Skip to content

Commit

Permalink
Remove unnecessary guard
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Aug 31, 2023
1 parent bbd8d81 commit 1e7243a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/src/dotty/tools/dotc/core/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 1e7243a

Please sign in to comment.