File: unionExcessPropsWithPartialMember.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (35 lines) | stat: -rw-r--r-- 1,298 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
=== tests/cases/compiler/unionExcessPropsWithPartialMember.ts ===
interface A {
>A : Symbol(A, Decl(unionExcessPropsWithPartialMember.ts, 0, 0))

    unused?: string;
>unused : Symbol(A.unused, Decl(unionExcessPropsWithPartialMember.ts, 0, 13))

    x: string;
>x : Symbol(A.x, Decl(unionExcessPropsWithPartialMember.ts, 1, 20))
}

interface B {
>B : Symbol(B, Decl(unionExcessPropsWithPartialMember.ts, 3, 1))

    x: string;
>x : Symbol(B.x, Decl(unionExcessPropsWithPartialMember.ts, 5, 13))

    y: string;
>y : Symbol(B.y, Decl(unionExcessPropsWithPartialMember.ts, 6, 14))
}

declare var ab: A | B;
>ab : Symbol(ab, Decl(unionExcessPropsWithPartialMember.ts, 10, 11))
>A : Symbol(A, Decl(unionExcessPropsWithPartialMember.ts, 0, 0))
>B : Symbol(B, Decl(unionExcessPropsWithPartialMember.ts, 3, 1))

declare var a: A;
>a : Symbol(a, Decl(unionExcessPropsWithPartialMember.ts, 11, 11))
>A : Symbol(A, Decl(unionExcessPropsWithPartialMember.ts, 0, 0))

ab = {...a, y: (null as any as string | undefined)}; // Should be allowed, since `y` is missing on `A`
>ab : Symbol(ab, Decl(unionExcessPropsWithPartialMember.ts, 10, 11))
>a : Symbol(a, Decl(unionExcessPropsWithPartialMember.ts, 11, 11))
>y : Symbol(y, Decl(unionExcessPropsWithPartialMember.ts, 13, 11))