[project @ 2000-03-09 06:14:38 by andy]
[ghc-hetmet.git] / ghc / interpreter / type.c
index fec44e1..744597a 100644 (file)
@@ -9,8 +9,8 @@
  * included in the distribution.
  *
  * $RCSfile: type.c,v $
- * $Revision: 1.24 $
- * $Date: 2000/03/06 08:38:05 $
+ * $Revision: 1.27 $
+ * $Date: 2000/03/07 09:34:43 $
  * ------------------------------------------------------------------------*/
 
 #include "prelude.h"
@@ -1963,6 +1963,7 @@ Inst in; {                              /* member functions for instance in*/
     /* Invent a GHC-compatible name for the instance decl */
     {
        char buf[FILENAME_MAX+1];
+       char buf2[10];
        Int           i, j;
        String        str;
        Cell          qq      = inst(in).head;
@@ -1983,12 +1984,15 @@ Inst in; {                              /* member functions for instance in*/
        for (j = 0; i<FILENAME_MAX && str[j]!='\0'; i++, j++) {
           buf[i] = str[j];
        }
-       for (; nonNull(pp); pp=tl(pp)) {
+       if (nonNull(pp)) {
           qq = hd(pp);
           while (isAp(qq)) qq = fun(qq);
           switch (whatIs(qq)) {
-             case TYCON: str = textToStr(tycon(qq).text); break;
-             case TUPLE: str = textToStr(ghcTupleText(qq)); break;
+             case TYCON:  str = textToStr(tycon(qq).text); break;
+             case TUPLE:  str = textToStr(ghcTupleText(qq)); break;
+             case OFFSET: sprintf(buf2,"%d",offsetOf(qq)); 
+                          str = buf2;
+                          break;
              default: internal("typeInstDefn: making GHC name"); break;
           }
           for (j = 0; i<FILENAME_MAX && str[j]!='\0'; i++, j++) {