Skip to content

java interop: inherits unrelated defaults for $init$() from types #8599

Closed
@ohze

Description

@ohze

minimized code

trait A { val a = 0 }
trait B { val b = 0 }
class Scala extends B with A
class Java extends Scala { }

Compilation output

[info] Compiling 1 Scala source and 1 Java source to /Users/thanhbv/ohze/dotty-example/target/scala-0.23/classes ...
[error] /Users/thanhbv/ohze/dotty-example/src/main/java/Java.java:1:1: types B and A are incompatible;
[error]   class Java inherits unrelated defaults for $init$() from types B and A
[error] (Compile / compileIncremental) javac returned non-zero exit code

expectation

compile successfully as in scala 2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions