(0000546)
|
juliensf
|
2013-06-28 14:55
(Last edited: 2013-06-28 14:57) |
|
The problem here is that polymorphism transforms the multi-clause version into the following:
% Clause 1.
test.f(TypeClassInfo_for_foo_3, HeadVar__1_1) = HeadVar__2_2 :-
(
( HeadVar__1_1 = test.x,
HeadVar__2_2 = test.a
),
TypeClassInfo_for_foo_4 = typeclass_info_const(0),
TypeClassInfo_for_foo_3 = TypeClassInfo_for_foo_4
).
% Clause 2
test.f(TypeClassInfo_for_foo_3, HeadVar__1_1) = HeadVar__2_2 :-
(
(
HeadVar__1_1 = test.y,
HeadVar__2_2 = test.b
),
TypeClassInfo_for_foo_3 = TypeClassInfo_for_foo_4
).
In the second clause TypeClassInfo_for_foo_4 is free. It should presumably have been pointed
at typeclass_info_const(0) as in the first clause, but that hasn't happened for some reason.
(Possibly, the mapping of typeclass_infos to static data is being maintained across clauses, so it thinks
that it has already introduced the unification with the constant when it processes the second clause.)
(A workaround here is to re-write the predicate with a single clause -- as mentioned in the original bug report -- since polymorphism will process that in one go and the issue won't arise.)
|
|