From: Eric B. <er...@go...> - 2008-04-10 17:23:52
|
Gelint reports the following errors: [VUAR-2] class XM_XPATH_ARRAY_LIST_ITERATOR (33,25): the 1-th actual argument (of type 'NONE') does not conform to the corresponding formal argument (of type 'G') of feature `has' in class DS_ARRAYED_LIST. ---- [VUAR-2] class XM_XPATH_ARRAY_LIST_ITERATOR (46,25): the 1-th actual argument (of type 'NONE') does not conform to the corresponding formal argument (of type 'G') of feature `has' in class DS_ARRAYED_LIST. ---- [VUAR-2] class XM_XPATH_ARRAY_LIST_ITERATOR (205,21): the 1-th actual argument (of type 'NONE') does not conform to the corresponding formal argument (of type 'G') of feature `has' in class DS_ARRAYED_LIST. ---- [VUAR-2] class XM_XPATH_REVERSE_ARRAY_LIST_ITERATOR (33,25): the 1-th actual argument (of type 'NONE') does not conform to the corresponding formal argument (of type 'G') of feature `has' in class DS_ARRAYED_LIST. ---- [VUAR-2] class XM_XPATH_REVERSE_ARRAY_LIST_ITERATOR (46,25): the 1-th actual argument (of type 'NONE') does not conform to the corresponding formal argument (of type 'G') of feature `has' in class DS_ARRAYED_LIST. ---- [VUAR-2] class XM_XPATH_REVERSE_ARRAY_LIST_ITERATOR (174,21): the 1-th actual argument (of type 'NONE') does not conform to the corresponding formal argument (of type 'G') of feature `has' in class DS_ARRAYED_LIST. ---- One way to solve this problem is to use inline agents ;-))) Anyway, the assertions are obviously wrong, it should be: no_void_item: not a_list.has (Void) ^^^ Probably not caught earlier because of the bug in gexace. OK, I can feel the fact that you don't want to use inline agents. So, there are several other solutions. 1) Add a routine `has_default' in class DS_SEARCHABLE. 2) Add a routine `default_item: G' in your class and call: not a_list.has (default_item). But this will not be practical for assertions in creation routines. 3) Use KL_ANY_ROUTINES.same_objects: not a_list.there_exists (agent ANY_.same_objects (?, Void)) Solution 3 is the one which will work without any additional code. PS: I would tend to avoid declaring the generic parameter as 'reference G' because it is not part of ECMA Eiffel is I remember correctly. -- Eric Bezault mailto:er...@go... http://www.gobosoft.com |