There is this JShell bug: https://bugs.openjdk.java.net/browse/JDK-8129337
Which basically comes down to getting two errors from an undefined symbol in this case:
/tmp 1150>> cat > T.java
class T {
void f() { if (tttt) System.out.println("T"); }
}
/tmp 1151>> javac T.java
T.java:2: error: cannot find symbol
void f() { if (tttt) System.out.println("T"); }
^
symbol: variable tttt
location: class T
T.java:2: error: illegal start of type
void f() { if (tttt) System.out.println("T"); }
^
2 errors
Is this the desired compiler behavior, or a chained error that should be cut-off?
Thanks,
Robert
I think this is a javac bug - most likely the result of 'cannot resolve symbol' is an erroneous _class_ type, which means then javac complains because it's finding a type where an expression was required; obviously the logic that does the latter check is not skipping erroneous types appropriately.
Maurizio
- blocks
-
JDK-8129337 JShell: forward variables are not corralled in condition expressions
-
- Open
-