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
julia> versioninfo()
Julia Version 0.7.0-DEV.5036
Commit 9de318afa1* (2018-05-07 18:03 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, sandybridge)
Environment:
JULIA_BINDIR = C:\Users\Liam\AppData\Local\Julia-0.7.0-dev\bin
JULIA_HOME = C:\Users\Liam\AppData\Local\Julia-0.7.0-dev\bin
JULIA_NUM_THREADS = 4
julia> using Parameters
julia> @with_kw struct Test
a::Int = 10
b::Float64 = 1.0
"""
Test
"""
function Test(a,b)
new(10, 20)
end
end
ERROR: LoadError: type String has no field head
Stacktrace:
[1] getproperty(::Any, ::Symbol) at .\sysimg.jl:18
[2] next(::Parameters.Lines, ::Int64) at C:\Users\Liam\.julia\v0.7\Parameters\src\Parameters.jl:29
[3] done(::Parameters.Lines, ::Int64) at C:\Users\Liam\.julia\v0.7\Parameters\src\Parameters.jl:36
[4] with_kw(::Expr, ::Module, ::Bool) at C:\Users\Liam\.julia\v0.7\Parameters\src\Parameters.jl:257
[5] @with_kw(::LineNumberNode, ::Module, ::Any) at C:\Users\Liam\.julia\v0.7\Parameters\src\Parameters.jl:500
in expression starting at REPL[3]:1
Error shows that lns.block.args[i] is a String, and that's why Julia complains about field head. From my understanding, evaluation of if conditions stops when the condition matches, so when matches lns.block.args[i] isa String it is enough. However, it seems Julia also evaluate next line(!(lns.block.args[i].head==:line)) ).
The text was updated successfully, but these errors were encountered:
This works on Master since last week ;-) (Note though that your example also runs into JuliaLang/julia#27091)
So, I'll close. Feel free to re-open if you feel it's not resolved. I'm currently working on some other stuff, so unless it is urgent for you, I'll wait to tag a new version for a bit.
Parameters.jl/src/Parameters.jl
Lines 30 to 34 in 85dc58c
Error shows that
lns.block.args[i]
is a String, and that's why Julia complains about fieldhead
. From my understanding, evaluation ofif
conditions stops when the condition matches, so when matcheslns.block.args[i] isa String
it is enough. However, it seems Julia also evaluate next line(!(lns.block.args[i].head==:line))
).The text was updated successfully, but these errors were encountered: