effekt icon indicating copy to clipboard operation
effekt copied to clipboard

More warnings about unused effects

Open phischu opened this issue 1 year ago • 1 comments

We should consider warning users when an effect is not used. I can think of the following two situations where we might want additional warnings:

def foo(): Int / emit[Int] = 42

Here we annotated that we use an effect but don't.

def bar() = boundary { () }

Here we use a "handler function" boundary which handles a stop effect but don't actually use the handled effect stop.

phischu avatar Dec 10 '24 17:12 phischu

For the second case, is this always a problem / should this always be a warning?

At least in the case where there are multiple, e.g. nondet[A](){ body: => A / { flip, fail } }: A, we might actually don't want to use some (e.g. never fail). In those cases, I wouldn't want to be bothered with tons of warnings 🤔

Also, we did sometimes have things like map[A,B](...){ => B / break }: B where we might intentionally not break.

marzipankaiser avatar Mar 28 '25 18:03 marzipankaiser