Skip to content

Commit c181750

Browse files
committed
Update to the latest Swift export version
1 parent 9a58408 commit c181750

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
systemProp.kotlinVersion=2.0.0-RC2
22
systemProp.kotlinIdeVersion=1.9.20-506
33
systemProp.kotlinIdeVersionSuffix=IJ8109.175
4-
systemProp.swiftExportVersion=2.0.20-dev-3080
4+
systemProp.swiftExportVersion=2.0.20-dev-3623
55
systemProp.policy=executor.policy
66
systemProp.indexes=indexes.json
77
systemProp.indexesJs=indexesJs.json

src/test/kotlin/com/compiler/server/SwiftConverterTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class SwiftConverterTest : BaseExecutorTest() {
3636
input = "fun foo(): UInt = 42",
3737
expected = """
3838
public func foo() -> Swift.UInt32 {
39-
fatalError()
39+
stub()
4040
}
4141
""".trimIndent()
4242
)
@@ -49,10 +49,10 @@ class SwiftConverterTest : BaseExecutorTest() {
4949
5050
public class MyClass : KotlinRuntime.KotlinBase {
5151
public override init() {
52-
fatalError()
52+
stub()
5353
}
5454
public func A() -> Swift.Void {
55-
fatalError()
55+
stub()
5656
}
5757
}
5858
""".trimIndent()
@@ -69,7 +69,7 @@ class SwiftConverterTest : BaseExecutorTest() {
6969
public extension Playground.foo.bar {
7070
public static var myProperty: Swift.Int32 {
7171
get {
72-
fatalError()
72+
stub()
7373
}
7474
}
7575
}
@@ -92,7 +92,7 @@ class SwiftConverterTest : BaseExecutorTest() {
9292
input = "fun foo(): Bar = error()",
9393
expected = """
9494
public func foo() -> ERROR_TYPE {
95-
fatalError()
95+
stub()
9696
}
9797
""".trimIndent()
9898
)

swift-export-playground/src/main/kotlin/Runner.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import org.jetbrains.kotlin.analysis.project.structure.builder.buildKtLibraryMod
88
import org.jetbrains.kotlin.analysis.project.structure.builder.buildKtSourceModule
99
import org.jetbrains.kotlin.platform.konan.NativePlatforms
1010
import org.jetbrains.kotlin.psi.KtFile
11+
import org.jetbrains.kotlin.sir.SirFunctionBody
1112
import org.jetbrains.kotlin.sir.SirModule
1213
import org.jetbrains.kotlin.sir.SirMutableDeclarationContainer
1314
import org.jetbrains.kotlin.sir.util.addChild
@@ -37,7 +38,14 @@ fun runSwiftExport(
3738
}
3839
}
3940
}
40-
SirAsSwiftSourcesPrinter.print(sirModule, stableDeclarationsOrder = true, renderDocComments = true)
41+
SirAsSwiftSourcesPrinter.print(
42+
sirModule,
43+
stableDeclarationsOrder = true,
44+
renderDocComments = true,
45+
emptyBodyStub = SirFunctionBody(
46+
listOf("stub()")
47+
)
48+
)
4149
}
4250
}
4351

swift-export-playground/src/test/kotlin/Tests.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SwiftExportTests {
2727
""",
2828
"""
2929
public func foo() -> Swift.Int32 {
30-
fatalError()
30+
stub()
3131
}
3232
"""
3333
)
@@ -42,7 +42,7 @@ class SwiftExportTests {
4242
4343
public class A : KotlinRuntime.KotlinBase {
4444
public override init() {
45-
fatalError()
45+
stub()
4646
}
4747
}
4848
""".trimIndent()
@@ -59,11 +59,11 @@ class SwiftExportTests {
5959
public class O : KotlinRuntime.KotlinBase {
6060
public static var shared: Playground.O {
6161
get {
62-
fatalError()
62+
stub()
6363
}
6464
}
6565
private override init() {
66-
fatalError()
66+
stub()
6767
}
6868
}
6969
""".trimIndent()

0 commit comments

Comments
 (0)