Opened 12 years ago

Closed 11 years ago

#2092 closed defect (fixed)

Got type mismatch error, but matching types Integer

Reported by: janssen Owned by: adrpo
Priority: high Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: Cc:

Description (last modified by 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 Changed 12 years ago by janssen

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 Changed 12 years ago by janssen

  • Component changed from Backend to Frontend
  • Description modified (diff)
  • Owner changed from probably noone to somebody

comment:3 Changed 12 years ago by sjoelund.se

  • Owner changed from somebody to adrpo
  • Status changed from new to assigned

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 Changed 11 years ago by sjoelund.se

  • Resolution set to fixed
  • Status changed from assigned to closed

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.