Skip to content

Instantly share code, notes, and snippets.

@alaershov
Created March 26, 2020 12:06
Show Gist options
  • Save alaershov/058e9d8ec4697703e65a40333e9e885e to your computer and use it in GitHub Desktop.
Save alaershov/058e9d8ec4697703e65a40333e9e885e to your computer and use it in GitHub Desktop.
Property init with when
// 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