Skip to content

Type not found when reference static type in java parent class #10956

Closed
@changvvb

Description

@changvvb

Minimized code

java code

abstract class Foo {
    public static final class Inner { }
}

class Bar extends Foo {
    Inner i = new Inner();
}

Output

-- [E006] Not Found Error: Test.java:6:4 ---------------------------------------
6 |    Inner i = new Inner();
  |    ^^^^^
  |    Not found: type Inner

longer explanation available when compiling with `-explain`
1 error found

Expectation

I think this should be compiled because javac compiles the code successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions