===================================================================
@@ -3413,9 +3413,17 @@
-- an incomplete type, while resolution of the corresponding
-- predicate function may see the full view, as a consequence
-- of the delayed resolution of the corresponding expressions.
+ -- This can occur in the body of a predicate function, or in
+ -- a call to such.
- elsif Ekind (Etype (Formal)) = E_Incomplete_Type
- and then Full_View (Etype (Formal)) = Etype (Actual)
+ elsif ((Ekind (Current_Scope) = E_Function
+ and then Is_Predicate_Function (Current_Scope))
+ or else (Ekind (Nam) = E_Function
+ and then Is_Predicate_Function (Nam)))
+ and then
+ (Base_Type (Underlying_Type (Etype (Formal))) =
+ Base_Type (Underlying_Type (Etype (Actual))))
+ and then Serious_Errors_Detected = 0
then
Set_Etype (Formal, Etype (Actual));
Next_Actual (Actual);
===================================================================
@@ -6983,7 +6983,8 @@
elsif Nkind (P) /= N_Attribute_Reference then
-- This may have been meant as a prefixed call to a primitive
- -- of an untagged type.
+ -- of an untagged type. If it is a function call check type of
+ -- its first formal and add explanation.
declare
F : constant Entity_Id :=
@@ -6992,8 +6993,7 @@
if Present (F)
and then Is_Overloadable (F)
and then Present (First_Entity (F))
- and then Etype (First_Entity (F)) = Etype (P)
- and then not Is_Tagged_Type (Etype (P))
+ and then not Is_Tagged_Type (Etype (First_Entity (F)))
then
Error_Msg_N
("prefixed call is only allowed for objects "