File: commonTypeIntersection.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (26 lines) | stat: -rw-r--r-- 2,112 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
tests/cases/conformance/types/intersection/commonTypeIntersection.ts(2,5): error TS2322: Type '{ __typename?: "TypeTwo"; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne"; } & { a: boolean; }'.
  Type '{ __typename?: "TypeTwo"; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne"; }'.
    Types of property '__typename' are incompatible.
      Type '"TypeTwo"' is not assignable to type '"TypeOne"'.
tests/cases/conformance/types/intersection/commonTypeIntersection.ts(4,5): error TS2322: Type '{ __typename?: "TypeTwo"; } & string' is not assignable to type '{ __typename?: "TypeOne"; } & string'.
  Type '{ __typename?: "TypeTwo"; } & string' is not assignable to type '{ __typename?: "TypeOne"; }'.
    Types of property '__typename' are incompatible.
      Type '"TypeTwo"' is not assignable to type '"TypeOne"'.


==== tests/cases/conformance/types/intersection/commonTypeIntersection.ts (2 errors) ====
    declare let x1: { __typename?: 'TypeTwo' } & { a: boolean };
    let y1: { __typename?: 'TypeOne' } & { a: boolean} = x1;  // should error here
        ~~
!!! error TS2322: Type '{ __typename?: "TypeTwo"; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne"; } & { a: boolean; }'.
!!! error TS2322:   Type '{ __typename?: "TypeTwo"; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne"; }'.
!!! error TS2322:     Types of property '__typename' are incompatible.
!!! error TS2322:       Type '"TypeTwo"' is not assignable to type '"TypeOne"'.
    declare let x2: { __typename?: 'TypeTwo' } & string;
    let y2: { __typename?: 'TypeOne' } & string = x2;  // should error here
        ~~
!!! error TS2322: Type '{ __typename?: "TypeTwo"; } & string' is not assignable to type '{ __typename?: "TypeOne"; } & string'.
!!! error TS2322:   Type '{ __typename?: "TypeTwo"; } & string' is not assignable to type '{ __typename?: "TypeOne"; }'.
!!! error TS2322:     Types of property '__typename' are incompatible.
!!! error TS2322:       Type '"TypeTwo"' is not assignable to type '"TypeOne"'.