[Nice-commit] Nice/src/mlsub/typing Typing.java,1.38,1.39
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-03-24 23:55:06
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2614/src/mlsub/typing Modified Files: Typing.java Log Message: When checking polytype <: monotype, do not rigidify, since there are no need type variables introduced before. This should be slightly faster, and most importantly it allows existential type variables to be further constrained. This also means that we should _not_ discard changes after the test. Index: Typing.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Typing.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Typing.java 24 Mar 2004 14:02:11 -0000 1.38 --- Typing.java 24 Mar 2004 23:44:24 -0000 1.39 *************** *** 301,307 **** try{ ! Constraint.enter(t2.getConstraint()); ! implies(); Constraint.enter(t1.getConstraint()); --- 301,310 ---- try{ ! if (! t2.isMonomorphic()) ! { ! Constraint.enter(t2.getConstraint()); ! implies(); ! } Constraint.enter(t1.getConstraint()); *************** *** 327,342 **** Debug.println("Polytype leq: "+t1+" <: "+m2); ! // The additions we are going to make should be discarded at the end, ! // so as not to influence existential type variables in the context. ! int l = enter(true); try{ - implies(); - Constraint.enter(t1.getConstraint()); leq(t1.getMonotype(), m2); } finally{ ! if(leave(true, false) != l) throw new InternalError("Unmatched enters and leaves"); } --- 330,341 ---- Debug.println("Polytype leq: "+t1+" <: "+m2); ! int l = enter(); try{ Constraint.enter(t1.getConstraint()); leq(t1.getMonotype(), m2); } finally{ ! if(leave() != l) throw new InternalError("Unmatched enters and leaves"); } |