-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Dart 1.23 (strong mode) can not infer the type well #29437
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
Comments
@floitschG language or analyzer issue? |
I believe that analyzer is implementing the specification correctly. |
But the implementation changed in 1.23 (the original bug text says it worked in 1.22.1)? |
Strong mode top level inference restrictions (#28218) were incrementally rolled out in 1.23 (note that we issue a hint not an error). These will become errors in 1.24. |
Sorry, I don't get it. Does it mean I have to specify the type explicitly even though it can be inferred from the expression? And, this restriction is only applied to top-level variables, while local variables has no such limitation? |
We've rolled back the proposed restrictions to top level inference. This should work again. |
Uh oh!
There was an error while loading. Please reload this page.
With the following code:
Dart 1.23 (dartanalyzer) said "hint • The type of 'val' can't be inferred because of the use of the instance getter 'inSeconds'"
The text was updated successfully, but these errors were encountered: