Unhelpful error message for type erasure #23350
Labels
area:reporting
Error reporting including formatting, implicit suggestions, etc
better-errors
Issues concerned with improving confusing/unhelpful diagnostic messages
itype:enhancement
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
3.7.0
Minimized example
Output Error/Warning message
Why this Error/Warning was not helpful
It doesn't tell me what the "same type" actually is.
Suggested improvement
Ideally it would be something like this:
We need to have the class be the "least specific" type it can be in the bytecode.
For A: there's an invisible >: Nothing <: Any, meaning the least specific type is Any for which the class is Object.
For D: the type is SomeCaseClass | Unit, for which the shared class is Object
As both A and D are of type Object they are in conflict.
Consider adding a @TargetNAME annotation to either A or D.
The text was updated successfully, but these errors were encountered: