val
keyword for case class' constructor parameter SC-R1038By default, case class' parameters are accessible from both outside and inside the class. Therefore, marking them with the val
keyword is no longer necessary and is redundant.
case class Person(val name: String)
val p = Person("mark")
p.name
// Output
// mark
case class Person(name: String)
val p = Person("mark")
// Output
// mark