From the JVM specification, section 4.2.2: >Nam...
# announcements
k
From the JVM specification, section 4.2.2:
Names of methods, fields, and local variables are stored as unqualified names. An unqualified name must not contain any of the ASCII characters . ; [ / (that is, period or semicolon or left square bracket or forward slash).
r
In Scala is ok to have such names.
k
Then I guess they secretly rename them before emitting the JVM bytecode.
r
I think Kotlin do the same with spaces in names
Why not to do the same with / ?
k
Why bother? Do you really need to have variables with a
/
in their name?
r
yeap, what name will you have for value
application/vnd.google-earth.kml+xml
with this feature, we can have same name as value
k
You want a variable named like that? Yikes.
I understand the "spaces for unit test names" use case, but this is taking it a bit too far.
For the record, I don't think Kotlin does rename spaces, as they're already allowed as you can see from the specification excerpt.
r
so, what name will you give to that value?
k
I don't know what that variable means, what type it has, the context, ...