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

Unified Diff: sdk/lib/_internal/compiler/implementation/typechecker.dart

Issue 11416144: Produce run-time error when type parameters are accessed from static context. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed dart2dart unchcked tests. Created 8 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
Index: sdk/lib/_internal/compiler/implementation/typechecker.dart
diff --git a/sdk/lib/_internal/compiler/implementation/typechecker.dart b/sdk/lib/_internal/compiler/implementation/typechecker.dart
index d4889b665be47ea93784441fcdebf05d88d6cb66..7ae237e9e0907970fe0e007132e4e83c035df9ea 100644
--- a/sdk/lib/_internal/compiler/implementation/typechecker.dart
+++ b/sdk/lib/_internal/compiler/implementation/typechecker.dart
@@ -36,6 +36,7 @@ class TypeKind {
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 VOID = const TypeKind('void');
String toString() => id;
@@ -150,6 +151,24 @@ class VoidType extends DartType {
String toString() => name.slowToString();
}
+class MalformedType extends DartType {
+ const MalformedType(this.element);
+
+ TypeKind get kind => TypeKind.MALFORMED_TYPE;
+
+ SourceString get name => element.name;
+
+ final MalformedTypeElement element;
+
+ DartType unalias(Compiler compiler) => this;
+
+ int get hashCode => 1733;
+
+ bool operator ==(other) => other is MalformedType;
+
+ String toString() => name.slowToString();
+}
+
class InterfaceType extends DartType {
final Element element;
final Link<DartType> arguments;
@@ -319,6 +338,8 @@ class Types {
if (t is VoidType) {
return false;
+ } else if (t is MalformedType) {
+ return false;
} else if (t is InterfaceType) {
if (s is !InterfaceType) return false;
ClassElement tc = t.element;

Powered by Google App Engine
This is Rietveld 408576698