We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15b5add commit 5fac768Copy full SHA for 5fac768
src/compat.jl
@@ -1,3 +1,23 @@
1
if VERSION < v"1.2"
2
Base.getproperty(x::Tuple, f::Int) = getfield(x, f)
3
end
4
+
5
+if VERSION < v"1.1"
6
+ # Note: these are actually *better* than the ones in julia 1.1, 1.2, 1.3,and 1.4
7
+ # See: https://github.com/JuliaLang/julia/issues/34292
8
+ function fieldtypes(::Type{T}) where T
9
+ if @generated
10
+ ntuple(i -> fieldtype(T, i), fieldcount(T))
11
+ else
12
13
+ end
14
15
16
+ function fieldnames(::Type{T}) where T
17
18
+ ntuple(i -> fieldname(T, i), fieldcount(T))
19
20
21
22
23
+end
0 commit comments