[Nice-commit] Nice/testsuite/compiler/typing inference.testsuite,1.5,1.6
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-03-24 23:55:05
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2614/testsuite/compiler/typing Modified Files: inference.testsuite 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: inference.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/inference.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** inference.testsuite 24 Mar 2004 14:02:10 -0000 1.5 --- inference.testsuite 24 Mar 2004 23:44:24 -0000 1.6 *************** *** 108,112 **** } ! /// PASS bug let L1 = new LinkedList(); for (var j = 1; j <= 10; j++) L1.add(j); --- 108,112 ---- } ! /// PASS let L1 = new LinkedList(); for (var j = 1; j <= 10; j++) L1.add(j); *************** *** 141,142 **** --- 141,168 ---- for(s : testmap.keySet()) println(s + " => " + testmap[s]); + + /// PASS + let testmap = new HashMap(); + for(s : ["1", "2", "3"]) + testmap[s] = Integer.parseInt(s); + for(String s : testmap.keySet()) + println(s + " => " + testmap[s]); + + /// PASS + let l = new ArrayList(); + (List<String> l0, List<String> l1) = foo(l); + /// Toplevel + <T,U | U <: T> (List<T>,List<U>) foo(List<U> x) = (new ArrayList(x), x); + + /// FAIL + let l = new ArrayList(); + (List<String> l0, List<String> l1) = foo(l); + /*/// FAIL HERE */ (List<Number> l2, List<Number> l3) = foo(l); + + /* Without failure above, then we could do: + l1.add(""); + Number n = l3.get(0); // Bang! + */ + + /// Toplevel + <T,U | U <: T> (List<T>,List<U>) foo(List<U> x) = (new ArrayList(x), x); |