Skip to content

dotc requires override to implement abstract java method #6152

Closed
@lrytz

Description

@lrytz

A.java

public abstract class A {
  public abstract Object f();

  public static abstract class B extends A {
    @Override
    public abstract String f();
  }
}

Test.scala

class C extends A.B {
  def f() = ""
}

gives

-- Error: Test.scala:2:6 -------------------------------------------------------
2 |  def f() = ""
  |      ^
  |      error overriding method f in class B of type (): Object;
  |        method f of type (): String needs `override' modifier
one error found

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions