Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/deprecations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
macro mtkbuild(exprs...)
return quote
Base.depwarn("`@mtkbuild` is deprecated. Use `@mtkcompile` instead.", :mtkbuild)
@mtkcompile $(exprs...)
$(Expr(:macrocall, var"@mtkcompile",
LineNumberNode(@__LINE__, @__FILE__), exprs...))
end |> esc
end

Expand Down
9 changes: 9 additions & 0 deletions test/odesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1615,3 +1615,12 @@ end
@test_nowarn push!(arr, sys)
@test_nowarn TestWrapper(sys)
end

# ensure `@mtkbuild` works when `@mtkcompile` is not imported
module MtkbuildTestModule
import ModelingToolkit: @variables, System, t_nounits as t, D_nounits as D, @mtkbuild
import Test: @test
@variables x(t)
@mtkbuild sys = System(D(x) ~ t, t)
@test sys isa System
end
Loading