Character.isIdentifierIgnorable [message #1826447] |
Fri, 24 April 2020 21:10  |
Eclipse User |
|
|
|
class Z {
class _\u0001 {}
class _\u0001\u0001 {}
}
Compiles without warnings or errors using 2020-03 and OpenJDK 8
using javac from command line 2 warnings 1 error
javac -version
javac 1.8.0_252
javac Z.java
Z.java:2: warning: '_' used as an identifier
class _\u0001{}
^
(use of '_' as an identifier might not be supported in releases after Java SE 8)
Z.java:3: warning: '_' used as an identifier
class _\u0001\u0001{}
^
(use of '_' as an identifier might not be supported in releases after Java SE 8)
Z.java:3: error: class Z._ is already defined in class Z
class _\u0001\u0001{}
^
1 error
2 warnings
|
|
|
|
|
|
|
|
|
|
|
Re: Character.isIdentifierIgnorable [message #1826500 is a reply to message #1826497] |
Sat, 25 April 2020 18:42  |
Eclipse User |
|
|
|
isIdentifierIgnorable() is specified and implemented as part of the Java system libraries.
Yes.
If that conflicts with practical issues in certain languages, than that specification (and its implementation) should be changed
Yes, no, maybe.
We, I, are/am not discussing which characters are specified in Character.isIdentifierIgnorable(int).
The issue is what an implementation does with these ignorable characters, whatever they may be.
Prior to JLS for SE 9 the relevent paragraph read:
Two identifiers are the same only if they are identical, that is, have the same
Unicode character for each letter or digit. Identifiers that have the same external
appearance may yet be different.
Since then reads:
Two identifiers are the same only if, after ignoring characters that are
ignorable, the identifiers have the same Unicode character for each letter
or digit. An ignorable character is a character for which the method
Character.isIdentifierIgnorable(int) returns true. Identifiers that have the
same external appearance may yet be different.
in one of the linked bugs someone argued why ecj might be at fault.
I tend to agree that openjdk impl is more in line with my reading.
Whether and how ecj is to be changed is discussed in bugzilla, not here.
Now your sounding like a dev. :-)
That would, however, go towards ignoring *more*, not less.
I don't understand this sentence.
Looking at your comment #13 in 547817 you seem to be agreeing with my assessment above:
"I tend to agree that openjdk impl is more in line with my reading."
[Updated on: Sat, 25 April 2020 18:56] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05129 seconds