Skip to content

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

Closed
@rconnamacher

Description

@rconnamacher

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions