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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx01.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:35.0) Gecko/20100101 Thunderbird/35.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Possible GNAT bug w/ tasks and expression functions. Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Fri, 10 Oct 2014 00:30:06 UTC Organization: TeraNews.com Date: Thu, 09 Oct 2014 18:30:01 -0600 X-Received-Bytes: 1795 X-Received-Body-CRC: 2993288990 Xref: news.eternal-september.org comp.lang.ada:22299 Date: 2014-10-09T18:30:01-06:00 List-Id: I get an interesting compiler error when I try to replace this > -- Gen handles the actual creation of a new task and state. > Function Gen(P : Peg; G : not null access Generate) return Generator is > begin > return > (if G.Pegs(P) then null > else new Generate( > Pegs => new Used_Peg'(G.Pegs.all & P), > State => New Partial_Board'(G.All.State.All & P) > ) > ); > end; with > -- Gen handles the actual creation of a new task and state. > Function Gen(P : Peg; G : not null access Generate) return Generator is > (if G.Pegs(P) then null > else new Generate( > Pegs => new Used_Peg'(G.Pegs.all & P), > State => New Partial_Board'(G.All.State.All & P) > ) > ); As you can see, it is simply the transformation between the "proper subprogram" form and the expression-function form; something which the ARM says is equivalent. Fully compilable code here: http://rosettacode.org/wiki/Solve_the_no_connection_puzzle#Ada I was wondering if any of you have hit this issue as well.