-
Notifications
You must be signed in to change notification settings - Fork 1.7k
The type '((dynamic) → dynamic) → Iterable<dynamic>' is declared with 0 type parameters, but 0 type arguments were given #25641
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
@alan-knight is this in the command line analyzer or IDE? I've seen this too, and the command line analyzer side was recently fixed. What's going on is we're analyzing against the SDK without strong mode turned on, which means no generic methods. |
Another guess, we don't do upward inference on constructors -- so |
This is in Intellij, using, I think, 1.14.0_dev_7_2. It might be that it doesn't have that flag turned on for the SDK, not sure how to tell. |
If this in in IntelliJ, then you're running server and we're not setting this flag appropriately. @jmesserly What would the effect be of setting strong-mode in the SDK context if it isn't set in the user's context? (I'm just wondering if, until we get it fixed, we can make life better for folks by reversing the default.) |
@bwilkerson That may have unintended consequences? I don't think we have any testing of non-strong user code and against strong SDK. In theory, inferred elements in the SDK could change errors and warnings in non-strong user code. How hard would a real fix be? |
Good point.
I working on it now, I just need to carve out enough time. I'm hoping to have it done by the end of the week unless other issues take priority. |
General bug filed: |
General bug is fixed. I'll double check where this is at now. Regardless we need to fix the "0 type args 0 type params" message |
Confirmed Alan's bug is fixed. Here's a new repro: f() {}
main() {
// [warning] The type '() → dynamic' is declared with 0 type parameters, but 0 type arguments were given
f/*<int>*/();
} |
Found it. It's a silly bug :) |
From Intl: test/date_time_format_test_core.dart:369
The code below, which was previously passing, now gives warnings.
WARNING: The type '((dynamic) → dynamic) → Iterable' is declared with 0 type parameters, but 0 type arguments were given ([intl] test/date_time_format_test_core.dart:369)
and also
WARNING: new Iterable.generate(365 + leapDay, (n) => n + 1).map((day) {var result = new DateTime(year, 1, day); if (result.toUtc() == result) result = new DateTime(year, 1, day); return result;}).toList().asMap() (Map<int, dynamic>) will need runtime check to cast to type Map<int, DateTime>
The second is more reasonable, although I'd have thought it could be inferred.
The text was updated successfully, but these errors were encountered: