File tree 1 file changed +5
-1
lines changed
compiler/src/dotty/tools/dotc/reporting
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2775,7 +2775,11 @@ extends SyntaxMsg(TargetNameOnTopLevelClassID):
2775
2775
class NotClassType (tp : Type )(using Context )
2776
2776
extends TypeMsg (NotClassTypeID ), ShowMatchTrace (tp):
2777
2777
def msg (using Context ) = i " $tp is not a class type "
2778
- def explain (using Context ) = " "
2778
+ def explain (using Context ) =
2779
+ i """ A class type includes classes and traits in a specific order. Defining a class, even an anonymous class,
2780
+ |requires specifying an order for the traits it extends. For example, `A & B` is not a class type because it
2781
+ |doesn't specify which trait takes precedence, A or B. Both `A with B` and `B with A` are class types.
2782
+ |Class types also can't have refinements. """
2779
2783
2780
2784
class NotConstant (suffix : String , tp : Type )(using Context )
2781
2785
extends TypeMsg (NotConstantID ), ShowMatchTrace (tp):
You can’t perform that action at this time.
0 commit comments