diff options
Diffstat (limited to 'test/files')
-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 +} + |