Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,14 @@ extension JNISwift2JavaGenerator {
genericParameters: [SwiftGenericParameterDeclaration],
genericRequirements: [SwiftGenericRequirement],
) throws -> JavaType {
try translateGenericTypeParameter(
switch swiftType {
case let .tuple(elements):
if elements.count != 1 { throw JavaTranslationError.unsupportedSwiftType(swiftType) }
default:
break
}

return try translateGenericTypeParameter(
swiftType,
genericParameters: genericParameters,
genericRequirements: genericRequirements,
Expand Down
30 changes: 30 additions & 0 deletions Tests/JExtractSwiftTests/JNI/JNIDictionaryTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,34 @@ struct JNIDictionaryTest {
]
)
}

@Test("Import: () -> [UInt32: tuple] is unsupported")
func tupleDictionaryValue_swift() throws {
try assertOutput(
input: """
public enum ResponseType {
case ok
}

public class BindingStore {
public typealias RawResponse = (requestId: UInt32, stringResponse: String, responseType: ResponseType, finished: Bool)
public static var completeResponses: [UInt32: RawResponse] = [:]
}
""",
.jni,
.swift,
expectedChunks: [],
notExpectedChunks: [
"""
dictionaryGetJNIValue
""",
"""
getCompleteResponses
""",
"""
setCompleteResponses
""",
]
)
}
}
Loading