-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Missing generic type doesn't show a warning #26914
Comments
yeah. This is intended behavior. @leafpetersen (and @munificent too?) thought we did not want to warn about missing generics in type annotations. My initial implementation actually did, though, because it felt more consistent to me. So this is good feedback. (Perhaps we should make this more clear in the documentation too: https://github.com/dart-lang/dev_compiler/blob/master/doc/STATIC_SAFETY.md#disable-implicit-dynamic) I think the reasoning is more or less: I described this as a "no-implicit-generic-types" option here: #25573 (comment), but it wasn't clear to us if it was worth adding that flag. Also we may want to consider implicit-Object instead. p.s. @zoechi HUGE thanks for trying this out!!! This feedback is immensely valuable, keep it coming :) (and feel free to disagree with us too, we definitely don't get these right the first time.) |
duping against #26784 but definitely let's continue the discussion on this one |
I'm not entirely sure which part is the bug here. It looks like you are maybe using a lint rule, and the lint is not kicking in for the use of DataItem in the class? Is that the issue? If so, this isn't strong mode related. As @jmesserly says the strong-mode no-implicit-dynamic flag currently only warns on places where strong mode could have inferred a type (but failed). We may reconsider this based on feedback though. |
yeah, let me know if I misinterpreted that. I used the context of your other bugs to assume this report was about a difference between the "lint" and the "no-implicit-dynamic" feature. |
@leafpetersen it's possible, I'm still trying to understand all the implications of using no-implicit-dynamic Currently I'm struggling to combine the comments here and the response I got in #26901 (comment) from @jmesserly I'm not sure if it is now expected to get hints/warnings for missing type arguments or not from no-implicit-dynamic |
So basically, when you use a generic class as a type, and leave off the generic arguments, Clearly this point is confusing, which suggests we may have either made the wrong choice on generic classes used as types, and/or picked the wrong name for the flag. I think at one point we were considering calling this |
Ouch, I have a sub-project where I forgot to remove |
see comment in
AddNewRow
class:here the analyzer complains for the same type
and if I add one I get another hint because
AddnewRow.item
isn't compatiblewith
implicit-dynamic: false
The text was updated successfully, but these errors were encountered: