https://kotlinlang.org logo
#getting-started
Title
# getting-started
s

statmark56

09/01/2022, 2:48 PM
Was expecting:
Copy code
sealed class Element<T>(val value: T)

object Test : Element(10) // expecting compiler somehow able to refer the implicit integer 10 value to resolve T
But actually need to explicitly declare the argument type to satisfy the compiler:
Copy code
object Test : Element<Int>(10)
Any reason why? Thank you.
e

ephemient

09/01/2022, 4:33 PM