effekt icon indicating copy to clipboard operation
effekt copied to clipboard

Binding of type parameters in existentials

Open phischu opened this issue 2 months ago • 0 comments

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.

phischu avatar Oct 02 '25 07:10 phischu