Commit 8a4444e8 by Hristian Kirtchev Committed by Arnaud Charlet

sem_type.adb (Function_Interp_Has_Abstract_Op): Add guard to check whether…

sem_type.adb (Function_Interp_Has_Abstract_Op): Add guard to check whether formal E is an entity which may have parameters.

2007-12-06  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_type.adb (Function_Interp_Has_Abstract_Op): Add guard to check
	whether formal E is an entity which may have parameters.

From-SVN: r130858
parent a1980be8
...@@ -424,11 +424,11 @@ package body Sem_Type is ...@@ -424,11 +424,11 @@ package body Sem_Type is
and then Present (Abstract_Interface_Alias (E)) and then Present (Abstract_Interface_Alias (E))
then then
-- Ada 2005 (AI-251): If this primitive operation corresponds with -- Ada 2005 (AI-251): If this primitive operation corresponds with
-- an inmediate ancestor interface there is no need to add it to the -- an immediate ancestor interface there is no need to add it to the
-- list of interpretations; the corresponding aliased primitive is -- list of interpretations. The corresponding aliased primitive is
-- also in this list of primitive operations and will be used instead -- also in this list of primitive operations and will be used instead
-- because otherwise we have a dummy between the two subprograms that -- because otherwise we have a dummy ambiguity between the two
-- are in fact the same. -- subprograms which are in fact the same.
if not Is_Ancestor if not Is_Ancestor
(Find_Dispatching_Type (Abstract_Interface_Alias (E)), (Find_Dispatching_Type (Abstract_Interface_Alias (E)),
...@@ -505,8 +505,8 @@ package body Sem_Type is ...@@ -505,8 +505,8 @@ package body Sem_Type is
end; end;
else else
-- Overloaded prefix in indexed or selected component, -- Overloaded prefix in indexed or selected component, or call
-- or call whose name is an expression or another call. -- whose name is an expression or another call.
Add_Entry (Etype (N), Etype (N)); Add_Entry (Etype (N), Etype (N));
end if; end if;
...@@ -530,6 +530,7 @@ package body Sem_Type is ...@@ -530,6 +530,7 @@ package body Sem_Type is
Write_Entity_Info (All_Interp.Table (J). Nam, " "); Write_Entity_Info (All_Interp.Table (J). Nam, " ");
else else
Write_Str ("No Interp"); Write_Str ("No Interp");
Write_Eol;
end if; end if;
Write_Str ("================="); Write_Str ("=================");
...@@ -641,7 +642,7 @@ package body Sem_Type is ...@@ -641,7 +642,7 @@ package body Sem_Type is
Add_One_Interp (N, H, Etype (H)); Add_One_Interp (N, H, Etype (H));
if Debug_Flag_E then if Debug_Flag_E then
Write_Str ("Add overloaded Interpretation "); Write_Str ("Add overloaded interpretation ");
Write_Int (Int (H)); Write_Int (Int (H));
Write_Eol; Write_Eol;
end if; end if;
...@@ -1981,7 +1982,10 @@ package body Sem_Type is ...@@ -1981,7 +1982,10 @@ package body Sem_Type is
Form_Parm : Node_Id; Form_Parm : Node_Id;
begin begin
if Is_Overloaded (N) then -- Why is check on E needed below ???
-- In any case this para needs comments ???
if Is_Overloaded (N) and then Is_Overloadable (E) then
Act_Parm := First_Actual (N); Act_Parm := First_Actual (N);
Form_Parm := First_Formal (E); Form_Parm := First_Formal (E);
while Present (Act_Parm) while Present (Act_Parm)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment