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

Side by Side Diff: pkg/kernel/lib/ast.dart

Issue 2982373002: Resynthesize mixins from Kernel. (Closed)
Patch Set: Created 3 years, 5 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 /// ----------------------------------------------------------------------- 5 /// -----------------------------------------------------------------------
6 /// ERROR HANDLING 6 /// ERROR HANDLING
7 /// ----------------------------------------------------------------------- 7 /// -----------------------------------------------------------------------
8 /// 8 ///
9 /// As a rule of thumb, errors that can be detected statically are handled by 9 /// As a rule of thumb, errors that can be detected statically are handled by
10 /// the frontend, typically by translating the erroneous code into a 'throw' or 10 /// the frontend, typically by translating the erroneous code into a 'throw' or
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 /// Name of the class. 609 /// Name of the class.
610 /// 610 ///
611 /// Must be non-null and must be unique within the library. 611 /// Must be non-null and must be unique within the library.
612 /// 612 ///
613 /// The name may contain characters that are not valid in a Dart identifier, 613 /// The name may contain characters that are not valid in a Dart identifier,
614 /// in particular, the symbol '&' is used in class names generated for mixin 614 /// in particular, the symbol '&' is used in class names generated for mixin
615 /// applications. 615 /// applications.
616 String name; 616 String name;
617 bool isAbstract; 617 bool isAbstract;
618 618
619 /// Whether this class is a synthetic implementation created for each
620 /// mixed-in class. For example the following code:
621 /// class Z extends A with B, C, D {}
622 /// class A {}
623 /// class B {}
624 /// class C {}
625 /// class D {}
626 /// ...creates:
627 /// abstract class A&B extends A mixedIn B {}
628 /// abstract class A&B&C extends A&B mixedIn C {}
629 /// abstract class A&B&C&D extends A&B&C mixedIn D {}
630 /// class Z extends A&B&C&D {}
631 /// All X&Y classes are marked as synthetic.
632 bool isSyntheticMixinImplementation;
633
619 /// The uri of the source file this class was loaded from. 634 /// The uri of the source file this class was loaded from.
620 String fileUri; 635 String fileUri;
621 636
622 final List<TypeParameter> typeParameters; 637 final List<TypeParameter> typeParameters;
623 638
624 /// The immediate super type, or `null` if this is the root class. 639 /// The immediate super type, or `null` if this is the root class.
625 Supertype supertype; 640 Supertype supertype;
626 641
627 /// The mixed-in type if this is a mixin application, otherwise `null`. 642 /// The mixed-in type if this is a mixin application, otherwise `null`.
628 Supertype mixedInType; 643 Supertype mixedInType;
(...skipping 10 matching lines...) Expand all
639 final List<Constructor> constructors; 654 final List<Constructor> constructors;
640 655
641 /// Procedures declared in the class. 656 /// Procedures declared in the class.
642 /// 657 ///
643 /// For mixin applications this should be empty. 658 /// For mixin applications this should be empty.
644 final List<Procedure> procedures; 659 final List<Procedure> procedures;
645 660
646 Class( 661 Class(
647 {this.name, 662 {this.name,
648 this.isAbstract: false, 663 this.isAbstract: false,
664 this.isSyntheticMixinImplementation: false,
649 this.supertype, 665 this.supertype,
650 this.mixedInType, 666 this.mixedInType,
651 List<TypeParameter> typeParameters, 667 List<TypeParameter> typeParameters,
652 List<Supertype> implementedTypes, 668 List<Supertype> implementedTypes,
653 List<Constructor> constructors, 669 List<Constructor> constructors,
654 List<Procedure> procedures, 670 List<Procedure> procedures,
655 List<Field> fields, 671 List<Field> fields,
656 this.fileUri, 672 this.fileUri,
657 Reference reference}) 673 Reference reference})
658 : this.typeParameters = typeParameters ?? <TypeParameter>[], 674 : this.typeParameters = typeParameters ?? <TypeParameter>[],
(...skipping 3992 matching lines...) Expand 10 before | Expand all | Expand 10 after
4651 if (typedef_.canonicalName == null) { 4667 if (typedef_.canonicalName == null) {
4652 throw '$typedef_ has no canonical name'; 4668 throw '$typedef_ has no canonical name';
4653 } 4669 }
4654 return typedef_.canonicalName; 4670 return typedef_.canonicalName;
4655 } 4671 }
4656 4672
4657 /// Annotation describing information which is not part of Dart semantics; in 4673 /// Annotation describing information which is not part of Dart semantics; in
4658 /// other words, if this information (or any information it refers to) changes, 4674 /// other words, if this information (or any information it refers to) changes,
4659 /// static analysis and runtime behavior of the library are unaffected. 4675 /// static analysis and runtime behavior of the library are unaffected.
4660 const informative = null; 4676 const informative = null;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698