Skip to content

Commit 70c3bf9

Browse files
authored
Fix assertion when trying to assign to a method (#1799)
1 parent 42c2dbc commit 70c3bf9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5837,7 +5837,10 @@ export class Compiler extends DiagnosticEmitter {
58375837
break;
58385838
}
58395839
default: {
5840-
assert(false);
5840+
this.error(
5841+
DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,
5842+
expression.range, target.internalName
5843+
);
58415844
return this.module.unreachable();
58425845
}
58435846
}

0 commit comments

Comments
 (0)