diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-24 19:07:05 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-26 18:52:33 +0100 |
commit | d6b5f23bc389e1d7af0b69305708f59941dc34d1 (patch) | |
tree | 306c475e1156558515ed280929049e7f005639dc /tests/pos/test.scala | |
parent | f01071323516e699a169d89e5ac848215b6488c2 (diff) | |
download | dotty-d6b5f23bc389e1d7af0b69305708f59941dc34d1.tar.gz dotty-d6b5f23bc389e1d7af0b69305708f59941dc34d1.tar.bz2 dotty-d6b5f23bc389e1d7af0b69305708f59941dc34d1.zip |
Fixes to constraint handling.
In particular, need to unify polyparams before replacing one with the other, if the result wiould lead to a cyclic constraint.
Also: Avoid setting `inst` field of a type variable if a subtype operation is in progress, because the constraint might be retracted, and the instantiation should be retracted with it.
Third, tighter checks of cyclic constraint, and deep subtype recursions can now be demanded to cause an abort.
Diffstat (limited to 'tests/pos/test.scala')
-rw-r--r-- | tests/pos/test.scala | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/tests/pos/test.scala b/tests/pos/test.scala index 160efd3ad..edb644209 100644 --- a/tests/pos/test.scala +++ b/tests/pos/test.scala @@ -1,15 +1,7 @@ object test { + import scala.collection.breakOut - abstract class Tree[-T0 >: Null] - - trait TermTree[-T1 >: Null] extends Tree[T1] - - case class Literal[-T2 >: Null](x: Tree[T2]) extends /*Tree[T2] with*/ TermTree[T2] + def name(i: Int) = i.toString - def f[T >: Null](x: Tree[T]): Unit = { - def g(x: Tree[T]): Unit = () - x match { - case Literal(x) => g(x) - } - } + (0 until 10).map(name)(breakOut) }
\ No newline at end of file |