This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* allow to define callback wrappers that are protected from accidental multiple calls to resume/resumeWithException | |
* Created by daely on 3/30/2017. | |
*/ | |
class WrappedContinuation<T>(val c: Continuation<T>) : Continuation<T> { | |
var isResolved = false | |
override val context: CoroutineContext | |
get() = c.context | |
override fun resume(value: T) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun thisFunctionThrows() { | |
val a="aa" | |
a.let { | |
if(a!="aa") //<---------------- | |
throw IllegalArgumentException() | |
} | |
} | |
fun thisFunctionDoesNotThrows() { | |
val a="aa" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IntArray2D: Cloneable | |
{ | |
val xsize:Int | |
val ysize:Int | |
val _array:IntArray | |
constructor(xsize:Int, ysize:Int){ | |
this.xsize=xsize | |
this.ysize=ysize | |
_array = IntArray(xsize*ysize) | |
} |