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

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

Issue 2941093002: Only attempt to do type inference on fields that lack a declared type. (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_library_builder; 5 library fasta.kernel_library_builder;
6 6
7 import 'package:front_end/src/scanner/token.dart' show Token; 7 import 'package:front_end/src/scanner/token.dart' show Token;
8 8
9 import 'package:kernel/ast.dart'; 9 import 'package:kernel/ast.dart';
10 10
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 metadata: metadata, 457 metadata: metadata,
458 name: name, 458 name: name,
459 typeVariables: typeVariables, 459 typeVariables: typeVariables,
460 modifiers: modifiers, 460 modifiers: modifiers,
461 interfaces: interfaces, 461 interfaces: interfaces,
462 charOffset: charOffset); 462 charOffset: charOffset);
463 checkTypeVariables(typeVariables, supertype.builder); 463 checkTypeVariables(typeVariables, supertype.builder);
464 } 464 }
465 465
466 @override 466 @override
467 void addField(List<MetadataBuilder> metadata, int modifiers, 467 void addField(
468 KernelTypeBuilder type, String name, int charOffset, Token initializer) { 468 List<MetadataBuilder> metadata,
469 int modifiers,
470 KernelTypeBuilder type,
471 String name,
472 int charOffset,
473 Token initializerTokenForInference,
474 bool hasInitializer) {
469 addBuilder( 475 addBuilder(
470 name, 476 name,
471 new KernelFieldBuilder( 477 new KernelFieldBuilder(metadata, type, name, modifiers, this,
472 metadata, type, name, modifiers, this, charOffset, initializer), 478 charOffset, initializerTokenForInference, hasInitializer),
473 charOffset); 479 charOffset);
474 } 480 }
475 481
476 String computeAndValidateConstructorName(String name, int charOffset) { 482 String computeAndValidateConstructorName(String name, int charOffset) {
477 String className = currentDeclaration.name; 483 String className = currentDeclaration.name;
478 bool startsWithClassName = name.startsWith(className); 484 bool startsWithClassName = name.startsWith(className);
479 if (startsWithClassName && name.length == className.length) { 485 if (startsWithClassName && name.length == className.length) {
480 // Unnamed constructor or factory. 486 // Unnamed constructor or factory.
481 return ""; 487 return "";
482 } 488 }
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 mixinApplicationClasses.putIfAbsent(name, () => builder); 855 mixinApplicationClasses.putIfAbsent(name, () => builder);
850 if (existing != builder) { 856 if (existing != builder) {
851 part.scope.local.remove(name); 857 part.scope.local.remove(name);
852 } 858 }
853 }); 859 });
854 super.includePart(part); 860 super.includePart(part);
855 nativeMethods.addAll(part.nativeMethods); 861 nativeMethods.addAll(part.nativeMethods);
856 boundlessTypeVariables.addAll(part.boundlessTypeVariables); 862 boundlessTypeVariables.addAll(part.boundlessTypeVariables);
857 } 863 }
858 } 864 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698