@@ -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 */
@@ -1316,7 +1316,9 @@ class CheckCaptures extends Recheck, SymTransformer:
1316
1316
def traverse (t : Type ): Unit =
1317
1317
t match
1318
1318
case AppliedType (tycon, arg :: Nil ) if tycon.typeSymbol == defn.ArrayClass =>
1319
- if ! (pos.span.isSynthetic && ctx.reporter.errorsReported) then
1319
+ if ! (pos.span.isSynthetic && ctx.reporter.errorsReported)
1320
+ && ! arg.typeSymbol.name.is(WildcardParamName )
1321
+ then
1320
1322
CheckCaptures .disallowRootCapabilitiesIn(arg, NoSymbol ,
1321
1323
" Array" , " have element type" ,
1322
1324
" Since arrays are mutable, they have to be treated like variables,\n so their element type must be sealed." ,
@@ -1339,10 +1341,11 @@ class CheckCaptures extends Recheck, SymTransformer:
1339
1341
val lctx = tree match
1340
1342
case _ : DefTree | _ : TypeDef if tree.symbol.exists => ctx.withOwner(tree.symbol)
1341
1343
case _ => ctx
1342
- traverseChildren(tree)(using lctx)
1343
- check(tree)
1344
+ trace(i " post check $tree" ):
1345
+ traverseChildren(tree)(using lctx)
1346
+ check(tree)
1344
1347
def check (tree : Tree )(using Context ) = tree match
1345
- case t @ TypeApply (fun, args) =>
1348
+ case TypeApply (fun, args) =>
1346
1349
fun.knownType.widen match
1347
1350
case tl : PolyType =>
1348
1351
val normArgs = args.lazyZip(tl.paramInfos).map: (arg, bounds) =>
0 commit comments