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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.198.197 with SMTP id v45mr4429605yhn.26.1382652269691; Thu, 24 Oct 2013 15:04:29 -0700 (PDT) X-Received: by 10.50.109.170 with SMTP id ht10mr141876igb.14.1382652269159; Thu, 24 Oct 2013 15:04:29 -0700 (PDT) Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.astraweb.com!border5.a.newsrouter.astraweb.com!xlned.com!feeder5.xlned.com!news.glorb.com!i2no32273362qav.0!news-out.google.com!z6ni90012pbu.0!nntp.google.com!o2no24714785qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 24 Oct 2013 15:04:28 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=RxNzCgoAAACA5KmgtFQuaU-WaH7rjnAO NNTP-Posting-Host: 66.126.103.122 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Curious function signature issue From: Adam Beneschan Injection-Date: Thu, 24 Oct 2013 22:04:29 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 2888 Xref: number.nntp.dca.giganews.com comp.lang.ada:183725 Date: 2013-10-24T15:04:28-07:00 List-Id: On Thursday, October 24, 2013 2:12:28 PM UTC-7, RasikaSr...@gmail.com wrote= : > all >=20 > I have a package P that looks like this: >=20 > package P is > type Person_Type is private ; > function Create( targetsfile : String :=3D "targets.dat" ; > basalfile : String :=3D "basal.dat" ; > isffile : String :=3D "isf.dat" ; > icrfile : String :=3D "icr.dat" ) > return Person_Type ; > function Create return Person_Type ; > .... > .... > end P ; =20 >=20 > I am curious how gnat (2013 if it matters) can distinguish between the tw= o overloaded "Create" functions? >=20 > The project built successfully though I am yet to exercise the runtime. > thanks for any clues, srini You cannot use the Create function with no parameters, because Ada can't te= ll which one to use. However, that doesn't prevent the package from compil= ing. You won't get an error unless you actually try to use the Create func= tion with no parameters. (You could still define a function that renames t= he second Create and use that, however.) If you're actually using P.Create with no parameters, and you're not gettin= g an error, it's a GNAT bug. But in that case I'd want to see a small exam= ple that demonstrates the problem, to make sure there aren't any other cons= tructs that might be affecting something. -- Adam=20