1318: Update to Kotlin 2.1.20 #1320
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Associated AGP, Gradle, and friends changes.
Specify
kotlin.languageVersion=1.9
while we still use it in 1.9 apps.(Also I added a
.yarnrc
file so we don't override the yarnpkg registry unintentionally)This stands on its own as a worthwhile thing to do, but I'm doing it now because it unlocks being able to use
vanniketch
's publishing plugin0.28.0
(PR), which is important for being able to seamlessly update Sonatype Central location (PR).Note that we had a lot of
@UnsafeVariance
notes and conflicting variance specifications - e.g.,in
specified generics used in theout
position and vice versa. The ability to do this was removed with Kotlin 2.0 -@UnsafeVariance
is just ignored. See, e.g., https://youtrack.jetbrains.com/issue/KTLC-72/K2-Stop-relying-on-the-presence-of-UnsafeVariance-using-for-contravariant-parametersI did some spelunking (149ab27, e50a0bb, #56 and friends) back to the beginning and I cannot find any specific explicit decision or justification for use of
in PropsT
andout OutputT
,out RenderingT
.As such, my conclusion is just that we started there naturally because that is logically how those generics are "used" (e.g., props are passed in, output passed out; this regardless of whether or not the code using them is only producer, or only consumer as per the Kotlin generics declaration-site variance rules - https://kotlinlang.org/docs/generics.html#declaration-site-variance).
Also, with the exception of sometimes using, e.g.,
Nothing
as a subtype of all types in order to type utilities that did not have to deal with theRenderingT
we don't actually make use of this variance much with Workflows., E.g., we are not relying onWorkflow<String, String, String>
being a subclass ofWorkflow<Object, Object, Object>
. This is at least because when workflows are passed as a parameter, we are expecting a particular type of a Workflow (including specific generic types). We do not have (AFAIK) much utility that operates on a set of Workflow's whose generic types share some common supertype.I can prove this better running this snapshot in our internal build.
@zach-klippenstein , @rjrjr do you have any other recollections/thoughts on this?
Closes #1318