We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
using Base: @kwdef @kwdef struct Foo a::Int b::Int=2 end @kwdef mutable struct Bar a::Int b::Int=2 end @kwdef mutable struct Baz const a::Int b::Int=2 end a = 1 Foo(; a) # => Foo(1, 2) Bar(; a) # => Bar(1, 2) Baz(; a) # => # ERROR: MethodError: no method matching Baz(; a=1) # Closest candidates are: # Baz(; b) at util.jl:493 got unsupported keyword argument "a" # Baz(::Int64, ::Int64) at Untitled-1:10 got unsupported keyword argument "a" # Baz(::Any, ::Any) at Untitled-1:10 got unsupported keyword argument "a" # Stacktrace: # [1] kwerr(kw::NamedTuple{(:a,), Tuple{Int64}}, args::Type) # @ Base ./error.jl:165 # [2] top-level scope # @ Untitled-1:16
julia> versioninfo() Julia Version 1.8.0-rc1 Commit 6368fdc656 (2022-05-27 18:33 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) CPU: 2 × Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-13.0.1 (ORCJIT, sandybridge) Threads: 1 on 2 virtual cores Environment: JULIA_EDITOR = code JULIA_NUM_THREADS =
The text was updated successfully, but these errors were encountered:
I guess it's related to #45020
Sorry, something went wrong.
@kwdef
Successfully merging a pull request may close this issue.
The text was updated successfully, but these errors were encountered: