Skip to content

Fix incorrect cast target #19093

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

Merged
merged 1 commit into from
Oct 11, 2017
Merged

Fix incorrect cast target #19093

merged 1 commit into from
Oct 11, 2017

Conversation

weswigham
Copy link
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 mhegazy and amcasey October 11, 2017 01:25
@weswigham
Copy link
Member Author

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

@amcasey
Copy link
Member

amcasey commented Oct 11, 2017

@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