mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-14 09:52:23 -07:00
Allow for default parameters that are non-constant entities, but not any non-constant expression
This commit is contained in:
@@ -5128,6 +5128,9 @@ irValue *ir_build_expr_internal(irProcedure *proc, Ast *expr) {
|
||||
// args[i] =
|
||||
GB_PANIC("TODO ParameterValue_Location");
|
||||
break;
|
||||
case ParameterValue_Value:
|
||||
args[i] = ir_build_expr(proc, e->Variable.param_value.ast_value);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
args[i] = ir_emit_conv(proc, args[i], e->type);
|
||||
@@ -5221,6 +5224,9 @@ irValue *ir_build_expr_internal(irProcedure *proc, Ast *expr) {
|
||||
case ParameterValue_Location:
|
||||
args[arg_index++] = ir_emit_source_code_location(proc, proc_name, pos);
|
||||
break;
|
||||
case ParameterValue_Value:
|
||||
args[arg_index++] = ir_build_expr(proc, e->Variable.param_value.ast_value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5312,6 +5318,9 @@ irValue *ir_build_expr_internal(irProcedure *proc, Ast *expr) {
|
||||
case ParameterValue_Location:
|
||||
args[i] = ir_emit_source_code_location(proc, proc_name, pos);
|
||||
break;
|
||||
case ParameterValue_Value:
|
||||
args[i] = ir_build_expr(proc, e->Variable.param_value.ast_value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user