From 18fe176b06a8721e4fc1bfe42e22eef24f5fd9d0 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 30 Nov 2018 01:56:12 +0100 Subject: [PATCH] News and compat annotation for #29600 (fieldtypes). --- NEWS.md | 1 + base/reflection.jl | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 979cd6a798a4d..0b7e26ffae898 100644 --- a/NEWS.md +++ b/NEWS.md @@ -25,6 +25,7 @@ New library functions * `splitpath(p::String)` function, which is the opposite of `joinpath(parts...)`: it splits a filepath into its components ([#28156]). * `isnothing(::Any)` function, to check whether something is a `Nothing`, returns a `Bool` ([#29679]). * `getpid(::Process)` method ([#24064]). + * `fieldtypes(T::Type)` which return the declared types of the field in type T ([#29600]). Standard library changes ------------------------ diff --git a/base/reflection.jl b/base/reflection.jl index a62e1ecd54eab..b9c07eb40d561 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -628,6 +628,9 @@ end The declared types of all fields in a composite DataType `T` as a tuple. +!!! compat "Julia 1.1" + This function requires at least Julia 1.1. + # Examples ```jldoctest julia> struct Foo