[Nice-commit] Nice/src/mlsub/typing/lowlevel Engine.java,1.27,1.28
Brought to you by:
bonniot
From: <bo...@us...> - 2003-12-12 19:24:56
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1:/tmp/cvs-serv24923/src/mlsub/typing/lowlevel Modified Files: Engine.java Log Message: Make sure that type variables that have been deconstructed are correctly recognized as rigid. Index: Engine.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Engine.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Engine.java 3 Dec 2003 21:50:41 -0000 1.27 --- Engine.java 12 Dec 2003 19:24:53 -0000 1.28 *************** *** 42,45 **** --- 42,46 ---- if(dbg) Debug.println("Enter"); floating.mark(); + soft.mark(); frozenLeqs.mark(); for(Iterator i = constraints.iterator(); *************** *** 133,136 **** --- 134,138 ---- } floating.backtrack(); + soft.backtrack(); for(Iterator i = floating.iterator();i.hasNext();) ((Element)i.next()).setKind(null); *************** *** 280,284 **** else { ! e.setId(FLOATING); // for debugging purposes floating.add(e); } --- 282,286 ---- else { ! e.setId(FLOATING); floating.add(e); } *************** *** 286,289 **** --- 288,292 ---- private static final int FLOATING = -3; + private static final int RIGID = -4; public static boolean isRigid(Element e) *************** *** 432,435 **** --- 435,440 ---- floating.remove(e); + if (e.getId() == FLOATING) + soft.add(e); // Propagates the kind to all comparable elements *************** *** 529,532 **** --- 534,549 ---- { try{ + for (Iterator i = soft.iterator(); i.hasNext();) + { + Element e = (Element) i.next(); + e.setId(RIGID); + } + } + finally{ + soft.endOfIteration(); + } + soft.clear(); + + try { for(Iterator i = floating.iterator(); i.hasNext();) *************** *** 536,540 **** // useful for nullness head on monotype vars if (e.getKind() != null) ! continue; if(dbg) Debug.println("Registering variable "+e); --- 553,557 ---- // useful for nullness head on monotype vars if (e.getKind() != null) ! continue; if(dbg) Debug.println("Registering variable "+e); *************** *** 599,602 **** --- 616,622 ---- /** The elements that have not yet been added to a Kind */ private static final BackableList floating = new BackableList(); + + /** The elements that have not yet been rigidified. */ + private static final BackableList soft = new BackableList(); /** The constraint of monotype variables */ |