Last active
March 12, 2019 16:33
-
-
Save shkschneider/87c6be0b34262186c2449ccf66a66ca2 to your computer and use it in GitHub Desktop.
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
fun alwaysReturnsNull(position: Int): String? { | |
if ((position % 10) == 0) { | |
when (position) { | |
10 -> "one" | |
20, 30 -> "two" | |
else -> "three" | |
} | |
} | |
return null | |
} | |
fun returnsNullableString(position: Int): String? { | |
if ((position % 10) == 0) { | |
return when (position) { | |
10 -> "one" | |
20, 30 -> "two" | |
else -> "three" | |
} | |
} | |
return null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment