% vim: ts=4 ft=mercury et % rotd-2009-02-17 reports an error message for the following. % % inst_subtype_exists.m:045: In clause for % `print_result(in((inst_subtype_exists.cannot_fail)), % di, uo)': % mode error in unification of `Result' and % `inst_subtype_exists.exception(TypeInfo_15, V_7)'. % Variable `Result' has instantiatedness % `bound(inst_subtype_exists.exception(ground) ; % inst_subtype_exists.succeeded(ground))', % term `inst_subtype_exists.exception(TypeInfo_15, % V_7)' has instantiatedness % `inst_subtype_exists.exception( % free, % free % )'. % % The mode analyser appears to be including the introduced % type-infos in the insts it infers for existentially quantified % data constructors. :- module inst_subtype_exists. :- interface. :- import_module io. :- type exception_result(T) ---> succeeded(T) ; failed ; some [E] exception(E). :- inst cannot_fail ---> succeeded(ground) ; exception(ground). :- pred print_result(exception_result(T)::in(cannot_fail), io::di, io::uo) is det. :- implementation. print_result(Result, !IO) :- ( Result = succeeded(R), io.write(R, !IO) ; Result = exception(_), io.write_string("exception", !IO) ).