diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-11-20 00:53:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-19 17:53:25 +0100 |
commit | cecaf9c56b1240a44a4de837e03694a0c55ec379 (patch) | |
tree | be4434e4aaad0ea631d4093454b04128d6dab087 /compiler | |
parent | 5dafcf4957a225b1f015d131299e51735e7bb1d3 (diff) | |
download | Nim-cecaf9c56b1240a44a4de837e03694a0c55ec379.tar.gz |
fixes #22939; fixes #16890; push should but doesn't apply to importc … (#22944)
…var/let symbols fixes #22939 fixes #16890 Besides, it was applied to let/const/var with pragmas, now it is universally applied. ```nim {.push exportc.} proc foo = let bar = 12 echo bar {.pop.} ``` For example, the `bar` variable will be affected by `exportc`.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semtypes.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 65eaf1a89..0a0050f2f 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -528,6 +528,12 @@ proc semIdentWithPragma(c: PContext, kind: TSymKind, n: PNode, else: discard else: result = semIdentVis(c, kind, n, allowed) + case kind + of skField: implicitPragmas(c, result, n.info, fieldPragmas) + of skVar: implicitPragmas(c, result, n.info, varPragmas) + of skLet: implicitPragmas(c, result, n.info, letPragmas) + of skConst: implicitPragmas(c, result, n.info, constPragmas) + else: discard proc checkForOverlap(c: PContext, t: PNode, currentEx, branchIndex: int) = let ex = t[branchIndex][currentEx].skipConv |