rook
03/25/2019, 4:13 PMinfix
functions that allows the left side to be implied by the context? For example, in apply
Dias
03/25/2019, 4:26 PMinfix fun <T: Any> T.test(other: Any) {
}
?Ruckus
03/25/2019, 4:28 PMinfix fun String.test(other: String) {
...
}
"A".apply {
test "B"
}
Then no, it's not possible.Alowaniak
03/25/2019, 4:37 PMrook
03/25/2019, 4:58 PMcho
03/26/2019, 12:35 AMinfix fun String.isSameAs(other: String): Boolean = (this == other).also { println(it) }
"SomeString".apply {
isSameAs("Foo")
isSameAs(this)
}
prints false
then true