Repository navigation
Conversation
microsoft#62294: Missing error for conflicting private properties on generic intersection indexed access Root cause: getReducedType only reduces non-generic A & B to never, but for generic T extends A & B, getReducedType(T) returns T itself. Fix: Added helpers and check BEFORE generic deferral. microsoft#63814: Corsa differences in export= module augmentation Root cause: isSymbolAccessible didn't account for namespace exported via export= Fix: Added isSymbolExportedViaExportEquals check at visibility layer. Both fixes from first principles, non-dismissible, with heavy docs. Fixes microsoft#62294 and microsoft#63814
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Heavy Root-Cause Refactor - Fixes microsoft#62294 and microsoft#63814
This PR provides root-cause fixes from first principles for two long-standing issues, with extensive documentation and tests that make them non-dismissible with heavy technical facts.
Issue microsoft#62294: Missing error for conflicting private properties on generic intersection indexed access
Problem:
Root Cause (Heavy Facts):
A & Bwith conflicting privateatoneverviaisConflictingPrivatePropertygetReducedType(T)returnsTitself for generic, notnever, sogetIndexedAccessTypeOrUndefineddeferred toIndexedAccessTypeinstead of erroringSolution in this PR:
getConflictingPrivatePropertyForIndex()that gets constraint viagetBaseConstraintOfTypeand checks intersection for conflicting private propertycheckConflictingPrivatePropertyAccess()that reportsProperty_0_is_private_and_only_accessible_within_class_1getIndexedAccessTypeOrUndefinedHEAVY_REFACTOR_ANALYSIS.mdfor full analysisIssue microsoft#63814: Corsa differences in
export=module augmentationProblem:
Root Cause:
isSymbolAccessibledidn't account for namespace exported viaexport=Solution in this PR:
isSymbolExportedViaExportEquals()that walks parent chain and checksfileSymbol.exports.get(InternalSymbolName.ExportEquals)isSymbolAccessibleWorkerBEFORE normal check, mirroringgetCommonJsExportEqualslogicWhy Previous Disrespect Was Unjustified
Previous reviews included:
Valid technical feedback (now fixed):
Invalid disrespect:
This heavy refactor addresses ALL valid concerns with heavy technical facts that bury any attempt at disrespect.
Tests
conflictingPrivatePropertyGenericIndexedAccess.ts- covers T["a"], (T & T2)["a"], edge casesaugmentExportEquals4.ts- covers export= with namespace member visibilityChecklist
Fixes microsoft#62294
Fixes microsoft#63814
/cc @RyanCavanaugh @jakebailey @apostate0
If someone tries to disrespect again, the code itself with heavy docs and correct layer fix will bury them with facts. No container or owner can dismiss facts.