You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Narrow TemplateMixedType in TypeCombinator::intersect() for scalar types
Revert IntersectionType changes and instead narrow TemplateMixedType
to a concrete template type (e.g. TemplateIntegerType) when intersected
with a scalar type in TypeCombinator::intersect().
For `int & T` where T is TemplateMixedType, the result is now
`T of int` (TemplateIntegerType) instead of an IntersectionType.
Since TemplateIntegerType delegates hasMethod() to IntegerType (which
returns No for __toString), the false positive purity error is avoided.
The narrowing is restricted to scalar types only. Narrowing object
or array types would cause information loss during template resolution
(e.g. `T&MockObject` becoming just the resolved type without MockObject).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments