From fef1f1d3028271ccecfe27262a6762682d293463 Mon Sep 17 00:00:00 2001 From: halw Date: Fri, 6 Apr 2012 21:34:51 +0000 Subject: [PATCH] Replaced assignment attempt with object test. Author:halw Date:2012-04-06T21:34:51.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1063 abb3cda0-5349-4a8f-a601-0c33ac3a8c38 --- .../net/eiffel-net-language/eiffel-net/genericity.wiki | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/documentation/current/platform-specifics/microsoft-windows/net/eiffel-net-language/eiffel-net/genericity.wiki b/documentation/current/platform-specifics/microsoft-windows/net/eiffel-net-language/eiffel-net/genericity.wiki index af748d53..69bdfb3a 100644 --- a/documentation/current/platform-specifics/microsoft-windows/net/eiffel-net-language/eiffel-net/genericity.wiki +++ b/documentation/current/platform-specifics/microsoft-windows/net/eiffel-net-language/eiffel-net/genericity.wiki @@ -60,12 +60,10 @@ Another problem is that to do any CAT things with an item in the li my_cats.item.purr -- Is invalid -This is because "item" is type ANY and although it may be currently attached to an instance of CAT, the static typing system cannot guarantee that. So you must use assignment attempt as we saw in the polymorphism example in [[Inheritance|Inheritance]] . +This is because "item" is type ANY and although it may be currently attached to an instance of CAT, the static typing system cannot guarantee that. So you must use an object test as we saw in the polymorphism example in [[Inheritance|Inheritance]] . - some_cat: CAT ... - some_cat ?= my_cats.item - if some_cat /= Void then + if attached my_cats.item as some_cat then some_cat.purr end