Open tribbloid opened 1 year ago
the following works smoothly tho:
trait F_* {
type TT
}
trait TGen {
type T_/\
type T_\/ <: T_/\
type Mat = F_* { type TT <: T_/\ }
}
object ProductGen extends TGen {
override type T_/\ = Product
override type T_\/ = Product
}
object LessThanProductGen extends TGen {
override type T_/\ = Product
override type T_\/ = Nothing
}
summon[ProductGen.Mat =:= LessThanProductGen.Mat]
The upside-down version:
trait F[-T]
summon[F[Product] <:< F[_ >: Product]]
summon[F[_ >: Product] <:< F[Product]] // oops
summon[F[Product] =:= F[_ >: Product]] // oops
[Error] ... : Cannot prove that F[? >: Product] <:< F[Product].
[Error] ... : Cannot prove that F[Product] =:= F[? >: Product].
This works tho:
trait F_* {
type TT
}
trait TGen {
type T_/\
type T_\/ <: T_/\
type F = F_* { type TT >: T_\/ }
}
object ProductGen extends TGen {
override type T_/\ = Product
override type T_\/ = Product
}
object MoreThanProductGen extends TGen {
override type T_/\ = Any
override type T_\/ = Product
}
summon[ProductGen.F =:= MoreThanProductGen.F]
I remove myself as assignee since I don't want to give the impression I will work on this anytime soon.
Compiler version
3.3.0
Minimized code
Output
Expectation
F[+T]
,YYY <:< XXX
⊢F[YYY] <:< F[XXX]
F[+T]
⊢ ∀YYY <:< XXX
,F[YYY] <:< F[XXX]
F[+T]
⊢F[_ <: XXX] <:< F[XXX]
(This is one of a few compiler issues that may be simplified by CoC vs λP2 conjecture)