mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
fixes #13481; fixes #22708 Otherwise it gives implicit results or bad codegen
This commit is contained in:
@@ -2050,6 +2050,8 @@ proc genSetConstr(c: PCtx, n: PNode, dest: var TDest) =
|
||||
c.freeTemp(a)
|
||||
|
||||
proc genObjConstr(c: PCtx, n: PNode, dest: var TDest) =
|
||||
if tfUnion in n.typ.flags: # bug #22708 # bug #13481
|
||||
globalError(c.config, n.info, "object with '{.union.}' pragmas is not supported by VM")
|
||||
if dest < 0: dest = c.getTemp(n.typ)
|
||||
let t = n.typ.skipTypes(abstractRange+{tyOwned}-{tyTypeDesc})
|
||||
if t.kind == tyRef:
|
||||
|
||||
@@ -301,14 +301,6 @@ block: # bug #10815
|
||||
const a = P()
|
||||
doAssert $a == ""
|
||||
|
||||
when defined osx: # xxx bug #13481
|
||||
block:
|
||||
type CharSet {.union.} = object
|
||||
cs: set[char]
|
||||
vs: array[4, uint64]
|
||||
const a = Charset(cs: {'a'..'z'})
|
||||
doAssert a.repr.len > 0
|
||||
|
||||
import tables
|
||||
|
||||
block: # bug #8007
|
||||
|
||||
Reference in New Issue
Block a user