% The code generated by the compiler of 11/6/2000 for this
% test case gets a segmentation fault at runtime because
% the compiler doesn't remove duplicates in the list of
% unconstrained type variables for which it adds type-infos
% to a typeclass-info. The predicate generated to call
% write_list_pair for the instance `p(list(T), list(T))'
% expects one type-info for `T' but was given two.
%
:- module instance_unconstrained_tvar_dup.

:- interface.

:- import_module io, list.

:- pred main(io__state::di, io__state::uo) is det.

:- typeclass p(T, U) where [
	pred m(T, U, io__state, io__state),
	mode m(in, in, di, uo) is det
].

:- implementation.

:- instance p(list(T), list(T)) where [
	pred(m/4) is write_list_pair
].

main -->
	m([1,2,3], [4,5,6]),
	io__nl.

:- pred write_list_pair(list(T), list(U), io__state, io__state).
:- mode write_list_pair(in, in, di, uo) is det.

write_list_pair(T, U) -->
	io__write(T),
	io__nl,
	io__write(U),
	io__nl.

