mirror of
https://github.com/corda/corda.git
synced 2025-04-11 13:21:26 +00:00
Tactical fix for Explorer crash issue under Kotlin 1.1.1. Original code compiles, but then throws a typecast expression at runtime when trying to process the lambdas.
Update docs
This commit is contained in:
parent
c7e5cf5079
commit
0695374d72
@ -111,8 +111,14 @@ fun <A> ObservableList<out A>.filter(predicate: ObservableValue<(A) -> Boolean>)
|
||||
* val owners: ObservableList<Person> = dogs.map(Dog::owner).filterNotNull()
|
||||
*/
|
||||
fun <A> ObservableList<out A?>.filterNotNull(): ObservableList<A> {
|
||||
//TODO This is a tactical work round for an issue with SAM conversion (https://youtrack.jetbrains.com/issue/ALL-1552) so that the M10 explorer works.
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return filtered { it != null } as ObservableList<A>
|
||||
return (this as ObservableList<A?>).filtered(object : Predicate<A?> {
|
||||
override fun test(t: A?): Boolean {
|
||||
return t != null
|
||||
|
||||
}
|
||||
}) as ObservableList<A>
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user