Summary
BridgeJS code generation fails when a @JS exported function takes an optional @JSClass parameter (e.g. JSAbortSignal?).
Repro
In a BridgeJS-exported Swift API:
@JSClass
public struct JSAbortSignal {
@JSFunction public func addEventListener(type: String, listener: JSTypedClosure<() -> Void>) throws(JSException)
}
@JS
public final class JSCanvasSession {
@JS
public func recognizeText(pageId: String, languageCode: String, abortSignal: JSAbortSignal?) async throws(JSException) -> String {
return "{}"
}
}
Run BridgeJS AoT generation + build.
Actual
Generated code fails to compile in Generated/BridgeJS.swift with optional lift/lower errors for Optional<JSAbortSignal>, e.g.:
no exact matches in call to static method 'bridgeJSLiftParameter'
- candidates require
Wrapped == JSObject or protocol conformances not satisfied by JSAbortSignal
Expected
Optional @JSClass params should be supported, or codegen should emit a clear diagnostic that this shape is unsupported.
Summary
BridgeJS code generation fails when a
@JSexported function takes an optional@JSClassparameter (e.g.JSAbortSignal?).Repro
In a BridgeJS-exported Swift API:
Run BridgeJS AoT generation + build.
Actual
Generated code fails to compile in
Generated/BridgeJS.swiftwith optional lift/lower errors forOptional<JSAbortSignal>, e.g.:no exact matches in call to static method 'bridgeJSLiftParameter'Wrapped == JSObjector protocol conformances not satisfied byJSAbortSignalExpected
Optional
@JSClassparams should be supported, or codegen should emit a clear diagnostic that this shape is unsupported.