From cc1d13f94ad67717abecc692541c2149844bb5f5 Mon Sep 17 00:00:00 2001 From: dcode Date: Sun, 11 Apr 2021 23:05:35 +0200 Subject: [PATCH] Fix assertion when trying to assign to a method --- src/compiler.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler.ts b/src/compiler.ts index 6b20136dfc..ed85dc097c 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -5837,7 +5837,10 @@ export class Compiler extends DiagnosticEmitter { break; } default: { - assert(false); + this.error( + DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, + expression.range, target.internalName + ); return this.module.unreachable(); } }