[project @ 1999-12-20 10:12:50 by simonpj]
[ghc-hetmet.git] / ghc / interpreter / static.c
index 282650d..1a20f20 100644 (file)
@@ -9,8 +9,8 @@
  * included in the distribution.
  *
  * $RCSfile: static.c,v $
- * $Revision: 1.18 $
- * $Date: 1999/11/29 18:59:30 $
+ * $Revision: 1.20 $
+ * $Date: 1999/12/10 15:59:50 $
  * ------------------------------------------------------------------------*/
 
 #include "prelude.h"
@@ -1758,7 +1758,11 @@ Cell ty;                         /* used in type expression, reading*/
 List us;                               /* from left to right ignoring any */
 List ws;                               /* listed in us.                   */
 List vs; {                             /* ws = explicitly quantified vars */
+    if (isNull(ty)) return vs;
     switch (whatIs(ty)) {
+        case DICTAP    : return typeVarsIn(snd(snd(ty)),us,ws,vs);
+        case UNBOXEDTUP: return typeVarsIn(snd(ty),us,ws,vs);
+
        case AP        : return typeVarsIn(snd(ty),us,ws,
                                           typeVarsIn(fst(ty),us,ws,vs));
 
@@ -1785,8 +1789,14 @@ List vs; {                               /* ws = explicitly quantified vars */
                             }
                             return vs;
                         }
+        case TUPLE:
+        case TYCON:
+        case CONIDCELL:
+        case QUALIDENT: return vs;
+
+        default: fprintf(stderr, " bad tag = %d\n", whatIs(ty));internal("typeVarsIn");
     }
-    return vs;
+    assert(0);
 }
 
 static List local maybeAppendVar(v,vs) /* append variable to list if not   */
@@ -5025,7 +5035,8 @@ Void checkDefns() {                     /* Top level static analysis       */
     }
     mapProc(checkImportList, unqualImports);
 
-    linkPreludeTC();                    /* Get prelude tycons and classes  */
+    if (!combined) linkPreludeTC();     /* Get prelude tycons and classes  */
+
     mapProc(checkTyconDefn,tyconDefns); /* validate tycon definitions      */
     checkSynonyms(tyconDefns);          /* check synonym definitions       */
     mapProc(checkClassDefn,classDefns); /* process class definitions       */
@@ -5033,7 +5044,8 @@ Void checkDefns() {                     /* Top level static analysis       */
     mapProc(extendFundeps,classDefns);  /* finish class definitions       */
     mapProc(addMembers,classDefns);     /* add definitions for member funs */
     mapProc(visitClass,classDefns);     /* check class hierarchy           */
-    linkPreludeCM();                    /* Get prelude cfuns and mfuns     */
+
+    if (!combined) linkPreludeCM();     /* Get prelude cfuns and mfuns     */
     
     instDefns = rev(instDefns);         /* process instance definitions    */
     mapProc(checkInstDefn,instDefns);
@@ -5049,7 +5061,7 @@ Void checkDefns() {                     /* Top level static analysis       */
 
     mapProc(allNoPrevDef,valDefns);     /* check against previous defns    */
 
-    linkPreludeNames();
+    if (!combined) linkPreludeNames();  /* link names in Prelude           */
 
     mapProc(checkForeignImport,foreignImports); /* check foreign imports   */
     mapProc(checkForeignExport,foreignExports); /* check foreign exports   */
@@ -5258,11 +5270,12 @@ Int what; {
 #endif
                        break;
 
-        case INSTALL : staticAnalysis(RESET);
+        case POSTPREL: break;
+
+        case PREPREL : staticAnalysis(RESET);
 #if TREX
                        extKind = pair(STAR,pair(ROW,ROW));
 #endif
-                       break;
     }
 }