julia
49e76f1e - inference: Better `setfield!` modeling on `const` field of `PartialStruct` (#62234)

Commit
20 days ago
inference: Better `setfield!` modeling on `const` field of `PartialStruct` (#62234) For ordinary `DataType` objects, `setfield!_tfunc` already widens a `setfield!` on a `const` field to `Bottom`, since storing into a const field always throws at runtime. The `PartialStruct` branch of `_getfield_tfunc` did not apply the same check and instead returned the refined field type, so `setfield!_tfunc` reported a non-`Bottom` result for a `setfield!` on a const field of a value modeled as a `PartialStruct`. Apply the same `isconst` guard on that branch so the result is consistently inferred as `Bottom`.
Author
Parents
Loading