@@ -1133,6 +1133,14 @@ export class V13ToV14Transformer {
11331133 // Handle TypeName wrapper
11341134 const typeNode = argType . TypeName || argType ;
11351135
1136+ if ( typeNode . arrayBounds && Array . isArray ( typeNode . arrayBounds ) ) {
1137+ for ( const bound of typeNode . arrayBounds ) {
1138+ if ( bound . Integer && bound . Integer . ival === - 1 ) {
1139+ return true ;
1140+ }
1141+ }
1142+ }
1143+
11361144 if ( typeNode . names && Array . isArray ( typeNode . names ) ) {
11371145 const typeName = typeNode . names [ typeNode . names . length - 1 ] ?. String ?. str ;
11381146
@@ -1972,7 +1980,7 @@ export class V13ToV14Transformer {
19721980 return pg13ToP14TableLikeMapping [ option ] !== undefined ? pg13ToP14TableLikeMapping [ option ] : option ;
19731981 }
19741982
1975- private extractParameterNameFromFunctionName ( functionName : string | undefined , paramIndex : number ) : string | undefined {
1983+ private extractParameterNameFromFunctionName ( functionName : string | undefined , paramIndex : number , isVariadic ?: boolean ) : string | undefined {
19761984 if ( ! functionName ) {
19771985 return undefined ;
19781986 }
@@ -1991,6 +1999,7 @@ export class V13ToV14Transformer {
19911999
19922000 // Handle specific functions from test cases that have parameter names
19932001 if ( functionName === 'invert' ) return 'x' ;
2002+ if ( functionName === 'dfunc' && isVariadic ) return 'a' ; // Only for VARIADIC parameters
19942003
19952004 // Functions like testfunc1(int), testfunc2(int), testfunc4(boolean) should NOT have parameter names
19962005 return undefined ;
@@ -2099,7 +2108,8 @@ export class V13ToV14Transformer {
20992108 functionName = lastName . String . str ;
21002109 }
21012110 }
2102- paramName = this . extractParameterNameFromFunctionName ( functionName , index ) ;
2111+ const isVariadic = this . isVariadicParameterType ( arg , index , result . objargs , context ) ;
2112+ paramName = this . extractParameterNameFromFunctionName ( functionName , index , isVariadic ) ;
21032113 }
21042114
21052115
@@ -3273,9 +3283,6 @@ export class V13ToV14Transformer {
32733283 // Handle specific mode mappings between PG13 and PG14
32743284 switch ( pg13Mode ) {
32753285 case 'FUNC_PARAM_VARIADIC' :
3276- if ( context && context . parentNodeTypes ?. includes ( 'DropStmt' ) ) {
3277- return 'FUNC_PARAM_DEFAULT' ;
3278- }
32793286 return 'FUNC_PARAM_VARIADIC' ;
32803287 case 'FUNC_PARAM_IN' :
32813288 if ( context && context . parentNodeTypes ?. includes ( 'DropStmt' ) ) {
0 commit comments