Opened 8 years ago
Last modified 7 years ago
#4843 new defect
NF doesn't evaluate size expression of function input parameters
| Reported by: | Per Östlund | Owned by: | Per Östlund | 
|---|---|---|---|
| Priority: | normal | Milestone: | 2.1.0 | 
| Component: | New Instantiation | Version: | v1.13.0-dev-nightly | 
| Keywords: | Cc: | 
Description
The new frontend only types function parameters when typing the function itself, without taking input arguments into account. When typing a function call it should reevaluate the types of the parameters based in the input arguments, so that it catches error like this (where the function should only take a square matrix):
function f input Real x[:, size(x, 1)]; end f; model M algorithm f({{1, 2, 3}, {3, 4, 5}}); end M;
  Note:
 See   TracTickets
 for help on using tickets.
    

Retargeting to 2.1.0, for 2.0.0 I would focus on getting to work stuff that doesn't