File tree Expand file tree Collapse file tree 3 files changed +23
-17
lines changed Expand file tree Collapse file tree 3 files changed +23
-17
lines changed Original file line number Diff line number Diff line change 541
541
542
542
NamedTuple () = NamedTuple {(),Tuple{}} (())
543
543
544
- """
545
- NamedTuple{names}(args::Tuple)
546
-
547
- Construct a named tuple with the given `names` (a tuple of Symbols) from a tuple of values.
548
- """
549
544
NamedTuple {names} (args:: Tuple ) where {names} = NamedTuple {names,typeof(args)} (args)
550
545
551
546
using . Intrinsics: sle_int, add_int
Original file line number Diff line number Diff line change @@ -2128,6 +2128,29 @@ See the manual section on [Tuple Types](@ref).
2128
2128
"""
2129
2129
Tuple
2130
2130
2131
+ """
2132
+ NamedTuple{names}(args::Tuple)
2133
+
2134
+ Construct a named tuple with the given `names` (a tuple of Symbols) from a tuple of values.
2135
+ """
2136
+ NamedTuple {names} (args:: Tuple )
2137
+
2138
+ """
2139
+ NamedTuple{names,T}(args::Tuple)
2140
+
2141
+ Construct a named tuple with the given `names` (a tuple of Symbols) and field types `T`
2142
+ (a `Tuple` type) from a tuple of values.
2143
+ """
2144
+ NamedTuple {names,T} (args:: Tuple )
2145
+
2146
+ """
2147
+ NamedTuple{names}(nt::NamedTuple)
2148
+
2149
+ Construct a named tuple by selecting fields in `names` (a tuple of Symbols) from
2150
+ another named tuple.
2151
+ """
2152
+ NamedTuple {names} (nt:: NamedTuple )
2153
+
2131
2154
"""
2132
2155
typeassert(x, type)
2133
2156
Original file line number Diff line number Diff line change @@ -63,12 +63,6 @@ Core.NamedTuple
63
63
64
64
if nameof (@__MODULE__ ) === :Base
65
65
66
- """
67
- NamedTuple{names,T}(args::Tuple)
68
-
69
- Construct a named tuple with the given `names` (a tuple of Symbols) and field types `T`
70
- (a `Tuple` type) from a tuple of values.
71
- """
72
66
@eval function NamedTuple {names,T} (args:: Tuple ) where {names, T <: Tuple }
73
67
if length (args) != length (names)
74
68
throw (ArgumentError (" Wrong number of arguments to named tuple constructor." ))
@@ -78,12 +72,6 @@ Construct a named tuple with the given `names` (a tuple of Symbols) and field ty
78
72
$ (Expr (:splatnew , :(NamedTuple{names,T}), :(T (args))))
79
73
end
80
74
81
- """
82
- NamedTuple{names}(nt::NamedTuple)
83
-
84
- Construct a named tuple by selecting fields in `names` (a tuple of Symbols) from
85
- another named tuple.
86
- """
87
75
function NamedTuple {names} (nt:: NamedTuple ) where {names}
88
76
if @generated
89
77
types = Tuple{(fieldtype (nt, n) for n in names). .. }
You can’t perform that action at this time.
0 commit comments