@@ -20,7 +20,7 @@ object ContextFunctionResults:
20
20
*/
21
21
def annotateContextResults (mdef : DefDef )(using Context ): Unit =
22
22
def contextResultCount (rhs : Tree , tp : Type ): Int = tp match
23
- case defn.DependentFunctionRefinementOf (_, mt) if mt.isContextualMethod =>
23
+ case defn.DependentFunctionRefinementOf (mt) if mt.isContextualMethod =>
24
24
rhs match
25
25
case closureDef(meth) => 1 + contextResultCount(meth.rhs, mt.resType)
26
26
case _ => 0
@@ -62,7 +62,7 @@ object ContextFunctionResults:
62
62
*/
63
63
def contextResultsAreErased (sym : Symbol )(using Context ): Boolean =
64
64
def allErased (tp : Type ): Boolean = tp.dealias match
65
- case ft @ defn.DependentFunctionRefinementOf (_, mt) if mt.isContextualMethod =>
65
+ case ft @ defn.DependentFunctionRefinementOf (mt) if mt.isContextualMethod =>
66
66
! defn.erasedFunctionParams(ft).contains(false ) && allErased(mt.resType)
67
67
case ft @ defn.NonDependentContextFunctionOf (_, resTpe) =>
68
68
! defn.erasedFunctionParams(ft).contains(false ) && allErased(resTpe)
@@ -79,8 +79,8 @@ object ContextFunctionResults:
79
79
integrateContextResults(rt, crCount)
80
80
case tp : MethodOrPoly =>
81
81
tp.derivedLambdaType(resType = integrateContextResults(tp.resType, crCount))
82
- case defn.DependentFunctionRefinementOf (base, mt) if mt.isContextualMethod =>
83
- integrateContextResults(base , crCount)
82
+ case defn.DependentFunctionRefinementOf (mt) if mt.isContextualMethod =>
83
+ mt.derivedLambdaType(resType = integrateContextResults(mt.resultType , crCount - 1 ) )
84
84
case defn.NonDependentContextFunctionOf (argTypes, resType) =>
85
85
MethodType (argTypes, integrateContextResults(resType, crCount - 1 ))
86
86
@@ -128,7 +128,7 @@ object ContextFunctionResults:
128
128
case Select (qual, name) =>
129
129
if name == nme.apply then
130
130
qual.tpe match
131
- case defn.DependentFunctionRefinementOf (_, mt) if mt.isContextualMethod =>
131
+ case defn.DependentFunctionRefinementOf (mt) if mt.isContextualMethod =>
132
132
integrateSelect(qual, n + 1 )
133
133
case defn.NonDependentContextFunctionOf (_, _) =>
134
134
integrateSelect(qual, n + 1 )
0 commit comments