diff options
author | Geoffrey Washburn <geoffrey.washburn@epfl.ch> | 2008-09-05 14:25:05 +0000 |
---|---|---|
committer | Geoffrey Washburn <geoffrey.washburn@epfl.ch> | 2008-09-05 14:25:05 +0000 |
commit | fa8d0d8d853cebdfa33552ca2f66c229b6d39f2d (patch) | |
tree | a626126927ae5f7c1933689bdfcf290d239064fe /test/files/pos | |
parent | d0eb6ae1a2a6136ed90d7cbab0efcacc4cd4c337 (diff) | |
download | scala-fa8d0d8d853cebdfa33552ca2f66c229b6d39f2d.tar.gz scala-fa8d0d8d853cebdfa33552ca2f66c229b6d39f2d.tar.bz2 scala-fa8d0d8d853cebdfa33552ca2f66c229b6d39f2d.zip |
Added support for -Yrecursion compiler flag.
Added two tests involving this flag.
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/comp-rec-test.flags | 1 | ||||
-rw-r--r-- | test/files/pos/comp-rec-test.scala | 24 | ||||
-rw-r--r-- | test/files/pos/proj-rec-test.flags | 1 | ||||
-rw-r--r-- | test/files/pos/proj-rec-test.scala | 13 |
4 files changed, 39 insertions, 0 deletions
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 +} + |