Skip to content

Commit 719fdd9

Browse files
nicolasstuckiWojciechMazur
authored andcommitted
Remove unnecessary guard
[Cherry-picked 1e7243a]
1 parent 8201ceb commit 719fdd9

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
@@ -1139,9 +1139,8 @@ class Definitions {
11391139
* Extracts the list of function argument types, the result type and whether function is contextual.
11401140
*/
11411141
def unapply(tpe: AppliedType)(using Context): Option[(List[Type], Type, Boolean)] = {
1142-
val targs = tpe.args
1143-
if targs.isEmpty || !isFunctionNType(tpe) then None
1144-
else Some(targs.init, targs.last, tpe.typeSymbol.name.isContextFunction)
1142+
if !isFunctionNType(tpe) then None
1143+
else Some(tpe.args.init, tpe.args.last, tpe.typeSymbol.name.isContextFunction)
11451144
}
11461145
}
11471146

0 commit comments

Comments
 (0)