Skip to content

Commit f604e5d

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

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/compiler.ts

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

0 commit comments

Comments
 (0)