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

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

Issue 709603003: Add compile-time errors for enums. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | « no previous file | 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/dart_types.dart
diff --git a/pkg/compiler/lib/src/dart_types.dart b/pkg/compiler/lib/src/dart_types.dart
index 32acb8871d16783a3ea8d8d2c03dddcc8d2064c7..22d949d3a290ac9c73cbc6b23d43897a368bed86 100644
--- a/pkg/compiler/lib/src/dart_types.dart
+++ b/pkg/compiler/lib/src/dart_types.dart
@@ -127,6 +127,9 @@ abstract class DartType {
/// Is [: true :] if this type is a malformed type.
bool get isMalformed => kind == TypeKind.MALFORMED_TYPE;
+ /// Is `true` if this type is declared by an enum.
+ bool get isEnumType => false;
+
/// Returns an occurrence of a type variable within this type, if any.
TypeVariableType get typeVariableOccurrence => null;
@@ -461,6 +464,8 @@ class InterfaceType extends GenericType {
bool get isObject => element.isObject;
+ bool get isEnumType => element.isEnumClass;
+
InterfaceType createInstantiation(List<DartType> newTypeArguments) {
return new InterfaceType(element, newTypeArguments);
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698