janvladimirmostert
05/20/2017, 5:11 PMjanvladimirmostert
05/20/2017, 5:14 PMigoticecream
05/20/2017, 5:14 PMigoticecream
05/20/2017, 5:15 PMjanvladimirmostert
05/20/2017, 5:17 PMreturn (blah) {
}
and you forget to return something in the lambda, you could potentially be returning the wrong type and not even notice it
otherwise I can think of interfaces where having a return type is is mandatory, so making functions not use them is kinda inconsistentjanvladimirmostert
05/20/2017, 5:19 PMigoticecream
05/20/2017, 5:25 PMjanvladimirmostert
05/20/2017, 5:45 PM<in R>
and <out S>
for quite a while, only because IntelliJ suggests using it.
what are the benefits of marking generics as in / out other than tightening the abstraction ?tarek
05/20/2017, 7:51 PMorangy
argoneus
05/20/2017, 9:01 PMargoneus
05/20/2017, 9:01 PMargoneus
05/20/2017, 9:01 PMdiesieben07
05/20/2017, 9:06 PMval thing = object : MyInterface {
// implementation here
}
argoneus
05/20/2017, 9:10 PMargoneus
05/20/2017, 9:10 PMargoneus
05/20/2017, 9:10 PMdiesieben07
05/20/2017, 9:11 PMwfisher
05/20/2017, 10:23 PMcontains(element: T?)
on Iterable<T>
? I can't find the code that allows this but the compiler doesn't complain.sagar.atalatti
05/21/2017, 10:15 AMargoneus
05/21/2017, 10:15 AMargoneus
05/21/2017, 10:15 AMmg6maciej
05/21/2017, 10:38 AMrefresh_servers
is defined in all (usually just one) configurations of your layout file, then yes, it will not be null (except before onViewCreated
and setContentView
).Ian
05/21/2017, 4:32 PMorangy
redrield
05/21/2017, 5:05 PMredrield
05/21/2017, 5:08 PMrahulsom
05/21/2017, 7:43 PMpublic interface JavaInterface {
String getId();
}
I can implement it in kotlin like this
class KotlinFromJava(private val id: String) : JavaInterface {
override fun getId() = id
}
However, that seems too verbose.
So I created a Kotlin interface.
interface KotlinInterface : JavaInterface {
val id1: String
override fun getId() = id1
}
Now I can do this.
class KotlinFromKotlin(override val id1: String) : KotlinInterface
Is there a way to write KotlinInterface
without renaming the field?danlew
05/21/2017, 7:49 PMJavaInterface
into a Kotlin interface.danlew
05/21/2017, 7:50 PMinterface Identifiable {
val id: String
}