You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The workaround is to extract the anonymous-struct of arg spec into a separated named definition ie. const Spec = struct {....
As a point of interest, if all fields in the anonymous-struct decl get default values (eg. TIn: type = union(enum) {},) and an empty .{} anon-struct-literal is passed instead, same compiler message.
The text was updated successfully, but these errors were encountered:
andrewrk
added
bug
Observed behavior contradicts documented or intended behavior
stage1
The process of building from source via WebAssembly and the C backend.
labels
Jan 28, 2020
andrewrk
changed the title
Proposal: allow anonymous-struct literal to be passed for anonymous-struct-typed arg (when structurally-identical / -compatible)
anonymous-struct literal unable to be passed for anonymous-struct-typed arg
Jan 28, 2020
Uh oh!
There was an error while loading. Please reload this page.
A minimal repro main.zig, currently rejected with
./main.zig:4:26: error: expected type 'struct:11:32', found 'struct:11:32'
:The workaround is to extract the anonymous-struct of arg
spec
into a separated named definition ie.const Spec = struct {...
.As a point of interest, if all fields in the anonymous-struct decl get default values (eg.
TIn: type = union(enum) {},
) and an empty.{}
anon-struct-literal is passed instead, same compiler message.The text was updated successfully, but these errors were encountered: