Skip to content

Commit 25d26b1

Browse files
committed
Simplify ContextFunctionOf
1 parent 65c9929 commit 25d26b1

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,15 +1135,8 @@ class Definitions {
11351135
*/
11361136
object ContextFunctionOf:
11371137
def unapply(tp: Type)(using Context): Option[(List[Type], Type)] =
1138-
asContextFunctionType(tp) match
1139-
case PolyFunctionOf(mt: MethodType) =>
1140-
Some((mt.paramInfos, mt.resType))
1141-
case DependentFunctionRefinementOf(_, mt) =>
1142-
None
1143-
case tp1 if tp1.exists =>
1144-
val args = tp1.functionArgInfos
1145-
val erasedParams = List.fill(functionArity(tp1)) { false }
1146-
Some((args.init, args.last))
1138+
tp match
1139+
case FunctionOf(argTypes, resultType, true) => Some((argTypes, resultType))
11471140
case _ => None
11481141

11491142
object PolyFunctionOf {

0 commit comments

Comments
 (0)