Opened 11 years ago

Last modified 3 years ago

#1939 reopened defect

Duplicate class detection not working when loading MSL

Reported by: perost Owned by: perost
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 follow-up: Changed 6 years ago by casella

  • Milestone changed from Future to 1.13.0
  • Resolution set to worksforme
  • Status changed from new to closed

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?

comment:2 in reply to: ↑ 1 Changed 6 years ago by perost

  • Resolution worksforme deleted
  • Status changed from closed to reopened

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 Changed 6 years ago by casella

Agreed.

comment:4 Changed 5 years ago by casella

  • Milestone changed from 1.13.0 to 1.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:5 Changed 4 years ago by casella

  • Milestone changed from 1.14.0 to 1.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 Changed 3 years ago by casella

  • Milestone changed from 1.16.0 to 1.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:7 Changed 3 years ago by casella

  • Milestone changed from 1.17.0 to 1.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:8 Changed 3 years ago by casella

  • Milestone 1.18.0 deleted

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.