Skip to content

2.12 emits static forwarder for bridge method in mirror class #10812

@lrytz

Description

@lrytz
trait A { def f: Object = null }
object B extends A { override def f: String = "b" }

With 2.12.5, asm gives

  // access flags 0x9
  public static f()Ljava/lang/String;
    GETSTATIC B$.MODULE$ : LB$;
    INVOKEVIRTUAL B$.f ()Ljava/lang/String;

  // access flags 0x9
  public static f()Ljava/lang/Object;
    GETSTATIC B$.MODULE$ : LB$;
    INVOKEVIRTUAL B$.f ()Ljava/lang/Object;

In 2.11, we don't get the static forwarder for the bridge method. Luckily, javac picks one of the two (the more specific), but IntelliJ seems to complain.

https://discuss.lightbend.com/t/http-get-is-ambiguous-from-java/571/12

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions