Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 1674073002: Add UnlinkedConst.isValid and set it during summarizing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Generate the 'isInvalid' property. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/src/summary/summary_common.dart
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index c7a55847155c68209e64c610c3d74e210261d7b1..ea8bb99c4fddc0da859f3cf5ac8056c77471d7c7 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -4036,6 +4036,16 @@ class C {
operators: [UnlinkedConstOperation.pushInt], ints: [0]);
}
+ test_field_final_invalidConstExpr() {
+ UnlinkedVariable variable = serializeClassText(r'''
+class C {
+ final int f = 1 + m();
+ static int m() => 42;
+}''').fields[0];
+ expect(variable.isFinal, isTrue);
+ _assertUnlinkedConst(variable.constExpr, isInvalid: true);
+ }
+
test_field_formal_param_inferred_type_explicit() {
UnlinkedClass cls = serializeClassText(
'class C extends D { var v; C(int this.v); }'
@@ -5866,13 +5876,15 @@ var v;''';
}
void _assertUnlinkedConst(UnlinkedConst constExpr,
- {List<UnlinkedConstOperation> operators,
+ {bool isInvalid: false,
+ List<UnlinkedConstOperation> operators: const <UnlinkedConstOperation>[],
List<int> ints: const <int>[],
List<double> doubles: const <double>[],
List<String> strings: const <String>[],
List<_EntityRefValidator> referenceValidators:
const <_EntityRefValidator>[]}) {
expect(constExpr, isNotNull);
+ expect(constExpr.isInvalid, isInvalid);
expect(constExpr.operations, operators);
expect(constExpr.ints, ints);
expect(constExpr.doubles, doubles);
« pkg/analyzer/lib/src/summary/idl.dart ('K') | « pkg/analyzer/lib/src/summary/summarize_elements.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698