-
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 error reporting for missing members (#19800)
Fixes: #19731
- Loading branch information
Showing
3 changed files
with
48 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- Error: tests/neg/i19731.scala:4:6 ----------------------------------------------------------------------------------- | ||
4 |class F1 extends Foo: // error | ||
| ^ | ||
| class F1 needs to be abstract, since def foo(): Unit in class F1 is not defined | ||
-- Error: tests/neg/i19731.scala:7:6 ----------------------------------------------------------------------------------- | ||
7 |class F2 extends Foo: // error | ||
| ^ | ||
| class F2 needs to be abstract, since: | ||
| it has 2 unimplemented members. | ||
| /** As seen from class F2, the missing signatures are as follows. | ||
| * For convenience, these are usable as stub implementations. | ||
| */ | ||
| def foo(): Unit = ??? | ||
| def foo(x: Int): Unit = ??? | ||
-- Error: tests/neg/i19731.scala:16:6 ---------------------------------------------------------------------------------- | ||
16 |class B1 extends Bar: // error | ||
| ^ | ||
| class B1 needs to be abstract, since: | ||
| it has 2 unimplemented members. | ||
| /** As seen from class B1, the missing signatures are as follows. | ||
| * For convenience, these are usable as stub implementations. | ||
| */ | ||
| // Members declared in B1 | ||
| def foo(x: Int): Unit = ??? | ||
| | ||
| // Members declared in Bar | ||
| def foo(): Unit = ??? |
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,17 @@ | ||
trait Foo: | ||
def foo(): Unit | ||
|
||
class F1 extends Foo: // error | ||
def foo(): Unit | ||
|
||
class F2 extends Foo: // error | ||
def foo(): Unit | ||
def foo(x: Int): Unit | ||
|
||
|
||
trait Bar: | ||
def foo(): Unit | ||
def foo(x: Int): Unit | ||
|
||
class B1 extends Bar: // error | ||
def foo(x: Int): Unit |