:- module unif_bug2. :- interface. :- pred foo(X::in, X::out) is semidet <= foo(X). :- implementation. :- import_module list. :- typeclass foo(X) where []. foo(X, Y) :- % The calls to reverse() are necessary so things aren't % optimized away... promise_equivalent_solutions [Bar] reverse([X], Bar), ( Bar = [], false ; Bar = [Z|L], reverse(L, _), Y = Z ).