[Nice-commit] Nice/src/mlsub/typing Enumeration.java,1.19,1.20
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2005-05-26 15:22:18
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10965/src/mlsub/typing Modified Files: Enumeration.java Log Message: Avoid looking setting kinds for Object when it's not used, as we already know there is some solution. Index: Enumeration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Enumeration.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Enumeration.java 26 May 2005 12:25:46 -0000 1.19 --- Enumeration.java 26 May 2005 15:22:06 -0000 1.20 *************** *** 138,143 **** if (tag.getKind() == TopMonotype.TopKind.instance) { ! // Tag is "Object". All TCs are solutions. ! tag = tags[minFloating] = new MonotypeVar("enumeration"); } else --- 138,152 ---- if (tag.getKind() == TopMonotype.TopKind.instance) { ! if (all[minFloating]) ! // Tag is "Object". All TCs are solutions. ! tag = tags[minFloating] = new MonotypeVar("enumeration"); ! else ! { ! // We only want one solution anyway, which surely exists ;-) ! // No need to set kinds ! // recursive call ! setFloatingKinds(tags, all, minFloating + 1, res, doAll); ! return; ! } } else *************** *** 156,160 **** { if(linkDbg && Typing.dbg) ! Debug.println("Choosing kind " + c + " for " + tag); if (tag instanceof MonotypeVar) --- 165,169 ---- { if(linkDbg && Typing.dbg) ! Debug.println("Choosing kind " + c + " for " + minFloating + ":" + tag); if (tag instanceof MonotypeVar) *************** *** 165,168 **** --- 174,178 ---- // recursive call setFloatingKinds(tags, all, minFloating + 1, res, doAll); + tag.setKind(null); } *************** *** 217,221 **** for(int i = 0;i<tags.length;i++) { ! Engine.Constraint k = Engine.getConstraint(tags[i].getKind()); BitVector obs; --- 227,237 ---- for(int i = 0;i<tags.length;i++) { ! Kind kind = tags[i].getKind(); ! ! if (kind == TopMonotype.TopKind.instance) ! continue; ! ! Engine.Constraint k = Engine.getConstraint(kind); ! BitVector obs; |