comp.lang.ada
 help / color / mirror / Atom feed
From: briot.emmanuel@gmail.com
Subject: Re: GNAT: no visible subprogram matches the specification for "Put"
Date: Mon, 7 Oct 2019 12:01:40 -0700 (PDT)
Date: 2019-10-07T12:01:40-07:00	[thread overview]
Message-ID: <58103920-4692-46b8-9426-e5a85fa04e77@googlegroups.com> (raw)
In-Reply-To: <50fceebb-c48e-4b38-b0f5-2318672a70c1@googlegroups.com>

> The visibility of generic formal parameters outside the generic body is problematic in GNAT. LRM 8.2 (8) says:

I have had this problem forever too, but I was told by the GNAT and Ada
experts that this was actually expected behavior, though I can never remember
the corresponding parts of the LRM. I think it has to do with whether the user of the generic instance can see what the actual parameters were. So if you pass the signature package as a parameter in the instantiation of another generic, then you can reference the formal parameters, but if the compiler see statically what the actual parameters are, you cannot.

This is a pain point when using generics.

It would be nice if someone (Randy, Bob ?) could confirm one way or the other.


> One workaround is to put a rename declaration in the generic package:

This is indeed the proper workaround, but this is a pain because we have to invent a second name to designated the same thing.

  parent reply	other threads:[~2019-10-07 19:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 18:53 GNAT: no visible subprogram matches the specification for "Put" Vincent Marciante
2019-10-05 10:50 ` Stephen Leake
2019-10-06 11:45   ` marciant
2019-10-07 11:55     ` vincent.marciante
2019-10-07 15:03     ` Stephen Leake
2019-10-07 19:00       ` Vincent Marciante
2019-10-07 19:01       ` briot.emmanuel [this message]
2019-10-08 10:01         ` Vincent Marciante
2019-10-08 14:53           ` Optikos
2019-10-08 17:48             ` Björn Lundin
2019-10-08 18:47               ` Vincent Marciante
replies disabled

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