-
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.
Report only non-overridden unimplemented members
Previously, when a concrete class A had unimplemented members that are overridden, all overrides would be reported as unimplemented in the error message. This would produce error messages that are not accurate, and that suggest stubs that are not correct. This patch fixes the issue by reporting in the error message only the unimplemented members that are not overridden by other unimplemented members. Fixes #21335 [Cherry-picked 0d50a30]
- Loading branch information
1 parent
b093ae8
commit cc37466
Showing
3 changed files
with
31 additions
and
1 deletion.
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,8 @@ | ||
-- Error: tests/neg/i21335.scala:7:6 ----------------------------------------------------------------------------------- | ||
7 |class Z1 extends Bar1 // error | ||
| ^ | ||
| class Z1 needs to be abstract, since override def bar(): Bar1 in trait Bar1 is not defined | ||
-- Error: tests/neg/i21335.scala:12:6 ---------------------------------------------------------------------------------- | ||
12 |class Z2 extends Bar2 // error | ||
| ^ | ||
| class Z2 needs to be abstract, since def bar(): Bar2 in trait Bar2 is not defined |
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,12 @@ | ||
trait Foo: | ||
def bar(): Foo | ||
|
||
trait Bar1 extends Foo: | ||
override def bar(): Bar1 | ||
|
||
class Z1 extends Bar1 // error | ||
|
||
trait Bar2 extends Foo: | ||
def bar(): Bar2 | ||
|
||
class Z2 extends Bar2 // error |