Chromium Code Reviews| 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 9572643066b468c27a90d0a62e17b7200f0a6716..670e83b714cd74aea779e41d250005f53a8ebebc 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; |
|
ngeoffray
2012/11/27 09:37:35
Not checking if elements are equal is kind of stra
aam-me
2012/11/28 01:49:47
Good point. I used VoidType above as a template.
|
| + |
| + String toString() => name.slowToString(); |
| +} |
| + |
| class InterfaceType extends DartType { |
| final Element element; |
| final Link<DartType> arguments; |
| @@ -321,6 +340,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; |