Skip to content

Commit

Permalink
fix: generate code for receivers outside of block lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Oct 31, 2024
1 parent 91b0ba2 commit 18a10ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,8 @@ export class SafeDsPythonGenerator {

private generateBlockLambda(blockLambda: SdsBlockLambda, frame: GenerationInfoFrame): Generated {
const results = streamBlockLambdaResults(blockLambda).toArray();
const lambdaBlock = this.generateBlock(blockLambda.body, frame, true);
const lambdaFrame = frame.newScope();
const lambdaBlock = this.generateBlock(blockLambda.body, lambdaFrame, true);
if (results.length !== 0) {
lambdaBlock.appendNewLine();
lambdaBlock.append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def __gen_lambda_1(p):
[]
)
safeds_runner.save_placeholder('_result', __gen_placeholder__result)
__gen_receiver_2 = safeds_runner.memoized_static_call(
"tests.generation.python.runnerIntegration.blockLambdas.C",
C,
[],
{},
[]
)
def __gen_lambda_4(a):
__gen_receiver_2 = safeds_runner.memoized_static_call(
"tests.generation.python.runnerIntegration.blockLambdas.C",
C,
[],
{},
[]
)
__gen_receiver_3 = a
__gen_block_lambda_result_result = safeds_runner.memoized_dynamic_call(
__gen_receiver_3,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 18a10ca

Please sign in to comment.