diff options
| author | Martin Wickham <spexguy070@gmail.com> | 2021-09-23 12:17:06 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-23 13:17:06 -0400 |
| commit | a0a847f2e40046387e2e2b8a0b8dae9cb27ca22a (patch) | |
| tree | 2fdaa3bdd0ab7d63eb54e1bd92aca1f1607cca14 /test/behavior/this.zig | |
| parent | f615648d7bdcb5c7ed38ad15169a8fa90bd86ca0 (diff) | |
| download | zig-a0a847f2e40046387e2e2b8a0b8dae9cb27ca22a.tar.gz zig-a0a847f2e40046387e2e2b8a0b8dae9cb27ca22a.zip | |
Stage2: Implement comptime closures and the This builtin (#9823)
Diffstat (limited to 'test/behavior/this.zig')
| -rw-r--r-- | test/behavior/this.zig | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/behavior/this.zig b/test/behavior/this.zig index 086fe2814a..0fcfd5910c 100644 --- a/test/behavior/this.zig +++ b/test/behavior/this.zig @@ -24,11 +24,10 @@ test "this refer to module call private fn" { } test "this refer to container" { - var pt = Point(i32){ - .x = 12, - .y = 34, - }; - pt.addOne(); + var pt: Point(i32) = undefined; + pt.x = 12; + pt.y = 34; + Point(i32).addOne(&pt); try expect(pt.x == 13); try expect(pt.y == 35); } |
