Closed
Description
IMHO https://dart-review.googlesource.com/c/sdk/+/66160 should be reverted. It's causing spurious warnings when running Flutter's tests:
compiler message: widgets/editable_text_test.dart:1341:23: Warning: This expression has type 'void' and can't be used.
compiler message: verify(controls.handleCopy(any)).called(1);
compiler message: ^
compiler message: widgets/editable_text_test.dart:1344:23: Warning: This expression has type 'void' and can't be used.
compiler message: verify(controls.handleCut(any)).called(1);
compiler message: ^
compiler message: widgets/routes_test.dart:435:30: Warning: This expression has type 'void' and can't be used.
compiler message: verify(pageRouteAware1.didPush()).called(1);
compiler message: ^
compiler message: widgets/routes_test.dart:440:30: Warning: This expression has type 'void' and can't be used.
compiler message: verify(pageRouteAware1.didPushNext()).called(1);
compiler message: ^
compiler message: widgets/routes_test.dart:443:30: Warning: This expression has type 'void' and can't be used.
compiler message: verify(pageRouteAware2.didPush()).called(1);
compiler message: ^
compiler message: widgets/routes_test.dart:446:30: Warning: This expression has type 'void' and can't be used.
compiler message: verify(pageRouteAware2.didPop()).called(1);
compiler message: ^
compiler message: widgets/routes_test.dart:447:30: Warning: This expression has type 'void' and can't be used.
compiler message: verify(pageRouteAware1.didPopNext()).called(1);
...
By "spurious" I mean that they are messages that the analyzer is not reporting, and that the code works fine.
IMHO the compiler should never output any messages except if it has a fatal error. The analyzer is the tool whose role it is to report problems, not the compiler.