diff --git a/NEWS.md b/NEWS.md index 9398517a6c06b..d02dbec27b047 100644 --- a/NEWS.md +++ b/NEWS.md @@ -68,6 +68,7 @@ Standard library changes * `mul!`, `rmul!` and `lmul!` methods for `UniformScaling` ([#29506]). * `Symmetric` and `Hermitian` matrices now preserve the wrapper when scaled with a number ([#29469]). * New `edit(m::Module)` method which opens the main source file for module `m` ([#29636]). + * `Base.@kwdef` can now be used for parametric structs, and for structs with supertypes ([#29316]). Compiler/Runtime improvements ----------------------------- diff --git a/base/util.jl b/base/util.jl index 886654959a6b6..479062c058161 100644 --- a/base/util.jl +++ b/base/util.jl @@ -651,6 +651,10 @@ Inner constructors can still be defined, but at least one should accept argument same form as the default inner constructor (i.e. one positional argument per field) in order to function correctly with the keyword outer constructor. +!!! compat "Julia 1.1" + `Base.@kwdef` for parametric structs, and structs with supertypes + requires at least Julia 1.1. + # Examples ```jldoctest julia> Base.@kwdef struct Foo