File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package dotty.tools.dotc.core
2
2
3
3
import Names .Name
4
4
import Contexts .Context
5
- import Types .Type
5
+ import Types .{ Type , TypeBounds }
6
6
7
7
/** A common super trait of Symbol and Refinement.
8
8
* Used to capture the attributes of type parameters
@@ -19,13 +19,13 @@ trait MemberBinding {
19
19
def memberName (implicit ctx : Context ): Name
20
20
21
21
/** The info of the member */
22
- def memberInfo (implicit ctx : Context ): Type
22
+ def memberBounds (implicit ctx : Context ): TypeBounds
23
23
24
24
/** The info of the member as seen from a prefix type.
25
25
* This can be different from `memberInfo` if the binding
26
26
* is a type symbol of a class.
27
27
*/
28
- def memberInfoAsSeenFrom (pre : Type )(implicit ctx : Context ): Type
28
+ def memberBoundsAsSeenFrom (pre : Type )(implicit ctx : Context ): TypeBounds
29
29
30
30
/** The variance of the type parameter
31
31
* @pre: isTypeParam = true
Original file line number Diff line number Diff line change @@ -492,8 +492,8 @@ object Symbols {
492
492
// MemberBinding methods
493
493
def isTypeParam (implicit ctx : Context ) = denot.is(TypeParam )
494
494
def memberName (implicit ctx : Context ): Name = name
495
- def memberInfo (implicit ctx : Context ) = denot.info
496
- def memberInfoAsSeenFrom (pre : Type )(implicit ctx : Context ) = pre.memberInfo(this )
495
+ def memberBounds (implicit ctx : Context ) = denot.info.bounds
496
+ def memberBoundsAsSeenFrom (pre : Type )(implicit ctx : Context ) = pre.memberInfo(this ).bounds
497
497
def memberVariance (implicit ctx : Context ) = denot.variance
498
498
499
499
// -------- Printing --------------------------------------------------------
Original file line number Diff line number Diff line change @@ -2088,8 +2088,8 @@ object Types {
2088
2088
case _ => false
2089
2089
}
2090
2090
def memberName (implicit ctx : Context ) = refinedName
2091
- def memberInfo (implicit ctx : Context ) = refinedInfo
2092
- def memberInfoAsSeenFrom (pre : Type )(implicit ctx : Context ) = refinedInfo
2091
+ def memberBounds (implicit ctx : Context ) = refinedInfo.bounds
2092
+ def memberBoundsAsSeenFrom (pre : Type )(implicit ctx : Context ) = memberBounds
2093
2093
def memberVariance (implicit ctx : Context ) = BindingKind .toVariance(refinedInfo.bounds.bindingKind)
2094
2094
2095
2095
override def equals (that : Any ) = that match {
Original file line number Diff line number Diff line change @@ -937,11 +937,11 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
937
937
def typedArg (arg : untpd.Tree , tparam : MemberBinding ) = {
938
938
val (desugaredArg, argPt) =
939
939
if (ctx.mode is Mode .Pattern )
940
- (if (isVarPattern(arg)) desugar.patternVar(arg) else arg, tparam.memberInfo )
940
+ (if (isVarPattern(arg)) desugar.patternVar(arg) else arg, tparam.memberBounds )
941
941
else
942
942
(arg, WildcardType )
943
943
val arg1 = typed(desugaredArg, argPt)
944
- adaptTypeArg(arg1, tparam.memberInfo )
944
+ adaptTypeArg(arg1, tparam.memberBounds )
945
945
}
946
946
args.zipWithConserve(tparams)(typedArg(_, _)).asInstanceOf [List [Tree ]]
947
947
}
You can’t perform that action at this time.
0 commit comments