Opened 6 years ago

Last modified 6 years ago

#5364 closed enhancement

Obscure error message from NF — at Initial Version

Reported by: massimo ceraolo Owned by: somebody
Priority: normal Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Consider the following code:

model aaa
  parameter Real specificCons[:, :]( unit = "g/(kW.h)") = [0.0, 100; 10, 630];
equation
end aaa;

When checked with the OK I get the following very clear warning:

[1] 17:42:45 Translation Warning
[aaa: 2:38-2:55]: Non-array modification '"g/(kW.h)"' for array component, possibly due to missing 'each'.

When I check with the NF I get instead:

[2] 17:45:38 Translation Error
[aaa: 2:3-2:79]: Type mismatch in binding unit = "g/(kW.h)", expected subtype of String[2, 2], got type String.

which, IMO, is worse.

What makes the second message worse, for me, is:

  • the phrase "subtype of" (with basic types such as Rel. Integer, Boolean, String are involved can this be omitted?)
  • the absence of the hint regarding each.

Change History (0)

Note: See TracTickets for help on using tickets.