| OLD | NEW |
| 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 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1429 compiler.resolver._ensureClassWillBeResolved(cls); | 1429 compiler.resolver._ensureClassWillBeResolved(cls); |
| 1430 element.computeType(compiler); | 1430 element.computeType(compiler); |
| 1431 var arguments = new LinkBuilder<DartType>(); | 1431 var arguments = new LinkBuilder<DartType>(); |
| 1432 bool hashTypeArgumentMismatch = resolveTypeArguments( | 1432 bool hashTypeArgumentMismatch = resolveTypeArguments( |
| 1433 node, cls.typeVariables, enclosingElement, | 1433 node, cls.typeVariables, enclosingElement, |
| 1434 scope, onFailure, whenResolved, arguments); | 1434 scope, onFailure, whenResolved, arguments); |
| 1435 if (hashTypeArgumentMismatch) { | 1435 if (hashTypeArgumentMismatch) { |
| 1436 type = new MalformedType( | 1436 type = new MalformedType( |
| 1437 new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH, | 1437 new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH, |
| 1438 {'type': node}, typeName.source, enclosingElement), | 1438 {'type': node}, typeName.source, enclosingElement), |
| 1439 new InterfaceType(cls.declaration, arguments.toLink())); | 1439 new InterfaceType.userProvidedBadType(cls.declaration, |
| 1440 arguments.toLink())); |
| 1440 } else { | 1441 } else { |
| 1441 if (arguments.isEmpty) { | 1442 if (arguments.isEmpty) { |
| 1442 type = cls.rawType; | 1443 type = cls.rawType; |
| 1443 } else { | 1444 } else { |
| 1444 type = new InterfaceType(cls.declaration, arguments.toLink()); | 1445 type = new InterfaceType(cls.declaration, arguments.toLink()); |
| 1445 } | 1446 } |
| 1446 } | 1447 } |
| 1447 } else if (element.isTypedef()) { | 1448 } else if (element.isTypedef()) { |
| 1448 TypedefElement typdef = element; | 1449 TypedefElement typdef = element; |
| 1449 // TODO(ahe): Should be [ensureResolved]. | 1450 // TODO(ahe): Should be [ensureResolved]. |
| 1450 compiler.resolveTypedef(typdef); | 1451 compiler.resolveTypedef(typdef); |
| 1451 var arguments = new LinkBuilder<DartType>(); | 1452 var arguments = new LinkBuilder<DartType>(); |
| 1452 bool hashTypeArgumentMismatch = resolveTypeArguments( | 1453 bool hashTypeArgumentMismatch = resolveTypeArguments( |
| 1453 node, typdef.typeVariables, enclosingElement, | 1454 node, typdef.typeVariables, enclosingElement, |
| 1454 scope, onFailure, whenResolved, arguments); | 1455 scope, onFailure, whenResolved, arguments); |
| 1455 if (hashTypeArgumentMismatch) { | 1456 if (hashTypeArgumentMismatch) { |
| 1456 type = new MalformedType( | 1457 type = new MalformedType( |
| 1457 new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH, | 1458 new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH, |
| 1458 {'type': node}, typeName.source, enclosingElement), | 1459 {'type': node}, typeName.source, enclosingElement), |
| 1459 new TypedefType(typdef, arguments.toLink())); | 1460 new TypedefType.userProvidedBadType(typdef, arguments.toLink())); |
| 1460 } else { | 1461 } else { |
| 1461 if (arguments.isEmpty) { | 1462 if (arguments.isEmpty) { |
| 1462 type = typdef.rawType; | 1463 type = typdef.rawType; |
| 1463 } else { | 1464 } else { |
| 1464 type = new TypedefType(typdef, arguments.toLink()); | 1465 type = new TypedefType(typdef, arguments.toLink()); |
| 1465 } | 1466 } |
| 1466 } | 1467 } |
| 1467 } else if (element.isTypeVariable()) { | 1468 } else if (element.isTypeVariable()) { |
| 1468 if (enclosingElement.isInStaticMember()) { | 1469 if (enclosingElement.isInStaticMember()) { |
| 1469 compiler.backend.registerThrowRuntimeError(); | 1470 compiler.backend.registerThrowRuntimeError(); |
| (...skipping 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3700 return e; | 3701 return e; |
| 3701 } | 3702 } |
| 3702 | 3703 |
| 3703 /// Assumed to be called by [resolveRedirectingFactory]. | 3704 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3704 Element visitReturn(Return node) { | 3705 Element visitReturn(Return node) { |
| 3705 Node expression = node.expression; | 3706 Node expression = node.expression; |
| 3706 return finishConstructorReference(visit(expression), | 3707 return finishConstructorReference(visit(expression), |
| 3707 expression, expression); | 3708 expression, expression); |
| 3708 } | 3709 } |
| 3709 } | 3710 } |
| OLD | NEW |