Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

assignment-in-condition

Flag a bare = assignment used as the test of an if/elseif/while. It is valid Julia but almost always a typo for ==, so it is reported with a safe fix that rewrites = to ==.

= where == was meant:

if x = 5
    println(x)
end
example.jl:1:4: warning[assignment-in-condition] assignment used as a condition; did you mean `==`?