Skip to content

Commit ddb0d6a

Browse files
fallback similarterm for x as type
1 parent 32f90b3 commit ddb0d6a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/TermInterface.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ and `metadata` as the metadata. By default this will execute `head(args...)`.
7979
"""
8080
similarterm(x, head, args; type=nothing, metadata=nothing) = head(args...)
8181
similarterm(x::Type{Expr}, head, args; type=nothing, metadata=nothing) = Expr(head, args...)
82+
function similarterm(x::Type{T}, head::T, args; type=nothing, metadata=nothing) where T
83+
if !isterm(T) head else head(args...) end
84+
end
8285

8386
end # module
8487

0 commit comments

Comments
 (0)