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
Looks like any is not a constant type, but it is still evaluated as a constant value in lb_build_expr_internal() through this check:
if (tv.value.kind != ExactValue_Invalid) {
// NOTE(bill): Short on constant valuesreturnlb_const_value(p->module, type, tv.value);
Here the tv.value is a float constant, and type is a Basic_any, and thus lb_const_value() ends up creating a LLVMConstReal() with type any
What's the convention here, I assume all constant values should be calculated at typechecking phase, rather than in the llvm backend?
If so, should we only go into lb_const_value() if the type also is a constant type? Something like:
if (is_type_constant_type(tv.type) && tv.value.kind != ExactValue_Invalid) {
// NOTE(bill): Short on constant valuesreturnlb_const_value(p->module, type, tv.value);
minimal example
compilation crashes and silently exits with no error message
compiler command
odin run . or odin build .
system info
Odin 2025-01 (source built: 19-JAN-2025)
Windows
LLVM 18.1.8
suggested labels
bug
better-error-message-needed
The text was updated successfully, but these errors were encountered: