From d78fee1367fb98e786046bc0267db1b0f19cbd9f Mon Sep 17 00:00:00 2001 From: Rintaro Ishizaki Date: Tue, 17 Jun 2025 13:05:02 -0700 Subject: [PATCH] [JExtract] Prohibit 'throws' in FFM generator It's just not supported yet. --- .../FFMSwift2JavaGenerator+FunctionLowering.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/JExtractSwiftLib/FFM/CDeclLowering/FFMSwift2JavaGenerator+FunctionLowering.swift b/Sources/JExtractSwiftLib/FFM/CDeclLowering/FFMSwift2JavaGenerator+FunctionLowering.swift index 6938dc58..7609937d 100644 --- a/Sources/JExtractSwiftLib/FFM/CDeclLowering/FFMSwift2JavaGenerator+FunctionLowering.swift +++ b/Sources/JExtractSwiftLib/FFM/CDeclLowering/FFMSwift2JavaGenerator+FunctionLowering.swift @@ -109,6 +109,11 @@ struct CdeclLowering { ) } + for effect in signature.effectSpecifiers { + // Prohibit any effects for now. + throw LoweringError.effectNotSupported(effect) + } + // Lower the result. let loweredResult = try lowerResult(signature.result.type) @@ -642,4 +647,5 @@ extension LoweredFunctionSignature { enum LoweringError: Error { case inoutNotSupported(SwiftType) case unhandledType(SwiftType) + case effectNotSupported(SwiftEffectSpecifier) }