diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/bug391.check | 16 | ||||
-rw-r--r-- | test/files/neg/bug391.scala | 6 | ||||
-rw-r--r-- | test/files/neg/bug588.check | 13 | ||||
-rwxr-xr-x | test/files/neg/bug588.scala | 15 |
4 files changed, 50 insertions, 0 deletions
diff --git a/test/files/neg/bug391.check b/test/files/neg/bug391.check new file mode 100644 index 0000000000..57b3f5d565 --- /dev/null +++ b/test/files/neg/bug391.check @@ -0,0 +1,16 @@ +bug391.scala:2 error: identifier expected but 'def' found. + def fun1(def x: Int): Int = x; // the "def x" is illegal + ^ +bug391.scala:3 error: ':' expected but '}' found. + def fun2(val x: Int): Int = x; // the "val x" is illegal + ^ +bug391.scala:4 error: illegal start of simple expression +} +^ +bug391.scala:6 error: identifier expected but 'def' found. +class E(def x: Int); // the "def x" is illegal + ^ +bug391.scala:6 error: ':' expected but eof found. +class E(def x: Int); // the "def x" is illegal + ^ +5 errors found diff --git a/test/files/neg/bug391.scala b/test/files/neg/bug391.scala new file mode 100644 index 0000000000..08c083baa5 --- /dev/null +++ b/test/files/neg/bug391.scala @@ -0,0 +1,6 @@ +trait C { + def fun1(def x: Int): Int = x; // the "def x" is illegal + def fun2(val x: Int): Int = x; // the "val x" is illegal +} + +class E(def x: Int); // the "def x" is illegal diff --git a/test/files/neg/bug588.check b/test/files/neg/bug588.check new file mode 100644 index 0000000000..02a9b9c482 --- /dev/null +++ b/test/files/neg/bug588.check @@ -0,0 +1,13 @@ +/home/odersky/scala/test/files/pos/bug588.scala:3 error: double definition: +method visit:((scala.Int) => java.lang.String)scala.Boolean and +method visit:((scala.Int) => scala.Unit)scala.Boolean at line 2 +have same type after erasure: (scala.Function1)scala.Boolean + def visit(f: int => String): boolean
+ ^ +/home/odersky/scala/test/files/pos/bug588.scala:10 error: double definition: +method f:(Test.this.TypeB)scala.Unit and +method f:(Test.this.TypeA)scala.Unit at line 9 +have same type after erasure: (Test#TraitA)scala.Unit + def f(brac : TypeB) : Unit;
+ ^ +two errors found diff --git a/test/files/neg/bug588.scala b/test/files/neg/bug588.scala new file mode 100755 index 0000000000..bbb79ed79e --- /dev/null +++ b/test/files/neg/bug588.scala @@ -0,0 +1,15 @@ +abstract class Test0 { + def visit(f: int => unit): boolean + def visit(f: int => String): boolean +} +trait Test { + type TypeA <: TraitA; + type TypeB <: TypeA with TraitB; + + def f(node : TypeA) : Unit; + def f(brac : TypeB) : Unit; + + trait TraitA; + trait TraitB; + +} |