|
1 | 1 | -- [E164] Declaration Error: tests/neg/targetName-override.scala:16:35 ------------------------------------------------- |
| 2 | +error overriding method foo in class Alpha of type (): Int; |
| 3 | + method foo of type (): Int should not have a @targetName annotation since the overridden member hasn't one either |
| 4 | + 6 | def foo() = 1 |
| 5 | + | - |
| 6 | + | the overridden method is here |
| 7 | + 7 | |
| 8 | + 8 | @targetName("foo1") def foo(x: T): T |
| 9 | + 9 | |
| 10 | +10 | @targetName("append") def ++ (xs: Alpha[T]): Alpha[T] = this |
| 11 | +11 | |
| 12 | +12 |} |
| 13 | +13 | |
| 14 | +14 |class Beta extends Alpha[String] { // error: needs to be abstract |
| 15 | +15 | |
2 | 16 | 16 | @targetName("foo1") override def foo() = 1 // error: should not have a target name |
3 | 17 | | ^ |
4 | | - |error overriding method foo in class Alpha of type (): Int; |
5 | | - | method foo of type (): Int should not have a @targetName annotation since the overridden member hasn't one either |
| 18 | + | the overriding method should not have a @targetName annotation since the overridden member hasn't one either |
| 19 | + |
6 | 20 | -- [E164] Declaration Error: tests/neg/targetName-override.scala:18:25 ------------------------------------------------- |
| 21 | +error overriding method foo in class Alpha of type (x: String): String; |
| 22 | + method foo of type (x: String): String has a different target name annotation; it should be @targetName(foo1) |
| 23 | + 8 | @targetName("foo1") def foo(x: T): T |
| 24 | + | - |
| 25 | + | the overridden method is here |
| 26 | + 9 | |
| 27 | +10 | @targetName("append") def ++ (xs: Alpha[T]): Alpha[T] = this |
| 28 | +11 | |
| 29 | +12 |} |
| 30 | +13 | |
| 31 | +14 |class Beta extends Alpha[String] { // error: needs to be abstract |
| 32 | +15 | |
| 33 | +16 | @targetName("foo1") override def foo() = 1 // error: should not have a target name |
| 34 | +17 | |
7 | 35 | 18 | @targetName("baz") def foo(x: String): String = x ++ x // error: has a different target name annotation |
8 | 36 | | ^ |
9 | | - | error overriding method foo in class Alpha of type (x: String): String; |
10 | | - | method foo of type (x: String): String has a different target name annotation; it should be @targetName(foo1) |
| 37 | + | the overriding method has a different target name annotation; it should be @targetName(foo1) |
| 38 | + |
11 | 39 | -- [E164] Declaration Error: tests/neg/targetName-override.scala:20:15 ------------------------------------------------- |
| 40 | +error overriding method ++ in class Alpha of type (xs: Alpha[String]): Alpha[String]; |
| 41 | + method ++ of type (xs: Alpha[String]): Alpha[String] misses a target name annotation @targetName(append) |
| 42 | +10 | @targetName("append") def ++ (xs: Alpha[T]): Alpha[T] = this |
| 43 | + | - |
| 44 | + | the overridden method is here |
| 45 | +11 | |
| 46 | +12 |} |
| 47 | +13 | |
| 48 | +14 |class Beta extends Alpha[String] { // error: needs to be abstract |
| 49 | +15 | |
| 50 | +16 | @targetName("foo1") override def foo() = 1 // error: should not have a target name |
| 51 | +17 | |
| 52 | +18 | @targetName("baz") def foo(x: String): String = x ++ x // error: has a different target name annotation |
| 53 | +19 | |
12 | 54 | 20 | override def ++ (xs: Alpha[String]): Alpha[String] = this // error: misses a targetname annotation |
13 | 55 | | ^ |
14 | | - | error overriding method ++ in class Alpha of type (xs: Alpha[String]): Alpha[String]; |
15 | | - | method ++ of type (xs: Alpha[String]): Alpha[String] misses a target name annotation @targetName(append) |
| 56 | + | the overriding method misses a target name annotation @targetName(append) |
| 57 | + |
16 | 58 | -- Error: tests/neg/targetName-override.scala:14:6 --------------------------------------------------------------------- |
17 | 59 | 14 |class Beta extends Alpha[String] { // error: needs to be abstract |
18 | 60 | | ^^^^ |
|
0 commit comments