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
It is possible for comptime functions to not be found and evaluated at compile-time, e.g:
let bad = my_comptime_only_function;bad();// Call is not registered as comptime
Happy Case
comptime functions are assigned a different type from regular functions: comptime fn(). This can then be checked for when calling functions to determine whether to do so at compile-time or not, and can also be used to issue an error if it cannot be evaluated at compile-time do to being mixed in runtime code, e.g:
fnmain(x:bool){if x {
my_comptime_fn1
}else{
my_comptime_fn2
}();}
Project Impact
None
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered:
Problem
It is possible for comptime functions to not be found and evaluated at compile-time, e.g:
Happy Case
comptime functions are assigned a different type from regular functions:
comptime fn()
. This can then be checked for when calling functions to determine whether to do so at compile-time or not, and can also be used to issue an error if it cannot be evaluated at compile-time do to being mixed in runtime code, e.g:Project Impact
None
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: