mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Avoid name clashes in cases such as
inline class Login(val login: String)
inline class Password(val password: String)
fun validate(login: Login) { ... }
fun validate(password: Password) { ... }
13 lines
224 B
Kotlin
Vendored
13 lines
224 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
// IGNORE_BACKEND: JVM_IR
|
|
|
|
inline class S(val string: String)
|
|
|
|
fun foo(s: S): String {
|
|
val anon = object {
|
|
fun bar() = s.string
|
|
}
|
|
return anon.bar()
|
|
}
|
|
|
|
fun box() = foo(S("OK")) |