summaryrefslogtreecommitdiff
path: root/test/files/run/reflection-mem-typecheck.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/reflection-mem-typecheck.scala')
-rw-r--r--test/files/run/reflection-mem-typecheck.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/files/run/reflection-mem-typecheck.scala b/test/files/run/reflection-mem-typecheck.scala
new file mode 100644
index 0000000000..a312c2c893
--- /dev/null
+++ b/test/files/run/reflection-mem-typecheck.scala
@@ -0,0 +1,26 @@
+import scala.tools.partest.MemoryTest
+
+trait A { type T <: A }
+trait B { type T <: B }
+
+object Test extends MemoryTest {
+ lazy val tb = {
+ import scala.reflect.runtime.universe._
+ import scala.reflect.runtime.{currentMirror => cm}
+ import scala.tools.reflect.ToolBox
+ cm.mkToolBox()
+ }
+
+ override def maxDelta = 10
+ override def calcsPerIter = 8
+ override def calc() {
+ var snippet = """
+ trait A { type T <: A }
+ trait B { type T <: B }
+ def foo[T](x: List[T]) = x
+ foo(List(new A {}, new B {}))
+ """.trim
+ snippet = snippet + "\n" + (List.fill(50)(snippet.split("\n").last) mkString "\n")
+ tb.typeCheck(tb.parse(snippet))
+ }
+} \ No newline at end of file