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
{{ message }}
Repository navigation
Missing error about inability to access conflicting private properties on generic types involving intersections #62294
classA{privatea: {foo: number};}classB{privatea: {bar: string};}typeX<TextendsA>=[T["a"],(T|B)["a"]];// errorstypeY<TextendsA|B>=T["a"];// errortypeZ<TextendsA&B>=T["a"];// no error?typeZ_<TextendsA&B>=T["a"]["b"]["c"]["d"];// look, we can even go crazy and access deep unknown propertiestypeZ1<TextendsA>=T["a"];// errortypeZ2<TextendsB>=T["a"];// errortypeZ3<TextendsA,T2extendsB>=(T&T2)["a"];// no error?typeZ3_<TextendsA,T2extendsB>=(T&T2)["a"]["b"]["c"]["d"];// look, we can even go crazy and access deep unknown properties
🙁 Actual behavior
Z, Z_, Z3 and Z3_ have no errors
🙂 Expected behavior
I would expect the above type aliases to all contain errors
I'd like to investigate this. The issue is clear — Z, Z_, Z3,
and Z3_ should all error when accessing private properties on
intersection types, consistent with the other cases.
I'll look at checker.ts around the indexed access type resolution
and the intersection reduction logic from #37762.
I've now opened PR #63548 with the fix. The check uses the
existing isConflictingPrivateProperty helper that was already
used in getReducedType — just wasn't being called in the indexed
access path.
Activity
hesam-oxe commentedon May 12, 2026
I'd like to investigate this. The issue is clear —
Z,Z_,Z3,and
Z3_should all error when accessing private properties onintersection types, consistent with the other cases.
I'll look at
checker.tsaround the indexed access type resolutionand the intersection reduction logic from #37762.
/assign
hesam-oxe commentedon Jun 11, 2026
Mateusz Burzyński (@Andarist) Ryan Cavanaugh (@RyanCavanaugh) Apologies for the delay — I was deep in
LLVM X86 backend fixes and OWASP security benchmarks and this
slipped through the cracks.
I've now opened PR #63548 with the fix. The check uses the
existing
isConflictingPrivatePropertyhelper that was alreadyused in
getReducedType— just wasn't being called in the indexedaccess path.
Ready for review! 🙏