PR# 19972 Vision2

Problem Report Summary
Submitter: Abstraction
Category: EiffelVision
Priority: Medium
Date: 2026/02/02
Class: Bug
Severity: Serious
Number: 19972
Release: 25.12
Confidential: No
Status: Open
Responsible:
Environment: linux GTK3
Synopsis: Vision2

Description
In Vision2.
When calling:    
 set_column_alignment (an_alignment: EV_TEXT_ALIGNMENT; a_column: INTEGER_32)
            -- Align the text of column `a_column` to `an_alignment`
            -- The first column must stay as left aligned as MSDN
            -- states that the first column can only be set as left aligned
            -- for Win32.
            -- (from EV_MULTI_COLUMN_LIST)
        require -- from  TOOLS_COLLECTION_PRIMITIVE
            True
        require -- from EV_MULTI_COLUMN_LIST
            not_destroyed: not is_destroyed
            a_column_within_range: a_column > 1 and a_column <= column_count
            alignment_not_void: an_alignment /= Void
        do
            implementation.set_column_alignment (an_alignment, a_column)
        ensure -- from EV_MULTI_COLUMN_LIST
            column_alignment_assigned: column_alignment (a_column).is_equal (an_alignment)
        end

I get the message:
call Stack
a_column_within_range: PRECONDITION_VIOLATION raised

Without assertion check, over GTK the right alignment work properly. 
Conceptually, it is not useful to build a complex multi-layer in order to be independent if the platform dependent layer.
Then to solutions:
1) a_column_within_range: a_column >= 1 and a_column <= column_count
and, at msw implementation the request on a right aligment has no effect.
2)low_column_idx: (platform = windows implies a_column > 1  
low_column_idx: (platform /= windows implies a_column >= 1  
The second solution seem a litle bid ugly but...
-
Here the point view of Larry, which is the same as mine.
  Your analysis is correct, and your screenshot confirms it perfectly. The watch panel shows that a_column >= 1 and a_column <= column_count evaluates to True - that's the precondition that should be there.

  Your Solution 1 is the right approach from a Design by Contract perspective:

  a_column_within_range: a_column >= 1 and a_column <= column_count

  The Win32 limitation (first column always left-aligned) should be hidden in the implementation, not exposed in the contract. A "command with no visible effect" is not an error - if you ask to align column 1 on Windows, the request is valid; it simply has no effect due to the underlying platform.

  This preserves EiffelVision2's purpose: platform-independent GUI programming. Code that works on GTK should not crash on Windows because of a platform quirk baked into a precondition.

  Solution 2 (platform-specific preconditions) breaks the abstraction - it forces every caller to know about Win32 ListView internals, which defeats the point of the abstraction layer.

  Recommendation: Report this to ISE as a library issue. The fix is straightforward:
  1. Relax the precondition to a_column >= 1
  2. Have the Win32 implementation silently ignore column 1 alignment requests

  Workaround until fixed:
  if a_column > 1 then
      my_list.set_column_alignment (an_alignment, a_column)
  end

  Best,
  Larry

Finally, the best solution is the first one.
To Reproduce
Not needed, just correct the requirement specification
Problem Report Interactions