@@ -443,39 +443,13 @@ class SepCheck(checker: CheckCaptures.CheckerAPI) extends tpd.TreeTraverser:
443443 |No clashing definitions were found. This might point to an internal error. """ ,
444444 tree.srcPos)
445445
446- class UseAfterConsume (ref : Capability , consumedLoc : SrcPos , useLoc : SrcPos )(using Context ) extends reporting.Message (reporting.ErrorMessageID .NoExplanationID ):
447- def kind = reporting.MessageKind .NoKind
448-
449- protected def msg (using Context ): String = " "
450-
451- protected def explain (using Context ): String = " "
452-
453- override def leading (using Context ): Option [String ] = Some (
454- em """ Separation failure: Illegal access to $ref, which was passed to a
455- |consume parameter or was used as a prefix to a consume method
456- |and therefore is no longer available. """ .message
457- )
458-
459- override def parts (using Context ): List [reporting.Message .MessagePart ] = List (
460- reporting.Message .MessagePart (
461- " The capability was consumed here." ,
462- consumedLoc.sourcePos,
463- isPrimary = false
464- ),
465- reporting.Message .MessagePart (
466- " Then, it was used here" ,
467- useLoc.sourcePos,
468- isPrimary = true
469- )
470- )
471-
472446 /** Report a failure where a previously consumed capability is used again,
473447 * @param ref the capability that is used after being consumed
474448 * @param loc the position where the capability was consumed
475449 * @param pos the position where the capability was used again
476450 */
477451 def consumeError (ref : Capability , loc : SrcPos , pos : SrcPos )(using Context ): Unit =
478- report.error(UseAfterConsume (ref, loc, pos), pos)
452+ report.error(reporting. UseAfterConsume (ref, loc.sourcePos , pos.sourcePos ), pos)
479453
480454 /** Report a failure where a capability is consumed in a loop.
481455 * @param ref the capability
0 commit comments