This code causes it to hang indefinitely it seems. I've waited a while and it still hasn't terminated execution. Some similar code struct Vector2 { float x; float y; alias byRef this; ref const(Vector2) byRef() const { return this; } Vector2 opBinary(string op : "+")(ref const(Vector2) a) const { return Vector2(x + a.x, y + a.y); } } void main() { Vector2 a = Vector2(1, 2); Vector2 b = Vector2(3, 4); Vector2 c = a + b; // this line causes application to run infinitely Vector2 d = a + Vector2(5, 6); // this line seg faults without the above line }
@BorisCarvajal created dlang/dmd pull request #12161 "Fix Issue 16635 - Alias this for implicit conversion to "ref typeof(tâĤ" fixing this issue: - Fix Issue 16635 - Alias this for implicit conversion to "ref typeof(this)" causes dmd to run endlessly https://github.com/dlang/dmd/pull/12161
dlang/dmd pull request #12161 "Fix Issue 16635 - Alias this for implicit conversion to "ref const(typeof(this))" causes dmd to segfault" was merged into master: - ccdd1ca11baee5174801deb41bdd5f93fbbb55a2 by Boris Carvajal: Fix Issue 16635 - Alias this for implicit conversion to "ref typeof(this)" causes dmd to run endlessly https://github.com/dlang/dmd/pull/12161