That causes a sigsegfault on DMD without any error message ```d public struct Foo { private int values; alias values this; } void main() { writeln(Foo()); } ``` If the values variable is changed to "values2", then, a compiler error is being presented. The mix of private and that special name causes an error, @jrfondren did a brute force test case for every word that happens: https://gist.github.com/jrfondren/78b5d366e37a6a9c4b91e37751f25789 @Mayonix helped me tracking that bug too by getting to the conclusion "So when you name a private field some function defined in object.d, alias this it, and then pass an object to a function in a different module which attempts to access the alias this, it can't access the field in question because it's private, so instead it finds the function defined in object.d,"
@BorisCarvajal created dlang/dmd pull request #13119 "Fix Issue 22329 - DMD and LDC2 Segumentation Faults due to alias this" fixing this issue: - Fix Issue 22329 - DMD and LDC2 Segumentation Faults due to alias this on private field + special names https://github.com/dlang/dmd/pull/13119
dlang/dmd pull request #13119 "Fix Issue 22329 - DMD and LDC2 Segumentation Faults due to alias this" was merged into stable: - 1a1744d58212a7a8ff431b81ffa72239acb6da3a by Boris Carvajal: Fix Issue 22329 - DMD and LDC2 Segumentation Faults due to alias this on private field + special names https://github.com/dlang/dmd/pull/13119
dlang/dmd pull request #13140 "merge stable" was merged into master: - 138559dbf6b472674170576b09193b96d6153ab8 by Boris Carvajal: Fix Issue 22329 - DMD and LDC2 Segumentation Faults due to alias this on private field + special names (#13119) https://github.com/dlang/dmd/pull/13140