General
I don't understand why there are like 2 generating_type
kinds, the one with exclamation point, and the other not.
My case
I have a function returning a DB_SERVICE[G]
from a given instance from a collection of db_services
so that from another service I can retrieve it and call it. When I pass an instance generating_type
to that function, the conforms_to
returns True, as when I give ({ENUMERATE}).generating_type
it doesn't.
Why is that so?
-- Humanly unreadable
if attached {ENUMERATE_DB_SERVICE} {SIT_ENVIRONMENT}.app_instance.db_service_from_entity_type (item_prototype.charge_unit_relationship.secondary_prototype.an_index_relationship.secondary_prototype.generating_type) as l_enum_dbs then
-- Humanly readable but not working
if attached {ENUMERATE_DB_SERVICE} {SIT_ENVIRONMENT}.app_instance.db_service_from_entity_type (({ENUMERATE}).generating_type) as l_enum_dbs then
My function
db_service_from_entity_type (an_entity_type: TYPE[detachable DB_ENTITY]): detachable like db_services.item
do
across
db_services as l_dbs
until
Result /= Void
loop
if l_dbs.item.item_prototype.generating_type.conforms_to (an_entity_type) then
Result := l_dbs.item
end
end
ensure
service_found: attached Result
end
Edit (20190405-11:26 UTC)
As the screenshot shows, giving {ENUMERATE}
instead of ({ENUMERATE}).generating_type
doesn't work either