Commit 48fd138c authored by sewardj's avatar sewardj
Browse files

[project @ 2000-01-07 17:49:29 by sewardj]

type.c: implement typechecker(POSTPREL), so that initialisation
    of the typechecker is completed correctly in combined mode.
storage.c(addTupleTycon): create a name table entry for () so that
    nameUnit in the above can be bound to something.
parent 8239cf96
......@@ -9,8 +9,8 @@
* included in the distribution.
*
* $RCSfile: link.c,v $
* $Revision: 1.26 $
* $Date: 2000/01/06 16:33:10 $
* $Revision: 1.27 $
* $Date: 2000/01/07 17:49:29 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
......@@ -490,11 +490,10 @@ Int what; {
break;
case POSTPREL:
#if 0
#if 1
fprintf(stderr, "linkControl(POSTPREL)\n");
#endif
if (combined) assert(0);
break;
break;
case PREPREL :
......
......@@ -9,8 +9,8 @@
* included in the distribution.
*
* $RCSfile: storage.c,v $
* $Revision: 1.32 $
* $Date: 2000/01/07 16:56:47 $
* $Revision: 1.33 $
* $Date: 2000/01/07 17:49:29 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
......@@ -803,10 +803,11 @@ Name addWiredInBoxingTycon
Tycon addTupleTycon ( Int n )
{
Int i;
Kind k;
Tycon t;
Int i;
Kind k;
Tycon t;
Module m;
Name nm;
for (i = TYCMIN; i < tyconHw; i++)
if (tycon(i).tuple == n) return i;
......@@ -822,6 +823,13 @@ Tycon addTupleTycon ( Int n )
tycon(t).kind = k;
tycon(t).tuple = n;
tycon(t).what = DATATYPE;
if (n == 0) {
/* maybe we want to do this for all n ? */
nm = newName(ghcTupleText_n(n), t);
name(nm).type = t; /* ummm ... for n > 0 */
}
return t;
}
......
......@@ -9,8 +9,8 @@
* included in the distribution.
*
* $RCSfile: type.c,v $
* $Revision: 1.20 $
* $Date: 1999/12/16 16:34:46 $
* $Revision: 1.21 $
* $Date: 2000/01/07 17:49:29 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
......@@ -2795,7 +2795,20 @@ Int what; {
mark(typeProgIO);
break;
case POSTPREL: break;
case POSTPREL:
if (combined) {
setCurrModule(modulePrelude);
dummyVar = inventVar();
typeUnit = mkTuple(0);
arrow = fn(aVar,bVar);
listof = ap(typeList,aVar);
boundPair = ap(ap(mkTuple(2),aVar),aVar);
nameUnit = findQualNameWithoutConsultingExportList
(mkQVar(findText("PrelBase"),
findText("()")));
}
break;
case PREPREL :
typeChecker(RESET);
......@@ -2834,8 +2847,11 @@ Int what; {
starToStar = simpleKind(1);
typeUnit = addPrimTycon(findText("()"),
STAR,0,DATATYPE,NIL);
typeUnit = //addPrimTycon(findText("()"),
// STAR,0,DATATYPE,NIL);
findTycon(findText("()"));
assert(nonNull(typeUnit));
typeArrow = addPrimTycon(findText("(->)"),
simpleKind(2),2,
DATATYPE,NIL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment