Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/kernel_target.dart

Issue 2709943005: Canonicalize mixin applications by their name (Closed)
Patch Set: Address comment Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.kernel_target; 5 library fasta.kernel_target;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'dart:io' show 10 import 'dart:io' show
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 loader.builders.forEach((Uri uri, LibraryBuilder library) { 187 loader.builders.forEach((Uri uri, LibraryBuilder library) {
188 library.members.forEach((String name, Builder member) { 188 library.members.forEach((String name, Builder member) {
189 if (member is SourceClassBuilder) { 189 if (member is SourceClassBuilder) {
190 result.add(member); 190 result.add(member);
191 } 191 }
192 }); 192 });
193 }); 193 });
194 return result; 194 return result;
195 } 195 }
196 196
197 List<Class> collectAllMixinApplications() {
198 List<Class> result = <Class>[];
199 loader.builders.forEach((Uri uri, LibraryBuilder library) {
200 if (library is KernelLibraryBuilder) {
201 result.addAll(library.mixinApplicationClasses);
202 }
203 });
204 return result;
205 }
206
207 void breakCycle(ClassBuilder builder) { 197 void breakCycle(ClassBuilder builder) {
208 Class cls = builder.target; 198 Class cls = builder.target;
209 cls.implementedTypes.clear(); 199 cls.implementedTypes.clear();
210 cls.supertype = null; 200 cls.supertype = null;
211 cls.mixedInType = null; 201 cls.mixedInType = null;
212 builder.supertype = 202 builder.supertype =
213 new KernelNamedTypeBuilder( 203 new KernelNamedTypeBuilder(
214 "Object", null, builder.charOffset, 204 "Object", null, builder.charOffset,
215 builder.fileUri ?? Uri.parse(cls.fileUri)) 205 builder.fileUri ?? Uri.parse(cls.fileUri))
216 ..builder = objectClassBuilder; 206 ..builder = objectClassBuilder;
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 superclass = superclass.superclass; 591 superclass = superclass.superclass;
602 } 592 }
603 for (Constructor constructor in superclass.constructors) { 593 for (Constructor constructor in superclass.constructors) {
604 if (constructor.name.name.isEmpty) { 594 if (constructor.name.name.isEmpty) {
605 return constructor.function.requiredParameterCount == 0 ? 595 return constructor.function.requiredParameterCount == 0 ?
606 constructor : null; 596 constructor : null;
607 } 597 }
608 } 598 }
609 return null; 599 return null;
610 } 600 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_mixin_application_builder.dart ('k') | pkg/front_end/test/fasta/compile.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698