-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
SpreeSuitable for a future SpreeSuitable for a future Spreearea:desugarDesugaring happens after parsing but before typing, see desugar.scalaDesugaring happens after parsing but before typing, see desugar.scalaarea:enumsarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcarea:value-classesIssues tied to value classes.Issues tied to value classes.better-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement
Milestone
Description
Compiler version
Minimized example
enum Orientation extends AnyVal:
case North, South, East, West
Output Error/Warning message
-- [E074] Syntax Error: t.scala:2:5 --------------------------------------------
2 |enum Orientation extends AnyVal:
| ^
| Value classes may not be abstract
-- [E093] Syntax Error: t.scala:3:29 -------------------------------------------
3 | case North, South, East, West
| ^
| anonymous class {...} cannot extend final class Orientation
|-----------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| A class marked with the final keyword cannot be extended
-----------------------------------------------------------------------------
Why this Error/Warning was not helpful
The message leaks implementation details about desugaring...
Suggested improvement
A message saying that enums cannot extend AnyVal
is better here
Metadata
Metadata
Assignees
Labels
SpreeSuitable for a future SpreeSuitable for a future Spreearea:desugarDesugaring happens after parsing but before typing, see desugar.scalaDesugaring happens after parsing but before typing, see desugar.scalaarea:enumsarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcarea:value-classesIssues tied to value classes.Issues tied to value classes.better-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement