Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: irrelevant order var load in the lambda #1704

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kclvm/evaluator/src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ impl<'ctx> Evaluator<'ctx> {
self.is_local_var(name),
) {
// Get variable from the global lazy scope.
(false, false, false) => {
(false, _, false) => {
let variable = self.get_variable(name);
match self.resolve_variable_level(name) {
// Closure variable or local variables
Expand Down
9 changes: 9 additions & 0 deletions test/grammar/schema/irrelevant_order/simple_11/main.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
v = f1()

f0 = lambda {
"value"
}

f1 = lambda {
{f0 = f0()}
}
2 changes: 2 additions & 0 deletions test/grammar/schema/irrelevant_order/simple_11/stdout.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
v:
f0: value
Loading