janvladimirmostert
09/11/2017, 12:28 PMkarelpeeters
09/11/2017, 3:04 PMtest(InInt(5))
has type Out<Int>
and the only possibility is that it's actually OutInt
, but it's not that advanced.myanmarking
09/11/2017, 4:08 PMTypeface.create(“roboto…“, Typeface.NORMAL)
does this needs to be cached?evkaky
09/11/2017, 4:40 PMRuckus
09/11/2017, 5:23 PMCollectionsKt.binarySearch
functions aren't inline?dimsuz
09/11/2017, 9:59 PMhasNext()
and next()
are operators available to overloading? But they a not mentioned in kotlin reference - is this a missing documentation or am I understanding it wrong?
https://kotlinlang.org/docs/reference/operator-overloading.htmlsnowe
09/11/2017, 11:21 PMsqia09
09/12/2017, 7:13 AMarjunbvb
09/12/2017, 8:06 AMkarelpeeters
09/12/2017, 9:42 AMlpirro
09/12/2017, 10:04 AMlet
because if not null not works with mutable properties, and you need to use !!karelpeeters
09/12/2017, 10:10 AMobj?.let { ... } ?: run { ... }
.diego-gomez-olvera
09/12/2017, 10:13 AMv
is val
, if
can smart-cast to non nullableSlackbot
09/12/2017, 12:26 PMkristofdho
09/12/2017, 12:28 PMdave08
09/12/2017, 12:30 PMenum class PackageFlags(val mask: Int) {
NONE(0), SYSTEM_APP(1), IS_DEBUGGABLE(2), SYSTEM_APP_UPDATED(128), IN_SD_CARD(262144),
IS_DATA_ONLY(16777216), IS_STOPPED(2097152)
}
dave08
09/12/2017, 1:38 PMenum class PackageFlags(val mask: Int) {
NONE(0), SYSTEM_APP(1), IS_DEBUGGABLE(2), SYSTEM_APP_UPDATED(128), IN_SD_CARD(262144),
IS_DATA_ONLY(16777216), IS_STOPPED(2097152)
}
The function invoke() is not foundjacobmoncur
09/12/2017, 5:20 PMdamian
09/12/2017, 5:25 PMkotlin.compiler.execution.strategy="in-process"
? I am seeing java.lang.ClassCastException: com.sun.tools.javac.api.JavacTrees cannot be cast to com.sun.source.util.Trees
when calling Trees.instance(processingEnv)
in a processor through kapteginez
09/12/2017, 10:10 PMmike_shysh
09/13/2017, 7:41 AMpniederw
09/13/2017, 7:54 AMsealed
)rrader
09/13/2017, 8:24 AMsqia09
09/13/2017, 9:56 AMsqia09
09/13/2017, 10:25 AMgeatmo
09/13/2017, 1:30 PMval myList = List(3) { it }
which, as the documentation states, creates a read-only list.. but as far as I can see, this list only appears to really be read-only, as I am able to do this:
(myList as MutableList).clear()
and the list will get modified..
so for actually immutable lists, should I better stick to keep using listOf()
instead?nish
09/13/2017, 5:25 PMmichael.barker
09/13/2017, 8:01 PMis
prefix since the getter becomes getIsValid. From what I found with Java interoperability a property with the is
prefix ends up with a getter named isValid.Dalinar
09/14/2017, 6:32 AMpostInit { }
or ready { }
block that is called in the parent after all subclasses are fully constructed.
Right now I'm implementing an abstract fun() that the child must override (to ensure that all subclasses always call the parent initializer method) (at the bottom of the child class) to call an initalize() fun in the parent. I'm wondering if there is a better way?
Because the code that I would normally put in the init { }
block needs to reference an abstract val that (implemented in the child) references a constructor property of that childpniederw
09/14/2017, 9:33 AMclass Outer {
sealed class Foo {}
// cannot access '<init>': it is private in 'Foo'
class Bar : Foo() {}
}
pniederw
09/14/2017, 9:33 AMclass Outer {
sealed class Foo {}
// cannot access '<init>': it is private in 'Foo'
class Bar : Foo() {}
}
orangy
09/14/2017, 9:35 AMnil2l
09/14/2017, 9:39 AMA sealed class can have subclasses, but all of them must be declared in the same file as the sealed class itself. (Before Kotlin 1.1, the rules were even more strict: classes had to be nested inside the declaration of the sealed class).
pniederw
09/14/2017, 9:40 AMnil2l
09/14/2017, 9:41 AMpniederw
09/14/2017, 9:41 AMnil2l
09/14/2017, 9:43 AMall of them _must_ be declared in the same file as the sealed class itself
pniederw
09/14/2017, 9:43 AMstanislav.erokhin
09/14/2017, 9:44 AM