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

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

Issue 2788153002: Create separate scopes for constructors, setters, and other members. (Closed)
Patch Set: Update subpackage dependencies. 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.kernel_target; 5 library fasta.kernel_target;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'dart:io' show File, IOSink; 9 import 'dart:io' show File, IOSink;
10 10
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 421
422 /// If [builder] doesn't have a constructors, install the defaults. 422 /// If [builder] doesn't have a constructors, install the defaults.
423 void installDefaultConstructor(SourceClassBuilder builder) { 423 void installDefaultConstructor(SourceClassBuilder builder) {
424 if (builder.cls.isMixinApplication) { 424 if (builder.cls.isMixinApplication) {
425 // We have to test if builder.cls is a mixin application. [builder] may 425 // We have to test if builder.cls is a mixin application. [builder] may
426 // think it's a mixin application, but if its mixed-in type couldn't be 426 // think it's a mixin application, but if its mixed-in type couldn't be
427 // resolved, the target class won't be a mixin application and we need 427 // resolved, the target class won't be a mixin application and we need
428 // to add a default constructor to complete error recovery. 428 // to add a default constructor to complete error recovery.
429 return; 429 return;
430 } 430 }
431 if (builder.constructors.isNotEmpty) return; 431 if (builder.constructors.local.isNotEmpty) return;
432 432
433 /// Quotes below are from [Dart Programming Language Specification, 4th 433 /// Quotes below are from [Dart Programming Language Specification, 4th
434 /// Edition]( 434 /// Edition](
435 /// https://ecma-international.org/publications/files/ECMA-ST/ECMA-408.pdf): 435 /// https://ecma-international.org/publications/files/ECMA-ST/ECMA-408.pdf):
436 if (builder is NamedMixinApplicationBuilder) { 436 if (builder is NamedMixinApplicationBuilder) {
437 /// >A mixin application of the form S with M; defines a class C with 437 /// >A mixin application of the form S with M; defines a class C with
438 /// >superclass S. 438 /// >superclass S.
439 /// >... 439 /// >...
440 440
441 /// >Let LM be the library in which M is declared. For each generative 441 /// >Let LM be the library in which M is declared. For each generative
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 } 696 }
697 for (Constructor constructor in superclass.constructors) { 697 for (Constructor constructor in superclass.constructors) {
698 if (constructor.name.name.isEmpty) { 698 if (constructor.name.name.isEmpty) {
699 return constructor.function.requiredParameterCount == 0 699 return constructor.function.requiredParameterCount == 0
700 ? constructor 700 ? constructor
701 : null; 701 : null;
702 } 702 }
703 } 703 }
704 return null; 704 return null;
705 } 705 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698