Files
mercury/tests/invalid/errors2.m
Fergus Henderson b7ce625178 Rename *.nl as *.m.
tests/invalid:
	Rename *.nl as *.m.
1995-07-11 13:12:09 +00:00

76 lines
1.4 KiB
Mathematica

%-----------------------------------------------------------------------------%
:- module errors2.
%-----------------------------------------------------------------------------%
:- pred bind_type_param(TypeParam::input, TypeParam2::output).
bind_type_param(Argument) :-
Argument = 0.
%-----------------------------------------------------------------------------%
% NOT an error.
:- pred unresolved_polymorphism.
unresolved_polymorphism :-
bind_type_param(Arg, Arg).
%-----------------------------------------------------------------------------%
:- pred produce_string(string).
:- pred expect_int(int).
:- pred type_error.
type_error :-
produce_string(X),
expect_int(X).
:- pred type_error_2.
type_error_2 :-
produce_string(X),
expect_int(Y),
X = Y.
:- pred type_error_3.
type_error_3 :-
X = Y,
produce_string(X),
expect_int(Y).
:- type foo_type ---> foo_functor(int, character, string).
:- type bar_1_type ---> bar_functor(int, character, string).
:- type bar_2_type ---> bar_functor(character, int, string).
:- pred type_error_4.
type_error_4 :-
Y = 0,
X = foo_functor(Y, 'x', 1.0).
:- pred type_error_5.
:- type foo ---> a ; b ; c.
type_error_5 :-
Y = 'a',
X = foo_functor(0, Y, 1.0).
:- pred type_error_6.
type_error_6 :-
Y = 'a',
X = bar_functor(0, Y, 1.0).
:- pred type_error_7.
type_error_7 :-
Y = 'a',
Z = bar_functor(A, B, C),
expect_int(C).
%-----------------------------------------------------------------------------%