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

Unified Diff: pkg/compiler/lib/src/dart_types.dart

Issue 1192103002: Support serialization of the compiler backbone. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/compiler/lib/src/dart_types.dart
diff --git a/pkg/compiler/lib/src/dart_types.dart b/pkg/compiler/lib/src/dart_types.dart
index 21fbc7826d300b75a83cd2c0161b35462095471b..17e6472127b790a4d8829a7914be01bd0cb33a57 100644
--- a/pkg/compiler/lib/src/dart_types.dart
+++ b/pkg/compiler/lib/src/dart_types.dart
@@ -9,30 +9,22 @@ import 'dart:math' show min;
import 'core_types.dart';
import 'dart2jslib.dart' show Compiler, invariant, Script, Message;
import 'elements/modelx.dart'
- show VoidElementX,
- LibraryElementX,
- BaseClassElementX,
+ show LibraryElementX,
TypeDeclarationElementX,
TypedefElementX;
import 'elements/elements.dart';
import 'ordered_typeset.dart' show OrderedTypeSet;
import 'util/util.dart' show CURRENT_ELEMENT_SPANNABLE, equalElements;
-class TypeKind {
- final String id;
-
- const TypeKind(String this.id);
-
- static const TypeKind FUNCTION = const TypeKind('function');
- static const TypeKind INTERFACE = const TypeKind('interface');
- static const TypeKind STATEMENT = const TypeKind('statement');
- static const TypeKind TYPEDEF = const TypeKind('typedef');
- static const TypeKind TYPE_VARIABLE = const TypeKind('type variable');
- static const TypeKind MALFORMED_TYPE = const TypeKind('malformed');
- static const TypeKind DYNAMIC = const TypeKind('dynamic');
- static const TypeKind VOID = const TypeKind('void');
-
- String toString() => id;
+enum TypeKind {
+ FUNCTION,
+ INTERFACE,
+ STATEMENT,
+ TYPEDEF,
+ TYPE_VARIABLE,
+ MALFORMED_TYPE,
+ DYNAMIC,
+ VOID,
}
abstract class DartType {
@@ -451,9 +443,9 @@ class InterfaceType extends GenericType {
assert(invariant(element, element.isDeclaration));
}
- InterfaceType.forUserProvidedBadType(BaseClassElementX element,
- [List<DartType> typeArguments =
- const <DartType>[]])
+ InterfaceType.forUserProvidedBadType(
+ ClassElement element,
+ [List<DartType> typeArguments = const <DartType>[]])
: super(element, typeArguments, checkTypeArgumentCount: false);
ClassElement get element => super.element;

Powered by Google App Engine
This is Rietveld 408576698