effekt
effekt copied to clipboard
Binding of type parameters in existentials
Currently the following program is accepted:
type Dynamic {
Wrap[A](x: A)
}
def f(d: Dynamic) = d match {
case Wrap(y) => ()
}
We want it to be rejected, because there is no explicit binding of the type parameter in the case arm.
Instead, we want the following program to be accepted, which is currently rejected by the parser:
type Dynamic {
Wrap[A](x: A)
}
def f(d: Dynamic) = d match {
case Wrap[B](y) => ()
}
Bottom line is that we require users to always bind types explicitly.