Multi-constraint formal generics: access to renamed feature in clickable form
Posted May 28th, 2007 by alexk_es
in
Purpose:
Ensure a clickable/flat form of a feature with calls on entities of a formal generic type respects renaming specified in the constraint.
Test procedure:
- Create and compile a system with the following classes:class A [G -> {
B
rename
f as b_f,
g as h,
out as b_out
end,
C
rename
default_create as c_default_create,
f as c_f,
h as g,
out as c_out
end
} create default_create end
]
feature
f is
do
create item
io.put_string (item.b_out)
io.put_new_line
io.put_string (item.c_out)
io.put_new_line
io.put_string (item.b_f)
io.put_new_line
io.put_string (item.c_f)
io.put_new_line
io.put_string (item.g)
io.put_new_line
io.put_string (item.h)
io.put_new_line
end
item: G
end
class B
inherit
ANY
redefine
out
end
feature
f, g, out: STRING is
do
Result := "B"
end
end
class C
inherit
ANY
redefine
out
end
feature
f, h, out: STRING is
do
Result := "C"
end
end - Open "Flat view" of feature
{A}.f.
Expected result:
Flat/clickable view of the feature matches the basic text view, that has feature calls to "b_out", "c_out", "b_f", "c_f", "g", "h" in the specified order.
- Login to post comments
- Add new test run report