then
Resolve (Rhs, Base_Type (T1));
+ -- When the right hand side is a qualified expression and the left hand
+ -- side is mutably tagged we force the right hand side to be class-wide
+ -- so that they are compatible both for the purposes of checking
+ -- legality rules as well as assignment expansion.
+
+ elsif Is_Mutably_Tagged_Type (T1)
+ and then Nkind (Rhs) = N_Qualified_Expression
+ then
+ Make_Mutably_Tagged_Conversion (Rhs, T1);
+ Resolve (Rhs, T1);
+
+ -- Otherwise, resolve the right hand side normally
+
else
Resolve (Rhs, T1);
end if;
and then not Is_Class_Wide_Type (T2)
and then not Is_Tag_Indeterminate (Rhs)
and then not Is_Dynamically_Tagged (Rhs)
+ and then not Is_Mutably_Tagged_Type (T1)
then
Error_Msg_N ("dynamically tagged expression required!", Rhs);
end if;