|
| 1 | +Input:: |
| 2 | +//// [/lib/lib.d.ts] |
| 3 | +/// <reference no-default-lib="true"/> |
| 4 | +interface Boolean {} |
| 5 | +interface Function {} |
| 6 | +interface CallableFunction {} |
| 7 | +interface NewableFunction {} |
| 8 | +interface IArguments {} |
| 9 | +interface Number { toExponential: any; } |
| 10 | +interface Object {} |
| 11 | +interface RegExp {} |
| 12 | +interface String { charAt: any; } |
| 13 | +interface Array<T> { length: number; [n: number]: T; } |
| 14 | +interface ReadonlyArray<T> {} |
| 15 | +declare const console: { log(msg: any): void; }; |
| 16 | +interface ReadonlyArray<T> { readonly length: number } |
| 17 | + |
| 18 | +//// [/src/project/index.tsx] |
| 19 | +declare namespace JSX { |
| 20 | + interface ElementChildrenAttribute { children: {}; } |
| 21 | + interface IntrinsicElements { div: {} } |
| 22 | +} |
| 23 | + |
| 24 | +declare var React: any; |
| 25 | + |
| 26 | +declare function Component(props: never): any; |
| 27 | +declare function Component(props: { children?: number }): any; |
| 28 | +(<Component> |
| 29 | + <div /> |
| 30 | + <div /> |
| 31 | +</Component>) |
| 32 | + |
| 33 | +//// [/src/project/tsconfig.json] |
| 34 | +{"compilerOptions":{"incremental":true,"strict":true,"jsx":"react","module":"esnext"}} |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +Output:: |
| 39 | +/lib/tsc -p src/project |
| 40 | +[96msrc/project/index.tsx[0m:[93m10[0m:[93m3[0m - [91merror[0m[90m TS2746: [0mThis JSX tag's 'children' prop expects a single child of type 'never', but multiple children were provided. |
| 41 | + |
| 42 | +[7m10[0m (<Component> |
| 43 | +[7m [0m [91m ~~~~~~~~~[0m |
| 44 | + |
| 45 | +[96msrc/project/index.tsx[0m:[93m10[0m:[93m3[0m - [91merror[0m[90m TS2746: [0mThis JSX tag's 'children' prop expects a single child of type 'number | undefined', but multiple children were provided. |
| 46 | + |
| 47 | +[7m10[0m (<Component> |
| 48 | +[7m [0m [91m ~~~~~~~~~[0m |
| 49 | + |
| 50 | +[96msrc/project/index.tsx[0m:[93m10[0m:[93m3[0m - [91merror[0m[90m TS2769: [0mNo overload matches this call. |
| 51 | + This JSX tag's 'children' prop expects a single child of type 'never', but multiple children were provided. |
| 52 | + This JSX tag's 'children' prop expects a single child of type 'number | undefined', but multiple children were provided. |
| 53 | + |
| 54 | +[7m10[0m (<Component> |
| 55 | +[7m [0m [91m ~~~~~~~~~[0m |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +Found 3 errors in the same file, starting at: src/project/index.tsx[90m:10[0m |
| 60 | + |
| 61 | +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated |
| 62 | + |
| 63 | + |
| 64 | +//// [/src/project/index.js] |
| 65 | +"use strict"; |
| 66 | +(React.createElement(Component, null, |
| 67 | + React.createElement("div", null), |
| 68 | + React.createElement("div", null))); |
| 69 | + |
| 70 | + |
| 71 | +//// [/src/project/tsconfig.tsbuildinfo] |
| 72 | +{"program":{"fileNames":["../../lib/lib.d.ts","./index.tsx"],"fileInfos":[{"version":"7198220534-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };\ninterface ReadonlyArray<T> { readonly length: number }","affectsGlobalScope":true},{"version":"42569361247-declare namespace JSX {\n interface ElementChildrenAttribute { children: {}; }\n interface IntrinsicElements { div: {} }\n}\n\ndeclare var React: any;\n\ndeclare function Component(props: never): any;\ndeclare function Component(props: { children?: number }): any;\n(<Component>\n <div />\n <div />\n</Component>)","affectsGlobalScope":true}],"options":{"jsx":2,"module":99,"strict":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./index.tsx","start":265,"length":9,"messageText":"This JSX tag's 'children' prop expects a single child of type 'never', but multiple children were provided.","category":1,"code":2746},{"file":"./index.tsx","start":265,"length":9,"messageText":"This JSX tag's 'children' prop expects a single child of type 'number | undefined', but multiple children were provided.","category":1,"code":2746},{"file":"./index.tsx","start":265,"length":9,"code":2769,"category":1,"messageText":{"messageText":"No overload matches this call.","category":1,"code":2769,"next":[{"code":2746,"category":1,"messageText":"This JSX tag's 'children' prop expects a single child of type 'never', but multiple children were provided."},{"code":2746,"category":1,"messageText":"This JSX tag's 'children' prop expects a single child of type 'number | undefined', but multiple children were provided."}]},"relatedInformation":[]}]]]},"version":"FakeTSVersion"} |
| 73 | + |
| 74 | +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] |
| 75 | +{ |
| 76 | + "program": { |
| 77 | + "fileNames": [ |
| 78 | + "../../lib/lib.d.ts", |
| 79 | + "./index.tsx" |
| 80 | + ], |
| 81 | + "fileInfos": { |
| 82 | + "../../lib/lib.d.ts": { |
| 83 | + "version": "7198220534-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };\ninterface ReadonlyArray<T> { readonly length: number }", |
| 84 | + "signature": "7198220534-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };\ninterface ReadonlyArray<T> { readonly length: number }", |
| 85 | + "affectsGlobalScope": true |
| 86 | + }, |
| 87 | + "./index.tsx": { |
| 88 | + "version": "42569361247-declare namespace JSX {\n interface ElementChildrenAttribute { children: {}; }\n interface IntrinsicElements { div: {} }\n}\n\ndeclare var React: any;\n\ndeclare function Component(props: never): any;\ndeclare function Component(props: { children?: number }): any;\n(<Component>\n <div />\n <div />\n</Component>)", |
| 89 | + "signature": "42569361247-declare namespace JSX {\n interface ElementChildrenAttribute { children: {}; }\n interface IntrinsicElements { div: {} }\n}\n\ndeclare var React: any;\n\ndeclare function Component(props: never): any;\ndeclare function Component(props: { children?: number }): any;\n(<Component>\n <div />\n <div />\n</Component>)", |
| 90 | + "affectsGlobalScope": true |
| 91 | + } |
| 92 | + }, |
| 93 | + "options": { |
| 94 | + "jsx": 2, |
| 95 | + "module": 99, |
| 96 | + "strict": true |
| 97 | + }, |
| 98 | + "referencedMap": {}, |
| 99 | + "exportedModulesMap": {}, |
| 100 | + "semanticDiagnosticsPerFile": [ |
| 101 | + "../../lib/lib.d.ts", |
| 102 | + [ |
| 103 | + "./index.tsx", |
| 104 | + [ |
| 105 | + { |
| 106 | + "file": "./index.tsx", |
| 107 | + "start": 265, |
| 108 | + "length": 9, |
| 109 | + "messageText": "This JSX tag's 'children' prop expects a single child of type 'never', but multiple children were provided.", |
| 110 | + "category": 1, |
| 111 | + "code": 2746 |
| 112 | + }, |
| 113 | + { |
| 114 | + "file": "./index.tsx", |
| 115 | + "start": 265, |
| 116 | + "length": 9, |
| 117 | + "messageText": "This JSX tag's 'children' prop expects a single child of type 'number | undefined', but multiple children were provided.", |
| 118 | + "category": 1, |
| 119 | + "code": 2746 |
| 120 | + }, |
| 121 | + { |
| 122 | + "file": "./index.tsx", |
| 123 | + "start": 265, |
| 124 | + "length": 9, |
| 125 | + "code": 2769, |
| 126 | + "category": 1, |
| 127 | + "messageText": { |
| 128 | + "messageText": "No overload matches this call.", |
| 129 | + "category": 1, |
| 130 | + "code": 2769, |
| 131 | + "next": [ |
| 132 | + { |
| 133 | + "code": 2746, |
| 134 | + "category": 1, |
| 135 | + "messageText": "This JSX tag's 'children' prop expects a single child of type 'never', but multiple children were provided." |
| 136 | + }, |
| 137 | + { |
| 138 | + "code": 2746, |
| 139 | + "category": 1, |
| 140 | + "messageText": "This JSX tag's 'children' prop expects a single child of type 'number | undefined', but multiple children were provided." |
| 141 | + } |
| 142 | + ] |
| 143 | + }, |
| 144 | + "relatedInformation": [] |
| 145 | + } |
| 146 | + ] |
| 147 | + ] |
| 148 | + ] |
| 149 | + }, |
| 150 | + "version": "FakeTSVersion", |
| 151 | + "size": 2053 |
| 152 | +} |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | +Change:: no-change-run |
| 157 | +Input:: |
| 158 | + |
| 159 | + |
| 160 | +Output:: |
| 161 | +/lib/tsc -p src/project |
| 162 | +[96msrc/project/index.tsx[0m:[93m10[0m:[93m3[0m - [91merror[0m[90m TS2746: [0mThis JSX tag's 'children' prop expects a single child of type 'never', but multiple children were provided. |
| 163 | + |
| 164 | +[7m10[0m (<Component> |
| 165 | +[7m [0m [91m ~~~~~~~~~[0m |
| 166 | + |
| 167 | +[96msrc/project/index.tsx[0m:[93m10[0m:[93m3[0m - [91merror[0m[90m TS2746: [0mThis JSX tag's 'children' prop expects a single child of type 'number | undefined', but multiple children were provided. |
| 168 | + |
| 169 | +[7m10[0m (<Component> |
| 170 | +[7m [0m [91m ~~~~~~~~~[0m |
| 171 | + |
| 172 | +[96msrc/project/index.tsx[0m:[93m10[0m:[93m3[0m - [91merror[0m[90m TS2769: [0mNo overload matches this call. |
| 173 | + This JSX tag's 'children' prop expects a single child of type 'never', but multiple children were provided. |
| 174 | + This JSX tag's 'children' prop expects a single child of type 'number | undefined', but multiple children were provided. |
| 175 | + |
| 176 | +[7m10[0m (<Component> |
| 177 | +[7m [0m [91m ~~~~~~~~~[0m |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | +Found 3 errors in the same file, starting at: src/project/index.tsx[90m:10[0m |
| 182 | + |
| 183 | +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated |
| 184 | + |
| 185 | + |
0 commit comments