class TEST create make feature {NONE} -- Creation make -- Run test. local a: A b: B c: C t: TEST x: COMPARABLE y: INTEGER_REF do x := "" -- Simple test. report (<>, {ARRAY [TEST]}, 2) -- Non-conforming types. report (<>, {ARRAY [detachable ANY]}, 3) report (<>, {ARRAY [detachable ANY]}, 4) -- Incompatible types with a common maximal element. report (<>, {ARRAY [detachable C]}, 5) report (<>, {ARRAY [detachable C]}, 6) report (<>, {ARRAY [detachable C]}, 7) -- Non-conforming integer constants. report (<>, {ARRAY [ANY]}, 8) report (<>, {ARRAY [ANY]}, 9) -- Attached and detachable types. report (<>, {ARRAY [detachable TEST]}, 10) report (<>, {ARRAY [detachable TEST]}, 11) report (<>, {ARRAY [detachable ANY]}, 12) -- Separate and non-separate types. report (<>, {ARRAY [separate C]}, 13) report (<>, {ARRAY [separate ANY]}, 14) -- Separate and detachable types. report (<>, {ARRAY [detachable separate C]}, 15) report (<>, {ARRAY [detachable separate C]}, 16) report (<>, {ARRAY [detachable separate ANY]}, 17) -- Expanded and attached reference types. report (<>, {ARRAY [INTEGER_REF]}, 18) report (<>, {ARRAY [COMPARABLE]}, 19) -- Expanded and detachable reference types. report (<>, {ARRAY [detachable INTEGER_REF]}, 20) report (<>, {ARRAY [detachable ANY]}, 21) -- Expanded and separate types. report (<>, {ARRAY [separate ANY]}, 22) report (<>, {ARRAY [separate COMPARABLE]}, 23) -- Expanded and detachable separate types. report (<>, {ARRAY [detachable separate ANY]}, 24) report (<>, {ARRAY [detachable separate COMPARABLE]}, 25) end feature {NONE} -- Output report (a: ANY; t: TYPE [detachable separate ANY]; n: NATURAL_8) -- Compare type of object `a` with type `t` and report if they match in test number `n`. local actual: TYPE [detachable separate ANY] expected: TYPE [detachable separate ANY] r: REFLECTOR do create r expected := t actual := r.type_of_type (r.attached_type (a.generating_type.type_id)) io.put_string ("Test #") io.put_natural_8 (n) if actual ~ expected then io.put_string (": OK") else io.put_string (": Failed - expected `") io.put_string (expected.name) io.put_string ("` [") io.put_integer (expected.type_id) io.put_string ("] but got `") io.put_string (actual.name) io.put_string ("`[") io.put_integer (actual.type_id) io.put_string ("].") end io.put_new_line end feature {NONE} -- Status report q, q1, q2: BOOLEAN -- A random boolean value. do end end