Skip to content

Commit c5fd602

Browse files
committed
fix #39698 by disabling the unnecessary Vararg var bounds error
backports #39875 to 1.6
1 parent 859577b commit c5fd602

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/jltypes.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,9 +1166,14 @@ static jl_value_t *inst_datatype_inner(jl_datatype_t *dt, jl_svec_t *p, jl_value
11661166
if (jl_is_vararg_type((jl_value_t*)dt) && ntp == 2) {
11671167
jl_value_t *lenparam = iparams[1];
11681168
if (jl_is_typevar(lenparam)) {
1169+
// TODO: this is disabled due to #39698; it is also inconsistent
1170+
// with other similar checks, where we usually only check substituted
1171+
// values and not the bounds of variables.
1172+
/*
11691173
jl_tvar_t *N = (jl_tvar_t*)lenparam;
11701174
if (!(N->lb == jl_bottom_type && N->ub == (jl_value_t*)jl_any_type))
11711175
jl_error("TypeVar in Vararg length must have bounds Union{} and Any");
1176+
*/
11721177
}
11731178
else if (!jl_is_long(lenparam)) {
11741179
jl_type_error_rt("Vararg", "count", (jl_value_t*)jl_long_type, lenparam);

0 commit comments

Comments
 (0)