Load special java methods as properites

Currently only those that override special builtin properties (e.g. `Collection.size`)
Their modality is defined by method's modality
This commit is contained in:
Denis Zharkov
2015-10-02 18:34:19 +03:00
parent a02b64f0e3
commit 547aa2cda6
36 changed files with 341 additions and 39 deletions
@@ -105,3 +105,11 @@ public fun String.lastIndexOfOrNull(char: Char, startIndex: Int = 0, ignoreCase:
val index = lastIndexOf(char, startIndex, ignoreCase)
return if (index >= 0) index else null
}
inline fun <T, R : Any> Iterable<T>.firstNotNullResult(transform: (T) -> R?): R? {
for (element in this) {
val result = transform(element)
if (result != null) return result
}
return null
}