Skip to content

Fix unassign_variable warning#2298

Merged
dalance merged 1 commit intoveryl-lang:masterfrom
taichi-ishitani:fix_unassigned_variable
Mar 6, 2026
Merged

Fix unassign_variable warning#2298
dalance merged 1 commit intoveryl-lang:masterfrom
taichi-ishitani:fix_unassigned_variable

Conversation

@taichi-ishitani
Copy link
Contributor

fix #2297

The caller context should be used to extract the given local function but an empty context is used.
Due to this, a const used in the function can't be found and unassign_variable is reported becuase for loop in the function can't be evaluated.

To fix this issue, the given context should be used if the given function is a local function.

@taichi-ishitani taichi-ishitani requested a review from dalance March 6, 2026 02:36
pub func_paths: HashMap<FuncPath, VarId>,
pub variables: HashMap<VarId, Variable>,
pub functions: HashMap<VarId, Function>,
pub func_call_depth: u32,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func_call_depth is not used so I removed it.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 6, 2026

Merging this PR will not alter performance

✅ 3 untouched benchmarks


Comparing taichi-ishitani:fix_unassigned_variable (6b9adf9) with master (42386b9)

Open in CodSpeed

@taichi-ishitani taichi-ishitani force-pushed the fix_unassigned_variable branch from 23b0b28 to 6b9adf9 Compare March 6, 2026 06:51
@dalance dalance merged commit e53f22e into veryl-lang:master Mar 6, 2026
14 checks passed
@taichi-ishitani taichi-ishitani deleted the fix_unassigned_variable branch March 6, 2026 07:34
@dalance dalance added this to the v0.19.1 milestone Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unassign_variable is reported for variable assigned in for loop in function

2 participants