@@ -143,8 +143,13 @@ This constructor does not store/modify `y` or `x`.
143143 x:: X ;
144144 tag:: Union{Symbol,Nothing} = :default ) where {F,X<: Real ,Y<: Real }
145145 # @inline ensures that, e.g., DerivativeConfig(...; tag = :small) will be well-inferred
146- T = @inline maketag (tag, f, X)
147- return @noinline DerivativeConfig (f,y,x,T)
146+ @static if VERSION ≥ v " 1.8"
147+ T = @inline maketag (tag, f, X)
148+ return @noinline DerivativeConfig (f,y,x,T)
149+ else
150+ T = maketag (tag, f, X)
151+ return DerivativeConfig (f,y,x,T)
152+ end
148153end
149154
150155function DerivativeConfig (f:: F ,
@@ -190,8 +195,13 @@ This constructor does not store/modify `x`.
190195 c:: Chunk{N} = Chunk (x);
191196 tag:: Union{Symbol,Nothing} = :default ) where {F,V,N}
192197 # @inline ensures that, e.g., GradientConfig(...; tag = :small) will be well-inferred
193- T = @inline maketag (tag, f, V)
194- return @noinline GradientConfig (f,x,c,T)
198+ @static if VERSION ≥ v " 1.8"
199+ T = @inline maketag (tag, f, V)
200+ return @noinline GradientConfig (f,x,c,T)
201+ else
202+ T = maketag (tag, f, V)
203+ return GradientConfig (f,x,c,T)
204+ end
195205end
196206
197207function GradientConfig (f:: F ,
@@ -239,8 +249,13 @@ This constructor does not store/modify `x`.
239249 c:: Chunk{N} = Chunk (x);
240250 tag:: Union{Symbol,Nothing} = :default ) where {F,V,N}
241251 # @inline ensures that, e.g., JacobianConfig(...; tag = :small) will be well-inferred
242- T = @inline maketag (tag, f, V)
243- return @noinline JacobianConfig (f,x,c,T)
252+ @static if VERSION ≥ v " 1.8"
253+ T = @inline maketag (tag, f, V)
254+ return @noinline JacobianConfig (f,x,c,T)
255+ else
256+ T = maketag (tag, f, V)
257+ return JacobianConfig (f,x,c,T)
258+ end
244259end
245260
246261function JacobianConfig (f:: F ,
@@ -277,8 +292,13 @@ This constructor does not store/modify `y` or `x`.
277292 c:: Chunk{N} = Chunk (x);
278293 tag:: Union{Symbol,Nothing} = :default ) where {F,Y,X,N}
279294 # @inline ensures that, e.g., JacobianConfig(...; tag = :small) will be well-inferred
280- T = @inline maketag (tag, f, X)
281- return @noinline JacobianConfig (f,y,x,c,T)
295+ @static if VERSION ≥ v " 1.8"
296+ T = @inline maketag (tag, f, X)
297+ return @noinline JacobianConfig (f,y,x,c,T)
298+ else
299+ T = maketag (tag, f, X)
300+ return JacobianConfig (f,y,x,c,T)
301+ end
282302end
283303
284304function JacobianConfig (f:: F ,
@@ -331,8 +351,13 @@ This constructor does not store/modify `x`.
331351 chunk:: Chunk = Chunk (x);
332352 tag:: Union{Symbol,Nothing} = :default ) where {F,V}
333353 # @inline ensures that, e.g., HessianConfig(...; tag = :small) will be well-inferred
334- T = @inline maketag (tag, f, V)
335- return @noinline HessianConfig (f, x, chunk, T)
354+ @static if VERSION ≥ v " 1.8"
355+ T = @inline maketag (tag, f, V)
356+ return @noinline HessianConfig (f, x, chunk, T)
357+ else
358+ T = maketag (tag, f, V)
359+ return HessianConfig (f, x, chunk, T)
360+ end
336361end
337362
338363function HessianConfig (f:: F ,
@@ -368,8 +393,13 @@ This constructor does not store/modify `x`.
368393 chunk:: Chunk = Chunk (x);
369394 tag:: Union{Symbol,Nothing} = :default ) where {F,V}
370395 # @inline ensures that, e.g., HessianConfig(...; tag = :small) will be well-inferred
371- T = @inline maketag (tag, f, V)
372- return @noinline HessianConfig (f, result, x, chunk, T)
396+ @static if VERSION ≥ v " 1.8"
397+ T = @inline maketag (tag, f, V)
398+ return @noinline HessianConfig (f, result, x, chunk, T)
399+ else
400+ T = maketag (tag, f, V)
401+ return HessianConfig (f, result, x, chunk, T)
402+ end
373403end
374404
375405function HessianConfig (f:: F ,
0 commit comments