Skip to content

Commit fa1f79d

Browse files
committed
Optimization computing erased argument counts
1 parent 785fe5a commit fa1f79d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala

+2-5
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,11 @@ object ContextFunctionResults:
8585
else
8686
val defn.ContextFunctionType(params, resTpe, erasedParams) = tp: @unchecked
8787
val rest = contextParamCount(resTpe, crCount - 1)
88+
// TODO use mt.nonErasedParamCount
8889
if erasedParams.contains(true) then erasedParams.count(_ == false) + rest else params.length + rest // TODO use mt.nonErasedParamCount
8990

9091
def normalParamCount(tp: Type): Int = tp.widenExpr.stripPoly match
91-
case mt @ MethodType(pnames) =>
92-
val rest = normalParamCount(mt.resType)
93-
if mt.hasErasedParams then
94-
mt.nonErasedParamCount + rest
95-
else pnames.length + rest
92+
case mt @ MethodType(pnames) => mt.nonErasedParamCount + normalParamCount(mt.resType)
9693
case _ => contextParamCount(tp, contextResultCount(sym))
9794

9895
normalParamCount(sym.info)

0 commit comments

Comments
 (0)