mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-28 17:41:45 +00:00
* fixes #20699; generate an empty struct for void type * Add docs and test case.
This commit is contained in:
@@ -476,6 +476,20 @@ 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)
|
||||
|
||||
discard oToEither(O())
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user