Opened 5 years ago

Closed 5 years ago

#5710 closed defect (fixed)

Wrong error when duplicating a class (from the MSL)

Reported by: Christian Kral <dr.christian.kral@…> Owned by: Adeel Asghar
Priority: blocker Milestone: 1.16.0
Component: OMEdit Version: v1.16.0-dev
Keywords: Cc:

Description

I create a new package A in OMEdit. From the MSL I make a left click on Modelica.Mechanics.Rotational.Components.IdealGear and select Duplicate:

  • I leave the name IdealGear
  • I pick the path A

This causes an error and does NOT duplicate the model. The error message is:

Unable to create class IdealGear. Invalid name.

Please make sure you are not using any OpenModelica Keywords 
like (model, package, record, class etc.).

This issue is reproducible in:

Connected to OpenModelica 1.16.0~dev-48-gc5243a7
Connected to OMSimulator unknown-linux

Two additional formal notes here:

  1. In the error message: the keywords are Modelica keywords not OpenModelica keywords.
  1. On my understand a sentence is always a full sentence even if I do not read what is written inside the parentheses. In this case the sentence

Please make sure you are not using any OpenModelica Keywords like (model, package, record, class etc.).

reads:

Please make sure you are not using any OpenModelica Keywords like.

So I would just omit the parentheses:

Please make sure you are not using any Modelica Keywords like model, package, record, class etc.

Change History (2)

comment:1 by Francesco Casella, 5 years ago

Milestone: 1.14.01.16.0

See #5346.

I don't think we can fix this in 1.14.0, the plan with that version is to release whatever we have as long as there are no regressions. This is an old known issue.

We could try to prioritize this feature for 1.16.0, I'm not sure how difficult this is, maybe @adrpo and @adeas31 can comment on that.

comment:2 by Adeel Asghar, 5 years ago

Resolution: fixed
Status: newclosed

Seems like the main issue reported in this ticket is already fixed as part of #5668.

As for the error message I have updated it to Please make sure you are not using any OpenModelica/Modelica Keywords like model, package, record, class etc.

I would like to keep OpenModelica in the sentence since the API call can fail if some OpenModelica keywords are used.

Note: See TracTickets for help on using tickets.