ClassCastExcpetion when inheriting from two traits that define conflicting vals #23061
Labels
area:initialization
itype:bug
itype:soundness
Soundness bug (it lets us compile code that crashes at runtime with a ClassCastException)
Compiler version
3.3.5
,3.6.4
Minimized code
Output
Expectation
I would have expected a compile error somewhere instead of the Runtime issue.
(when compiling under 3.6.4 with
-Wsafe-init
the compiler warns at the line in MyActor about an unitialized access tolog
, compare this scastie https://scastie.scala-lang.org/kTVVbeCwSlOdwqO58ldS9w )Background: what we would have originally liked to do is fix a compile error by disambiguating the inherited
log
) viaCombining
super
with vals, however, does not seem to be allowed (full scastie: https://scastie.scala-lang.org/eiogKgSTTnyCB3CFCggCXA)(Side note: We stumbled across this while trying to minimize a slightly different case of a failed disambiguation attempt; I'll link to it as soon as my colleague reports it)
The text was updated successfully, but these errors were encountered: