Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

@extend no longer works with components #3167

Closed
cstjean opened this issue Oct 30, 2024 · 0 comments · Fixed by #3170
Closed

@extend no longer works with components #3167

cstjean opened this issue Oct 30, 2024 · 0 comments · Fixed by #3170
Assignees

Comments

@cstjean
Copy link
Contributor

cstjean commented Oct 30, 2024

Describe the example

The simple code below used to work on MTK 9.46.1, but now I get outlet not defined on MTK 9.49.0.

Minimal Reproducible Example 👇

using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using DifferentialEquations: solve, init, step!
using SymbolicIndexingInterface
using Symbolics, Test

@connector MyPin begin
    flow(t), [connect=Flow]
    p(t)
end

@mtkmodel ConnectedFlow begin
    @components begin
        outlet = MyPin()
    end
end

@mtkmodel MyTank begin
    @extend ConnectedFlow()
    @equations begin
        outlet.flow ~ 0
    end
end;

MyTank(name=:MyTank)

Error & Stacktrace ⚠️

UndefVarError: `outlet` not defined

Stack trace
Here is what happened, the most recent locations are first:

__MyTank__(; name::String)
from 
[Other cell: line 138](http://localhost:1234/edit?id=1a282b20-9668-11ef-3f47-b371376f490e#f22be213-2b14-45b8-9eec-0da478856994)
#_#438(; kw::@Kwargs{…}) [...show types...](http://localhost:1234/edit?id=1a282b20-9668-11ef-3f47-b371376f490e#)
from 
ModelingToolkit  model_parsing.jl:25

Not Working Environment (please complete the following information):

  • Output of using Pkg; Pkg.status()
ModelingToolkit 9.49.0
SymbolicIndexingInterface 0.3.34
Symbolics 6.16
  • Output of versioninfo()
Julia 1.10.5, Windows
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants