Mercury Bugs - mercury
View Issue Details
0000271mercuryBugpublic2012-12-31 12:032013-06-28 15:44
Assigned Topbone 
Platformx86_64OSLinuxOS VersionDebian 6.0.6
Product Version 
Target VersionFixed in Version 
Summary0000271: Polymorphism related compiler crash.
DescriptionSome MCit code crashes the polymorphism pass of the the compiler. This occurs on both the 12.08 and main branches.
Steps To ReproduceI'll put together a small test case.
TagsNo tags attached.
related to 0000187confirmed juliensf Strange error with disjunctive definitions returning existential typeclass instance 
Attached Files? bug271.m (1,082) 2013-01-04 11:52

2013-01-04 11:53   
Bug271 is caused by the handling of multiple typeclass infos for the same
    type where existentially typed variables are also present. When the
    compiler knows that a typeclass info value is a constant it is allocated
    statically on backends that support this. When the typeclass info value is
    seen a second time (on any execution path) the previously created static
    value is used for the typeclass info. However, if a predicate call's
    arguments include both a constrained universally quantified variable, and an
    existentially quantified variable, then polymorphism.m attempts to create a
    new value, regardless of whether there is an existing value. When it
    records the new value in the table of constant typeclass instance values, it
    crashes as this key is already present.
2013-05-22 13:10   
A fix for this was committed to the master and 13.05 branches some time ago.

Issue History
2012-12-31 12:03pboneNew Issue
2012-12-31 12:03pboneStatusnew => assigned
2012-12-31 12:03pboneAssigned To => pbone
2013-01-04 11:52pboneFile Added: bug271.m
2013-01-04 11:53pboneNote Added: 0000490
2013-05-22 13:10pboneNote Added: 0000524
2013-05-22 13:10pboneStatusassigned => closed
2013-05-22 13:10pboneResolutionopen => fixed
2013-06-28 15:44pboneRelationship addedrelated to 0000187