Update of /cvsroot/nice/Nice/src/mlsub/typing
In directory sc8-pr-cvs1:/tmp/cvs-serv1807/src/mlsub/typing
Modified Files:
MonotypeVar.java
Log Message:
Made Object a super-type of every monotype.
Index: MonotypeVar.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/mlsub/typing/MonotypeVar.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** MonotypeVar.java 1 Mar 2003 01:07:53 -0000 1.14
--- MonotypeVar.java 3 Dec 2003 21:50:41 -0000 1.15
***************
*** 138,141 ****
--- 138,148 ----
}
+ /** Allows modifying the existing kind. Use in special cases only. */
+ public void resetKind(Kind value)
+ {
+ setKind(null);
+ setKind(value);
+ }
+
public void setPersistentKind(Kind k)
{
***************
*** 210,214 ****
if (equivalent != null)
equivalent.tag(variance);
! else
mlsub.typing.lowlevel.Engine.tag(this, variance);
}
--- 217,222 ----
if (equivalent != null)
equivalent.tag(variance);
! // A type var with kind TopKind will be equivalent to Top, no need to tag.
! else if (kind != TopMonotype.TopKind.instance)
mlsub.typing.lowlevel.Engine.tag(this, variance);
}
***************
*** 218,221 ****
--- 226,232 ----
if (equivalent != null)
return equivalent.canonify();
+ // A type var with kind TopKind is equivalent to Top.
+ else if (kind == TopMonotype.TopKind.instance)
+ return TopMonotype.instance;
else
return (MonotypeVar) mlsub.typing.lowlevel.Engine.canonify(this);
|