diff --git a/compiler/ast.nim b/compiler/ast.nim index 8a095311ed..5e9680a278 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1196,7 +1196,12 @@ proc propagateToOwner*(owner, elem: PType; propagateHasAsgn = true) = let o2 = owner.skipTypes({tyGenericInst, tyAlias, tySink}) if o2.kind in {tyTuple, tyObject, tyArray, tySequence, tyString, tySet, tyDistinct}: - o2.incl mask + if o2.state == Sealed: + # During the original compilation, propagateToOwner set tfHasAsgn/tfHasOwned on the type before it was sealed + # On IC reload, the sealed type already has those flags + assert mask <= o2.flags, "IC bug: sealed type missing propagated flags" + else: + o2.incl mask owner.incl mask if owner.kind notin {tyProc, tyGenericInst, tyGenericBody,