Skip to content

Move utilities for getting type parameter constraints and defaults from public lazy members to services#20162

Merged
weswigham merged 1 commit into
microsoft:masterfrom
weswigham:typeParameter-public-api
Nov 28, 2017
Merged

Move utilities for getting type parameter constraints and defaults from public lazy members to services#20162
weswigham merged 1 commit into
microsoft:masterfrom
weswigham:typeParameter-public-api

Conversation

@weswigham
Copy link
Copy Markdown
Member

Fixes #20137

@weswigham weswigham requested review from a user and mhegazy November 20, 2017 18:53
Comment thread src/compiler/types.ts
getSuggestionForNonexistentSymbol(location: Node, name: string, meaning: SymbolFlags): string | undefined;
/* @internal */ getBaseConstraintOfType(type: Type): Type | undefined;
getBaseConstraintOfType(type: Type): Type | undefined;
getDefaultFromTypeParameter(type: Type): Type | undefined;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why not just take a TypeParameter as input?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just to be the same as getBaseConstraintOfType. Which, BTW, getBaseConstraintOfType technically returns the resolvedBaseConstraint, while getConstraintFromTypeParameter would actually return the constraint; the different being that getBaseConstraintOfType follows all the constraints on your constraints to get the actual final constraint, while getConstraintFromTypeParameter is just the immediate constraint. Should we be exposing both?

@weswigham weswigham merged commit 5ee640d into microsoft:master Nov 28, 2017
@weswigham weswigham deleted the typeParameter-public-api branch November 28, 2017 21:37
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants