Skip to content

Instantly share code, notes, and snippets.

@dnadlinger
Created July 19, 2015 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnadlinger/90ab58e2c473d52b91b9 to your computer and use it in GitHub Desktop.
Save dnadlinger/90ab58e2c473d52b91b9 to your computer and use it in GitHub Desktop.
uint count;
struct S {
uint x;
void opAssign(const ref S rhs) { assert(false); }
~this() { ++count; }
}
void main() {
S[2] a;
a[0].x = 42;
a = a.init;
assert(a[0].x == 0); // as expected the value has been reset
assert(count == 0); // Passes?!?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment