I assign to a variable in the condition of a while loop in this working code:
getdata() = rand() < 0.5 ? rand() : missing
function dowork()
while !ismissing((val = getdata();))
println(val^2)
end
end
When I format the file with JuliaFormatter.format_file(), the semicolon is removed. The code then errors with “ERROR: MethodError: no method matching ismissing(; val::Float64)”.
Should this syntax not be allowed or is this a bug in JuliaFormatter?
The versions are Julia 1.9.3, JuliaFormatter 1.0.36.