[m-dev.] Bug with solver types and submodules
Peter Hawkins
peter at hawkins.emu.id.au
Tue Sep 6 12:07:46 AEST 2005
Hi...
This two-module test case exposes some sort of solver type bug.
File: ts.m
:- module ts.
:- interface.
:- include_module tsub.
:- import_module io.
:- pred main(io.state::di, io.state::uo) is det.
:- implementation.
:- import_module int, exception.
:- solver type st where representation is int,
initialisation is init_int.
:- pred init_int(st::oa) is erroneous.
init_int(_A) :- throw("stop").
main(!IO) :- print("hello", !IO).
File: ts.tsub.m
:- module tsub.
:- interface.
:- pred foo(st::ia) is det.
:- implementation.
Bug:
$ mmc --make ts
Making Mercury/int3s/ts.int3
Making Mercury/int3s/ts.tsub.int3
Making Mercury/cs/ts.c
Making Mercury/int0s/ts.int0
Making Mercury/cs/ts.tsub.c
Mercury/int0s/ts.int0:009: Error: `:- pragma foreign_proc' (or `pragma
c_code')
Mercury/int0s/ts.int0:009: declaration for imported function
Mercury/int0s/ts.int0:009: `ts.representation of ground st/0/1'.
Mercury/int0s/ts.int0:009: Error: `:- pragma foreign_proc' (or `pragma
c_code')
Mercury/int0s/ts.int0:009: declaration for imported function
Mercury/int0s/ts.int0:009: `ts.representation of any st/0/1'.
Mercury/int0s/ts.int0:009: Error: `:- pragma foreign_proc' (or `pragma
c_code')
Mercury/int0s/ts.int0:009: declaration for imported function
Mercury/int0s/ts.int0:009: `ts.representation to ground st/0/1'.
Mercury/int0s/ts.int0:009: Error: `:- pragma foreign_proc' (or `pragma
c_code')
Mercury/int0s/ts.int0:009: declaration for imported function
Mercury/int0s/ts.int0:009: `ts.representation to any st/0/1'.
ts.tsub.m:003: Error: no clauses for predicate `foo/1'.
For more information, try recompiling with `-E'.
** Error making `Mercury/cs/ts.tsub.c'.
What's the problem with the representation casts in the parent module?
=)
Peter
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list