diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 944712b6cd73..7b34eea94ec7 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -1137,9 +1137,8 @@ class Definitions { * Extracts the list of function argument types, the result type and whether function is contextual. */ def unapply(tpe: AppliedType)(using Context): Option[(List[Type], Type, Boolean)] = { - val targs = tpe.args - if targs.isEmpty || !isFunctionNType(tpe) then None - else Some(targs.init, targs.last, tpe.typeSymbol.name.isContextFunction) + if !isFunctionNType(tpe) then None + else Some(tpe.args.init, tpe.args.last, tpe.typeSymbol.name.isContextFunction) } }