@@ -21,7 +21,7 @@ import Recheck.*
21
21
import scala .collection .mutable
22
22
import CaptureSet .{withCaptureSetsExplained , IdempotentCaptRefMap , CompareResult }
23
23
import StdNames .nme
24
- import NameKinds .DefaultGetterName
24
+ import NameKinds .{ DefaultGetterName , WildcardParamName }
25
25
import reporting .trace
26
26
27
27
/** The capture checker */
@@ -1318,7 +1318,9 @@ class CheckCaptures extends Recheck, SymTransformer:
1318
1318
def traverse (t : Type ): Unit =
1319
1319
t match
1320
1320
case AppliedType (tycon, arg :: Nil ) if tycon.typeSymbol == defn.ArrayClass =>
1321
- if ! (pos.span.isSynthetic && ctx.reporter.errorsReported) then
1321
+ if ! (pos.span.isSynthetic && ctx.reporter.errorsReported)
1322
+ && ! arg.typeSymbol.name.is(WildcardParamName )
1323
+ then
1322
1324
CheckCaptures .disallowRootCapabilitiesIn(arg, NoSymbol ,
1323
1325
" Array" , " have element type" ,
1324
1326
" Since arrays are mutable, they have to be treated like variables,\n so their element type must be sealed." ,
@@ -1341,10 +1343,11 @@ class CheckCaptures extends Recheck, SymTransformer:
1341
1343
val lctx = tree match
1342
1344
case _ : DefTree | _ : TypeDef if tree.symbol.exists => ctx.withOwner(tree.symbol)
1343
1345
case _ => ctx
1344
- traverseChildren(tree)(using lctx)
1345
- check(tree)
1346
+ trace(i " post check $tree" ):
1347
+ traverseChildren(tree)(using lctx)
1348
+ check(tree)
1346
1349
def check (tree : Tree )(using Context ) = tree match
1347
- case t @ TypeApply (fun, args) =>
1350
+ case TypeApply (fun, args) =>
1348
1351
fun.knownType.widen match
1349
1352
case tl : PolyType =>
1350
1353
val normArgs = args.lazyZip(tl.paramInfos).map: (arg, bounds) =>
0 commit comments