-
Notifications
You must be signed in to change notification settings - Fork 26
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
misc: upgrade to Kotlin 2.0.0 #1105
Conversation
This comment has been minimized.
This comment has been minimized.
…ld file" This reverts commit 9f35f07.
…mpilerApi` annotation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/** | ||
* The gzip compression algorithm. | ||
* Used to compress http requests. | ||
* | ||
* See: https://en.wikipedia.org/wiki/Gzip | ||
*/ | ||
public expect class Gzip() : CompressionAlgorithm | ||
public expect class Gzip() : CompressionAlgorithm { | ||
override val id: String // expect class members must be explicitly overridden in K2: |
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.
nit: I don't know if this comment is necessary
@@ -62,8 +62,7 @@ public fun Any?.type(): String = when (this) { | |||
is List<*>, is Array<*> -> "array" | |||
is Number -> "number" | |||
is Any -> "object" | |||
null -> "null" | |||
else -> throw Exception("Undetected type for: $this") | |||
else -> "null" |
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.
question: was this causing issues anywhere?
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.
yeah, it was a warning saying the "else" block was unreachable
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 was having trouble replicating the exact warning locally just now, so I reverted the change
|
||
@Test | ||
fun testEquals() { | ||
assertEquals(BigInteger("340282366920938463463374607431768211456"), BigInteger("340282366920938463463374607431768211456")) |
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.
style/nit: it would be nice to have a single format for these new tests you added for BigInteger
and BigDecimal
val value = "0.340282366920938463463374607431768211456"
assertEquals(BigDecimal(value), BigDecimal(value))
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties | ||
# FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532 | ||
# echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.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.
Question: Without this suppression which error(s) are seen? Just errors related to @Suppress("INAPPLICABLE_JVM_NAME")
?
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.
Yeah that's the only one. Since K2, they have started giving warnings for using this suppression, but the warning will be disabled again soon.
public companion object Key : CoroutineContext.Key<TelemetryContextElement> | ||
|
||
public val context: Context | ||
override val key: CoroutineContext.Key<*> | ||
override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E? | ||
override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R | ||
override fun plus(context: CoroutineContext): CoroutineContext | ||
override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext | ||
} |
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.
Question: The K2 migration guide shows overriding abstract members with the expect
keyword, which is not included here. Do you know what the difference is? Is expect
an optional keyword for abstract members of expect
classes or does it change the meaning/implementation somehow?
Affected ArtifactsChanged in size
|
Major changes:
expect class
members must be explicitly overridden: https://kotlinlang.slack.com/archives/C03PK0PE257/p1700127129049459?thread_ts=1700121556.811959&cid=C03PK0PE257BigDecimal
/BigInteger
. When we typealiased ourexpect
classes to the java.math.BigDecimal / BigInteger classes, the binary compatibility tool marked us as using those java.math.* classes, but really it should be theexpect
class. I don't expect this to really break anyone.Issue #
Description of changes
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.