Skip to content

asserts don't print failed condition if sources are not present in kernel file #34586

@aam

Description

@aam

When dart vm runs against kernel file without source code embedded in it, failed asserts report null instead of original dart condition:

'\'file:///$FH/flutter/packages/flutter/test/foundation/error_reporting_test.dart\': Failed assertion: line 12 pos 12: \'null\'',

The penalty of having source code present just to have asserts reporting correct condition seems to be too high: for flutter tests (package/flutter) average kernel file with the source is 16M vs 6M without source. Test execution time when running against kernel files without source code drops by ~25% (from 2m50s to 2m07s).

It seems reasonable for assert in Kernel AST to capture source text condition in the kernel file itself instead of capturing just token positions.

@rmacnak-google

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onfront-end-kernellegacy-area-front-endLegacy: Use area-dart-model instead.type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions