Skip to content

const_eval_throws_exception error #36511

@tvolkert

Description

@tvolkert

Consider the work-in-progress changes in flutter/flutter#30646 in which I change Flutter's Row widget to have a const constructor.

In the associated test, I have the following code:

testWidgets('Row is const constructable', (WidgetTester tester) async {
  const Row(
    children: <Widget>[
      Text('Billable Hours'),
    ],
  );
});

When run over that code, the analyzer produces the following error:

  error • Evaluation of this constant expression throws an exception • test/widgets/row_test.dart:32:5 • const_eval_throws_exception

Yet when I run the test, it passes:

$ flutter test test/widgets/row_test.dart 
00:05 +28: All tests passed!                                  
  • Dart VM version: 2.2.1-dev.3.0.flutter-None (Tue Apr 2 13:54:28 2019 +0000) on "macos_x64"

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failuresanalyzer-constantscustomer-flutterlegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions