Skip to content

crash as local trait's reference to sibling local is mixed in to subclass with same reference #11777

Open
@hrhino

Description

@hrhino
[nix-shell:/code/scala/sandbox]$ cat Test.scala 
class Q {{
  object F { def apply(): Int = 1 }
  trait L { def x = F() }
  class X() extends L { def y = F() }

  println(new X())
}}

[nix-shell:/code/scala/sandbox]$ scala -d . Test.scala

[nix-shell:/code/scala/sandbox]$ javap -p Q\$X\$1.class 
Compiled from "Test.scala"
public class Q$X$1 implements Q$L$1 {
  private final Q $outer;
  private final scala.runtime.LazyRef F$module$1;
  private final scala.runtime.LazyRef F$module$1;
  public void Q$L$1$_setter_$F$module$1_$eq(scala.runtime.LazyRef);
  public scala.runtime.LazyRef F$module$1();
  public int x();
  public int y();
  public Q Q$L$$$outer();
  public Q$X$1(Q, scala.runtime.LazyRef);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)mixinruntime crash

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions