Smarter variant object construction (#11273)

This commit is contained in:
Jasper Jenkins 2019-05-26 12:22:02 -07:00 • committed by Andreas Rumpf
commit f774426095
9 changed files with 333 additions and 15 deletions

View file

@ -0,0 +1,14 @@
discard """
errormsg: "branch initialization with a runtime discriminator only supports ordinal types with 2^16 elements or less."
line: 13
"""
type
HoledObj = object
case kind: int
of 0: a: int
else: discard
let someInt = low(int)
case someInt
of 938: echo HoledObj(kind: someInt, a: 1)
else: discard