« Return to Thread: [scala] Conformance to bounds in higher-order type parameters

[scala] Conformance to bounds in higher-order type parameters

by nikov :: Rate this Message:

Reply to Author | View in Thread

Hi,

Given the following definitions,

///////////////////////////////////////////
trait A[B[X, Y <: X, Z <: Y]]

trait C[X, Y <: X, Z <: X]
trait D[X, Y, Z <: X]
trait E[X >: Y, Y, Z]
///////////////////////////////////////////

Scala 2.7.5 accepts the type application A[C], but rejects A[D] and
A[E]. But they all seem equally type-safe. What part of SLS describes
how these type-checks should proceed? Is the current behavior correct
or desirable?

Thanks,
Vladimir

 « Return to Thread: [scala] Conformance to bounds in higher-order type parameters