You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala>traitBar// defined trait Bar
scala>enumB(x: Int) {
|caseFooextendsBarwithB(10)
| }
2|caseFooextendsBarwithB(10)
|^^^^^|classB is not a trait2|caseFooextendsBarwithB(10)
|^| missing argument for parameter x of constructor B: (x: Int):B
expectation
The second error message is wrong as we are definitely not missing an argument for B's constructor.
The text was updated successfully, but these errors were encountered:
this also exploits that checking for enum parent only checks first parent as now the errors include
2|caseFooextendsBarwithB(10)
|^|enumcase does not extend its enumclassB
bishabosha
changed the title
(Slightly) misleading error message when incorrectly inheriting an enum case from a trait
incorrect error when base class extended in wrong order
Oct 16, 2020
4|classBarextendsFoowithA(10)
|^^^^^|classA is not a trait4|classBarextendsFoowithA(10)
|^| missing argument for parameter x of constructor A: (x: Int):A
if Foo is a class then the second error is dropped
bishabosha
changed the title
incorrect error when base class extended in wrong order
incorrect error when class with parameters is not first parent
Oct 16, 2020
bishabosha
changed the title
incorrect error when class with parameters is not first parent
incorrect error when class with parameters follows trait in parents
Oct 16, 2020
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 5, 2022
minimized code
expectation
The second error message is wrong as we are definitely not missing an argument for
B
's constructor.The text was updated successfully, but these errors were encountered: