[java] 'var' arrays highlighting (IDEA-193514)

This commit is contained in:
Roman Shevchenko
2018-06-08 17:28:55 +03:00
parent e522772ecc
commit eabcde2868
3 changed files with 47 additions and 32 deletions
@@ -38,24 +38,24 @@ class Main {
}
private void forEachType(String[] strs, Iterable<String> it, Iterable raw) {
for (var str : strs) {
for (var str: strs) {
String s = str;
}
for (var str : it) {
for (var str: it) {
String s = str;
str = s;
}
for (var o : raw) {
for (var o: raw) {
Object obj = o;
}
for (var v:<error descr="Expression expected"> </error>) {}
for (var v: <error descr="foreach not applicable to type 'null'">null</error>) {}
for (var v: <error descr="foreach not applicable to type 'null'">null</error>) {}
for (var v : (<error descr="Cannot resolve symbol 'v'">v</error>)) {}
for (var v: (<error descr="Cannot resolve symbol 'v'">v</error>)) {}
}
private void tryWithResources(AutoCloseable c) throws Exception {
@@ -2,6 +2,8 @@ import java.util.function.Function;
class C {
void m() {
Function<String, String> f = (var var) -> var;
Function<String, String> f1 = (var var) -> var;
Function<String[], String> f2 = (<error descr="'var' is not allowed as an element type of an array">var</error> arr[]) -> "";
Function<String[], String> f3 = (var arr) -> "";
}
}