comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: SPARK 2014 and protected objects
Date: Tue, 30 Aug 2016 16:33:13 +0100
Date: 2016-08-30T16:33:13+01:00	[thread overview]
Message-ID: <lyoa4ai85i.fsf@pushface.org> (raw)
In-Reply-To: fad2fbc7-acec-4923-984f-d7726e130e04@googlegroups.com

Shark8 <onewingedshark@gmail.com> writes:

> Have you tried moving "Protected_Value : Integer := 0 with Volatile;"
> into the protected object's private section (inside the
> specification)?

Like this ...

   private

      Protected_Value : Integer := 0
        with Volatile,
        Part_Of => State;

   end PO;

but I still get the problem with Impl ... so I put its spec in po.ads
similarly ... State still needs refinement, but it can't be done ...

     1. package body PO
     2. with Refined_State => (State => (Protected_Value,
                               |
        >>> non-external state "State" cannot contain external constituents in refinement

     3.                                  Impl))
     4. is

What is a non-external state?

(by the way, this is the compiler complaining, not gnatprove)

  reply	other threads:[~2016-08-30 15:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 10:34 SPARK 2014 and protected objects Simon Wright
2016-08-30 14:45 ` Shark8
2016-08-30 15:33   ` Simon Wright [this message]
2016-08-30 18:42     ` Simon Wright
2016-08-30 18:47     ` Simon Wright
2016-08-31  0:11 ` Shark8
2016-08-31  7:42   ` Simon Wright
2016-08-31 15:41     ` Shark8
2016-08-31 20:55       ` Simon Wright
2016-09-01 20:07         ` Shark8
replies disabled

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