The problem seems to be that too many things are i...
# announcements
l
The problem seems to be that too many things are inlined, but I need that many things inlined
r
but I need that many things inlined
Why?
l
I need the function to work both in suspend context and non-suspend context
(the high-order function)
And I don't want to create a suspended alternative
r
That sounds... wrong. I'm guessing you have a serious XY problem, but I could be wrong.
l
Ok, I'll try to explain the problem
r
You may do better in #C1CFAFJSK.
l
Given function
fun foo(boo: () -> Unit) { }
I want to call
foo { suspendBoo() }
and
foo { nonSuspendBoo() }
But if I let
boo
be
boo: suspend () -> Unit
, the second case won't work
Or will it.... Hmm
r
The second case works just fine. I just tried it. I'm guessing you have some other problem going on
A suspending function can run non-suspending code. It would be pretty useless if it couldn't.
l
My original problem is that I want to run on the current suspend scope if I'm inside one, but outside it if I'm not
r
You probably want to ask in #C1CFAFJSK then
l
ty 😄