fixes #25120; don't generate hooks for NimNode (#25144)

fixes #25120
This commit is contained in:
ringabout
2025-09-09 22:17:22 +08:00
committed by GitHub
parent 08d74a1c27
commit 34bb37ddda
2 changed files with 9 additions and 1 deletions

View File

@@ -1147,7 +1147,9 @@ proc semAnyRef(c: PContext; n: PNode; kind: TTypeKind; prev: PType): PType =
let t = newTypeS(tySink, c, result)
result = t
else: discard
if result.kind == tyRef and c.config.selectedGC in {gcArc, gcOrc, gcAtomicArc}:
if result.kind == tyRef and
c.config.selectedGC in {gcArc, gcOrc, gcAtomicArc} and
tfTriggersCompileTime notin result.flags:
result.flags.incl tfHasAsgn
proc findEnforcedStaticType(t: PType): PType =

6
tests/errmsgs/t25120.nim Normal file
View File

@@ -0,0 +1,6 @@
discard """
errormsg: "request to generate code for .compileTime proc: riesig"
"""
proc riesig(): NimNode = discard
discard riesig()