| Index: lib/compiler/implementation/elements/elements.dart
|
| diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
|
| index e96db49c907d6d2635a90ce8f1b9dd1fc3a8306e..9b072d1aa7eb43e1b5d343625c38cba482952834 100644
|
| --- a/lib/compiler/implementation/elements/elements.dart
|
| +++ b/lib/compiler/implementation/elements/elements.dart
|
| @@ -429,7 +429,7 @@ class VariableListElement extends Element {
|
|
|
| Type computeType(Compiler compiler) {
|
| if (type != null) return type;
|
| - type = getType(parseNode(compiler).type, compiler, getLibrary());
|
| + type = compiler.resolveType(this, parseNode(compiler).type);
|
| return type;
|
| }
|
|
|
| @@ -483,47 +483,6 @@ class AbstractFieldElement extends Element {
|
| }
|
| }
|
|
|
| -/** DEPRECATED. */
|
| -Type getType(TypeAnnotation typeAnnotation,
|
| - Compiler compiler,
|
| - LibraryElement library) {
|
| - // TODO(karlklose,ngeoffray): This method should be removed and the
|
| - // information should be computed by the resolver.
|
| -
|
| - if (typeAnnotation == null || typeAnnotation.typeName == null) {
|
| - return compiler.types.dynamicType;
|
| - }
|
| - Identifier identifier = typeAnnotation.typeName.asIdentifier();
|
| - if (identifier === null) {
|
| - compiler.reportWarning(
|
| - typeAnnotation.typeName,
|
| - new ResolutionWarning(MessageKind.GENERIC,
|
| - ['library prefixes not handled']));
|
| - return compiler.types.dynamicType;
|
| - }
|
| - SourceString name = identifier.source;
|
| - Element element = library.find(name);
|
| - if (element !== null) {
|
| - if (element.isTypedef()) {
|
| - // TODO(ngeoffray): This is a hack to help us get support for the
|
| - // DOM library.
|
| - // TODO(ngeoffray): The list of types for the argument is wrong.
|
| - return new FunctionType(compiler.types.dynamicType,
|
| - const EmptyLink<Type>(),
|
| - element);
|
| - }
|
| - if (element.isClass()) {
|
| - // TODO(karlklose): substitute type parameters.
|
| - return element.computeType(compiler);
|
| - }
|
| - }
|
| - Type type = compiler.types.lookup(name);
|
| - if (type === null) {
|
| - type = compiler.types.dynamicType;
|
| - }
|
| - return type;
|
| -}
|
| -
|
| class FunctionParameters {
|
| Link<Element> requiredParameters;
|
| Link<Element> optionalParameters;
|
| @@ -627,8 +586,7 @@ class FunctionElement extends Element {
|
| Types types = compiler.types;
|
| FunctionExpression node =
|
| compiler.parser.measure(() => parseNode(compiler));
|
| - Type returnType = getType(node.returnType, compiler, getLibrary());
|
| - if (returnType === null) returnType = types.dynamicType;
|
| + Type returnType = compiler.resolveType(this, node.returnType);
|
|
|
| LinkBuilder<Type> parameterTypes = new LinkBuilder<Type>();
|
| for (Link<Element> link = parameters.requiredParameters;
|
|
|