Skip to content

Commit 1e9929a

Browse files
committed
Make module imports public to survive internal imports by default
Maybe resolves #705 Alternatives would be to keep internal imports but that's an adventure since we need to keep those thunks NOT dead code eliminated... and we cannot use @used until swift 6.3 so this could not be used in previous swift builds...
1 parent e0127ae commit 1e9929a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Sources/JExtractSwiftLib/JNI/JNISwift2JavaGenerator+SwiftThunkPrinting.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,13 +836,15 @@ extension JNISwift2JavaGenerator {
836836
}
837837

838838
private func printHeader(_ printer: inout CodePrinter) {
839+
// `public import` so the thunk file remains valid under
840+
// `InternalImportsByDefault` (SE-0409)
839841
printer.print(
840842
"""
841843
// Generated by swift-java
842844
843-
import SwiftJava
844-
import SwiftJavaJNICore
845-
import SwiftJavaRuntimeSupport
845+
public import SwiftJava
846+
public import SwiftJavaJNICore
847+
public import SwiftJavaRuntimeSupport
846848
847849
"""
848850
)

0 commit comments

Comments
 (0)