Skip to content

Commit

Permalink
mv comment
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi committed Sep 5, 2023
1 parent da9dfde commit d3231bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/register.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ macro register_symbolic(expr, define_promotion = true)
argnames = map(a -> a isa Symbol ? a : a.args[1], args)
args′ = map((a, T) -> :($a::$T), argnames, Ts)

# @register_symbolic f(x::T1, y::T2)
#
# `types`: for every argument find the types that
# could be taken as arguments. These are:
#
# 1) T 2) wrapper_type(T) 3) Symbolic{T}
#
# However later while emiting methods we omit the ones
# that are all 1) since those are expected to be defined
# outside Symbolics

ftype = if f isa Expr && f.head == :(::)
@assert length(f.args) == 2
Expand Down
8 changes: 8 additions & 0 deletions src/wrapper-types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ function wrap_func_expr(mod, expr)
names = vcat(argname.(args), kwargname.(kwargs))

function type_options(arg)
# for every argument find the types that
# should be allowed as argument. These are:
#
# (1) T (2) wrapper_type(T) (3) Symbolic{T}
#
# However later while emiting methods we omit the one
# method where all arguments are (1) since those are
# expected to be defined outside Symbolics
if arg isa Expr && arg.head == :(::)
T = Base.eval(mod, arg.args[2])
has_symwrapper(T) ? (T, :(SymbolicUtils.Symbolic{<:$T}), wrapper_type(T)) :
Expand Down

0 comments on commit d3231bc

Please sign in to comment.