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.source_class_builder; | 5 library fasta.source_class_builder; |
6 | 6 |
| 7 import 'package:front_end/src/fasta/builder/class_builder.dart' |
| 8 show ClassBuilder; |
| 9 |
| 10 import 'package:front_end/src/fasta/type_inference/type_inferrer.dart' |
| 11 show TypeInferrer; |
| 12 |
7 import 'package:kernel/ast.dart' | 13 import 'package:kernel/ast.dart' |
8 show Class, Constructor, Supertype, TreeNode, setParents; | 14 show Class, Constructor, Supertype, TreeNode, setParents; |
9 | 15 |
10 import '../errors.dart' show internalError; | 16 import '../errors.dart' show internalError; |
11 | 17 |
12 import '../kernel/kernel_builder.dart' | 18 import '../kernel/kernel_builder.dart' |
13 show | 19 show |
14 Builder, | 20 Builder, |
15 ConstructorReferenceBuilder, | 21 ConstructorReferenceBuilder, |
16 KernelClassBuilder, | 22 KernelClassBuilder, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 146 } |
141 | 147 |
142 void addSyntheticConstructor(Constructor constructor) { | 148 void addSyntheticConstructor(Constructor constructor) { |
143 String name = constructor.name.name; | 149 String name = constructor.name.name; |
144 cls.constructors.add(constructor); | 150 cls.constructors.add(constructor); |
145 constructor.parent = cls; | 151 constructor.parent = cls; |
146 DillMemberBuilder memberBuilder = new DillMemberBuilder(constructor, this); | 152 DillMemberBuilder memberBuilder = new DillMemberBuilder(constructor, this); |
147 memberBuilder.next = constructorScopeBuilder[name]; | 153 memberBuilder.next = constructorScopeBuilder[name]; |
148 constructorScopeBuilder.addMember(name, memberBuilder); | 154 constructorScopeBuilder.addMember(name, memberBuilder); |
149 } | 155 } |
| 156 |
| 157 @override |
| 158 void prepareInitializerInference(TypeInferrer typeInferrer, |
| 159 LibraryBuilder library, ClassBuilder currentClass) { |
| 160 scope.forEach((name, builder) { |
| 161 builder.prepareInitializerInference(typeInferrer, library, this); |
| 162 }); |
| 163 } |
150 } | 164 } |
OLD | NEW |