Skip to content

Commit ced77c9

Browse files
committed
Restrict the exception for CAST_FROM_NULL_ALWAYS_FAILS
Also fix case in mockito. All other fixes have been Rosie'd out as cl/470591518; as these land we can tighten more. PiperOrigin-RevId: 470728313
1 parent 1363d90 commit ced77c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/manual_mocks_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ void main() {
9595
'cannot operate on method with non-nullable params without a manual '
9696
'mock', () {
9797
// Normally this use of `any` would be a static error. To push forward to
98-
// reveal the runtime error, we cast as int.
98+
// reveal the runtime error, we cast as dynamic.
9999
expect(
100-
() => when(mock.notMockedNonNullableParam(any as int))
100+
() => when(mock.notMockedNonNullableParam((any as dynamic) as int))
101101
.thenReturn('Mock'),
102102
throwsA(TypeMatcher<TypeError>()));
103103
});

0 commit comments

Comments
 (0)