include_c "math.h"; use "basic_models.g"; struct foo where { DefaultConstructible, Regular, DefaultConstructible, Regular, DefaultConstructible, Regular } { T w; U x; V y; }; /* Would be nice to have constraints propagation here! */ fun w where { DefaultConstructible, Regular, DefaultConstructible, Regular, DefaultConstructible, Regular } (foo f) -> T { return f.w; } fun x where { DefaultConstructible, Regular, DefaultConstructible, Regular, DefaultConstructible, Regular } (foo f) -> U { return f.x; } fun y where { DefaultConstructible, Regular, DefaultConstructible, Regular, DefaultConstructible, Regular } (foo f) -> V { return f.y; } fun main() -> int@ { let f = @foo{ w = 2.0, x = 3, y = 4.0 }; return (d2i(floor(f.w + f.y)) + f.x) - (d2i(floor(w(f) + y(f))) + x(f)); }