eclipse-jdt / eclipse-jdt/eclipse.jdt.core
Nested class cannot be constructed through outer class reference when in outer class
Open
compiler
rawtypes
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
When trying to compile this using ecj and javac only javac successfully compiles.
Replacing `new Outer.Inner();` with `this.new Inner();` fixes the compile error along with specifying the `.Inner>` as a generic in the `mapToObj` method call.
```java
public class Outer {
public void main(String[] args) {
Stream.Inner> stream = IntStream.range(0, 10).mapToObj((num) -> {
return new Outer.Inner();
});
}
public class Inner {
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.