core: fix anonymous class codegen