Skip to content

Commit

Permalink
edit conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
apkille committed Jul 22, 2024
1 parent 95dd6e6 commit 975c44b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/QSymbolicsBase/QSymbolicsBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Metadata() = Metadata(CacheType())
"""Decorate a struct definition in order to add a metadata dict which would be storing cached `express` results."""
macro withmetadata(strct)
ex = quote $strct end
if @capture(ex, (struct T_{params__} fields__ end) | (struct T_{p1__} <: A_{p2__} fields__ end) | (struct T_{p1__} <: A_{p2__} where {p3__} fields__ end))
if @capture(ex, (struct T_{params__} fields__ end) | (struct T_{params__} <: A_ fields__ end))
struct_name = namify(T)
args = (namify(i) for i in fields)
constructor = :($struct_name{S}($(args...)) where S = new{S}($((args..., :(Metadata()))...)))
Expand Down

0 comments on commit 975c44b

Please sign in to comment.