Fix cast exception (#1419) · TypeScriptToLua/TypeScriptToLua@a17d9b1 · GitHub
Skip to content

Commit a17d9b1

Browse files
authored
Fix cast exception (#1419)
1 parent f802fa5 commit a17d9b1

3 files changed

Lines changed: 36 additions & 4 deletions

File tree

‎src/transformation/visitors/binary-expression/compound.ts‎

Lines changed: 14 additions & 3 deletions

‎test/unit/assignments.spec.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,3 +506,13 @@ test.each([
506506
return [obj, objGot];
507507
`.expectToMatchJsResult();
508508
});
509+
510+
// https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1412
511+
test("invalid assignment to call expression (#1412)", () => {
512+
util.testFunction`
513+
function foo(): number {
514+
return 3;
515+
}
516+
foo() += 4;
517+
`.expectNoTranspileException();
518+
});

‎test/util.ts‎

Lines changed: 12 additions & 1 deletion

0 commit comments

Comments
 (0)