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

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

Issue 2740943005: Fix for type reference for 'MyEnum.myValue.index'. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/resynthesize_common.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index 7f0a3f4a954add8e31c851715a70874a4118dd1a..5cbe2e9ead90d02675119aeee2da76ddd8440c8b 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -5443,6 +5443,46 @@ const dynamic v = const {0: 'aaa', 1: 'bbb', 2: 'ccc'};
}
}
+ test_constExpr_pushReference_enum_field() {
+ var library = checkLibrary('''
+enum E {a, b, c}
+final vValue = E.a;
+final vValues = E.values;
+final vIndex = E.a.index;
+''');
+ if (isStrongMode) {
+ checkElementText(
+ library,
+ r'''
+enum E {
+ final int index;
+ static const List<E> values;
+ static const E a;
+ static const E b;
+ static const E c;
+}
+final E vValue;
+final List<E> vValues;
+final int vIndex;
+''');
+ } else {
+ checkElementText(
+ library,
+ r'''
+enum E {
+ final int index;
+ static const List<E> values;
+ static const E a;
+ static const E b;
+ static const E c;
+}
+final dynamic vValue;
+final dynamic vValues;
+final dynamic vIndex;
+''');
+ }
+ }
+
test_constExpr_pushReference_field_simpleIdentifier() {
var library = checkLibrary('''
class C {
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698