-- an instantiation, otherwise the conversion will already have been
-- rejected as illegal.
- -- Note: warnings are issued by the analyzer for the instance cases
+ -- Note: warnings are issued by the analyzer for the instance cases,
+ -- and, since we are late in expansion, a check is performed to
+ -- verify that neither the target type nor the operand type are
+ -- internally generated - as this can lead to spurious errors when,
+ -- for example, the operand type is a result of BIP expansion.
elsif In_Instance_Body
and then Statically_Deeper_Relation_Applies (Target_Type)
+ and then not Is_Internal (Target_Type)
+ and then not Is_Internal (Operand_Type)
and then
Type_Access_Level (Operand_Type) > Type_Access_Level (Target_Type)
then