| 1 | export fn entry1() void { |
| 2 | foo(); |
| 3 | } |
| 4 | |
| 5 | comptime { |
| 6 | qux(); |
| 7 | } |
| 8 | |
| 9 | inline fn foo() void { |
| 10 | _ = bar(); |
| 11 | } |
| 12 | |
| 13 | fn bar() type { |
| 14 | qux(); |
| 15 | return u8; |
| 16 | } |
| 17 | |
| 18 | fn qux() void { |
| 19 | rt = 123; |
| 20 | } |
| 21 | |
| 22 | var rt: u32 = undefined; |
| 23 | |
| 24 | // error |
| 25 | // |
| 26 | // :19:8: error: unable to evaluate comptime expression |
| 27 | // :19:5: note: operation is runtime due to this operand |
| 28 | // :6:8: note: called at comptime from here |
| 29 | // :5:1: note: 'comptime' keyword forces comptime evaluation |
| 30 | // :19:8: error: unable to evaluate comptime expression |
| 31 | // :19:5: note: operation is runtime due to this operand |
| 32 | // :14:8: note: called at comptime from here |
| 33 | // :10:12: note: called at comptime from here |
| 34 | // :10:12: note: call to function with comptime-only return type 'type' is evaluated at comptime |
| 35 | // :13:10: note: return type declared here |
| 36 | // :10:12: note: types are not available at runtime |
| 37 | // :2:8: note: called inline here |