-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Guard against opaques crashing the compiler #19541
Conversation
One possibility would be to merge ElimOpaque with erasure. It's a tiny phase. I am not sure anything between ElimOpaque and Erasure depends on the fact that opaque aliases are now aliases. So far no phase declares that it needs to run after ElimOpaque but that's of course no guarantee that there are no dependencies. |
I could see that fixing this case, seeing as the code branch is run in |
d7ad0c6
to
c14daff
Compare
e34ed90
to
7c2f0a5
Compare
How do we deal with |
Hmm. Maybe we have to leave ElimOpaque where it is since it seems to upset quite a few assumptions afterwards. We should document in the relevant phases that they have to run after ElimOpaque. That means that match type reduction has to cope with this somehow. One trick we could play is to refuse to normalize match types after ElimOpaque. Instead, time-travel to the ElimOpaque phase and do the reduction there. Or else treat normal aliases like opaque aliases, if the symbol has Opaque set before ElimOpaque. Not sure whether the second one is safe, though. |
7c2f0a5
to
3b8dee8
Compare
I didn't quite understand what you meant here. Could you explain again what you think we should try? Currently I'm just phase travelling to typer. |
My take on that idea is that we could try an I'm not sure whether that's sound TBH. |
Can't make that work. It fails Ycheck. |
Fixes #19434