diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-10-30 16:58:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 09:58:55 +0100 |
commit | 17f08b2939db224d533db846fc3fa8ab91cc9755 (patch) | |
tree | 94654e4423c0e665f37e55dfdc6ec4c27746e498 /compiler | |
parent | 2de90a14cbc5182efad2cff63cd33f820e3a8832 (diff) | |
download | Nim-17f08b2939db224d533db846fc3fa8ab91cc9755.tar.gz |
closes #7658 (#15784)
* fix #7658 * more
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/pragmas.nim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index c0c9cc06a..273b2b004 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -1110,9 +1110,12 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int, else: sym.typ.kind = tyUncheckedArray of wUnion: - noVal(c, it) - if sym.typ == nil: invalidPragma(c, it) - else: incl(sym.typ.flags, tfUnion) + if c.config.backend == backendJs: + localError(c.config, it.info, "`{.union.}` is not implemented for js backend.") + else: + noVal(c, it) + if sym.typ == nil: invalidPragma(c, it) + else: incl(sym.typ.flags, tfUnion) of wRequiresInit: noVal(c, it) if sym.kind == skField: |