Skip to content
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

Fix https://github.com/Microsoft/TypeScript/issues/15436 #17367

Closed
wants to merge 1 commit into from

Conversation

ochanje210
Copy link

@ochanje210 ochanje210 commented Jul 24, 2017

I have found out that getTypeOfSymbol does not check if its parameter, symbol, exists and produce TypeError: Cannot read property 'flags' of undefined when using no-unused-variable from TSLint.

Fixes palantir/tslint#3001
Also, it is related to #15436

@msftclas
Copy link

@ochanje210,
Thanks for having already signed the Contribution License Agreement. Your agreement has not been validated yet. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@ochanje210 ochanje210 changed the title Fix https://github.com/palantir/tslint/issues/3001 Fix https://github.com/Microsoft/TypeScript/issues/15436 Jul 24, 2017
@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jul 24, 2017

Hey @ochanje210, thanks for the PR. I don't necessarily know if this is the correct fix - do other similar functions check for if a symbol is defined? Or do all callers need to make sure that symbols are defined before calling getTypeOfSymbol?

Additionally, we need a failing test case to ensure we don't have regressions.

@faceach
Copy link

faceach commented Jul 31, 2017

This change is necessary, and many ts-lint mistakes are hidden because of this issue.

@ochanje210
Copy link
Author

Thank you for your comments and apologies for being late since I've been busy lately. :(
I will try to find out if this is necessarily correct fix, in addition to the failing test case very soon. Also, anyone is welcome to continue this before I could do so.

@ochanje210 ochanje210 closed this Jul 31, 2017
@ochanje210 ochanje210 reopened this Jul 31, 2017
@msftclas
Copy link

@ochanje210,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by Microsoft. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@ochanje210
Copy link
Author

Closing this since it seems fixed with this commit: palantir/tslint@a479f43

@ochanje210 ochanje210 closed this Aug 2, 2017
@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.

4 participants