Skip to content
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

Support GADT reasoning over path-dependent types #13364

Closed
wants to merge 15 commits into from

Conversation

Linyxus
Copy link
Contributor

@Linyxus Linyxus commented Aug 23, 2021

This PR enables GADT reasoning over path-dependent types. Specifically, it adds to the GadtConstraint the functionality to register path-dependent types and record bounds for them.

The following code will not type-check before this PR:

trait Expr[+T]
case class LitInt(x: Int) extends Expr[Int]

trait Tag { type T }

def f(p: Tag, e: Expr[p.T]): p.T = e match
  case LitInt(x) => x

Note that this PR does not add handling for type member reasoning in pattern matching. This will be added in a future PR.

@Linyxus
Copy link
Contributor Author

Linyxus commented Aug 23, 2021

test performance please

@dottybot
Copy link
Member

performance test scheduled: 7 job(s) in queue, 1 running.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit https://dotty-bench.epfl.ch/13364/ to see the changes.

Benchmarks is based on merging with master (dd7a07a)

@Linyxus
Copy link
Contributor Author

Linyxus commented Sep 2, 2021

test performance please

@Linyxus
Copy link
Contributor Author

Linyxus commented Oct 12, 2021

Working directly on the full support (in #13475)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants