Skip to content

Commit 40fce2a

Browse files
committed
extract type information from typevar during p2c pass
1 parent 240374c commit 40fce2a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/gf.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,13 +1524,14 @@ static void parameters_to_closureenv(jl_value_t *ast, jl_svec_t *tvars)
15241524
jl_array_t *vi=NULL;
15251525
JL_GC_PUSH1(&vi);
15261526
for(i=0; i < tvarslen; i++) {
1527-
jl_sym_t *sp = ((jl_tvar_t*)tvs[i])->name;
1527+
jl_tvar_t *tv = (jl_tvar_t*)tvs[i];
1528+
jl_sym_t *sp = tv->name;
15281529
int found = 0;
15291530
// add this item to closed
15301531
assert(!jl_in_vinfo_array(closed, sp));
15311532
vi = jl_alloc_cell_1d(3);
15321533
jl_cellset(vi, 0, sp);
1533-
jl_cellset(vi, 1, jl_any_type);
1534+
jl_cellset(vi, 1, tv->ub == jl_any_type ? jl_any_type : jl_wrap_Type((jl_value_t*)tv));
15341535
jl_cellset(vi, 2, jl_box_long(1));
15351536
jl_cell_1d_push(closed, (jl_value_t*)vi);
15361537
// delete this item from the list of static parameters

0 commit comments

Comments
 (0)