Tresa
01/21/2021, 1:37 PMpre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
we end up with other errors during build like
Undefined symbols for architecture x86_64:
"_sqlite3_bind_text16", referenced from:
_SQLiter_SQLiteStatement_nativeBindString in ConnectPlusSharedDB(result.o)Afzal Najam
01/21/2021, 4:47 PMMati Galli
01/21/2021, 7:41 PM@Serializable
a java.util.Date
with this format 2018-11-14T13:25:30Z
? I´m using Ktor and kotlinx.serialization
Philipp Mayer
01/21/2021, 9:26 PMflowNodes.forEach { initialNode ->
initialNode.succeedingNodes.list().forEach { nextNode ->
graph.addArc(initialNode to nextNode)
}
}
in a more fluent way? Seems like I'm missing something.
The use case would be the following:
I have an initial Node 1 with the succeeding nodes 2 and 3.
The target is to add 1 to 2 and 1 to 3 to the graph.
thanks a lot!Ifvwm
01/22/2021, 9:33 AMfun f () {
val result = async { ktor-client-function... return@async 1 }
return result
}
bod
01/22/2021, 3:01 PMfun <T> foo(a: T, block: () -> T) {}
foo("Hello") { 1 }
How come this compiles? T
is String
for a
but Int
for the block
lambda. Bonus question: what's a way to make this not compile and enforce the same type? 🙂 Thanks 🙏Pablo
01/22/2021, 3:29 PMJunior leoncio
01/22/2021, 4:41 PMAnimesh Sahu
01/22/2021, 5:40 PM--info
or --verbose
is passed within a task 👀 when creating the task :blob-thinking-upside-down:Youssef Shoaib [MOD]
01/22/2021, 10:07 PMinline fun <T> identity(block: () -> T) = block
inline fun <T> do(block: () -> T): T = block()
fun main() {
println(do(identity { "hello" })
}
would be optimised to basically the equivalent of this:
fun main () {
println("hello")
}
Or would the lambda object still be created because it is being returned by identity
? I don't have access to an IDE right this second but this question is burning me so thought I'd ask. If anyone has the time, try pasting this code into a kotlin project then doing Show Kotlin Bytecode
then Decompile
and look at the Java source code to see what happens.Andrew
01/23/2021, 6:01 AMMjahangiry75
01/23/2021, 1:39 PMfun main() = runBlocking { // this: CoroutineScope
launch {
delay(200L)
println("Task from runBlocking")
}
coroutineScope { // Creates a coroutine scope
launch {
delay(500L)
println("Task from nested launch")
}
delay(100L)
println("Task from coroutine scope") // This line will be printed before the nested launch
}
println("Coroutine scope is over") // This line is not printed until the nested launch completes
}
I made a change to see the difference, I changed the coroutineScope
to runBlocking
and then as the document said runBlocking
blocks the current thread and coroutineScope
suspends but I got the same output. does anybody know why?elect
01/23/2021, 8:45 PM.java
files given a root folder to redirect to javac
. Isn't there a nicer kotlin alternative to this?
val sources = Files.find(Paths.get(srcDir), 999, { path, attr ->
attr.isRegularFile && path.toString().endsWith(".java")
}).map { it.toString() }.collect(Collectors.joining(" "))
Files.find
returns a Stream<Path!>!
and I need to go trough map
+ collect
+ Collectors
instead something more conciseNir
01/23/2021, 10:05 PMFred Ells
01/23/2021, 10:05 PMItem
. This results in a kotlin file ~14k lines long. And Intellij IDEA simply cannot handle the file. It essentially freezes instantly as long as the file exists in the project. Any ideas on how to deal with this situation?napperley
01/23/2021, 11:28 PMchristophsturm
01/24/2021, 10:12 PMjavaClass.getResource("myJsonFile.json")
but it does not work.Mikołaj Kąkol
01/25/2021, 10:14 AMAnimesh Sahu
01/25/2021, 11:54 AMString.trimIndent()
was a runtime function, but according to the the latest safari video up at 2:00 he says its compile time transformation, but then I tried to use it in a const val
then it says Const 'val' initializer should be a constant value
is it evaluated at run-time or at compile-time just not able to fit into const val
(maybe because compiler can't figure it out easily)?stephanmg
01/25/2021, 1:51 PMdasralph
01/25/2021, 2:36 PMThe Kotlin/Native distribution used in this build does not provide the standard library.
Does anyone have an idea whats going wrong?Kirill Grouchnikov
01/25/2021, 7:32 PMAndrew
01/26/2021, 5:02 AMclass MyObject(private val a: Int, private val b: Double) {
constructor(str: String) : this(parse(str))
companion object {
private fun parse(str: String): ???
}
}
Is there anything that would allow this to work? Currently I have to create 2 parse functions, one to get the first and another for the second value I need.Radoslaw Juszczyk
01/26/2021, 10:42 AMval commonMain by getting {
dependencies {
implementation("com.russhwolf:multiplatform-settings:0.6.1")
}
}
Inside iosMain I have added this code:
fun test(d: NSUserDefaults) {
AppleSettings(d)
}
And everything compiles correctly but IDE complains about AppleSettings that (Cannot access class ‘platform.Foundation.NSUserDefaults’. Check your module classpath for missing or conflicting dependencies) [see image below]
any ideas what could be the reason of this error?Yuri Drigin
01/26/2021, 11:26 AMHenrik Johansson
01/26/2021, 2:39 PMKoenichiwa
01/26/2021, 4:14 PMRainer Schlonvoigt
01/27/2021, 8:58 AMmyCollection
.map { ... }
.filter { ... }
.forEach { ... }
I know in Java i would call it “stream syntax” but that’s because there you actually need to create streams before being able to make these callsRainer Schlonvoigt
01/27/2021, 9:25 AMSet<T>
and List<T>
are an option, which do you default to and why?christophsturm
01/27/2021, 11:34 AMkotlin.collections.LinkedHashSet
typealias that aliases to java.util.LinkedHashSet
(in typealiases.kt) , but also a kotlin class kotlin.collections.LinkedHashSet
defined in LinkedHashSet.kt
?christophsturm
01/27/2021, 11:34 AMkotlin.collections.LinkedHashSet
typealias that aliases to java.util.LinkedHashSet
(in typealiases.kt) , but also a kotlin class kotlin.collections.LinkedHashSet
defined in LinkedHashSet.kt
?ephemient
01/27/2021, 11:45 AMexpect class LinkedHashSet<E>
libraries/stdlib/jvm/src/kotlin/collections/TypeAliases.kt:
public actual typealias LinkedHashSet<E> = java.util.LinkedHashSet<E>
libraries/stdlib/wasm/src/kotlin/collections/LinkedHashSet.kt:
actual open class LinkedHashSet<E>
(ditto libraries/stdlib/js... etc)christophsturm
01/27/2021, 11:50 AMephemient
01/27/2021, 11:51 AMchristophsturm
01/27/2021, 11:52 AMephemient
01/27/2021, 11:53 AMchristophsturm
01/27/2021, 11:56 AM