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

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sun Apr 5 01:17:05 UTC 2026


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.



More information about the Digitalmars-d-learn mailing list