File: expressionWithJSDocTypeArguments.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 (91 lines) | stat: -rw-r--r-- 7,491 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(9,21): error TS8020: JSDoc types can only be used inside documentation comments.
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(10,20): error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(11,21): error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(12,23): error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(12,24): error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(14,28): error TS8020: JSDoc types can only be used inside documentation comments.
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(15,27): error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(16,28): error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(17,30): error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(17,31): error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(19,21): error TS8020: JSDoc types can only be used inside documentation comments.
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(20,20): error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(21,21): error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(22,23): error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(22,24): error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(24,28): error TS8020: JSDoc types can only be used inside documentation comments.
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(25,27): error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(26,28): error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(27,30): error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
tests/cases/compiler/expressionWithJSDocTypeArguments.ts(27,31): error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?


==== tests/cases/compiler/expressionWithJSDocTypeArguments.ts (20 errors) ====
    // Repro from #51802
    
    function foo<T>(x: T): T { return x }
    
    class Bar<T> { constructor(public x: T) { } }
    
    // Errors expected on all of the following
    
    const WhatFoo = foo<?>;
                        ~
!!! error TS8020: JSDoc types can only be used inside documentation comments.
    const HuhFoo = foo<string?>;
                       ~~~~~~~
!!! error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
    const NopeFoo = foo<?string>;
                        ~~~~~~~
!!! error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
    const ComeOnFoo = foo<?string?>;
                          ~~~~~~~~
!!! error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
                           ~~~~~~~
!!! error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
    
    type TWhatFoo = typeof foo<?>;
                               ~
!!! error TS8020: JSDoc types can only be used inside documentation comments.
    type THuhFoo = typeof foo<string?>;
                              ~~~~~~~
!!! error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
    type TNopeFoo = typeof foo<?string>;
                               ~~~~~~~
!!! error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
    type TComeOnFoo = typeof foo<?string?>;
                                 ~~~~~~~~
!!! error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
                                  ~~~~~~~
!!! error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
    
    const WhatBar = Bar<?>;
                        ~
!!! error TS8020: JSDoc types can only be used inside documentation comments.
    const HuhBar = Bar<string?>;
                       ~~~~~~~
!!! error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
    const NopeBar = Bar<?string>;
                        ~~~~~~~
!!! error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
    const ComeOnBar = Bar<?string?>;
                          ~~~~~~~~
!!! error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
                           ~~~~~~~
!!! error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
    
    type TWhatBar = typeof Bar<?>;
                               ~
!!! error TS8020: JSDoc types can only be used inside documentation comments.
    type THuhBar = typeof Bar<string?>;
                              ~~~~~~~
!!! error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?
    type TNopeBar = typeof Bar<?string>;
                               ~~~~~~~
!!! error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
    type TComeOnBar = typeof Bar<?string?>;
                                 ~~~~~~~~
!!! error TS17020: '?' at the start of a type is not valid TypeScript syntax. Did you mean to write 'string | null | undefined'?
                                  ~~~~~~~
!!! error TS17019: '?' at the end of a type is not valid TypeScript syntax. Did you mean to write 'string | undefined'?