ilya.matveev
03/23/2018, 5:38 PMexpectedBy
-dependencies in one Kotlin/Native project.
You can get the release binaries here:
https://download.jetbrains.com/kotlin/native/builds/releases/0.6.2/macos/kotlin-native-macos-0.6.2.tar.gz
https://download.jetbrains.com/kotlin/native/builds/releases/0.6.2/linux/kotlin-native-linux-0.6.2.tar.gz
https://download.jetbrains.com/kotlin/native/builds/releases/0.6.2/windows/kotlin-native-windows-0.6.2.zip
GitHub release page: https://github.com/JetBrains/kotlin-native/releases/tag/v0.6.2spierce7
03/23/2018, 9:46 PMmolikto
03/24/2018, 11:28 AMqlitzler
03/24/2018, 1:13 PMSomething
and a class inside this framework is named Somewhere
, the class in iOS will be named SomethingSomewhere
IS there anything I can do about it ?qlitzler
03/24/2018, 1:16 PMftomassetti
03/24/2018, 4:54 PMAregev2
03/24/2018, 7:39 PMjo
03/24/2018, 8:35 PMkyonifer
03/24/2018, 9:20 PMjo
03/24/2018, 9:22 PMAregev2
03/24/2018, 9:40 PMhellotimmutton
03/26/2018, 4:18 AMError:(33, 0) Platform project project ':android' has more than one 'expectedBy' dependency: project ':common', project ':common-frontend'
yusuf3000
03/26/2018, 1:48 PMexpect
class called Date:
expect class Date() {
companion object {
val current: Double
}
}
This is the ios actual:
package com.careem.adma.booking.framework.Date
import platform.Foundation.*
actual class Date actual constructor () {
actual companion object {
actual val current: Double = NSDate.timeIntervalSince1970()
}
}
but i’m getting this error:
error: unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
@ObjCMethod public external fun NSDate.timeIntervalSince1970(): NSTimeInterval /* = Double */ defined in platform.Foundation
actual val current: Double = NSDate.timeIntervalSince1970()
molikto
03/27/2018, 7:41 AMjkbbwr
03/27/2018, 4:17 PMsdeleuze
03/28/2018, 8:56 AMSam
03/28/2018, 1:45 PM//Kotlin class taking an array of functions
class Store (private val repositories: Map<String, Repository<*>>,
private val middleware: List<Middleware> = emptyList()){
//The function definitions
typealias DispatchFunction = (cmd: Command) -> Unit
typealias Middleware = (dispatch: DispatchFunction, repositories: Map<String, Repository<*>>) -> (DispatchFunction) -> DispatchFunction
//The ObjC header file that is generated
-(instancetype)initWithRepositories:(NSDictionary<NSString*, id<PistachioRepository>>*)repositories middleware:(NSArray<PistachioStdlibUnit*(^)(id<PistachioCommand>)(^)(PistachioStdlibUnit*(^)(id<PistachioCommand>))(^)(PistachioStdlibUnit*(^)(id<PistachioCommand>), NSDictionary<NSString*, id<PistachioRepository>>*)>*)middleware NS_SWIFT_NAME(init(repositories:middleware:)) NS_DESIGNATED_INITIALIZER;
The error message is Pistachio.h:86:168: Block pointer to non-function type is invalid
. Admittedly this is not a pretty function header and I'll probably refactor it since it seems to be a little too functional for ObjC. The code with the issue can be found at https://github.com/samus/pistachio/commit/4537d11648563596db6be22a53bb72a38a6be9eeSam
03/29/2018, 4:54 AMAccount
defined in Swift as a subclass of NSObject. I'm trying to pass it into a method of a class in a framework. However to pass that object to some of the foundation classes it needs to be of type NSObject or the compiler will complain. Any cast I've tried has failed at runtime with an exception for me. If I take out the if check it will give a class cast exception
override fun put(obj: T): UUID {
if (obj !is ObjCObject) { //Tried NSObject, NSObjectProtocol
throw IllegalArgumentException("Object: $obj must be a subclass of NSObject.")
}
val objc = obj as ObjCObject
val data = NSKeyedArchiver.archivedDataWithRootObject(objc) // Won't take obj so need to cast.
...
}
//Swift class
class Account: NSObject {
let name: String
init(name: String) {
self.name = name
}
}
J-Rojas
03/30/2018, 1:19 PMnon-final Kotlin subclasses of Objective-C classes are not yet supported
If I understand this error correctly, I cannot create my intermediate UIViewController subclass in Kotlin. Will a fix for this be addressed soon? I'm trying to imagine if a workaround is possible.mikehearn
03/30/2018, 3:01 PMmikehearn
03/30/2018, 4:02 PMJ-Rojas
03/30/2018, 5:58 PMdispatch_async
on different queues. Lambdas (blocks) that are born on the Swift side but executed in the Kotlin compiled code work fine. But Lambdas born on the Kotlin side executed in a different thread than they were born in cause a crash. I'll have to create a code sample since it's not straightforward, but it is a common use case.mikehearn
03/30/2018, 9:12 PMnapperley
03/31/2018, 1:32 AMJ-Rojas
03/31/2018, 3:33 AMnapperley
04/01/2018, 6:59 AMalloc
and allocArray
functions only handle primitive types.jkbbwr
04/01/2018, 12:08 PMstaticLibraries
in gradle for cinteropAregev2
04/01/2018, 2:36 PMjkbbwr
04/01/2018, 3:19 PM#ifndef _SEAHORN__H_
#define _SEAHORN__H_
#ifdef __cplusplus
extern "C" {
#endif
extern void __VERIFIER_error (void);
extern void __VERIFIER_assume (int);
#ifdef __cplusplus
}
#endif
#define assume __VERIFIER_assume
#define sassert(X) (void)((X) || (__VERIFIER_error (), 0))
#endif
qlitzler
04/01/2018, 4:03 PMqlitzler
04/01/2018, 4:03 PMolonho
04/01/2018, 4:30 PMqlitzler
04/01/2018, 4:37 PM