Skip to content

Commit 7cdd5ff

Browse files
fix: fix @mtkbuild not working when @mtkcompile is not imported
1 parent b0907ec commit 7cdd5ff

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/deprecations.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
macro mtkbuild(exprs...)
66
return quote
77
Base.depwarn("`@mtkbuild` is deprecated. Use `@mtkcompile` instead.", :mtkbuild)
8-
@mtkcompile $(exprs...)
8+
$(Expr(:macrocall, var"@mtkcompile",
9+
LineNumberNode(@__LINE__, @__FILE__), exprs...))
910
end |> esc
1011
end
1112

test/odesystem.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,3 +1614,10 @@ end
16141614
@test_nowarn push!(arr, sys)
16151615
@test_nowarn TestWrapper(sys)
16161616
end
1617+
1618+
module MtkbuildTestModule
1619+
import ModelingToolkit: @variables, System, t_nounits as t, D_nounits as D, @mtkbuild
1620+
@variables x(t)
1621+
@mtkbuild sys = System(D(x) ~ t, t)
1622+
@test sys isa System
1623+
end

0 commit comments

Comments
 (0)