effekt-lang / effekt-lang/effekt

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

Open
#1,318 6 comments 0 reactions 1 assignee Claimed by @marvinborner View on GitHub
bug errormessage first-hackathon-issue
Dominant language
Scala
Stars
469
Forks
41
Avg merge
1d 16h
Merged PRs (30d)
23

Description

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](https://effekt-lang.org/playground.html?playground=TY5BCsIwEEX3c4q%2FTFeCuCr0AG5FDxCTiQbNVOIUEendTaLQ7obhvZkXRTkH6xhHzgkfAjwHyJSM9NiLdj1OEpVmIg6BneLA1p%2Btu2FoDlEVLqP5k9isCT%2B2W7tt9%2BOSjWI6DOWP5nfTyviKel2sGrHKKDQyP6fE5pFL713KrlrzFw%3D%3D&repl=bWFpbigp):

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

effect Readback = Term

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.