-
Notifications
You must be signed in to change notification settings - Fork 104
1340: Changing RenderContext
from an inner class to a nested class with its own generics
#1341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4f14d12
to
cdf8890
Compare
4a09419
to
8ba5356
Compare
RenderContext
from an inner class to a nested class with its own genericsRenderContext
from an inner class to a nested class with its own generics
@@ -37,7 +37,7 @@ class HelloTerminalWorkflow : TerminalWorkflow, | |||
override fun render( | |||
renderProps: TerminalProps, | |||
renderState: State, | |||
context: RenderContext | |||
context: StatefulWorkflow.RenderContext<TerminalProps, State, ExitCode> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the StatefulWorkflow prefix in some spots but not others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just sloppiness in my regex replacing 🤷🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the StatefulWorkfow.RenderContext
usage FWIW. but in most cases I think its unambiguous, so no need to be too strict.
Will breaking it out allow us to follow up and undo any of the recent c*variance work? |
8ba5356
to
bd4480b
Compare
It's possible we might be able to get I could do a test bringing back The other thing this does do though is make |
Note also that I can cache |
Nope. I checked and we can't do
|
Yes, this means we have to provide type parameters every time we use it.
However, it also means we won't break the
out RenderingT
variance (which will not be allowed come the K2 compiler).This will fix #1340 as we will no longer be consuming
RenderingT
(via the Workflow instance to get thePropsT
andOutpuT
types) when we passRenderContext
intorender()
as its types - forPropsT
andOutpuT
will be provided explicitly.