interface someTypes{@Type}domains
rec = rec(@Type).
domains
valueProvider =(rec*)-> @TypeValue.
end interface someTypes
%======interface objA
end interface objA
%---class objA{@Type}:objAopen someTypes{@Type}constructors
new :(valueProvider).
end class objA
%---implement objA{@Type}clauses
new(_ProvideValue).
end implement objA
%======interface objB{@Type}domains
useTypeToPreventWarning = @Type.
end interface objB
%---class objB{@Type}:objB{@Type}end class objB
%---implement objB{@Type}open someTypes{@Type}clauses
new():-%hasDomain(valueProvider, ProvideValue),ProvideValue={(RecList)=Val:-[rec(Val)]==RecList},_ObjA= objA::new(ProvideValue).
end implement objB
%======implement main
clauses
run():-_ObjB= objB::new().
end implement main
When uncommenting the hasDomain line, the message changes to error c504 : The expression has type '(someTypes::rec*) -> @Type procedure', which is incompatible with the type '(someTypes::rec{@Type}*) -> @Type procedure'. Trying to strip down the problem further, I found that following short code produces same kind of error.
interface someTypes{@Type}domains
rec = rec(@Type).
end interface someTypes
implement main
clauses
run():-
hasDomain(someTypes{unsigned}::rec,_Rec).
end implement main
As always I believe you can work around the problems by refraining from using @Type in domains and define ordinary parameterized domains instead. And then only use @Type in predicate declarations.
interface someTypes{@Type}domains
rec{T}= rec(T). % Do not use @Type heredomains
valueProvider{T}=(rec{T}*)->TValue. % Do not use @Type herepredicates
ppp :(valueProvider{@Type}VP). % Here @Type can be usedend interface someTypes
The problem is that the domains does not really belong to the objects and therefore it is "problematic" to let them depend on the interface parameters.
But we have allowed such usage, so we will of course address the problem.