| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 serialization.elements; | 5 library serialization.elements; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/dart/element/type.dart'; | 8 import 'package:analyzer/dart/element/type.dart'; |
| 9 import 'package:analyzer/src/dart/element/element.dart'; | 9 import 'package:analyzer/src/dart/element/element.dart'; |
| 10 import 'package:analyzer/src/dart/element/member.dart'; | 10 import 'package:analyzer/src/dart/element/member.dart'; |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 DartType type = parameter.type; | 682 DartType type = parameter.type; |
| 683 if (parameter.hasImplicitType) { | 683 if (parameter.hasImplicitType) { |
| 684 Element contextParent = context.enclosingElement; | 684 Element contextParent = context.enclosingElement; |
| 685 if (!parameter.isInitializingFormal && | 685 if (!parameter.isInitializingFormal && |
| 686 contextParent is ExecutableElement && | 686 contextParent is ExecutableElement && |
| 687 !contextParent.isStatic && | 687 !contextParent.isStatic && |
| 688 contextParent is! ConstructorElement) { | 688 contextParent is! ConstructorElement) { |
| 689 b.inferredTypeSlot = storeInferredType(type, context); | 689 b.inferredTypeSlot = storeInferredType(type, context); |
| 690 } | 690 } |
| 691 } else { | 691 } else { |
| 692 if (type is FunctionType) { | 692 if (type is FunctionType && type.element.isSynthetic) { |
| 693 b.isFunctionTyped = true; | 693 b.isFunctionTyped = true; |
| 694 b.type = serializeTypeRef(type.returnType, parameter); | 694 b.type = serializeTypeRef(type.returnType, parameter); |
| 695 b.parameters = type.parameters | 695 b.parameters = type.parameters |
| 696 .map((parameter) => serializeParam(parameter, context)) | 696 .map((parameter) => serializeParam(parameter, context)) |
| 697 .toList(); | 697 .toList(); |
| 698 } else { | 698 } else { |
| 699 b.type = serializeTypeRef(type, context); | 699 b.type = serializeTypeRef(type, context); |
| 700 } | 700 } |
| 701 } | 701 } |
| 702 if (parameter is ConstVariableElement) { | 702 if (parameter is ConstVariableElement) { |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 exportNames.add(new LinkedExportNameBuilder( | 1363 exportNames.add(new LinkedExportNameBuilder( |
| 1364 name: name, | 1364 name: name, |
| 1365 dependency: serializeDependency(dependentLibrary), | 1365 dependency: serializeDependency(dependentLibrary), |
| 1366 unit: unit, | 1366 unit: unit, |
| 1367 kind: kind)); | 1367 kind: kind)); |
| 1368 } | 1368 } |
| 1369 pb.exportNames = exportNames; | 1369 pb.exportNames = exportNames; |
| 1370 return pb; | 1370 return pb; |
| 1371 } | 1371 } |
| 1372 } | 1372 } |
| OLD | NEW |