File: intersectionTypeAssignment.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 203,960 kB
  • sloc: sh: 11; makefile: 5
file content (45 lines) | stat: -rw-r--r-- 2,354 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
43
44
45
tests/cases/conformance/types/intersection/intersectionTypeAssignment.ts(8,1): error TS2322: Type '{ a: string; }' is not assignable to type '{ a: string; b: string; }'.
  Property 'b' is missing in type '{ a: string; }'.
tests/cases/conformance/types/intersection/intersectionTypeAssignment.ts(9,1): error TS2322: Type '{ a: string; }' is not assignable to type '{ a: string; } & { b: string; }'.
  Type '{ a: string; }' is not assignable to type '{ b: string; }'.
    Property 'b' is missing in type '{ a: string; }'.
tests/cases/conformance/types/intersection/intersectionTypeAssignment.ts(13,1): error TS2322: Type '{ b: string; }' is not assignable to type '{ a: string; b: string; }'.
  Property 'a' is missing in type '{ b: string; }'.
tests/cases/conformance/types/intersection/intersectionTypeAssignment.ts(14,1): error TS2322: Type '{ b: string; }' is not assignable to type '{ a: string; } & { b: string; }'.
  Type '{ b: string; }' is not assignable to type '{ a: string; }'.
    Property 'a' is missing in type '{ b: string; }'.


==== tests/cases/conformance/types/intersection/intersectionTypeAssignment.ts (4 errors) ====
    var a: { a: string };
    var b: { b: string };
    var x: { a: string, b: string };
    var y: { a: string } & { b: string };
    
    a = x;
    a = y;
    x = a;  // Error
    ~
!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: string; b: string; }'.
!!! error TS2322:   Property 'b' is missing in type '{ a: string; }'.
    y = a;  // Error
    ~
!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: string; } & { b: string; }'.
!!! error TS2322:   Type '{ a: string; }' is not assignable to type '{ b: string; }'.
!!! error TS2322:     Property 'b' is missing in type '{ a: string; }'.
    
    b = x;
    b = y;
    x = b;  // Error
    ~
!!! error TS2322: Type '{ b: string; }' is not assignable to type '{ a: string; b: string; }'.
!!! error TS2322:   Property 'a' is missing in type '{ b: string; }'.
    y = b;  // Error
    ~
!!! error TS2322: Type '{ b: string; }' is not assignable to type '{ a: string; } & { b: string; }'.
!!! error TS2322:   Type '{ b: string; }' is not assignable to type '{ a: string; }'.
!!! error TS2322:     Property 'a' is missing in type '{ b: string; }'.
    
    x = y;
    y = x;