-
Notifications
You must be signed in to change notification settings - Fork 112
Description
I brought back the out RenderingT variance declaration because we use the covariance across RenderingT for workflows quite a bit (#1328). I thought we did not need to remove it for RenderingT.
However, while not immediately clear (in fact I don't think my IDE was even showing me the error at first), it still has UnsafeVariance when we create the inner class RenderContext<PropsT, StateT, OutputT> :(.
The reason is that we use the PropsT, StateT, and OutputT that are defined on the StatefulWorkflow or StatelessWorkflow instance that surrounds the inner class of RenderContext, so we are still passing in (consuming) the instance that defines RenderingT when we create RenderContext<PropsT, StateT, OutputT> which has no direct use of RenderingT itself. 😢 .
Why did this work? Well I believe this worked because by the time I brought back out RenderingT we had specified kotlinLanguageVersion = 1.9 to the compiler, which means UnsafeVariance is still allowed until we use the K2 compiler.
So this still needs to be fixed somehow.