diff --git a/src/dump.c b/src/dump.c index ae3e4991b86ef..e19876d0ef285 100644 --- a/src/dump.c +++ b/src/dump.c @@ -196,7 +196,7 @@ static void jl_serialize_datatype(jl_serializer_state *s, jl_datatype_t *dt) JL_ if (!internal && jl_unwrap_unionall(dt->name->wrapper) == (jl_value_t*)dt) { tag = 6; // external primary type } - else if (!dt->isconcretetype) { + else if (jl_is_tuple_type(dt) ? !dt->isconcretetype : dt->hasfreetypevars) { tag = 0; // normal struct } else if (internal) { @@ -212,8 +212,8 @@ static void jl_serialize_datatype(jl_serializer_state *s, jl_datatype_t *dt) JL_ tag = 11; // external, but definitely new (still needs caching, but not full unique-ing) } else { - // this'll need unique-ing later - // flag this in the backref table as special + // this is eligible for (and possibly requires) unique-ing later, + // so flag this in the backref table as special uintptr_t *bp = (uintptr_t*)ptrhash_bp(&backref_table, dt); assert(*bp != (uintptr_t)HT_NOTFOUND); *bp |= 1; diff --git a/test/precompile.jl b/test/precompile.jl index a6aa60009ba6e..f69e7a4766f2c 100644 --- a/test/precompile.jl +++ b/test/precompile.jl @@ -95,6 +95,7 @@ precompile_test_harness(false) do dir const t17809s = Any[ Tuple{ Type{Ptr{MyType{i}}}, + Ptr{Type{MyType{i}}}, Array{Ptr{MyType{MyType{:sym}()}}(0), 0}, Val{Complex{Int}(1, 2)}, Val{3}, @@ -340,6 +341,7 @@ precompile_test_harness(false) do dir @test all(i -> Foo.t17809s[i + 1] === Tuple{ Type{Ptr{Foo.MyType{i}}}, + Ptr{Type{Foo.MyType{i}}}, Array{Ptr{Foo.MyType{Foo.MyType{:sym}()}}(0), 0}, Val{Complex{Int}(1, 2)}, Val{3},