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 '../deprecated_problems.dart' show deprecated_internalProblem; | 7 import '../problems.dart' show unsupported; |
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 deprecated_internalProblem( | 41 unsupported("bind", -1, null); |
42 "Internal error: can't bind a mixin application."); | |
43 } | 42 } |
44 | 43 |
45 String get debugName => "MixinApplicationBuilder"; | 44 String get debugName => "MixinApplicationBuilder"; |
46 | 45 |
47 StringBuffer printOn(StringBuffer buffer) { | 46 StringBuffer printOn(StringBuffer buffer) { |
48 buffer.write(supertype); | 47 buffer.write(supertype); |
49 buffer.write(" with "); | 48 buffer.write(" with "); |
50 bool first = true; | 49 bool first = true; |
51 for (T t in mixins) { | 50 for (T t in mixins) { |
52 if (!first) buffer.write(", "); | 51 if (!first) buffer.write(", "); |
53 first = false; | 52 first = false; |
54 t.printOn(buffer); | 53 t.printOn(buffer); |
55 } | 54 } |
56 return buffer; | 55 return buffer; |
57 } | 56 } |
58 } | 57 } |
OLD | NEW |