Skip to content

Commit 6a4b37d

Browse files
refactor: move LazyString proxy to compat.jl
1 parent 01421fd commit 6a4b37d

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/ExprTools.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ module ExprTools
22

33
export args_tuple_expr, combinedef, parameters, signature, splitdef
44

5+
include("compat.jl")
56
include("function.jl")
67
include("method.jl")
78
include("type_utils.jl")
89
include("def_tools.jl")
910

10-
end # module
11+
end # module

src/compat.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@static if !isdefined(Base, :LazyString)
2+
# `LazyString` was added in Julia 1.8. On older versions fall back to eagerly
3+
# building the string; correctness is preserved, only the laziness is lost.
4+
LazyString(parts...) = string(parts...)
5+
end
6+

src/function.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
@static if !isdefined(Base, :LazyString)
2-
# `LazyString` was added in Julia 1.8. On older versions fall back to eagerly
3-
# building the string; correctness is preserved, only the laziness is lost.
4-
LazyString(parts...) = string(parts...)
5-
end
6-
71
"""
82
splitdef(ex::Expr; throw::Bool=true) -> Union{Dict{Symbol,Any}, Nothing}
93

0 commit comments

Comments
 (0)