Using `with()` on a struct that contains alias this only works within a single module.

realhet real_het at hotmail.com
Sun Apr 5 09:23:44 UTC 2026


On Sunday, 5 April 2026 at 01:17:05 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> On 05/04/2026 6:02 AM, realhet wrote:
>> private Transaction transaction_; @property Transaction 
>> transaction() => transaction_; /+ //alias this = transaction_; 
>> This FAILS when using with() in another module. +/
>
> ``alias this = transaction;``
>
> The private visibility modifier will be getting respected.

Thank You!

A single `_` character solved 2 hours of frustration, lol. Now my 
fate in modern stuff has been restored. :D
The exact error message was this: ``Error: undefined identifier 
`execute` ``
"Unable to access" was not on my mind at all.


More information about the Digitalmars-d-learn mailing list