irus
07/20/2019, 11:10 AMMichał Kalinowski
07/22/2019, 1:13 PMUInt
to CPointer
?Kruger Brent
07/22/2019, 3:35 PMKruger Brent
07/22/2019, 11:16 PMolonho
07/23/2019, 6:04 AMMichał Kalinowski
07/24/2019, 5:25 AMandreasmattsson
07/25/2019, 1:37 PMclass KotlinWeakViewController(private val weak: WeakReference<UIViewController>) {
constructor(viewController: UIViewController) : this(WeakReference(viewController))
val viewController get() = weak.get()
}
And I have this in my Swift VC:```
private var weakVc: KotlinWeakViewController?
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
//weakVc = KotlinWeakViewController(viewController: self)
weakVc = KotlinWeakViewController(weak: KotlinWeakReference(referred: self))
weakVc = nil
}
deinit {
print("ViewController deinit")
}
```
Unfortunately the ViewController never seems to deinit if I instantiate the KotlinWeakViewController
, regardless of whether I create the WeakReference
on the Kotlin side or on the Swift side, and regardless of whether I keep the reference to the KotlinWeakViewController
around in an instance variable or nil it immediately.Thomas
07/25/2019, 3:38 PMmalloc: *** error for object 0x280872d78: pointer being freed was not allocated
malloc: *** set a breakpoint in malloc_error_break to debug
I am guessing I am doing something wrong with my cinterop code. How can I find the cause of the issue in my code?ptmt
07/29/2019, 8:25 AMInvalid module
https://kotlinlang.slack.com/archives/C3PQML5NU/p1548688304549700 for 1.3.50-eap-5
Is it possible to implement more meaningful message from `LLVMVerifyModule`as TODO here states? (if it makes sense at all) https://github.com/JetBrains/kotlin-native/blob/b0c74ec00b91038cc2e587e0017d919fd5dbbadc/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt#L65Thomas
07/29/2019, 12:53 PMInvalidMutabilityException
? If you move the init
to the end (after the lazy val) it does not throw the exception.
fun main() {
Example()
}
class Example {
init {
freeze()
}
val value by lazy { 1 }
}
Jurriaan Mous
07/29/2019, 7:32 PM#include <map>
with exception: /include/rocksdb/db.h:13:10: fatal error: 'map' file not found
. This is the .h file: https://github.com/facebook/rocksdb/blob/master/include/rocksdb/db.h . What am I doing wrong? (This cinterop thing is new to me so maybe I am missing something obvious)Arkadii Ivanov
07/29/2019, 10:45 PMvar map: Map<Int, Int> = emptyMap()
repeat(10000) {
map += it to it * 2
}
Kris Wong
07/30/2019, 2:57 PM@ObjCMethod
- @ObjCMethod external override fun viewDidLoad() {
. the generated bindings don't seem to pass any args to that annotation.Kris Wong
07/30/2019, 7:17 PM__attribute__((unavailable("Kotlin subclass of Objective-C class can't be imported")))
Kris Wong
07/30/2019, 9:19 PMaddTarget
call on a UIControl?Andrei Marshalov
08/01/2019, 3:00 PMallocArrayOf()
inside memScoped{ }
to alloc array of double
? I’m surprised that it works only for float
.
Kotlin version 1.3.30
russhwolf
08/02/2019, 2:37 AMfun main() {
val label = "hello"
val lambda: suspend () -> String = { label }
}
Apparently the compiler chokes on a variable named label
being passed into a suspend lambda. The problem goes away if a different name than label
is used. I’d toss it in youtrack but it seems to already be fixed in the 1.3.50 eap.Yan Pujante
08/04/2019, 7:00 PMsrc/nativeMain // contains "generic" code that can be used in other dir
src/macosMain // contains "specific" code for macOS
src/mingwMain // contains "specific" code for Windows
From my understanding, the build.gradle
needs to look like this:
kotlin {
macosX64("macos") {
binaries {
staticLib {
}
}
}
mingwX64("mingw") {
binaries {
staticLib {
}
}
}
}
But I am unclear how I include nativeMain
which should be part of the static library as well as how I declare a dependency ( macosMain
depends on nativeMain
)
Any help appreciated.Cyrille QUÉMIN
08/05/2019, 1:49 PMasad.awadia
08/05/2019, 6:27 PMgalex
08/06/2019, 1:32 PM4ntoine
08/06/2019, 1:59 PMmacosX64("native") {
binaries {
executable()
}
}
.
The measurements are done with trivial measureTimeMillis()
What can be the reason? Any optimizations turned off?Paul Idstein
08/06/2019, 3:26 PMlouiscad
08/06/2019, 4:52 PM.h
+ .c
or .m
) into a Kotlin/Native library, is setting up C-interop enough, or do I also need to do something special to export the file?louiscad
08/06/2019, 9:08 PMid <SomeProtocol>
ends up being Any?
.
I tried to add extraOpts("-Xobjc-generics")
in the cinterop from my build.gradle.kts
, but then, the cinterop gradle task fails, telling the option is unknown.andreasmattsson
08/07/2019, 7:28 AMKotlinKClass
of Kotlin class from Swift/obj-C (in order to then pass it to a kotlin method)? I.e. the equivalent of ClassName::class
on the Kotlin side?alex009
08/07/2019, 8:44 AMAnimesh Sahu
08/07/2019, 3:00 PMYan Pujante
08/07/2019, 6:52 PMpackage sample
import platform.AppKit.NSView
fun attached(parent: NSView) : Boolean {
println("kotlin::attached(${parent.window()})")
return true
}
Then I have another (C++) project consuming the library and calling:
lib->kotlin.root.sample.attached({ parent }))
where parent
is a NSView
that was created by some code I am not responsible for (it is passed to me).
This simple code crashes...
From the screenshot attached I can confirm that what is passed to me is a NSView
pointer... but somehow on the kotlin side it crashes. I have tried with a few methods on NSView
and they all trigger a crash.
Any idea? Am I doing something wrong?Harsh Deshpande
08/08/2019, 5:26 PMHarsh Deshpande
08/08/2019, 5:26 PMKirill Shmakov [JB]
08/09/2019, 9:11 AMHarsh Deshpande
08/09/2019, 3:48 PMKirill Shmakov [JB]
08/12/2019, 1:55 PMbinaries { ... executable ... }
in you build.gradle
file?
If not then IDE will not determine its run configuration from Gradle model. The resulting run configurations are supposed to be of type `Kotlin/Native Application`: