Skip to content

Commit 1f661e2

Browse files
author
Pietro Vertechi
committed
Only add _getproperty for backward compatibility
1 parent 85059b1 commit 1f661e2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/utils.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ end
2525

2626
Base.@pure SkipConstructor(::Type) = false
2727

28-
# needed for Julia pre 1.2
29-
@inline _getproperty(v::Tuple, field) = getfield(v, field)
30-
@inline _getproperty(v, field) = getproperty(v, field)
28+
@static if VERSION < v"1.2.0"
29+
@inline _getproperty(v::Tuple, field) = getfield(v, field)
30+
@inline _getproperty(v, field) = getproperty(v, field)
31+
else
32+
const _getproperty = getproperty
33+
end
3134

3235
function _foreachfield(names, xs)
3336
exprs = Expr[]

0 commit comments

Comments
 (0)