Skip to content
Snippets Groups Projects
Verified Commit e6f6a1f1 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Fix scope of `value` variable

parent ac829a3c
No related branches found
No related tags found
No related merge requests found
Pipeline #22780 failed
...@@ -127,17 +127,17 @@ for variable_func in keys(variables) ...@@ -127,17 +127,17 @@ for variable_func in keys(variables)
alt_var, forward, backward, _ = alternative_variables[Variables.$variable_func] alt_var, forward, backward, _ = alternative_variables[Variables.$variable_func]
try try
value = alt_var(bb) value = alt_var(bb)
if value isa Number
return backward(value)
elseif value isa AbstractArray{<:Number}
return backward.(value)
end
catch e catch e
if e isa VariableNotAvailable if e isa VariableNotAvailable
throw(VariableNotAvailable(typeof(bb), Variables.$variable_func)) throw(VariableNotAvailable(typeof(bb), Variables.$variable_func))
end end
rethrow() rethrow()
end end
if value isa Number
return backward(value)
elseif value isa AbstractArray{<:Number}
return backward.(value)
end
throw(VariableNotAvailable(typeof(bb), Variables.$variable_func, alt_var)) throw(VariableNotAvailable(typeof(bb), Variables.$variable_func, alt_var))
end end
throw(VariableNotAvailable(typeof(bb), Variables.$variable_func)) throw(VariableNotAvailable(typeof(bb), Variables.$variable_func))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment