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

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

Issue 2946273002: Implement override-based type inference for instance methods. (Closed)
Patch Set: Created 3 years, 6 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_class_builder; 5 library fasta.kernel_class_builder;
6 6
7 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart' 7 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'
8 show KernelMember; 8 show KernelMember;
9 9
10 import 'package:kernel/ast.dart' 10 import 'package:kernel/ast.dart'
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 void checkOverride( 188 void checkOverride(
189 Member declaredMember, Member interfaceMember, bool isSetter) { 189 Member declaredMember, Member interfaceMember, bool isSetter) {
190 if (declaredMember is Constructor || interfaceMember is Constructor) { 190 if (declaredMember is Constructor || interfaceMember is Constructor) {
191 internalError( 191 internalError(
192 "Constructor in override check.", fileUri, declaredMember.fileOffset); 192 "Constructor in override check.", fileUri, declaredMember.fileOffset);
193 } 193 }
194 if (declaredMember is Procedure && interfaceMember is Procedure) { 194 if (declaredMember is Procedure && interfaceMember is Procedure) {
195 if (declaredMember.kind == ProcedureKind.Method && 195 if (declaredMember.kind == ProcedureKind.Method &&
196 interfaceMember.kind == ProcedureKind.Method) { 196 interfaceMember.kind == ProcedureKind.Method) {
197 checkMethodOverride(declaredMember, interfaceMember); 197 checkMethodOverride(declaredMember, interfaceMember);
198 return;
199 } 198 }
200 } 199 }
201 // TODO(ahe): Handle other cases: accessors, operators, and fields. 200 // TODO(ahe): Handle other cases: accessors, operators, and fields.
202 201
203 // Also record any cases where a field or getter/setter overrides something 202 // Also record any cases where a field or getter/setter overrides something
204 // in a superclass, since this information will be needed for type 203 // in a superclass, since this information will be needed for type
205 // inference. 204 // inference.
206 if (declaredMember is KernelMember && 205 if (declaredMember is KernelMember &&
207 identical(declaredMember.enclosingClass, cls)) { 206 identical(declaredMember.enclosingClass, cls)) {
208 KernelMember.recordOverride(declaredMember, interfaceMember); 207 KernelMember.recordOverride(declaredMember, interfaceMember);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 293 }
295 } 294 }
296 } 295 }
297 296
298 String get fullNameForErrors { 297 String get fullNameForErrors {
299 return isMixinApplication 298 return isMixinApplication
300 ? "${supertype.fullNameForErrors} with ${mixedInType.fullNameForErrors}" 299 ? "${supertype.fullNameForErrors} with ${mixedInType.fullNameForErrors}"
301 : name; 300 : name;
302 } 301 }
303 } 302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698