comp.lang.ada
 help / color / mirror / Atom feed
From: sun-barr!west.West.Sun.COM!cronkite.Central.Sun.COM!texsun!yorktown!young @ames.arc.nasa.gov  (Mark Young)
Subject: Generic Package Visibility Problems! (help)
Date: 2 Oct 92 18:35:52 GMT	[thread overview]
Message-ID: <YOUNG.92Oct2123552@kuwait.gdfwc3> (raw)

I am having visibility problems with generic packages.

Here's an example:

file #1
-----------------------------------------------
generic 

  Generic_Parameter : Generic_Parameter_Type;

package Color is

  type RGB_Type is (RED,GREEN,BLUE);

  function Get_Color return RGB_Type;

end Color;
----------------------------------------------
file #2
----------------------------------------------
with Color;

package Caller is

  package C_1 is new Caller( Generic_Argument );

  procedure Test_Color;

end Caller;

package body Caller is 

  procedure Test_Color is separate;

end Caller;
---------------------------------------------
file #3
---------------------------------------------
separate( Caller )

procedure Test_Color is

begin

  if ( C_1.Get_Color = C_1.RED ) then
	               -------
	null;

  end if;

end Test_Color;
----------------------------------------------

This will not work.  For some reason the compiler cannot
resolve C_1.RED.  It tells me that = is not a legal 
operation, that C_1.Get_Color returns type RGB_Type but, 
that it does not understand C_1.RED and that perhaps I 
needed a "use" clause in the body of Caller.  I don't
understand this.  My understanding of Ada scoping would
lead me to believe that this is correct.  Am I missing 
something?  

BTW: this is not a complete example, it is only to illustrate
a point.

Thanks,

Mark Young

             reply	other threads:[~1992-10-02 18:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-10-02 18:35 Mark Young [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-10-02 23:25 Generic Package Visibility Problems! (help) dog.ee.lbl.gov!overload.lbl.gov!agate!spool.mu.edu!nigel.msen.com!caen!de
1992-10-04 21:02 Adam Beneschan
1992-10-04 22:10 DONALD PRINCIOTTA
replies disabled

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