mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
* fixes #22613; Default value does not work with object's discriminator fixes #22613 * merge branches * add a test case * fixes status * remove outdated comments * move collectBranchFields into the global scope
This commit is contained in:
@@ -377,7 +377,7 @@ template main {.dirty.} =
|
||||
Red, Blue, Yellow
|
||||
|
||||
type
|
||||
ObjectVarint3 = object # fixme it doesn't work with static
|
||||
ObjectVarint3 = object
|
||||
case kind: Color = Blue
|
||||
of Red:
|
||||
data1: int = 10
|
||||
@@ -703,5 +703,20 @@ template main {.dirty.} =
|
||||
var foo = new Container
|
||||
doAssert int(foo.thing[0].x) == 1
|
||||
|
||||
block: # bug #22613
|
||||
type
|
||||
K = enum
|
||||
A = "a"
|
||||
B = "b"
|
||||
T = object
|
||||
case kind: K = B
|
||||
of A:
|
||||
a: int
|
||||
of B:
|
||||
b: float
|
||||
|
||||
doAssert T().kind == B
|
||||
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user