Skip to content

Commit a29e870

Browse files
committed
Replace MemberBinding # memberInfo by memberBounds
1 parent 1aed088 commit a29e870

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/dotty/tools/dotc/core/MemberBinding.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package dotty.tools.dotc.core
22

33
import Names.Name
44
import Contexts.Context
5-
import Types.Type
5+
import Types.{Type, TypeBounds}
66

77
/** A common super trait of Symbol and Refinement.
88
* Used to capture the attributes of type parameters
@@ -19,13 +19,13 @@ trait MemberBinding {
1919
def memberName(implicit ctx: Context): Name
2020

2121
/** The info of the member */
22-
def memberInfo(implicit ctx: Context): Type
22+
def memberBounds(implicit ctx: Context): TypeBounds
2323

2424
/** The info of the member as seen from a prefix type.
2525
* This can be different from `memberInfo` if the binding
2626
* is a type symbol of a class.
2727
*/
28-
def memberInfoAsSeenFrom(pre: Type)(implicit ctx: Context): Type
28+
def memberBoundsAsSeenFrom(pre: Type)(implicit ctx: Context): TypeBounds
2929

3030
/** The variance of the type parameter
3131
* @pre: isTypeParam = true

src/dotty/tools/dotc/core/Symbols.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@ object Symbols {
492492
// MemberBinding methods
493493
def isTypeParam(implicit ctx: Context) = denot.is(TypeParam)
494494
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
497497
def memberVariance(implicit ctx: Context) = denot.variance
498498

499499
// -------- Printing --------------------------------------------------------

src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,8 +2088,8 @@ object Types {
20882088
case _ => false
20892089
}
20902090
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
20932093
def memberVariance(implicit ctx: Context) = BindingKind.toVariance(refinedInfo.bounds.bindingKind)
20942094

20952095
override def equals(that: Any) = that match {

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,11 +937,11 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
937937
def typedArg(arg: untpd.Tree, tparam: MemberBinding) = {
938938
val (desugaredArg, argPt) =
939939
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)
941941
else
942942
(arg, WildcardType)
943943
val arg1 = typed(desugaredArg, argPt)
944-
adaptTypeArg(arg1, tparam.memberInfo)
944+
adaptTypeArg(arg1, tparam.memberBounds)
945945
}
946946
args.zipWithConserve(tparams)(typedArg(_, _)).asInstanceOf[List[Tree]]
947947
}

0 commit comments

Comments
 (0)