libminizinc icon indicating copy to clipboard operation
libminizinc copied to clipboard

Can MiniZinc infer function parameter types?

Open jarble opened this issue 2 years ago • 0 comments

I tried to define a function with inferred parameter types and return types:

function any: add(any:a, any:b) = a+b;

any: a1 = add(3,4);

But the compiler shows these error messages:

`MiniZinc: syntax error: parameter declaration cannot have `any' type-inst without type-inst variable`
`MiniZinc: syntax error: return type cannot have `any' type-inst without type-inst variable`

Is it not possible to infer parameter types or return types in functions?

jarble avatar Jun 29 '22 22:06 jarble