/* Test the assignment operator generated for structs. Also test the models of Regular and DefaultConstructible. */ struct foo { int x; }; fun bar where { Regular, DefaultConstructible } (T x, T! y) { let tmp = @T(); tmp = x; y = tmp; } fun main() -> int@ { let f1 = @foo{ x = 2 }; let f2 = @foo{ x = 3 }; f2 = f1; let f3 = @foo{ x = 2 }; let f4 = @foo{ x = 3 }; bar(f3, f4); return (f1.x - f2.x) + (f3.x - f4.x); }