-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Pad object literal types with implicit anys based on binding pattern elements #59924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c28ea26
7dc8ef0
32217ae
5bcd475
9ca5c51
e468300
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6010,7 +6010,6 @@ export interface SymbolLinks { | |
exportsChecked?: boolean; // True if exports of external module have been checked | ||
typeParametersChecked?: boolean; // True if type parameters of merged class and interface declarations have been checked. | ||
isDeclarationWithCollidingName?: boolean; // True if symbol is block scoped redeclaration | ||
bindingElement?: BindingElement; // Binding element associated with property symbol | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
originatingImport?: ImportDeclaration | ImportCall; // Import declaration which produced the symbol, present if the symbol is marked as uncallable but had call signatures in `resolveESModuleSymbol` | ||
lateSymbol?: Symbol; // Late-bound symbol for a computed property | ||
specifierCache?: Map<ModeAwareCacheKey, string>; // For symbols corresponding to external modules, a cache of incoming path -> module specifier name mappings | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8750,7 +8750,6 @@ declare namespace ts { | |
function isJSDocCommentContainingNode(node: Node): boolean; | ||
function isSetAccessor(node: Node): node is SetAccessorDeclaration; | ||
function isGetAccessor(node: Node): node is GetAccessorDeclaration; | ||
/** True if has initializer node attached to it. */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one was copied over from an internal function declared above it, I don't think this comment is true as it made much more sense for the other function |
||
function hasOnlyExpressionInitializer(node: Node): node is HasExpressionInitializer; | ||
function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; | ||
function isStringLiteralLike(node: Node | FileReference): node is StringLiteralLike; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be a narrower type than just Node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this implementation, it could be
Expression | BindingPattern | BindingElement
if you'd prefer that.2 extra notes that come to my mind now:
contextualTypes
stack for this and I should just introduce a new one? It seemed fine here to avoid creating a new but then reusinggetContextualType
wasn't possible so it's slightly weird now that I'm only using part of the existing pattern . Perhaps with a new context flag it would be possible but introducinggetContextualPaddingType
seemed easiergetContextualPaddingType
with support for array patterns and usingpushContextualType
/popContextualType
inpadTupleType
. Since this PR tries to address a regression in a backportable manner I refrained from doing this to avoid any new unforeseen behavioral changes