Gokhan Alıcı
03/27/2019, 11:54 AMIlya Goncharov [JB]
03/27/2019, 12:01 PMelect
03/27/2019, 4:18 PM@JvmName
cant do anything here?
@JvmName("getI") fun get(): Int = 0
@JvmName("getF") fun get(): Float = 0f // error, signature clash
Paul Woitaschek
03/28/2019, 6:45 AMVlad
03/28/2019, 1:31 PMoperator fun MyDate.rangeTo(other: MyDate): DateRange
and it will work without implementing any interface.amadeu01
03/28/2019, 2:24 PMapply
and with
. When should I use one over the other?Jorge Riveiro
03/28/2019, 3:01 PMPaul Woitaschek
03/28/2019, 3:55 PMDavide Giuseppe Farella
03/28/2019, 11:22 PMDavide Giuseppe Farella
03/28/2019, 11:25 PMDavide Giuseppe Farella
03/28/2019, 11:29 PMfun MutableEntity.postSomething() = postSomething
Vlad
03/29/2019, 6:01 AMclass Dummy {
fun foo() = println("Hi")
}
fun Dummy.apply(f :Dummy.() -> Unit) = f()
Dummy().apply({ foo() })
How does Dummy.() -> Unit
know how it needs to dispatch the function call?Jacques Smuts
03/29/2019, 11:00 AM<reified T>
with a sealed class
?Pascal How
03/29/2019, 11:10 AMby
keyword. This looks great and I like it so far. However, during the closing panel of KotlinConf 2018, Andrey and another guy said it was their least favourite feature. Does anyone have any opinion or bad experience with class delegation?JoaoGoulart
03/29/2019, 12:31 PMpublic abstract class MyClass implements MyInterface {
@Override
public abstract <M extends MyInterface> MyModelType<M> getModelType();
}
How do i implement this in Kolin? i always get this:
override fun <M : MyInterface?> getModelType(): MyModelType<M> {
TODO
}
but this is not what i want, in Java works fine
@Override
public MyModelType<MyClassImpl> getModelType() {
return null;
}
Any ideas on how to do it?bbaldino
03/29/2019, 7:53 PMinlineClassInstance++
to increment its valueJared
03/29/2019, 8:18 PMSmallville7123
03/29/2019, 9:45 PMbbaldino
03/29/2019, 10:45 PMSub.member
that causes the ClassCastExceptionSlackbot
03/30/2019, 3:39 AMSmallville7123
03/30/2019, 4:33 AMdiesieben07
03/30/2019, 1:14 PMobject UserModel : Model {
val name by VarcharField()
}
From that I am doing to generate code like this (using an annotation processor):
data class User(val name: String)
If I now have a call like dataSource.findAll(UserModel)
how can I express to the compiler that this returns List<User>
?serebit
03/30/2019, 5:00 PMSmallville7123
03/31/2019, 4:03 AMtipsy
03/31/2019, 11:52 AMon(Event.TYPE_ONE) { int ->
// an int is available here
}
on(Event.TYPE_TWO) { string ->
// a string is available here
}
Mustafa
04/01/2019, 1:55 AMnorricorp
04/01/2019, 8:46 AMJacques Smuts
04/01/2019, 11:21 AMribesg
04/01/2019, 2:11 PMMap<String, String?>
as parameter of a function taking Map<Any?, *>
? I assume I can safely do an unchecked cast here, but I wonder why I need it at alldumptruckman
04/01/2019, 4:12 PMdumptruckman
04/01/2019, 4:12 PMprotected
functionality back in Kotlin:Artglorin
04/01/2019, 4:33 PM