* Revert "fixes #20699; generate an empty struct for void type (#20790)"
This reverts commit 8fcb9380f0.
* better fix [backport]
This commit is contained in:
parent
73680cef95
commit
165d523edf
3 changed files with 30 additions and 27 deletions
|
|
@ -476,20 +476,21 @@ template main {.dirty.} =
|
|||
|
||||
foo2()
|
||||
|
||||
block: # issue #20699
|
||||
type
|
||||
Either[A,B] = object
|
||||
case kind:bool
|
||||
of false:
|
||||
b: B
|
||||
of true:
|
||||
a: A
|
||||
O = object of RootRef
|
||||
|
||||
proc oToEither(o:O):Either[O,void] =
|
||||
Either[O,void](kind:true,a: o)
|
||||
block: # issue #20699
|
||||
type
|
||||
Either[A,B] = object
|
||||
case kind:bool
|
||||
of false:
|
||||
b: B
|
||||
of true:
|
||||
a: A
|
||||
O = object of RootRef
|
||||
|
||||
discard oToEither(O())
|
||||
proc oToEither(o:O):Either[O,void] =
|
||||
Either[O,void](kind:true,a: o)
|
||||
|
||||
discard oToEither(O())
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue