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

Kotlin & KSP 2.1.0 #2029

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.

[versions]
kotlin = "2.0.10"
kct = "0.5.1"
ksp = "2.0.0-1.0.22"
kotlin = "2.1.0"
kct = "0.7.0"
ksp = "2.1.0-1.0.29"
ktlint = "0.48.2"

[plugins]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,19 +577,35 @@ class TestProcessorTest(private val useKsp2: Boolean) {
assertThat(result.exitCode).isEqualTo(KotlinCompilation.ExitCode.OK)
val generatedFileText = File(compilation.kspSourcesDir, "kotlin/test/TestTransitiveAliases.kt")
.readText()
assertThat(generatedFileText).isEqualTo(
"""
package test
if (useKsp2) {
assertThat(generatedFileText).isEqualTo(
"""
package test

import kotlin.Int
import kotlin.Unit
import kotlin.Int
import kotlin.Unit

public class TestTransitiveAliases {
public fun <T : Alias41<Alias23, out Alias77<Alias73<Int>>>> bar(vararg arg1: T): Unit = TODO()
}
public class TestTransitiveAliases {
public fun <T : Alias41<Alias43<Alias23>, Alias47<out Alias77<Alias73<Int>>>>> bar(vararg arg1: T): Unit = TODO()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure why this started behaving differently with KSP. @ZacSweers any thoughts?

}

""".trimIndent(),
)
""".trimIndent(),
)
} else {
assertThat(generatedFileText).isEqualTo(
"""
package test

import kotlin.Int
import kotlin.Unit

public class TestTransitiveAliases {
public fun <T : Alias41<Alias23, out Alias77<Alias73<Int>>>> bar(vararg arg1: T): Unit = TODO()
}

""".trimIndent(),
)
}
}

@Test
Expand Down
Loading
Loading