@@ -6,45 +6,57 @@ scala> val x: List[String] = List(1)
6
6
| ^
7
7
| Found: (1 : Int)
8
8
| Required: String
9
- longer explanation available when compiling with `-explain`
9
+ |-----------------------------------------------------------------------------
10
+ | longer explanation available when compiling with `-explain`
11
+ ·-----------------------------------------------------------------------------
10
12
1 error found
11
13
scala> val y: List[List[String]] = List(List(1))
12
14
-- [E007] Type Mismatch Error: -------------------------------------------------
13
15
1 | val y: List[List[String]] = List(List(1))
14
16
| ^
15
17
| Found: (1 : Int)
16
18
| Required: String
17
- longer explanation available when compiling with `-explain`
19
+ |-----------------------------------------------------------------------------
20
+ | longer explanation available when compiling with `-explain`
21
+ ·-----------------------------------------------------------------------------
18
22
1 error found
19
23
scala> val z: (List[String], List[Int]) = (List(1), List("a"))
20
24
-- [E007] Type Mismatch Error: -------------------------------------------------
21
25
1 | val z: (List[String], List[Int]) = (List(1), List("a"))
22
26
| ^
23
27
| Found: (1 : Int)
24
28
| Required: String
25
- longer explanation available when compiling with `-explain`
29
+ |-----------------------------------------------------------------------------
30
+ | longer explanation available when compiling with `-explain`
31
+ ·-----------------------------------------------------------------------------
26
32
-- [E007] Type Mismatch Error: -------------------------------------------------
27
33
1 | val z: (List[String], List[Int]) = (List(1), List("a"))
28
34
| ^^^
29
35
| Found: ("a" : String)
30
36
| Required: Int
31
- longer explanation available when compiling with `-explain`
37
+ |-----------------------------------------------------------------------------
38
+ | longer explanation available when compiling with `-explain`
39
+ ·-----------------------------------------------------------------------------
32
40
2 errors found
33
41
scala> val a: Inv[String] = new Inv(new Inv(1))
34
42
-- [E007] Type Mismatch Error: -------------------------------------------------
35
43
1 | val a: Inv[String] = new Inv(new Inv(1))
36
44
| ^^^^^^^^^^
37
45
| Found: Inv[Int]
38
46
| Required: String
39
- longer explanation available when compiling with `-explain`
47
+ |-----------------------------------------------------------------------------
48
+ | longer explanation available when compiling with `-explain`
49
+ ·-----------------------------------------------------------------------------
40
50
1 error found
41
51
scala> val b: Inv[String] = new Inv(1)
42
52
-- [E007] Type Mismatch Error: -------------------------------------------------
43
53
1 | val b: Inv[String] = new Inv(1)
44
54
| ^
45
55
| Found: (1 : Int)
46
56
| Required: String
47
- longer explanation available when compiling with `-explain`
57
+ |-----------------------------------------------------------------------------
58
+ | longer explanation available when compiling with `-explain`
59
+ ·-----------------------------------------------------------------------------
48
60
1 error found
49
61
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() } }; }
50
62
-- [E007] Type Mismatch Error: -------------------------------------------------
@@ -55,7 +67,9 @@ scala> abstract class C { type T; val x: T; val s: Unit = { type T = String; var
55
67
|
56
68
|where: T is a type in class C
57
69
| T² is a type in the initializer of value s which is an alias of String
58
- longer explanation available when compiling with `-explain`
70
+ |-----------------------------------------------------------------------------
71
+ | longer explanation available when compiling with `-explain`
72
+ ·-----------------------------------------------------------------------------
59
73
-- [E007] Type Mismatch Error: -------------------------------------------------
60
74
1 | 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() } }; }
61
75
| ^
@@ -64,7 +78,9 @@ longer explanation available when compiling with `-explain`
64
78
|
65
79
|where: T is a type in the initializer of value s which is an alias of String
66
80
| T² is a type in method f which is an alias of Int
67
- longer explanation available when compiling with `-explain`
81
+ |-----------------------------------------------------------------------------
82
+ | longer explanation available when compiling with `-explain`
83
+ ·-----------------------------------------------------------------------------
68
84
2 errors found
69
85
scala> class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
70
86
-- [E008] Not Found Error: -----------------------------------------------------
@@ -78,33 +94,43 @@ scala> val x: List[Int] = "foo" :: List(1)
78
94
| ^^^^^
79
95
| Found: ("foo" : String)
80
96
| Required: Int
81
- longer explanation available when compiling with `-explain`
97
+ |-----------------------------------------------------------------------------
98
+ | longer explanation available when compiling with `-explain`
99
+ ·-----------------------------------------------------------------------------
82
100
1 error found
83
101
scala> while ((( foo ))) {}
84
102
-- [E006] Not Found Error: -----------------------------------------------------
85
103
1 | while ((( foo ))) {}
86
104
| ^^^
87
105
| Not found: foo
88
- longer explanation available when compiling with `-explain`
106
+ |-----------------------------------------------------------------------------
107
+ | longer explanation available when compiling with `-explain`
108
+ ·-----------------------------------------------------------------------------
89
109
1 error found
90
110
scala> val a: iDontExist = 1
91
111
-- [E006] Not Found Error: -----------------------------------------------------
92
112
1 | val a: iDontExist = 1
93
113
| ^^^^^^^^^^
94
114
| Not found: type iDontExist
95
- longer explanation available when compiling with `-explain`
115
+ |-----------------------------------------------------------------------------
116
+ | longer explanation available when compiling with `-explain`
117
+ ·-----------------------------------------------------------------------------
96
118
1 error found
97
119
scala> def foo1(x: => Int) = x _
98
120
-- [E099] Syntax Error: --------------------------------------------------------
99
121
1 | def foo1(x: => Int) = x _
100
122
| ^^^
101
123
|Only function types can be followed by _ but the current expression has type Int
102
- longer explanation available when compiling with `-explain`
124
+ |-----------------------------------------------------------------------------
125
+ | longer explanation available when compiling with `-explain`
126
+ ·-----------------------------------------------------------------------------
103
127
1 error found
104
128
scala> def foo2(x: => Int): () => Int = x _
105
129
-- [E099] Syntax Error: --------------------------------------------------------
106
130
1 | def foo2(x: => Int): () => Int = x _
107
131
| ^^^
108
132
|Only function types can be followed by _ but the current expression has type Int
109
- longer explanation available when compiling with `-explain`
133
+ |-----------------------------------------------------------------------------
134
+ | longer explanation available when compiling with `-explain`
135
+ ·-----------------------------------------------------------------------------
110
136
1 error found
0 commit comments