Groovy allows `$` in identifiers (e.g. `A$B` is a ...
# getting-started
n
Groovy allows
$
in identifiers (e.g.
A$B
is a valid identifier). Kotlin allows quoted identifiers like ``A$B`` . But https://kotlinlang.org/spec/syntax-and-grammar.html#identifiers states that letters are "<any unicode character of classes LL, LM, LO, LT, LU or NL>" and that identifiers are "(Letter |
'_'
) {Letter |
'_'
| UnicodeDigit} | `'`'` QuotedSymbol {QuotedSymbol} `'`'` ". Does that not mean that e.g. Ⅲ (aka \u2162) - which is part of unicode character class NL - should be a valid identifier? I just tried but the compiler does not like
val Ⅲ = "roman 3"
.
e
that's interesting, kotlin doesn't seem to allow it as a identifier part at all.
val _Ⅲ
doesn't work either
n
yes. Seems the language spec is wrong (or the implementation). Do you know the best place to bring that to attention?
e
https://github.com/Kotlin/kotlin-spec if it were the spec, but to me it feels like it's the implementation that should be brought into compliance, in which case, https://youtrack.jetbrains.com/issues/KT I think?