-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Adding full support of path-dependent GADT reasoning #13475
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
Conversation
…pdgadt-structural
Currently some tests will break. We will fix them. Let's test performance first. |
test performance please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully: Visit https://dotty-bench.epfl.ch/13475/ to see the changes. Benchmarks is based on merging with master (a82a1a6) |
This is a really cool improvement but I'm a bit concerned that we're expanding the support for GADT when there is one known GADT soundness bug: #13080, in particular is it possible that this PR could lead to this soundness bug being triggered in more situations? |
@smarter I don't think this risks introducing any additional injectivity problems. Indeed, working with type members eschews the whole injectivity issue – while inferring constraints from PS: There is at least one other known GADT bug: #11545, though I suspect there are many more, due to the way GADT reasoning is currently implemented. |
This reverts commit 4665bd2.
This PR was left without any activity for too long and so will be closed. If you want to return to it, please feel free to reopen it and start the discussion anew. |
Following PR #13364, this PR adds full support of path-dependent GADT reasoning. Compared to the previous one, this one will perform GADT reasoning on pattern's and scrutinee's type members, bringing richer GADT bounds.
The following shows a code snippet made possible by this PR.
I removed the pos test i2941 (https://github.com/lampepfl/dotty/blob/master/tests/pos/i2941.scala) because it will trigger infinite type comparison after this PR, and we investigated and found out that the problem originates from TypeComparer, but found no good solution for this issue.