-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve missing argument list error (#17126)
Fixes #17123
- Loading branch information
Showing
13 changed files
with
187 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
-- Error: tests/neg/i16820.scala:5:11 ---------------------------------------------------------------------------------- | ||
-- [E178] Type Error: tests/neg/i16820.scala:5:11 ---------------------------------------------------------------------- | ||
5 | val x1 = f // error | ||
| ^ | ||
| missing arguments for method f in object Test | ||
| missing argument list for method f in object Test | ||
| | ||
| def f(xs: Int*): Int | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E100] Syntax Error: tests/neg/i16820.scala:6:11 -------------------------------------------------------------------- | ||
6 | val x2 = g // error | ||
| ^ | ||
| method g in object Test must be called with () argument | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- Error: tests/neg/i16820.scala:7:40 ---------------------------------------------------------------------------------- | ||
-- [E178] Type Error: tests/neg/i16820.scala:7:40 ---------------------------------------------------------------------- | ||
7 | val x3 = java.nio.file.Paths.get(".").toRealPath // error | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| missing arguments for method toRealPath in trait Path | ||
-- Error: tests/neg/i16820.scala:11:14 --------------------------------------------------------------------------------- | ||
| missing argument list for method toRealPath in trait Path | ||
| | ||
| def toRealPath(x$0: java.nio.file.LinkOption*): java.nio.file.Path | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i16820.scala:11:14 --------------------------------------------------------------------- | ||
11 |def test = Foo(3) // error | ||
| ^^^^^^ | ||
| missing arguments for method apply in object Foo | ||
| missing argument list for method apply in object Foo | ||
| | ||
| def apply(x: Int)(xs: String*): Foo | ||
| | ||
| longer explanation available when compiling with `-explain` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
-- [E100] Syntax Error: tests/neg/i17123.scala:7:2 --------------------------------------------------------------------- | ||
7 | m1 // error | ||
| ^^ | ||
| method m1 in object ConfusingErrorMessage must be called with () argument | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i17123.scala:9:2 ----------------------------------------------------------------------- | ||
9 | m2 // error | ||
| ^^ | ||
| missing argument list for method m2 in object ConfusingErrorMessage | ||
| | ||
| def m2()(): Unit | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i17123.scala:10:4 ---------------------------------------------------------------------- | ||
10 | m2() // error | ||
| ^^^^ | ||
| missing argument list for method m2 in object ConfusingErrorMessage | ||
| | ||
| def m2()(): Unit | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i17123.scala:11:2 ---------------------------------------------------------------------- | ||
11 | m3 // error | ||
| ^^ | ||
| missing argument list for method m3 in object ConfusingErrorMessage | ||
| | ||
| def m3()()(): Unit | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i17123.scala:12:4 ---------------------------------------------------------------------- | ||
12 | m3() // error | ||
| ^^^^ | ||
| missing argument list for method m3 in object ConfusingErrorMessage | ||
| | ||
| def m3()()(): Unit | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i17123.scala:13:6 ---------------------------------------------------------------------- | ||
13 | m3()() // error | ||
| ^^^^^^ | ||
| missing argument list for method m3 in object ConfusingErrorMessage | ||
| | ||
| def m3()()(): Unit | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i17123.scala:15:2 ---------------------------------------------------------------------- | ||
15 | f3 // error | ||
| ^^ | ||
| missing argument list for method f3 in object ConfusingErrorMessage | ||
| | ||
| def f3()(i: Int)(): Unit | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i17123.scala:16:2 ---------------------------------------------------------------------- | ||
16 | f3() // error | ||
| ^^^^ | ||
| missing argument list for method f3 in object ConfusingErrorMessage | ||
| | ||
| def f3()(i: Int)(): Unit | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i17123.scala:17:6 ---------------------------------------------------------------------- | ||
17 | f3()(2) // error | ||
| ^^^^^^^ | ||
| missing argument list for method f3 in object ConfusingErrorMessage | ||
| | ||
| def f3()(i: Int)(): Unit | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i17123.scala:19:2 ---------------------------------------------------------------------- | ||
19 | i3 // error | ||
| ^^ | ||
| missing argument list for method i3 in object ConfusingErrorMessage | ||
| | ||
| def i3()(using d: DummyImplicit)(): Unit | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E178] Type Error: tests/neg/i17123.scala:20:2 ---------------------------------------------------------------------- | ||
20 | i3() // error | ||
| ^^^^ | ||
| missing argument list for method i3 in object ConfusingErrorMessage | ||
| | ||
| def i3()(using d: DummyImplicit)(): Unit | ||
| | ||
| longer explanation available when compiling with `-explain` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
object ConfusingErrorMessage { | ||
def m1() = () | ||
def m2()() = () | ||
def m3()()() = () | ||
def f3()(i: Int)() = () | ||
def i3()(using d: DummyImplicit)() = () | ||
m1 // error | ||
m1() | ||
m2 // error | ||
m2() // error | ||
m3 // error | ||
m3() // error | ||
m3()() // error | ||
m3()()() | ||
f3 // error | ||
f3() // error | ||
f3()(2) // error | ||
f3()(2)() | ||
i3 // error | ||
i3() // error | ||
i3()() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
object A { | ||
def f()(>) = ??? // error | ||
import f.NonExistent // error | ||
import f.NonExistent | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters