Files
mercury/tests/valid/instance_unconstrained_tvar.m
David Jeffery 51f11d354e When building the type-infos to be packaged inside a typeclass-info,
compiler/polymorphism.m:
        When building the type-infos to be packaged inside a typeclass-info,
        apply the variable type bindings first.

tests/valid/instance_unconstrained_tvar.m:
        Test case for this.
tests/valid/Mmakefile:
        Turn this test on. Also turn another test on which I mistakenly
        turned off in my previous commit (because the test was failing).
1998-06-19 00:43:17 +00:00

26 lines
530 B
Mathematica

:- module instance_unconstrained_tvar.
:- interface.
:- import_module list.
:- typeclass c1(T) where [ ].
:- typeclass c2(T) <= c1(T) where [ ].
:- instance c1(list(T)) where [ ].
:- instance c2(list(T)) where [ ].
:- pred p is det.
:- implementation.
% The bug that this test case is checking for is at the creation of
% the typeclass info for this call, when creating the type-info the
% the int (1), the type bindings were not being applied properly.
p :- q([1]).
:- pred q(T) <= c2(T).
:- mode q(in) is det.
q(_).