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
compiler forcing aliases it shouldn't while reporting type errors #7134
Comments
Comment author: @garrigue I'm not sure what to do here. |
Comment author: @garrigue Oh, wait a minute. Does the problem only occur with -short-paths? |
Comment author: @sliquister Yeah, I think it's only with short-paths and -no-alias-deps, otherwise modules can't even alias modules they don't depend on. |
Comment author: @sliquister This bites people occasionally. Instead of finding every place in the typer that might be forcing aliases to compilation units that the input program doesn't use, how about:
This assumes the typer doesn't have legitimate reasons to load compilation units that weren't loaded at the time the type error was found. Not sure if this is true. |
Comment author: @sliquister Oops, I meant the ref defaults to true and would be set to false for error reporting. |
Comment author: @sliquister Alternatively, I think (haven't tested) that something like #682 would allow to change the way we build to not produce these forward references anymore. The idea would be that instead of creating, for each library, a module aliasing all the modules of the library, and make every module of the library open the aliases module, I would have a preprocessor that would create just the aliases a given module needs. (and this would also require a similar feature in signatures: open sig .. end) |
Comment author: @garrigue #7134#c16151 makes sense to me. Your workaround might work, but we don't want to force all users to use such an approach. |
Comment author: @garrigue By the way, Frédéric Bour was supposed to change the way -short-paths works. |
Comment author: @sliquister The tip of the feature is broken because the second commit sets the boolean to true instead of false, effectively doing nothing.
I haven't tested the problem that made me create this PR, I'm going to try now if it's not too hard. |
Comment author: @sliquister I reproduced the bug from February, and this one also gives a type error instead of inconsistent assumptions with this change. I wonder if the fix from #6812 is still necessary, with this. |
Comment author: @sliquister I checked the reproduction from #6812 with 4.02.1 (inconsistent assumptions) and 4.02.1 + this patch (the expected type error). |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Looks like it was fixed. |
Original bug ID: 7134
Reporter: @sliquister
Assigned to: @garrigue
Status: assigned (set by @sliquister on 2016-08-23T17:07:39Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.02.3
Target version: undecided
Category: typing
Related to: #6812 #7751
Bug description
This is a similar problem to #6812, the compiler reads cmis it shouldn't, resulting in inconsistent assumptions. But if the cmi doesn't exist, the compiler doesn't read it and so succeeds (at giving a type error).
Stack trace at the moment when the wrong cmi is read (lib__C.cmi in the example below):
The text was updated successfully, but these errors were encountered: