diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t6988.check | 7 | ||||
-rw-r--r-- | test/files/neg/t6988.scala | 10 | ||||
-rw-r--r-- | test/files/neg/t8325-b.check | 10 | ||||
-rw-r--r-- | test/files/neg/t8325-b.scala | 4 | ||||
-rw-r--r-- | test/files/neg/t8325-c.check | 7 | ||||
-rw-r--r-- | test/files/neg/t8325-c.scala | 4 | ||||
-rw-r--r-- | test/files/neg/t8325.check | 15 | ||||
-rw-r--r-- | test/files/neg/t8325.scala | 11 |
8 files changed, 68 insertions, 0 deletions
diff --git a/test/files/neg/t6988.check b/test/files/neg/t6988.check new file mode 100644 index 0000000000..acb7b3cb08 --- /dev/null +++ b/test/files/neg/t6988.check @@ -0,0 +1,7 @@ +t6988.scala:3: error: annotation argument needs to be a constant; found: 13.asInstanceOf[Long] +@SerialVersionUID(13.asInstanceOf[Long]) case class IdentifyMessage1(userName: String, user: User, code: Int) + ^ +t6988.scala:8: error: annotation argument needs to be a constant; found: O.SerialUID +@SerialVersionUID(O.SerialUID) case class IdentifyMessage3(userName: String, user: User, code: Int) + ^ +two errors found diff --git a/test/files/neg/t6988.scala b/test/files/neg/t6988.scala new file mode 100644 index 0000000000..8171dc9dd0 --- /dev/null +++ b/test/files/neg/t6988.scala @@ -0,0 +1,10 @@ +case class User() + +@SerialVersionUID(13.asInstanceOf[Long]) case class IdentifyMessage1(userName: String, user: User, code: Int) +@SerialVersionUID(13l) case class IdentifyMessage2(userName: String, user: User, code: Int) +object O { + val SerialUID = "13".toLong +} +@SerialVersionUID(O.SerialUID) case class IdentifyMessage3(userName: String, user: User, code: Int) + + diff --git a/test/files/neg/t8325-b.check b/test/files/neg/t8325-b.check new file mode 100644 index 0000000000..ec80826dc0 --- /dev/null +++ b/test/files/neg/t8325-b.check @@ -0,0 +1,10 @@ +t8325-b.scala:3: error: Unmatched closing brace '}' ignored here + def k(is: Int*} = ??? + ^ +t8325-b.scala:3: error: ';' expected but '=' found. + def k(is: Int*} = ??? + ^ +t8325-b.scala:4: error: eof expected but '}' found. +} +^ +three errors found diff --git a/test/files/neg/t8325-b.scala b/test/files/neg/t8325-b.scala new file mode 100644 index 0000000000..6ac78708bb --- /dev/null +++ b/test/files/neg/t8325-b.scala @@ -0,0 +1,4 @@ + +trait Test { + def k(is: Int*} = ??? +} diff --git a/test/files/neg/t8325-c.check b/test/files/neg/t8325-c.check new file mode 100644 index 0000000000..51ea4988a6 --- /dev/null +++ b/test/files/neg/t8325-c.check @@ -0,0 +1,7 @@ +t8325-c.scala:3: error: identifier expected but ')' found. + def k(xx: Int`*`) = ??? + ^ +t8325-c.scala:4: error: ')' expected but '}' found. +} +^ +two errors found diff --git a/test/files/neg/t8325-c.scala b/test/files/neg/t8325-c.scala new file mode 100644 index 0000000000..076202df3f --- /dev/null +++ b/test/files/neg/t8325-c.scala @@ -0,0 +1,4 @@ + +trait Test { + def k(xx: Int`*`) = ??? +} diff --git a/test/files/neg/t8325.check b/test/files/neg/t8325.check new file mode 100644 index 0000000000..175a0db415 --- /dev/null +++ b/test/files/neg/t8325.check @@ -0,0 +1,15 @@ +t8325.scala:5: error: *-parameter must come last + def f(is: Int*, s: String) = ??? + ^ +t8325.scala:7: error: *-parameter must come last + def h(is: Int * String *, s: String) = ??? + ^ +t8325.scala:10: error: type mismatch; + found : Int(5) + required: Int* + def j(is: Int* = 5) = ??? + ^ +t8325.scala:10: error: a parameter section with a `*'-parameter is not allowed to have default arguments + def j(is: Int* = 5) = ??? + ^ +four errors found diff --git a/test/files/neg/t8325.scala b/test/files/neg/t8325.scala new file mode 100644 index 0000000000..3813797e83 --- /dev/null +++ b/test/files/neg/t8325.scala @@ -0,0 +1,11 @@ + +trait Test { + type OK[A,B] = A Tuple2 B + type *[A,B] = A Tuple2 B + def f(is: Int*, s: String) = ??? + def g(is: Int * String, s: String) = ??? // OK + def h(is: Int * String *, s: String) = ??? + // won't recover from following + //def i(is: Int OK) = ??? //error: identifier expected but ')' found. + def j(is: Int* = 5) = ??? +} |