kotlin-inline-class Questions
3
In my business logic I have to deal with a lot of entity IDs, all of them of type String, which can cause confusion especially when you pass a couple of them as method parameters. So I thought abou...
Desai asked 3/1, 2020 at 15:50
2
Let's say I have:
inline class Email(value: String)
and
fun something(email: Email)
now if I want to call something() from Java I can't. Because any method that is accepting an inline class as ...
Dorcus asked 17/1, 2019 at 15:51
1
Solved
This is an exact code snippet of value classes taken from kotlin official website.
interface I
@JvmInline
value class Foo(val i: Int) : I
fun asInline(f: Foo) {}
fun <T> asGeneric(x: T) {}
...
Sse asked 7/2, 2021 at 6:12
1
© 2022 - 2025 — McMap. All rights reserved.