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
Some usability improvements relating to errors (#23370)
The changes in this PR were motivated by a very nice live coding session
of Nicolas Rinaudo at the Scala User's group meetup in Krakow. We
identified 4 areas where the feed-back of the compiler could be clearer:
1. Trying to add a capture set to a pure type, such as in `Int^` should
give an error.
2. Don't complain about inferred type not conforming to external type if
the definition in question is in the empty package. Improve the error
message for the remaining definitions.
4. Don't show expected types as dependent function types if they were
generic function types originally
5. Don't print "box" unless we are in -Ycc-verbose mode.
Copy file name to clipboardExpand all lines: tests/neg-custom-args/captures/boundschecks3.check
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,31 @@
1
1
-- [E057] Type Mismatch Error: tests/neg-custom-args/captures/boundschecks3.scala:9:11 ---------------------------------
2
2
9 | val foo: C[Tree^] = ??? // error
3
3
| ^
4
-
| Type argument box test.Tree^ does not conform to upper bound test.Tree in inferred type test.C[box test.Tree^]
4
+
| Type argument test.Tree^ does not conform to upper bound test.Tree in inferred type test.C[test.Tree^]
5
5
|
6
-
| where: ^ refers to the universal root capability
6
+
| where: ^ refers to the universal root capability
7
7
|
8
8
| longer explanation available when compiling with `-explain`
9
9
-- [E057] Type Mismatch Error: tests/neg-custom-args/captures/boundschecks3.scala:10:11 --------------------------------
10
10
10 | type T = C[Tree^] // error
11
11
| ^
12
-
| Type argument box test.Tree^ does not conform to upper bound test.Tree in inferred type test.C[box test.Tree^]
12
+
| Type argument test.Tree^ does not conform to upper bound test.Tree in inferred type test.C[test.Tree^]
13
13
|
14
-
| where: ^ refers to the universal root capability
14
+
| where: ^ refers to the universal root capability
15
15
|
16
16
| longer explanation available when compiling with `-explain`
17
17
-- [E057] Type Mismatch Error: tests/neg-custom-args/captures/boundschecks3.scala:11:11 --------------------------------
18
18
11 | val bar: T -> T = ??? // error
19
19
| ^
20
-
|Type argument box test.Tree^ does not conform to upper bound test.Tree in subpart test.C[box test.Tree^] of inferred type test.C[box test.Tree^] -> test.C[box test.Tree^]
20
+
|Type argument test.Tree^ does not conform to upper bound test.Tree in subpart test.C[test.Tree^] of inferred type test.C[test.Tree^] -> test.C[test.Tree^]
21
21
|
22
22
|where: ^ refers to the universal root capability
23
23
|
24
24
| longer explanation available when compiling with `-explain`
25
25
-- [E057] Type Mismatch Error: tests/neg-custom-args/captures/boundschecks3.scala:12:11 --------------------------------
26
26
12 | val baz: C[Tree^] -> Unit = ??? // error
27
27
| ^
28
-
|Type argument box test.Tree^ does not conform to upper bound test.Tree in subpart test.C[box test.Tree^] of inferred type test.C[box test.Tree^] -> Unit
28
+
|Type argument test.Tree^ does not conform to upper bound test.Tree in subpart test.C[test.Tree^] of inferred type test.C[test.Tree^] -> Unit
0 commit comments