* fixes #21023; Segfault when mixing seqs, orc, variants and futures * fixes none of the branches were explicitly selected * add one more test * one more test
This commit is contained in:
parent
72e262666b
commit
0319824322
3 changed files with 136 additions and 18 deletions
|
|
@ -269,3 +269,64 @@ proc bug20305 =
|
|||
echo x.pChildren
|
||||
|
||||
bug20305()
|
||||
|
||||
# bug #21023
|
||||
block:
|
||||
block:
|
||||
type
|
||||
MGErrorKind = enum
|
||||
mgeUnexpected, mgeNotFound
|
||||
|
||||
type Foo = object
|
||||
kind: MGErrorKind
|
||||
ex: Exception
|
||||
|
||||
type Boo = object
|
||||
a: seq[int]
|
||||
|
||||
type
|
||||
Result2 = object
|
||||
case o: bool
|
||||
of false:
|
||||
e: Foo
|
||||
of true:
|
||||
v: Boo
|
||||
|
||||
proc startSessionSync(): Result2 =
|
||||
return Result2(o: true)
|
||||
|
||||
proc mainSync =
|
||||
let ff = startSessionSync()
|
||||
doAssert ff.o == true
|
||||
|
||||
mainSync()
|
||||
|
||||
block:
|
||||
type
|
||||
MGErrorKind = enum
|
||||
mgeUnexpected, mgeNotFound
|
||||
|
||||
type Foo = object
|
||||
kind: MGErrorKind
|
||||
ex: Exception
|
||||
|
||||
type Boo = object
|
||||
a: seq[int]
|
||||
|
||||
type
|
||||
Result2 = object
|
||||
case o: bool
|
||||
of false:
|
||||
e: Foo
|
||||
of true:
|
||||
v: Boo
|
||||
s: int
|
||||
|
||||
proc startSessionSync(): Result2 =
|
||||
return Result2(o: true, s: 12)
|
||||
|
||||
proc mainSync =
|
||||
let ff = startSessionSync()
|
||||
doAssert ff.s == 12
|
||||
|
||||
mainSync()
|
||||
|
|
|
|||
|
|
@ -559,6 +559,38 @@ template main {.dirty.} =
|
|||
let x = default(Default)
|
||||
doAssert x.data is DjangoDateTime
|
||||
|
||||
block:
|
||||
type
|
||||
Result2 = object
|
||||
case o: bool
|
||||
of false:
|
||||
e: float
|
||||
of true:
|
||||
v {.requiresInit.} : int = 1
|
||||
|
||||
proc startSessionSync(): Result2 =
|
||||
return Result2(o: true)
|
||||
|
||||
proc mainSync =
|
||||
let ff = startSessionSync()
|
||||
doAssert ff.v == 1
|
||||
|
||||
mainSync()
|
||||
|
||||
block:
|
||||
type
|
||||
Result2 = object
|
||||
v {.requiresInit.} : int = 1
|
||||
|
||||
proc startSessionSync(): Result2 =
|
||||
return Result2()
|
||||
|
||||
proc mainSync =
|
||||
let ff = startSessionSync()
|
||||
doAssert ff.v == 1
|
||||
|
||||
mainSync()
|
||||
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue