Skip to content

Error Overriding: incompatible types #4771

Closed
@allanrenucci

Description

@allanrenucci
sealed abstract class <:<[-From, +To] {
  def substituteCo[F[+_]](ff: F[From]): F[To]
}

sealed abstract class =:=[From, To] extends (From <:< To) {
  override def substituteCo[F[_]](ff: F[From]): F[To] = ???
}
dotc -d out tests/allan/Test.scala
-- Error: tests/allan/Test.scala:32:15 -----------------------------------------
32 |  override def substituteCo[F[_]](ff: F[From]): F[To] = ???
   |               ^
   |error overriding method substituteCo in class <:< of type [F <: [+_$1] => Any](ff: F[From]): F[To];
   |  method substituteCo of type [F <: [_$2] => Any](ff: F[From]): F[To] has incompatible type
one error found

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions