I think Kotlin sees the former as, i.e. as 2 decla...
# announcements
j
I think Kotlin sees the former as, i.e. as 2 declarations: companion object without members and a property:
Copy code
companion object
val yo = "yo"
u
Which seems like a compiler bug to me. Wouldn't the language spec require a
;
inbetween?
j
I don't think so. There are only a very few places where semicolons are needed. There is no ambiguity from the perspective of the compiler. The companion object declaration is complete: no
{
following
companion object
, so a new declaration can be started immediatly
u
Typically a statement is ended by a SEMI token which is defined to be semicolon or new line: https://kotlinlang.org/docs/reference/grammar.html#SEMI As i am on my phone, i have not checked if this is true for object declarations