-
Notifications
You must be signed in to change notification settings - Fork 26
Typedef with untyped args appear to generate spurious downcast messages #10
Comments
Hmm, I think the DownCast may be due to the static type of (_) => "bar" being dynamic -> dynamic. I.e., in our the type system (both Dart and our stricter one), the return type of a lambda (=>) is dynamic. So, the DownCast would be from dynamic -> dynamic (the type of the function literals) to dynamic -> String (StringProvider). This should be a coercion though I think. |
The DownCast warning I get is on the line invoking the StringProvider not the one defining it. |
What happens if you break that into two lines: Wondering which one it's complaining about.... |
This error is still here. This is the warning: If that last line is rewritten as follows: |
This example does the right thing now - no down cast. |
Maybe I am confused about where the downcast is coming from but I don't understand why this generates a downcast.
The text was updated successfully, but these errors were encountered: