Javier
09/20/2021, 10:14 AMCLOVIS
09/20/2021, 10:21 AMCLOVIS
09/20/2021, 10:21 AMCLOVIS
09/20/2021, 10:23 AMobject Hello {
val x = "Hello"
}
fun main() {
Hello.x // whatever
}
Robert Jaros
09/20/2021, 10:23 AMhello.x
inside main()
. It's strange for me as well.CLOVIS
09/20/2021, 10:25 AMhello
variable?Robert Jaros
09/20/2021, 10:26 AMAny
in the second case and <anonymous object : Any>
in the first (working) one.Robert Jaros
09/20/2021, 10:29 AMRobert Jaros
09/20/2021, 10:30 AMJavier
09/20/2021, 10:45 AMJavier
09/20/2021, 10:46 AMCLOVIS
09/20/2021, 10:46 AMAny
, and Any
doesn't have an x
attribute.CLOVIS
09/20/2021, 10:47 AMx
attribute)Javier
09/20/2021, 10:47 AMJavier
09/20/2021, 10:47 AMCLOVIS
09/20/2021, 10:47 AMJavier
09/20/2021, 10:48 AMJavier
09/20/2021, 10:48 AMJavier
09/20/2021, 10:48 AMCLOVIS
09/20/2021, 10:49 AMJavier
09/20/2021, 10:50 AMJavier
09/20/2021, 10:50 AMJavier
09/20/2021, 10:50 AMWhen an anonymous object is used as a type of a local orĀ privateĀ but notĀ inlineĀ declaration (function or property), all its members are accessible via this function or property
CLOVIS
09/20/2021, 10:50 AMJavier
09/20/2021, 11:32 AMTobias Berger
09/20/2021, 3:09 PM