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 incorrect cast target#19093

Merged
weswigham merged 1 commit into
mastermicrosoft/TypeScript:masterfrom
fix-invalid-castmicrosoft/TypeScript:fix-invalid-castCopy head branch name to clipboard
Oct 11, 2017
Merged

Fix incorrect cast target#19093
weswigham merged 1 commit into
mastermicrosoft/TypeScript:masterfrom
fix-invalid-castmicrosoft/TypeScript:fix-invalid-castCopy head branch name to clipboard

Conversation

@weswigham

Copy link
Copy Markdown
Member

Found while updating #18285 to latest master. Not sure what this fixes, but it was definitely incorrect - node must be a Block at this point, so this cast must have been intended for node.parent, which was checked against TryStatement right before it.

Hopefully this example can be further incentive that we'd really like to be using a discriminated union of node types. 🐱

Found while updating #18285 to latest master. Not sure what this fixes, but it was definitely incorrect - `node` must be a `Block` at this point, so this cast must have been intended for `node.parent`, which was checked against `TryStatement` right before it.
@weswigham weswigham requested review from amcasey and mhegazy October 11, 2017 01:25
@weswigham

Copy link
Copy Markdown
Member Author

@amcasey does whatever this affects have test coverage? I saw no test diff locally before or after this change.

@amcasey

amcasey commented Oct 11, 2017

Copy link
Copy Markdown
Member

@weswigham There appears not to be coverage for this particular code path. I'll add a test after you merge.

@weswigham weswigham merged commit 9f4130b into master Oct 11, 2017
@weswigham weswigham deleted the fix-invalid-cast branch October 11, 2017 21:52
@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

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