Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant final modifiers on objects #3183

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/data/Chain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ object Chain extends ChainInstances {

private val sentinel: Function1[Any, Any] = new scala.runtime.AbstractFunction1[Any, Any] { def apply(a: Any) = this }

final private[data] case object Empty extends Chain[Nothing] {
private[data] case object Empty extends Chain[Nothing] {
def isEmpty: Boolean = true
}
final private[data] case class Singleton[A](a: A) extends Chain[A] {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/datatypes/chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ In code it looks like this:
```tut:book
sealed abstract class Chain[+A]

final case object Empty extends Chain[Nothing]
case object Empty extends Chain[Nothing]
final case class Singleton[A](a: A) extends Chain[A]
final case class Append[A](left: Chain[A], right: Chain[A]) extends Chain[A]
final case class Wrap[A](seq: Seq[A]) extends Chain[A]
Expand Down
10 changes: 5 additions & 5 deletions docs/src/main/tut/datatypes/either.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ can go wrong in our program.
object EitherStyle {
sealed abstract class Error
final case class NotANumber(string: String) extends Error
final case object NoZeroReciprocal extends Error
case object NoZeroReciprocal extends Error

def parse(s: String): Either[Error, Int] =
if (s.matches("-?[0-9]+")) Either.right(s.toInt)
Expand Down Expand Up @@ -261,10 +261,10 @@ We may then be tempted to make our entire application share an error data type.

```tut:silent
sealed abstract class AppError
final case object DatabaseError1 extends AppError
final case object DatabaseError2 extends AppError
final case object ServiceError1 extends AppError
final case object ServiceError2 extends AppError
case object DatabaseError1 extends AppError
case object DatabaseError2 extends AppError
case object ServiceError1 extends AppError
case object ServiceError2 extends AppError

trait DatabaseValue

Expand Down
6 changes: 3 additions & 3 deletions kernel/src/main/scala/cats/kernel/Comparison.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ package cats.kernel
sealed abstract class Comparison(val toInt: Int, val toDouble: Double) extends Product with Serializable

object Comparison {
final case object GreaterThan extends Comparison(1, 1.0)
final case object EqualTo extends Comparison(0, 0.0)
final case object LessThan extends Comparison(-1, -1.0)
case object GreaterThan extends Comparison(1, 1.0)
case object EqualTo extends Comparison(0, 0.0)
case object LessThan extends Comparison(-1, -1.0)

// Used for fromDouble
private val SomeGt = Some(Comparison.GreaterThan)
Expand Down