diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t0764.check | 2 | ||||
-rw-r--r-- | test/files/neg/t0842.check | 4 | ||||
-rwxr-xr-x | test/files/neg/t0842.scala | 1 | ||||
-rwxr-xr-x | test/files/pos/t0872.scala | 8 |
4 files changed, 14 insertions, 1 deletions
diff --git a/test/files/neg/t0764.check b/test/files/neg/t0764.check index b622f17c5e..9f0cedc69b 100644 --- a/test/files/neg/t0764.check +++ b/test/files/neg/t0764.check @@ -1,5 +1,5 @@ t0764.scala:13: error: type mismatch; - found : java.lang.Object with Node{type T = _1.type} where val _1: Main.this.AType + found : java.lang.Object with Node{type T = _1.type} where val _1: Node{type T = NextType} required: Node{type T = Main.this.AType} new Main[AType]( (value: AType).prepend ) ^ diff --git a/test/files/neg/t0842.check b/test/files/neg/t0842.check new file mode 100644 index 0000000000..5f88f08194 --- /dev/null +++ b/test/files/neg/t0842.check @@ -0,0 +1,4 @@ +t0842.scala:1: error: A.this.type does not take type parameters +trait A[T] { def m: this.type[T] = this }
+ ^ +one error found diff --git a/test/files/neg/t0842.scala b/test/files/neg/t0842.scala new file mode 100755 index 0000000000..f32c2ba26d --- /dev/null +++ b/test/files/neg/t0842.scala @@ -0,0 +1 @@ +trait A[T] { def m: this.type[T] = this } diff --git a/test/files/pos/t0872.scala b/test/files/pos/t0872.scala new file mode 100755 index 0000000000..8f4c1c4436 --- /dev/null +++ b/test/files/pos/t0872.scala @@ -0,0 +1,8 @@ +object Main { + def main(args : Array[String]) { + val fn = (a : Int, str : String) => "a: " + a + ", str: " + str + implicit def fx[T](f : (T,String) => String) = (x:T) => f(x,null) + println(fn(1)) + () + } +} |