Skip to content

Commit

Permalink
null save access
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Potucek committed Jan 3, 2025
1 parent b6488c8 commit 4daa033
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions openrewrite/test/javascript/parser/typeLiteral.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ describe('type literal mapping', () => {
`)
);
});
test('null save access ?.', () => {
rewriteRun(
//language=typescript
typeScript(`
const array: Array<any> = null;
console.log(array.length);
`),
//language=typescript
typeScript(`
const array: Array<any> = null;
console.log(array?.length);
`)
);
});

test('type literal', () => {
rewriteRun(
Expand Down

0 comments on commit 4daa033

Please sign in to comment.