Ratul Sarna
12/04/2023, 8:51 PM@SealedInterop.Enabled
sealed interface NativeScreen {
data object Home : NativeScreen
data class Song(val argument: ScreenArgument) : NativeScreen
data class Artist(val argument: ScreenArgument) : NativeScreen
}
But the only case that is available on Swift side is .else
after switching onEnum(of: nativeScreen)
Can someone help me understand why this could be happening? There are other sealed classes in the project that are working fine.Ratul Sarna
12/04/2023, 9:19 PMFilip Dolník
12/05/2023, 8:13 AMRatul Sarna
12/05/2023, 9:09 AMtargets.withType<KotlinNativeTarget>().configureEach {
binaries.withType<Framework> {}
}
Filip Dolník
12/05/2023, 9:11 AMRatul Sarna
12/05/2023, 9:14 AMContent_stateNativeScreen
instead of NativeScreen
.Filip Dolník
12/05/2023, 9:16 AMRatul Sarna
12/05/2023, 9:18 AMtargets.withType<KotlinNativeTarget>().configureEach {
binaries.withType<Framework> {}
}
Filip Dolník
12/05/2023, 9:20 AMRatul Sarna
12/05/2023, 9:21 AM__attribute__((swift_name("NativeScreen")))
@interface ProjectNameNativeScreen : ProjectNameBase
@end
Filip Dolník
12/05/2023, 9:23 AMRatul Sarna
12/05/2023, 9:24 AMFilip Dolník
12/05/2023, 9:24 AMFilip Dolník
12/05/2023, 9:24 AMFilip Dolník
12/05/2023, 9:25 AMFilip Dolník
12/05/2023, 9:25 AMFilip Dolník
12/05/2023, 9:25 AM__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("__SkieTypeExportsKt")))
@interface Kotlin__SkieTypeExportsKt : KotlinBase
+ (void)skieTypeExportsP0:(KotlinDependencyNativeScreenArtist *)p0 p1:(KotlinDependencyNativeScreenHome *)p1 p2:(KotlinDependencyNativeScreenSong *)p2 __attribute__((swift_name("skieTypeExports(p0:p1:p2:)")));
@end
Ratul Sarna
12/05/2023, 9:28 AMFilip Dolník
12/05/2023, 9:28 AMRatul Sarna
12/05/2023, 9:28 AMRatul Sarna
12/05/2023, 9:35 AMSkieTypeExports
section doesn't have this particular sealed interface but it has another from the same module which is also annotated with SealedInterop.Enabled
Ratul Sarna
12/05/2023, 9:36 AMp147:(ProjectNameContent_stateIndexViewStateLoading *)
where Loading is an implementation of IndexViewState sealed interfaceFilip Dolník
12/05/2023, 9:38 AMFilip Dolník
12/05/2023, 9:38 AMRatul Sarna
12/05/2023, 9:38 AM0.5.6
and 1.9.21
skie {
features {
group {
FlowInterop.Enabled(false)
SuspendInterop.Enabled(false)
SealedInterop.Enabled(false)
EnumInterop.Enabled(false)
}
}
}
Filip Dolník
12/05/2023, 9:42 AMskie { isEnabled.set(false) }
Ratul Sarna
12/05/2023, 9:43 AMFilip Dolník
12/05/2023, 9:43 AMRatul Sarna
12/06/2023, 9:05 AMskie { isEnabled.set(false) }
and not including the module in binaries block, there is no mention of "NativeScreen" in the headers file.
2. After setting skie enabled to true and not including module in binaries, here are the mentions of NativeScreen in headers file -
a. @class ....., ProjectNameModuleNameNativeScreen, .....
b.
__attribute__((swift_name("ModuleNameNativeScreen")))
@interface ProjectNameModuleNameNativeScreen : ProjectNameBase
@end
As before, it is not included in SkieTypeExports
section.Filip Dolník
12/06/2023, 9:08 AMProjectNameModuleNameNativeScreen
class?
Because there should be at least one extra reference somewhere (it might a return type or value parameter of some function, or an inheritance relation)Ratul Sarna
12/06/2023, 9:11 AMRatul Sarna
12/06/2023, 9:14 AM__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("ModuleNameNativeNavigationDescriptor")))
@interface ProjectNameModuleNameNativeNavigationDescriptor : ProjectNameBase
@property (readonly) BOOL clearScreenStack __attribute__((swift_name("clearScreenStack")));
@property (readonly) ProjectNameModuleNameNativeScreen *screen __attribute__((swift_name("screen")));
- (instancetype)initWithScreen:(ProjectNameModuleNameNativeScreen *)screen clearScreenStack:(BOOL)clearScreenStack __attribute__((swift_name("init(screen:clearScreenStack:)"))) __attribute__((objc_designated_initializer));
- (ProjectNameModuleNameNativeNavigationDescriptor *)doCopyScreen:(ProjectNameModuleNameNativeScreen *)screen clearScreenStack:(BOOL)clearScreenStack __attribute__((swift_name("doCopy(screen:clearScreenStack:)")));
- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)")));
- (NSUInteger)hash __attribute__((swift_name("hash()")));
- (NSString *)description __attribute__((swift_name("description()")));
@end
Filip Dolník
12/06/2023, 9:14 AMFilip Dolník
12/06/2023, 9:17 AMdata class NativeNavigationDescriptor(
val screen: NativeScreen,
val clearScreenStack: Boolean,
)
Ratul Sarna
12/06/2023, 9:17 AMFilip Dolník
12/06/2023, 9:18 AMFilip Dolník
12/06/2023, 9:34 AMRatul Sarna
12/06/2023, 9:34 AMFilip Dolník
12/06/2023, 9:38 AMval foo: Flow<NativeNavigationDescriptor>
SKIE also automatically exports a class used exclusively in the Flow type argument because Kotlin doesn’t do that (it doesn’t need to because without SKIE the type argument is erased)
This is handled by the same code as for the sealed classes and the code is supposed to support this, but there is some bug in it.Filip Dolník
12/06/2023, 9:38 AMval foo: NativeNavigationDescriptor
it would work as expectedRatul Sarna
12/06/2023, 9:40 AMRatul Sarna
12/06/2023, 9:41 AMFilip Dolník
12/06/2023, 9:43 AMRatul Sarna
12/06/2023, 9:43 AM