@@ -472,7 +472,8 @@ object Types {
472
472
* Inherited by all type proxies. Overridden for And and Or types.
473
473
* `Nil` for all other types.
474
474
*/
475
- def baseClasses (implicit ctx : Context ): List [ClassSymbol ] = track(" baseClasses" ) {
475
+ def baseClasses (implicit ctx : Context ): List [ClassSymbol ] = {
476
+ record(" baseClasses" )
476
477
this match {
477
478
case tp : TypeProxy =>
478
479
tp.underlying.baseClasses
@@ -501,12 +502,13 @@ object Types {
501
502
* The result is either a SymDenotation or a MultiDenotation of SymDenotations.
502
503
* The info(s) are the original symbol infos, no translation takes place.
503
504
*/
504
- final def decl (name : Name )(implicit ctx : Context ): Denotation = track(" decl" ) {
505
+ final def decl (name : Name )(implicit ctx : Context ): Denotation = {
506
+ record(" decl" )
505
507
findDecl(name, EmptyFlags )
506
508
}
507
509
508
510
/** A denotation containing the non-private declaration(s) in this type with the given name */
509
- final def nonPrivateDecl (name : Name )(implicit ctx : Context ): Denotation = track( " nonPrivateDecl " ) {
511
+ final def nonPrivateDecl (name : Name )(implicit ctx : Context ): Denotation = {
510
512
findDecl(name, Private )
511
513
}
512
514
@@ -526,12 +528,14 @@ object Types {
526
528
}
527
529
528
530
/** The member of this type with the given name */
529
- final def member (name : Name )(implicit ctx : Context ): Denotation = /* >|>*/ track(" member" ) /* <|<*/ {
531
+ final def member (name : Name )(implicit ctx : Context ): Denotation = /* >|>*/ {
532
+ record(" member" )
530
533
memberBasedOnFlags(name, required = EmptyFlags , excluded = EmptyFlags )
531
534
}
532
535
533
536
/** The non-private member of this type with the given name. */
534
- final def nonPrivateMember (name : Name )(implicit ctx : Context ): Denotation = track(" nonPrivateMember" ) {
537
+ final def nonPrivateMember (name : Name )(implicit ctx : Context ): Denotation = {
538
+ record(" nonPrivateMember" )
535
539
memberBasedOnFlags(name, required = EmptyFlags , excluded = Flags .Private )
536
540
}
537
541
@@ -759,31 +763,36 @@ object Types {
759
763
}
760
764
761
765
/** The set of abstract term members of this type. */
762
- final def abstractTermMembers (implicit ctx : Context ): Seq [SingleDenotation ] = track(" abstractTermMembers" ) {
766
+ final def abstractTermMembers (implicit ctx : Context ): Seq [SingleDenotation ] = {
767
+ record(" abstractTermMembers" )
763
768
memberDenots(abstractTermNameFilter,
764
769
(name, buf) => buf ++= nonPrivateMember(name).altsWith(_.is(Deferred )))
765
770
}
766
771
767
772
/** The set of abstract type members of this type. */
768
- final def abstractTypeMembers (implicit ctx : Context ): Seq [SingleDenotation ] = track(" abstractTypeMembers" ) {
773
+ final def abstractTypeMembers (implicit ctx : Context ): Seq [SingleDenotation ] = {
774
+ record(" abstractTypeMembers" )
769
775
memberDenots(abstractTypeNameFilter,
770
776
(name, buf) => buf += nonPrivateMember(name).asSingleDenotation)
771
777
}
772
778
773
779
/** The set of abstract type members of this type. */
774
- final def nonClassTypeMembers (implicit ctx : Context ): Seq [SingleDenotation ] = track(" nonClassTypeMembers" ) {
780
+ final def nonClassTypeMembers (implicit ctx : Context ): Seq [SingleDenotation ] = {
781
+ record(" nonClassTypeMembers" )
775
782
memberDenots(nonClassTypeNameFilter,
776
783
(name, buf) => buf += member(name).asSingleDenotation)
777
784
}
778
785
779
786
/** The set of type alias members of this type */
780
- final def typeAliasMembers (implicit ctx : Context ): Seq [SingleDenotation ] = track(" typeAlias" ) {
787
+ final def typeAliasMembers (implicit ctx : Context ): Seq [SingleDenotation ] = {
788
+ record(" typeAliasMembers" )
781
789
memberDenots(typeAliasNameFilter,
782
790
(name, buf) => buf += member(name).asSingleDenotation)
783
791
}
784
792
785
793
/** The set of type members of this type */
786
- final def typeMembers (implicit ctx : Context ): Seq [SingleDenotation ] = track(" typeMembers" ) {
794
+ final def typeMembers (implicit ctx : Context ): Seq [SingleDenotation ] = {
795
+ record(" typeMembers" )
787
796
memberDenots(typeNameFilter,
788
797
(name, buf) => buf += member(name).asSingleDenotation)
789
798
}
@@ -792,31 +801,36 @@ object Types {
792
801
* @param kind A subset of {Implicit, Given} that specifies what kind of implicit should
793
802
* be returned
794
803
*/
795
- final def implicitMembers (kind : FlagSet )(implicit ctx : Context ): List [TermRef ] = track(" implicitMembers" ) {
804
+ final def implicitMembers (kind : FlagSet )(implicit ctx : Context ): List [TermRef ] = {
805
+ record(" implicitMembers" )
796
806
memberDenots(implicitFilter,
797
807
(name, buf) => buf ++= member(name).altsWith(_.isOneOf(GivenOrImplicitVal & kind)))
798
808
.toList.map(d => TermRef (this , d.symbol.asTerm))
799
809
}
800
810
801
811
/** The set of member classes of this type */
802
- final def memberClasses (implicit ctx : Context ): Seq [SingleDenotation ] = track(" memberClasses" ) {
812
+ final def memberClasses (implicit ctx : Context ): Seq [SingleDenotation ] = {
813
+ record(" memberClasses" )
803
814
memberDenots(typeNameFilter,
804
815
(name, buf) => buf ++= member(name).altsWith(x => x.isClass))
805
816
}
806
817
807
- final def fields (implicit ctx : Context ): Seq [SingleDenotation ] = track(" fields" ) {
818
+ final def fields (implicit ctx : Context ): Seq [SingleDenotation ] = {
819
+ record(" fields" )
808
820
memberDenots(fieldFilter,
809
821
(name, buf) => buf ++= member(name).altsWith(x => ! x.is(Method )))
810
822
}
811
823
812
824
/** The set of members of this type that have all of `required` flags but none of `excluded` flags set. */
813
- final def membersBasedOnFlags (required : FlagSet , excluded : FlagSet )(implicit ctx : Context ): Seq [SingleDenotation ] = track(" membersBasedOnFlags" ) {
825
+ final def membersBasedOnFlags (required : FlagSet , excluded : FlagSet )(implicit ctx : Context ): Seq [SingleDenotation ] = {
826
+ record(" membersBasedOnFlags" )
814
827
memberDenots(takeAllFilter,
815
828
(name, buf) => buf ++= memberBasedOnFlags(name, required, excluded).alternatives)
816
829
}
817
830
818
831
/** All members of this type. Warning: this can be expensive to compute! */
819
- final def allMembers (implicit ctx : Context ): Seq [SingleDenotation ] = track(" allMembers" ) {
832
+ final def allMembers (implicit ctx : Context ): Seq [SingleDenotation ] = {
833
+ record(" allMembers" )
820
834
memberDenots(takeAllFilter, (name, buf) => buf ++= member(name).alternatives)
821
835
}
822
836
@@ -827,27 +841,31 @@ object Types {
827
841
/** This type seen as if it were the type of a member of prefix type `pre`
828
842
* declared in class `cls`.
829
843
*/
830
- final def asSeenFrom (pre : Type , cls : Symbol )(implicit ctx : Context ): Type = track(" asSeenFrom" ) {
844
+ final def asSeenFrom (pre : Type , cls : Symbol )(implicit ctx : Context ): Type = {
845
+ record(" asSeenFrom" )
831
846
if (! cls.membersNeedAsSeenFrom(pre)) this
832
847
else ctx.asSeenFrom(this , pre, cls)
833
848
}
834
849
835
850
// ----- Subtype-related --------------------------------------------
836
851
837
852
/** Is this type a subtype of that type? */
838
- final def <:< (that : Type )(implicit ctx : Context ): Boolean = track(" <:<" ) {
853
+ final def <:< (that : Type )(implicit ctx : Context ): Boolean = {
854
+ record(" <:<" )
839
855
ctx.typeComparer.topLevelSubType(this , that)
840
856
}
841
857
842
858
/** Is this type a subtype of that type? */
843
- final def frozen_<:< (that : Type )(implicit ctx : Context ): Boolean = track(" frozen_<:<" ) {
859
+ final def frozen_<:< (that : Type )(implicit ctx : Context ): Boolean = {
860
+ record(" frozen_<:<" )
844
861
ctx.typeComparer.isSubTypeWhenFrozen(this , that)
845
862
}
846
863
847
864
/** Is this type the same as that type?
848
865
* This is the case iff `this <:< that` and `that <:< this`.
849
866
*/
850
- final def =:= (that : Type )(implicit ctx : Context ): Boolean = track(" =:=" ) {
867
+ final def =:= (that : Type )(implicit ctx : Context ): Boolean = {
868
+ record(" =:=" )
851
869
ctx.typeComparer.isSameType(this , that)
852
870
}
853
871
@@ -905,7 +923,8 @@ object Types {
905
923
* (*) when matching with a Java method, we also regard Any and Object as equivalent
906
924
* parameter types.
907
925
*/
908
- def matches (that : Type )(implicit ctx : Context ): Boolean = track(" matches" ) {
926
+ def matches (that : Type )(implicit ctx : Context ): Boolean = {
927
+ record(" matches" )
909
928
ctx.typeComparer.matchesType(this , that, relaxed = ! ctx.phase.erasedTypes)
910
929
}
911
930
@@ -920,14 +939,16 @@ object Types {
920
939
}
921
940
922
941
/** The basetype of this type with given class symbol, NoType if `base` is not a class. */
923
- final def baseType (base : Symbol )(implicit ctx : Context ): Type = /* trace(s"$this baseType $base")*/ /* >|>*/ track(" base type" ) /* <|<*/ {
942
+ final def baseType (base : Symbol )(implicit ctx : Context ): Type = {
943
+ record(" baseType" )
924
944
base.denot match {
925
945
case classd : ClassDenotation => classd.baseTypeOf(this )
926
946
case _ => NoType
927
947
}
928
948
}
929
949
930
- def & (that : Type )(implicit ctx : Context ): Type = track(" &" ) {
950
+ def & (that : Type )(implicit ctx : Context ): Type = {
951
+ record(" &" )
931
952
ctx.typeComparer.glb(this , that)
932
953
}
933
954
@@ -956,7 +977,8 @@ object Types {
956
977
// superclass.
957
978
}
958
979
959
- def | (that : Type )(implicit ctx : Context ): Type = track(" |" ) {
980
+ def | (that : Type )(implicit ctx : Context ): Type = {
981
+ record(" |" )
960
982
ctx.typeComparer.lub(this , that)
961
983
}
962
984
0 commit comments