Trailing commas lead to very confusing errors. Trailing commas were added in SIP-27 (Scala 2.12.2). I don't actually use them intentionally but it can take a very long time to find it since scalac passes but scalastyle fails without any line information and usually on an unrelated token.
For example:
[error] MySpec.scala: illegal start of simple expression: Token(RPAREN,),295,))
import org.scalatest.FlatSpec
import org.scalatest.prop.GeneratorDrivenPropertyChecks
class MySpec extends FlatSpec with GeneratorDrivenPropertyChecks {
case class Foo(a: String, b: Int)
Foo(
"hello",
123,
)
}
Trailing commas lead to very confusing errors. Trailing commas were added in SIP-27 (Scala 2.12.2). I don't actually use them intentionally but it can take a very long time to find it since scalac passes but scalastyle fails without any line information and usually on an unrelated token.
For example: