Skip to content
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 to Kotlin 2.0-RC3 #4129

Merged
merged 2 commits into from
May 16, 2024
Merged

Update to Kotlin 2.0-RC3 #4129

merged 2 commits into from
May 16, 2024

Conversation

qwwdfsad
Copy link
Member

Apply all workarounds from k2 branch

Apply all workarounds from k2 branch
@lppedd
Copy link

lppedd commented May 14, 2024

If I'm stuck on the 1.9 line, will I be able to consume the new artifacts?

@@ -0,0 +1,19 @@
package kotlinx.coroutines.test.internal

/* This is a declaration of JS's `Promise<Unit>`. We need to keep it a separate class, because
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth linking to https://youtrack.jetbrains.com/issue/KT-60561 ?

I just hope it gets fixed soon tbh, this workaround means everyone is going to have their own promise types, a mess.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? Is everyone really creating their own Promise types? The TestResult class has a very specific and technical purpose: to let Kotlin know that it should handle the values returned from @Test fun on JS in a specific manner. Do many other codebases maintain their own test frameworks instead of using kotlinx-coroutines-test?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it's not really just for testing. I have some typealiases to Promise<T> in my KMP project and I can work with them in K1. In K2 I have to remove the typealias or have to create an intermediate class, just like JsPromiseInterfaceForTesting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typealias Future<T> = Promise<T> should still work. Is your use case covered by it?

Copy link

@lppedd lppedd May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works because you have the type parameter in Future, but something like typealias HostValue = Promise<Int> won't work. This plus KT-61043 makes working with typealiases a lot more cumbersome.

Copy link
Contributor

@dkhalanskyjb dkhalanskyjb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compilation fails. I think the reason is that the Kotlin version in integration-testing should also be updated.

@qwwdfsad qwwdfsad merged commit b34dc86 into develop May 16, 2024
1 check passed
@qwwdfsad qwwdfsad deleted the kotlin-2.0 branch May 16, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants