Roberto Messina
09/17/2019, 7:53 AMSlackbot
09/17/2019, 7:55 AMPaul Woitaschek
09/17/2019, 9:34 AMU+1F3CA-200D-2642-FE0F
Emil Orvik Kollstrøm
09/17/2019, 10:01 AMNote that so far newer versions don’t add any bytecode optimizations or features beyond the ones that exist in lower versions, but that is going to change in the future.Does this mean that the JVM itself does not have any optimizations or is it only the Kotlin generated bytecode that loses out on these optimizations for those versions?
Malachi de Ælfweald
09/17/2019, 1:50 PMKroppeb
09/17/2019, 2:59 PMSam
09/17/2019, 5:17 PM<https://github.com/Tencent/MMKV>
Has anyone ever used this library that can prove the comparison to be true?Luke
09/17/2019, 5:19 PMval s: CharSequence = "Whatever"
assert(s is String)
println(s.compareTo("Something")) // Unresolved reference compareTo
Luis Munoz
09/17/2019, 8:50 PMBernhard
09/18/2019, 8:59 AMBernhard
09/18/2019, 2:53 PMcarlos cdmp
09/18/2019, 3:08 PMblakelee
09/18/2019, 5:38 PMUziel Sulkies
09/18/2019, 7:14 PMSam
09/19/2019, 12:54 AMMiguel Fermin
09/19/2019, 1:20 AMdoodla
09/19/2019, 4:45 AMRoberto Messina
09/19/2019, 8:36 AMuser
09/19/2019, 11:30 AMSlackbot
09/19/2019, 2:07 PMSandy
09/19/2019, 2:09 PMLeoColman
09/19/2019, 6:47 PM*doubleArrayOf(1.0, 2.0)
?rgrasell
09/20/2019, 1:58 AMAnthony f
09/20/2019, 7:45 AMBen Madore
09/20/2019, 2:45 PMfun getFoo(): Foo? {
// lookup logic for foo
return foo?. someName { nullFunc = { <http://log.info|log.info>{"didn't find it"} }, nonNullFunc = { <http://log.info|log.info>{"Found $this"}} }
}
nfrankel
09/20/2019, 10:05 PMnfrankel
09/20/2019, 10:15 PMinternal class MapEntry<K, V>(override val key: K, override val value: V) : Map.Entry<K, V>
internal fun <K, V> Pair<K, V>.toEntry() = MapEntry(first, second)
PHondogo
09/21/2019, 7:07 AMMatthew Holmes
09/21/2019, 4:48 PMharoldadmin
09/22/2019, 8:50 AMinterface MyType {
fun giveHello(): String = "Hello!"
}
class Polite: MyType {
// Does not override giveHello()
}
class Rude: MyType {
override fun giveHello(): String = "I don't like you"
}
I get access to the giveHello
method using reflection like this:
val methodOfPolite = Polite::class.java.getDeclaredMethod("giveHello")
val methodOfRude = Rude::class.java.getDeclaredMethod("giveHello")
There's one weird thing here. The polite class does not override the giveHello
method, but the declaringClass
property of this method object still points to the class Polite.
So is there a way I can check whether the class actually did override the default interface method or not?
My use case looks something like this (assuming we can get the behaviour I'm asking for in a property called isOverriden
):
if (methodOfPolite.isOverriden) {
// do something
} else {
// do something else
}
Here's a link to the question on StackOverflow: https://stackoverflow.com/questions/58047229/how-to-check-if-a-class-has-overriden-a-default-method-from-an-interface-using-r/58047393haroldadmin
09/22/2019, 8:50 AMinterface MyType {
fun giveHello(): String = "Hello!"
}
class Polite: MyType {
// Does not override giveHello()
}
class Rude: MyType {
override fun giveHello(): String = "I don't like you"
}
I get access to the giveHello
method using reflection like this:
val methodOfPolite = Polite::class.java.getDeclaredMethod("giveHello")
val methodOfRude = Rude::class.java.getDeclaredMethod("giveHello")
There's one weird thing here. The polite class does not override the giveHello
method, but the declaringClass
property of this method object still points to the class Polite.
So is there a way I can check whether the class actually did override the default interface method or not?
My use case looks something like this (assuming we can get the behaviour I'm asking for in a property called isOverriden
):
if (methodOfPolite.isOverriden) {
// do something
} else {
// do something else
}
Here's a link to the question on StackOverflow: https://stackoverflow.com/questions/58047229/how-to-check-if-a-class-has-overriden-a-default-method-from-an-interface-using-r/58047393karelpeeters
09/22/2019, 8:58 AM::class.java
there is no way to recover that information.instance::class.memberFunctions.first { it.name == "giveHello" } in instance::class.declaredFunctions
haroldadmin
09/22/2019, 9:13 AMkarelpeeters
09/22/2019, 9:17 AMharoldadmin
09/22/2019, 9:34 AM