@@ -42,8 +42,9 @@ function flatten_equations(eqs::Vector{Union{Equation, Vector{Equation}}})
4242end 
4343
4444function  _model_macro (mod, fullname:: Union{Expr, Symbol} , expr, isconnector)
45+     MTK =  ModelingToolkit
4546    if  fullname isa  Symbol
46-         name, type =  fullname, :System 
47+         name, type =  fullname, :( $ MTK . System) 
4748    else 
4849        if  fullname. head ==  :(:: )
4950            name, type =  fullname. args
@@ -74,9 +75,9 @@ function _model_macro(mod, fullname::Union{Expr, Symbol}, expr, isconnector)
7475    push! (exprs. args, :(parameters =  []))
7576    #  We build `System` by default; vectors can't be created for `System` as it is
7677    #  a function.
77-     push! (exprs. args, :(systems =  ModelingToolkit . AbstractSystem[]))
78-     push! (exprs. args, :(equations =  Union{Equation, Vector{Equation}}[]))
79-     push! (exprs. args, :(defaults =  Dict {Num, Union{Number, Symbol, Function}} ()))
78+     push! (exprs. args, :(systems =  $ MTK . AbstractSystem[]))
79+     push! (exprs. args, :(equations =  Union{$ MTK . Equation, Vector{$ MTK . Equation}}[]))
80+     push! (exprs. args, :(defaults =  Dict {$MTK. Num, Union{Number, Symbol, Function}} ()))
8081
8182    Base. remove_linenums! (expr)
8283    for  arg in  expr. args
0 commit comments