myanmarking
06/19/2017, 5:09 PMelizarov
06/19/2017, 7:30 PMiex
06/19/2017, 9:47 PMshiraji
06/19/2017, 11:11 PMval bar = foo ?: {
println("foo is null!")
return // return for block? return for what??? I don't know.
}
Is there any discussion about this? or no one interested having this feature? I know Kotlin can do this but still I want to have a block after elvis.
val bar = foo ?: return println("foo is null!")
val bar2 = foo2 ?: return someReturnUnitMethod()
dmcg
06/20/2017, 8:24 AMgildor
06/20/2017, 10:38 AMwords.map { word ->
findMatches(word, wordsSet).map { "$word -> $it" }
}
or
words.map { word ->
findMatches(word, wordsSet)
.map { "$word -> $it" }
}
phplego
06/20/2017, 10:38 AMmg6maciej
06/20/2017, 1:13 PMval z: Int
init {
fun x() {
z = 2
}
z = 1
x()
}
Is this already reported? Shouldn't compile imho.Sudhir Singh Khanger
06/20/2017, 2:33 PMkarelpeeters
06/20/2017, 5:43 PMreturn if (resource != null) something(resource) else null
using some of the null-safety operators?chb0kotlin
06/20/2017, 8:10 PMtschuchort
06/20/2017, 8:43 PMbindView
from the kotterknife library.liminal
06/21/2017, 4:17 AMtypealias Dict<V> = Map<String, V>
to be made available to other classesmbstavola
06/21/2017, 5:56 AMqwert_ukg
06/21/2017, 6:44 AMmarcinmoskala
06/21/2017, 9:25 AMdiesieben07
06/21/2017, 9:34 AMCzar
06/21/2017, 11:33 AMdata class CommonProperties(/*properties here*/)
sealed class Device(val commonProperties: CommonProperties)
data class Type1Device(commonProperties: CommonProperties, /*other properties*/): Device(commonProperties)
//...
You probably see the problem: Data class primary constructor must have only property (val / var) parameters
. Any suggestions on how to improve the design of my hierarchy?dev-priporov
06/21/2017, 2:19 PMdave
06/21/2017, 8:01 PMmenegatti
06/22/2017, 8:29 AMchristophsturm
06/22/2017, 11:59 AMfun error(field: String, value: String)
is it Nothing?dh44t
06/22/2017, 4:47 PMdierre
06/23/2017, 7:52 AMdata
class to do something like this. And for me it’s actually a good thing, because the bean you use to model your JPA entity should stay inside the JPA module. You have to convert it to a model that makes sense in your domain, and at that point, you can actually use a data class that doesn’t rely on those necessities given by the ORM framework you are using.xemoni
06/23/2017, 7:53 AMdierre
06/23/2017, 8:04 AMemaleavil
06/23/2017, 9:15 AMumike
06/23/2017, 2:24 PMdiesieben07
06/23/2017, 2:39 PMMyClass::class.memberProperties
should be what you want.raulraja
06/23/2017, 11:32 PMraulraja
06/23/2017, 11:32 PMorangy
06/24/2017, 9:21 AM