diesieben07
03/22/2018, 1:32 PMclass Impl1(impl2: Impl2) : SomeInterface by impl2
geoffrey
03/22/2018, 5:06 PMis
used with optional types, which I don’t quite get: if( myvar is MyObject? )
. Seems to be valid syntax, but I don’t understand what the ?
is adding. Any thoughts?kagomez
03/23/2018, 12:14 AMdead.fish
03/23/2018, 8:21 AMSomeClass
, but only an instance (actually an object
) of that classspand
03/23/2018, 8:22 AMobjOfSomeClass::class.safeCast(otherInstance) != null
dead.fish
03/23/2018, 8:23 AMit::class.isInstance(value.type)
apparently needs kotlin-reflect
, which I don't want to draw in just for that purposeShawn
03/23/2018, 2:34 PMzip
operationjw
03/23/2018, 7:48 PMczyzby
03/24/2018, 12:46 PMJean-Philippe Déry
03/24/2018, 7:29 PMaltavir
03/25/2018, 6:37 AMT
and it could produce other nodes that could possibly extend T
. Then I have a builder object for that tree that could consume T
or something extending T:
class Tree<T>{
fun getNode(name: String): Tree<T>
}
class Builder<T>{
fun setNode(name: String, tree: Tree<T>)
}
In first case I can possibly work without variance at all, but in second case I need some kind of variance to be able to put nodes of something: T
inside. How should I do it? Just putting in
variance in class header does not work.pal0810
03/25/2018, 1:39 PMToby
03/25/2018, 5:55 PMmekarthedev
03/25/2018, 7:21 PMType parameter T is declared as 'out' but occurs in 'in' position in type T
on line override fun receive(t: T) {
thanksforallthefish
03/26/2018, 6:28 AMDeividasDuda
03/26/2018, 9:05 AMjava.lang.NullPointerException`
at com.google.api.client.repackaged.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:213)
at com.google.api.client.util.Preconditions.checkNotNull(Preconditions.java:127)
DeividasDuda
03/26/2018, 9:09 AMsarahpoehler
03/26/2018, 6:19 PMsarahpoehler
03/26/2018, 6:24 PMcolintheshots
03/26/2018, 6:27 PMJoe
03/26/2018, 6:41 PMif (!(raw instanceof Map)) {
...
}
And here’s the converted Kotlin:
if (raw !is Map<*, *>) {
...
}
Now the variable raw
is actually of type LinkedHashTreeMap
which inherits from Map
. What am I missing?Adrian M
03/27/2018, 7:45 AMdiesieben07
03/27/2018, 11:08 AMgildor
03/27/2018, 1:55 PMKonstantin Petrukhnov
03/27/2018, 2:41 PMdroidrcc
03/27/2018, 3:37 PMperryprog
03/27/2018, 5:11 PMreadStuff {
println(it)
}
// Do other things meanwhile...
qwert_ukg
03/28/2018, 4:14 AMvibin
03/28/2018, 7:26 AMclass Foo(val bar: Bar)
var foo: Foo? = null
foo?.bar!! // will crash when foo is null 💀
rrader
03/28/2018, 1:44 PMhttps://pbs.twimg.com/media/DZYF8XQWAAAUuT2.jpg▾
join(who='jonnyzzz', when=Today, where=Linz, talks=listOf("Live coding and IntelliJ IDEA"))
rrader
03/28/2018, 1:44 PMhttps://pbs.twimg.com/media/DZYF8XQWAAAUuT2.jpg▾
join(who='jonnyzzz', when=Today, where=Linz, talks=listOf("Live coding and IntelliJ IDEA"))
dasz
03/28/2018, 2:37 PMjoin 'Jonnyzzz' Today in Linz regarding 'Live coding..'