-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update Kotlin to 2.1.0 #4284
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
Update Kotlin to 2.1.0 #4284
Changes from 3 commits
6dbef90
cdc51d1
b4fe3bb
e26544b
fc74c80
6667d37
6d40654
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
kotlin_version=2.0.0 | ||
kotlin_version=2.1.0 | ||
coroutines_version=1.9.0-SNAPSHOT | ||
asm_version=9.3 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,6 +153,7 @@ public suspend fun <T> withContext( | |
// FAST PATH #1 -- new context is the same as the old one | ||
if (newContext === oldContext) { | ||
val coroutine = ScopeCoroutine(newContext, uCont) | ||
@Suppress("LEAKED_IN_PLACE_LAMBDA") // Contract is preserved, invoked immediately or throws | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one (an one on the contract definition) is annoying, I'll report it to the team |
||
return@sc coroutine.startUndispatchedOrReturn(coroutine, block) | ||
} | ||
// FAST PATH #2 -- the new dispatcher is the same as the old one (something else changed) | ||
|
@@ -161,11 +162,14 @@ public suspend fun <T> withContext( | |
val coroutine = UndispatchedCoroutine(newContext, uCont) | ||
// There are changes in the context, so this thread needs to be updated | ||
withCoroutineContext(coroutine.context, null) { | ||
@Suppress("LEAKED_IN_PLACE_LAMBDA") // Contract is preserved, invoked immediately or throws | ||
return@sc coroutine.startUndispatchedOrReturn(coroutine, block) | ||
} | ||
} | ||
// SLOW PATH -- use new dispatcher | ||
val coroutine = DispatchedCoroutine(newContext, uCont) | ||
// Contract is preserved, invoked immediately or throws | ||
@Suppress("LEAKED_IN_PLACE_LAMBDA") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer that the comment is to the right of |
||
block.startCoroutineCancellable(coroutine, coroutine) | ||
coroutine.getResult() | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
package kotlinx.coroutines.internal | ||
|
||
@Suppress("ACTUAL_WITHOUT_EXPECT") // Not the same name to WA the bug in the compiler | ||
internal actual typealias IgnoreJreRequirement = org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
package kotlinx.coroutines.internal | ||
|
||
@Suppress("ACTUAL_WITHOUT_EXPECT") | ||
internal actual typealias LocalAtomicInt = java.util.concurrent.atomic.AtomicInteger |
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.
Does this line do anything useful today other than accidentally disabling the "warnings are errors" flag?
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.
AFAIR release team uses it, but not sure. Will figure out separately
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.
The release team may override this property, this I get, but do we need to keep it in gradle.properties?
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.
At least for the sake of having "release team" branch and mainline having the same configuration and catching the same warnings/errors.