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' | 7 import 'builder.dart' |
8 show | 8 show |
9 Builder, | 9 Builder, |
10 ClassBuilder, | 10 ClassBuilder, |
11 LibraryBuilder, | 11 LibraryBuilder, |
12 PrefixBuilder, | 12 PrefixBuilder, |
13 Scope, | 13 Scope, |
14 TypeBuilder; | 14 TypeBuilder; |
15 | 15 |
16 import '../messages.dart' show warning; | 16 import '../messages.dart' show deprecated_warning; |
17 | 17 |
18 class ConstructorReferenceBuilder extends Builder { | 18 class ConstructorReferenceBuilder extends Builder { |
19 final String name; | 19 final String name; |
20 | 20 |
21 final List<TypeBuilder> typeArguments; | 21 final List<TypeBuilder> typeArguments; |
22 | 22 |
23 /// This is the name of a named constructor. As `bar` in `new Foo<T>.bar()`. | 23 /// This is the name of a named constructor. As `bar` in `new Foo<T>.bar()`. |
24 final String suffix; | 24 final String suffix; |
25 | 25 |
26 Builder target; | 26 Builder target; |
(...skipping 24 matching lines...) Expand all Loading... |
51 target = builder; | 51 target = builder; |
52 return; | 52 return; |
53 } | 53 } |
54 } | 54 } |
55 } | 55 } |
56 if (builder is ClassBuilder) { | 56 if (builder is ClassBuilder) { |
57 target = builder.findConstructorOrFactory( | 57 target = builder.findConstructorOrFactory( |
58 suffix ?? "", charOffset, fileUri, accessingLibrary); | 58 suffix ?? "", charOffset, fileUri, accessingLibrary); |
59 } | 59 } |
60 if (target == null) { | 60 if (target == null) { |
61 warning(fileUri, charOffset, | 61 deprecated_warning(fileUri, charOffset, |
62 "Couldn't find constructor '$fullNameForErrors'."); | 62 "Couldn't find constructor '$fullNameForErrors'."); |
63 } | 63 } |
64 } | 64 } |
65 } | 65 } |
OLD | NEW |