You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java
qualifyingType = currentType.isGenericType() ? (ReferenceBinding)scope.environment().convertToRawType(currentType, false/*do not force conversion of enclosing types*/) : currentType;
185
+
qualifyingType = currentType.isGenericType() ?
186
+
(ReferenceBinding)scope.environment().convertToRawType(currentType, false/*do not force conversion of enclosing types*/) :
Copy file name to clipboardExpand all lines: org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_9.java
"The member type OuterStaticNestedDemo.Outer.StaticNested cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type OuterStaticNestedDemo<String>.Outer\n" +
// ecj ignores error "cannot select a static class from a parameterized type"
2065
+
publicvoidtestIssue4702_1() {
2066
+
if (this.complianceLevel < ClassFileConstants.JDK16)
2067
+
return;
2068
+
runNegativeTest(newString[] {
2069
+
"OuterStaticNestedDemo.java",
2070
+
"""
2071
+
public class OuterStaticNestedDemo<E> {
2072
+
class Outer {
2073
+
static class StaticNested {}
2074
+
}
2075
+
2076
+
void qualifiedNew(Outer outer) {
2077
+
new Outer.StaticNested();
2078
+
}
2079
+
}
2080
+
"""
2081
+
},
2082
+
"----------\n" +
2083
+
"1. ERROR in OuterStaticNestedDemo.java (at line 7)\n" +
2084
+
" new Outer.StaticNested();\n" +
2085
+
" ^^^^^^^^^^^^^^^^^^\n" +
2086
+
"The member type OuterStaticNestedDemo.Outer.StaticNested cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type OuterStaticNestedDemo<E>.Outer\n" +
// ecj ignores error "cannot select a static class from a parameterized type"
2091
+
publicvoidtestIssue4702_2() {
2092
+
if (this.complianceLevel < ClassFileConstants.JDK16)
2093
+
return;
2094
+
runNegativeTest(newString[] {
2095
+
"OuterStaticNestedDemo.java",
2096
+
"""
2097
+
class OuterStaticNestedBase<E> {
2098
+
class Outer {
2099
+
static class StaticNested {}
2100
+
}
2101
+
}
2102
+
class OuterStaticNestedDemo<E> extends OuterStaticNestedBase<E> {
2103
+
2104
+
2105
+
void qualifiedNew(Outer outer) {
2106
+
new Outer.StaticNested();
2107
+
}
2108
+
}
2109
+
"""
2110
+
},
2111
+
"----------\n" +
2112
+
"1. ERROR in OuterStaticNestedDemo.java (at line 10)\n" +
2113
+
" new Outer.StaticNested();\n" +
2114
+
" ^^^^^^^^^^^^^^^^^^\n" +
2115
+
"The member type OuterStaticNestedBase.Outer.StaticNested cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type OuterStaticNestedBase<E>.Outer\n" +
0 commit comments