Skip to content

Commit

Permalink
bugfix: Don't call tail on an empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Jan 5, 2024
1 parent d71009e commit abcf921
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ object InterpolatorCompletions:
case _: Select => true
case _ => false
} =>
val allLiterals = parent match
case SeqLiteral(elems, _) =>
elems
case _ => Nil
expr.elems.zip(allLiterals.tail).collectFirst {
case (i: (Ident | Select), literal) if literal == lit =>
i
}
parent match
case SeqLiteral(elems, _) if elems.size > 0 =>
expr.elems.zip(elems.tail).collectFirst {
case (i: (Ident | Select), literal) if literal == lit =>
i
}
case _ => None

end interpolatorMemberArg

/**
Expand Down

0 comments on commit abcf921

Please sign in to comment.