What does Core.PartialStruct means for type stability?

As I understand it, Core.Const and Core.PartialStruct are the bits in Julia IR that allow Julia to do constant propagation. When some constant is known — like the tuple (:a, :b) above — Julia annotates its IR with a ::Core.Const instead of just a ::Tuple{Symbol, Symbol}.

PartialStruct is for when some struct has some constants. So instead of just ::Tuple{String, Matrix{Float64}}, Julia additionally knows that the first field is a constant "test", while the second is a dynamically created matrix.

The fact that the IR uses an Any array to encode this is an implementation detail of the compiler itself, and not a problem with your code at all.

7 Likes