Hullaballoonatic
05/04/2019, 4:34 AM**
and root \\
operators (is backslash ever used outside of character and strings?).jishindev
05/04/2019, 10:01 AMjimn
05/04/2019, 1:47 PMdavidasync
05/04/2019, 6:07 PMDico
05/04/2019, 11:46 PMHullaballoonatic
05/05/2019, 1:11 AM3..0 // 3, 2, 1, 0
?Hullaballoonatic
05/05/2019, 1:43 AMrangeTo ..
operator to add descending and unbounded functionality, e.g. list[3..]
Mike
05/05/2019, 1:08 PMelect
05/05/2019, 7:33 PMtailrec
? And get rid of the !!
?
while (window.flags has Wf.ChildWindow && window.parentWindow != null)
window = window.parentWindow!!
elect
05/06/2019, 9:40 AM==
(and also Float.compareTo
) will call java.lang.Float.compare()
under the hoodFelix Robles
05/06/2019, 11:29 AMrobstoll
05/06/2019, 12:43 PMBernhard
05/06/2019, 12:57 PMiex
05/06/2019, 3:39 PMInt
into a ByteArray
?Chi
05/06/2019, 7:09 PMChi
05/06/2019, 7:10 PMwhile
loopRohan Maity
05/06/2019, 9:08 PMcrummy
05/06/2019, 11:11 PMval Map<UInt, UInt>.hex: String
get() = this.map { "${it.key.hex}=${it.value.hex}" }.toString()
@get:JvmName("mapIntByteHex")
val Map<UInt, UByte>.hex: String
get() = this.map { "${it.key.hex}=${it.value.hex}" }.toString()
I added the @JvmName
annotation to fix the error in the IDE. However, when I try to build I still get an error:
Error:(1, 1) Kotlin: Platform declaration clash: The following declarations have the same JVM signature (hex$annotations(Ljava/util/Map;)V):
val Map<UInt, UByte>.hex: String...
val Map<UInt, UInt>.hex: String...
Is there a way around this without changing the property names?LeoColman
05/07/2019, 3:01 AMfor(int divisor = 2; n > 1; divisor++) {
for(; n % divisor == 0; n /= divisor) {
...
}
}
Josué
05/07/2019, 11:25 AMMarko Mitic
05/07/2019, 11:34 AMcompanion object {
const val TAG1 = this.javaClass.simpleName
const val TAG2 = MainActivity::class.simpleName!!
}
Obfuscation mangles class names so having them assigned to constants before obfuscation pass would be greatly useful.
(Or is there a way to this that I'm missing)william
05/07/2019, 3:57 PMClass
as well?
abstract class BaseViewModelFragment<T : ViewModel>(private val type: Class<T>) : BaseInjectedFragment() {
@Inject
lateinit var viewModelFactory: ViewModelProvider.Factory
private lateinit var viewModel: T
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
viewModel = ViewModelProviders.of(this, viewModelFactory).get(type)
}
}
kd
05/07/2019, 7:07 PMYossi Saiada
05/07/2019, 8:24 PMenum class EnumA {
A, B;
val group = EnumB.values().find { this == it.enumA }
}
enum class EnumB(val enumA: EnumA) {
A1(EnumA.A),
B1(EnumA.B),
}
EnumB.values().map { it.enumA } // => [null, null]
EnumA.A.group // == null
EnumB.values().find { EnumA.A == it.enumA } // == null
Why does EnumB.enumA, for every EnumB value, equals null
?
(I know it's happening because of the circular dependency (caused by the group property), but I'm not sure it should be like that)
Edit:
I'm a bit confused. I had thought the reason is the circular dependency, but this code:
enum class EnumA(val enumB: EnumB) { A(EnumB.B) }
enum class EnumB(val enumA: EnumA) { B(EnumA.A) }
EnumB.values().map { it.enumA }
actually works as expected and return [A]
. 🤨amanda.hinchman-dominguez
05/08/2019, 12:23 AMamanda.hinchman-dominguez
05/08/2019, 1:05 AMPere Casafont
05/08/2019, 6:10 AMAny?.orElse(block: () -> Nothing)
which works for the purpose like a charm but then I wonder why there isn't anything like that in the language itself or the stdlib, maybe I am missing something?nickk
05/08/2019, 8:14 AMThrowable
was an alias for java.lang.Exception
on the JVM?
Anyway, I have run into this problem: kotlin.NotImplementedError cannot be cast to java.lang.Exception
and I am thinking what is the best way to avoid it. It happens somewhere in my java dependencies (RxJava perhaps).
Your thoughts, please?Nikita Yatskivskiy
05/08/2019, 11:30 AMfrellan
05/08/2019, 11:34 AMkotlinOptions.jvmTarget = "1.8"
and that feels a bit ancient, I have not really followed what has happened to to jvm since the Stream API basically. What is a sensible version to run the latest kotlin versions on now? Are there any performance improvements for kotlin?frellan
05/08/2019, 11:34 AMkotlinOptions.jvmTarget = "1.8"
and that feels a bit ancient, I have not really followed what has happened to to jvm since the Stream API basically. What is a sensible version to run the latest kotlin versions on now? Are there any performance improvements for kotlin?karelpeeters
05/08/2019, 11:35 AMfrellan
05/08/2019, 11:36 AMkarelpeeters
05/08/2019, 11:36 AMfrellan
05/08/2019, 11:36 AMStephan Schroeder
05/08/2019, 11:37 AMfrellan
05/08/2019, 11:38 AMkarelpeeters
05/08/2019, 11:38 AM