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

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

Open
kazuho opened this issue Dec 27, 2013 · 2 comments
Open

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

kazuho opened this issue Dec 27, 2013 · 2 comments

Comments

@kazuho
Copy link
Member

kazuho commented Dec 27, 2013

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.

@kazuho
Copy link
Member Author

kazuho commented Dec 27, 2013

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

@nyuichi
Copy link
Member

nyuichi commented Dec 27, 2013

👍

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

2 participants