Re: Default struct constructors if a struct member is a union

2024-06-30 Thread Basile B. via Digitalmars-d-learn
On Sunday, 30 June 2024 at 11:23:45 UTC, Nick Treleaven wrote: On Saturday, 29 June 2024 at 23:33:41 UTC, solidstate1991 wrote: S foo0 = S(TypeEnum.Integer32, S(20)); //Ugly, but works S foo1 = S(TypeEnum.Integer64, S(20L)); //Error: cannot Did you mean `U(20)`? The 20 applies to the first fi

Re: Default struct constructors if a struct member is a union

2024-06-30 Thread Nick Treleaven via Digitalmars-d-learn
On Saturday, 29 June 2024 at 23:33:41 UTC, solidstate1991 wrote: S foo0 = S(TypeEnum.Integer32, S(20)); //Ugly, but works S foo1 = S(TypeEnum.Integer64, S(20L)); //Error: cannot Did you mean `U(20)`? The 20 applies to the first field of the union, i32. `U(20L)` also works and (I think) it doe