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

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

Issue 12079098: Revert "Take type arguments into account in interface type subtype check." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element operator[](Node node); 8 Element operator[](Node node);
9 Selector getSelector(Send send); 9 Selector getSelector(Send send);
10 DartType getType(Node node); 10 DartType getType(Node node);
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 compiler.resolver._ensureClassWillBeResolved(cls); 1391 compiler.resolver._ensureClassWillBeResolved(cls);
1392 element.computeType(compiler); 1392 element.computeType(compiler);
1393 var arguments = new LinkBuilder<DartType>(); 1393 var arguments = new LinkBuilder<DartType>();
1394 bool hashTypeArgumentMismatch = resolveTypeArguments( 1394 bool hashTypeArgumentMismatch = resolveTypeArguments(
1395 node, cls.typeVariables, enclosingElement, 1395 node, cls.typeVariables, enclosingElement,
1396 scope, onFailure, whenResolved, arguments); 1396 scope, onFailure, whenResolved, arguments);
1397 if (hashTypeArgumentMismatch) { 1397 if (hashTypeArgumentMismatch) {
1398 type = new MalformedType( 1398 type = new MalformedType(
1399 new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH, 1399 new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH,
1400 {'type': node}, typeName.source, enclosingElement), 1400 {'type': node}, typeName.source, enclosingElement),
1401 new InterfaceType.userProvidedBadType(cls.declaration, 1401 new InterfaceType(cls.declaration, arguments.toLink()));
1402 arguments.toLink()));
1403 } else { 1402 } else {
1404 if (arguments.isEmpty) { 1403 if (arguments.isEmpty) {
1405 type = cls.rawType; 1404 type = cls.rawType;
1406 } else { 1405 } else {
1407 type = new InterfaceType(cls.declaration, arguments.toLink()); 1406 type = new InterfaceType(cls.declaration, arguments.toLink());
1408 } 1407 }
1409 } 1408 }
1410 } else if (element.isTypedef()) { 1409 } else if (element.isTypedef()) {
1411 TypedefElement typdef = element; 1410 TypedefElement typdef = element;
1412 // TODO(ahe): Should be [ensureResolved]. 1411 // TODO(ahe): Should be [ensureResolved].
1413 compiler.resolveTypedef(typdef); 1412 compiler.resolveTypedef(typdef);
1414 var arguments = new LinkBuilder<DartType>(); 1413 var arguments = new LinkBuilder<DartType>();
1415 bool hashTypeArgumentMismatch = resolveTypeArguments( 1414 bool hashTypeArgumentMismatch = resolveTypeArguments(
1416 node, typdef.typeVariables, enclosingElement, 1415 node, typdef.typeVariables, enclosingElement,
1417 scope, onFailure, whenResolved, arguments); 1416 scope, onFailure, whenResolved, arguments);
1418 if (hashTypeArgumentMismatch) { 1417 if (hashTypeArgumentMismatch) {
1419 type = new MalformedType( 1418 type = new MalformedType(
1420 new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH, 1419 new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH,
1421 {'type': node}, typeName.source, enclosingElement), 1420 {'type': node}, typeName.source, enclosingElement),
1422 new TypedefType.userProvidedBadType(typdef, arguments.toLink())); 1421 new TypedefType(typdef, arguments.toLink()));
1423 } else { 1422 } else {
1424 if (arguments.isEmpty) { 1423 if (arguments.isEmpty) {
1425 type = typdef.rawType; 1424 type = typdef.rawType;
1426 } else { 1425 } else {
1427 type = new TypedefType(typdef, arguments.toLink()); 1426 type = new TypedefType(typdef, arguments.toLink());
1428 } 1427 }
1429 } 1428 }
1430 } else if (element.isTypeVariable()) { 1429 } else if (element.isTypeVariable()) {
1431 if (enclosingElement.isInStaticMember()) { 1430 if (enclosingElement.isInStaticMember()) {
1432 compiler.reportWarning(node, 1431 compiler.reportWarning(node,
(...skipping 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after
3624 return e; 3623 return e;
3625 } 3624 }
3626 3625
3627 /// Assumed to be called by [resolveRedirectingFactory]. 3626 /// Assumed to be called by [resolveRedirectingFactory].
3628 Element visitReturn(Return node) { 3627 Element visitReturn(Return node) {
3629 Node expression = node.expression; 3628 Node expression = node.expression;
3630 return finishConstructorReference(visit(expression), 3629 return finishConstructorReference(visit(expression),
3631 expression, expression); 3630 expression, expression);
3632 } 3631 }
3633 } 3632 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/dart_types.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698