conjure-java icon indicating copy to clipboard operation
conjure-java copied to clipboard

Generate no-arg static constructor for union type of empty value

Open gatesn opened this issue 5 years ago • 1 comments

What happened?

Given the definition:

NoneType:
  fields: {}
SomeType:
  fields:
    val: any
MyUnion:
  union:
    none: NoneType
    some: SomeType

I want to be able to write MyUnion.none() instead of MyUnion.none(NoneType.of())

I've found it common to have "empty types" as part of a union

gatesn avatar May 13 '20 10:05 gatesn

Better yet, MyUnion.some("value")

Or builders, MyUnion.some().value("value").build()

gatesn avatar May 13 '20 11:05 gatesn