You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Leaving a trailing comma after the last element of using is a mistake I've made a few times. The parser only catches this error later, resulting in a fairly poor error message. For example, it can gobble up the function keyword in the next part of the file:
julia>using A: b,
functionfoo()
end
ERROR: ParseError:
Error: extra tokens after end of expression
@ REPL[4]:3:9using A: b,
functionfoo()
--------^^^^^^---end
The text was updated successfully, but these errors were encountered:
This is made slightly trickier by the fact that function can be used as a valid identifier there:
julia> module A
b = 2
var"function" = 3
end
Main.A
julia> using .A: b,
function
julia> using .A: b,
function foo()
ERROR: syntax: extra token "foo" after end of expression
Stacktrace:
[1] top-level scope
@ none:1
Then again, this is a really good use case for post-hoc diagnostics instead of limited lookahead during parsing :)
Leaving a trailing comma after the last element of
using
is a mistake I've made a few times. The parser only catches this error later, resulting in a fairly poor error message. For example, it can gobble up thefunction
keyword in the next part of the file:The text was updated successfully, but these errors were encountered: