Thanks Tucker for the clarification. I too almost got into the mode of
thinking that if GNAT accepts it, it must be right. I should know better
Apex also rejects (properly) the original code, since only if Left and
Right were Boolean would Standard.And apply.
Another approach that works is to use a child package to define the new
functions and refer back to the parent package definition of "and".
package Some_Package is
type Private_Type is private;
type Private_Type is array (0 .. 1023) of Boolean;
package Some_Package.Sub_Function is
function "and" (Left, Right : Private_Type) return Private_Type;
package body Some_Package.Sub_Function is
function "and" (Left, Right : Private_Type) return Private_Type is
return Some_Package."and" (Left, Right);