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

Incorrect type warning on "symbol in object" expression #3060

Closed
rconnamacher opened this issue Aug 26, 2018 · 3 comments
Closed

Incorrect type warning on "symbol in object" expression #3060

rconnamacher opened this issue Aug 26, 2018 · 3 comments
Assignees

Comments

@rconnamacher
Copy link

Closure Compiler's type warnings show an incorrect type error when using a symbol on the left side of an in expression:

src/js/SourceFile:100: WARNING - left side of 'in'
found   : symbol
required: string
        if ( SYMBOL in record ) {
              ^^^^^^^^^

This should be updated to allow either a string or symbol on the left side of in.

(Using --compilation_level=ADVANCED_OPTIMIZATIONS, --language_out=ECMASCRIPT5_STRICT, and Closure Compiler version 20180805

@rconnamacher rconnamacher changed the title Incorrect type warning on aSymbol in anObject Incorrect type warning on "symbol in object" expression Aug 26, 2018
@concavelenz
Copy link
Contributor

I added support for symbol as a primitive type to the type system and type checker, but I clearly missed "in". It should be a trivial fix.

@concavelenz concavelenz self-assigned this Sep 14, 2018
@concavelenz
Copy link
Contributor

Thanks for the report. I have a fix out for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants