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

Indirectly extending raw types fails to typecheck. #11770

Open
martijnhoekstra opened this issue Oct 13, 2019 · 1 comment
Labels

Comments

@martijnhoekstra
Copy link

@martijnhoekstra martijnhoekstra commented Oct 13, 2019

Given java class

abstract class AFn implements java.lang.Callable {
  Object invoke() {
    return throw new Exception()
  }
  override Object call() {
    return invoke()
  }
}

then

new AFn {
  override def invoke(): Object = new Object()
}

fails to compile with

incompatible type in overriding def call(): V (defined in trait Callable)
with def call(): Object (defined in class AFn);
found   : ()Object
required: ()V

AFn extends the raw interface Callable, and this seems to be throwing a wrench in the works.

Clojure fans may have recognized Afn as the implementation of clojure functions.

@martijnhoekstra

This comment has been minimized.

Copy link
Author

@martijnhoekstra martijnhoekstra commented Oct 13, 2019

Works in 2.12.10, fails in 2.13.0 and 2.13.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.