Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun main(args: Array<String>) {
- val current = Test(null, "foobar")
- val ret = with(current) {
- when {
- left != null && right != null -> null
- left != null -> 1
- right != null -> 2
- else -> 3
- }
- }
- println(ret)
- }
- class Test(
- val left: Any?,
- val right: Any?
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement