Opened 16 years ago

Last modified 14 years ago

#1041 closed defect (fixed)

Unnecessary and unclear messages (from MathCore)

Reported by: krsta Owned by: krsta
Priority: critical Milestone:
Component: Version:
Keywords: Cc: krsta,

Description

The below model returns strange and very long error messages when using check model. Isn't it possible to help the user with fewer messages?

model foo "This is a sample model"
public 
  parameter Real yMin=2,yMax=10;
  parameter Real y0[:]=zeros(size(k, 1));
  parameter Boolean signal=time > 0.5,setSignal=true;

equation 
  assert(yMin <= yMax);
end foo;

Implementation Note: The reason for several error messages is that when type-checking the expression

zeros(size(k, 1))

, it first can not find the identifier k (1st message), which results in that it cannot determine the type of size (k,1) (2nd message) and thus can not determine type of zeros(size(k,1)) (3rd message). The solution should probably prevent the 2nd and 3rd message from being printed (in some clever way).

Change History (3)

comment:2 by Martin Sjölund, 14 years ago

It is possible to solve this by sending the number of errors before trying to elaborate a builtin function, and then comparing the number of errors before printing the error in the builtin function that fails.

comment:3 by Martin Sjölund, 14 years ago

Fixed in r7540 (if a specific error message was added, the generic one for builtin functions will no longer be added)

Note: See TracTickets for help on using tickets.