Online Eiffel Documentation |
Documentation Home > Tools > EiffelStudio > EiffelStudio Reference > Compiler > Compiler History |
EiffelStudio |
Major changes between ISE Eiffel 5.4 and ISE Eiffel 5.5 |
class A [reference G] ... end class B [expanded G] ... endto say that the valid actual generic parameters for A are always reference types, and for B are always expanded types.
class A inherit APPLICATION_EXCEPTION undefine finalize, equals, to_string, get_hash_code end ANYby the much simpler inheritance clause:
class A inherit APPLICATION_EXCEPTION
e: EIFFEL_CLASS o: SYSTEM_OBJECT ... o := e o.feature_of_system_object
a: ANY o: SYSTEM_OBJECT ... check o /= Void and a = Void end a ?= o check o /= Void and a /= Void end
class A [G] feature bug is local l_any: LIST [ANY] l_g: LIST [G] do l_any := l_g l_g := l_any endThe workaround is to use the reference keyword to guarantee that the formal generic parameter will always be instantiated with a reference type. For example the code below is correct:
class A [reference G] feature bug is local l_any: LIST [ANY] l_g: LIST [G] do l_any := l_g l_g ?= l_any end
my_special: SPECIAL [INTEGER] create my_special.make (10)
class A [G, H] feature item: H end class C [G] end class ROOT_CLASS create make feature make is local l_a: A [STRING, expanded C [ANY]] do create l_a io.put_string (l_a.item.generating_type) end endwould print
expanded C [STRING]instead of
expanded C [ANY]
Copyright 1993-2006 Eiffel Software. All rights reserved. |