Message ID | 20101004133843.GA8862@adacore.com |
---|---|
State | New |
Headers | show |
Index: exp_ch5.adb =================================================================== --- exp_ch5.adb (revision 164906) +++ exp_ch5.adb (working copy) @@ -1956,6 +1956,12 @@ package body Exp_Ch5 is if Is_Class_Wide_Type (Typ) and then Is_Tagged_Type (Typ) and then Is_Tagged_Type (Underlying_Type (Etype (Rhs))) + + -- Do not generate a tag check when the target object is + -- an interface since the expression of the right hand + -- side must only cover the interface. + + and then not Is_Interface (Typ) then Append_To (L, Make_Raise_Constraint_Error (Loc,