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
Generate valid functions with optional non-nullable arguments
If a method of a mocked class returns a function with optional
yet non-nullable argument, Mockito currently produces something
like
```dart
(int x, {int y}) => /* doesn't matter */
```
which is not a valid Dart, since `y` must either be `required` or
have a default value. `required` won't fit into the desired type
and coming up with a default value is not easy, since it has to
be a constant, but `dummyValue` doesn't always produce one.
Fortunately, we can just widen the type here and make it nullable.
PiperOrigin-RevId: 582669927
0 commit comments