@@ -135,7 +135,7 @@ object messages {
135
135
}
136
136
137
137
case class EmptyCatchBlock (tryBody : untpd.Tree )(implicit ctx : Context )
138
- extends EmptyCatchOrFinallyBlock (tryBody, EmptyCatchBlockID ) {
138
+ extends EmptyCatchOrFinallyBlock (tryBody, EmptyCatchBlockID ) {
139
139
val kind = " Syntax"
140
140
val msg =
141
141
hl """ |The ${" catch" } block does not contain a valid expression, try
@@ -1252,85 +1252,5 @@ object messages {
1252
1252
| ${" import" } scala.{ $name => ${name.show + " Tick" } }
1253
1253
| """
1254
1254
}
1255
-
1256
- case class ErasedPhantomsSignatureCollision (decls : Iterable [Symbol ], erased : (Name , Type ))(implicit ctx : Context )
1257
- extends Message (ErasedPhantomsSignatureCollisionID ) {
1258
- val kind = " Phantom restriction"
1259
- val msg = em " After phantom erasure methods $methodsString will have the same signature: ${erased._1}${erased._2}"
1260
1255
1261
- private def methodsString = decls.map(decl => em " ${decl.name}${decl.info}" ).mkString(" , " )
1262
-
1263
- val explanation =
1264
- hl """ |Phantom erasure removes all phantom parameters/arguments from methods and functions.
1265
- | """ .stripMargin
1266
- }
1267
-
1268
- case class PhantomInheritance (cdef : tpd.TypeDef )(implicit ctx : Context )
1269
- extends Message (PhantomInheritanceID ) {
1270
- val kind = " Phantom restriction"
1271
- val msg = perfix + " cannot extend both Any and PhantomAny."
1272
-
1273
- def perfix =
1274
- if (cdef.symbol.flags.is(Flags .Trait )) " A trait"
1275
- else if (cdef.symbol.flags.is(Flags .Abstract )) " An abstract class"
1276
- else " A class"
1277
-
1278
- val explanation =
1279
- hl """ | """ .stripMargin
1280
- }
1281
-
1282
- case class PhantomMixedBounds (op : untpd.Ident )(implicit ctx : Context )
1283
- extends Message (PhantomMixedBoundsID ) {
1284
- val kind = " Phantom restriction"
1285
- val msg = hl " Can not mix types of ${" Any" } and ${" Phantom.Any" } with ${op.show}. "
1286
-
1287
- val explanation =
1288
- hl """ | """ .stripMargin
1289
- }
1290
-
1291
- case class PhantomCrossedMixedBounds (lo : untpd.Tree , hi : untpd.Tree )(implicit ctx : Context )
1292
- extends Message (PhantomCrossedMixedBoundsID ) {
1293
- val kind = " Phantom restriction"
1294
- val msg = hl " Type can not be bounded at the same time by types in the ${" Any" } and ${" Phantom.Any" } latices. "
1295
-
1296
- val explanation =
1297
- hl """ | """ .stripMargin
1298
- }
1299
-
1300
- case class MatchPhantom (tpdCase : tpd.CaseDef , expected : Type )(implicit ctx : Context ) extends Message (MatchPhantomID ) {
1301
- val kind = " Phantom restriction"
1302
- val msg = s " Pattern expected case to return a ${expected.show} but was ${tpdCase.tpe.show}"
1303
-
1304
- val explanation =
1305
- hl """ | """ .stripMargin
1306
- }
1307
-
1308
-
1309
- case class MatchOnPhantom ()(implicit ctx : Context ) extends Message (MatchOnPhantomID ) {
1310
- val kind = " Phantom restriction"
1311
- val msg = " Cannot pattern match on phantoms"
1312
-
1313
- val explanation =
1314
- hl """ | """ .stripMargin
1315
- }
1316
-
1317
- case class IfElsePhantom (thenp : tpd.Tree , elsep : tpd.Tree )(implicit ctx : Context ) extends Message (IfElsePhantomID ) {
1318
- val kind = " Phantom restriction"
1319
- val msg =
1320
- s """ if/else cannot have branches with types in different lattices:
1321
- | ${thenp.tpe.show} of lattice ${thenp.tpe.topType.show}
1322
- | ${elsep.tpe.show} of lattice ${elsep.tpe.topType.show}
1323
- """ .stripMargin
1324
-
1325
- val explanation =
1326
- hl """ | """ .stripMargin
1327
- }
1328
-
1329
- case class PhantomIsInObject ()(implicit ctx : Context ) extends Message (PhantomIsInObjectID ) {
1330
- val kind = " Phantom restriction"
1331
- val msg = s " Only ${" object" } can extend ${" scala.Phantom" }"
1332
-
1333
- val explanation =
1334
- hl """ | """ .stripMargin
1335
- }
1336
1256
}
0 commit comments