Pipo
Pipo

Reputation: 5073

Eiffel: Unknown identifier on attached check into require statement

    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??!!!

Upvotes: 0

Views: 124

Answers (1)

Jocelyn
Jocelyn

Reputation: 703

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.

Upvotes: 3

Related Questions