-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elseif
raises an error when used with both short-circuiting evaluation and anonymous function
#47410
Comments
|
Note this was a regression in v1.6 (vs. v1.5). From the error message, it looks like it accidentally pulled apart the call expression too much and lost the julia> if false
elseif false && (f() = true)()
end
ERROR: syntax: invalid syntax false && begin
(method (outerref f))
begin
(method (outerref f) (call (core svec) (call (core svec) (call (core Typeof) (outerref f))) (call (core svec)) (inert #0=(line 2 REPL[1]))) (lambda (#self#) (((#self# (core Any) 0)) () 0 ()) (block #0# (true))))
end
(unnecessary (outerref f))
end()
Stacktrace:
[1] top-level scope
@ REPL[1]:1 side-note: precedence of this operator printing is not great: ./julia --lisp
> (deparse '(call (-> (tuple) (block nothing))))
() -> begin
nothing
end() since this would actually be a call to implicit multiplication of |
is there a faster way to bisect this other than doing it wholesale? |
So could at least narrow it down to that range. |
you can do
|
Be careful, @rdeits said in Discourse that the code does not error in 1.6.2 for him. See https://discourse.julialang.org/t/weird-syntax-error/89591/8?u=pjssilva It does not work in 1.6.7 for me. So the regression may have happened between point releases. |
This was added between 1.6.2 and 1.6.3, which reduces it to
|
I mean it could have been "good" -- "bad" -- "good" -- "bad" we probably want the last bad? LOL, those two commites makes sense... |
See some MWE here https://discourse.julialang.org/t/weird-syntax-error/89591/6, seems to occur on all recent versions.
The text was updated successfully, but these errors were encountered: