google / google/closure-compiler

The compiler doesn't warn about dot access on a dict in some cases

Open
#534 0 comments 0 reactions 0 assignees View on GitHub
bug OTI P2
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

This was originally discussed here:
https://groups.google.com/forum/#!topic/closure-compiler-discuss/iqmjfjruSzs

This works as intended in the new type inference, so it will be fixed when the new inference lands. See:
http://closure-compiler-debugger.appspot.com/#input0%3D%252F**%250A%2520*%2520%2540constructor%250A%2520*%2520%2540dict%250A%2520*%252F%250Afunction%2520MyDict%28%29%2520%257B%257D%250A%250A%252F**%2520%2540constructor%2520*%252F%250Afunction%2520High%28%29%2520%257B%250A%2520%2520%252F**%2520%2540type%2520%257B!MyDict%257D%2520*%252F%2520this.prop%253B%250A%257D%250A%250A%252F**%250A%2520*%2520%2540constructor%250A%2520*%2520%2540extends%2520%257BHigh%257D%250A%2520*%252F%250Afunction%2520Low%28x%29%2520%257B%250A%2520%2520this.prop%2520%253D%2520x%253B%250A%2520%2520this.prop.foo%2520%253D%2520123%253B%250A%257D%250A%26input1%26externs%26CHECK_SYMBOLS%3D1%26CHECK_TYPES_NEW_INFERENCE%3D1%26LANG_IN_IS_ES6%3D1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.