cincheo / jsweet

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

char[] initialized with ts error "implicitly has an 'any[]' return type" #709

Closed lalalic closed 2 years ago

lalalic commented 2 years ago
char[] tar = new char[len];

will be transpiled as following, which has ts error "Function expression, which lacks return-type annotation, implicitly has an 'any[]' return type"

let tar: string[] = (s => { let a=[]; while(s-->0) a.push(null); return a; })(len);
new Object[len]

has the same problem

lgrignon commented 2 years ago

Please turn off TypeScript’s strict mode. JSweet doesn’t support it.

lalalic commented 2 years ago

thanks