I am not sure whether it is already known or maybe intended. In an interface the compiler (build 802) does not see domains which are declared in the class having the same name as the interface:
The reason is that your interface must be valid without "knowing about the class" (whereas the other way around is impossible, because it says class xxx : xxx).
If the interface was not independent of the class you can have strange behavior in places where only the interface is visible (such situation will only happen with a "strange" and unadwisable project structure, but nevertheless ...).
I have tried to find an example of a project structure in which the strange behavior would show up. But I have no idea what it could be. Can you give a clue?
It will/can happen if you define the interface in one package and the class in another.
This is both possible and legal, but not something I can recommend. If you do so you will definitely confuse some mechanisms in the IDE, especially the automatic insertion of include directives.
A reason that could incline you to make such a structure is when you consider the interface to be of global interest, but consider the class itself to be a "private" matter. For example the class is only intended to be the base class of a number of different implementations of the interface. This is a good cause, but a bad solution. A better structure for this case would be to use a different name for the base class, e.g. <something>Base.
I have tested the unadwisable project structure. In below the class domain someObj::classDomain is not visible when the code of interface and class is placed in different packages:
%%%%%%% This code is in package someInterfaceinterface someObj
domains
objDomain = unsigned.
end interface someObj
% End of code in package someInterface%%%%%%%---%%%%%%% That code is in package someClassclass someObj :someObjdomains
classDomain = unsigned.
end class someObj
implement someObj
end implement someObj
% End of code in package someClass%%%%%%%===implement main
classpredicates
takeObjDomain :(someObj::objDomain).
clauses
takeObjDomain(_).
classpredicates
takeClassDomain :(someObj::classDomain). %gives unknown domain/interface 'someObj::classDomain'clauses
takeClassDomain(_).
clauses
run():-
takeObjDomain(1),
takeClassDomain(2).
end implement main
But the above compiles when doing it the adwisable way, placing the code of someObj in a single package.
An alternative idea, to deal with the problem, would be, to let the compiler always see the class level domains, but to prevent creating the unadwisable project structure in the IDE. Of course that is a naive suggestion, because I do not know about all the complex internal details of compiler and IDE.