Skip to content

get_component_type errors on compiled systems #3983

@bradcarman

Description

@bradcarman

It seems that the gui_metadata field is being dropped after running mtkcompile.

MWE

using ModelingToolkit
using ModelingToolkitStandardLibrary

include(joinpath(pkgdir(ModelingToolkit),"test","common","rc_model.jl"))

@mtkcompile rc_model_compile = RCModel()
@test get_component_type(rc_model).name == :RCModel #OK
@test get_component_type(rc_model_compile).name == :RCModel #ERROR

julia> get_component_type(rc_model_compile)
ERROR: type Nothing has no field type
Stacktrace:
 [1] getproperty(x::Nothing, f::Symbol)
   @ Base .\Base.jl:49
 [2] get_component_type(x::System)
   @ ModelingToolkit c:\Work\Packages\ModelingToolkit.jl\src\systems\abstractsystem.jl:3
 [3] top-level scope
   @ c:\Work\Packages\ModelingToolkit.jl\mwe.jl:8

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions