Skip to content

Using range to slice array created in let expression throws an integer expression error  #483

Closed

Description

@hbierlee

Hi!

I ran into the following bug on b07cdda:

array[int] of var bool: x = let {
  array[int] of var bool: y = [true,false]
} in y[min(index_set(y))..max(index_set(y))-1];
% } in y[1..2]; % same but somewhat different error message

% > minizinc --solver gecode bug.mzn
% || MiniZinc: evaluation error: 
% ||   /home/hbierlee/Projects/libminizinc/tests/spec/unit/sat/bugs/8_array_slice_throws_int_exp_error.mzn:2:
% ||   in variable declaration for 'x'
% ||   in let expression
% ||   /home/hbierlee/Projects/libminizinc/tests/spec/unit/sat/bugs/8_array_slice_throws_int_exp_error.mzn:4:
% ||   in array access
% ||   in binary '..' operator expression
% ||   not an integer expression ''..''
% || 

Cheers,

Henk

Activity

  1. added a commit that references this issue on May 14, 2021
    36e6670
  2. added
    resolvedIssue is resolved and the feature or fix will be part of next release
    on Oct 1, 2021
  3. added theissue type on Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolvedIssue is resolved and the feature or fix will be part of next release

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions