Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14527 from dotty-staging/fix-14415
Don't skip override tests when overridden is AbsOverride
- Loading branch information
Showing
3 changed files
with
32 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,5 @@ | ||
-- [E164] Declaration Error: tests/neg/i14415.scala:21:6 --------------------------------------------------------------- | ||
21 |class X extends E with D // error | ||
| ^ | ||
| error overriding method m in trait C of type (a: Int): Int; | ||
| method m in trait D of type (a: Int): Int needs `abstract override` modifiers |
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,21 @@ | ||
trait A { | ||
def m(a:Int): Int | ||
} | ||
|
||
trait B extends A { | ||
override def m(a:Int): Int = { return a; } | ||
} | ||
|
||
trait C extends A { | ||
abstract override def m(a:Int):Int = { return super.m(a); } | ||
} | ||
|
||
trait D extends B with C { | ||
override def m(a:Int):Int = { return super.m(a); } | ||
} | ||
|
||
trait E extends C with B { | ||
abstract override def m(a:Int):Int = { return super.m(a); } | ||
} | ||
|
||
class X extends E with D // error |