File: invalidVoidValues.errors.txt

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 (64 lines) | stat: -rw-r--r-- 3,094 bytes parent folder | download | duplicates (3)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(3,1): error TS2322: Type 'string' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(4,1): error TS2322: Type 'boolean' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(7,1): error TS2322: Type 'typeof E' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(8,1): error TS2322: Type 'E' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(12,1): error TS2322: Type 'C' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(16,1): error TS2322: Type 'I' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(18,1): error TS2322: Type '{ f(): void; }' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(21,1): error TS2322: Type 'typeof M' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(24,5): error TS2322: Type 'T' is not assignable to type 'void'.
tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(26,5): error TS2322: Type '<T>(a: T) => void' is not assignable to type 'void'.


==== tests/cases/conformance/types/primitives/void/invalidVoidValues.ts (11 errors) ====
    var x: void;
    x = 1;
    ~
!!! error TS2322: Type 'number' is not assignable to type 'void'.
    x = '';
    ~
!!! error TS2322: Type 'string' is not assignable to type 'void'.
    x = true;
    ~
!!! error TS2322: Type 'boolean' is not assignable to type 'void'.
    
    enum E { A }
    x = E;
    ~
!!! error TS2322: Type 'typeof E' is not assignable to type 'void'.
    x = E.A;
    ~
!!! error TS2322: Type 'E' is not assignable to type 'void'.
    
    class C { foo: string }
    var a: C;
    x = a;
    ~
!!! error TS2322: Type 'C' is not assignable to type 'void'.
    
    interface I { foo: string }
    var b: I;
    x = b;
    ~
!!! error TS2322: Type 'I' is not assignable to type 'void'.
    
    x = { f() {} }
    ~
!!! error TS2322: Type '{ f(): void; }' is not assignable to type 'void'.
    
    module M { export var x = 1; }
    x = M;
    ~
!!! error TS2322: Type 'typeof M' is not assignable to type 'void'.
    
    function f<T>(a: T) {
        x = a;
        ~
!!! error TS2322: Type 'T' is not assignable to type 'void'.
!!! related TS2208 tests/cases/conformance/types/primitives/void/invalidVoidValues.ts:23:12: This type parameter might need an `extends void` constraint.
    }
    x = f;
        ~
!!! error TS2322: Type '<T>(a: T) => void' is not assignable to type 'void'.
!!! related TS6212 tests/cases/conformance/types/primitives/void/invalidVoidValues.ts:26:5: Did you mean to call this expression?