Skip to content

Static interface methods excluded from type variable membership #4550

@fbricon

Description

@fbricon

Initially reported in redhat-developer/vscode-java#4058:

Following is some sample code to replicate the issue:

public class Tester<T extends Thing> {
    public void test() {
        System.out.println("Testing: " + T.getStuff());  // Error is here
    }

    public static void main(String[] args) {
        Tester<OtherThing> tester = new Tester<>();
        tester.test();
    }

}

interface Thing {
    static String getStuff() {
        return "Stuff";
    }
}

class OtherThing implements Thing {
}

With this, I get a build error: The method getStuff() is undefined for the type T Java(67108964)

I reproduced with the latest Eclipse 2025-12 M2 (Build id: 20251024-0159)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions