Skip to content

Commit

Permalink
#524 : fixing an issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey Rakov committed Jul 12, 2023
1 parent 646d552 commit 4c10d5c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
7 changes: 7 additions & 0 deletions elenasrc3/elc/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7715,7 +7715,14 @@ ObjectInfo Compiler :: compileAltOperation(BuildTreeWriter& writer, ExprScope& s
writer.newNode(BuildKey::Tape);
SyntaxNode altNode = current.nextNode().firstChild();

if (target.mode == TargetMode::Casting) {
// HOTFIX : for the cast, the argument is a target
target = compileExpression(writer, scope, current.findChild(SyntaxKey::Expression),
0, EAttr::Parameter, nullptr);
}

compileMessageOperationR(writer, scope, target, altNode.firstChild(), false);

writer.closeNode();

writer.closeNode();
Expand Down
14 changes: 6 additions & 8 deletions tests60/sandbox/sandbox.l
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import extensions;
import system'dynamic'expressions;

A;

B;

public program()
{
for (int i := 1, i <= 5, i += 1) {
if (i == 3) {
i += 1;

$continue;
};
A a := new A();

console.writeLine(i);
}
B b := cast B(a) \ back:nilValue;
}

0 comments on commit 4c10d5c

Please sign in to comment.