Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't override a Java method that uses raw types #2424

Open
bjansen opened this issue Nov 8, 2015 · 0 comments
Open

Can't override a Java method that uses raw types #2424

bjansen opened this issue Nov 8, 2015 · 0 comments
Labels
Milestone

Comments

@bjansen
Copy link
Member

bjansen commented Nov 8, 2015

Given the following scenario:

public class A<T> { }
import java.util.Collection;

public interface B {
    void method(Collection<A> a);
}
import java.util { Collection }
class C() satisfies B {
    shared actual void method(Collection<A<out Object>>? a) { }
}

I get the following error:

source/mymodule/run.ceylon:5: error: C is not abstract and does not override abstract method method(Collection<A>) in B
class C() satisfies B {
^
source/mymodule/run.ceylon:7: error: name clash: method(Collection<A<? extends Object>>) in C and method(Collection<A>) in B have the same erasure, yet neither overrides the other
    shared actual void method(Collection<A<out Object>>? a) {
           ^
2 errors

Ceylon forces me to override Collection<A> with Collection<A<out Object>>, and unfortunately I can't fix the Java interface to use Collection<A<Whatever>>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants