File: renameObjectSpread.ts

package info (click to toggle)
node-typescript 4.8.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 523,068 kB
  • sloc: javascript: 1,735,777; makefile: 7; sh: 1
file content (16 lines) | stat: -rw-r--r-- 579 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// <reference path='fourslash.ts'/>

////interface A1 { [|[|{| "contextRangeIndex": 0 |}a|]: number|] };
////interface A2 { [|[|{| "contextRangeIndex": 2 |}a|]?: number|] };
////let a1: A1;
////let a2: A2;
////let a12 = { ...a1, ...a2 };
////a12.[|a|];

const [r0Def, r0, r1Def, r1, r2] = test.ranges();
// A1 unions with A2, so rename A1.a and a12.a
verify.renameLocations(r0, [r0, r2]);
// A1 unions with A2, so rename A2.a and a12.a
verify.renameLocations(r1, [r1, r2]);
// a12.a unions A1.a and A2.a, so rename A1.a, A2.a and a12.a
verify.renameLocations(r2, [r0, r1, r2]);