« Return to Thread: [scala] Unsoundness in higher-order type parameters?

[scala] Unsoundness in higher-order type parameters?

by nikov :: Rate this Message:

Reply to Author | View in Thread

Hi,

Consider these definitions:

///////////////////////////////////////
trait A[B[_[X, Y <: X]]] {
  def f() : B[P]
}

trait C[_[X, Y]]

trait P[X, Y <: X]
///////////////////////////////////////

Type application C[P] is (correctly) rejected by the Scala 2.7.5
compiler. But A[C] is (incorrectly) accepted, which results in
incorrect type of member f(). It looks like unsoundness.

Thanks,
Vladimir

 « Return to Thread: [scala] Unsoundness in higher-order type parameters?