Re: Errors caught by gelint in XM_XPATH classes
"Colin Adams" <[email protected]>
| Newsgroups | gmane.comp.lang.eiffel.gobo.devel |
|---|---|
| Message-ID | <[email protected]> |
I will deal with this next weekend, as I only have a laptop this weekend. Also Unicode 5.1 has been released a week ago, so I will prepare an update for that too. On 10/04/2008, Eric Bezault <[email protected]> wrote: > 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:[email protected] > http://www.gobosoft.com > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > gobo-eiffel-develop mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/gobo-eiffel-develop > ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone