/* Test the assignment operator generated for unions */ union foo { int i; double d; }; fun bar where { Regular } (T x, T! y) { y = x; } fun main() -> int@ { let f1 = @foo{ i = 2 }; let f2 = @foo{ d = 3.0 }; f2 = f1; let f3 = @foo{ i = 2 }; let f4 = @foo{ d = 3.0 }; bar(f3,f4); switch (f2) { case i: let j = i; switch (f3) { case i: return i - j; case d: return -1; } case d: return -1; } }