埃菲尔:附加检查要求声明中的未知标识符

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

为什么我这里有一个未知的标识符 l_i??!!!

试试

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

注意你也可以这样做

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

您可以重用先前前提条件中的对象测试局部变量l_i