PR# 15501 `index_set' fails for an empty array
Problem Report Summary
Submitter: nadya_kenguru
Category: EiffelBase
Priority: Low
Date: 2009/03/13
Class: Bug
Severity: Non-critical
Number: 15501
Release: rev 243
Confidential: No
Status: Open
Responsible:
Environment: OS Windows XP
Synopsis: `index_set' fails for an empty array
Description
Feature ARRAY.index_set has a postcondition (Result.lower = lower) and (Result.upper = upper). In an empty array lower = x and upper = x - 1, where x can be any integer. However, when calling `index_set' on an empty array, the resulting integer interval always has lower = 1 and upper = 0, which violates the postcondition.
To Reproduce
execute is -- Run application. local a: ARRAY [INTEGER] i: INTEGER_INTERVAL do create a.make (10, 9) i := a.index_set end
Problem Report Interactions