Skip to content

Commit 31b3c11

Browse files
committed
fix cc compiler to pass override checks
1 parent 85fbfb6 commit 31b3c11

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/pos-with-compiler-cc/dotc/cc/CaptureAnnotation.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Decorators.*
1010
import config.Printers.capt
1111
import printing.Printer
1212
import printing.Texts.Text
13+
import annotation.retains
1314

1415
/** An annotation representing a capture set and whether it is boxed.
1516
* It simulates a normal @retains annotation except that it is more efficient,
@@ -50,7 +51,7 @@ case class CaptureAnnotation(refs: CaptureSet, boxed: Boolean)(cls: Symbol) exte
5051
this.refs == refs && this.boxed == boxed && this.symbol == that.symbol
5152
case _ => false
5253

53-
override def mapWith(tm: TypeMap)(using Context) =
54+
override def mapWith(tm: TypeMap @retains(caps.*))(using Context) =
5455
val elems = refs.elems.toList
5556
val elems1 = elems.mapConserve(tm)
5657
if elems1 eq elems then this

tests/pos-with-compiler-cc/dotc/cc/CaptureSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ sealed abstract class CaptureSet extends Showable, caps.Pure:
273273
map(Substituters.SubstParamsMap(tl, to).detach)
274274

275275
/** Invoke handler if this set has (or later aquires) the root capability `*` */
276-
def disallowRootCapability(handler: () => Context ?=> Unit)(using Context): this.type =
276+
def disallowRootCapability(handler: () -> Context ?-> Unit)(using Context): this.type =
277277
if isUniversal then handler()
278278
this
279279

0 commit comments

Comments
 (0)