Skip to content

Non-nullary apply is permitted on dotty nullary method overriding java method #3012

Closed
@olafurpg

Description

@olafurpg

Copy-pasteable repro.

cat << EOF > Fuzbar.java
package fuz;
public interface Fuzbar {
  public String str();
}
EOF
cat << EOF > a.scala
object a extends fuz.Fuzbar {
  override def str = ""
  str()()()()()()
}
EOF
dotc a.scala Fuzbar.java
// compiles OK, expected error
$ dotc -version
0.4.0-bin-SNAPSHOT-nonbootstrapped-git-d70b8f4

I expected dotty to report an error like below

-- Error: a.scala:5:6 ----------------------------------------------------------
5 |  str()()()()
  |  ^^^^^
  |  missing argument for parameter index of method apply: (index: Int): Char

Related #2570

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions