Chills
03/19/2020, 5:26 PMaligned With Code"""
................ class Dance{
...................companion SType{
.........................dress = "BW"
.......................}
.................}
"""
how to trim this (the dots are spaces which need to trimmed) ,so after format those spaces gets trimmed
Colton Idle
03/19/2020, 6:22 PMval asdf = "asdf"
when (asdf) {
"abc" -> {
}
else -> {
}
}
and then comment out the first line, it takes about 15 seconds for the when
statement to show as invalid (the asdf var is underlined in red).
How would I get a trace in order to file a bug for this? How can I help JB with this issue?Michael Limb
03/19/2020, 7:47 PMChills
03/19/2020, 8:07 PMNew111
03/19/2020, 9:11 PMjaguililla
03/20/2020, 8:47 AMDico
03/20/2020, 11:40 AMwith(vk) { this@create.enumerate() }
Oscar Sequeiros
03/20/2020, 2:23 PMval range = IntRange[2, 5)
That express as maths, interval with closed at 2, opened at 5.PandaH.
03/20/2020, 2:27 PM// typescript
type ID = String;
function generateId(obj): ID { ...body... }
basically, how to create types like above. i came up with this, but im not sure if its the best way:
// kotlin
class ID : String()
fun generateId(obj: Obj): ID { ...body... }
thank you!PandaH.
03/20/2020, 2:28 PMtype Fruits = "Apples" | "Oranges" | "Bananas";
, what would be the kotlin equivalent?nickheitz
03/20/2020, 2:59 PMOrhan Tozan
03/20/2020, 3:37 PM@Deprecated
class have all of its method automatically marked as deprecated?basher
03/20/2020, 4:36 PM-Xexplicit-api={strict|warning}
to make the compiler force you to add visibility modifiers. maybe still experimental? but awesome to see this coming for library authorsSteve
03/20/2020, 10:11 PMif(!validateLength(thingy)) if(!validatePrefixLength())
statements?Paul Woitaschek
03/20/2020, 11:00 PMChills
03/21/2020, 7:33 AMLastExceed
03/21/2020, 3:21 PMsuspend fun main() {
val x = getItems1()
val y = getItems2()
}
suspend fun getItems1() = httpClient.get<PayloadContainer<Items>>("<https://api.warframe.market/v1/items>").payload
suspend fun getItems2() = httpClient.getUnwrapped<Items>("<https://api.warframe.market/v1/items>")
suspend inline fun <reified PayloadType> HttpClient.getUnwrapped(url: String) =
get<PayloadContainer<PayloadType>>(url).payload
//for some reason this API wraps all it's payloads in another payload so we need to unwrap 1 layer
data class PayloadContainer<PayloadType>(val payload: PayloadType)
getItems1()
works perfectly fine, getItems2()
gives me the following error:
class java.util.LinkedHashMap cannot be cast to class payload.Items (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; payload.Items is in unnamed module of loader 'app')
can someone explain the problem? It seems to have to do with type erasure, but shouldn't reified
prevent that ?LastExceed
03/21/2020, 8:21 PMJanelle Fullen
03/22/2020, 1:36 AMJanelle Fullen
03/22/2020, 1:48 AMv79
03/22/2020, 9:49 AMallTags [
tag { category: "genre", value: "classical", count=0, multiple=false },
tag { category: "genre", value: "jazz",, count=0, multiple=false },
tag { category: "composer", value: "mahler", count=0, multiple=false },
tag { category: "composer", value: "bach", count=0, multiple=false },
tag { category: "genre", value: "classical", count=0, multiple=false },
tag { category: "composer", value: "bach", count=0, multiple=false },
]
I want:
groupedList [
tag { category: "genre", value: "classical", count=2, multiple=true },
tag { category: "genre", value: "jazz", count=1, multiple=false },
tag { category: "composer", value: "mahler", count=1, multiple=false }
tag { category: "composer", value: "bach", count=2, multiple=true }
]
// TODO: this isn't counting correctly
val groupedList = allTags.groupBy { it.label }.values.map { it.reduce { acc, item -> Tag(category = item.category, label = item.label, url = item.url, postCount = item.postCount++, hasPosts = item.postCount > 1) } }
Chills
03/22/2020, 11:17 AMEdoardo Luppi
03/22/2020, 11:27 AMLastExceed
03/22/2020, 2:58 PMAnimesh Sahu
03/23/2020, 9:13 AMLastExceed
03/23/2020, 12:11 PMfun main() {
val thing = MyClass(42, "69")
thing::class.memberProperties.forEach {
println(it.name)
println(it.get())
}
}
data class MyClass(val x: Int, val y: String)
but get()
requires a parameter of type Nothing
which i dont understandaipok
03/23/2020, 12:18 PMuser
03/23/2020, 1:03 PMRuckus
03/23/2020, 2:15 PMPacane
03/23/2020, 2:27 PMuse
keyword and also catch exceptions? Seems like the exception doesn't reach the caller of doSomething
override fun doSomething() {
sessionCreator.createSession().use(fun(session: SqlSession) {
// Some code
throw Exception("Test Exception")
})
}
Pacane
03/23/2020, 2:27 PMuse
keyword and also catch exceptions? Seems like the exception doesn't reach the caller of doSomething
override fun doSomething() {
sessionCreator.createSession().use(fun(session: SqlSession) {
// Some code
throw Exception("Test Exception")
})
}
spand
03/23/2020, 2:39 PMuse()
rethrows the exceptionPacane
03/23/2020, 2:39 PMRuckus
03/23/2020, 3:32 PMuse
is just a function, not a keyword.