Skip to content

Commit 1b4fbf3

Browse files
authored
Merge pull request #4039 from dotty-staging/rename-dependent
Rename isDependent
2 parents fcd422a + 2910d8a commit 1b4fbf3

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ object Types {
13621362
val funType = defn.FunctionOf(
13631363
formals1 mapConserve (_.underlyingIfRepeated(mt.isJavaMethod)),
13641364
mt.nonDependentResultApprox, isImplicit, isUnused)
1365-
if (mt.isDependent) RefinedType(funType, nme.apply, mt)
1365+
if (mt.isResultDependent) RefinedType(funType, nme.apply, mt)
13661366
else funType
13671367
}
13681368

@@ -2668,7 +2668,7 @@ object Types {
26682668

26692669
override def resultType(implicit ctx: Context) = resType
26702670

2671-
def isDependent(implicit ctx: Context): Boolean
2671+
def isResultDependent(implicit ctx: Context): Boolean
26722672
def isParamDependent(implicit ctx: Context): Boolean
26732673

26742674
final def isTermLambda = isInstanceOf[TermLambda]
@@ -2683,7 +2683,7 @@ object Types {
26832683
}
26842684

26852685
final def instantiate(argTypes: => List[Type])(implicit ctx: Context): Type =
2686-
if (isDependent) resultType.substParams(this, argTypes)
2686+
if (isResultDependent) resultType.substParams(this, argTypes)
26872687
else resultType
26882688

26892689
def companion: LambdaTypeCompanion[ThisName, PInfo, This]
@@ -2845,7 +2845,7 @@ object Types {
28452845
/** Does result type contain references to parameters of this method type,
28462846
* which cannot be eliminated by de-aliasing?
28472847
*/
2848-
def isDependent(implicit ctx: Context): Boolean = dependencyStatus == TrueDeps
2848+
def isResultDependent(implicit ctx: Context): Boolean = dependencyStatus == TrueDeps
28492849

28502850
/** Does one of the parameter types contain references to earlier parameters
28512851
* of this method type which cannot be eliminated by de-aliasing?
@@ -2856,7 +2856,7 @@ object Types {
28562856

28572857
/** The least supertype of `resultType` that does not contain parameter dependencies */
28582858
def nonDependentResultApprox(implicit ctx: Context): Type =
2859-
if (isDependent) {
2859+
if (isResultDependent) {
28602860
val dropDependencies = new ApproximatingTypeMap {
28612861
def apply(tp: Type) = tp match {
28622862
case tp @ TermParamRef(thisLambdaType, _) =>
@@ -3007,7 +3007,7 @@ object Types {
30073007
type This <: TypeLambda
30083008
type ParamRefType = TypeParamRef
30093009

3010-
def isDependent(implicit ctx: Context): Boolean = true
3010+
def isResultDependent(implicit ctx: Context): Boolean = true
30113011
def isParamDependent(implicit ctx: Context): Boolean = true
30123012

30133013
def newParamRef(n: Int) = new TypeParamRef(this, n) {}

compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ object ProtoTypes {
435435
* replaced by either wildcards (if typevarsMissContext) or TypeParamRefs.
436436
*/
437437
def resultTypeApprox(mt: MethodType)(implicit ctx: Context): Type =
438-
if (mt.isDependent) {
438+
if (mt.isResultDependent) {
439439
def replacement(tp: Type) =
440440
if (ctx.mode.is(Mode.TypevarsMissContext)) WildcardType else newDepTypeVar(tp)
441441
mt.resultType.substParams(mt, mt.paramInfos.map(replacement))
@@ -464,7 +464,7 @@ object ProtoTypes {
464464
normalize(constrained(poly).resultType, pt)
465465
case mt: MethodType =>
466466
if (mt.isImplicitMethod) normalize(resultTypeApprox(mt), pt)
467-
else if (mt.isDependent) tp
467+
else if (mt.isResultDependent) tp
468468
else {
469469
val rt = normalize(mt.resultType, pt)
470470
pt match {

compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ trait TypeAssigner {
362362
val ownType = fn.tpe.widen match {
363363
case fntpe: MethodType =>
364364
if (sameLength(fntpe.paramInfos, args) || ctx.phase.prev.relaxedTyping)
365-
if (fntpe.isDependent) safeSubstParams(fntpe.resultType, fntpe.paramRefs, args.tpes)
365+
if (fntpe.isResultDependent) safeSubstParams(fntpe.resultType, fntpe.paramRefs, args.tpes)
366366
else fntpe.resultType
367367
else
368368
errorType(i"wrong number of arguments at ${ctx.phase.prev} for $fntpe: ${fn.tpe}, expected: ${fntpe.paramInfos.length}, found: ${args.length}", tree.pos)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ class Typer extends Namer
741741
case SAMType(meth) =>
742742
val mt @ MethodTpe(_, formals, restpe) = meth.info
743743
(formals,
744-
if (mt.isDependent)
744+
if (mt.isResultDependent)
745745
untpd.DependentTypeTree(syms => restpe.substParams(mt, syms.map(_.termRef)))
746746
else
747747
typeTree(restpe))

0 commit comments

Comments
 (0)