From fa8d0d8d853cebdfa33552ca2f66c229b6d39f2d Mon Sep 17 00:00:00 2001 From: Geoffrey Washburn Date: Fri, 5 Sep 2008 14:25:05 +0000 Subject: Added support for -Yrecursion compiler flag. Added two tests involving this flag. --- test/files/pos/comp-rec-test.flags | 1 + test/files/pos/comp-rec-test.scala | 24 ++++++++++++++++++++++++ test/files/pos/proj-rec-test.flags | 1 + test/files/pos/proj-rec-test.scala | 13 +++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 test/files/pos/comp-rec-test.flags create mode 100644 test/files/pos/comp-rec-test.scala create mode 100644 test/files/pos/proj-rec-test.flags create mode 100644 test/files/pos/proj-rec-test.scala (limited to 'test') diff --git a/test/files/pos/comp-rec-test.flags b/test/files/pos/comp-rec-test.flags new file mode 100644 index 0000000000..ad928f52a0 --- /dev/null +++ b/test/files/pos/comp-rec-test.flags @@ -0,0 +1 @@ +-Yrecursion 1 diff --git a/test/files/pos/comp-rec-test.scala b/test/files/pos/comp-rec-test.scala new file mode 100644 index 0000000000..eaf12942c7 --- /dev/null +++ b/test/files/pos/comp-rec-test.scala @@ -0,0 +1,24 @@ +object Comp extends Application { + + trait Family { + type T + } + + object Trivial extends Family { + type T = Unit + } + + trait Wrap extends Family { + val v : Family + type T = v.T + } + + object WrapTrivial extends Wrap { + val v = Trivial + } + + object WrapWrapTrivial extends Wrap { + val v = WrapTrivial + } + +} diff --git a/test/files/pos/proj-rec-test.flags b/test/files/pos/proj-rec-test.flags new file mode 100644 index 0000000000..ad928f52a0 --- /dev/null +++ b/test/files/pos/proj-rec-test.flags @@ -0,0 +1 @@ +-Yrecursion 1 diff --git a/test/files/pos/proj-rec-test.scala b/test/files/pos/proj-rec-test.scala new file mode 100644 index 0000000000..b7efcf3e8d --- /dev/null +++ b/test/files/pos/proj-rec-test.scala @@ -0,0 +1,13 @@ +object ProjTest { + trait MInt { type Type } + trait _0 extends MInt { type Type = Boolean } + trait Succ[Pre <: MInt] extends MInt { type Type = Pre#Type } + + type _1 = Succ[_0] + type _2 = Succ[_1] + + type X1 = _0#Type // Ok + type X2 = _1#Type // Ok + type X3 = _2#Type // Compiler error, illegal cyclic reference involving type Type +} + -- cgit v1.2.3