On Sunday, 25 February 2018 at 21:35:33 UTC, ketmar wrote:
add postblit debug prints, and you will see.
I get that it will call the postblit since it creates a temporary.
What I expected though was that.
auto s = S(0).foo(1);
Would become something like:
S s; s.__ctor(0).foo(1);
But maybe
add postblit debug prints, and you will see.
When writing some code to setup properties in a chain function
manner I ran into some unexpected behavior with destructors.
Example:
struct S {
int a, b;
ref S foo(int b) {
this.b = b;
return this;
}
this(int ab) {
this.a = this.b = ab;