Replaced sure() invocations with '!!' operator in codegen tests.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import java.lang.Runtime
|
||||
|
||||
fun box() : String {
|
||||
val processors = Runtime.getRuntime().sure().availableProcessors()
|
||||
val processors = Runtime.getRuntime()!!.availableProcessors()
|
||||
var threadNum = 1
|
||||
while(threadNum <= 1024) {
|
||||
System.out?.println(threadNum)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
public class StockMarketTableModel() {
|
||||
|
||||
public fun getColumnCount() : Int {
|
||||
return COLUMN_TITLES?.size.sure()
|
||||
return COLUMN_TITLES?.size!!
|
||||
}
|
||||
|
||||
class object {
|
||||
|
||||
@@ -6,7 +6,7 @@ fun <T : Any> T?.iterator() = object {
|
||||
fun next() : T {
|
||||
if (hasNext) {
|
||||
hasNext = false
|
||||
return this@iterator.sure()
|
||||
return this@iterator!!
|
||||
}
|
||||
throw java.util.NoSuchElementException()
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ import kotlin.util.*
|
||||
|
||||
class C{
|
||||
public fun foo(){
|
||||
val items : Collection<Item> = java.util.Collections.singleton(Item()).sure()
|
||||
val items : Collection<Item> = java.util.Collections.singleton(Item())!!
|
||||
val result = ArrayList<Item>()
|
||||
val pattern: Pattern? = Pattern.compile("...")
|
||||
items.filterTo(result) {
|
||||
pattern.sure().matcher(it.name()).sure().matches()
|
||||
pattern!!.matcher(it.name())!!.matches()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ abstract class ClassValAbstract {
|
||||
|
||||
fun box() : String {
|
||||
for(m in ClassValAbstract.methods) {
|
||||
if (m.sure().getName() == "getA") {
|
||||
if(m.sure().getModifiers() != 1025)
|
||||
if (m!!.getName() == "getA") {
|
||||
if(m!!.getModifiers() != 1025)
|
||||
return "get failed"
|
||||
}
|
||||
if (m.sure().getName() == "setA") {
|
||||
if(m.sure().getModifiers() != 1025)
|
||||
if (m!!.getName() == "setA") {
|
||||
if(m!!.getModifiers() != 1025)
|
||||
return "set failed"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun box(): String {
|
||||
val c = javaClass<Runnable>()
|
||||
return if(c.getName().sure() == "java.lang.Runnable") "OK" else "fail"
|
||||
return if(c.getName()!! == "java.lang.Runnable") "OK" else "fail"
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class Luhny() {
|
||||
|
||||
private fun printOneDigit() {
|
||||
while (!buffer.isEmpty()) {
|
||||
val c = buffer.removeFirst().sure()
|
||||
val c = buffer.removeFirst()!!
|
||||
print(c)
|
||||
if (c.isDigit()) {
|
||||
digits.removeFirst()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun Int?.inc() = this.sure().inc()
|
||||
fun Int?.inc() = this!!.inc()
|
||||
|
||||
public fun box() : String {
|
||||
var i : Int? = 10
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package demo_range
|
||||
|
||||
fun Int?.rangeTo(other : Int?) : IntRange = this.sure().rangeTo(other.sure())
|
||||
fun Int?.rangeTo(other : Int?) : IntRange = this!!.rangeTo(other!!)
|
||||
|
||||
fun box() : String {
|
||||
val x : Int? = 10
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package bitwise_demo
|
||||
|
||||
fun Long?.shl(bits : Int?) : Long = this.sure().shl(bits.sure())
|
||||
fun Long?.shl(bits : Int?) : Long = this!!.shl(bits!!)
|
||||
|
||||
fun box() : String {
|
||||
val x : Long? = 10
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package demo_range
|
||||
|
||||
fun Int?.plus() : Int = this.sure().plus()
|
||||
fun Int?.dec() : Int = this.sure().dec()
|
||||
fun Int?.inc() : Int = this.sure().inc()
|
||||
fun Int?.minus() : Int = this.sure().minus()
|
||||
fun Int?.plus() : Int = this!!.plus()
|
||||
fun Int?.dec() : Int = this!!.dec()
|
||||
fun Int?.inc() : Int = this!!.inc()
|
||||
fun Int?.minus() : Int = this!!.minus()
|
||||
|
||||
fun box() : String {
|
||||
val x : Int? = 10
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package demo_long
|
||||
|
||||
fun Long?.inv() : Long = this.sure().inv()
|
||||
fun Long?.inv() : Long = this!!.inv()
|
||||
|
||||
fun box() : String {
|
||||
val x : Long? = 10
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun <T> Array<T>?.get(i : Int?) = this.sure().get(i.sure())
|
||||
fun <T> Array<T>?.get(i : Int?) = this!!.get(i!!)
|
||||
fun <T> array(vararg t : T) : Array<T> = t
|
||||
|
||||
fun box() : String {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.ArrayList
|
||||
|
||||
fun Int.plus(a: Int?) = this + a.sure()
|
||||
fun Int.plus(a: Int?) = this + a!!
|
||||
|
||||
public open class PerfectNumberFinder() {
|
||||
open public fun isPerfect(number : Int) : Boolean {
|
||||
|
||||
@@ -5,4 +5,4 @@ fun box() : String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
val String?.indices : IntRange get() = IntRange(0, this.sure().length)
|
||||
val String?.indices : IntRange get() = IntRange(0, this!!.length)
|
||||
Reference in New Issue
Block a user