Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/QualifiedNew.java
Tagir Valeev 00fec48b9f IDEA-234810 IntelliJ doesn't report parsing error on Java code
GitOrigin-RevId: 1d177aaec708bc9d09b5874164af91bf55686d41
2020-03-11 16:33:13 +00:00

35 lines
803 B
Java

// Qualified new of static class
class A {
b b;
A() {
<error descr="Qualified new of static class">b.new c()</error>;
b.new inner();
new A.inner();
b.new <error descr="Qualified class reference is not allowed in qualified new">A</error>.inner();
new A.inner() {};
b.new <error descr="Qualified class reference is not allowed in qualified new">A</error>.inner() {};
}
class inner {}
void f() {
char[] c = <error descr="Invalid qualified new">b.new char[0]</error>;
}
}
class b extends A {
static class c {}
}
class WithAnonym {
interface I {}
class Inner{}
}
class WithAnonymInheritor extends WithAnonym {
{
<error descr="Anonymous class implements interface; cannot have qualifier for new">this.new I() {}</error>;
this.new Inner() {};
}
}