[m-users.] Compiler bug found

Volker Wysk <[email protected]>
Newsgroups gmane.comp.lang.mercury.general
Message-ID <[email protected]>
Hi!

I get a compiler error with this piece of code:


:- pred main1(io::di, io::uo) is det.

main1(!IO) :-
    io.write_string("Parent\n", !IO),
    spawn_ex(yes, "echo", ["Hallo", "Welt"], _Pid, !IO),
    spawn_ex(no, "echo", ["Hallo", "Welt"], _Pid, !IO).


The error message is:


test.m:048: In `main1'(di, uo):
test.m:048:   error: determinism declaration not satisfied.
test.m:048:   Declared `cc_multi', inferred `semidet'.
test.m:048:   The reason for the difference is the following.
test.m:053:   In argument 4 of call to predicate `process.spawn_ex'/6:
test.m:053:   unification with `_Pid' can fail.
test.m:052: In clause for predicate `main1'/2:
test.m:052:   warning: variable `_Pid' occurs more than once in this scope.
test.m:053: In clause for predicate `main1'/2:
test.m:053:   warning: variable `_Pid' occurs more than once in this scope.


After changing the "_Pid" variables to "_", it works.

Cheers,
Volker

_______________________________________________
users mailing list
[email protected]
https://lists.mercurylang.org/listinfo/users
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE6QXGh82Ov3+2nrxp+K4ydFOsHoUFAmP3gVIACgkQ+K4ydFOs
HoWcvhAArnpSsI/vsNtsLIC+EwCDD3beWmTkfpM3yQelbNBfxpi0dSzdggu9sG0E
qPYEtnFSXZOneyGfD/r0Qte2Qfz+UwqBteykSIyWrOMn4/LendxPRCYb3/HBha70
lA80wJnT+3CXWeh+aFYKDW8COYmqHciTe+ySqQY20u+ags46USjbV5XwguB4OslS
3m3918FzAgQO7jYdPRrm0xPXJXQcNEjAWLDoxCbhfOF+6292AbNKli/lejGC9wzA
H0IvCzdozEyPDnHiLEj/fjAaisr5rZNYHOtTqhuXoaJekwVLZNVRW7JDFDMkNb+L
kPwe9JvK2/1AKr2PP1eANGHyxeB/J8hA0fB4Yh8dF+w7gQSOErkl0+kH6uC8967v
KeDwqs4hkaJIJNI7rLBtEMCebnulOXkS6sOxjtdwco3qlC1SQUjluw3c8QpGtiSh
Z5m7RoNhOazUUTURZIg7XHIOncfaQqQPx/344Riw0L/6wWsY20dpqXylMV+bfZ1k
8j6+KioRynVbs0+a9/Hr39TtZ6k9Kr+n8IX0Q7DQ80zih6Yq4MeC18wvgg1qnO/M
QhmbnyGN6x9RGsf391yaI4Jl2UWtWJmtkz5f1z/LJ7F5bCeNUzMUNa9MH3dM7RzG
3qFw3Fbg9YLLq3XDtLWeOg/9/16VFQxxbKf6jAcDGYhJSqZIshQ=
=2TiI
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.