Scala

Scala

Made by DeepSource

Annotating a method with both inline and tailrec annotations results in a compile-time error in future Scala versions SC-W1088

Bug risk
Critical

Any method that is annotated with both inline and tailrec annotations throw a compile time error in Scala 3 despite compiling and running fine in Scala 2. In case you wish to upgrade to Scala 3 in near future, it is recommended that you take another look at this method and either rewrite it appropriately or drop one of the two said annotations.

Bad Practice

@tailrec
@inline
def m1(): Unit = {
  // ...
}

Recommended

@tailrec
def m1(): Unit = {
  // ...
}