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
error overriding method toString in traitCompanion of type=>String;
method toString of type=>String cannot overridefinal member method toString in traitCompanioncaseclassExample(value: Int)
Expectation
Companion object inherits toString implementation from the trait.
The text was updated successfully, but these errors were encountered:
-- [E120] Naming Error: i16879.scala:8:6 ---------------------------------------
8 | def toString = "Ex"
| ^
|Double definition:
|override def toString: String in object Example at line 6 and
|def toString: String in object Example at line 8
|have the same type after erasure.
|
|Consider adding a @targetName annotation to one of the conflicting definitions
|for disambiguation.
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Feb 11, 2023
Compiler version
3.2.1 and 3.2.2
Minimized code
Output
Expectation
Companion object inherits toString implementation from the trait.
The text was updated successfully, but these errors were encountered: