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

empty set as default value for optional set fails #809

Closed
CervEdin opened this issue Apr 22, 2024 · 2 comments
Closed

empty set as default value for optional set fails #809

CervEdin opened this issue Apr 22, 2024 · 2 comments
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@CervEdin
Copy link

CervEdin commented Apr 22, 2024

The following model:

enum foo = {A,B,C};
opt set of foo: bar;
set of foo: biz = bar default {};
output show(biz)

fails with

MiniZinc: type error: ambiguous overloading on return type of function
@cyderize
Copy link
Member

This is probably more to do with the opt set - these are currently not really supported (they happen to work sometimes by coincidence, but there seem to be many places where they don't).

We'll have a look at whether it's possible to make this work, or otherwise make the type checker give a proper error for opt sets.

@cyderize cyderize added the bug label Apr 22, 2024
@CervEdin
Copy link
Author

Aha. Yeah, I've been a bit curious about why it was possible to have an opt set but not an opt array[_].
I see int the spec that option types may be

Allowed Insts. The argument of an option type must be one of the base types bool, int or float.

Sounds like we're using something that's not officially supported, and working by accident.
Am I understand that correctly?

As a user, I would add that option types that include sets, arrays parameters etc. would be useful in the language as it allows for introducing parameters which are backwards compatible.

@cyderize cyderize added the resolved Issue is resolved and the feature or fix will be part of next release label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release
Projects
None yet
Development

No branches or pull requests

2 participants