Skip to content

Commit 2a31eb5

Browse files
committed
fix: Fix assert when calling a setter property
1 parent 70c3bf9 commit 2a31eb5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/compiler.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6335,7 +6335,16 @@ export class Compiler extends DiagnosticEmitter {
63356335
}
63366336
case ElementKind.PROPERTY: {
63376337
let propertyInstance = <Property>target;
6338-
let getterInstance = assert(propertyInstance.getterInstance);
6338+
let getterInstance = propertyInstance.getterInstance;
6339+
6340+
if (!getterInstance) {
6341+
this.error(
6342+
DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,
6343+
expression.range, this.currentType.toString()
6344+
);
6345+
return module.unreachable();
6346+
}
6347+
63396348
let thisArg: ExpressionRef = 0;
63406349
if (propertyInstance.is(CommonFlags.INSTANCE)) {
63416350
thisArg = this.compileExpression(

0 commit comments

Comments
 (0)