You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/test-resources/repl/errmsgs
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,42 +1,50 @@
1
1
scala> class Inv[T](x: T)
2
2
// defined class Inv
3
3
scala> val x: List[String] = List(1)
4
+
-- Error:
4
5
1 | val x: List[String] = List(1)
5
6
| ^
6
7
| Found: (1 : Int)
7
8
| Required: String
8
9
scala> val y: List[List[String]] = List(List(1))
10
+
-- Error:
9
11
1 | val y: List[List[String]] = List(List(1))
10
12
| ^
11
13
| Found: (1 : Int)
12
14
| Required: String
13
15
scala> val z: (List[String], List[Int]) = (List(1), List("a"))
16
+
-- Error:
14
17
1 | val z: (List[String], List[Int]) = (List(1), List("a"))
15
18
| ^
16
19
| Found: (1 : Int)
17
20
| Required: String
21
+
-- Error:
18
22
1 | val z: (List[String], List[Int]) = (List(1), List("a"))
19
23
| ^^^
20
24
| Found: ("a" : String)
21
25
| Required: Int
22
26
scala> val a: Inv[String] = new Inv(new Inv(1))
27
+
-- Error:
23
28
1 | val a: Inv[String] = new Inv(new Inv(1))
24
29
| ^^^^^^^^^^
25
30
| Found: Inv[Int]
26
31
| Required: String
27
32
scala> val b: Inv[String] = new Inv(1)
33
+
-- Error:
28
34
1 | val b: Inv[String] = new Inv(1)
29
35
| ^
30
36
| Found: (1 : Int)
31
37
| Required: String
32
38
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() } }; }
39
+
-- Error:
33
40
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() } }; }
34
41
| ^
35
42
|Found: (C.this.x : C.this.T)
36
43
|Required: T²
37
44
|
38
45
|where: T is a type in class C
39
46
| T² is a type in the initializer of value s which is an alias of String
47
+
-- Error:
40
48
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() } }; }
41
49
| ^
42
50
|Found: (y : T)
@@ -45,27 +53,33 @@ scala> abstract class C { type T; val x: T; val s: Unit = { type T = String; var
45
53
|where: T is a type in the initializer of value s which is an alias of String
46
54
| T² is a type in method f which is an alias of Int
47
55
scala> class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
56
+
-- Error:
48
57
1 | class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
49
58
| ^^^^^^^^
50
59
| value barr is not a member of Foo - did you mean foo.bar?
51
60
scala> val x: List[Int] = "foo" :: List(1)
61
+
-- Error:
52
62
1 | val x: List[Int] = "foo" :: List(1)
53
63
| ^^^^^
54
64
| Found: ("foo" : String)
55
65
| Required: Int
56
66
scala> while ((( foo ))) {}
67
+
-- Error:
57
68
1 | while ((( foo ))) {}
58
69
| ^^^
59
70
| Not found: foo
60
71
scala> val a: iDontExist = 1
72
+
-- Error:
61
73
1 | val a: iDontExist = 1
62
74
| ^^^^^^^^^^
63
75
| Not found: type iDontExist
64
76
scala> def foo1(x: => Int) = x _
77
+
-- Error:
65
78
1 | def foo1(x: => Int) = x _
66
79
| ^^^
67
80
|Only function types can be followed by _ but the current expression has type Int
68
81
scala> def foo2(x: => Int): () => Int = x _
82
+
-- Error:
69
83
1 | def foo2(x: => Int): () => Int = x _
70
84
| ^^^
71
85
|Only function types can be followed by _ but the current expression has type Int
scala> object Lives { class Private { def foo1: Any = new Private.C1; def foo2: Any = new Private.C2 }; object Private { class C1 private {}; private class C2 {} } }
2
+
-- Error:
2
3
1 | object Lives { class Private { def foo1: Any = new Private.C1; def foo2: Any = new Private.C2 }; object Private { class C1 private {}; private class C2 {} } }
3
4
| ^^^^^^^^^^
4
5
|constructor C1 cannot be accessed as a member of Lives.Private.C1 from class Private.
0 commit comments