What are the Reserved Keywords in Kotlin?
UPD: The keyword reference was added to the Kotlin docs: (here)
An auto-generated list of hard keywords for the current version can be found in Kotlin Github repo: (here)
There are more soft keywords, which behave like keywords in certain context, like it
, field
, object
, access & member modifiers.
More about context in which soft keywords are treated as keywords can be found in the grammar reference, along with the whole grammar, including hard keywords in their places.
There is a grammar reference https://kotlinlang.org/docs/reference/grammar.html
So anything in double quotes is a keyword (like "class"
) or an operator (like "%"
). However many keywords are "soft" (like "file"
), meaning that they depend on their syntactic position and still may be used as function names, etc.