On 11/11/2025 11:36, Derick Rethans wrote:
On Sat, 8 Nov 2025, Rowan Tommins [IMSoP] wrote:

To spell those out, the prefix version could look like this:

namespace Acme\AuthLib\Somewhere\Deep\In\Package;
// ...
#[NamespacePrivate('Acme\AuthLib', includeChildren: true)]
Whatever the way to define a prefix is going to be, I disagree with that
being done through attributes.

Nowhere in the language do these annotations (yet) interfere with
how code can be run.


The main reason my mind went in that direction is that people are building attributes for this in userspace already - set the actual visibility to public, and then use an attribute for static analysis to restrict it.

They also have a standard syntax for arguments, so it's easy to illustrate those without spending time imagining a new syntax.

But in general, I agree, a native implementation would ideally look and feel like it matched the existing "private" keyword.


--
Rowan Tommins
[IMSoP]

Reply via email to