intellij-v
intellij-v copied to clipboard
variable re-definition error on if scope
Describe the bug
I get an error for the method redefinition but it shouldn't error because it is in the if scope which is different for each if scope
Expected Behavior
There should be no error in this
Current Behavior
There is an error
Reproduction Steps
Given already. This can be seen in https://github.com/vlang/v/pull/23967 for a clear idea
Possible Solution
No response
Additional Information/Context
No response
Environment details (v doctor output)
Not Required for this
IDE Type (IDEA Community/Ultimate, GoLand, CLion, etc.)
IDEA Ultimate
Plugin Version
Latest
It only happens on else branch of IfGruard expression, where a given var is none. Original a seem to be still in scope.
fn main() {
aaa := ?int(none)
bbb := ?int(1)
if a := aaa {
println("aaa: $a")
} else {
if a := bbb {
println("bbb: $a")
}
}
if a := bbb {
println("bbb: $a")
}
}