-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Direct representation of higher-kinded types #1343
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
Changes from 1 commit
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
5866d0d
Allow refinements of new types
odersky d30f441
Allow general recursion in refined types.
odersky 5d03186
Better printing of skolems
odersky cdb4a1c
New type lambda scheme for hk types
odersky 850dc6f
Introduce recursive types
odersky af43d32
Abstract type parameters out from type symbols
odersky aa7f66d
Disable checkInst in RecType
odersky 08a0ea6
Add printing of type lambda trees
odersky 178e90e
Remove special case in parser
odersky 4bf43f8
Turn on new hk scheme
odersky 5daae27
Multiple fixes
odersky e56bd1f
Beta-reduce when simplifying
odersky e61b80a
Refinement of cycle avoidance
odersky a7d61c0
Make etaExpandIfHk work for non-symbol type params
odersky d0f82a5
Don't map info of SkolemTypes in type maps
odersky c136af1
Fixes to BetaReduce and asMemberOf; add a second betaReduce
odersky ae1f248
Normalize RecTypes on creation to avoid cycles.
odersky 939d9da
Add a second betaReduce
odersky c35f817
Adapt widenForMatchSelector to new HK scheme
odersky e36a36a
Fix typeParams for abstract types under completion
odersky 6a7e466
Avoid accidental creation of hk types
odersky 8e84fb0
Eta-expand unapplied types that have type parameters
odersky 68e73e8
Restrict betaReduce to hk applications
odersky 463e99a
Optionally, check kinds match for & and |
odersky 0a5f839
Avoid infinite recursion when comparing recursive types.
odersky 31af865
Fix condition for lambda abstracting in Namer
odersky 5041e93
Make TypeAccumulators follow LazyRefs
odersky f1bf78b
Avoid creating dependent function types for closures
odersky 830b724
Change tests
odersky 6414f3b
Deal with nested findMember calls over the same RecType
odersky e749d83
Various tweaks
odersky d1f809f
Remove old hk scheme
odersky 60d81f8
Start new, direct HK scheme
odersky 3490e01
Make Constraint#bounds work for aliases
odersky f6efd99
Fix appliedTo and typeParams, and higher kinded subtyping tests
odersky 97e84e6
Fix printing of type lambda trees and types
odersky 73dd039
Various hk related fixes in types
odersky 02ce995
Refactoring of PolyType and TypeLambda
odersky c28dd1b
Tweaks to appliedTo
odersky c1e27a0
Change underlying of HKApply
odersky 98b466c
Ensure wildApprox maintains kinds
odersky 0965e1a
Handle TypeLambdas in findMember
odersky 65c26ba
Avoid cyclic errors when reading nsc.Global
odersky 1e48758
Refactor handling of unpickled type params
odersky 960ea75
Allow for HK types in widenForMatchSelector
odersky e0db04d
Drop bounds checking for type lambdas
odersky de5d8fe
Skip typeBounds when computing upperBound
odersky 8805dd4
When comparing types revert eta-expansion as needed
odersky 646bf97
Beta-reduce with wildcard arguments if this is safe.
odersky 09f7ab1
Handle findMember for unreduced hk types.
odersky 9a90e81
Handle WildcardType in liftToClasses
odersky dca1052
Don't make * types higher-kinded in avoid
odersky 4093e13
Don't dealias when applying types
odersky bb59931
Fixes to hk comparisons
odersky dc5be65
Special case for TypeRefs in upperbound
odersky 31ecad5
Drop assertion in TypeMap
odersky 9d9965c
Fix parameter unpickling
odersky a23c1a4
Fixes for printing under -Ytest-pickler
odersky 6bd7ba9
Remove refinement encoding of hk types
odersky ae360e9
Handle signatures over uninstantiated type variables
odersky 6abde38
Get rid of BindingKind
odersky 68abba1
Simplify appliedTo
odersky 30e15ab
Cleanup of Signature matching
odersky b6a8bc7
Revert complications in asMemberOf
odersky 32c0135
Refactorings of GenericTypes and underlying/upperbound
odersky 34a068b
Drop Config.checkKinds
odersky beff8f8
Avoid orphan parameters in Constraint#replace
odersky eebb4b0
Fix bug in printing untyped New nodes.
odersky fd62c7b
Disallow higher-kinded types that simulate general existential types
odersky 4693a78
Less eager removal of type parameters from constraint
odersky 2ddb849
Unify aliases when taking a lub.
odersky c541ef9
Do the right thing for NoDenotation.mapInfo
odersky 78b2672
Add a case where caching was missing.
odersky 223705d
Refactor Typevar instantiation
odersky 5e90215
Drop compareAliasedRefined
odersky 540b38c
More tests
odersky a200695
Fix SI-2712
odersky 6d7bc49
Address reviewers comments
odersky 055726e
ExtractAPI: Do not miss value parameters of PolyTypes
smarter a6a142e
ExtractAPI: Add support for TypeLambdas
smarter 1792c9e
ExtractAPI: Add support for RecType
smarter cdebd91
Allow definition of new types in refinements
odersky 84a1a7a
Avoid dealiasing on type application
odersky c7f3b45
Drop restriction to 2nd order hk types
odersky 7df0fa5
Enable test for fixed #1181: Typer should preserve aliases in TypeTrees
smarter 1443fd4
Optimize hk comparisons
odersky f50cb20
Make rewritings of hk applications configurable
odersky 0ff5354
Simplify variance computations
odersky 18b3080
Allow hk parameters in lower bounds
odersky 82fc27f
Fix bounds checking of hk applied typed
odersky a737b47
Add test case for hk bounds checking
odersky 894c9fb
Bounds of type lambdas compare contravariantly
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
When comparing types revert eta-expansion as needed
The problem is that some existential types read from Java (and Scala as well? not sure) appear as naked typerefs. They consequently get expanded via eta expansion to type lambdas. This commit compensates for this by collapsing an eta expansion if this can make a subtype tests succeed or a union or intersection be legal. Also, take hk types into account for liftToClasses Needs to special-treat TypeLambda and HKApply since otherwise we risk creating malformed And-types.
- Loading branch information
commit 8805dd4f821e06a688fcf492b61033fe0992e752
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
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.
Should this be
pbound match? Otherwise I don't get what's going on here, a comment would help