mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 10:53:40 +00:00
27 lines
564 B
Mathematica
27 lines
564 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module quant_constraint_2.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- typeclass c1(T1) where [].
|
|
|
|
% Error: T is existentially quantified, but appears in a universal
|
|
% constraint.
|
|
%
|
|
:- some [T] (func q = T <= c1(T)).
|
|
|
|
:- implementation.
|
|
|
|
:- instance c1(int) where [].
|
|
|
|
q = 1.
|
|
|
|
main(!IO) :-
|
|
X = q,
|
|
io.write_line(X, !IO).
|