From f23ff3abba8663a0e7f64f79b556efd36cc86a83 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Thu, 29 Sep 2016 17:10:45 +0200 Subject: Improve positions for MemberDefs using `namePos` --- tests/neg/applydynamic_sip.scala | 6 +++--- tests/neg/assignments.scala | 2 +- tests/neg/dynamicApplyDynamicTest3.scala | 2 +- tests/neg/i1424.scala | 2 +- tests/neg/tailcall/t6574.scala | 2 +- tests/repl/errmsgs.check | 16 ++++++++-------- tests/repl/imports.check | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/neg/applydynamic_sip.scala b/tests/neg/applydynamic_sip.scala index 7b131e7ff..86cff5fc4 100644 --- a/tests/neg/applydynamic_sip.scala +++ b/tests/neg/applydynamic_sip.scala @@ -18,9 +18,9 @@ object Test extends App { } val bad1 = new Bad1 bad1.sel // error - bad1.sel(1) // error // error - bad1.sel(a = 1) // error // error - bad1.sel = 1 // error // error + bad1.sel(1) // error + bad1.sel(a = 1) // error + bad1.sel = 1 // error class Bad2 extends Dynamic { def selectDynamic = 1 diff --git a/tests/neg/assignments.scala b/tests/neg/assignments.scala index 5be107717..273419cb5 100644 --- a/tests/neg/assignments.scala +++ b/tests/neg/assignments.scala @@ -13,7 +13,7 @@ object assignments { x = x + 1 x *= 2 - x_= = 2 // error should give missing arguments + // error reassignment to val + x_= = 2 // error should give missing arguments } var c = new C diff --git a/tests/neg/dynamicApplyDynamicTest3.scala b/tests/neg/dynamicApplyDynamicTest3.scala index 61d3c9677..d68132b02 100644 --- a/tests/neg/dynamicApplyDynamicTest3.scala +++ b/tests/neg/dynamicApplyDynamicTest3.scala @@ -3,5 +3,5 @@ import scala.language.dynamics class Foo extends scala.Dynamic object DynamicTest { - new Foo().bazApply _ // error // error + new Foo().bazApply _ // error } diff --git a/tests/neg/i1424.scala b/tests/neg/i1424.scala index 3586260c1..8eba32842 100644 --- a/tests/neg/i1424.scala +++ b/tests/neg/i1424.scala @@ -1,3 +1,3 @@ class Test { - (x: Int) => x // error: not a legal self type clause // error: package x is not a value // error: package x is not a value + (x: Int) => x // error: not a legal self type clause // error: not found x } diff --git a/tests/neg/tailcall/t6574.scala b/tests/neg/tailcall/t6574.scala index d9ba2882d..462ef800f 100644 --- a/tests/neg/tailcall/t6574.scala +++ b/tests/neg/tailcall/t6574.scala @@ -4,7 +4,7 @@ class Bad[X, Y](val v: Int) extends AnyVal { println("tail") } - @annotation.tailrec final def differentTypeArgs : Unit = { // error + @annotation.tailrec final def differentTypeArgs: Unit = { // error {(); new Bad[String, Unit](0)}.differentTypeArgs // error } } diff --git a/tests/repl/errmsgs.check b/tests/repl/errmsgs.check index 2a65fd949..066d98d0f 100644 --- a/tests/repl/errmsgs.check +++ b/tests/repl/errmsgs.check @@ -1,34 +1,34 @@ scala> class Inv[T](x: T) defined class Inv scala> val x: List[String] = List(1) --- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- +-- [E007] Type Mismatch Error: ------------------------------------------------------------------------------- 4 |val x: List[String] = List(1) | ^ | found: Int(1) | required: String | scala> val y: List[List[String]] = List(List(1)) --- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- +-- [E007] Type Mismatch Error: ------------------------------------------------------------------------------- 4 |val y: List[List[String]] = List(List(1)) | ^ | found: Int(1) | required: String | scala> val z: (List[String], List[Int]) = (List(1), List("a")) --- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- +-- [E007] Type Mismatch Error: ------------------------------------------------------------------------------- 4 |val z: (List[String], List[Int]) = (List(1), List("a")) | ^ | found: Int(1) | required: String | --- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- +-- [E007] Type Mismatch Error: ------------------------------------------------------------------------------- 4 |val z: (List[String], List[Int]) = (List(1), List("a")) | ^^^ | found: String("a") | required: Int | scala> val a: Inv[String] = new Inv(new Inv(1)) --- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- +-- [E007] Type Mismatch Error: ------------------------------------------------------------------------------- 5 |val a: Inv[String] = new Inv(new Inv(1)) | ^^^^^ | found: Inv[T] @@ -36,7 +36,7 @@ scala> val a: Inv[String] = new Inv(new Inv(1)) | | where: T is a type variable with constraint >: Int(1) scala> val b: Inv[String] = new Inv(1) --- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- +-- [E007] Type Mismatch Error: ------------------------------------------------------------------------------- 5 |val b: Inv[String] = new Inv(1) | ^ | found: Int(1) @@ -57,7 +57,7 @@ scala> abstract class C { } } } --- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- +-- [E007] Type Mismatch Error: ------------------------------------------------------------------------------- 9 | var y: T = x | ^ | found: C.this.T(C.this.x) @@ -65,7 +65,7 @@ scala> abstract class C { | | where: T is a type in class C | T' is a type in the initalizer of value s which is an alias of String --- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- +-- [E007] Type Mismatch Error: ------------------------------------------------------------------------------- 13 | val z: T = y | ^ | found: T(y) diff --git a/tests/repl/imports.check b/tests/repl/imports.check index 9743d2b94..26b725637 100644 --- a/tests/repl/imports.check +++ b/tests/repl/imports.check @@ -7,7 +7,7 @@ defined module o scala> import o._ import o._ scala> buf += xs --- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- +-- [E007] Type Mismatch Error: ------------------------------------------------------------------------------- 11 |buf += xs | ^^ | found: scala.collection.immutable.List[Int](o.xs) -- cgit v1.2.3