| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.kernel_builder; | 5 library fasta.kernel_builder; |
| 6 | 6 |
| 7 export 'kernel_class_builder.dart' show KernelClassBuilder; | 7 export 'kernel_class_builder.dart' show KernelClassBuilder; |
| 8 | 8 |
| 9 export 'kernel_enum_builder.dart' show KernelEnumBuilder; | 9 export 'kernel_enum_builder.dart' show KernelEnumBuilder; |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 export 'kernel_variable_builder.dart' show KernelVariableBuilder; | 42 export 'kernel_variable_builder.dart' show KernelVariableBuilder; |
| 43 | 43 |
| 44 export 'kernel_invalid_type_builder.dart' show KernelInvalidTypeBuilder; | 44 export 'kernel_invalid_type_builder.dart' show KernelInvalidTypeBuilder; |
| 45 | 45 |
| 46 import 'package:kernel/text/ast_to_text.dart' show Printer; | 46 import 'package:kernel/text/ast_to_text.dart' show Printer; |
| 47 | 47 |
| 48 import 'package:kernel/ast.dart' | 48 import 'package:kernel/ast.dart' |
| 49 show | 49 show |
| 50 Class, | 50 Class, |
| 51 Constructor, |
| 51 DartType, | 52 DartType, |
| 52 DynamicType, | 53 DynamicType, |
| 53 Field, | 54 Field, |
| 55 Initializer, |
| 54 Library, | 56 Library, |
| 55 Member, | 57 Member, |
| 56 Procedure, | 58 Procedure, |
| 59 RedirectingInitializer, |
| 57 TypeParameter; | 60 TypeParameter; |
| 58 | 61 |
| 59 import '../errors.dart' show inputError; | 62 import '../errors.dart' show inputError; |
| 60 | 63 |
| 61 import '../builder/builder.dart' show LibraryBuilder; | 64 import '../builder/builder.dart' show LibraryBuilder; |
| 62 | 65 |
| 63 List<DartType> computeDefaultTypeArguments(LibraryBuilder library, | 66 List<DartType> computeDefaultTypeArguments(LibraryBuilder library, |
| 64 List<TypeParameter> typeParameters, List<DartType> arguments) { | 67 List<TypeParameter> typeParameters, List<DartType> arguments) { |
| 65 // TODO(ahe): Not sure what to do if `arguments.length != | 68 // TODO(ahe): Not sure what to do if `arguments.length != |
| 66 // cls.typeParameters.length`. | 69 // cls.typeParameters.length`. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 108 } |
| 106 name = (cls == null ? "" : "${cls.name}::") + name; | 109 name = (cls == null ? "" : "${cls.name}::") + name; |
| 107 return inputError(uri, charOffset, "Error in $name: $error"); | 110 return inputError(uri, charOffset, "Error in $name: $error"); |
| 108 } | 111 } |
| 109 | 112 |
| 110 int compareProcedures(Procedure a, Procedure b) { | 113 int compareProcedures(Procedure a, Procedure b) { |
| 111 int i = a.fileUri.compareTo(b.fileUri); | 114 int i = a.fileUri.compareTo(b.fileUri); |
| 112 if (i != 0) return i; | 115 if (i != 0) return i; |
| 113 return a.fileOffset.compareTo(b.fileOffset); | 116 return a.fileOffset.compareTo(b.fileOffset); |
| 114 } | 117 } |
| 118 |
| 119 bool isRedirectingGenerativeConstructorImplementation(Constructor constructor) { |
| 120 List<Initializer> initializers = constructor.initializers; |
| 121 return initializers.length == 1 && |
| 122 initializers.single is RedirectingInitializer; |
| 123 } |
| OLD | NEW |