@@ -46,6 +46,12 @@ template loadType(t: PType) =
4646 when not defined (nimKochBootstrap):
4747 ast2nif.loadType (program, t)
4848
49+ proc loadSymCallback * (s: PSym ) {.nimcall .} =
50+ loadSym (s)
51+
52+ proc loadTypeCallback * (t: PType ) {.nimcall .} =
53+ loadType (t)
54+
4955proc ensureMutable * (s: PSym ) {.inline .} =
5056 assert s.state != Sealed
5157 if s.state == Partial : loadSym (s)
@@ -82,9 +88,6 @@ proc setOwner*(s: PType; owner: PSym) {.inline.} =
8288 if s.state == Partial : loadType (s)
8389 s.ownerFieldImpl = owner
8490
85- # Accessor procs for TSym fields
86- # Note: kind is kept as a direct field for case statement compatibility
87- # but we still provide an accessor that checks state
8891proc kind * (s: PSym ): TSymKind {.inline .} =
8992 if s.state == Partial : loadSym (s)
9093 result = s.kindImpl
@@ -227,7 +230,7 @@ proc offset*(s: PSym): int32 {.inline.} =
227230 result = s.offsetImpl
228231
229232proc `offset=` * (s: PSym , val: int32 ) {.inline .} =
230- assert s.state != Sealed
233+ # assert s.state != Sealed
231234 if s.state == Partial : loadSym (s)
232235 s.offsetImpl = val
233236
@@ -293,7 +296,8 @@ proc incl*(s: PSym; flags: set[TSymFlag]) {.inline.} =
293296 s.flagsImpl.incl (flags)
294297
295298proc incl * (s: PSym ; flag: TLocFlag ) {.inline .} =
296- assert s.state != Sealed
299+ # assert s.state != Sealed
300+ # locImpl is a backend field so do not protect it against mutations
297301 if s.state == Partial : loadSym (s)
298302 s.locImpl.flags.incl (flag)
299303
0 commit comments