Files
mercury/tests/valid/nasty_func_test.m
Fergus Henderson 35887c31d2 Move nasty_func_test.m from tests/hard_coded to tests/valid
Estimated hours taken: 0.25

Move nasty_func_test.m from tests/hard_coded to tests/valid
(since it isn't a complete program) and then enable it.
1996-12-11 00:03:03 +00:00

15 lines
569 B
Mathematica

% This test case shows up an obscure bug in the compiler.
% The compiler reports spurious mode errors in the compiler-generated
% unification/compare/index predicates.
% It's not clear whether or not this code is legal, but at very
% least the compiler ought to issue a better error message.
% If you write obfuscated code like this, you really deserve
% what you get, but I guess we should fix the bug someday anyway...
% for the moment, I'll file the bug report and forget it.
:- module nasty_func_test.
:- type foo ---> f(int) ; g.
:- func f(int) = foo.
f(_) = g.