@@ -21,7 +21,7 @@ import Recheck.*
2121import scala .collection .mutable
2222import CaptureSet .{withCaptureSetsExplained , IdempotentCaptRefMap , CompareResult }
2323import StdNames .nme
24- import NameKinds .DefaultGetterName
24+ import NameKinds .{ DefaultGetterName , WildcardParamName }
2525import reporting .trace
2626
2727/** The capture checker */
@@ -1316,7 +1316,9 @@ class CheckCaptures extends Recheck, SymTransformer:
13161316 def traverse (t : Type ): Unit =
13171317 t match
13181318 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
13201322 CheckCaptures .disallowRootCapabilitiesIn(arg, NoSymbol ,
13211323 " Array" , " have element type" ,
13221324 " 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:
13391341 val lctx = tree match
13401342 case _ : DefTree | _ : TypeDef if tree.symbol.exists => ctx.withOwner(tree.symbol)
13411343 case _ => ctx
1342- traverseChildren(tree)(using lctx)
1343- check(tree)
1344+ trace(i " post check $tree" ):
1345+ traverseChildren(tree)(using lctx)
1346+ check(tree)
13441347 def check (tree : Tree )(using Context ) = tree match
1345- case t @ TypeApply (fun, args) =>
1348+ case TypeApply (fun, args) =>
13461349 fun.knownType.widen match
13471350 case tl : PolyType =>
13481351 val normArgs = args.lazyZip(tl.paramInfos).map: (arg, bounds) =>
0 commit comments