We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like be able to return a pointer to an object via the Union.
Union
Example with html/Window from https://github.com/lightpanda-io/browser, the following Union declaration:
html/Window
const generate = @import("../generate.zig"); pub const Interfaces = generate.Tuple(.{ Window, }); const Generated = generate.Union.compile(Interfaces); pub const Union = Generated._union; pub const Tags = Generated._enum;
Adding this function doesn't compile.
pub fn get_window(self: *Window) Union { return .{ .Window = self }; }
$ zig build install └─ install lightpanda └─ zig build-exe lightpanda Debug native 1 errors src/html/window.zig:81:29: error: expected type 'html.window.Window', found '*html.window.Window' return .{ .Window = self }; ^~~~ src/html/window.zig:43:20: note: struct declared here pub const Window = struct { ^~~~~~ referenced by: callFunc__anon_29998: vendor/zig-js-runtime/src/engines/v8/generate.zig:916:22 getter: vendor/zig-js-runtime/src/engines/v8/generate.zig:1029:21 remaining reference traces hidden; use '-freference-trace' to see all reference traces
But this one works.
pub fn get_window(self: *Window) Union { return .{ .Window = self.* }; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I would like be able to return a pointer to an object via the
Union
.Example with
html/Window
from https://github.com/lightpanda-io/browser, the followingUnion
declaration:Adding this function doesn't compile.
But this one works.
The text was updated successfully, but these errors were encountered: