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

dart2js: consider emitting known type errors even with omit-implicit-checks #35961

Open
sigmundch opened this issue Feb 15, 2019 · 0 comments
Open
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. P2 A bug or feature request we're likely to work on web-dart2js

Comments

@sigmundch
Copy link
Member

Sometimes we optimize based on the fact that errors would be thrown. For example: we might get rid of the rest of the code in a loop if we know that a statement throws.

If that statement is a type-error and the compiler was given --omit-implicit-checks, we end up with a bad combo: errors are not thrown, but the loop now is different. Some users have seen the loop turn into an infinite loop as a result.

We are considering to keep around type errors that we know statically that will throw (note: we can't make it a static error, because it might be in a codepath that is not reached dynamically.). To keep those type errors, we should also be careful not to pull in unnecessary RTI data. Since we know already statically that it will fail, we might be able to strip the type details (e.g. if the reason of the failure is on the raw type, then remove the type parameters from the check by using the 'any' type parameter).

@sigmundch sigmundch added web-dart2js P2 A bug or feature request we're likely to work on labels Feb 15, 2019
@vsmenon vsmenon added the area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. label Jul 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. P2 A bug or feature request we're likely to work on web-dart2js
Projects
None yet
Development

No branches or pull requests

2 participants