File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
compiler/src/dotty/tools/dotc/reporting/diagnostic Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1132,7 +1132,18 @@ object messages {
1132
1132
val kind = " Usage"
1133
1133
private val traitOrAbstract = if (isTrait) hl " a trait " else hl " abstract "
1134
1134
val msg = hl """ ${cls.name} is ${traitOrAbstract}; it cannot be instantiated """
1135
- val explanation = " "
1135
+ val explanation =
1136
+ hl """ |Abstract classes and traits need to be extended by a concrete class or object
1137
+ |to make their functionality accessible.
1138
+ |
1139
+ |You may want to create an anonymous class extending ${cls.name} with
1140
+ | ${s " class ${cls.name} { } " }
1141
+ |
1142
+ |or add a companion object with
1143
+ | ${s " object ${cls.name} extends ${cls.name}" }
1144
+ |
1145
+ |You need to implement any abstract members in both cases.
1146
+ | """ .stripMargin
1136
1147
}
1137
1148
1138
1149
}
You can’t perform that action at this time.
0 commit comments