mirror of
https://github.com/ziglang/zig.git
synced 2026-01-04 12:33:19 +00:00
And fix test cases to make them pass. This is in preparation for starting to pass behavior tests with self-hosted.
18 lines
324 B
Zig
18 lines
324 B
Zig
const Foobar = struct {
|
|
myTypes: [128]type,
|
|
str: [1024]u8,
|
|
|
|
fn foo() @This() {
|
|
comptime var foobar: Foobar = undefined;
|
|
foobar.str = [_]u8{'a'} ** 1024;
|
|
return foobar;
|
|
}
|
|
};
|
|
|
|
fn foo(arg: anytype) void {}
|
|
|
|
test "" {
|
|
comptime var foobar = Foobar.foo();
|
|
foo(foobar.str[0..10]);
|
|
}
|