-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add match type #4964
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
Merged
Merged
Add match type #4964
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
9ef3898
Add MatchType as a type form
odersky 1c17274
Represent literals used as types with SingletonTypeTrees
odersky 24a2f73
Syntax, parsing, and type-checking of match types
odersky 6d472f5
Fix unpickling of match types
odersky 0877a36
Blacklist match type fromtasty test
odersky bd8b3cd
Classify type defs with matches as RHS as abstract
odersky 993c40c
Implement subtyping for match types
odersky 151a37c
Cache match reduce results
odersky ffac30e
Cache results of attempts to reduce match types
odersky e2d8bc3
Use a special type for match aliases
odersky b261ff7
Applications of erased functions are always pure
odersky a144c35
Allow user-defined error diagnostics when rewriting
odersky 5147d32
Fix two issues when comparing match types
odersky fb5c554
MatchType reorg
odersky 400495f
Typelevel natural numbers
odersky 3d3d595
Reduce matches on creation
odersky 38312e0
Handle MatchTypeTrees in ExtractAPI
odersky a9f9ced
Refine matchtype reduction caching
odersky 2408b54
Coarser variance checking for match types
odersky 7a51259
Add constValue function
odersky dc669a6
Add NonEmptyTuple abstract class
odersky d924ef1
More precise derivesFrom for MatchTypes
odersky 0d4a118
Base Tuple computations on types
odersky 189973b
Make MatchTypes value types
odersky 8307685
Fix inlining of parameters of singleton type
odersky 8219a83
Test tuples2 needs to run with -Yno-deep-subtypes
odersky 56759c8
Add constValueOpt method
odersky 45fbf3e
Fix unpickling of match type aliases
odersky e41bf9a
Survive bottom values in pattern matches
odersky 2d83885
Report rewrite errors at outermost rewrite call
odersky b53bf1e
Harden Tuple operations against wrong inputs
odersky 71fbc15
Reduce sizes of tuples of tuples2.scala
odersky 2d76382
Allow additional arguments for typelevel.error
odersky 10f2acb
GenericSignatures needs to consult erasedToObject
odersky 03f5c4e
Properly erase NonEmptyTuple
odersky 3657799
Make Tuple types covariant
odersky d53b3fa
Allow generic tuple operations to be dynamic
odersky a7ea105
Equate TupleN(...) and *: types
odersky 9897d22
Description and informal spec for match types
odersky 7a0c31f
Fix typo
odersky 0ca095f
Add related work section to match-types.md
odersky 194d85d
Fix matchtype termination
odersky c7ee07c
Fix `Elem` method for sizes > 23
odersky 00de2f8
Print max constraint under -Ydetailed-stats
odersky c51a2c0
Normalize when simplifying
odersky 16d1856
Propagate bound into nested match types
odersky 536c350
Match cases in parallel
odersky 5a8ac63
Update rules on match term/type checking
odersky 7b548db
Go back to reducing match types sequentially
odersky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use a special type for match aliases
This is a more principled implementation of the situation that match aliases are not full type aliases because one side cannot be freely substituted for the other. Match aliases are checked in some respects like abstract type bounds (in particular, nested cycles are allowed), but are treated as aliases in others (in particular, lower and upper "bound" are always guaranteed to be the same).
- Loading branch information
commit e2d8bc35591817e27aba472af7bf1ff5ee24b02b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this check be performed in
TypeBounds
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have a constructor in TypeBounds. Maybe we need a refactoring, I am not sure. Anyway at the moment MatchType as whole needs more work but this will be in future PRs.