File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
packages/transform/src/transformers Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -924,8 +924,14 @@ export class V13ToV14Transformer {
924924 : [ this . transform ( result . objargs , context ) ] ;
925925 }
926926
927- if ( result . objfuncargs !== undefined ) {
928- const shouldPreserveObjfuncargs = this . shouldPreserveObjfuncargs ( context ) ;
927+ // Handle objfuncargs based on context
928+ const shouldCreateObjfuncargs = this . shouldCreateObjfuncargs ( context ) ;
929+ const shouldPreserveObjfuncargs = this . shouldPreserveObjfuncargs ( context ) ;
930+
931+ if ( shouldCreateObjfuncargs ) {
932+ // For CreateCastStmt contexts, always set empty objfuncargs
933+ result . objfuncargs = [ ] ;
934+ } else if ( result . objfuncargs !== undefined ) {
929935 if ( shouldPreserveObjfuncargs ) {
930936 result . objfuncargs = Array . isArray ( result . objfuncargs )
931937 ? result . objfuncargs . map ( ( item : any ) => this . transform ( item , context ) )
@@ -939,6 +945,17 @@ export class V13ToV14Transformer {
939945 }
940946
941947 private shouldCreateObjfuncargs ( context : TransformerContext ) : boolean {
948+ if ( ! context . parentNodeTypes || context . parentNodeTypes . length === 0 ) {
949+ return false ;
950+ }
951+
952+ // CreateCastStmt contexts need empty objfuncargs added in PG14
953+ for ( const parentType of context . parentNodeTypes ) {
954+ if ( parentType === 'CreateCastStmt' ) {
955+ return true ;
956+ }
957+ }
958+
942959 return false ;
943960 }
944961
You can’t perform that action at this time.
0 commit comments