Skip to content

Spurious compiler output when running Flutter tests #34031

Closed
@Hixie

Description

@Hixie

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.

cc @aam @peter-ahe-google

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failurescustomer-fluttercustomer-fuchsiafront-end-fastatype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions