Opened 12 years ago

Closed 12 years ago

#2092 closed defect (fixed)

Got type mismatch error, but matching types Integer

Reported by: Bill Janssen Owned by: Adrian Pop
Priority: high Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: Cc:

Description (last modified by Bill Janssen)

% omc +showErrorMessages +d=pedantic /tmp/t2.mo ModelicaServices Modelica
{"Warning: Parameter nu has neither value nor start value, and is fixed during initialization (fixed=true)", "TRANSLATION", "Warning", "500"}
{"[/private/tmp/t2.mo:3:3-3:25:writable] Error: Got type mismatch error, but matching types Integer.
This is a ***COMPILER BUG***, please report it to https://trac.openmodelica.org/OpenModelica.", "TRANSLATION", "Error", "247"}
{"Error: Error occurred while flattening model t2", "TRANSLATION", "Error", "89"}
Error processing file: /tmp/t2.mo
Warning: Parameter nu has neither value nor start value, and is fixed during initialization (fixed=true)
[/private/tmp/t2.mo:3:3-3:25:writable] Error: Got type mismatch error, but matching types Integer.
This is a ***COMPILER BUG***, please report it to https://trac.openmodelica.org/OpenModelica.
Error: Error occurred while flattening model t2

# Error encountered! Exiting...
# Please check the error message and the flags.

Execution failed!
%

Change History (4)

comment:1 by Bill Janssen, 12 years ago

Whoops! An old version of the model. It should be

model t2
  parameter Integer nu;
  input Integer[nu] vals;
  Integer y;
equation
  y = max({abs(vals[i]) for i in 1:nu});
end t2;

comment:2 by Bill Janssen, 12 years ago

Component: BackendFrontend
Description: modified (diff)
Owner: changed from probably noone to somebody

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

Owner: changed from somebody to Adrian Pop
Status: newassigned

OK; the error-message should be "Could not evaluate structural parameter nu". But it's just a warning since the front-end ceval is not sure if it needs the value or not...

comment:4 by Martin Sjölund, 12 years ago

Resolution: fixed
Status: assignedclosed

I think Adrian fixed this...

[a.mo:3:3-3:25:writable] Error: Could not evaluate structural parameter (or constant): nu which gives dimensions of array: vals[nu]. Array dimensions must be known at compile time.
Note: See TracTickets for help on using tickets.