comp.lang.ada
 help / color / mirror / Atom feed
* generic subprogs. in a package
@ 1992-01-16  0:06 David  A. Hasan
  0 siblings, 0 replies; 2+ messages in thread
From: David  A. Hasan @ 1992-01-16  0:06 UTC (permalink / raw)


OK, I give up.  I can't figure out why the DEC compiler is rejecting
the following package spec.  Can anyone point out the obvious thing
I must be overlooking?


PACKAGE test IS
  PROCEDURE f;
  FUNCTION f RETURN Integer;

  GENERIC 
    n : Boolean;
  FUNCTION f RETURN Integer;
END test;


---DEC compiler diagnostics:


    6 	  GENERIC 
..........1
%ADAC-E-REDECLERR, (1) Illegal redeclaration of procedure specification f at 
        line 2 [LRM 8.3(17)]


--David A. Hasan
--  Center for Space Research
--  University of Texas at Austin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: generic subprogs. in a package
@ 1992-01-16 14:14 David A. Hasan
  0 siblings, 0 replies; 2+ messages in thread
From: David A. Hasan @ 1992-01-16 14:14 UTC (permalink / raw)


In article <65114@ut-emx.uucp> hasan@emx.utexas.edu (David A. Hasan) writes:
>I can't figure out why the DEC compiler is rejecting

>PACKAGE test IS
>  PROCEDURE f;
...
>  GENERIC 
>    n : Boolean;
>  FUNCTION f RETURN Integer;
>END test;
>
>    6 	  GENERIC 
>..........1
>%ADAC-E-REDECLERR, (1) Illegal redeclaration of procedure specification f at 


My question was answered by mail.  The answer is that generics
can't be overloaded, although knowing that I must say that the
compiler error message is somewhat misleading.

Out of curiosity, is there a relatively simple explanation for
this constraint on generics?

-- 
 |   David A. Hasan
 |   hasan@emx.utexas.edu 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1992-01-16 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-01-16  0:06 generic subprogs. in a package David  A. Hasan
  -- strict thread matches above, loose matches on Subject: below --
1992-01-16 14:14 David A. Hasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox