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
Dagger 2.11 initial setup example |
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 _Ternary<out T>(val condition: Boolean, val ifTrue: T) | |
infix fun <T> Boolean.then(ifTrue: T): _Ternary<T> = _Ternary(this, ifTrue) | |
infix fun <T> _Ternary<T>.otherwise(ifFalse: T): T = if (condition) ifTrue else ifFalse | |
const val tellMeTheTruth: Boolean = true | |
val result: String = tellMeTheTruth then "I'll believe you" otherwise "I'll never trust you" |