jsweet icon indicating copy to clipboard operation
jsweet copied to clipboard

Invalid code generated for anonymous classes

Open andreasmuelder opened this issue 3 years ago • 1 comments

Argument of type 'Example$0' is not assignable to parameter of type '() => void'. Type 'Example$0' provides no match for the signature '(): void'.ts(2345)

inEventQueue.add(new Runnable() {
	@Override
	public void run() {
	   // do stuff
	}
});

results in

    public raiseTimeEvent(eventID: number) {
        /* add */(this.inEventQueue.push(new Example.Example$0(this, eventID))>0);
        this.runCycle();
    }

andreasmuelder avatar Mar 17 '21 09:03 andreasmuelder

That's odd. Thanks for reporting @andreasmuelder Could you please include the related Example.Example$0 class definition?

Also, please try again with latest JSweet 3.1.0-SNAPSHOT (about to be released soon)

lgrignon avatar Apr 11 '21 09:04 lgrignon