diff --git a/src/method.ts b/src/method.ts index 4b64d61..8f03cf0 100644 --- a/src/method.ts +++ b/src/method.ts @@ -69,7 +69,7 @@ export class Method { const currentOverwriteName = '__current_overwrite_for_' + name; const thunkName = '__overwrite_thunk_for_' + name; if (code) { - out += `static ${functionType} ${currentOverwriteName};\n`; + out += `static ${functionType} &${currentOverwriteName} = *new ${functionType};\n`; out += `static ${formatType(this.returnType)}${thunkName}${this.args} {\n`; out += `${INDENT}${this.returnType.trim() === 'void' ? '' : 'return '}${currentOverwriteName}(${getArgNames(this.args).join(', ')});\n`; out += `}\n`;