diff options
author | Martin Odersky <odersky@gmail.com> | 2016-06-29 19:41:36 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:35:01 +0200 |
commit | 6a7e466fa2ff5d6d01a25bed0c685188c9a84a63 (patch) | |
tree | 332b0156ebe12c76ec2eafd1529f969442736262 /src/dotty/tools/dotc/core/ConstraintHandling.scala | |
parent | e36a36a5aea93c19aa133ffb215bc05787378375 (diff) | |
download | dotty-6a7e466fa2ff5d6d01a25bed0c685188c9a84a63.tar.gz dotty-6a7e466fa2ff5d6d01a25bed0c685188c9a84a63.tar.bz2 dotty-6a7e466fa2ff5d6d01a25bed0c685188c9a84a63.zip |
Avoid accidental creation of hk types
- Swap subtype tests
Previous order could create constraints where hk type parameters
got a * bound. (this is now caught in an assert).
- Make underlyingClassRef work for hk types under new scheme.
- Ensure that toAvoid does not creat hk from * types
- Let getClass return a * type
We will be pickier than before. An unapplied type such as
`java.lang.Class` will always be an hk type. Hence, the type
of getClass has to be appleid to [_] to make it a * type.
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 8072a111a..e7b05af43 100644 --- a/src/dotty/tools/dotc/core/ConstraintHandling.scala +++ b/src/dotty/tools/dotc/core/ConstraintHandling.scala @@ -239,6 +239,8 @@ trait ConstraintHandling { def addParamBound(bound: PolyParam) = if (fromBelow) addLess(bound, param) else addLess(param, bound) + assert(param.isHK == bound.isHK, s"$param / $bound / $fromBelow") + /** Drop all constrained parameters that occur at the toplevel in `bound` and * handle them by `addLess` calls. * The preconditions make sure that such parameters occur only |