===================================================================
@@ -5756,14 +5756,31 @@
declare
TSS_Name : constant TSS_Name_Type := Get_TSS_Name (New_Id);
+
begin
if TSS_Name /= TSS_Stream_Read
and then TSS_Name /= TSS_Stream_Write
and then TSS_Name /= TSS_Stream_Input
and then TSS_Name /= TSS_Stream_Output
then
- Conformance_Error
- ("\type of & does not match!", New_Formal);
+ -- Here we have a definite conformance error. It is worth
+ -- special casesing the error message for the case of a
+ -- controlling formal (which excludes null).
+
+ if Is_Controlling_Formal (New_Formal) then
+ Error_Msg_Node_2 := Scope (New_Formal);
+ Conformance_Error
+ ("\controlling formal& of& excludes null, "
+ & "declaration must exclude null as well",
+ New_Formal);
+
+ -- Normal case (couldn't we give more detail here???)
+
+ else
+ Conformance_Error
+ ("\type of & does not match!", New_Formal);
+ end if;
+
return;
end if;
end;