Minimal support for dependent case classes #21698
Open
+229
−54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This lets us write:
Pattern matching works but isn't dependent yet:
(for my usecase this isn't a problem, I'm working on a type constraint API which lets me write things like
case class CC(a: Int, b: Int GreaterThan[a.type])
)Because case class pattern matching relies on the product selectors
_N
, making it dependent is a bit tricky, currently we generate:So the type of
_2
is not obviously related to the type of_1
, we probably need to change what we generate into:But this can be done in a separate PR.
Fixes #8073.