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 @@ -2495,6 +2495,8 @@ void jl_reinstantiate_inner_types(jl_datatype_t *t) // can throw!
2495
2495
2496
2496
for (j = 0 ; j < jl_array_len (partial ); j ++ ) {
2497
2497
jl_datatype_t * ndt = (jl_datatype_t * )jl_array_ptr_ref (partial , j );
2498
+ if (ndt == NULL )
2499
+ continue ;
2498
2500
assert (jl_unwrap_unionall (ndt -> name -> wrapper ) == (jl_value_t * )t );
2499
2501
for (i = 0 ; i < n ; i ++ )
2500
2502
env [i ].val = jl_svecref (ndt -> parameters , i );
@@ -2506,6 +2508,8 @@ void jl_reinstantiate_inner_types(jl_datatype_t *t) // can throw!
2506
2508
if (t -> types != jl_emptysvec ) {
2507
2509
for (j = 0 ; j < jl_array_len (partial ); j ++ ) {
2508
2510
jl_datatype_t * ndt = (jl_datatype_t * )jl_array_ptr_ref (partial , j );
2511
+ if (ndt == NULL )
2512
+ continue ;
2509
2513
for (i = 0 ; i < n ; i ++ )
2510
2514
env [i ].val = jl_svecref (ndt -> parameters , i );
2511
2515
assert (ndt -> types == NULL );
@@ -2514,7 +2518,9 @@ void jl_reinstantiate_inner_types(jl_datatype_t *t) // can throw!
2514
2518
if (ndt -> isconcretetype ) { // cacheable
2515
2519
jl_compute_field_offsets (ndt );
2516
2520
}
2521
+ jl_array_ptr_set (partial , j , NULL );
2517
2522
}
2523
+ t -> name -> partial = NULL ;
2518
2524
}
2519
2525
else {
2520
2526
assert (jl_field_names (t ) == jl_emptysvec );
Original file line number Diff line number Diff line change @@ -7551,6 +7551,19 @@ end
7551
7551
struct T36104 # check that redefining it works, issue #21816
7552
7552
v:: Vector{T36104}
7553
7553
end
7554
+ struct S36104{K,V}
7555
+ v:: S36104{K,V}
7556
+ S36104 {K,V} () where {K,V} = new ()
7557
+ S36104 {K,V} (x:: S36104 ) where {K,V} = new (x)
7558
+ end
7559
+ @test ! isdefined (Base. unwrap_unionall (Base. ImmutableDict). name, :partial )
7560
+ @test ! isdefined (S36104. body. body. name, :partial )
7561
+ @test hasfield (typeof (S36104. body. body. name), :partial )
7562
+ struct S36104{K,V} # check that redefining it works
7563
+ v:: S36104{K,V}
7564
+ S36104 {K,V} () where {K,V} = new ()
7565
+ S36104 {K,V} (x:: S36104 ) where {K,V} = new (x)
7566
+ end
7554
7567
# with a gensymmed unionall
7555
7568
struct Symmetric{T,S<: AbstractMatrix{<:T} } <: AbstractMatrix{T}
7556
7569
data:: S
You can’t perform that action at this time.
0 commit comments