You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is working as designed. Function calls are executed at runtime, unless the type signature requires a comptime execution, or unless the function call is in a comptime scope. @dbandstra's suggestion puts the function call into a comptime scope, which is why it solves the problem.
I think the somewhat counter-intuitive thing here is that return control flow is unaffected by whether it is in a comptime scope or not. However the return expression is comptime evaluated. So your compileTimeParseFile ends up being code generated to return 42 (or whatever the result of the computation is) which is then called at runtime from main.
Now I comment out the
@compileLog
line:The text was updated successfully, but these errors were encountered: