You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is that we cannot use any with Strong mode turned on. For example:
intf(List<int> l) => l[0];
voidmain() {
f(any);
}
Yields an analyzer error (dartanalyzer --strong a.dart): "Unsound implicit cast from dynamic to List".
I think we can solve this on the Mockito side, similar to Java Mockito's any().
I have a prototype implementation that uses the Strong mode type parameter comments:
/*=T*/ any/*<T>*/([/*=T*/ e =null]) =>null;
The tricky part is that any would now return null, instead of the _ArgMatcher (again similar to Java Mockito's, and we would have to implement something like Java Mockito's reportMatcher(), maybe changing how the whole matching situation works...
What do you think? Any thoughts or other ideas?
The text was updated successfully, but these errors were encountered:
This is a sibling issue to dart-lang/sdk#26036.
The issue is that we cannot use
any
with Strong mode turned on. For example:Yields an analyzer error (
dartanalyzer --strong a.dart
): "Unsound implicit cast from dynamic to List".I think we can solve this on the Mockito side, similar to Java Mockito's
any()
.I have a prototype implementation that uses the Strong mode type parameter comments:
The tricky part is that
any
would now returnnull
, instead of the_ArgMatcher
(again similar to Java Mockito's, and we would have to implement something like Java Mockito's reportMatcher(), maybe changing how the whole matching situation works...What do you think? Any thoughts or other ideas?
The text was updated successfully, but these errors were encountered: