PR# 19976 Current used before initialized - expanded
Problem Report Summary
Submitter: gobobe
Category: Compiler
Priority: Low
Date: 2026/04/24
Class: Bug
Severity: Non-critical
Number: 19976
Release: 25.12.9.8922
Confidential: No
Status: Open
Responsible:
Environment: win
Synopsis: Current used before initialized - expanded
Description
The following program is not valid. The compiler should report a VEVI error because `Current` is used before the attribute `b` of attached type is initialized in the creation procedure of class `AA`. In particular, the code `b = b` will call `is_equal` because class `BB` is expanded. Instead of that we get a call-on-void_target: ******************************** Thread exception ***************************** In thread Root thread 0x0 (thread id) ******************************************************************************* ------------------------------------------------------------------------------- Class / Object Routine Nature of exception Effect ------------------------------------------------------------------------------- ANY is_equal @N is_empty: <XXXXXXXXXXXXXXXX> (From BB) Feature call on void target. Fail ------------------------------------------------------------------------------- ANY is_equal @N <XXXXXXXXXXXXXXXX> (From BB) Routine failure. Fail ------------------------------------------------------------------------------- AA make @N <XXXXXXXXXXXXXXXX> Routine failure. Fail ------------------------------------------------------------------------------- AA root's creation <XXXXXXXXXXXXXXXX> Routine failure. Exit -------------------------------------------------------------------------------
To Reproduce
class AA
create
make
feature
make
local
a: BOOLEAN
b: BB
do
create b.make (Current)
a := b = b
c := ""
end
c: STRING
end
~~~~~~
expanded class BB
inherit
ANY
redefine
is_equal
end
create
default_create,
make
feature
make (a: AA)
do
aa := a
end
aa: detachable separate AA
is_equal (other: like Current): BOOLEAN
do
if attached {AA} aa as a then
Result := a.c.is_empty
end
end
end
Problem Report Interactions