replace .sure with !!

This commit is contained in:
Stepan Koltsov
2012-05-02 00:01:04 +04:00
parent d5d05d76f3
commit 427afefce4
2 changed files with 3 additions and 3 deletions
@@ -14,5 +14,5 @@ var <T> ArrayList<T>.length : Int
set(value: Int) = throw java.lang.Error()
var <T> ArrayList<T>.last : T
get() = get(size()-1).sure()
get() = get(size()-1)!!
set(el : T) { set(size()-1, el) }
@@ -246,7 +246,7 @@ public class ArrayGenTest extends CodegenTestCase {
public void testCollectionAssignGetMultiIndex () throws Exception {
loadText("import java.util.ArrayList\n" +
"fun box() : String { val s = ArrayList<String>(1); s.add(\"\"); s [1, -1] = \"5\"; s[2, -2] += \"7\"; return s[2,-2] }\n" +
"fun ArrayList<String>.get(index1: Int, index2 : Int) = this[index1+index2].sure()\n" +
"fun ArrayList<String>.get(index1: Int, index2 : Int) = this[index1+index2]!!\n" +
"fun ArrayList<String>.set(index1: Int, index2 : Int, elem: String) { this[index1+index2] = elem }\n");
// System.out.println(generateToText());
Method foo = generateFunction("box");
@@ -266,7 +266,7 @@ public class ArrayGenTest extends CodegenTestCase {
public void testCollectionGetMultiIndex () throws Exception {
loadText("import java.util.ArrayList\n" +
"fun box() : String { val s = ArrayList<String>(1); s.add(\"\"); s [1, -1] = \"5\"; return s[2, -2] }\n" +
"fun ArrayList<String>.get(index1: Int, index2 : Int) = this[index1+index2].sure()\n" +
"fun ArrayList<String>.get(index1: Int, index2 : Int) = this[index1+index2]!!\n" +
"fun ArrayList<String>.set(index1: Int, index2 : Int, elem: String) { this[index1+index2] = elem }\n");
// System.out.println(generateToText());
Method foo = generateFunction("box");