Skip to content

Commit 4f13a73

Browse files
authored
Fix 'this' confusion when inferring generic calls (#913)
1 parent f2a275c commit 4f13a73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5830,6 +5830,7 @@ export class Compiler extends DiagnosticEmitter {
58305830
}
58315831

58325832
let instance: Function | null = null;
5833+
let thisExpression = this.resolver.currentThisExpression;
58335834

58345835
// resolve generic call if type arguments have been provided
58355836
if (typeArguments) {
@@ -5917,7 +5918,7 @@ export class Compiler extends DiagnosticEmitter {
59175918
// compile 'this' expression if an instance method
59185919
let thisExpr: ExpressionRef = 0;
59195920
if (instance.is(CommonFlags.INSTANCE)) {
5920-
thisExpr = this.compileExpression(assert(this.resolver.currentThisExpression), this.options.usizeType);
5921+
thisExpr = this.compileExpression(assert(thisExpression), this.options.usizeType);
59215922
}
59225923

59235924
return this.compileCallDirect(

0 commit comments

Comments
 (0)