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

Side by Side Diff: pkg/front_end/lib/src/fasta/source/source_class_builder.dart

Issue 2800083002: Complain about incorrect this/super constructor initializers. (Closed)
Patch Set: Created 3 years, 8 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.source_class_builder; 5 library fasta.source_class_builder;
6 6
7 import 'package:kernel/ast.dart' 7 import 'package:kernel/ast.dart'
8 show Class, Constructor, Supertype, TreeNode, setParents; 8 show Class, Constructor, Supertype, TreeNode, setParents;
9 9
10 import '../errors.dart' show internalError; 10 import '../errors.dart' show internalError;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (typeVariables != null) { 69 if (typeVariables != null) {
70 for (KernelTypeVariableBuilder t in typeVariables) { 70 for (KernelTypeVariableBuilder t in typeVariables) {
71 cls.typeParameters.add(t.parameter); 71 cls.typeParameters.add(t.parameter);
72 } 72 }
73 setParents(cls.typeParameters, cls); 73 setParents(cls.typeParameters, cls);
74 count += cls.typeParameters.length; 74 count += cls.typeParameters.length;
75 } 75 }
76 return count + super.resolveTypes(library); 76 return count + super.resolveTypes(library);
77 } 77 }
78 78
79 Class build(KernelLibraryBuilder library) { 79 Class build(KernelLibraryBuilder library, LibraryBuilder coreLibrary) {
80 void buildBuilders(String name, Builder builder) { 80 void buildBuilders(String name, Builder builder) {
81 do { 81 do {
82 if (builder is KernelFieldBuilder) { 82 if (builder is KernelFieldBuilder) {
83 // TODO(ahe): It would be nice to have a common interface for the 83 // TODO(ahe): It would be nice to have a common interface for the
84 // build method to avoid duplicating these two cases. 84 // build method to avoid duplicating these two cases.
85 cls.addMember(builder.build(library)); 85 cls.addMember(builder.build(library));
86 } else if (builder is KernelFunctionBuilder) { 86 } else if (builder is KernelFunctionBuilder) {
87 cls.addMember(builder.build(library)); 87 cls.addMember(builder.build(library));
88 } else { 88 } else {
89 internalError("Unhandled builder: ${builder.runtimeType}"); 89 internalError("Unhandled builder: ${builder.runtimeType}");
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 void addSyntheticConstructor(Constructor constructor) { 142 void addSyntheticConstructor(Constructor constructor) {
143 String name = constructor.name.name; 143 String name = constructor.name.name;
144 cls.constructors.add(constructor); 144 cls.constructors.add(constructor);
145 constructor.parent = cls; 145 constructor.parent = cls;
146 DillMemberBuilder memberBuilder = new DillMemberBuilder(constructor, this); 146 DillMemberBuilder memberBuilder = new DillMemberBuilder(constructor, this);
147 memberBuilder.next = constructorScopeBuilder[name]; 147 memberBuilder.next = constructorScopeBuilder[name];
148 constructorScopeBuilder.addMember(name, memberBuilder); 148 constructorScopeBuilder.addMember(name, memberBuilder);
149 } 149 }
150 } 150 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698