Strange VAPE error

22 views
Skip to first unread message

Louis M

unread,
May 22, 2017, 12:26:38 PM5/22/17
to Eiffel Users
Hi everyone,

I have a little error here and I have to admit that I feel super noob because my error seems elementary, almost trivial. But the problem is that I don't understand it. Here it is. I have this simple code:


deferred class
    REPOSITORIES_SHARED

feature {NONE} -- Implementation

    database_access:DATABASE_ACCESS
            -- The database session manager
        once
            create Result.make
        end

    users_repository:USER_REPOSITORY
            -- The {REPOSITORY} used to create {USER}
        require
            Is_Set: database_access.is_database_set
        once
            create Result.make (database_access)
        end

end

The compiler give me a "VAPE: some clients have access to routine but not to a feature used in its precondition". The error is with the precondition of `users_repository' and the insufficient exported feature is `database_access'. Both feature are exported {NONE}, so it is not true to say that client that have access to `users_repository' does not have access to `database_access'. I'm sure there is a very good reason for the compiler to give me this error, but I don't know what it is. If somebody can explain it to me, I would be glad.

Thanks,

Louis M

Finnian Reilly

unread,
May 22, 2017, 12:33:49 PM5/22/17
to Eiffel Users
Are you sure that `is_database_set' is sufficiently exported, because descendants of REPOSITORIES_SHARED need to access this value.

Alexander Kogtenkov

unread,
May 22, 2017, 1:05:12 PM5/22/17
to eiffel...@googlegroups.com
Most probably feature `users_repository` is exported in a descendant though `database_access` is not. Also, the complete error message could mention the descendant class name.

Alexander Kogtenkov


 Louis M <eif...@tioui.com>:

Louis M

unread,
May 22, 2017, 3:31:53 PM5/22/17
to Eiffel Users, kwa...@mail.ru
Le lundi 22 mai 2017 13:05:12 UTC-4, Alexander Kogtenkov a écrit :
Most probably feature `users_repository` is exported in a descendant though `database_access` is not. Also, the complete error message could mention the descendant class name.

Alexander Kogtenkov

That was it. I feel bad. In an descendant of {REPOSITORIES_SHARED}, I exported {ANY} the `users_repository. So the error has a lot of sense now. Also you are right; in the complete error, there was a reference to the class that the feature was exported. I will know next time.

Good day,

Louis M
Reply all
Reply to author
Forward
0 new messages