cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.45k stars 159 forks source link

Wrong default inherited method call #697

Open deadlocklogic opened 2 years ago

deadlocklogic commented 2 years ago

Tested with the live sandbox (version 3.0.0):

package org.jsweet;

import static def.dom.Globals.*;

/**
 * This is a very simple example that just shows an alert.
 */
public class HelloWorld {
    interface I1 {
        default void method() {
            alert("from I1");
        }
    }

    interface I2 extends I1 {
        default void method() {
            alert("from I2");
        }
    }

    static class C1 implements I1 {
    }

    static class C2 extends C1 implements I2 {
    }

    public static void main(String[] args) {
        new C2().method();
    }
}

Expected result: from I2 Actual result: from I1

Alerts from I1 which is wrong, should be from I2