Skip to content

Commit afb8c89

Browse files
@kwdef: export and add to public api (#46273)
1 parent ca629f3 commit afb8c89

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Library changes
8787
* `@time` now separates out % time spent recompiling invalidated methods ([#45015]).
8888
* `eachslice` now works over multiple dimensions; `eachslice`, `eachrow` and `eachcol` return
8989
a `Slices` object, which allows dispatching to provide more efficient methods ([#32310]).
90+
* `@kwdef` is now exported and added to the public API ([#46273])
9091

9192
Standard library changes
9293
------------------------

base/exports.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ export
772772
# syntax
773773
esc,
774774
gensym,
775+
@kwdef,
775776
macroexpand,
776777
@macroexpand1,
777778
@macroexpand,

base/util.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,12 @@ order to function correctly with the keyword outer constructor.
507507
`Base.@kwdef` for parametric structs, and structs with supertypes
508508
requires at least Julia 1.1.
509509
510+
!!! compat "Julia 1.9"
511+
This macro is exported as of Julia 1.9.
512+
510513
# Examples
511514
```jldoctest
512-
julia> Base.@kwdef struct Foo
515+
julia> @kwdef struct Foo
513516
a::Int = 1 # specified default
514517
b::String # required keyword
515518
end

doc/src/base/base.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ outer
8888
const
8989
struct
9090
mutable struct
91+
@kwdef
9192
abstract type
9293
primitive type
9394
where

0 commit comments

Comments
 (0)