diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t1960.check | 11 | ||||
-rw-r--r-- | test/files/neg/t1960.scala | 7 | ||||
-rw-r--r-- | test/files/pos/issue244.scala | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/test/files/neg/t1960.check b/test/files/neg/t1960.check index de0907b4a9..bb6d3d3548 100644 --- a/test/files/neg/t1960.check +++ b/test/files/neg/t1960.check @@ -1,4 +1,7 @@ -t1960.scala:5: error: parameter 'p' requires field but conflicts with variable p in trait TBase -class Aclass (p: Int) extends TBase { def g() { f(p) } } - ^ -one error found +t1960.scala:2: error: parameter 'vr' requires field but conflicts with variable vr in trait T +class C(vr: Int, vl: Int) extends T { def ref = vr + vl } + ^ +t1960.scala:2: error: parameter 'vl' requires field but conflicts with value vl in trait T +class C(vr: Int, vl: Int) extends T { def ref = vr + vl } + ^ +two errors found diff --git a/test/files/neg/t1960.scala b/test/files/neg/t1960.scala index 5311940b5a..f4fdb341c6 100644 --- a/test/files/neg/t1960.scala +++ b/test/files/neg/t1960.scala @@ -1,5 +1,2 @@ -object ClassFormatErrorExample extends App { new Aclass(1) } - -trait TBase { var p:Int = 0; def f(p1: Int) {} } - -class Aclass (p: Int) extends TBase { def g() { f(p) } } +trait T { var vr: Int = 0 ; val vl: Int = 0 } +class C(vr: Int, vl: Int) extends T { def ref = vr + vl } diff --git a/test/files/pos/issue244.scala b/test/files/pos/issue244.scala new file mode 100644 index 0000000000..f9189c9313 --- /dev/null +++ b/test/files/pos/issue244.scala @@ -0,0 +1,2 @@ +trait T { lazy val overloaded: String = "a" } +class C extends T { def overloaded(a: String): String = "b" } |