mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-24 05:43:53 +00:00
Estimated hours taken: 1 Branches: main compiler/mercury_to_mercury.m: Fix a bug where class constraints on functions were being written out before the determinism annotation in interface files. tests/valid/Mercury.options: tests/valid/Mmakefile: tests/valid/func_class.m: Add a test case.
21 lines
444 B
Mathematica
21 lines
444 B
Mathematica
:- module func_class.
|
|
|
|
% Class constraints on functions were being written out before the
|
|
% determinism annotation in interface files.
|
|
:- module func_class1.
|
|
:- interface.
|
|
|
|
:- typeclass tc(T) where [].
|
|
:- func f(T) = int is det <= tc(T).
|
|
|
|
:- implementation.
|
|
f(_) = 1.
|
|
|
|
:- end_module func_class1.
|
|
|
|
% Read in the faulty interface file.
|
|
:- module func_class2.
|
|
:- implementation.
|
|
:- import_module func_class.func_class1.
|
|
:- end_module func_class2.
|