| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library analyzer.src.dart.element.element; | 5 library analyzer.src.dart.element.element; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 8463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8474 } | 8474 } |
| 8475 | 8475 |
| 8476 /** | 8476 /** |
| 8477 * If this element is resynthesized, and its type and parameters have not | 8477 * If this element is resynthesized, and its type and parameters have not |
| 8478 * been build yet, build them and remember in the corresponding fields. | 8478 * been build yet, build them and remember in the corresponding fields. |
| 8479 */ | 8479 */ |
| 8480 void _resynthesizeTypeAndParameters() { | 8480 void _resynthesizeTypeAndParameters() { |
| 8481 if (_kernel != null && _type == null) { | 8481 if (_kernel != null && _type == null) { |
| 8482 kernel.DartType type = _kernel.type; | 8482 kernel.DartType type = _kernel.type; |
| 8483 _type = enclosingUnit._kernelContext.getType(this, type); | 8483 _type = enclosingUnit._kernelContext.getType(this, type); |
| 8484 if (type is kernel.FunctionType) { | 8484 if (type is kernel.FunctionType && type.typedefReference == null) { |
| 8485 _parameters = new List<ParameterElement>( | 8485 _parameters = new List<ParameterElement>( |
| 8486 type.positionalParameters.length + type.namedParameters.length); | 8486 type.positionalParameters.length + type.namedParameters.length); |
| 8487 int index = 0; | 8487 int index = 0; |
| 8488 for (int i = 0; i < type.positionalParameters.length; i++) { | 8488 for (int i = 0; i < type.positionalParameters.length; i++) { |
| 8489 String name = i < type.positionalParameterNames.length | 8489 String name = i < type.positionalParameterNames.length |
| 8490 ? type.positionalParameterNames[i] | 8490 ? type.positionalParameterNames[i] |
| 8491 : null; | 8491 : null; |
| 8492 _parameters[index++] = new ParameterElementImpl.forKernel( | 8492 _parameters[index++] = new ParameterElementImpl.forKernel( |
| 8493 enclosingElement, | 8493 enclosingElement, |
| 8494 new kernel.VariableDeclaration(name, | 8494 new kernel.VariableDeclaration(name, |
| (...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10015 | 10015 |
| 10016 @override | 10016 @override |
| 10017 DartObject computeConstantValue() => null; | 10017 DartObject computeConstantValue() => null; |
| 10018 | 10018 |
| 10019 @override | 10019 @override |
| 10020 void visitChildren(ElementVisitor visitor) { | 10020 void visitChildren(ElementVisitor visitor) { |
| 10021 super.visitChildren(visitor); | 10021 super.visitChildren(visitor); |
| 10022 _initializer?.accept(visitor); | 10022 _initializer?.accept(visitor); |
| 10023 } | 10023 } |
| 10024 } | 10024 } |
| OLD | NEW |