@@ -3277,7 +3277,7 @@ extends SyntaxMsg(VolatileOnValID):
3277
3277
protected def explain (using Context ): String = " "
3278
3278
3279
3279
class ConstructorProxyNotValue (sym : Symbol )(using Context )
3280
- extends TypeMsg (ConstructorProxyNotValueID ):
3280
+ extends TypeMsg (PhantomSymbolNotValueID ):
3281
3281
protected def msg (using Context ): String =
3282
3282
i " constructor proxy $sym cannot be used as a value "
3283
3283
protected def explain (using Context ): String =
@@ -3292,7 +3292,7 @@ extends TypeMsg(ConstructorProxyNotValueID):
3292
3292
|but not as a stand-alone value. """
3293
3293
3294
3294
class ContextBoundCompanionNotValue (sym : Symbol )(using Context )
3295
- extends TypeMsg (ConstructorProxyNotValueID ):
3295
+ extends TypeMsg (PhantomSymbolNotValueID ):
3296
3296
protected def msg (using Context ): String =
3297
3297
i " context bound companion $sym cannot be used as a value "
3298
3298
protected def explain (using Context ): String =
@@ -3311,6 +3311,22 @@ extends TypeMsg(ConstructorProxyNotValueID):
3311
3311
|companion value with the (term-)name `A`. However, these context bound companions
3312
3312
|are not values themselves, they can only be referred to in selections. """
3313
3313
3314
+ class DummyCaptureParamNotValue (sym : Symbol )(using Context )
3315
+ extends TypeMsg (PhantomSymbolNotValueID ):
3316
+ protected def msg (using Context ): String =
3317
+ i " dummy term capture parameter $sym cannot be used as a value "
3318
+ protected def explain (using Context ): String =
3319
+ i """ A term capture parameter is a symbol made up by the compiler to represent a reference
3320
+ |to a real capture parameter in capture sets. For instance, in
3321
+ |
3322
+ | class A:
3323
+ | type C^
3324
+ |
3325
+ |there is just a type `A` declared but not a value `A`. Nevertheless, one can write
3326
+ |the selection `(a: A).C` and use a a value, which works because the compiler created a
3327
+ |term capture parameter for `C`. However, these term capture parameters are not real values,
3328
+ |they can only be referred in capture sets. """
3329
+
3314
3330
class UnusedSymbol (errorText : String , val actions : List [CodeAction ] = Nil )(using Context )
3315
3331
extends Message (UnusedSymbolID ):
3316
3332
def kind = MessageKind .UnusedSymbol
@@ -3518,7 +3534,7 @@ final class OnlyFullyDependentAppliedConstructorType()(using Context)
3518
3534
override protected def explain (using Context ): String = " "
3519
3535
3520
3536
final class IllegalContextBounds (using Context ) extends SyntaxMsg (IllegalContextBoundsID ):
3521
- override protected def msg (using Context ): String =
3537
+ override protected def msg (using Context ): String =
3522
3538
i " Context bounds are not allowed in this position "
3523
3539
3524
3540
override protected def explain (using Context ): String = " "
0 commit comments