From aa559359bb55729913d34588462542f10c42e147 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 21 Sep 2016 10:09:13 +0200 Subject: Refactor explanation interpolator --- tests/repl/errmsgs.check | 61 +++++++++++++++++++++++------------------------- tests/repl/imports.check | 8 +++---- 2 files changed, 33 insertions(+), 36 deletions(-) (limited to 'tests') diff --git a/tests/repl/errmsgs.check b/tests/repl/errmsgs.check index d8c1b9215..8f86aac08 100644 --- a/tests/repl/errmsgs.check +++ b/tests/repl/errmsgs.check @@ -1,48 +1,47 @@ scala> class Inv[T](x: T) defined class Inv scala> val x: List[String] = List(1) --- Error: ------------------------------------------------------------ +-- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- 3:val x: List[String] = List(1) ^ - type mismatch: found: Int(1) required: String + scala> val y: List[List[String]] = List(List(1)) --- Error: ------------------------------------------------------------ +-- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- 3:val y: List[List[String]] = List(List(1)) ^ - type mismatch: found: Int(1) required: String + scala> val z: (List[String], List[Int]) = (List(1), List("a")) --- Error: ------------------------------------------------------------ +-- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- 3:val z: (List[String], List[Int]) = (List(1), List("a")) ^ - type mismatch: found: Int(1) required: String --- Error: ------------------------------------------------------------ + +-- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- 3:val z: (List[String], List[Int]) = (List(1), List("a")) - ^ - type mismatch: + ^^^ found: String("a") required: Int + scala> val a: Inv[String] = new Inv(new Inv(1)) --- Error: ------------------------------------------------------------ +-- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- 4:val a: Inv[String] = new Inv(new Inv(1)) - ^^^^ - type mismatch: - found: Inv[T] - required: String - - where T is a type variable with constraint >: Int(1) + ^^^^^ + found: Inv[T] + required: String + + T is a type variable with constraint >: Int(1) scala> val b: Inv[String] = new Inv(1) --- Error: ------------------------------------------------------------ +-- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- 4:val b: Inv[String] = new Inv(1) ^ - type mismatch: found: Int(1) required: String + scala> abstract class C { type T val x: T @@ -58,22 +57,20 @@ scala> abstract class C { } } } --- Error: ------------------------------------------------------------ +-- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- 8: var y: T = x ^ - type mismatch: - found: C.this.T(C.this.x) - required: T' - - where T is a type in class C - T' is a type in the initalizer of value s which is an alias of String --- Error: ------------------------------------------------------------ + found: C.this.T(C.this.x) + required: T + + 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: ------------------------------------------------------------------------------- 12: val z: T = y ^ -type mismatch: -found: T(y) -required: T' - -where T is a type in the initalizer of value s which is an alias of String - T' is a type in method f which is an alias of Int + found: T(y) + required: T + + T is a type in the initalizer of value s which is an alias of String + T' is a type in method f which is an alias of Int scala> :quit diff --git a/tests/repl/imports.check b/tests/repl/imports.check index f9e48c011..2e8d5dcf9 100644 --- a/tests/repl/imports.check +++ b/tests/repl/imports.check @@ -7,18 +7,18 @@ defined module o scala> import o._ import o._ scala> buf += xs --- Error: ------------------------------------------------------------ +-- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- 10:buf += xs ^^ - type mismatch: found: scala.collection.immutable.List[Int](o.xs) required: String --- Error: ------------------------------------------------------------ + +-- [E006] Type Mismatch Error: ------------------------------------------------------------------------------- 10:buf += xs ^^^^^^^^^ - type mismatch: found: String required: scala.collection.mutable.ListBuffer[Int] + scala> buf ++= xs res1: scala.collection.mutable.ListBuffer[Int] = ListBuffer(1, 2, 3) scala> :quit -- cgit v1.2.3