Index: pkg/analyzer/lib/src/summary/resynthesize.dart |
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart |
index 15fe567f16fb775b682a216e8fd0bdb1151a2121..11b74c309f8749ab336798b14323625a8e2f8b25 100644 |
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart |
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart |
@@ -330,7 +330,7 @@ class _ConstExprBuilder { |
Expression build() { |
if (!uc.isValidConst) { |
- return AstTestFactory.identifier3(r'$$invalidConstExpr$$'); |
+ return null; |
} |
for (UnlinkedExprOperation operation in uc.operations) { |
switch (operation) { |
@@ -1572,7 +1572,9 @@ class _UnitResynthesizer { |
ElementAnnotationImpl buildAnnotation(ElementImpl context, UnlinkedExpr uc) { |
ElementAnnotationImpl elementAnnotation = new ElementAnnotationImpl(unit); |
Expression constExpr = _buildConstExpression(context, uc); |
- if (constExpr is Identifier) { |
+ if (constExpr == null) { |
+ // Invalid constant expression. |
+ } else if (constExpr is Identifier) { |
ArgumentList arguments = |
constExpr.getProperty(_ConstExprBuilder.ARGUMENT_LIST); |
elementAnnotation.element = constExpr.staticElement; |