cincheo / jsweet

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

Can't Extend from Parallel Directory Structure #749

Open bcwhite-code opened 1 year ago

bcwhite-code commented 1 year ago

Using the latest JSweet...

I have a class defined in java/com/foo/lib/Thing.java:

package com.foo.lib;
public class com.foo.lib.Thing {
  ... some methods ...
}

It transpiles just fine.

I have another class in java/com/foo/project/common/MyThing.java:

package com.foo.project.common;
public class MyThing extends com.foo.lib.Thing {
  ... methods making calls to methods from Thing ...
}

This works fine compiled with Java but It fails to transpile with JSweet, saying:

cannot find name 'Thing' at (every line that calls a method inside Thing)

If I move "Thing" to be in java/com/foo/project/common or even java/com/foo/project then it'll transpile just fine even if I don't change the path.to.Thing after "extends".

It seems like JSweet only looks up the directory structure for classes to extend and not the defined path.