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

Updated kotlin version to 2.1.0-RC #780

Merged
merged 3 commits into from
Nov 5, 2024
Merged
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
3 changes: 1 addition & 2 deletions common/src/main/kotlin/component/KotlinEnvironment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class KotlinEnvironment(
"-opt-in=kotlin.io.encoding.ExperimentalEncodingApi",
"-Xcontext-receivers",
"-Xreport-all-warnings",
"-Xuse-fir-extended-checkers",
"-Wextra",
"-XXLanguage:+ExplicitBackingFields",
)
}
Expand Down Expand Up @@ -127,7 +127,6 @@ class KotlinEnvironment(
val messageCollector = MessageCollector.NONE
put(CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector)
put(CommonConfigurationKeys.MODULE_NAME, "web-module")
put(JSConfigurationKeys.TYPED_ARRAYS_ENABLED, true)
put(JSConfigurationKeys.PROPERTY_LAZY_INITIALIZATION, true)

languageVersionSettings = arguments.toLanguageVersionSettings(messageCollector)
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlin = "2.1.0-Beta1"
kotlin = "2.1.0-RC"
kotlinIdeVersion = "1.9.20-506"
kotlinIdeVersionWithSuffix = "231-1.9.20-506-IJ8109.175"
spring-boot = "2.7.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ fun <T> CLICompiler<*>.tryCompilation(inputDirectory: Path, inputFiles: List<Pat
STRONG_WARNING, WARNING -> ProjectSeveriry.WARNING
INFO, LOGGING, OUTPUT -> return ""
}

val textInterval = location?.let {
TextInterval(
start = TextInterval.TextPosition(minusOne(location.line), minusOne(location.column)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ class KotlinToJSTranslator(
val klibPath = (outputDir / "klib").toFile().canonicalPath
val additionalCompilerArgumentsForKLib = listOf(
"-Xreport-all-warnings",
"-Xuse-fir-extended-checkers",
"-Xir-only",
"-Wextra",
"-Xir-produce-klib-dir",
"-libraries=${kotlinEnvironment.JS_LIBRARIES.joinToString(PATH_SEPARATOR)}",
"-ir-output-dir=$klibPath",
Expand All @@ -107,8 +106,7 @@ class KotlinToJSTranslator(
.flatMap {
k2JSCompiler.tryCompilation(inputDir, ioFiles, listOf(
"-Xreport-all-warnings",
"-Xuse-fir-extended-checkers",
"-Xir-only",
"-Wextra",
"-Xir-produce-js",
"-Xir-dce",
"-Xinclude=$klibPath",
Expand Down Expand Up @@ -159,7 +157,7 @@ class KotlinToJSTranslator(
} ?: emptyList()
val additionalCompilerArgumentsForKLib: List<String> = listOf(
"-Xreport-all-warnings",
"-Xuse-fir-extended-checkers",
"-Wextra",
"-Xwasm",
"-Xir-produce-klib-dir",
"-libraries=${dependencies.joinToString(PATH_SEPARATOR)}",
Expand All @@ -171,7 +169,7 @@ class KotlinToJSTranslator(
.flatMap {
k2JSCompiler.tryCompilation(inputDir, ioFiles, mutableListOf(
"-Xreport-all-warnings",
"-Xuse-fir-extended-checkers",
"-Wextra",
"-Xwasm",
"-Xir-produce-js",
"-Xir-dce",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class KoansJUnitTestsRunnerTest : BaseJUnitTest() {
@Test
fun `koans test Default arguments`() {
runKoanTest(
"fun foo(name: String, number: Int = 42, toUpperCase: Boolean = false) =\n (if (toUpperCase) name.toUpperCase() else name) + number\n\nfun useFoo() = listOf(\n foo(\"a\"),\n foo(\"b\", number = 1),\n foo(\"c\", toUpperCase = true),\n foo(name = \"d\", number = 2, toUpperCase = true)\n)",
"fun foo(name: String, number: Int = 42, toUpperCase: Boolean = false) =\n (if (toUpperCase) name.uppercase() else name) + number\n\nfun useFoo() = listOf(\n foo(\"a\"),\n foo(\"b\", number = 1),\n foo(\"c\", toUpperCase = true),\n foo(name = \"d\", number = 2, toUpperCase = true)\n)",
"import org.junit.Test\nimport org.junit.Assert\n\nclass TestDefaultAndNamedParams() {\n\n @Test fun testDefaultAndNamedParams() {\n Assert.assertEquals(listOf(\"a42\", \"b1\", \"C42\", \"D2\"), useFoo())\n }\n}"
)
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":11,"ch":19},"end":{"line":11,"ch":25}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":12,"ch":26},"end":{"line":12,"ch":32}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>Issue uniqueDescr4 registered correctly.\nIssue uniqueDescr2 marked as duplicate and rejected.\n</outStream>"}
{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"<outStream>Issue uniqueDescr4 registered correctly.\nIssue uniqueDescr2 marked as duplicate and rejected.\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":4},"end":{"line":2,"ch":7}},"message":"The 'var' property is never written to, so it can be declared as 'val'.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":2,"ch":11},"end":{"line":2,"ch":17}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":4,"ch":8},"end":{"line":4,"ch":9}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":4,"ch":11},"end":{"line":4,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":5,"ch":8},"end":{"line":5,"ch":9}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>initial\n</outStream>"}
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":4},"end":{"line":2,"ch":7}},"message":"The 'var' property is never written to, so it can be declared as 'val'.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":4,"ch":8},"end":{"line":4,"ch":9}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":5,"ch":8},"end":{"line":5,"ch":9}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>initial\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":3,"ch":11},"end":{"line":3,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>6\n</outStream>"}
{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"<outStream>6\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":3,"ch":11},"end":{"line":3,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>5\n</outStream>"}
{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"<outStream>5\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":11},"end":{"line":2,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":6,"ch":11},"end":{"line":6,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":10,"ch":12},"end":{"line":10,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":11,"ch":12},"end":{"line":11,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\nfalse\n</outStream>"}
{"errors":{"File.kt":[{"interval":{"start":{"line":10,"ch":12},"end":{"line":10,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":11,"ch":12},"end":{"line":11,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\nfalse\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":11},"end":{"line":2,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\ntrue\n</outStream>"}
{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\ntrue\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":16},"end":{"line":2,"ch":23}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":3,"ch":17},"end":{"line":3,"ch":24}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":4,"ch":8},"end":{"line":4,"ch":16}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\nfalse\nfalse\n</outStream>"}
{"errors":{"File.kt":[{"interval":{"start":{"line":4,"ch":8},"end":{"line":4,"ch":16}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\nfalse\nfalse\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":15},"end":{"line":2,"ch":19}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>a\n\n\n＀\n</outStream>"}
{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"<outStream>a\n\n\n＀\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":16},"end":{"line":2,"ch":23}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":3,"ch":17},"end":{"line":3,"ch":24}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\nfalse\nfalse\nnull\n</outStream>"}
{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\nfalse\nfalse\nnull\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":15},"end":{"line":2,"ch":19}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>a\n\n\n＀\n</outStream>"}
{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"<outStream>a\n\n\n＀\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":20},"end":{"line":2,"ch":22}},"message":"Initializer is redundant.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":7,"ch":14},"end":{"line":7,"ch":15}},"message":"Assignment can be replaced with operator assignment.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>10\n</outStream>"}
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":20},"end":{"line":2,"ch":22}},"message":"Initializer is redundant.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>10\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":8,"ch":11},"end":{"line":8,"ch":17}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>3\nhello\n</outStream>"}
{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"<outStream>3\nhello\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":11},"end":{"line":2,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":6,"ch":11},"end":{"line":6,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":10,"ch":12},"end":{"line":10,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":11,"ch":12},"end":{"line":11,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\nfalse\n</outStream>"}
{"errors":{"File.kt":[{"interval":{"start":{"line":10,"ch":12},"end":{"line":10,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":11,"ch":12},"end":{"line":11,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\nfalse\n</outStream>"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":11},"end":{"line":2,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\ntrue\n</outStream>"}
{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"<outStream>true\ntrue\n</outStream>"}
Loading