mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-13 21:04:00 +00:00
compiler/module_imports.m:
Don't just scan a few kinds of items, scan all items that contain
goals and/or terms. This includes the instance items that caused
mantis bug 371, as well as some others (promises, mutables, and
type definitions).
compiler/prog_data.m:
Delete an out-of-date comment.
tests/valid/string_format_in_instance.m:
Add the Mantis test case under a meaningful name.
tests/valid/Mmakefile:
Enable the new test case.
27 lines
472 B
Mathematica
27 lines
472 B
Mathematica
% vim: ft=mercury ts=4 sts=4 sw=4 et
|
|
%
|
|
% This is a regression test for Mantis bug #371.
|
|
|
|
:- module string_format_in_instance.
|
|
:- interface.
|
|
|
|
:- import_module list.
|
|
|
|
:- type foo
|
|
---> foo(int).
|
|
|
|
:- typeclass cons(T) where [
|
|
pred cons(T::in, list(string)::in, list(string)::out) is det
|
|
].
|
|
|
|
:- instance cons(foo).
|
|
|
|
:- implementation.
|
|
|
|
:- import_module string.
|
|
|
|
:- instance cons(foo) where [
|
|
cons(foo(X), A, [S | A]) :-
|
|
string.format("%d", [i(X)], S)
|
|
].
|