2022-08-30 13:21:50 +01:00
|
|
|
pub export fn entry() void {
|
|
|
|
var a: u32 = 0;
|
|
|
|
_ = @as(comptime_int, a);
|
|
|
|
}
|
2023-06-15 08:14:16 +01:00
|
|
|
pub export fn entry2() void {
|
2022-08-30 13:21:50 +01:00
|
|
|
var a: u32 = 0;
|
|
|
|
_ = @as(comptime_float, a);
|
|
|
|
}
|
2023-06-15 08:14:16 +01:00
|
|
|
pub export fn entry3() void {
|
2022-08-30 13:21:50 +01:00
|
|
|
comptime var aa: comptime_float = 0.0;
|
|
|
|
var a: f32 = 4;
|
|
|
|
aa = a;
|
|
|
|
}
|
2023-06-15 08:14:16 +01:00
|
|
|
pub export fn entry4() void {
|
2022-08-30 13:21:50 +01:00
|
|
|
comptime var aa: comptime_int = 0.0;
|
|
|
|
var a: f32 = 4;
|
|
|
|
aa = a;
|
|
|
|
}
|
|
|
|
|
|
|
|
// error
|
|
|
|
// backend=stage2
|
|
|
|
// target=native
|
|
|
|
//
|
|
|
|
// :3:27: error: unable to resolve comptime value
|
2022-10-05 19:58:23 +01:00
|
|
|
// :3:27: note: value being casted to 'comptime_int' must be comptime-known
|
2022-08-30 13:21:50 +01:00
|
|
|
// :7:29: error: unable to resolve comptime value
|
2022-10-05 19:58:23 +01:00
|
|
|
// :7:29: note: value being casted to 'comptime_float' must be comptime-known
|
2022-08-30 13:21:50 +01:00
|
|
|
// :12:10: error: unable to resolve comptime value
|
2022-10-05 19:58:23 +01:00
|
|
|
// :12:10: note: value being casted to 'comptime_float' must be comptime-known
|
2022-08-30 13:21:50 +01:00
|
|
|
// :17:10: error: unable to resolve comptime value
|
2022-10-05 19:58:23 +01:00
|
|
|
// :17:10: note: value being casted to 'comptime_int' must be comptime-known
|