diff options
author | Martin Odersky <odersky@gmail.com> | 2016-06-29 19:35:24 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:35:00 +0200 |
commit | c136af18c1ff37663393e0ad738926776946679e (patch) | |
tree | 7720229e5b2b62b4ec33ac12805f1c56872e0a00 /src/dotty/tools/dotc/core/ConstraintHandling.scala | |
parent | d0f82a50bffc059803b56a341c8fcd9a238431f7 (diff) | |
download | dotty-c136af18c1ff37663393e0ad738926776946679e.tar.gz dotty-c136af18c1ff37663393e0ad738926776946679e.tar.bz2 dotty-c136af18c1ff37663393e0ad738926776946679e.zip |
Fixes to BetaReduce and asMemberOf; add a second betaReduce
The new one only reduces straight applications of type lambdas with
definite arguments. It is called very early on appliedTo, and derivedRefinedType.
The old one, now renamed to normalizeHkApply also handles wildcard arguments
and can garbage collect general unneeded hk-refinements. It is called later, at various
places.
TODO: See what functionality of normalizeHkApply should go into betaReduce instead.
Maybe we can even drop normalizeHkApply? However: need to be careful to maintain aliases
for hk type inference.
Handle LazyRefs in BetaReduce
Needs to be careful to not skip LazyRefs when dealiasing.
- Fix^2 of asMemberOf: This fix ensures that
- under the old hk scheme test succeeds for compilestdlib and tasty-new-all
- under the new scheme test succeeds for i94-nada (i.e. REP[T] = T).
- Try to beta-reduce bounds before adding to a constraint.
- More subtle handling of LazyRefs in BetaReduce
- Another refinement to asMemberOf
Need to assume lastSymbol in sync with lastDenotation.
- Drop isSafe test from BetaReduce
Instead, track the higherkinded argument names that a
type variable could potentially instantiate to.
Diffstat (limited to 'src/dotty/tools/dotc/core/ConstraintHandling.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/ConstraintHandling.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/ConstraintHandling.scala b/src/dotty/tools/dotc/core/ConstraintHandling.scala index f8eae186a..3b368ad5e 100644 --- a/src/dotty/tools/dotc/core/ConstraintHandling.scala +++ b/src/dotty/tools/dotc/core/ConstraintHandling.scala @@ -285,6 +285,8 @@ trait ConstraintHandling { if (!addParamBound(bound)) NoType else if (fromBelow) defn.NothingType else defn.AnyType + case bound: RefinedType => + bound.BetaReduce case _ => bound } |