object Spike {
trait Conj
trait Topology { type Conj_/\ <: Conj }
abstract class GraphBuilder[T <: Topology](val topology: T) {
type Conj_/\ = topology.Conj_/\
}
type Of[C <: Conj] = GraphBuilder[_] { type Conj_/\ <: C }
def sanity[C <: Conj]: Unit = { // sanity
val example: Of[C] = ???
implicitly[example.Conj_/\ <:< C]
val a: example.Conj_/\ = ???
val b: C = a
}
}
Problem
The following errors are invalid:
[Error] /home/peng/git-proto/scalaspike/common/src/test/scala/com/tribbloids/spike/scalaspike/Spike.scala:20:15: implicit error;
!I e: example.topology.Conj/\ <:< C
Cannot prove that example.Conj_/\ <:< C.
[Error] /home/peng/git-proto/scalaspike/common/src/test/scala/com/tribbloids/spike/scalaspike/Spike.scala:23:16: type mismatch;
found : a.type (with underlying type example.Conj/)
required: C
two errors found
Reproduction steps
Scala version: 2.13.12
Problem
The following errors are invalid:
[Error] /home/peng/git-proto/scalaspike/common/src/test/scala/com/tribbloids/spike/scalaspike/Spike.scala:20:15: implicit error; !I e: example.topology.Conj/\ <:< C Cannot prove that example.Conj_/\ <:< C.
[Error] /home/peng/git-proto/scalaspike/common/src/test/scala/com/tribbloids/spike/scalaspike/Spike.scala:23:16: type mismatch; found : a.type (with underlying type example.Conj/) required: C two errors found