bbaldino
03/19/2019, 8:25 PMroberto
03/20/2019, 2:36 AMclass MyAwesomeView: FrameLayout {
constructor(context: Context?, attrs: AttributeSet? = null) : super(context, attrs)
constructor(context: Context?, attrs: AttributeSet?, parm1: Int) : super(context, attrs, parm1)
constructor(context: Context?, attrs: AttributeSet?, parm1: Int, parm2: Int) : super(context, attrs, parm1, parm2)
init {
context.someMethod(attrs)
}
}
The init method cannot access attrs, I'm getting "Unresolved reference 'attrs'". Why is that? how can I make init access attrs. Shouldn't be enough by adding attrs to constructors as it is here?Paul Woitaschek
03/20/2019, 11:55 AMjuliocbcotta
03/20/2019, 2:42 PMinternal
in my gradle modules classes makes the project compilation time smaller or improves the IDE memory/processor usage? If so, Is there any docs/articles about this?klizter
03/20/2019, 3:07 PMMap
where key is String
and case insensitive?amanda.hinchman-dominguez
03/20/2019, 3:11 PMPaul Woitaschek
03/20/2019, 4:09 PMbasher
03/20/2019, 9:36 PMturansky
03/20/2019, 11:52 PMtruncate
?
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.math/truncate.html
1. fraction
2. fractional
Sola
03/21/2019, 9:17 AM-Xnew-inference
), is this a known issue? (It compiles with old inference implementation, btw)Ubi
03/21/2019, 9:51 AMinvoke()
. Is there any other way to achieve this?Paul Woitaschek
03/21/2019, 11:09 AM.sumBy()
not defined on kotlin.collections.Iterator<T>
too?
I'm using android-ktx fun <T> androidx.collection.SparseArrayCompat<T>.valueIterator(): kotlin.collections.Iterator<T>
and would like to sum the values.
As a workaround I can call toSequence().sumBy { it }
amadeu01
03/21/2019, 12:48 PMkotlin repl
but with some library included. Eg: I want to make a test with RxKotlin, but I just want to see the result of something, is that possible to make a import of the library to the repl ?Ian White
03/21/2019, 1:10 PMmyMap: Map<String,Any>
from myMap: Map<String,Any?>
, because both of those turn into Java Map<String,Object>
from the standpoint of the annotation processor. Is there any way to distinguish them? As a workaround I’m considering adding an additional annotation @HasNullValue
but it’s a bit of a hack.Slackbot
03/21/2019, 4:05 PMkarelpeeters
03/21/2019, 5:15 PMif (indice == composizione.lastIndex)
David Cuesta
03/21/2019, 6:31 PMddlucas
03/21/2019, 7:05 PMLeoColman
03/22/2019, 1:17 AMfun Any?.foo(other: Any?) {
contract {
other == null implies (this != null)
}
}
Guru
03/22/2019, 8:43 AMspand
03/22/2019, 8:54 AMklizter
03/22/2019, 8:57 AMAntanas A.
03/22/2019, 12:01 PMGuru
03/22/2019, 12:26 PMhdarritchon
03/22/2019, 3:45 PMliminal
03/22/2019, 4:31 PMtipsy
03/22/2019, 7:50 PMclass Person {
public int age;
public String name;
}
and i want to turn it into a data class(val age: Int, val name: String)
. i know i could write something to convert it, but is there something built-in that can just freeze the object instead?Slackbot
03/22/2019, 8:53 PMKirill Zhukov
03/22/2019, 10:58 PMBigDecimal#toInt()
which maps to intValue()
. Curious how this is done.Hamza
03/23/2019, 5:19 PMHamza
03/23/2019, 5:19 PMShawn
03/23/2019, 5:42 PMHamza
03/24/2019, 10:55 AM