Eiffel: Unknown identifier on attached check into require statement

124 views Asked by At
    require
        valid_item: attached item as l_i and then l_i.valid_for_insert or l_i.valid_for_update

why do I have an unknown identifier here with l_i??!!!

1

There are 1 answers

2
Jocelyn On BEST ANSWER

Try with

valid_item: attached item as l_i and then (l_i.valid_for_insert or l_i.valid_for_update)

Note you can also do

item_set: attached item as l_i 
valid_item: l_i.valid_for_insert or l_i.valid_for_update

you can reuse the object test local variable l_i from a previous precondition.