Skip to content

Commit 1e7243a

Browse files
committed
Remove unnecessary guard
1 parent bbd8d81 commit 1e7243a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,9 +1137,8 @@ class Definitions {
11371137
* Extracts the list of function argument types, the result type and whether function is contextual.
11381138
*/
11391139
def unapply(tpe: AppliedType)(using Context): Option[(List[Type], Type, Boolean)] = {
1140-
val targs = tpe.args
1141-
if targs.isEmpty || !isFunctionNType(tpe) then None
1142-
else Some(targs.init, targs.last, tpe.typeSymbol.name.isContextFunction)
1140+
if !isFunctionNType(tpe) then None
1141+
else Some(tpe.args.init, tpe.args.last, tpe.typeSymbol.name.isContextFunction)
11431142
}
11441143
}
11451144

0 commit comments

Comments
 (0)