OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 ClassElement definingClass = element.getAncestor(ClassElement.class); | 439 ClassElement definingClass = element.getAncestor(ClassElement.class); |
440 if (definingClass != null) { | 440 if (definingClass != null) { |
441 type.setTypeArguments(definingClass.getType().getTypeArguments()); | 441 type.setTypeArguments(definingClass.getType().getTypeArguments()); |
442 } | 442 } |
443 element.setType(type); | 443 element.setType(type); |
444 return null; | 444 return null; |
445 } | 445 } |
446 | 446 |
447 @Override | 447 @Override |
448 public Void visitFunctionTypeAlias(FunctionTypeAlias node) { | 448 public Void visitFunctionTypeAlias(FunctionTypeAlias node) { |
449 super.visitFunctionTypeAlias(node); | |
450 FunctionTypeAliasElementImpl element = (FunctionTypeAliasElementImpl) node.g
etElement(); | 449 FunctionTypeAliasElementImpl element = (FunctionTypeAliasElementImpl) node.g
etElement(); |
451 element.setReturnType(computeReturnType(node.getReturnType())); | 450 if (element.getReturnType() == null) { |
| 451 // Only visit function type aliases once. |
| 452 super.visitFunctionTypeAlias(node); |
| 453 element.setReturnType(computeReturnType(node.getReturnType())); |
| 454 } |
452 return null; | 455 return null; |
453 } | 456 } |
454 | 457 |
455 @Override | 458 @Override |
456 public Void visitFunctionTypedFormalParameter(FunctionTypedFormalParameter nod
e) { | 459 public Void visitFunctionTypedFormalParameter(FunctionTypedFormalParameter nod
e) { |
457 super.visitFunctionTypedFormalParameter(node); | 460 super.visitFunctionTypedFormalParameter(node); |
458 Element element = node.getIdentifier().getStaticElement(); | 461 Element element = node.getIdentifier().getStaticElement(); |
459 if (element instanceof ParameterElementImpl) { | 462 if (element instanceof ParameterElementImpl) { |
460 setFunctionTypedParameterType( | 463 setFunctionTypedParameterType( |
461 (ParameterElementImpl) element, | 464 (ParameterElementImpl) element, |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 if (alias != null) { | 1382 if (alias != null) { |
1380 aliasElement.setTypeParameters(alias.getTypeParameters()); | 1383 aliasElement.setTypeParameters(alias.getTypeParameters()); |
1381 type.setTypeArguments(alias.getType().getTypeArguments()); | 1384 type.setTypeArguments(alias.getType().getTypeArguments()); |
1382 } else { | 1385 } else { |
1383 type.setTypeArguments(TypeImpl.EMPTY_ARRAY); | 1386 type.setTypeArguments(TypeImpl.EMPTY_ARRAY); |
1384 } | 1387 } |
1385 } | 1388 } |
1386 element.setType(type); | 1389 element.setType(type); |
1387 } | 1390 } |
1388 } | 1391 } |
OLD | NEW |