cincheo / jsweet

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

Return value of another class's inner interface not fully qualified #675

Open rendaw opened 3 years ago

rendaw commented 3 years ago

To get this to cause an error, I put the two classes in different packages. The full qualification appears to be missing if they're in one package too but it doesn't raise an error.

package jsweettest.moda;

import jsweettest.moda2.ThingB;

public class ThingA extends ThingB {
  @Override
  public X m() {
    return null;
  }
}
package jsweettest.moda2;

public abstract class ThingB {
    public interface X {
    }

    public abstract X m();
}

produces this output:

/* Generated from Java with JSweet 2.4.0-SNAPSHOT - http://www.jsweet.org */
namespace jsweettest.moda {
    export class ThingA extends jsweettest.moda2.ThingB {
        /**
         * 
         * @return {*}
         */
        public m() : ThingB.X {
            return null;
        }
    }
    ThingA["__class"] = "jsweettest.moda.ThingA";

}
lgrignon commented 3 years ago

Nice one, thanks :)