| 1 | pub export fn entry() void { |
| 2 | var a: u32 = 0; |
| 3 | _ = &a; |
| 4 | _ = @as(comptime_int, a); |
| 5 | } |
| 6 | pub export fn entry2() void { |
| 7 | var a: u32 = 0; |
| 8 | _ = &a; |
| 9 | _ = @as(comptime_float, a); |
| 10 | } |
| 11 | pub export fn entry3() void { |
| 12 | comptime var aa: comptime_float = 0.0; |
| 13 | var a: f32 = 4; |
| 14 | _ = &a; |
| 15 | aa = a; |
| 16 | } |
| 17 | pub export fn entry4() void { |
| 18 | comptime var aa: comptime_int = 0.0; |
| 19 | var a: f32 = 4; |
| 20 | _ = &a; |
| 21 | aa = a; |
| 22 | } |
| 23 | |
| 24 | // error |
| 25 | // |
| 26 | // :4:27: error: unable to resolve comptime value |
| 27 | // :4:27: note: value casted to 'comptime_int' must be comptime-known |
| 28 | // :9:29: error: unable to resolve comptime value |
| 29 | // :9:29: note: value casted to 'comptime_float' must be comptime-known |
| 30 | // :15:10: error: unable to resolve comptime value |
| 31 | // :15:10: note: value casted to 'comptime_float' must be comptime-known |
| 32 | // :21:10: error: unable to resolve comptime value |
| 33 | // :21:10: note: value casted to 'comptime_int' must be comptime-known |