Mercury Bugs - mercury
View Issue Details
0000027mercuryBugpublic2007-11-12 15:352007-11-14 15:02
Reporterrafe 
Assigned Tojuliensf 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000027: Type var in instance declaration can cause compiler to crash
DescriptionThe compiler crashes when compiling the following code:

:- module instance_var_bug.
:- interface.
:- typeclass tc(T) where [ pred p(T::in) is semidet ].
:- implementation.
:- instance tc(V) where [ p(_) :- semidet_true ].

The bug is that the instance argument is a variable, but this is not being caught.
TagsNo tags attached.
Attached Files

Notes
(0000048)
juliensf   
2007-11-12 16:11   
The compiler is checking that the instance declarations don't contain
type variables. The problem is that it doesn't do this check until
*after* the code that causing this abort is executed. Fixing this
should just be a matter of either re-ordering some of the checks in
compiler/check_typeclass.m.
(0000051)
juliensf   
2007-11-14 15:02   
Fixed. See r1.116 of compiler/check_typeclass.m for details.

Issue History
2007-11-12 15:35rafeNew Issue
2007-11-12 16:11juliensfNote Added: 0000048
2007-11-12 16:11juliensfAssigned To => juliensf
2007-11-12 16:11juliensfStatusnew => assigned
2007-11-14 15:02juliensfStatusassigned => resolved
2007-11-14 15:02juliensfResolutionopen => fixed
2007-11-14 15:02juliensfNote Added: 0000051