From a70f6a1bc618fb73b0805cfcdad7a92b7dc9c8a4 Mon Sep 17 00:00:00 2001 From: Tom Richards Date: Thu, 9 Nov 2023 09:20:54 +0000 Subject: [PATCH] add @nowarn for exhaustiveness on a function I can't really comprehend --- riff-raff/app/utils/Retriable.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/riff-raff/app/utils/Retriable.scala b/riff-raff/app/utils/Retriable.scala index 3f32f0adb..af617f9e1 100644 --- a/riff-raff/app/utils/Retriable.scala +++ b/riff-raff/app/utils/Retriable.scala @@ -1,8 +1,9 @@ package utils import play.api.Logger -import scala.util.{Try, Success, Failure} -import scala.annotation.tailrec + +import scala.util.{Failure, Success, Try} +import scala.annotation.{nowarn, tailrec} trait Retriable { def log: Logger @@ -10,6 +11,7 @@ trait Retriable { def retryUpTo[T](maxAttempts: Int, message: Option[String] = None)( thunk: => T ): Try[T] = { + @nowarn // It would fail on the following inputs: Cons(), Empty @tailrec def go(s: Stream[Try[T]], n: Int): Try[T] = s match { case (f @ Failure(t)) #:: tail => val errorMessage = "Caught exception %s (attempt #%d)".format(