-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
ICE: Generic type alias to invalid type crashes during type check on latest stable #62742
Comments
Backtrace:
|
This started ICE-ing in 1.27. The first nightly where it's present seems to be Backtrace on nightly-2018-04-28
The range of commits between the previous nightly and this one is 7f3444e to 686d0ae. It contains, in reverse chronological order:
In particular #48995 may be related, "a new canonical trait query for update: made the commit range shorter |
visiting for triage: @nikomatsakis do you plan to investigate or delegate in near term? |
nominating for reassignment. |
I can look at it, although maybe @tmandry might be a good fit, too. |
OK, I put some work into investigation here. I at least see what is going wrong, and actually the fix I suspect is a refactoring that I've been considering for some time, but which I think has been blocked on getting rid of the leak-check (so cc #65232). The problem is that, the way our type checker works, when we have a subtyping relationship Now the problem is that when we do our canonicalization, even though OK, so then we go and apply that result to our actual variables. But remember that we had a subtyping relationship between
which together implies that As it happens, we (sort of) detect this when we are "generalizing" Here are some of the solutions I think we could do here:
I think I favor the second half. I've been steadily trying to maneuver our type system implementation into a combination of two things:
The current "sub relations" list is basically a third bullet, and it's kind of a special case of the pending obligations. The ICE we're seeing here is precisely arising because of the "canonicalization" system assumes that it can treat unbound variables as independent things from one another. Right now, we can't because of these implicit links due to subtyping. |
This also crashes on the latest nightly
playground
The text was updated successfully, but these errors were encountered: