void fun() { int x = 2; struct A { int a; this(int a) { this.a = a + x; // segault here } } A a = 5; // A a = A(5); initializing `a` like this works as expected } void main() { fun(); }
PR : https://github.com/dlang/dmd/pull/8597
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/9b5a295e8707a17bee8e45e0337935ed568bcff9 Fix Issue 19185 - [ICE] Nested struct segfaults when using variable from outer scope https://github.com/dlang/dmd/commit/88de313bb92b3fb181cc0198b490422b1ab57407 Merge pull request #8597 from RazvanN7/Issue_19185 Fix Issue 19185 - [ICE] Nested struct segfaults when using variable from outer scope merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>