Skip to content

Type mismatch: cannot convert from... #5053

@tiller

Description

@tiller

Hi,

Currently on 4.40M2 I have an issue with the following code:

    public static void main(String[] args) throws Exception {
        Stream.of(MyInterface.class.getName()).map(className -> {
            try {
                return Class.forName(className).asSubclass(MyInterface.class);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        });
    }

    interface MyInterface {
    }

It fails with:
Type mismatch: cannot convert from Class<capture#4-of ? extends Test2.MyInterface> to Class<Test2.MyInterface> Test2.java /test2/src/test line 13 Java Problem

Code compiles OK with javac

Not entirely sure whether it's a regression or not, because the code is new on our base code and I did not try it with previous eclipse versions

Metadata

Metadata

Labels

javacecj not compatible with javac

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions