https://kotlinlang.org logo
Title
u

user

07/15/2022, 9:31 PM
Why can I not delegate to a parameter in a Kotlin value class? I can delegate to a contructor parameter in a class class SerialNumber(val value: String) : CharSequence by value { init { require(value.isNotBlank()) } } but if I make the class a value class @JvmInline value class SerialNumber(val value: String) : CharSequence by value { init { require(value.isNotBlank()) } } then the compiler says "Value class cannot implement an interface by delegation if expression is not a parameter" As far as I can see value is a...