diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-21 08:14:51 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-21 08:14:51 -0700 |
commit | 08334b0721d6040d61a727702b718fb3f3d558d2 (patch) | |
tree | 3cd49ce3a383cfda20eab1780f1ed5365ad1dc6b /test | |
parent | 1f5584fbe183041d4af269278f0125e2f0b94a44 (diff) | |
parent | f5c1fb91a2b352dde8c55ed9db7981a5945bbd13 (diff) | |
download | scala-08334b0721d6040d61a727702b718fb3f3d558d2.tar.gz scala-08334b0721d6040d61a727702b718fb3f3d558d2.tar.bz2 scala-08334b0721d6040d61a727702b718fb3f3d558d2.zip |
Merge pull request #576 from axel22/issue/4717
Fix SI-4717: lazy val declared inside an anonymous class inside a specialized
context no longer crashes Duplicators.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t4717.scala | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/files/pos/t4717.scala b/test/files/pos/t4717.scala new file mode 100644 index 0000000000..4acfe489cc --- /dev/null +++ b/test/files/pos/t4717.scala @@ -0,0 +1,35 @@ + + + + + + + +trait Bug1[@specialized(Boolean) A] extends TraversableOnce[A] { + + def ++[B >: A](that: TraversableOnce[B]): Iterator[B] = new Iterator[B] { + lazy val it = that.toIterator + def hasNext = it.hasNext + def next = it.next + } + +} + + + +trait WorksFine[@specialized(Boolean) A] { + class SubBounds[B >: A] extends Bounds[B] { + lazy val it = ??? + } + def x[B >: A]: Unit = new SubBounds[B] +} + + +trait Bounds[@specialized(Boolean) A] { + // okay without `>: A` + def x[B >: A]: Unit = new Bounds[B] { + lazy val it = ??? // def or val okay + } +} + + |