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

Side by Side Diff: sdk/lib/mirrors/mirrors.dart

Issue 40613003: Hoist generics-related functions from ClassMirror to TypeMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // For the purposes of the mirrors library, we adopt a naming 5 // For the purposes of the mirrors library, we adopt a naming
6 // convention with respect to getters and setters. Specifically, for 6 // convention with respect to getters and setters. Specifically, for
7 // some variable or field... 7 // some variable or field...
8 // 8 //
9 // var myField; 9 // var myField;
10 // 10 //
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 * An immutable list with mirrors for all type variables for this type. 744 * An immutable list with mirrors for all type variables for this type.
745 * 745 *
746 * If this type is a generic declaration or an invocation of a generic 746 * If this type is a generic declaration or an invocation of a generic
747 * declaration, the returned list contains mirrors on the type variables 747 * declaration, the returned list contains mirrors on the type variables
748 * declared in the original declaration. 748 * declared in the original declaration.
749 * Otherwise, the returned list is empty. 749 * Otherwise, the returned list is empty.
750 * 750 *
751 * This list preserves the order of declaration of the type variables. 751 * This list preserves the order of declaration of the type variables.
752 */ 752 */
753 List<TypeVariableMirror> get typeVariables; 753 List<TypeVariableMirror> get typeVariables;
754
755 /**
756 * An immutable list with mirrors for all type arguments for
757 * this type.
758 *
759 * If the reflectee is an invocation of a generic class,
760 * the type arguments are the bindings of its type parameters.
761 * If the reflectee is the original declaration of a generic,
762 * it has no type arguments and this method returns an empty list.
763 * If the reflectee is not generic, then
764 * it has no type arguments and this method returns an empty list.
765 *
766 * This list preserves the order of declaration of the type variables.
767 */
768 List<TypeMirror> get typeArguments;
769
770 /**
771 * Is this the original declaration of this type?
772 *
773 * For most classes, they are their own original declaration. For
774 * generic classes, however, there is a distinction between the
775 * original class declaration, which has unbound type variables, and
776 * the instantiations of generic classes, which have bound type
777 * variables.
778 */
779 bool get isOriginalDeclaration;
780
781 /**
782 * A mirror on the original declaration of this type.
783 *
784 * For most classes, they are their own original declaration. For
785 * generic classes, however, there is a distinction between the
786 * original class declaration, which has unbound type variables, and
787 * the instantiations of generic classes, which have bound type
788 * variables.
789 */
790 TypeMirror get originalDeclaration;
754 } 791 }
755 792
756 /** 793 /**
757 * A [ClassMirror] reflects a Dart language class. 794 * A [ClassMirror] reflects a Dart language class.
758 */ 795 */
759 abstract class ClassMirror implements TypeMirror, ObjectMirror { 796 abstract class ClassMirror implements TypeMirror, ObjectMirror {
760 /** 797 /**
761 * Returns true if this mirror reflects a non-generic class or an instantiated 798 * Returns true if this mirror reflects a non-generic class or an instantiated
762 * generic class in the current isolate. Otherwise, returns false. 799 * generic class in the current isolate. Otherwise, returns false.
763 */ 800 */
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 * declarations for this type. 862 * declarations for this type.
826 */ 863 */
827 Map<Symbol, VariableMirror> get variables; 864 Map<Symbol, VariableMirror> get variables;
828 865
829 /** 866 /**
830 * An immutable map from names to mirrors for all constructor 867 * An immutable map from names to mirrors for all constructor
831 * declarations for this type. 868 * declarations for this type.
832 */ 869 */
833 Map<Symbol, MethodMirror> get constructors; 870 Map<Symbol, MethodMirror> get constructors;
834 871
835 /**
836 * An immutable list with mirrors for all type arguments for
837 * this type.
838 *
839 * If the reflectee is an invocation of a generic class,
840 * the type arguments are the bindings of its type parameters.
841 * If the reflectee is the original declaration of a generic,
842 * it has no type arguments and this method returns an empty list.
843 * If the reflectee is not generic, then
844 * it has no type arguments and this method returns an empty list.
845 *
846 * This list preserves the order of declaration of the type variables.
847 */
848 List<TypeMirror> get typeArguments;
849
850 /**
851 * Is this the original declaration of this type?
852 *
853 * For most classes, they are their own original declaration. For
854 * generic classes, however, there is a distinction between the
855 * original class declaration, which has unbound type variables, and
856 * the instantiations of generic classes, which have bound type
857 * variables.
858 */
859 bool get isOriginalDeclaration;
860
861 /**
862 * A mirror on the original declaration of this type.
863 *
864 * For most classes, they are their own original declaration. For
865 * generic classes, however, there is a distinction between the
866 * original class declaration, which has unbound type variables, and
867 * the instantiations of generic classes, which have bound type
868 * variables.
869 */
870 ClassMirror get originalDeclaration;
871
872 /** 872 /**
873 * Invokes the named constructor and returns a mirror on the result. 873 * Invokes the named constructor and returns a mirror on the result.
874 * 874 *
875 * Let *c* be the class reflected by this mirror 875 * Let *c* be the class reflected by this mirror
876 * let *a1, ..., an* be the elements of [positionalArguments] 876 * let *a1, ..., an* be the elements of [positionalArguments]
877 * let *k1, ..., km* be the identifiers denoted by the elements of 877 * let *k1, ..., km* be the identifiers denoted by the elements of
878 * [namedArguments.keys] 878 * [namedArguments.keys]
879 * and let *v1, ..., vm* be the elements of [namedArguments.values]. 879 * and let *v1, ..., vm* be the elements of [namedArguments.values].
880 * If [constructorName] was created from the empty string 880 * If [constructorName] was created from the empty string
881 * Then this method will execute the instance creation expression 881 * Then this method will execute the instance creation expression
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 * 1402 *
1403 * When used as metadata on an import of "dart:mirrors", this metadata does 1403 * When used as metadata on an import of "dart:mirrors", this metadata does
1404 * not apply to the library in which the annotation is used, but instead 1404 * not apply to the library in which the annotation is used, but instead
1405 * applies to the other libraries (all libraries if "*" is used). 1405 * applies to the other libraries (all libraries if "*" is used).
1406 */ 1406 */
1407 final override; 1407 final override;
1408 1408
1409 const MirrorsUsed( 1409 const MirrorsUsed(
1410 {this.symbols, this.targets, this.metaTargets, this.override}); 1410 {this.symbols, this.targets, this.metaTargets, this.override});
1411 } 1411 }
OLDNEW
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698