feat(47595): allow using private fields in type queries - #4714
Open
a-tarasyuk wants to merge 2 commits into
Open
feat(47595): allow using private fields in type queries#4714a-tarasyuk wants to merge 2 commits into
a-tarasyuk wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements private identifiers in indexed-access type queries, including parsing, checking, declaration emit, API exposure, and baselines.
Changes:
- Adds
PrivateNameTypeAST and checker support. - Resolves private-name indexed accesses safely during declaration emit.
- Adds conformance coverage and updates generated APIs/baselines.
Reviewed changes
Copilot reviewed 37 out of 42 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
testdata/tests/cases/conformance/classes/members/privateNames/privateNameInTypeQuery.ts |
Adds conformance cases. |
testdata/baselines/reference/submodule/conformance/privateNamesAndIndexedAccess.types.diff |
Records type convergence. |
testdata/baselines/reference/submodule/conformance/privateNamesAndIndexedAccess.types |
Updates type baseline. |
testdata/baselines/reference/submodule/conformance/privateNamesAndIndexedAccess.symbols.diff |
Records symbol convergence. |
testdata/baselines/reference/submodule/conformance/privateNamesAndIndexedAccess.symbols |
Updates symbol baseline. |
testdata/baselines/reference/submodule/conformance/privateNamesAndIndexedAccess.js.diff |
Records emit convergence. |
testdata/baselines/reference/submodule/conformance/privateNamesAndIndexedAccess.js |
Updates JavaScript baseline. |
testdata/baselines/reference/submodule/conformance/privateNamesAndIndexedAccess.errors.txt.diff |
Records diagnostic convergence. |
testdata/baselines/reference/submodule/conformance/privateNamesAndIndexedAccess.errors.txt |
Updates diagnostics baseline. |
testdata/baselines/reference/conformance/privateNameInTypeQuery.types |
Adds type baseline. |
testdata/baselines/reference/conformance/privateNameInTypeQuery.symbols |
Adds symbol baseline. |
testdata/baselines/reference/conformance/privateNameInTypeQuery.js |
Adds emit/declaration baseline. |
testdata/baselines/reference/conformance/privateNameInTypeQuery.errors.txt |
Adds diagnostics baseline. |
internal/transformers/tstransforms/typeserializer.go |
Handles metadata serialization. |
internal/transformers/tstransforms/typeeraser.go |
Erases private-name types. |
internal/transformers/declarations/transform.go |
Resolves declaration-emitted indexed accesses. |
internal/printer/printer.go |
Prints private-name types. |
internal/printer/emitresolver.go |
Extends declaration resolver API. |
internal/parser/parser.go |
Parses private identifiers as types. |
internal/nodebuilder/types.go |
Adds private-name resolution flag. |
internal/ls/inlay_hints.go |
Supports inlay-hint display. |
internal/checker/utilities.go |
Supports comparison and property lookup. |
internal/checker/types.go |
Defines private-name type flags/data. |
internal/checker/nodebuilderimpl.go |
Builds and resolves type nodes. |
internal/checker/emitresolver.go |
Resolves indexed accesses for emit. |
internal/checker/checker.go |
Implements checking and resolution semantics. |
internal/ast/precedence.go |
Defines type precedence. |
internal/ast/kind_stringer_generated.go |
Updates generated kind strings. |
internal/ast/kind_generated.go |
Adds the AST kind. |
internal/ast/ast_generated.go |
Adds the Go AST node. |
internal/api/encoder/encoder_generated.go |
Encodes private-name nodes. |
internal/api/encoder/decoder_generated.go |
Decodes private-name nodes. |
_scripts/ast.json |
Defines the generated AST schema. |
_packages/native-preview/src/enums/typeFlags.ts |
Updates generated type flags. |
_packages/native-preview/src/enums/typeFlags.enum.ts |
Exposes the new type flag. |
_packages/native-preview/src/enums/syntaxKind.ts |
Updates generated syntax kinds. |
_packages/native-preview/src/enums/syntaxKind.enum.ts |
Exposes the new syntax kind. |
_packages/native-preview/src/ast/visitor.generated.ts |
Visits private-name nodes. |
_packages/native-preview/src/ast/is.generated.ts |
Adds the node type guard. |
_packages/native-preview/src/ast/factory.generated.ts |
Adds factory/update functions. |
_packages/native-preview/src/ast/ast.generated.ts |
Adds the TypeScript AST interface. |
_packages/native-preview/src/api/node/protocol.generated.ts |
Describes protocol child properties. |
Files not reviewed (5)
- internal/api/encoder/decoder_generated.go: Generated file
- internal/api/encoder/encoder_generated.go: Generated file
- internal/ast/ast_generated.go: Generated file
- internal/ast/kind_generated.go: Generated file
- internal/ast/kind_stringer_generated.go: Generated file
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.
Fixes microsoft/TypeScript#47595