cincheo / jsweet

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

JSweet 3: Untyped function calls may not accept type arguments #619

Closed lgrignon closed 3 years ago

lgrignon commented 3 years ago

Some return types are transpiled to any, which causes an error when a generic method is called on it.

Error noticed on java js runtime:

public interface Collection<E> {
    default Stream<E> stream() {
        return new StreamHelper<E>(this);
    }
}

transpiles to

 export interface Collection<E>  {
        stream() : any;
}

collection.stream().collect<any, any>(java.util.stream.Collectors.toList<any>()) // error: Untyped function calls may not accept type arguments