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

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: 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 41737589144f75efe371464219ca6f3853ac822e..c824bf19ce5806793f358e859a9dc44d7aee06d0 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -3888,6 +3888,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, isValid: false);
+ }
+
test_field_formal_param_inferred_type_explicit() {
UnlinkedClass cls = serializeClassText(
'class C extends D { var v; C(int this.v); }'
@@ -5425,13 +5435,15 @@ var v;''';
}
void _assertUnlinkedConst(UnlinkedConst constExpr,
- {List<UnlinkedConstOperation> operators,
+ {bool isValid: true,
+ 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.isValid, isValid);
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