Skip to content

Commit

Permalink
Update phrasing for NotClassType explain error message
Browse files Browse the repository at this point in the history
  • Loading branch information
aherlihy committed Feb 6, 2024
1 parent 5850d2d commit d55938e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/src/dotty/tools/dotc/reporting/messages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2775,7 +2775,10 @@ extends SyntaxMsg(TargetNameOnTopLevelClassID):
class NotClassType(tp: Type)(using Context)
extends TypeMsg(NotClassTypeID), ShowMatchTrace(tp):
def msg(using Context) = i"$tp is not a class type"
def explain(using Context) = ""
def explain(using Context) =
i"""A class type includes classes and traits in a specific order. Defining a class, even an anonymous class,
|requires specifying an order for the traits it extends. For example, `A & B` is not a class type because it
|doesn't specify which trait takes precedence, A or B. Both `A with B` and `B with A` are class types."""

class NotConstant(suffix: String, tp: Type)(using Context)
extends TypeMsg(NotConstantID), ShowMatchTrace(tp):
Expand Down

0 comments on commit d55938e

Please sign in to comment.