Open Alex009 opened 2 years ago
Kotlin/Native use mangling of conflicted names. For example with code:
interface A { fun test(value: Int) } interface B { fun test(value: String) }
we got after compilation:
protocol A { func test(value: Int) } protocol B { func test(value_: String) }
same will be with same classnames some.package.A, some.other.package.A will be A and A_.
some.package.A
some.other.package.A
A
A_
now generated Swift code can't detect what name will be mangled. but we can use @KSwiftOverrideName annotation to give new name manually.
@KSwiftOverrideName
maybe we can resolve mangling automatically?
this code:
echo "import shared\n:type lookup shared" | \ xcrun --sdk macosx swift -F../shared/build/cocoapods/framework/ | \ tail -n+2 >| ./Sources/Shared/Shared.swift
generates swift api for compiled kotlin framework. and maybe we can find new name of kotlin definition using this generated swift code and swift-ast
Kotlin/Native use mangling of conflicted names. For example with code:
we got after compilation:
same will be with same classnames
some.package.A
,some.other.package.A
will beA
andA_
.now generated Swift code can't detect what name will be mangled. but we can use
@KSwiftOverrideName
annotation to give new name manually.maybe we can resolve mangling automatically?
this code:
generates swift api for compiled kotlin framework. and maybe we can find new name of kotlin definition using this generated swift code and swift-ast