diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2021-07-30 12:05:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 12:05:14 +0200 |
commit | 562dde624fdebcf060c54a39e76519ba150a9c4a (patch) | |
tree | 9237bf727b5b5991830104d3bc42f1a32908c52f | |
parent | c6fadb179975f79ad9914f09ce10f7fa6cbf0735 (diff) | |
download | Nim-562dde624fdebcf060c54a39e76519ba150a9c4a.tar.gz |
fixes #18371 (#18617)
-rw-r--r-- | compiler/vmops.nim | 7 | ||||
-rw-r--r-- | lib/std/effecttraits.nim | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/compiler/vmops.nim b/compiler/vmops.nim index 6ee915bd5..a1a4996b2 100644 --- a/compiler/vmops.nim +++ b/compiler/vmops.nim @@ -303,12 +303,15 @@ proc registerAdditionalOps*(c: PCtx) = proc getEffectList(c: PCtx; a: VmArgs; effectIndex: int) = let fn = getNode(a, 0) + var list = newNodeI(nkBracket, fn.info) if fn.typ != nil and fn.typ.n != nil and fn.typ.n[0].len >= effectListLen and fn.typ.n[0][effectIndex] != nil: - var list = newNodeI(nkBracket, fn.info) for e in fn.typ.n[0][effectIndex]: list.add opMapTypeInstToAst(c.cache, e.typ.skipTypes({tyRef}), e.info, c.idgen) - setResult(a, list) + else: + list.add newIdentNode(getIdent(c.cache, "UncomputedEffects"), fn.info) + + setResult(a, list) registerCallback c, "stdlib.effecttraits.getRaisesListImpl", proc (a: VmArgs) = getEffectList(c, a, exceptionEffects) diff --git a/lib/std/effecttraits.nim b/lib/std/effecttraits.nim index 358280db0..635ec82d0 100644 --- a/lib/std/effecttraits.nim +++ b/lib/std/effecttraits.nim @@ -11,7 +11,7 @@ ## for Nim's macro system. ## **Since**: Version 1.4. ## -## One can test for the existance of this standard module +## One can test for the existence of this standard module ## via `defined(nimHasEffectTraitsModule)`. import macros |