Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the idents of the predefined type constructors (such as int, char) persistent or global #6750

Closed
vicuna opened this issue Jan 13, 2015 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Jan 13, 2015

Original bug ID: 6750
Reporter: oleg
Status: acknowledged (set by @damiendoligez on 2015-02-19T17:23:24Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.02.1
Target version: later
Category: typing
Monitored by: @ygrek @hcarty

Bug description

Currently, the identifiers of predefined exceptions are defined
to be global identifiers (with the global flag set): see the code
for builtin_values at the end of typing/predef.ml. However, identifiers
such as "int", "char" and other builtin type constructors are not
distinguished in any way. Is there a reason for that?

MetaOCaml has to know if a type is defined in the current
compilation unit or in other units (or is pervasive). If the type
is defined in the current unit, it can be redefined, and so we cannot
use its name (without the time stamp) reliably. If the name of the type
is qualified, it is easy to determine if it is ``external'' -- I just
have to check if the top-most module name is a persistent identifier.
If the type name is unqualified (such as int), I have to search the
initial environment. It would be much nicer just to check the global
flag and avoid any searches.

@vicuna vicuna added the typing label Mar 14, 2019
@trefis
Copy link
Contributor

trefis commented Mar 15, 2019

Fixed as part of #1980.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants