Closed
Description
In my efforts to abuse the @connector
macro to allow multiple dispatch on systems that aren't actually connectors (see #1071), I noticed that you can't add documentation to things that were defined with the macro. Example:
julia> using ModelingToolkit
julia> """
Hey there
"""
@connector function Pin(;name)
sts = @variables v(t)=1.0 i(t)=1.0
ODESystem(Equation[], t, sts, []; name=name)
end
ERROR: cannot document the following expression:
#= REPL[5]:4 =# @connector function Pin(; name)
#= REPL[5]:4 =#
#= REPL[5]:5 =#
sts = #= REPL[5]:5 =# @variables(v(t) = begin
#= REPL[5]:5 =#
1.0
end, i(t) = begin
#= REPL[5]:5 =#
1.0
end)
#= REPL[5]:6 =#
ODESystem(Equation[], t, sts, []; name = name)
end
'@connector' not documentable. See 'Base.@__doc__' docs for details.
Stacktrace:
[1] error(::String, ::String)
@ Base .\error.jl:42
[2] top-level scope
@ REPL[5]:1
Metadata
Metadata
Assignees
Labels
No labels