How can I suppress `RestrictsSuspension` ? I have ...
# compiler
How can I suppress
? I have my own additional dsl on top of sequence building but I cannot call through to the underlying sequence builder from my DSL because of restricts suspension ­čś×
You could make all the methods have a SequenceScope extension receiver. I'd say doing that while also using contexts would probably be the easiest way.
I agree (havent tried) but I want to avoid that actually. My dsl also has restricts suspension and should be the only way (I need to intercept the items at that point)
If you have a gist or repository or something with some minimal reproducer I could mess around with it and see if I can get it working!
Copy code
protected sealed interface ProduceOptionsScope {
  suspend fun <T> yield(option: Option<T>): Option<T>
  fun <T> value(block: () -> T): Value<T> = ValueImpl(block)
  fun <T> noValue(): Value<Nothing> = ValueImpl { error("No value provided") }

protected sealed interface Value<T>
It was staring me in the face entire time:
(its in the printed error message)
Just be mindful that suppressing errors is not guaranteed to work in the future, even if it's working right now
Yeah thats fine for now.