Opened 12 years ago

Last modified 3 years ago

#1939 reopened defect

Duplicate class detection not working when loading MSL

Reported by: Per Östlund Owned by: Per Östlund
Priority: normal Milestone:
Component: New Instantiation Version: trunk
Keywords: Cc:

Description

Loading a file such as

package Modelica end Modelica;

and loading the MSL at the same time works fine, but it should complain about duplicate classes.

Change History (8)

comment:1 by Francesco Casella, 6 years ago

Milestone: Future1.13.0
Resolution: worksforme
Status: newclosed

Tried to load Modelica.mo with OMEdit after loading the "real" Modelica library, I got an error window.

I tried to run this .mos script

loadModel(Modelica);getErrorString();
loadFile("Modelica.mo");getErrorString();
simulate(Modelica.Blocks.Examples.Filter);getErrorString();

and I got

Simulation Failed. 
Model: Modelica.Blocks.Examples.Filter does not exist!
Please load it first before simulation.

This is fine as long as the semantics of loadFile() is to discard whatever existing class with the same name is already loaded. Should we give a warning in this case?

in reply to:  1 comment:2 by Per Östlund, 6 years ago

Resolution: worksforme
Status: closedreopened

Replying to casella:

This is fine as long as the semantics of loadFile() is to discard whatever existing class with the same name is already loaded. Should we give a warning in this case?

If you load the file first the model would be found, and the user-defined package would be silently ignored. I think that's quite bad, so we should at least give a warning (possibly an error, duplicate elements is illegal in Modelica after all).

comment:3 by Francesco Casella, 6 years ago

Agreed.

comment:4 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:5 by Francesco Casella, 5 years ago

Milestone: 1.14.01.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:6 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:7 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:8 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.