Skip to content

java.lang.ClassCastException when handling an effect alias of an interface #1318

@marvinborner

Description

@marvinborner

Effekt crashes with the following error if you incorrectly try to use an effect that's aliased to an interface:

Exception in thread "main" java.lang.ClassCastException: class effekt.symbols.EffectAlias cannot be cast to class effekt.symbols.BlockTypeConstructor$Interface (effekt.symbols.EffectAlias and effekt.symbols.BlockTypeConstructor$Interface are in unnamed module of loader 'app')

On the web, it crashes with TypeError: can't access property "a", a is undefined.

Reproduction:

interface Term {
  def num(n: Int): Unit
}

effect Readback = Term

def main() =
  try go()
  with Readback {
    def num(n) = resume(println(n))
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions