From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,162ee844b6e6caa1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: Brian May Newsgroups: comp.lang.ada Subject: Re: Odd error with access to derived types References: Date: Sun, 17 Oct 2004 10:19:27 +1000 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:G4Rx3M+/xnL+CAbdrD6K4MZp6Fo= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: dsl-202-173-153-89.vic.westnet.com.au X-Trace: news.melbourne.pipenetworks.com 1097972354 202.173.153.89 (17 Oct 2004 10:19:14 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!news-north.connect.com.au!news.alphalink.com.au!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:5340 Date: 2004-10-17T10:19:27+10:00 List-Id: >>>>> "Stephen" == Stephen Leake writes: Stephen> A.Imran writes: >> Thank you for looking at the code. Here is the error message: >> >> ~> gnatmake test gcc -c test.adb parent-child.ads:10:09: >> "derived_access" conflicts with declaration at line 6 gnatmake: >> "test.adb" compilation error Stephen> That is certainly a confusing error message. I'd call it Stephen> a compiler bug; submit this to report@gnat.com. Was the previous code valid? If not, why not? Stephen> As for working around it, this compiles: package parent Stephen> is Another three work arounds I found: a) move definition of derived_access after derived_type (i.e. make it private). b) make definition of derived_type public. It would appear that derived_access needs the full definition of derived_type in order to work because it contains a task. I don't understand why. c) make dummy_task an access type to a_task. My preference would be c), although you could argue you shouldn't need to use or manipulate access types here. gcc-3.4 also has the same problem: [519] [snoopy:bam] ~/abc >gnatmake test gcc-3.4 -c test.adb parent-child.ads:9:09: "derived_access" conflicts with declaration at line 5 gnatmake: "test.adb" compilation error -- Brian May