----------------------
function Check_References (Nod : Node_Id) return Traverse_Result is
+ CW_Disp_Typ : constant Entity_Id :=
+ (if Present (Disp_Typ)
+ then Class_Wide_Type (Disp_Typ)
+ else Empty);
begin
if Nkind (Nod) = N_Function_Call
and then Is_Entity_Name (Name (Nod))
-- A return object of the type is illegal as well
if Etype (Func) = Disp_Typ
- or else Etype (Func) = Class_Wide_Type (Disp_Typ)
+ or else Etype (Func) = CW_Disp_Typ
then
Error_Msg_NE
("operation in class-wide condition must be primitive "
elsif Is_Entity_Name (Nod)
and then
(Etype (Nod) = Disp_Typ
- or else Etype (Nod) = Class_Wide_Type (Disp_Typ))
+ or else Etype (Nod) = CW_Disp_Typ)
and then Ekind (Entity (Nod)) in E_Constant | E_Variable
then
Error_Msg_NE
elsif Nkind (Nod) = N_Explicit_Dereference
and then (Etype (Nod) = Disp_Typ
- or else Etype (Nod) = Class_Wide_Type (Disp_Typ))
+ or else Etype (Nod) = CW_Disp_Typ)
and then (not Is_Entity_Name (Prefix (Nod))
or else not Is_Formal (Entity (Prefix (Nod))))
then