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

Unified Diff: pkg/compiler/lib/src/resolution/enum_creator.dart

Issue 1383503002: Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add TODOs. Created 5 years, 3 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/compiler/lib/src/resolution/constructors.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/enum_creator.dart
diff --git a/pkg/compiler/lib/src/resolution/enum_creator.dart b/pkg/compiler/lib/src/resolution/enum_creator.dart
index 02c2c532f14344abf7e2335e24cedfd877720a95..1102aad6f24051fb4562f8f8738af52af526487f 100644
--- a/pkg/compiler/lib/src/resolution/enum_creator.dart
+++ b/pkg/compiler/lib/src/resolution/enum_creator.dart
@@ -5,6 +5,7 @@
library dart2js.resolution.enum_creator;
import '../compiler.dart';
+import '../core_types.dart';
import '../dart_types.dart';
import '../elements/elements.dart';
import '../elements/modelx.dart';
@@ -184,13 +185,15 @@ class EnumCreator {
EnumCreator(this.compiler, this.enumClass);
+ CoreTypes get coreTypes => compiler.coreTypes;
+
void createMembers() {
Enum node = enumClass.node;
InterfaceType enumType = enumClass.thisType;
AstBuilder builder = new AstBuilder(enumClass.position.charOffset);
- InterfaceType intType = compiler.intClass.computeType(compiler);
- InterfaceType stringType = compiler.stringClass.computeType(compiler);
+ InterfaceType intType = coreTypes.intType;
+ InterfaceType stringType = coreTypes.stringType;
EnumFieldElementX addInstanceMember(String name, InterfaceType type) {
Identifier identifier = builder.identifier(name);
@@ -268,8 +271,7 @@ class EnumCreator {
VariableList valuesVariableList =
new VariableList(builder.modifiers(isStatic: true, isConst: true));
- InterfaceType listType = compiler.listClass.computeType(compiler);
- valuesVariableList.type = listType.createInstantiation([enumType]);
+ valuesVariableList.type = coreTypes.listType(enumType);
Identifier valuesIdentifier = builder.identifier('values');
// TODO(johnniwinther): Add type argument.
« no previous file with comments | « pkg/compiler/lib/src/resolution/constructors.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698