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.constructor_reference_builder; | 5 library fasta.constructor_reference_builder; |
6 | 6 |
7 import 'builder.dart' show PrefixBuilder, ClassBuilder, Builder, TypeBuilder; | 7 import 'builder.dart' |
| 8 show Builder, ClassBuilder, PrefixBuilder, Scope, TypeBuilder; |
8 | 9 |
9 import '../messages.dart' show warning; | 10 import '../messages.dart' show warning; |
10 | 11 |
11 import 'scope.dart' show Scope; | |
12 | |
13 class ConstructorReferenceBuilder extends Builder { | 12 class ConstructorReferenceBuilder extends Builder { |
14 final String name; | 13 final String name; |
15 | 14 |
16 final List<TypeBuilder> typeArguments; | 15 final List<TypeBuilder> typeArguments; |
17 | 16 |
18 /// This is the name of a named constructor. As `bar` in `new Foo<T>.bar()`. | 17 /// This is the name of a named constructor. As `bar` in `new Foo<T>.bar()`. |
19 final String suffix; | 18 final String suffix; |
20 | 19 |
21 Builder target; | 20 Builder target; |
22 | 21 |
(...skipping 25 matching lines...) Expand all Loading... |
48 } | 47 } |
49 } | 48 } |
50 if (builder is ClassBuilder) { | 49 if (builder is ClassBuilder) { |
51 target = builder.constructors[suffix ?? ""]; | 50 target = builder.constructors[suffix ?? ""]; |
52 } | 51 } |
53 if (target == null) { | 52 if (target == null) { |
54 warning(null, -1, "Couldn't find constructor '$fullNameForErrors'."); | 53 warning(null, -1, "Couldn't find constructor '$fullNameForErrors'."); |
55 } | 54 } |
56 } | 55 } |
57 } | 56 } |
OLD | NEW |