Skip to content

Commit a981d46

Browse files
natebiggsCommit Queue
authored andcommitted
[dart2js] Better error messaging around invalid annotation.
Also ignore InvalidExpression since the CFE should surface this error itself. Bug: #62096 Change-Id: I5da48678ca87cf0eb572c1c1c6700557c752f0ce Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465080 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Nate Biggs <[email protected]>
1 parent 0733438 commit a981d46

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/compiler/lib/src/kernel/transformations/modular/late_lowering.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,8 +754,11 @@ class LateLowering {
754754
ConstantExpression(annotation.constant, annotation.type)
755755
..fileOffset = annotation.fileOffset,
756756
);
757-
} else {
758-
throw StateError('Non-constant annotation on $source');
757+
} else if (annotation is! InvalidExpression) {
758+
throw StateError(
759+
'Non-constant annotation on $source (${annotation.runtimeType}): '
760+
'$annotation',
761+
);
759762
}
760763
}
761764
}

0 commit comments

Comments
 (0)