diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/structural.check | 18 | ||||
-rw-r--r-- | test/files/neg/t0565.check | 2 | ||||
-rw-r--r-- | test/files/neg/t2144.check | 2 | ||||
-rw-r--r-- | test/files/neg/t6336.check | 7 | ||||
-rw-r--r-- | test/files/neg/t6336.scala | 1 |
5 files changed, 17 insertions, 13 deletions
diff --git a/test/files/neg/structural.check b/test/files/neg/structural.check index 6ef57db1b4..5b2f352a76 100644 --- a/test/files/neg/structural.check +++ b/test/files/neg/structural.check @@ -1,28 +1,28 @@ structural.scala:47: error: Parameter type in structural refinement may not refer to the type of that refinement (self type) val s1 = new { def f(p: this.type): Unit = () } - ^ + ^ structural.scala:10: error: Parameter type in structural refinement may not refer to an abstract type defined outside that refinement def f1[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: A): Object; val x: A }) = x.m[Tata](x.x) //fail - ^ + ^ structural.scala:11: error: Parameter type in structural refinement may not refer to an abstract type defined outside that refinement def f2[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: B): Object; val x: B }) = x.m[Tata](x.x) //fail - ^ + ^ structural.scala:12: error: Parameter type in structural refinement may not refer to an abstract type defined outside that refinement def f3[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: C): Object; val x: C }) = x.m[Tata](x.x) //fail - ^ + ^ structural.scala:13: error: Parameter type in structural refinement may not refer to a type member of that refinement def f4[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: D): Object; val x: D }) = x.m[Tata](x.x) //fail - ^ + ^ structural.scala:42: error: Parameter type in structural refinement may not refer to an abstract type defined outside that refinement type Summable[T] = { def +(v : T) : T } - ^ + ^ structural.scala:46: error: Parameter type in structural refinement may not refer to the type of that refinement (self type) type S1 = { def f(p: this.type): Unit } - ^ + ^ structural.scala:49: error: Parameter type in structural refinement may not refer to a type member of that refinement type S2 = { type T; def f(p: T): Unit } - ^ + ^ structural.scala:52: error: Parameter type in structural refinement may not refer to an abstract type defined outside that refinement def s3[U >: Null <: Object](p: { def f(p: U): Unit; def u: U }) = () - ^ + ^ 9 errors found diff --git a/test/files/neg/t0565.check b/test/files/neg/t0565.check index c5a64d0e53..98e61a2503 100644 --- a/test/files/neg/t0565.check +++ b/test/files/neg/t0565.check @@ -1,4 +1,4 @@ t0565.scala:8: error: Parameter type in structural refinement may not refer to a type member of that refinement def z (w : T) : T } = - ^ + ^ one error found diff --git a/test/files/neg/t2144.check b/test/files/neg/t2144.check index 7239f4406e..670e188c2a 100644 --- a/test/files/neg/t2144.check +++ b/test/files/neg/t2144.check @@ -1,4 +1,4 @@ t2144.scala:2: error: Parameter type in structural refinement may not refer to an abstract type defined outside that refinement def foo[A](a: A) = new { def bar(x: A): A = x } - ^ + ^ one error found diff --git a/test/files/neg/t6336.check b/test/files/neg/t6336.check index f6b35ad232..f70a5f70ab 100644 --- a/test/files/neg/t6336.check +++ b/test/files/neg/t6336.check @@ -1,4 +1,7 @@ t6336.scala:3: error: Parameter type in structural refinement may not refer to a user-defined value class val a = new { def y[T](x: X[T]) = x.i } - ^ -one error found + ^ +t6336.scala:4: error: Result type in structural refinement may not refer to a user-defined value class + val b = new { def y[T](x: T): X[T] = new X(2) } + ^ +two errors found diff --git a/test/files/neg/t6336.scala b/test/files/neg/t6336.scala index a9844ff94f..b1d61f4dd2 100644 --- a/test/files/neg/t6336.scala +++ b/test/files/neg/t6336.scala @@ -1,6 +1,7 @@ object D { def main(args: Array[String]) { val a = new { def y[T](x: X[T]) = x.i } + val b = new { def y[T](x: T): X[T] = new X(2) } val x = new X(3) val t = a.y(x) println(t) |