[Nice-commit] Nice/testsuite/compiler/expressions/arrays literal.testsuite,1.10,1.11 compilation.tes
Brought to you by:
bonniot
From: <bo...@us...> - 2004-02-11 12:50:47
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5377/testsuite/compiler/expressions/arrays Modified Files: literal.testsuite compilation.testsuite Log Message: Use more typing information from the context when deciding what bytecode types to use for literal arrays and tuples, especially when they are nested inside other literal arrays or tuples. This allows to generate more efficient code, and fixes several runtime errors (fixes #761629 and #892625). Index: literal.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays/literal.testsuite,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** literal.testsuite 9 Feb 2004 12:25:58 -0000 1.10 --- literal.testsuite 11 Feb 2004 12:46:38 -0000 1.11 *************** *** 41,42 **** --- 41,55 ---- /// Toplevel var String[][][] s = [[["A"]]]; + + /// PASS + Object[][][] s = [[["A"]]]; + s[0] = [[ new Object() ]]; + + /// PASS + sizes([[1,2,3],[4,5,6]]); + /// TOPLEVEL + <T> void sizes (List<List<T>> lists) + { + int i; + lists.foreach(List<T> list => i = list.size); + } Index: compilation.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays/compilation.testsuite,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** compilation.testsuite 10 Feb 2004 15:05:18 -0000 1.9 --- compilation.testsuite 11 Feb 2004 12:46:39 -0000 1.10 *************** *** 86,98 **** assert x.equals("xyz") && arr[0].equals("xyz") && arr[1].equals("pqr"); ! /// PASS bug List<List<int>> x = [[1,2,3]]; int i = x[0][1]; ! /// PASS bug (List<int>, String) x = ([1,2,3], "abc"); (List<int> arr, String str) = x; ! /// PASS bug (int[], int[]) t1 = ([1, 2], [3, 4]); (List<int>, List<int>) t2 = t1; --- 86,108 ---- assert x.equals("xyz") && arr[0].equals("xyz") && arr[1].equals("pqr"); ! /// PASS List<List<int>> x = [[1,2,3]]; int i = x[0][1]; ! /// PASS ! let List<(List<byte>, String)> a = [([1,2,3], "Hello")]; ! (List<byte> l1, String s1) = a[0]; ! ! /// PASS (List<int>, String) x = ([1,2,3], "abc"); (List<int> arr, String str) = x; ! /// PASS ! List<String>[] x0 = [["A","B","C"]]; ! List<List<String>> x = x0; ! List<String> l = x0[0]; ! String s = l[1]; ! ! /// PASS (int[], int[]) t1 = ([1, 2], [3, 4]); (List<int>, List<int>) t2 = t1; *************** *** 103,109 **** /// PASS bug ((int[], String) , String) t1 = (([1, 2], "abc"), "xyz"); ! ((List<int>, String), String) t2 = t1; ! ((List<int>, String) t3, String s1) = t2; ! (List<int> la, String s2) = t3; ! assert la[0] == 1; ! assert la[1] == 2; --- 113,119 ---- /// PASS bug ((int[], String) , String) t1 = (([1, 2], "abc"), "xyz"); ! ((List<int>, String), String) t2 = t1; ! ((List<int>, String) t3, String s1) = t2; ! (List<int> la, String s2) = t3; ! assert la[0] == 1; ! assert la[1] == 2; |