Created
March 26, 2020 12:06
-
-
Save alaershov/058e9d8ec4697703e65a40333e9e885e to your computer and use it in GitHub Desktop.
Property init with when
This file contains 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
// this is fine | |
class CreateApplicationInteractor { | |
val isApplicationEnabled: Boolean | |
get() = when (BrandConfiguration.brand) { | |
BrandConfiguration.Brand.MY_INTERCOM_FOREIGN -> false | |
else -> true | |
} | |
} | |
// this makes IDE go crazy when I type it | |
class CreateApplicationInteractor { | |
val isApplicationEnabled: Boolean = when (BrandConfiguration.brand) { | |
BrandConfiguration.Brand.MY_INTERCOM_FOREIGN -> false | |
else -> true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment