The Foundation types are currently translated in full only when there is an explicit Foundation import in the source files where they are used. IIUC, this way Swift Java guards against user-defined Data types since it can't typecheck the Data use site. This behavior is visible in Samples/SwiftJavaExtractFFMSampleApp/Sources/MySwiftLibrary/MySwiftLibrary.swift if you switch import Foundation to import AppKit, which I think exports the Foundation through the modulemap, and run the sample. The jextract task succeeds, but the Java compilation fails because the Data.java wrapper is missing the expected APIs.
Similarly, the @_exported import Foundation doesn't seem to work.
The
Foundationtypes are currently translated in full only when there is an explicit Foundation import in the source files where they are used. IIUC, this way Swift Java guards against user-definedDatatypes since it can't typecheck theDatause site. This behavior is visible inSamples/SwiftJavaExtractFFMSampleApp/Sources/MySwiftLibrary/MySwiftLibrary.swiftif you switchimport Foundationtoimport AppKit, which I think exports theFoundationthrough the modulemap, and run the sample. Thejextracttask succeeds, but the Java compilation fails because theData.javawrapper is missing the expected APIs.Similarly, the
@_exported import Foundationdoesn't seem to work.