Skip to content

Commit 2c88bb5

Browse files
committed
Adapt check files
1 parent 46bb161 commit 2c88bb5

4 files changed

+10
-16
lines changed
+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
-- [E151] Syntax Error: tests/neg/extension-cannot-have-type.scala:3:10 ------------------------------------------------
1+
-- Error: tests/neg/extension-cannot-have-type.scala:3:10 --------------------------------------------------------------
22
3 | def f[U](u: U): T = ??? // error : extension method cannot have type params
33
| ^
4-
| Extension method cannot have type parameters since some were already given previously
5-
6-
longer explanation available when compiling with `-explain`
4+
| extension method cannot have type parameters since some were already given previously
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
-- [E150] Syntax Error: tests/neg/extension-method-not-allowed.scala:3:8 -----------------------------------------------
1+
-- Error: tests/neg/extension-method-not-allowed.scala:3:8 -------------------------------------------------------------
22
3 | def (c: T).f: T = ??? // error : No extension method allowed here
33
| ^^^^^^^^^^^^^^^^^^^^^
4-
| No extension method allowed here, since collective parameters are given
5-
6-
longer explanation available when compiling with `-explain`
4+
| no extension method allowed here since leading parameter was already given
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
-- [E152] Syntax Error: tests/neg/extensions-can-only-have-defs.scala:3:8 ----------------------------------------------
1+
-- Error: tests/neg/extensions-can-only-have-defs.scala:3:8 ------------------------------------------------------------
22
3 | val v: T = ??? // error : extensions can only have defs
33
| ^^^^^^^^^^^^^^
4-
| Only methods allowed here, since collective parameters are given
5-
6-
longer explanation available when compiling with `-explain`
4+
| extension clause can only define methods

tests/neg/i6900.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ object Test2 {
44
extension on [A](a: A):
55
def foo[C]: C => A = _ => a // error: extension method cannot have type parameters
66

7-
1.foo.foo // error: foo is undefined
7+
1.foo.foo
88

99
// ... but have to pass 2 parameters
10-
1.foo.foo[Any => Int, String] // error: foo is undefined
11-
1.foo[Int, String].foo // error: foo is undefined
12-
1.foo[Int, String].foo[String => Int, String] // error: foo is undefined
10+
1.foo.foo[Any => Int, String]
11+
1.foo[Int, String].foo
12+
1.foo[Int, String].foo[String => Int, String]
1313

1414
}
1515

0 commit comments

Comments
 (0)