File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2491,6 +2491,8 @@ void jl_reinstantiate_inner_types(jl_datatype_t *t) // can throw!
24912491
24922492 for (j = 0 ; j < jl_array_len (partial ); j ++ ) {
24932493 jl_datatype_t * ndt = (jl_datatype_t * )jl_array_ptr_ref (partial , j );
2494+ if (ndt == NULL )
2495+ continue ;
24942496 assert (jl_unwrap_unionall (ndt -> name -> wrapper ) == (jl_value_t * )t );
24952497 for (i = 0 ; i < n ; i ++ )
24962498 env [i ].val = jl_svecref (ndt -> parameters , i );
@@ -2502,6 +2504,8 @@ void jl_reinstantiate_inner_types(jl_datatype_t *t) // can throw!
25022504 if (t -> types != jl_emptysvec ) {
25032505 for (j = 0 ; j < jl_array_len (partial ); j ++ ) {
25042506 jl_datatype_t * ndt = (jl_datatype_t * )jl_array_ptr_ref (partial , j );
2507+ if (ndt == NULL )
2508+ continue ;
25052509 for (i = 0 ; i < n ; i ++ )
25062510 env [i ].val = jl_svecref (ndt -> parameters , i );
25072511 assert (ndt -> types == NULL );
@@ -2510,7 +2514,9 @@ void jl_reinstantiate_inner_types(jl_datatype_t *t) // can throw!
25102514 if (ndt -> isconcretetype ) { // cacheable
25112515 jl_compute_field_offsets (ndt );
25122516 }
2517+ jl_array_ptr_set (partial , j , NULL );
25132518 }
2519+ t -> name -> partial = NULL ;
25142520 }
25152521 else {
25162522 assert (jl_field_names (t ) == jl_emptysvec );
Original file line number Diff line number Diff line change @@ -7544,6 +7544,19 @@ end
75447544struct T36104 # check that redefining it works, issue #21816
75457545 v:: Vector{T36104}
75467546end
7547+ struct S36104{K,V}
7548+ v:: S36104{K,V}
7549+ S36104 {K,V} () where {K,V} = new ()
7550+ S36104 {K,V} (x:: S36104 ) where {K,V} = new (x)
7551+ end
7552+ @test ! isdefined (Base. unwrap_unionall (Base. ImmutableDict). name, :partial )
7553+ @test ! isdefined (S36104. body. body. name, :partial )
7554+ @test hasfield (typeof (S36104. body. body. name), :partial )
7555+ struct S36104{K,V} # check that redefining it works
7556+ v:: S36104{K,V}
7557+ S36104 {K,V} () where {K,V} = new ()
7558+ S36104 {K,V} (x:: S36104 ) where {K,V} = new (x)
7559+ end
75477560# with a gensymmed unionall
75487561struct Symmetric{T,S<: AbstractMatrix{<:T} } <: AbstractMatrix{T}
75497562 data:: S
You can’t perform that action at this time.
0 commit comments