diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/structural.check | 6 | ||||
-rw-r--r-- | test/files/pos/NoCyclicReference.scala | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/test/files/neg/structural.check b/test/files/neg/structural.check index a0342c4d9c..3a4a627b26 100644 --- a/test/files/neg/structural.check +++ b/test/files/neg/structural.check @@ -1,6 +1,9 @@ structural.scala:3: error: illegal dependent method type def f(x: { type D; def m: D }) = x.m ^ +structural.scala:19: error: illegal dependent method type + def f9[C <: AnyRef](x: AnyRef{ type D <: AnyRef; def m[E >: Null <: AnyRef](x: AnyRef): D }) = x.m[Tata](()) //suceed + ^ structural.scala:10: error: Parameter type in structural refinement may not refer to abstract type defined outside that same refinement def f1[C <: AnyRef](x: AnyRef{ type D <: AnyRef; def m[E >: Null <: AnyRef](x: A): AnyRef; val x: A }) = x.m[Tata](x.x) //fail ^ @@ -10,9 +13,6 @@ structural.scala:11: error: Parameter type in structural refinement may not refe structural.scala:12: error: Parameter type in structural refinement may not refer to abstract type defined outside that same refinement def f3[C <: AnyRef](x: AnyRef{ type D <: AnyRef; def m[E >: Null <: AnyRef](x: C): AnyRef; val x: C }) = x.m[Tata](x.x) //fail ^ -structural.scala:19: error: illegal dependent method type - def f9[C <: AnyRef](x: AnyRef{ type D <: AnyRef; def m[E >: Null <: AnyRef](x: AnyRef): D }) = x.m[Tata](()) //suceed - ^ structural.scala:42: error: Parameter type in structural refinement may not refer to abstract type defined outside that same refinement type Summable[T] = { def +(v : T) : T } ^ diff --git a/test/files/pos/NoCyclicReference.scala b/test/files/pos/NoCyclicReference.scala new file mode 100644 index 0000000000..e42896661e --- /dev/null +++ b/test/files/pos/NoCyclicReference.scala @@ -0,0 +1,7 @@ +package test + +trait Iterable[+A] { self => + + type CC[B] <: Iterable[B] { type CC[C] = self.CC[C] } + +} |