Skip to content

Commit 6876f2c

Browse files
committed
Fix #30807
1 parent d1ed21e commit 6876f2c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/jltypes.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,6 +1751,11 @@ jl_vararg_marker_t *jl_wrap_vararg(jl_value_t *t, jl_value_t *n)
17511751
jl_errorf("Vararg length is negative: %zd", jl_unbox_long(n));
17521752
}
17531753
}
1754+
if (t) {
1755+
if (!jl_is_typevar(t) && !jl_is_type(t)) {
1756+
jl_type_error_rt("Vararg", "type", (jl_value_t*)jl_type_type, t);
1757+
}
1758+
}
17541759
jl_ptls_t ptls = jl_get_ptls_states();
17551760
jl_vararg_marker_t *vm = (jl_vararg_marker_t *)jl_gc_alloc(ptls, sizeof(jl_vararg_marker_t), jl_vararg_marker_type);
17561761
vm->T = t;

test/core.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7507,3 +7507,6 @@ let array = Int[]
75077507
end
75087508
@test compare_union37557(Ref{Union{Int,Vector{Int}}}(1),
75097509
Ref{Union{Int,Vector{Int}}}(1))
7510+
7511+
# Issue #30807
7512+
@test_throws TypeError NTuple{<:Any, 3}

0 commit comments

Comments
 (0)