File: parseInvalidNonNullableTypes.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 (68 lines) | stat: -rw-r--r-- 4,783 bytes parent folder | download
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
65
66
67
68
tests/cases/compiler/parseInvalidNonNullableTypes.ts(1,30): error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(5,30): error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(9,16): error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(10,16): error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'number'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(12,16): error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(13,16): error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'number'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(15,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
tests/cases/compiler/parseInvalidNonNullableTypes.ts(15,16): error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(16,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
tests/cases/compiler/parseInvalidNonNullableTypes.ts(16,16): error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(18,16): error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'any'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(19,10): error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'number'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(21,16): error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'any'?
tests/cases/compiler/parseInvalidNonNullableTypes.ts(22,10): error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'number'?


==== tests/cases/compiler/parseInvalidNonNullableTypes.ts (14 errors) ====
    function f1(a: string): a is string! {
                                 ~~~~~~~
!!! error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string'?
        return true;
    }
    
    function f2(a: string): a is !string {
                                 ~~~~~~~
!!! error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string'?
        return true;
    }
    
    function f3(a: string!) {}
                   ~~~~~~~
!!! error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string'?
    function f4(a: number!) {}
                   ~~~~~~~
!!! error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'number'?
    
    function f5(a: !string) {}
                   ~~~~~~~
!!! error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string'?
    function f6(a: !number) {}
                   ~~~~~~~
!!! error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'number'?
    
    function f7(): string! {}
                   ~~~~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
                   ~~~~~~~
!!! error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string'?
    function f8(): !string {}
                   ~~~~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
                   ~~~~~~~
!!! error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string'?
    
    const a = 1 as any!;
                   ~~~~
!!! error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'any'?
    const b: number! = 1;
             ~~~~~~~
!!! error TS17019: '!' at the end of a type is not valid TypeScript syntax. Did you mean to write 'number'?
    
    const c = 1 as !any;
                   ~~~~
!!! error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'any'?
    const d: !number = 1;
             ~~~~~~~
!!! error TS17020: '!' at the start of a type is not valid TypeScript syntax. Did you mean to write 'number'?