Closed
Description
Normally, if you type an incomplete binary expression like 1 + 1 +
, then the parser automatically looks to the next line to complete the expression. However, this doesn't happen in macro calls (in both Julia 0.5 and 0.6):
julia> 1 + 1 +
1
3
julia> Base.Test.@test 1 + 1 +
ERROR: MethodError: no method matching @test(::Expr, ::Symbol)
Closest candidates are:
@test(::ANY) at test.jl:189
It seems to be related to the fact that +
is both a binary and a unary operator, since it works fine for *
, and hence I think it is a bug:
julia> Base.Test.@test 1 * 1 *
1 == 1
Test Passed
Expression: 1 * 1 * 1 == 1
Evaluated: 1 == 1
(I got bitten by this in #20249 when .+
became a unary+binary operator.)