Skip to content

Commit cf404cf

Browse files
authored
fix type annotation of dynamic new expressions in codegen (#30574)
1 parent 8025bab commit cf404cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/codegen.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -4065,7 +4065,9 @@ static jl_cgval_t emit_expr(jl_codectx_t &ctx, jl_value_t *expr, ssize_t ssaval)
40654065
}
40664066
Value *typ = boxed(ctx, argv[0]);
40674067
Value *val = emit_jlcall(ctx, jlnew_func, typ, &argv[1], nargs - 1);
4068-
return mark_julia_type(ctx, val, true, ty);
4068+
// temporarily mark as `Any`, expecting `emit_ssaval_assign` to update
4069+
// it to the inferred type.
4070+
return mark_julia_type(ctx, val, true, (jl_value_t*)jl_any_type);
40694071
}
40704072
else if (head == exc_sym) {
40714073
return mark_julia_type(ctx,

0 commit comments

Comments
 (0)