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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart

Issue 2991993002: Reapply 47ecf72 after it was reverted in e431e93e872d9a1c97a5177ebb09d5416f1d659a. (Closed)
Patch Set: Created 3 years, 5 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/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
index 1bce990241a61b97bfc944e19630fefc6243730c..fadda95d116b6ad8cc5a57b8fb896842d5aeccd4 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
@@ -125,10 +125,11 @@ class KernelEnumBuilder extends SourceClassBuilder
/// static const List<E> values = const <E>[id0, ..., idn-1];
/// String toString() => { 0: ‘E.id0’, . . ., n-1: ‘E.idn-1’}[index]
/// }
- members["index"] = new KernelFieldBuilder(
- null, intType, "index", finalMask, parent, charOffset, null, true);
+ members["index"] = new KernelFieldBuilder(null, null, intType, "index",
+ finalMask, parent, charOffset, null, true);
KernelConstructorBuilder constructorBuilder = new KernelConstructorBuilder(
null,
+ null,
constMask,
null,
"",
@@ -144,11 +145,20 @@ class KernelEnumBuilder extends SourceClassBuilder
constructors[""] = constructorBuilder;
int index = 0;
List<MapEntry> toStringEntries = <MapEntry>[];
- KernelFieldBuilder valuesBuilder = new KernelFieldBuilder(null, listType,
- "values", constMask | staticMask, parent, charOffset, null, true);
+ KernelFieldBuilder valuesBuilder = new KernelFieldBuilder(
+ null,
+ null,
+ listType,
+ "values",
+ constMask | staticMask,
+ parent,
+ charOffset,
+ null,
+ true);
members["values"] = valuesBuilder;
KernelProcedureBuilder toStringBuilder = new KernelProcedureBuilder(
null,
+ null,
0,
stringType,
"toString",
@@ -178,8 +188,16 @@ class KernelEnumBuilder extends SourceClassBuilder
constantNamesAndOffsets[i] = null;
continue;
}
- KernelFieldBuilder fieldBuilder = new KernelFieldBuilder(null, selfType,
- name, constMask | staticMask, parent, charOffset, null, true);
+ KernelFieldBuilder fieldBuilder = new KernelFieldBuilder(
+ null,
+ null,
+ selfType,
+ name,
+ constMask | staticMask,
+ parent,
+ charOffset,
+ null,
+ true);
members[name] = fieldBuilder;
toStringEntries.add(new MapEntry(
new IntLiteral(index), new StringLiteral("$className.$name")));

Powered by Google App Engine
This is Rietveld 408576698