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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 11299225: Revert "Canonicalize raw type" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 9db2227f66c691496373a669333a628a5d231dc9..537812e1c62d59ee9e325f7fa8fd721862f45e39 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -1142,18 +1142,14 @@ class TypeResolver {
type = new MalformedType(
new MalformedTypeElement(node, element));
} else {
- if (arguments.isEmpty) {
- // Use the canonical raw type if the class is generic.
- type = cls.rawType;
- } else {
- type = new InterfaceType(cls.declaration, arguments);
- }
+ type = new InterfaceType(cls.declaration, arguments);
}
}
} else if (element.isTypedef()) {
TypedefElement typdef = element;
// TODO(ahe): Should be [ensureResolved].
compiler.resolveTypedef(typdef);
+ typdef.computeType(compiler);
Link<DartType> arguments = resolveTypeArguments(
node, typdef.typeVariables, inStaticContext,
scope, onFailure, whenResolved);
@@ -1161,11 +1157,7 @@ class TypeResolver {
// Return the canonical type if it has no type parameters.
type = typdef.computeType(compiler);
} else {
- if (arguments.isEmpty) {
- type = typdef.rawType;
- } else {
- type = new TypedefType(typdef, arguments);
- }
+ type = new TypedefType(typdef, arguments);
}
} else if (element.isTypeVariable()) {
if (inStaticContext) {
@@ -1975,7 +1967,7 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
void handleRedirectingFactoryBody(Return node) {
Element redirectionTarget = resolveRedirectingFactory(node);
var type = mapping.getType(node.expression);
- if (type is InterfaceType && !type.isRaw) {
+ if (type is InterfaceType && !type.typeArguments.isEmpty) {
unimplemented(node.expression, 'type arguments on redirecting factory');
}
useElement(node.expression, redirectionTarget);
@@ -2563,7 +2555,8 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
} else {
objectElement.ensureResolved(compiler);
}
- element.supertype = objectElement.computeType(compiler);
+ // TODO(ahe): This should be objectElement.computeType(...).
+ element.supertype = new InterfaceType(objectElement);
}
assert(element.interfaces == null);
Link<DartType> interfaces = const Link<DartType>();

Powered by Google App Engine
This is Rietveld 408576698