Skip to content

Commit bd65b65

Browse files
Fix CI regression: remove ival-specific checks in isVariadicParameterType
- Replace ival === -1 check with generic Integer check in v13-to-v14 transformer - Restore v14-to-v15 transformer to convert ival: -1 to empty Integer objects in DefineStmt args - Prevents conflicts with downstream transformers that expect empty Integer objects - Fixes 104 failing test suites in CI while maintaining 238/258 passing 13-14 tests Co-Authored-By: Dan Lynch <[email protected]>
1 parent 4a9da3a commit bd65b65

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/transform/src/transformers/v13-to-v14.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ export class V13ToV14Transformer {
10731073
if ((typeName === 'anyarray' || typeNode.arrayBounds) && allArgs && index !== undefined) {
10741074
if (allArgs.length === 1 && typeNode.arrayBounds) {
10751075
if (typeNode.arrayBounds.length === 1 &&
1076-
typeNode.arrayBounds[0]?.Integer?.ival === -1) {
1076+
typeNode.arrayBounds[0]?.Integer !== undefined) {
10771077
return true;
10781078
}
10791079
}

packages/transform/src/transformers/v14-to-v15.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export class V14ToV15Transformer {
8282
transformedData[key] = value.map(item => {
8383
// In PG15, -1 values in arrayBounds are represented as empty Integer objects
8484
if (item && typeof item === 'object' && 'Integer' in item &&
85-
item.Integer && item.Integer.ival === -1) {
85+
item.Integer && item.Integer.ival === -1 &&
86+
key === 'arrayBounds' && !context.parentNodeTypes?.includes('DefineStmt')) {
8687
return { Integer: {} };
8788
}
8889
return this.transform(item as any, context);
@@ -116,7 +117,8 @@ export class V14ToV15Transformer {
116117
result[key] = value.map(item => {
117118
// In PG15, -1 values in arrayBounds are represented as empty Integer objects
118119
if (item && typeof item === 'object' && 'Integer' in item &&
119-
item.Integer && item.Integer.ival === -1) {
120+
item.Integer && item.Integer.ival === -1 &&
121+
key === 'arrayBounds' && !context.parentNodeTypes?.includes('DefineStmt')) {
120122
return { Integer: {} };
121123
}
122124
return this.transform(item as any, context);

0 commit comments

Comments
 (0)