Message ID | 20161012123415.GA119495@adacore.com |
---|---|
State | New |
Headers | show |
Index: sem_res.adb =================================================================== --- sem_res.adb (revision 241024) +++ sem_res.adb (working copy) @@ -6034,6 +6034,15 @@ end; else + -- If the function returns the limited view of type, the call must + -- appear in a context in which the non-limited view is available. + -- As is done in Try_Object_Operation, use the available view to + -- prevent back-end confusion. + + if From_Limited_With (Etype (Nam)) then + Set_Etype (Nam, Available_View (Etype (Nam))); + end if; + Set_Etype (N, Etype (Nam)); end if;