Skip to content

Commit 4193e4a

Browse files
authored
KTL-1636 fix: uuid samples fail in Core API references (#757)
1 parent d327640 commit 4193e4a

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

common/src/main/kotlin/component/KotlinEnvironment.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class KotlinEnvironment(
4747
"-opt-in=kotlin.ExperimentalUnsignedTypes",
4848
"-opt-in=kotlin.contracts.ExperimentalContracts",
4949
"-opt-in=kotlin.experimental.ExperimentalTypeInference",
50+
"-opt-in=kotlin.uuid.ExperimentalUuidApi",
5051
"-Xcontext-receivers",
5152
"-Xreport-all-warnings",
5253
"-Xuse-fir-extended-checkers",
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.compiler.server
2+
3+
import com.compiler.server.base.BaseExecutorTest
4+
import org.junit.jupiter.api.Test
5+
6+
class KotlinFeatureSince20 : BaseExecutorTest() {
7+
8+
@Test
9+
fun `Support UUIDs`() {
10+
run(
11+
// language=kotlin
12+
code = """
13+
import kotlin.uuid.*
14+
15+
fun main(args: Array<String>) {
16+
val uuid = Uuid.parse("550E8400-e29b-41d4-A716-446655440000")
17+
println(uuid)
18+
}
19+
""".trimIndent(),
20+
contains = "550e8400-e29b-41d4-a716-446655440000"
21+
)
22+
}
23+
}
24+

0 commit comments

Comments
 (0)