Skip to content

Commit 01c823d

Browse files
committed
fix variable import test for new scheme
1 parent 69cb71e commit 01c823d

File tree

3 files changed

+11
-36
lines changed

3 files changed

+11
-36
lines changed

Sources/JExtractSwift/ThunkNameRegistry.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15+
import SwiftSyntax
16+
1517
/// Registry of names we've already emitted as @_cdecl and must be kept unique.
1618
/// In order to avoid duplicate symbols, the registry can append some unique identifier to duplicated names
1719
package struct ThunkNameRegistry {

Tests/JExtractSwiftTests/ThunkNameRegistryTests.swift

Lines changed: 0 additions & 29 deletions
This file was deleted.

Tests/JExtractSwiftTests/VariableImportTests.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,20 @@ final class VariableImportTests {
4949
"""
5050
private static class counterInt {
5151
public static final FunctionDescriptor DESC_GET = FunctionDescriptor.of(
52-
/* -> */SWIFT_INT,
52+
/* -> */SWIFT_INT,
5353
SWIFT_POINTER
54-
);
55-
public static final MemorySegment ADDR_GET =
56-
FakeModule.findOrThrow("swiftjava_FakeModule_MySwiftClass_counterInt$1");
54+
);
55+
public static final MemorySegment ADDR_GET =
56+
FakeModule.findOrThrow("swiftjava_FakeModule_MySwiftClass_counterInt");
57+
5758
public static final MethodHandle HANDLE_GET = Linker.nativeLinker().downcallHandle(ADDR_GET, DESC_GET);
5859
public static final FunctionDescriptor DESC_SET = FunctionDescriptor.ofVoid(
59-
SWIFT_INT,
60+
SWIFT_INT,
6061
SWIFT_POINTER
61-
);
62+
);
6263
public static final MemorySegment ADDR_SET =
63-
FakeModule.findOrThrow("swiftjava_FakeModule_MySwiftClass_counterInt__$1");
64+
FakeModule.findOrThrow("swiftjava_FakeModule_MySwiftClass_counterInt");
65+
6466
public static final MethodHandle HANDLE_SET = Linker.nativeLinker().downcallHandle(ADDR_SET, DESC_SET);
6567
}
6668
""",

0 commit comments

Comments
 (0)