rellenberger
03/07/2018, 3:11 PMDiefferson
03/08/2018, 2:13 AMyusuf3000
03/08/2018, 9:13 AMclass TestGenerics<T> {
fun <T>test(type: T) { }
}
And here is the objective C interface :
__attribute__((objc_subclassing_restricted))
@interface CMETestGenerics : KotlinBase
-(instancetype)init NS_SWIFT_NAME(init()) NS_DESIGNATED_INITIALIZER;
-(void)testType:(id _Nullable)type NS_SWIFT_NAME(test(type:));
@end;
As you can see there is no longer any generics once imported into objective C. Does anybody know a solution this? Or a workaround?rootandy
03/08/2018, 9:51 AMrellenberger
03/08/2018, 7:30 PMAregev2
03/09/2018, 10:28 AMAregev2
03/10/2018, 4:51 PMAregev2
03/10/2018, 4:52 PMqlitzler
03/10/2018, 7:14 PMAregev2
03/11/2018, 10:55 AMAregev2
03/11/2018, 1:56 PMqlitzler
03/11/2018, 4:09 PMgoto1134
03/11/2018, 8:00 PMwalled
03/11/2018, 11:52 PMakoncius
03/12/2018, 8:29 AMfitzoh
03/12/2018, 10:22 PMgoto1134
03/13/2018, 8:12 AMMatthias Schuster
03/15/2018, 3:32 AMstan0
03/15/2018, 2:32 PMSimone Civetta
03/16/2018, 1:15 AMqlitzler
03/16/2018, 11:25 AMspierce7
03/17/2018, 9:46 PMKonstantin Petrukhnov
03/19/2018, 9:36 AMhellotimmutton
03/20/2018, 3:08 AMcommon
and a module common-frontend
. is it possible to have one of my modules (eg android
) depend on common-frontend
and get the classes in both of these modules. at the moment if i make common-front
have a dependency on common
, android
wont recognise the stuff from common
and I cant do multiple expected-by
statements to include itJ-Rojas
03/20/2018, 10:27 PMactual/expect
classes in a multiplatform project using K/N for iPhone target. I'm running the gradle build task compileKonan
and the compiler generates an error when compiling one my actual
class definitions.
UUID.kt:3:14: error: actual class 'UUID' has no corresponding expected declaration
actual class UUID {
My gradle.build file for the native project
apply plugin: 'konan'
konan.targets = ["iphone", "iphone_sim"]
konanArtifacts {
library('native') {
enableMultiplatform true
commonSourceSet 'main'
srcDir 'src/main/kotlin'
}
}
dependencies {
expectedBy project(':common')
}
task test(dependsOn: run)
Any thoughts on how I might have misconfigured my gradle build? I'm using v0.6 kotlin-native plugin for MacOS. My actual/expect
declarations work in my common and android modules in the multiplatform project, not in the native build currently.
My class is defined in the common module as such:
package some.package.name
expect class UUID {
companion object {
fun randomUUID() : UUID
}
}
Nail Gilaziev
03/21/2018, 10:30 AMSam
03/21/2018, 5:32 PMplatform.darwin
but that definition file doesn't exist for macOS. Shouldn't there be a platform.darwin
file for macOS as well?J-Rojas
03/22/2018, 8:52 AMexception: kotlin.TypeCastException: null cannot be cast to non-null type org.jetbrains.kotlin.ir.symbols.IrValueSymbol
. I'm guessing this is a compiler exception since I'm not referering to IrValueSymbol directly. Any ideas on what might cause this?goto1134
03/22/2018, 8:18 PM