Fix #9759: Typing without -principal is broken in 4.11 and trunk#9765
Fix #9759: Typing without -principal is broken in 4.11 and trunk#9765garrigue wants to merge 4 commits intoocaml:trunkfrom
Conversation
|
The last commit removes the extra call to |
Changes
Outdated
| - #9695, #9702: no error when opening an alias to a missing module | ||
| (Jacques Garrigue, report and review by Gabriel Scherer) | ||
|
|
||
| - #9759: Typing without -principal is broken in 4.11 and trunk |
There was a problem hiding this comment.
The message is quite scary and generic for an issue that appeared between 4.00.0 and 4.01.0 .
|
If I understand #9759 correctly, the issue is not specific to 4.11 and trunk, the bug has been present in GADT-typing from the start. Looking at the use of
The |
|
Another question, are we sure that it was not possible to exploit the current lack of |
To be more precise, it is probably there since the introduction of ambivalence tracking. I don't remember quire whether it was already there in 4.00 or 4.01.
To clarify, here we are talking on of the expected type, which is a type whose structure may be at
Indeed. While this is correct from the point of view of levels (assuming that the fresh type is a
This seems the right way to do it, even if it may cause a bit more duplication.
Since we want to exploit the generic levels inside |
What is the direction of this question? |
|
Since the changelog entry is in 4.11, and we are at the end of the beta cycle, I am mostly asking if we are absolutely certain that this change cannot break any code that compile today even if the code is kind of invalid and only accidentally compiles. |
|
Then I would say this is highly improbable. This would certainly have to rely on a bug somewhere else: in a normal situation, this use of |
|
I agree: I believe the patch is safe enough to go in 4.11 if we want. (And if it did break code somehow, it would be code that is wrong and can be fixed; knowing about it later in the 4.11 release cycle is not as good as earlier, but not worse than waiting for 4.12 to find out.) On the other hand, given that the bug is very old, personally I would not bother integrating it in the release pipeline; if I was release manager I would just ignore it to make my life easier. |
|
I don't really see the point of this PR actually / of merging this in 4.11. I'd vote for closing it. |
|
I want just to make sure there is no misunderstanding. |
|
As I understand it this doesn't fix the bug, it fixes part of the bug (which is fully fixed by #9767). And I don't believe this part of the bug is more critical than the others or that it should be fixed first. |
|
Since there seems to be an agreement that there is no need to merge this and 4.11, and #9767 is better for 4.12, I close this one. |
Quick fix for #9759:
type_expectmay modify the expected type in non-principalmode, so usecorrect_levelsbefore calling it intype_cases.It might be better ultimately to fully review the way
ty_expectedis used, including its semantics, but this would be a much bigger change.