Global Method Error
arnavs opened this issue · 4 comments
arnavs commented
Sometimes I get this error when using NamedTuple
s in a function.
ERROR: syntax: Global method definition around C:\Users\Arnav Sood\.julia\packages\Parameters\rOe8Q\src\Parameters.jl:596 needs to be placed at the top level, or use "eval".
The line in question is
(::typeof($NT))($(args...)) = $nt
This is on v10.2 and
julia> versioninfo()
Julia Version 1.0.2
Commit d789231e99 (2018-11-08 20:11 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
mauro3 commented
Can you post MWE? Otherwise this will be tricky to track down. Thanks!
mauro3 commented
Can you report whether this still occurs in Julia 1.1?
arnavs commented
Must have missed the earlier comment r.e. MWE.
Sure, will investigate in Julia 1.1
arnavs commented
@mauro3 Still see it.
julia> using Parameters
[ Info: Precompiling Parameters [d96e819e-fc66-5662-9728-84c9c7592b0a]
julia> function foo()
@with_kw (x = 1, y = 2)
end
ERROR: syntax: Global method definition around /Users/arnavsood/.julia/packages/Parameters/NholY/src/Parameters.jl:600 needs to be placed at the top level, or use "eval".
julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin14.5.0)
CPU: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)