:- module agg_bug.

:- interface.

:- import_module io.

:- pred main(io::di, io::uo) is cc_multi.


:- implementation.

:- import_module solutions.

:- type foo ---> foo(int, int).

:- pred bar(foo::bound(foo(ground, free)) >> ground) is nondet.

bar(foo(0, 1)).
bar(foo(0, 2)).
bar(foo(0, 3)).

main(!IO) :-
	unsorted_solutions(
		pred(X::out) is nondet :- bar(foo(0, _) @ X),
		Sols),
	print(Sols, !IO), nl(!IO).
