master
1const std = @import("std");
2const expect = std.testing.expect;
3
4test "no runtime side effects" {
5 var data: i32 = 0;
6 const T = @TypeOf(foo(i32, &data));
7 try comptime expect(T == i32);
8 try expect(data == 0);
9}
10
11fn foo(comptime T: type, ptr: *T) T {
12 ptr.* += 1;
13 return ptr.*;
14}
15
16// test