jsx / JSX

JSX - a faster, safer, easier JavaScript

Home Page:http://jsx.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

emit compiler warning for casts from variant to typed Array or Map

kazuho opened this issue · comments

Due to the typeless nature of JavaScript, the JSX compiler cannot determine the element type of Arrays / Maps. For example, it is impossible to throw an exception when an array containing a string is casted to Array.<number>.

But since such use is often found in our applications, we should better emit compiler warnings for such cases.

We should promote legitimate use of such casts to use as __nocheck__ instead, to keep the S/N ratio of the warnings.