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) { ... }
18 lines
452 B
Kotlin
Vendored
18 lines
452 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
|
|
inline class Foo(val x: Int) {
|
|
fun empty() {}
|
|
fun withParam(a: String) {}
|
|
fun withInlineClassParam(f: Foo) {}
|
|
|
|
fun test() {
|
|
empty()
|
|
withParam("hello")
|
|
withInlineClassParam(this)
|
|
}
|
|
}
|
|
|
|
// 1 INVOKESTATIC Foo\$Erased.empty \(I\)V
|
|
// 1 INVOKESTATIC Foo\$Erased.withParam \(ILjava/lang/String;\)V
|
|
// 1 INVOKESTATIC Foo\$Erased.withInlineClassParam\$1e4ch6lh \(II\)V
|
|
// 5 INVOKEVIRTUAL |