From: Simon Wright <simon@pushface.org>
Subject: Re: child class of limited_controlled not inheriting data
Date: Fri, 05 Aug 2016 20:36:21 +0100
Date: 2016-08-05T20:36:21+01:00 [thread overview]
Message-ID: <lya8grknyi.fsf@pushface.org> (raw)
In-Reply-To: aa30d04a-42be-4b18-b1f5-785377315a15@googlegroups.com
b.mcguinness747@gmail.com writes:
> Then I defined a child class as
>
> with sofa.time.two_part_date;
>
> package sofa.time.Julian_Day_Numbers is
> type Julian_Day_Number is new sofa.time.two_part_date.Date with null record;
>
> function To_Julian_Day_Number (time : Instant) return Julian_Day_Number;
> function To_Calendar_Date (this : Julian_Day_Number; calendar : Calendar_Type := GREGORIAN; zone : Time_Zone_Number := 0) return Instant;
> function To_Milliseconds (this : Julian_Day_Number) return Integer;
>
> end sofa.time.Julian_Day_Numbers;
>
>
> When I try to compile the child class, I get error messages such as
>
> sofa-time-julian_day_numbers.adb:77:79: "day_count" is not a component
> of type "Julian_Day_Number" defined at sofa-time-julian_day_numbers.ads:4
>
> indicating that the child class is not inheriting the data from the
> parent class.
You would need to put the julian day stuff in a child package:
package sofa.time.two_part_date.Julian_Day_Numbers ...
Otherwise there's no visibility of the private part of two_part_date.
next prev parent reply other threads:[~2016-08-05 19:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 18:59 child class of limited_controlled not inheriting data b.mcguinness747
2016-08-05 19:20 ` Jeffrey R. Carter
2016-08-05 19:36 ` Simon Wright [this message]
2016-08-05 19:37 ` Dmitry A. Kazakov
2016-08-05 19:42 ` G.B.
2016-08-05 20:26 ` b.mcguinness747
2016-08-05 20:47 ` Dmitry A. Kazakov
2016-08-06 19:00 ` rieachus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox