Skip to content

Keep partial labels in createTupleTargetType - #3

Merged
JoshuaKGoldberg merged 1 commit into
JoshuaKGoldberg:mixed-tuple-namingfrom
Andarist:keep-partial-labels-tuple-target-types
Mar 27, 2023
Merged

Keep partial labels in createTupleTargetType#3
JoshuaKGoldberg merged 1 commit into
JoshuaKGoldberg:mixed-tuple-namingfrom
Andarist:keep-partial-labels-tuple-target-types

Conversation

@Andarist

Copy link
Copy Markdown

No description provided.

Comment thread src/compiler/checker.ts
else {
expandedDeclarations = undefined;
}
expandedDeclarations.push(declaration);

@Andarist Andarist Mar 27, 2023

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the core of the fix, previously an unlabeled element was discarding the expandedDeclarations

Comment thread src/compiler/checker.ts
}

function createTupleType(elementTypes: readonly Type[], elementFlags?: readonly ElementFlags[], readonly = false, namedMemberDeclarations?: readonly (NamedTupleMember | ParameterDeclaration | undefined)[]) {
function createTupleType(elementTypes: readonly Type[], elementFlags?: readonly ElementFlags[], readonly = false, namedMemberDeclarations: readonly (NamedTupleMember | ParameterDeclaration | undefined)[] = []) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't exactly required for the fix, it's just more convenient to work with defined properties...

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JoshuaKGoldberg
JoshuaKGoldberg merged commit 3431d24 into JoshuaKGoldberg:mixed-tuple-naming Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants