Skip to content

Compiler generates wrong dispatch code for qualified super reference expression #9614

@axls

Description

@axls

GWT version: 2.8.2
Browser (with version): n/a
Operating System: n/a


Steps to reproduce
class Y {
  int foo(){
    return 42;
  }
}

class X extends Y{
  int foo(){
    return 23;
  }

  int bar(){
    Supplier<Integer> s = X.super::foo; // reference to Y.foo
    return s.get();
  }
}

Next code snippet returns 23 instead of 42:

new X().bar();
Known workarounds

Replace method reference with lambda or anonymous class.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions