Skip to content

Commit c81d02c

Browse files
committed
typeintersect: conservative typevar subtitution during finish_unionall (#54465)
(cherry picked from commit a946631)
1 parent 007d8de commit c81d02c

File tree

6 files changed

+245
-121
lines changed

6 files changed

+245
-121
lines changed

src/builtins.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,11 +1365,11 @@ JL_CALLABLE(jl_f_apply_type)
13651365
jl_vararg_t *vm = (jl_vararg_t*)args[0];
13661366
if (!vm->T) {
13671367
JL_NARGS(apply_type, 2, 3);
1368-
return (jl_value_t*)jl_wrap_vararg(args[1], nargs == 3 ? args[2] : NULL, 1);
1368+
return (jl_value_t*)jl_wrap_vararg(args[1], nargs == 3 ? args[2] : NULL, 1, 0);
13691369
}
13701370
else if (!vm->N) {
13711371
JL_NARGS(apply_type, 2, 2);
1372-
return (jl_value_t*)jl_wrap_vararg(vm->T, args[1], 1);
1372+
return (jl_value_t*)jl_wrap_vararg(vm->T, args[1], 1, 0);
13731373
}
13741374
}
13751375
else if (jl_is_unionall(args[0])) {
@@ -2060,7 +2060,7 @@ void jl_init_primitives(void) JL_GC_DISABLED
20602060
add_builtin("Tuple", (jl_value_t*)jl_anytuple_type);
20612061
add_builtin("TypeofVararg", (jl_value_t*)jl_vararg_type);
20622062
add_builtin("SimpleVector", (jl_value_t*)jl_simplevector_type);
2063-
add_builtin("Vararg", (jl_value_t*)jl_wrap_vararg(NULL, NULL, 0));
2063+
add_builtin("Vararg", (jl_value_t*)jl_wrap_vararg(NULL, NULL, 0, 0));
20642064

20652065
add_builtin("Module", (jl_value_t*)jl_module_type);
20662066
add_builtin("MethodTable", (jl_value_t*)jl_methtable_type);

src/gf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ static jl_value_t *inst_varargp_in_env(jl_value_t *decl, jl_svec_t *sparams)
735735
vm = T_has_tv ? jl_type_unionall(v, T) : T;
736736
if (N_has_tv)
737737
N = NULL;
738-
vm = (jl_value_t*)jl_wrap_vararg(vm, N, 1); // this cannot throw for these inputs
738+
vm = (jl_value_t*)jl_wrap_vararg(vm, N, 1, 0); // this cannot throw for these inputs
739739
}
740740
sp++;
741741
decl = ((jl_unionall_t*)decl)->body;
@@ -984,7 +984,7 @@ static void jl_compilation_sig(
984984
// avoid Vararg{Type{Type{...}}}
985985
if (jl_is_type_type(type_i) && jl_is_type_type(jl_tparam0(type_i)))
986986
type_i = (jl_value_t*)jl_type_type;
987-
type_i = (jl_value_t*)jl_wrap_vararg(type_i, (jl_value_t*)NULL, 1); // this cannot throw for these inputs
987+
type_i = (jl_value_t*)jl_wrap_vararg(type_i, (jl_value_t*)NULL, 1, 0); // this cannot throw for these inputs
988988
}
989989
else {
990990
type_i = inst_varargp_in_env(decl, sparams);

0 commit comments

Comments
 (0)