Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overloading functions causes collision when using record Type-inst #794

Open
CervEdin opened this issue Mar 11, 2024 · 1 comment
Open
Labels

Comments

@CervEdin
Copy link

CervEdin commented Mar 11, 2024

Take the following simple model.

% Works
test valid(record(int:x): x) = true;
test valid(record(int:y): x) = true;

% Doesn't work
type rx = record(int:x);
type ry = record(int:y);
test valid_tr(ry: x) = true;
test valid_tr(rx: x) = true;

Using type-inst it's not possible to overload a function for different record types.

Behavior seen in 2.7.6 and by the looks of it, also in latest/development.

Here's an example in the MiniZinc playground

@CervEdin
Copy link
Author

Fails with

Playground.mzn:9.1-27:

MiniZinc:
type error: function with the same type already defined in /minizinc/Playground.mzn:8.1-27

Process finished with non-zero exit code 1.

@cyderize cyderize added the bug label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants