===================================================================
@@ -2272,7 +2272,16 @@ package body Sem_Ch10 is
else
Set_Scope (Defining_Entity (N), Current_Scope);
Generate_Reference (Nam, Defining_Identifier (N), 'b');
- Set_Has_Completion (Etype (Nam));
+
+ -- Check for duplicate stub, if so give message and terminate
+
+ if Has_Completion (Etype (Nam)) then
+ Error_Msg_N ("duplicate stub for task", N);
+ return;
+ else
+ Set_Has_Completion (Etype (Nam));
+ end if;
+
Analyze_Proper_Body (N, Etype (Nam));
-- Set elaboration flag to indicate that entity is callable. This