Opened 4 years ago

Closed 4 years ago

#6289 closed defect (fixed)

newInst fails to resolve renaming import

Reported by: Martin Sjölund Owned by: Per Östlund
Priority: high Milestone: 1.17.0
Component: New Instantiation Version: v1.17.0-dev
Keywords: Cc:

Description

IdealizedContact.Examples.Example1 uses a PartialContactBlock that looks like the following and it fails unless I change SI.TranslationalDampingConstant to Modelica.SIunits.TranslationalDampingConstant

    partial model PartialContactBlock "Partial model for the contact blocks"
      import SI = Modelica.SIunits;
      outer parameter SI.TranslationalSpringConstant springCoefficient;
      outer parameter SI.TranslationalDampingConstant dampingCoefficient;

The library has many other issues, but at least this should be good to fix.

Change History (2)

comment:1 by Martin Sjölund, 4 years ago

I don't know if this has to do with the outer, but I guess it should work regardless

comment:2 by Per Östlund, 4 years ago

Resolution: fixed
Status: newclosed

Fixed in PR 7050.

The issue was that the model is missing inner declarations for some of the outer elements, and we used to instantiate generated inner components in the scope of the simulation model instead of in the scope they were declared in. This has been a known issue for a long time, but while trying to explain why this was very hard to fix I came up with a simple solution. So thanks rubber duck!

The library is all kinds of broken of course, but at least the model now fails with correct error messages.

Note: See TracTickets for help on using tickets.