Skip to content
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

Global Method Error #91

Closed
arnavs opened this issue Nov 30, 2018 · 4 comments
Closed

Global Method Error #91

arnavs opened this issue Nov 30, 2018 · 4 comments

Comments

@arnavs
Copy link
Contributor

arnavs commented Nov 30, 2018

Sometimes I get this error when using NamedTuples 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
Copy link
Owner

mauro3 commented Nov 30, 2018

Can you post MWE? Otherwise this will be tricky to track down. Thanks!

@mauro3
Copy link
Owner

mauro3 commented Jan 25, 2019

Can you report whether this still occurs in Julia 1.1?

@arnavs
Copy link
Contributor Author

arnavs commented Jan 25, 2019

Must have missed the earlier comment r.e. MWE.

Sure, will investigate in Julia 1.1

@arnavs
Copy link
Contributor Author

arnavs commented Jan 25, 2019

@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)

@mauro3 mauro3 closed this as completed in ed2a78f Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants