scala> class Inv[T](x: T) defined class Inv scala> val x: List[String] = List(1) -- [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)) -- [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")) -- [E007] Type Mismatch Error: --------------------------------------- 4 |val z: (List[String], List[Int]) = (List(1), List("a")) | ^ | found: Int(1) | required: String | -- [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)) -- [E007] Type Mismatch Error: --------------------------------------- 5 |val a: Inv[String] = new Inv(new Inv(1)) | ^^^^^ | found: Inv[T] | required: String | | where: T is a type variable with constraint >: Int(1) scala> val b: Inv[String] = new Inv(1) -- [E007] Type Mismatch Error: --------------------------------------- 5 |val b: Inv[String] = new Inv(1) | ^ | found: Int(1) | required: String | scala> abstract class C { type T val x: T val s: Unit = { type T = String var y: T = x locally { def f() = { type T = Int val z: T = y } f() } } } -- [E007] Type Mismatch Error: --------------------------------------- 9 | var y: T = x | ^ |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 -- [E007] Type Mismatch Error: --------------------------------------- 13 | val z: T = y | ^ |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 scala> class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr -- [E008] Member Not Found Error: ------------------------------------ 4 |class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr | ^^^^^^^^ | value `barr` is not a member of Foo(foo) - did you mean `foo.bar`? scala> :quit