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.mixin_application_builder; | 5 library fasta.mixin_application_builder; |
6 | 6 |
7 import '../errors.dart' show internalError; | 7 import '../deprecated_problems.dart' show deprecated_internalProblem; |
8 | 8 |
9 import 'builder.dart' | 9 import 'builder.dart' |
10 show Scope, TypeBuilder, TypeDeclarationBuilder, TypeVariableBuilder; | 10 show Scope, TypeBuilder, TypeDeclarationBuilder, TypeVariableBuilder; |
11 | 11 |
12 abstract class MixinApplicationBuilder<T extends TypeBuilder> | 12 abstract class MixinApplicationBuilder<T extends TypeBuilder> |
13 extends TypeBuilder { | 13 extends TypeBuilder { |
14 final T supertype; | 14 final T supertype; |
15 final List<T> mixins; | 15 final List<T> mixins; |
16 | 16 |
17 MixinApplicationBuilder( | 17 MixinApplicationBuilder( |
(...skipping 13 matching lines...) Expand all Loading... |
31 String get name => null; | 31 String get name => null; |
32 | 32 |
33 void resolveIn(Scope scope) { | 33 void resolveIn(Scope scope) { |
34 supertype.resolveIn(scope); | 34 supertype.resolveIn(scope); |
35 for (T t in mixins) { | 35 for (T t in mixins) { |
36 t.resolveIn(scope); | 36 t.resolveIn(scope); |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 void bind(TypeDeclarationBuilder builder) { | 40 void bind(TypeDeclarationBuilder builder) { |
41 internalError("Internal error: can't bind a mixin application."); | 41 deprecated_internalProblem( |
| 42 "Internal error: can't bind a mixin application."); |
42 } | 43 } |
43 | 44 |
44 String get debugName => "MixinApplicationBuilder"; | 45 String get debugName => "MixinApplicationBuilder"; |
45 | 46 |
46 StringBuffer printOn(StringBuffer buffer) { | 47 StringBuffer printOn(StringBuffer buffer) { |
47 buffer.write(supertype); | 48 buffer.write(supertype); |
48 buffer.write(" with "); | 49 buffer.write(" with "); |
49 bool first = true; | 50 bool first = true; |
50 for (T t in mixins) { | 51 for (T t in mixins) { |
51 if (!first) buffer.write(", "); | 52 if (!first) buffer.write(", "); |
52 first = false; | 53 first = false; |
53 t.printOn(buffer); | 54 t.printOn(buffer); |
54 } | 55 } |
55 return buffer; | 56 return buffer; |
56 } | 57 } |
57 } | 58 } |
OLD | NEW |