Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix type predicates with structurally identical types#12251

Merged
ahejlsberg merged 4 commits into
mastermicrosoft/TypeScript:masterfrom
fixTypePredicateStructuralMatchmicrosoft/TypeScript:fixTypePredicateStructuralMatchCopy head branch name to clipboard
Nov 15, 2016
Merged

Fix type predicates with structurally identical types#12251
ahejlsberg merged 4 commits into
mastermicrosoft/TypeScript:masterfrom
fixTypePredicateStructuralMatchmicrosoft/TypeScript:fixTypePredicateStructuralMatchCopy head branch name to clipboard

Conversation

@ahejlsberg

Copy link
Copy Markdown
Member

The special casing we implemented for instanceof in #10216 also ended up also applying to similar type predicates. This fix reverts type predicates to their original behavior.

Fixes #12235.

@ahejlsberg ahejlsberg merged commit 73ada7a into master Nov 15, 2016
@ahejlsberg ahejlsberg deleted the fixTypePredicateStructuralMatch branch November 15, 2016 21:20
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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.

Narrowing a type union with user-defined type guard

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.