@@ -717,13 +717,8 @@ struct StackCodegen {
717717 /// - Returns: An ExprSyntax representing the lift expression
718718 func liftExpression( for type: BridgeType ) -> ExprSyntax {
719719 switch type {
720- case . string, . int, . uint, . bool, . float, . double,
721- . jsObject( nil ) , . jsValue, . swiftStruct, . swiftHeapObject, . unsafePointer,
722- . swiftProtocol, . caseEnum, . associatedValueEnum, . rawValueEnum:
723- return " \( raw: type. swiftType) .bridgeJSLiftParameter() "
724720 case . jsObject( let className? ) :
725721 return " \( raw: className) (unsafelyWrapping: JSObject.bridgeJSLiftParameter()) "
726-
727722 case . nullable( let wrappedType, let kind) :
728723 return liftNullableExpression ( wrappedType: wrappedType, kind: kind)
729724 case . array( let elementType) :
@@ -734,6 +729,8 @@ struct StackCodegen {
734729 return " JSObject.bridgeJSLiftParameter() "
735730 case . void, . namespaceEnum:
736731 return " () "
732+ default :
733+ return " \( raw: type. swiftType) .bridgeJSLiftParameter() "
737734 }
738735 }
739736
@@ -804,14 +801,10 @@ struct StackCodegen {
804801 private func liftNullableExpression( wrappedType: BridgeType , kind: JSOptionalKind ) -> ExprSyntax {
805802 let typeName = kind == . null ? " Optional " : " JSUndefinedOr "
806803 switch wrappedType {
807- case . string, . int, . uint, . bool, . float, . double, . jsObject( nil ) , . jsValue,
808- . swiftStruct, . swiftHeapObject, . caseEnum, . associatedValueEnum, . rawValueEnum,
809- . array, . dictionary:
810- return " \( raw: typeName) < \( raw: wrappedType. swiftType) >.bridgeJSLiftParameter() "
811- case . jsObject( let className? ) :
804+ case . jsObject( let className? ) where className != " JSObject " :
812805 return " \( raw: typeName) <JSObject>.bridgeJSLiftParameter().map { \( raw: className) (unsafelyWrapping: $0) } "
813- case . nullable , . void , . namespaceEnum , . closure , . unsafePointer , . swiftProtocol :
814- fatalError ( " Invalid nullable wrapped type: \( wrappedType) " )
806+ default :
807+ return " \( raw : typeName ) < \( raw : wrappedType. swiftType ) >.bridgeJSLiftParameter() "
815808 }
816809 }
817810
0 commit comments