Skip to content

Commit

Permalink
Fix assertion when trying to assign to a method (AssemblyScript#1799)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO authored Apr 12, 2021
1 parent 42c2dbc commit 70c3bf9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 70c3bf9

Please sign in to comment.