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

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

Issue 10996039: Bring type variables into static scope, but produce compile-time error when they are used. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Produce warning and dynamic type error instead of compile-time error. Created 8 years, 2 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: lib/compiler/implementation/typechecker.dart
diff --git a/lib/compiler/implementation/typechecker.dart b/lib/compiler/implementation/typechecker.dart
index b57c1a8bd0f8be3933349e9172f5b7788187116a..1980fe6fbeb50b1606c53b9e8439c358b64b7338 100644
--- a/lib/compiler/implementation/typechecker.dart
+++ b/lib/compiler/implementation/typechecker.dart
@@ -118,6 +118,20 @@ class VoidType implements DartType {
String toString() => name.slowToString();
}
+class MalformedType implements DartType {
+ const MalformedType(this.element);
+ SourceString get name => element.name;
+ final MalformedTypeElement element;
+
+ DartType unalias(Compiler compiler) => this;
+
+ int hashCode() => 1733;
+
+ bool operator ==(other) => other is MalformedType;
+
+ String toString() => name.slowToString();
+}
+
class InterfaceType implements DartType {
final Element element;
final Link<DartType> arguments;
@@ -276,6 +290,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