[Nice-commit] Nice/src/mlsub/typing Typing.java,1.36,1.37 Enumeration.java,1.11,1.12
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-03-23 20:39:12
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24136/src/mlsub/typing Modified Files: Typing.java Enumeration.java Log Message: When doing overloading resolution in existential mode, backtrack when the symbol is not applicable. Index: Enumeration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Enumeration.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Enumeration.java 24 Feb 2004 18:35:26 -0000 1.11 --- Enumeration.java 23 Mar 2004 20:28:43 -0000 1.12 *************** *** 212,216 **** TypeConstructor[] vars = new TypeConstructor[tags.length]; ! Engine.enter(); try{ --- 212,216 ---- TypeConstructor[] vars = new TypeConstructor[tags.length]; ! Engine.enter(false); try{ *************** *** 273,277 **** } finally{ ! Engine.backtrack(); } --- 273,277 ---- } finally{ ! Engine.backtrack(false, false); } Index: Typing.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Typing.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Typing.java 17 Mar 2004 00:36:46 -0000 1.36 --- Typing.java 23 Mar 2004 20:28:43 -0000 1.37 *************** *** 39,46 **** public static int enter() { if(dbg) Debug.println("ENTER "+level); ! Engine.enter(); return level++; } --- 39,55 ---- public static int enter() { + return enter(false); + } + + /** + @param tentative when true, we will decide upon leaving if we want to + commit the changes made to existential type variables or not. + */ + public static int enter(boolean tentative) + { if(dbg) Debug.println("ENTER "+level); ! Engine.enter(tentative); return level++; } *************** *** 99,102 **** --- 108,122 ---- throws TypingEx { + return leave(false, false); + } + + /** + @param tentative must match the parameter used when entering + @param commit if tentative is true, then commit selects whether we + want to commit the changes made to existential type variables or not. + */ + public static int leave(boolean tentative, boolean commit) + throws TypingEx + { if(dbg) Debug.println("LEAVE "+(level-1)); *************** *** 104,108 **** try{ level--; ! Engine.leave(); } catch(Unsatisfiable e){ --- 124,128 ---- try{ level--; ! Engine.leave(tentative, commit); } catch(Unsatisfiable e){ |