From 0f7bbfb550e44920b3f0d6f4ce64a781d41ff13f Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 30 Nov 2018 18:12:37 +0100 Subject: [PATCH] News and compat annotation for #29316 (at-kwdef for parametric structs, and structs with supertypes). --- NEWS.md | 1 + base/util.jl | 4 ++++ 2 files changed, 5 insertions(+) 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