From 081f98232b9ff5c7c7798b807d0a82cf4592f4ca Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 16 Sep 2020 13:31:13 -0700 Subject: [PATCH 001/241] Handle the mapping between Array and ReadonlyArray in isTypeDerivedFrom --- src/compiler/checker.ts | 2 +- .../instanceofNarrowReadonlyArray.js | 21 +++++++++++++++++++ .../instanceofNarrowReadonlyArray.symbols | 19 +++++++++++++++++ .../instanceofNarrowReadonlyArray.types | 21 +++++++++++++++++++ .../compiler/instanceofNarrowReadonlyArray.ts | 9 ++++++++ 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/instanceofNarrowReadonlyArray.js create mode 100644 tests/baselines/reference/instanceofNarrowReadonlyArray.symbols create mode 100644 tests/baselines/reference/instanceofNarrowReadonlyArray.types create mode 100644 tests/cases/compiler/instanceofNarrowReadonlyArray.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a8f6e129f9c..6e80d32111b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15349,7 +15349,7 @@ namespace ts { source.flags & TypeFlags.InstantiableNonPrimitive ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (TypeFlags.Object | TypeFlags.NonPrimitive)) : target === globalFunctionType ? !!(source.flags & TypeFlags.Object) && isFunctionObjectType(source as ObjectType) : - hasBaseType(source, getTargetType(target)); + hasBaseType(source, getTargetType(target)) || (isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType)); } /** diff --git a/tests/baselines/reference/instanceofNarrowReadonlyArray.js b/tests/baselines/reference/instanceofNarrowReadonlyArray.js new file mode 100644 index 00000000000..a6976ff98f1 --- /dev/null +++ b/tests/baselines/reference/instanceofNarrowReadonlyArray.js @@ -0,0 +1,21 @@ +//// [instanceofNarrowReadonlyArray.ts] +// @strict + +function narrow(x: readonly number[] | number): readonly number[] { + if (x instanceof Array) { + return x; + } else { + return [x]; + } +} + +//// [instanceofNarrowReadonlyArray.js] +// @strict +function narrow(x) { + if (x instanceof Array) { + return x; + } + else { + return [x]; + } +} diff --git a/tests/baselines/reference/instanceofNarrowReadonlyArray.symbols b/tests/baselines/reference/instanceofNarrowReadonlyArray.symbols new file mode 100644 index 00000000000..03d6923f7e2 --- /dev/null +++ b/tests/baselines/reference/instanceofNarrowReadonlyArray.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/instanceofNarrowReadonlyArray.ts === +// @strict + +function narrow(x: readonly number[] | number): readonly number[] { +>narrow : Symbol(narrow, Decl(instanceofNarrowReadonlyArray.ts, 0, 0)) +>x : Symbol(x, Decl(instanceofNarrowReadonlyArray.ts, 2, 16)) + + if (x instanceof Array) { +>x : Symbol(x, Decl(instanceofNarrowReadonlyArray.ts, 2, 16)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + return x; +>x : Symbol(x, Decl(instanceofNarrowReadonlyArray.ts, 2, 16)) + + } else { + return [x]; +>x : Symbol(x, Decl(instanceofNarrowReadonlyArray.ts, 2, 16)) + } +} diff --git a/tests/baselines/reference/instanceofNarrowReadonlyArray.types b/tests/baselines/reference/instanceofNarrowReadonlyArray.types new file mode 100644 index 00000000000..53b4adac41e --- /dev/null +++ b/tests/baselines/reference/instanceofNarrowReadonlyArray.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/instanceofNarrowReadonlyArray.ts === +// @strict + +function narrow(x: readonly number[] | number): readonly number[] { +>narrow : (x: readonly number[] | number) => readonly number[] +>x : number | readonly number[] + + if (x instanceof Array) { +>x instanceof Array : boolean +>x : number | readonly number[] +>Array : ArrayConstructor + + return x; +>x : readonly number[] + + } else { + return [x]; +>[x] : number[] +>x : number + } +} diff --git a/tests/cases/compiler/instanceofNarrowReadonlyArray.ts b/tests/cases/compiler/instanceofNarrowReadonlyArray.ts new file mode 100644 index 00000000000..dbf9d9b409f --- /dev/null +++ b/tests/cases/compiler/instanceofNarrowReadonlyArray.ts @@ -0,0 +1,9 @@ +// @strict + +function narrow(x: readonly number[] | number): readonly number[] { + if (x instanceof Array) { + return x; + } else { + return [x]; + } +} \ No newline at end of file From 02f500183956d403faaa4260241fa9cfc0470335 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 17 Sep 2020 06:20:29 +0000 Subject: [PATCH 002/241] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 97940b9dab1..7df8a93637a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -550,9 +550,9 @@ "dev": true }, "@types/node": { - "version": "14.10.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.10.2.tgz", - "integrity": "sha512-IzMhbDYCpv26pC2wboJ4MMOa9GKtjplXfcAqrMeNJpUUwpM/2ATt2w1JPUXwS6spu856TvKZL2AOmeU2rAxskw==", + "version": "14.10.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.10.3.tgz", + "integrity": "sha512-zdN0hor7TLkjAdKTnYW+Y22oIhUUpil5ZD1V1OFq0CR0CLKw+NdR6dkziTfkWRLo6sKzisayoj/GNpNbe4LY9Q==", "dev": true }, "@types/node-fetch": { From d779a190535e52896cfe5100101173c00b6b8625 Mon Sep 17 00:00:00 2001 From: Alex T Date: Thu, 17 Sep 2020 12:15:48 +0300 Subject: [PATCH 003/241] fix(40432): show as keyword in function context (#40481) --- src/harness/fourslashInterfaceImpl.ts | 2 ++ src/services/completions.ts | 2 +- tests/cases/fourslash/completionAsKeyword.ts | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/completionAsKeyword.ts diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index 096b1ea8e8d..fc3dce9e1ff 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -1370,6 +1370,7 @@ namespace FourSlashInterface { "let", "package", "yield", + "as", "async", "await", ].map(keywordEntry); @@ -1510,6 +1511,7 @@ namespace FourSlashInterface { "let", "package", "yield", + "as", "async", "await", ].map(keywordEntry); diff --git a/src/services/completions.ts b/src/services/completions.ts index 1c9b10096a6..b7ac7e26925 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -2585,7 +2585,6 @@ namespace ts.Completions { || kind === SyntaxKind.ModuleKeyword || kind === SyntaxKind.TypeKeyword || kind === SyntaxKind.NamespaceKeyword - || kind === SyntaxKind.AsKeyword || isTypeKeyword(kind) && kind !== SyntaxKind.UndefinedKeyword; case KeywordCompletionFilters.FunctionLikeBodyKeywords: return isFunctionLikeBodyKeyword(kind); @@ -2660,6 +2659,7 @@ namespace ts.Completions { function isFunctionLikeBodyKeyword(kind: SyntaxKind) { return kind === SyntaxKind.AsyncKeyword || kind === SyntaxKind.AwaitKeyword + || kind === SyntaxKind.AsKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } diff --git a/tests/cases/fourslash/completionAsKeyword.ts b/tests/cases/fourslash/completionAsKeyword.ts new file mode 100644 index 00000000000..08e3f0d7c0e --- /dev/null +++ b/tests/cases/fourslash/completionAsKeyword.ts @@ -0,0 +1,11 @@ +/// + +////const x = this /*1*/ +////function foo() { +//// const x = this /*2*/ +////} + +verify.completions({ + marker: ["1", "2"], + includes: [{ name: "as", sortText: completion.SortText.GlobalsOrKeywords }] +}); From 735a67a05ea2b5844f7b0210af1df3e7ada71155 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 17 Sep 2020 10:42:47 -0700 Subject: [PATCH 004/241] Fix iterable contextual type (#40592) --- src/compiler/checker.ts | 5 ++- .../reference/contextualTypeIterableUnions.js | 17 ++++++++ .../contextualTypeIterableUnions.symbols | 33 +++++++++++++++ .../contextualTypeIterableUnions.types | 40 +++++++++++++++++++ .../compiler/contextualTypeIterableUnions.ts | 11 +++++ 5 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/contextualTypeIterableUnions.js create mode 100644 tests/baselines/reference/contextualTypeIterableUnions.symbols create mode 100644 tests/baselines/reference/contextualTypeIterableUnions.types create mode 100644 tests/cases/compiler/contextualTypeIterableUnions.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ccba60fe42d..c5ffd98f9ae 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -23651,7 +23651,10 @@ namespace ts { function getContextualTypeForElementExpression(arrayContextualType: Type | undefined, index: number): Type | undefined { return arrayContextualType && ( getTypeOfPropertyOfContextualType(arrayContextualType, "" + index as __String) - || getIteratedTypeOrElementType(IterationUse.Element, arrayContextualType, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false)); + || mapType( + arrayContextualType, + t => getIteratedTypeOrElementType(IterationUse.Element, t, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false), + /*noReductions*/ true)); } // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. diff --git a/tests/baselines/reference/contextualTypeIterableUnions.js b/tests/baselines/reference/contextualTypeIterableUnions.js new file mode 100644 index 00000000000..d1bb4e9d8a8 --- /dev/null +++ b/tests/baselines/reference/contextualTypeIterableUnions.js @@ -0,0 +1,17 @@ +//// [contextualTypeIterableUnions.ts] +declare class DMap { + constructor(iterable: Iterable<[K, V]> | undefined); +} +new DMap([["1", 2]]); + +const i1: Iterable<{ a: true }> | undefined = [{ a: true }]; +const i2: Iterable<{ a: true }> | Iterable<{ b: false }> = [{ b: false }]; +const i3: Iterable | 1[] = [2]; + + +//// [contextualTypeIterableUnions.js] +"use strict"; +new DMap([["1", 2]]); +const i1 = [{ a: true }]; +const i2 = [{ b: false }]; +const i3 = [2]; diff --git a/tests/baselines/reference/contextualTypeIterableUnions.symbols b/tests/baselines/reference/contextualTypeIterableUnions.symbols new file mode 100644 index 00000000000..0ae7379596e --- /dev/null +++ b/tests/baselines/reference/contextualTypeIterableUnions.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/contextualTypeIterableUnions.ts === +declare class DMap { +>DMap : Symbol(DMap, Decl(contextualTypeIterableUnions.ts, 0, 0)) +>K : Symbol(K, Decl(contextualTypeIterableUnions.ts, 0, 19)) +>V : Symbol(V, Decl(contextualTypeIterableUnions.ts, 0, 21)) + + constructor(iterable: Iterable<[K, V]> | undefined); +>iterable : Symbol(iterable, Decl(contextualTypeIterableUnions.ts, 1, 14)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>K : Symbol(K, Decl(contextualTypeIterableUnions.ts, 0, 19)) +>V : Symbol(V, Decl(contextualTypeIterableUnions.ts, 0, 21)) +} +new DMap([["1", 2]]); +>DMap : Symbol(DMap, Decl(contextualTypeIterableUnions.ts, 0, 0)) + +const i1: Iterable<{ a: true }> | undefined = [{ a: true }]; +>i1 : Symbol(i1, Decl(contextualTypeIterableUnions.ts, 5, 5)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>a : Symbol(a, Decl(contextualTypeIterableUnions.ts, 5, 20)) +>a : Symbol(a, Decl(contextualTypeIterableUnions.ts, 5, 48)) + +const i2: Iterable<{ a: true }> | Iterable<{ b: false }> = [{ b: false }]; +>i2 : Symbol(i2, Decl(contextualTypeIterableUnions.ts, 6, 5)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>a : Symbol(a, Decl(contextualTypeIterableUnions.ts, 6, 20)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>b : Symbol(b, Decl(contextualTypeIterableUnions.ts, 6, 44)) +>b : Symbol(b, Decl(contextualTypeIterableUnions.ts, 6, 61)) + +const i3: Iterable | 1[] = [2]; +>i3 : Symbol(i3, Decl(contextualTypeIterableUnions.ts, 7, 5)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) + diff --git a/tests/baselines/reference/contextualTypeIterableUnions.types b/tests/baselines/reference/contextualTypeIterableUnions.types new file mode 100644 index 00000000000..455b4d55733 --- /dev/null +++ b/tests/baselines/reference/contextualTypeIterableUnions.types @@ -0,0 +1,40 @@ +=== tests/cases/compiler/contextualTypeIterableUnions.ts === +declare class DMap { +>DMap : DMap + + constructor(iterable: Iterable<[K, V]> | undefined); +>iterable : Iterable<[K, V]> | undefined +} +new DMap([["1", 2]]); +>new DMap([["1", 2]]) : DMap +>DMap : typeof DMap +>[["1", 2]] : [string, number][] +>["1", 2] : [string, number] +>"1" : "1" +>2 : 2 + +const i1: Iterable<{ a: true }> | undefined = [{ a: true }]; +>i1 : Iterable<{ a: true; }> | undefined +>a : true +>true : true +>[{ a: true }] : { a: true; }[] +>{ a: true } : { a: true; } +>a : true +>true : true + +const i2: Iterable<{ a: true }> | Iterable<{ b: false }> = [{ b: false }]; +>i2 : Iterable<{ a: true; }> | Iterable<{ b: false; }> +>a : true +>true : true +>b : false +>false : false +>[{ b: false }] : { b: false; }[] +>{ b: false } : { b: false; } +>b : false +>false : false + +const i3: Iterable | 1[] = [2]; +>i3 : Iterable | 1[] +>[2] : 2[] +>2 : 2 + diff --git a/tests/cases/compiler/contextualTypeIterableUnions.ts b/tests/cases/compiler/contextualTypeIterableUnions.ts new file mode 100644 index 00000000000..2ab1857f391 --- /dev/null +++ b/tests/cases/compiler/contextualTypeIterableUnions.ts @@ -0,0 +1,11 @@ +// @strict: true +// @target: esnext + +declare class DMap { + constructor(iterable: Iterable<[K, V]> | undefined); +} +new DMap([["1", 2]]); + +const i1: Iterable<{ a: true }> | undefined = [{ a: true }]; +const i2: Iterable<{ a: true }> | Iterable<{ b: false }> = [{ b: false }]; +const i3: Iterable | 1[] = [2]; From 0c08138490696c8fee4114f1a8dae0f74caa4715 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Fri, 18 Sep 2020 06:20:48 +0000 Subject: [PATCH 005/241] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7df8a93637a..676abd3b302 100644 --- a/package-lock.json +++ b/package-lock.json @@ -550,9 +550,9 @@ "dev": true }, "@types/node": { - "version": "14.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.10.3.tgz", - "integrity": "sha512-zdN0hor7TLkjAdKTnYW+Y22oIhUUpil5ZD1V1OFq0CR0CLKw+NdR6dkziTfkWRLo6sKzisayoj/GNpNbe4LY9Q==", + "version": "14.11.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.1.tgz", + "integrity": "sha512-oTQgnd0hblfLsJ6BvJzzSL+Inogp3lq9fGgqRkMB/ziKMgEUaFl801OncOzUmalfzt14N0oPHMK47ipl+wbTIw==", "dev": true }, "@types/node-fetch": { From 6c6ddfe5c02194bc53ad70a2e08189f384373af6 Mon Sep 17 00:00:00 2001 From: Alex T Date: Fri, 18 Sep 2020 23:06:56 +0300 Subject: [PATCH 006/241] fix(39899): include in NavigationBar default exported call expression arguments (#40412) --- src/services/navigationBar.ts | 9 ++------ .../navigationItemsExportDefaultExpression.ts | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index 4f757be676c..4704e86846b 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -310,7 +310,7 @@ namespace ts.NavigationBar { case SyntaxKind.ExportAssignment: { const expression = (node).expression; - const child = isObjectLiteralExpression(expression) ? expression : + const child = isObjectLiteralExpression(expression) || isCallExpression(expression) ? expression : isArrowFunction(expression) || isFunctionExpression(expression) ? expression.body : undefined; if (child) { startNode(node); @@ -843,16 +843,11 @@ namespace ts.NavigationBar { } // Otherwise, we need to aggregate each identifier to build up the qualified name. - const result: string[] = []; - - result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - + const result = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; while (moduleDeclaration.body && moduleDeclaration.body.kind === SyntaxKind.ModuleDeclaration) { moduleDeclaration = moduleDeclaration.body; - result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } - return result.join("."); } diff --git a/tests/cases/fourslash/navigationItemsExportDefaultExpression.ts b/tests/cases/fourslash/navigationItemsExportDefaultExpression.ts index 23ba0d74dce..58670328773 100644 --- a/tests/cases/fourslash/navigationItemsExportDefaultExpression.ts +++ b/tests/cases/fourslash/navigationItemsExportDefaultExpression.ts @@ -28,6 +28,9 @@ //// d: 1 //// } //// } +//// +//// function foo(props: { x: number; y: number }) {} +//// export default foo({ x: 1, y: 1 }); verify.navigationTree({ "text": '"navigationItemsExportDefaultExpression"', @@ -90,6 +93,21 @@ verify.navigationTree({ } ] }, + { + "text": "default", + "kind": "const", + "kindModifiers": "export", + "childItems": [ + { + "text": "x", + "kind": "property" + }, + { + "text": "y", + "kind": "property" + } + ] + }, { "text": "AB", "kind": "class", @@ -119,6 +137,10 @@ verify.navigationTree({ "kind": "class" } ] + }, + { + "text": "foo", + "kind": "function" } ] }); From f1ac8cd93fcda3175366d7ed5e793d8083e1f372 Mon Sep 17 00:00:00 2001 From: Hikari Hayashi Date: Sat, 19 Sep 2020 05:26:20 +0800 Subject: [PATCH 007/241] Fix children prop for `react-jsx` and `react-jsxdev` (#40630) * Fix children prop for `react-jsx` and `react-jsxdev` * Add tests --- src/compiler/transformers/jsx.ts | 29 ++++++++++--------- ...JsxsCjsTransformChildren(jsx=react-jsx).js | 13 +++++++++ ...jsTransformChildren(jsx=react-jsx).symbols | 9 ++++++ ...sCjsTransformChildren(jsx=react-jsx).types | 10 +++++++ ...sCjsTransformChildren(jsx=react-jsxdev).js | 14 +++++++++ ...ransformChildren(jsx=react-jsxdev).symbols | 9 ++++++ ...sTransformChildren(jsx=react-jsxdev).types | 10 +++++++ .../jsx/jsxs/jsxJsxsCjsTransformChildren.tsx | 7 +++++ 8 files changed, 88 insertions(+), 13 deletions(-) create mode 100644 tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).js create mode 100644 tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).symbols create mode 100644 tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).types create mode 100644 tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).js create mode 100644 tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).symbols create mode 100644 tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).types create mode 100644 tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformChildren.tsx diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts index 0766cfbbfcf..544275c6d20 100644 --- a/src/compiler/transformers/jsx.ts +++ b/src/compiler/transformers/jsx.ts @@ -208,33 +208,36 @@ namespace ts { let objectProperties: Expression; const keyAttr = find(node.attributes.properties, p => !!p.name && isIdentifier(p.name) && p.name.escapedText === "key") as JsxAttribute | undefined; const attrs = keyAttr ? filter(node.attributes.properties, p => p !== keyAttr) : node.attributes.properties; - if (attrs.length === 0) { - objectProperties = factory.createObjectLiteralExpression([]); - // When there are no attributes, React wants {} - } - else { + + let segments: Expression[] = []; + if (attrs.length) { // Map spans of JsxAttribute nodes into object literals and spans // of JsxSpreadAttribute nodes into expressions. - const segments = flatten( + segments = flatten( spanMap(attrs, isJsxSpreadAttribute, (attrs, isSpread) => isSpread ? map(attrs, transformJsxSpreadAttributeToExpression) : factory.createObjectLiteralExpression(map(attrs, transformJsxAttributeToObjectLiteralElement)) ) ); - if (children && children.length) { - const result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - segments.push(result); - } - } - if (isJsxSpreadAttribute(attrs[0])) { // We must always emit at least one object literal before a spread // argument.factory.createObjectLiteral segments.unshift(factory.createObjectLiteralExpression()); } + } + if (children && children.length) { + const result = convertJsxChildrenToChildrenPropObject(children); + if (result) { + segments.push(result); + } + } + if (segments.length === 0) { + objectProperties = factory.createObjectLiteralExpression([]); + // When there are no attributes, React wants {} + } + else { // Either emit one big object literal (no spread attribs), or // a call to the __assign helper. objectProperties = singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments); diff --git a/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).js b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).js new file mode 100644 index 00000000000..bb94546b6f3 --- /dev/null +++ b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).js @@ -0,0 +1,13 @@ +//// [jsxJsxsCjsTransformChildren.tsx] +/// +const a =
text
; + +export {}; + + +//// [jsxJsxsCjsTransformChildren.js] +"use strict"; +exports.__esModule = true; +var jsx_runtime_1 = require("react/jsx-runtime"); +/// +var a = jsx_runtime_1.jsx("div", { children: "text" }, void 0); diff --git a/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).symbols b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).symbols new file mode 100644 index 00000000000..9bdb4e987b5 --- /dev/null +++ b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformChildren.tsx === +/// +const a =
text
; +>a : Symbol(a, Decl(jsxJsxsCjsTransformChildren.tsx, 1, 5)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) + +export {}; + diff --git a/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).types b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).types new file mode 100644 index 00000000000..716305916b6 --- /dev/null +++ b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsx).types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformChildren.tsx === +/// +const a =
text
; +>a : JSX.Element +>
text
: JSX.Element +>div : any +>div : any + +export {}; + diff --git a/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).js b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).js new file mode 100644 index 00000000000..227e714da14 --- /dev/null +++ b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).js @@ -0,0 +1,14 @@ +//// [jsxJsxsCjsTransformChildren.tsx] +/// +const a =
text
; + +export {}; + + +//// [jsxJsxsCjsTransformChildren.js] +"use strict"; +exports.__esModule = true; +var jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); +var _jsxFileName = "tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformChildren.tsx"; +/// +var a = jsx_dev_runtime_1.jsxDEV("div", { children: "text" }, void 0, false, { fileName: _jsxFileName, lineNumber: 2, columnNumber: 10 }, this); diff --git a/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).symbols b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).symbols new file mode 100644 index 00000000000..9bdb4e987b5 --- /dev/null +++ b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformChildren.tsx === +/// +const a =
text
; +>a : Symbol(a, Decl(jsxJsxsCjsTransformChildren.tsx, 1, 5)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) + +export {}; + diff --git a/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).types b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).types new file mode 100644 index 00000000000..716305916b6 --- /dev/null +++ b/tests/baselines/reference/jsxJsxsCjsTransformChildren(jsx=react-jsxdev).types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformChildren.tsx === +/// +const a =
text
; +>a : JSX.Element +>
text
: JSX.Element +>div : any +>div : any + +export {}; + diff --git a/tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformChildren.tsx b/tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformChildren.tsx new file mode 100644 index 00000000000..e736b59c838 --- /dev/null +++ b/tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformChildren.tsx @@ -0,0 +1,7 @@ +// @jsx: react-jsx,react-jsxdev +// @strict: true +// @module: commonjs +/// +const a =
text
; + +export {}; From c67fe4c2488320aa4c2b041173b28c71c5448727 Mon Sep 17 00:00:00 2001 From: csigs Date: Sat, 19 Sep 2020 00:10:42 +0000 Subject: [PATCH 008/241] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index b3a8a3f17ad..5e2f2d5fec7 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1416,6 +1416,24 @@ + + + + + + + + + + + + + + + + + + @@ -4881,6 +4899,15 @@ + + + + + + + + + @@ -10521,6 +10548,15 @@ + + + + + + + + + From 17c7c261d429cdc0ec3f957eb7f342a852ef5fd2 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 19 Sep 2020 06:12:39 -1000 Subject: [PATCH 009/241] Properly preserve modifiers in homomorphic mapped types with 'as' clauses (#40633) * Use original property name to fetch source property for modifiers * Add regression test * Accept new baselines --- src/compiler/checker.ts | 2 +- .../reference/mappedTypeAsClauses.js | 23 +++++++++++++ .../reference/mappedTypeAsClauses.symbols | 33 +++++++++++++++++++ .../reference/mappedTypeAsClauses.types | 22 +++++++++++++ .../types/mapped/mappedTypeAsClauses.ts | 14 ++++++++ 5 files changed, 93 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c5ffd98f9ae..54339bbdf3f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10458,7 +10458,7 @@ namespace ts { existingProp.keyType = getUnionType([existingProp.keyType, keyType]); } else { - const modifiersProp = getPropertyOfType(modifiersType, propName); + const modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : undefined; const isOptional = !!(templateModifiers & MappedTypeModifiers.IncludeOptional || !(templateModifiers & MappedTypeModifiers.ExcludeOptional) && modifiersProp && modifiersProp.flags & SymbolFlags.Optional); const isReadonly = !!(templateModifiers & MappedTypeModifiers.IncludeReadonly || diff --git a/tests/baselines/reference/mappedTypeAsClauses.js b/tests/baselines/reference/mappedTypeAsClauses.js index 75c1d32cd60..9bb361db932 100644 --- a/tests/baselines/reference/mappedTypeAsClauses.js +++ b/tests/baselines/reference/mappedTypeAsClauses.js @@ -28,6 +28,20 @@ type DoubleProp = { [P in keyof T & string as `${P}1` | `${P}2`]: T[P] } type TD1 = DoubleProp<{ a: string, b: number }>; // { a1: string, a2: string, b1: number, b2: number } type TD2 = keyof TD1; // 'a1' | 'a2' | 'b1' | 'b2' type TD3 = keyof DoubleProp; // `${keyof U & string}1` | `${keyof U & string}2` + +// Repro from #40619 + +type Lazyify = { + [K in keyof T as `get${capitalize string & K}`]: () => T[K] +}; + +interface Person { + readonly name: string; + age: number; + location?: string; +} + +type LazyPerson = Lazyify; //// [mappedTypeAsClauses.js] @@ -82,3 +96,12 @@ declare type TD1 = DoubleProp<{ }>; declare type TD2 = keyof TD1; declare type TD3 = keyof DoubleProp; +declare type Lazyify = { + [K in keyof T as `get${capitalize string & K}`]: () => T[K]; +}; +interface Person { + readonly name: string; + age: number; + location?: string; +} +declare type LazyPerson = Lazyify; diff --git a/tests/baselines/reference/mappedTypeAsClauses.symbols b/tests/baselines/reference/mappedTypeAsClauses.symbols index 75768ce31af..31a9ca0bef8 100644 --- a/tests/baselines/reference/mappedTypeAsClauses.symbols +++ b/tests/baselines/reference/mappedTypeAsClauses.symbols @@ -108,3 +108,36 @@ type TD3 = keyof DoubleProp; // `${keyof U & string}1` | `${keyof U & str >DoubleProp : Symbol(DoubleProp, Decl(mappedTypeAsClauses.ts, 21, 85)) >U : Symbol(U, Decl(mappedTypeAsClauses.ts, 28, 9)) +// Repro from #40619 + +type Lazyify = { +>Lazyify : Symbol(Lazyify, Decl(mappedTypeAsClauses.ts, 28, 34)) +>T : Symbol(T, Decl(mappedTypeAsClauses.ts, 32, 13)) + + [K in keyof T as `get${capitalize string & K}`]: () => T[K] +>K : Symbol(K, Decl(mappedTypeAsClauses.ts, 33, 5)) +>T : Symbol(T, Decl(mappedTypeAsClauses.ts, 32, 13)) +>K : Symbol(K, Decl(mappedTypeAsClauses.ts, 33, 5)) +>T : Symbol(T, Decl(mappedTypeAsClauses.ts, 32, 13)) +>K : Symbol(K, Decl(mappedTypeAsClauses.ts, 33, 5)) + +}; + +interface Person { +>Person : Symbol(Person, Decl(mappedTypeAsClauses.ts, 34, 2)) + + readonly name: string; +>name : Symbol(Person.name, Decl(mappedTypeAsClauses.ts, 36, 18)) + + age: number; +>age : Symbol(Person.age, Decl(mappedTypeAsClauses.ts, 37, 26)) + + location?: string; +>location : Symbol(Person.location, Decl(mappedTypeAsClauses.ts, 38, 16)) +} + +type LazyPerson = Lazyify; +>LazyPerson : Symbol(LazyPerson, Decl(mappedTypeAsClauses.ts, 40, 1)) +>Lazyify : Symbol(Lazyify, Decl(mappedTypeAsClauses.ts, 28, 34)) +>Person : Symbol(Person, Decl(mappedTypeAsClauses.ts, 34, 2)) + diff --git a/tests/baselines/reference/mappedTypeAsClauses.types b/tests/baselines/reference/mappedTypeAsClauses.types index 438d9c1fcbf..f2426a9c74c 100644 --- a/tests/baselines/reference/mappedTypeAsClauses.types +++ b/tests/baselines/reference/mappedTypeAsClauses.types @@ -66,3 +66,25 @@ type TD2 = keyof TD1; // 'a1' | 'a2' | 'b1' | 'b2' type TD3 = keyof DoubleProp; // `${keyof U & string}1` | `${keyof U & string}2` >TD3 : `${keyof U & string}1` | `${keyof U & string}2` +// Repro from #40619 + +type Lazyify = { +>Lazyify : Lazyify + + [K in keyof T as `get${capitalize string & K}`]: () => T[K] +}; + +interface Person { + readonly name: string; +>name : string + + age: number; +>age : number + + location?: string; +>location : string | undefined +} + +type LazyPerson = Lazyify; +>LazyPerson : Lazyify + diff --git a/tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts b/tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts index 51f6bd720bf..542503e82dc 100644 --- a/tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts +++ b/tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts @@ -30,3 +30,17 @@ type DoubleProp = { [P in keyof T & string as `${P}1` | `${P}2`]: T[P] } type TD1 = DoubleProp<{ a: string, b: number }>; // { a1: string, a2: string, b1: number, b2: number } type TD2 = keyof TD1; // 'a1' | 'a2' | 'b1' | 'b2' type TD3 = keyof DoubleProp; // `${keyof U & string}1` | `${keyof U & string}2` + +// Repro from #40619 + +type Lazyify = { + [K in keyof T as `get${capitalize string & K}`]: () => T[K] +}; + +interface Person { + readonly name: string; + age: number; + location?: string; +} + +type LazyPerson = Lazyify; From 8cd4793a9c93f2a50cc6b9b331b9f9bec74e8c98 Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Mon, 21 Sep 2020 16:33:37 +0100 Subject: [PATCH 010/241] Fix typo in isChangedSignagure (#40668) The correct spelling is `isChangedSignature`. --- src/compiler/builder.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 7765a753312..4c2f6258ddf 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -493,10 +493,10 @@ namespace ts { return !state.semanticDiagnosticsFromOldState.size; } - function isChangedSignagure(state: BuilderProgramState, path: Path) { + function isChangedSignature(state: BuilderProgramState, path: Path) { const newSignature = Debug.checkDefined(state.currentAffectedFilesSignatures).get(path); - const oldSignagure = Debug.checkDefined(state.fileInfos.get(path)).signature; - return newSignature !== oldSignagure; + const oldSignature = Debug.checkDefined(state.fileInfos.get(path)).signature; + return newSignature !== oldSignature; } /** @@ -509,7 +509,7 @@ namespace ts { return; } - if (!isChangedSignagure(state, affectedFile.resolvedPath)) return; + if (!isChangedSignature(state, affectedFile.resolvedPath)) return; // Since isolated modules dont change js files, files affected by change in signature is itself // But we need to cleanup semantic diagnostics and queue dts emit for affected files @@ -522,7 +522,7 @@ namespace ts { if (!seenFileNamesMap.has(currentPath)) { seenFileNamesMap.set(currentPath, true); const result = fn(state, currentPath); - if (result && isChangedSignagure(state, currentPath)) { + if (result && isChangedSignature(state, currentPath)) { const currentSourceFile = Debug.checkDefined(state.program).getSourceFileByPath(currentPath)!; queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); } From ce3dbef5f7424795cf6ef62f81f89b97bfa1a58d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 21 Sep 2020 07:07:29 -1000 Subject: [PATCH 011/241] Support properties of mapped types in assertion control flow analysis (#40482) * Support properties of mapped types in assertion control flow analysis * Add regression test * Accept new baselines --- src/compiler/checker.ts | 6 ++++ .../neverReturningFunctions1.errors.txt | 14 ++++++++ .../reference/neverReturningFunctions1.js | 22 +++++++++++++ .../neverReturningFunctions1.symbols | 31 ++++++++++++++++++ .../reference/neverReturningFunctions1.types | 32 +++++++++++++++++++ .../controlFlow/neverReturningFunctions1.ts | 14 ++++++++ 6 files changed, 119 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 54339bbdf3f..83d2130174f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21103,6 +21103,12 @@ namespace ts { return getTypeOfSymbol(symbol); } if (symbol.flags & (SymbolFlags.Variable | SymbolFlags.Property)) { + if (getCheckFlags(symbol) & CheckFlags.Mapped) { + const origin = (symbol).syntheticOrigin; + if (origin && getExplicitTypeOfSymbol(origin)) { + return getTypeOfSymbol(symbol); + } + } const declaration = symbol.valueDeclaration; if (declaration) { if (isDeclarationWithExplicitTypeAnnotation(declaration)) { diff --git a/tests/baselines/reference/neverReturningFunctions1.errors.txt b/tests/baselines/reference/neverReturningFunctions1.errors.txt index f84395e501c..de3c6a0c53b 100644 --- a/tests/baselines/reference/neverReturningFunctions1.errors.txt +++ b/tests/baselines/reference/neverReturningFunctions1.errors.txt @@ -318,4 +318,18 @@ tests/cases/conformance/controlFlow/neverReturningFunctions1.ts(153,5): error TS this.throw() } } + + // Repro from #40346 + + interface Services { + panic(message: string): never; + } + + function foo(services: Readonly, s: string | null): string { + if (s === null) { + services.panic("ouch"); + } else { + return s; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/neverReturningFunctions1.js b/tests/baselines/reference/neverReturningFunctions1.js index 35be732c3ec..84b356873a6 100644 --- a/tests/baselines/reference/neverReturningFunctions1.js +++ b/tests/baselines/reference/neverReturningFunctions1.js @@ -247,6 +247,20 @@ class SuperThrowable extends MyThrowable { this.throw() } } + +// Repro from #40346 + +interface Services { + panic(message: string): never; +} + +function foo(services: Readonly, s: string | null): string { + if (s === null) { + services.panic("ouch"); + } else { + return s; + } +} //// [neverReturningFunctions1.js] @@ -467,6 +481,14 @@ var SuperThrowable = /** @class */ (function (_super) { }; return SuperThrowable; }(MyThrowable)); +function foo(services, s) { + if (s === null) { + services.panic("ouch"); + } + else { + return s; + } +} //// [neverReturningFunctions1.d.ts] diff --git a/tests/baselines/reference/neverReturningFunctions1.symbols b/tests/baselines/reference/neverReturningFunctions1.symbols index 3ecda28aee1..b91c8fdb4b0 100644 --- a/tests/baselines/reference/neverReturningFunctions1.symbols +++ b/tests/baselines/reference/neverReturningFunctions1.symbols @@ -635,3 +635,34 @@ class SuperThrowable extends MyThrowable { } } +// Repro from #40346 + +interface Services { +>Services : Symbol(Services, Decl(neverReturningFunctions1.ts, 247, 1)) + + panic(message: string): never; +>panic : Symbol(Services.panic, Decl(neverReturningFunctions1.ts, 251, 20)) +>message : Symbol(message, Decl(neverReturningFunctions1.ts, 252, 10)) +} + +function foo(services: Readonly, s: string | null): string { +>foo : Symbol(foo, Decl(neverReturningFunctions1.ts, 253, 1)) +>services : Symbol(services, Decl(neverReturningFunctions1.ts, 255, 13)) +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) +>Services : Symbol(Services, Decl(neverReturningFunctions1.ts, 247, 1)) +>s : Symbol(s, Decl(neverReturningFunctions1.ts, 255, 42)) + + if (s === null) { +>s : Symbol(s, Decl(neverReturningFunctions1.ts, 255, 42)) + + services.panic("ouch"); +>services.panic : Symbol(panic, Decl(neverReturningFunctions1.ts, 251, 20)) +>services : Symbol(services, Decl(neverReturningFunctions1.ts, 255, 13)) +>panic : Symbol(panic, Decl(neverReturningFunctions1.ts, 251, 20)) + + } else { + return s; +>s : Symbol(s, Decl(neverReturningFunctions1.ts, 255, 42)) + } +} + diff --git a/tests/baselines/reference/neverReturningFunctions1.types b/tests/baselines/reference/neverReturningFunctions1.types index 2111736b893..c832fa660dd 100644 --- a/tests/baselines/reference/neverReturningFunctions1.types +++ b/tests/baselines/reference/neverReturningFunctions1.types @@ -706,3 +706,35 @@ class SuperThrowable extends MyThrowable { } } +// Repro from #40346 + +interface Services { + panic(message: string): never; +>panic : (message: string) => never +>message : string +} + +function foo(services: Readonly, s: string | null): string { +>foo : (services: Readonly, s: string | null) => string +>services : Readonly +>s : string | null +>null : null + + if (s === null) { +>s === null : boolean +>s : string | null +>null : null + + services.panic("ouch"); +>services.panic("ouch") : never +>services.panic : (message: string) => never +>services : Readonly +>panic : (message: string) => never +>"ouch" : "ouch" + + } else { + return s; +>s : string + } +} + diff --git a/tests/cases/conformance/controlFlow/neverReturningFunctions1.ts b/tests/cases/conformance/controlFlow/neverReturningFunctions1.ts index c2b553d21b3..de034e803f2 100644 --- a/tests/cases/conformance/controlFlow/neverReturningFunctions1.ts +++ b/tests/cases/conformance/controlFlow/neverReturningFunctions1.ts @@ -250,3 +250,17 @@ class SuperThrowable extends MyThrowable { this.throw() } } + +// Repro from #40346 + +interface Services { + panic(message: string): never; +} + +function foo(services: Readonly, s: string | null): string { + if (s === null) { + services.panic("ouch"); + } else { + return s; + } +} From fbce4f6c989e4296ab43873ffc78e9c17809cac9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 21 Sep 2020 07:09:29 -1000 Subject: [PATCH 012/241] Intrinsic string types (#40580) * Introduce Uppercase and Lowercase intrinsic types * Accept new API baselines * Add Uppercase/Lowercase/Capitalize/Uncapitalize to lib.d.ts * Update fourslash * Add an 'intrinsic' keyword * Update template literal type tests * Accept new API baselines * Minor fixes * Switch Capitalize and Uncapitalize to intrinsic types * Add tests * Accept new baselines * Accept new baselines * Remove template literal type casing modifiers * Update tests * Accept new baselines * Add more tests * Normalize nested template literal types * Add normalization tests * Accept new baselines * Update tests --- src/compiler/checker.ts | 192 +++++-- src/compiler/diagnosticMessages.json | 4 + src/compiler/emitter.ts | 9 - src/compiler/factory/nodeFactory.ts | 10 +- src/compiler/parser.ts | 11 +- src/compiler/scanner.ts | 5 +- src/compiler/types.ts | 39 +- src/harness/fourslashInterfaceImpl.ts | 4 + src/lib/es5.d.ts | 20 + .../reference/api/tsserverlibrary.d.ts | 469 +++++++++--------- tests/baselines/reference/api/typescript.d.ts | 469 +++++++++--------- .../reference/intrinsicKeyword.errors.txt | 51 ++ tests/baselines/reference/intrinsicKeyword.js | 36 ++ .../reference/intrinsicKeyword.symbols | 57 +++ .../reference/intrinsicKeyword.types | 50 ++ .../reference/intrinsicTypes.errors.txt | 90 ++++ tests/baselines/reference/intrinsicTypes.js | 110 ++++ .../reference/intrinsicTypes.symbols | 196 ++++++++ .../baselines/reference/intrinsicTypes.types | 151 ++++++ .../reference/mappedTypeAsClauses.js | 8 +- .../reference/mappedTypeAsClauses.symbols | 8 +- .../reference/mappedTypeAsClauses.types | 4 +- .../templateLiteralTypes1.errors.txt | 30 +- .../reference/templateLiteralTypes1.js | 41 +- .../reference/templateLiteralTypes1.symbols | 369 +++++++------- .../reference/templateLiteralTypes1.types | 47 +- .../types/literal/templateLiteralTypes1.ts | 26 +- .../types/mapped/mappedTypeAsClauses.ts | 4 +- .../types/typeAliases/intrinsicKeyword.ts | 22 + .../types/typeAliases/intrinsicTypes.ts | 57 +++ 30 files changed, 1739 insertions(+), 850 deletions(-) create mode 100644 tests/baselines/reference/intrinsicKeyword.errors.txt create mode 100644 tests/baselines/reference/intrinsicKeyword.js create mode 100644 tests/baselines/reference/intrinsicKeyword.symbols create mode 100644 tests/baselines/reference/intrinsicKeyword.types create mode 100644 tests/baselines/reference/intrinsicTypes.errors.txt create mode 100644 tests/baselines/reference/intrinsicTypes.js create mode 100644 tests/baselines/reference/intrinsicTypes.symbols create mode 100644 tests/baselines/reference/intrinsicTypes.types create mode 100644 tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts create mode 100644 tests/cases/conformance/types/typeAliases/intrinsicTypes.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 83d2130174f..8a74457f15a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -256,6 +256,20 @@ namespace ts { VoidIsNonOptional = 1 << 1, } + const enum IntrinsicTypeKind { + Uppercase, + Lowercase, + Capitalize, + Uncapitalize + } + + const intrinsicTypeKinds: ReadonlyESMap = new Map(getEntries({ + Uppercase: IntrinsicTypeKind.Uppercase, + Lowercase: IntrinsicTypeKind.Lowercase, + Capitalize: IntrinsicTypeKind.Capitalize, + Uncapitalize: IntrinsicTypeKind.Uncapitalize + })); + function SymbolLinks(this: SymbolLinks) { } @@ -705,6 +719,7 @@ namespace ts { const literalTypes = new Map(); const indexedAccessTypes = new Map(); const templateLiteralTypes = new Map(); + const stringMappingTypes = new Map(); const substitutionTypes = new Map(); const evolvingArrayTypes: EvolvingArrayType[] = []; const undefinedProperties: SymbolTable = new Map(); @@ -717,6 +732,7 @@ namespace ts { const wildcardType = createIntrinsicType(TypeFlags.Any, "any"); const errorType = createIntrinsicType(TypeFlags.Any, "error"); const nonInferrableAnyType = createIntrinsicType(TypeFlags.Any, "any", ObjectFlags.ContainsWideningType); + const intrinsicMarkerType = createIntrinsicType(TypeFlags.Any, "intrinsic"); const unknownType = createIntrinsicType(TypeFlags.Unknown, "unknown"); const undefinedType = createIntrinsicType(TypeFlags.Undefined, "undefined"); const undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(TypeFlags.Undefined, "undefined", ObjectFlags.ContainsWideningType); @@ -4344,7 +4360,7 @@ namespace ts { if (type.flags & TypeFlags.Any) { context.approximateLength += 3; - return factory.createKeywordTypeNode(SyntaxKind.AnyKeyword); + return factory.createKeywordTypeNode(type === intrinsicMarkerType ? SyntaxKind.IntrinsicKeyword : SyntaxKind.AnyKeyword); } if (type.flags & TypeFlags.Unknown) { return factory.createKeywordTypeNode(SyntaxKind.UnknownKeyword); @@ -4505,17 +4521,19 @@ namespace ts { } if (type.flags & TypeFlags.TemplateLiteral) { const texts = (type).texts; - const casings = (type).casings; const types = (type).types; const templateHead = factory.createTemplateHead(texts[0]); const templateSpans = factory.createNodeArray( map(types, (t, i) => factory.createTemplateLiteralTypeSpan( - casings[i], typeToTypeNodeHelper(t, context), (i < types.length - 1 ? factory.createTemplateMiddle : factory.createTemplateTail)(texts[i + 1])))); context.approximateLength += 2; return factory.createTemplateLiteralType(templateHead, templateSpans); } + if (type.flags & TypeFlags.StringMapping) { + const typeNode = typeToTypeNodeHelper((type).type, context); + return symbolToTypeNode((type).symbol, context, SymbolFlags.Type, [typeNode]); + } if (type.flags & TypeFlags.IndexedAccess) { const objectTypeNode = typeToTypeNodeHelper((type).objectType, context); const indexTypeNode = typeToTypeNodeHelper((type).indexType, context); @@ -10824,7 +10842,7 @@ namespace ts { } function getBaseConstraintOfType(type: Type): Type | undefined { - if (type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.UnionOrIntersection | TypeFlags.TemplateLiteral)) { + if (type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.UnionOrIntersection | TypeFlags.TemplateLiteral | TypeFlags.StringMapping)) { const constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -10922,7 +10940,11 @@ namespace ts { if (t.flags & TypeFlags.TemplateLiteral) { const types = (t).types; const constraints = mapDefined(types, getBaseConstraint); - return constraints.length === types.length ? getTemplateLiteralType((t).texts, (t).casings, constraints) : stringType; + return constraints.length === types.length ? getTemplateLiteralType((t).texts, constraints) : stringType; + } + if (t.flags & TypeFlags.StringMapping) { + const constraint = getBaseConstraint((t).type); + return constraint ? getStringMappingType((t).symbol, constraint) : stringType; } if (t.flags & TypeFlags.IndexedAccess) { const baseObjectType = getBaseConstraint((t).objectType); @@ -12128,6 +12150,9 @@ namespace ts { function getTypeAliasInstantiation(symbol: Symbol, typeArguments: readonly Type[] | undefined): Type { const type = getDeclaredTypeOfSymbol(symbol); + if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName as string) && typeArguments && typeArguments.length === 1) { + return getStringMappingType(symbol, typeArguments[0]); + } const links = getSymbolLinks(symbol); const typeParameters = links.typeParameters!; const id = getTypeListId(typeArguments); @@ -13465,50 +13490,58 @@ namespace ts { if (!links.resolvedType) { links.resolvedType = getTemplateLiteralType( [node.head.text, ...map(node.templateSpans, span => span.literal.text)], - map(node.templateSpans, span => span.casing), map(node.templateSpans, span => getTypeFromTypeNode(span.type))); } return links.resolvedType; } - function getTemplateLiteralType(texts: readonly string[], casings: readonly TemplateCasing[], types: readonly Type[]): Type { + function getTemplateLiteralType(texts: readonly string[], types: readonly Type[]): Type { const unionIndex = findIndex(types, t => !!(t.flags & (TypeFlags.Never | TypeFlags.Union))); if (unionIndex >= 0) { return checkCrossProductUnion(types) ? - mapType(types[unionIndex], t => getTemplateLiteralType(texts, casings, replaceElement(types, unionIndex, t))) : + mapType(types[unionIndex], t => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType; } - const newTypes = []; - const newCasings = []; - const newTexts = []; + const newTypes: Type[] = []; + const newTexts: string[] = []; let text = texts[0]; - for (let i = 0; i < types.length; i++) { - const t = types[i]; - if (t.flags & TypeFlags.Literal) { - const s = applyTemplateCasing(getTemplateStringForType(t) || "", casings[i]); - text += s; - text += texts[i + 1]; - } - else if (isGenericIndexType(t)) { - newTypes.push(t); - newCasings.push(casings[i]); - newTexts.push(text); - text = texts[i + 1]; - } - else { - return stringType; - } + if (!addSpans(texts, types)) { + return stringType; } if (newTypes.length === 0) { return getLiteralType(text); } newTexts.push(text); - const id = `${getTypeListId(newTypes)}|${newCasings.join(",")}|${map(newTexts, t => t.length).join(",")}|${newTexts.join("")}`; + const id = `${getTypeListId(newTypes)}|${map(newTexts, t => t.length).join(",")}|${newTexts.join("")}`; let type = templateLiteralTypes.get(id); if (!type) { - templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newCasings, newTypes)); + templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes)); } return type; + + function addSpans(texts: readonly string[], types: readonly Type[]): boolean { + for (let i = 0; i < types.length; i++) { + const t = types[i]; + if (t.flags & TypeFlags.Literal) { + text += getTemplateStringForType(t) || ""; + text += texts[i + 1]; + } + else if (t.flags & TypeFlags.TemplateLiteral) { + text += (t).texts[0]; + if (!addSpans((t).texts, (t).types)) return false; + text += texts[i + 1]; + } + else if (isGenericIndexType(t)) { + newTypes.push(t); + newTexts.push(text); + text = texts[i + 1]; + } + else { + return false; + } + } + return true; + } } function getTemplateStringForType(type: Type) { @@ -13519,22 +13552,44 @@ namespace ts { undefined; } - function applyTemplateCasing(str: string, casing: TemplateCasing) { - switch (casing) { - case TemplateCasing.Uppercase: return str.toUpperCase(); - case TemplateCasing.Lowercase: return str.toLowerCase(); - case TemplateCasing.Capitalize: return str.charAt(0).toUpperCase() + str.slice(1); - case TemplateCasing.Uncapitalize: return str.charAt(0).toLowerCase() + str.slice(1); + function createTemplateLiteralType(texts: readonly string[], types: readonly Type[]) { + const type = createType(TypeFlags.TemplateLiteral); + type.texts = texts; + type.types = types; + return type; + } + + function getStringMappingType(symbol: Symbol, type: Type): Type { + return type.flags & (TypeFlags.Union | TypeFlags.Never) ? mapType(type, t => getStringMappingType(symbol, t)) : + isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) : + type.flags & TypeFlags.StringLiteral ? getLiteralType(applyStringMapping(symbol, (type).value)) : + type; + } + + function applyStringMapping(symbol: Symbol, str: string) { + switch (intrinsicTypeKinds.get(symbol.escapedName as string)) { + case IntrinsicTypeKind.Uppercase: return str.toUpperCase(); + case IntrinsicTypeKind.Lowercase: return str.toLowerCase(); + case IntrinsicTypeKind.Capitalize: return str.charAt(0).toUpperCase() + str.slice(1); + case IntrinsicTypeKind.Uncapitalize: return str.charAt(0).toLowerCase() + str.slice(1); } return str; } - function createTemplateLiteralType(texts: readonly string[], casings: readonly TemplateCasing[], types: readonly Type[]) { - const type = createType(TypeFlags.TemplateLiteral); - type.texts = texts; - type.casings = casings; - type.types = types; - return type; + function getStringMappingTypeForGenericType(symbol: Symbol, type: Type): Type { + const id = `${getSymbolId(symbol)},${getTypeId(type)}`; + let result = stringMappingTypes.get(id); + if (!result) { + stringMappingTypes.set(id, result = createStringMappingType(symbol, type)); + } + return result; + } + + function createStringMappingType(symbol: Symbol, type: Type) { + const result = createType(TypeFlags.StringMapping); + result.symbol = symbol; + result.type = type; + return result; } function createIndexedAccessType(objectType: Type, indexType: Type, aliasSymbol: Symbol | undefined, aliasTypeArguments: readonly Type[] | undefined) { @@ -13772,7 +13827,7 @@ namespace ts { } return !!((type).objectFlags & ObjectFlags.IsGenericIndexType); } - return !!(type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.Index | TypeFlags.TemplateLiteral)); + return !!(type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.Index | TypeFlags.TemplateLiteral | TypeFlags.StringMapping)); } function isThisTypeParameter(type: Type): boolean { @@ -14278,7 +14333,7 @@ namespace ts { } function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type: Type) { - return isEmptyObjectType(type) || !!(type.flags & (TypeFlags.Null | TypeFlags.Undefined | TypeFlags.BooleanLike | TypeFlags.NumberLike | TypeFlags.BigIntLike | TypeFlags.StringLike | TypeFlags.EnumLike | TypeFlags.NonPrimitive | TypeFlags.Index | TypeFlags.TemplateLiteral)); + return isEmptyObjectType(type) || !!(type.flags & (TypeFlags.Null | TypeFlags.Undefined | TypeFlags.BooleanLike | TypeFlags.NumberLike | TypeFlags.BigIntLike | TypeFlags.StringLike | TypeFlags.EnumLike | TypeFlags.NonPrimitive | TypeFlags.Index)); } function isSinglePropertyAnonymousObjectType(type: Type) { @@ -14364,7 +14419,7 @@ namespace ts { } return mapType(right, t => getSpreadType(left, t, symbol, objectFlags, readonly)); } - if (right.flags & (TypeFlags.BooleanLike | TypeFlags.NumberLike | TypeFlags.BigIntLike | TypeFlags.StringLike | TypeFlags.EnumLike | TypeFlags.NonPrimitive | TypeFlags.Index | TypeFlags.TemplateLiteral)) { + if (right.flags & (TypeFlags.BooleanLike | TypeFlags.NumberLike | TypeFlags.BigIntLike | TypeFlags.StringLike | TypeFlags.EnumLike | TypeFlags.NonPrimitive | TypeFlags.Index)) { return left; } @@ -14642,6 +14697,8 @@ namespace ts { return neverType; case SyntaxKind.ObjectKeyword: return node.flags & NodeFlags.JavaScriptFile && !noImplicitAny ? anyType : nonPrimitiveType; + case SyntaxKind.IntrinsicKeyword: + return intrinsicMarkerType; case SyntaxKind.ThisType: case SyntaxKind.ThisKeyword as TypeNodeSyntaxKind: // TODO(rbuckton): `ThisKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service and because of `isPartOfTypeNode`. @@ -15166,7 +15223,10 @@ namespace ts { return getIndexType(instantiateType((type).type, mapper)); } if (flags & TypeFlags.TemplateLiteral) { - return getTemplateLiteralType((type).texts, (type).casings, instantiateTypes((type).types, mapper)); + return getTemplateLiteralType((type).texts, instantiateTypes((type).types, mapper)); + } + if (flags & TypeFlags.StringMapping) { + return getStringMappingType((type).symbol, instantiateType((type).type, mapper)); } if (flags & TypeFlags.IndexedAccess) { return getIndexedAccessType(instantiateType((type).objectType, mapper), instantiateType((type).indexType, mapper), /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); @@ -17323,6 +17383,21 @@ namespace ts { return result; } } + else if (source.flags & TypeFlags.StringMapping) { + if (target.flags & TypeFlags.StringMapping && (source).symbol === (target).symbol) { + if (result = isRelatedTo((source).type, (target).type, reportErrors)) { + resetErrorInfo(saveErrorInfo); + return result; + } + } + else { + const constraint = getBaseConstraintOfType(source); + if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) { + resetErrorInfo(saveErrorInfo); + return result; + } + } + } else if (source.flags & TypeFlags.Conditional) { if (target.flags & TypeFlags.Conditional) { // Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if @@ -19767,6 +19842,11 @@ namespace ts { inferFromTypes((source).objectType, (target).objectType); inferFromTypes((source).indexType, (target).indexType); } + else if (source.flags & TypeFlags.StringMapping && target.flags & TypeFlags.StringMapping) { + if ((source).symbol === (target).symbol) { + inferFromTypes((source).type, (target).type); + } + } else if (target.flags & TypeFlags.Conditional) { invokeOnce(source, target, inferToConditionalType); } @@ -20063,7 +20143,7 @@ namespace ts { function inferToTemplateLiteralType(source: Type, target: TemplateLiteralType) { const matches = source.flags & TypeFlags.StringLiteral ? inferLiteralsFromTemplateLiteralType(source, target) : - source.flags & TypeFlags.TemplateLiteral && arraysEqual((source).texts, target.texts) && arraysEqual((source).casings, target.casings)? (source).types : + source.flags & TypeFlags.TemplateLiteral && arraysEqual((source).texts, target.texts) ? (source).types : undefined; const types = target.types; for (let i = 0; i < types.length; i++) { @@ -20257,7 +20337,7 @@ namespace ts { function hasPrimitiveConstraint(type: TypeParameter): boolean { const constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & TypeFlags.Conditional ? getDefaultConstraintOfConditionalType(constraint as ConditionalType) : constraint, TypeFlags.Primitive | TypeFlags.Index | TypeFlags.TemplateLiteral); + return !!constraint && maybeTypeOfKind(constraint.flags & TypeFlags.Conditional ? getDefaultConstraintOfConditionalType(constraint as ConditionalType) : constraint, TypeFlags.Primitive | TypeFlags.Index | TypeFlags.TemplateLiteral | TypeFlags.StringMapping); } function isObjectLiteralType(type: Type) { @@ -26319,7 +26399,7 @@ namespace ts { else { const contextualType = getIndexedAccessType(restType, getLiteralType(i - index)); const argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - const hasPrimitiveContextualType = maybeTypeOfKind(contextualType, TypeFlags.Primitive | TypeFlags.Index | TypeFlags.TemplateLiteral); + const hasPrimitiveContextualType = maybeTypeOfKind(contextualType, TypeFlags.Primitive | TypeFlags.Index | TypeFlags.TemplateLiteral | TypeFlags.StringMapping); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(ElementFlags.Required); } @@ -29380,7 +29460,7 @@ namespace ts { // and the right operand to be of type Any, an object type, or a type parameter type. // The result is always of the Boolean primitive type. if (!(allTypesAssignableToKind(leftType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbolLike) || - isTypeAssignableToKind(leftType, TypeFlags.Index | TypeFlags.TemplateLiteral | TypeFlags.TypeParameter))) { + isTypeAssignableToKind(leftType, TypeFlags.Index | TypeFlags.TemplateLiteral | TypeFlags.StringMapping | TypeFlags.TypeParameter))) { error(left, Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } if (!allTypesAssignableToKind(rightType, TypeFlags.NonPrimitive | TypeFlags.InstantiableNonPrimitive)) { @@ -30334,7 +30414,7 @@ namespace ts { } // If the contextual type is a literal of a particular primitive type, we consider this a // literal context for all literals of that primitive type. - return !!(contextualType.flags & (TypeFlags.StringLiteral | TypeFlags.Index | TypeFlags.TemplateLiteral) && maybeTypeOfKind(candidateType, TypeFlags.StringLiteral) || + return !!(contextualType.flags & (TypeFlags.StringLiteral | TypeFlags.Index | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) && maybeTypeOfKind(candidateType, TypeFlags.StringLiteral) || contextualType.flags & TypeFlags.NumberLiteral && maybeTypeOfKind(candidateType, TypeFlags.NumberLiteral) || contextualType.flags & TypeFlags.BigIntLiteral && maybeTypeOfKind(candidateType, TypeFlags.BigIntLiteral) || contextualType.flags & TypeFlags.BooleanLiteral && maybeTypeOfKind(candidateType, TypeFlags.BooleanLiteral) || @@ -35316,12 +35396,18 @@ namespace ts { function checkTypeAliasDeclaration(node: TypeAliasDeclaration) { // Grammar checking checkGrammarDecoratorsAndModifiers(node); - checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); - checkSourceElement(node.type); - registerForUnusedIdentifiersCheck(node); + if (node.type.kind === SyntaxKind.IntrinsicKeyword) { + if (!intrinsicTypeKinds.has(node.name.escapedText as string) || length(node.typeParameters) !== 1) { + error(node.type, Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); + } + } + else { + checkSourceElement(node.type); + registerForUnusedIdentifiersCheck(node); + } } function computeEnumMemberValues(node: EnumDeclaration) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a46ddd430f9..29a31559aa4 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3043,6 +3043,10 @@ "category": "Error", "code": 2794 }, + "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.": { + "category": "Error", + "code": 2795 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 5d4811f08ef..237d3fee9cd 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2023,15 +2023,6 @@ namespace ts { } function emitTemplateTypeSpan(node: TemplateLiteralTypeSpan) { - const keyword = node.casing === TemplateCasing.Uppercase ? "uppercase" : - node.casing === TemplateCasing.Lowercase ? "lowercase" : - node.casing === TemplateCasing.Capitalize ? "capitalize" : - node.casing === TemplateCasing.Uncapitalize ? "uncapitalize" : - undefined; - if (keyword) { - writeKeyword(keyword); - writeSpace(); - } emit(node.type); emit(node.literal); } diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts index 0e2cf25d281..3d1b6fdb9a7 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -1605,9 +1605,8 @@ namespace ts { } // @api - function createTemplateLiteralTypeSpan(casing: TemplateCasing, type: TypeNode, literal: TemplateMiddle | TemplateTail) { + function createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail) { const node = createBaseNode(SyntaxKind.TemplateLiteralTypeSpan); - node.casing = casing; node.type = type; node.literal = literal; node.transformFlags = TransformFlags.ContainsTypeScript; @@ -1615,11 +1614,10 @@ namespace ts { } // @api - function updateTemplateLiteralTypeSpan(casing: TemplateCasing, node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail) { - return node.casing !== casing - || node.type !== type + function updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail) { + return node.type !== type || node.literal !== literal - ? update(createTemplateLiteralTypeSpan(casing, type, literal), node) + ? update(createTemplateLiteralTypeSpan(type, literal), node) : node; } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index af797435c9d..a815a12db9a 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2618,7 +2618,6 @@ namespace ts { const pos = getNodePos(); return finishNode( factory.createTemplateLiteralTypeSpan( - parseTemplateCasing(), parseType(), parseLiteralOfTemplateSpan(/*isTaggedTemplate*/ false) ), @@ -2626,14 +2625,6 @@ namespace ts { ); } - function parseTemplateCasing(): TemplateCasing { - return parseOptional(SyntaxKind.UppercaseKeyword) ? TemplateCasing.Uppercase : - parseOptional(SyntaxKind.LowercaseKeyword) ? TemplateCasing.Lowercase : - parseOptional(SyntaxKind.CapitalizeKeyword) ? TemplateCasing.Capitalize : - parseOptional(SyntaxKind.UncapitalizeKeyword) ? TemplateCasing.Uncapitalize : - TemplateCasing.None; - } - function parseLiteralOfTemplateSpan(isTaggedTemplate: boolean) { if (token() === SyntaxKind.CloseBraceToken) { reScanTemplateToken(isTaggedTemplate); @@ -6751,7 +6742,7 @@ namespace ts { const name = parseIdentifier(); const typeParameters = parseTypeParameters(); parseExpected(SyntaxKind.EqualsToken); - const type = parseType(); + const type = token() === SyntaxKind.IntrinsicKeyword && tryParse(parseKeywordAndNoDot) || parseType(); parseSemicolon(); const node = factory.createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 5f5248e1073..35388e38b04 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -111,6 +111,7 @@ namespace ts { infer: SyntaxKind.InferKeyword, instanceof: SyntaxKind.InstanceOfKeyword, interface: SyntaxKind.InterfaceKeyword, + intrinsic: SyntaxKind.IntrinsicKeyword, is: SyntaxKind.IsKeyword, keyof: SyntaxKind.KeyOfKeyword, let: SyntaxKind.LetKeyword, @@ -151,10 +152,6 @@ namespace ts { yield: SyntaxKind.YieldKeyword, async: SyntaxKind.AsyncKeyword, await: SyntaxKind.AwaitKeyword, - uppercase: SyntaxKind.UppercaseKeyword, - lowercase: SyntaxKind.LowercaseKeyword, - capitalize: SyntaxKind.CapitalizeKeyword, - uncapitalize: SyntaxKind.UncapitalizeKeyword, of: SyntaxKind.OfKeyword, }; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index eec63bd9054..fbf308707a1 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -167,6 +167,7 @@ namespace ts { DeclareKeyword, GetKeyword, InferKeyword, + IntrinsicKeyword, IsKeyword, KeyOfKeyword, ModuleKeyword, @@ -186,10 +187,6 @@ namespace ts { FromKeyword, GlobalKeyword, BigIntKeyword, - UppercaseKeyword, - LowercaseKeyword, - CapitalizeKeyword, - UncapitalizeKeyword, OfKeyword, // LastKeyword and LastToken and LastContextualKeyword // Parse tree nodes @@ -544,7 +541,6 @@ namespace ts { | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword - | SyntaxKind.CapitalizeKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword @@ -574,10 +570,10 @@ namespace ts { | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword + | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword - | SyntaxKind.LowercaseKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword @@ -605,11 +601,9 @@ namespace ts { | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword - | SyntaxKind.UncapitalizeKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword - | SyntaxKind.UppercaseKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword @@ -635,6 +629,7 @@ namespace ts { | SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword + | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword @@ -1665,19 +1660,10 @@ namespace ts { export interface TemplateLiteralTypeSpan extends TypeNode { readonly kind: SyntaxKind.TemplateLiteralTypeSpan, readonly parent: TemplateLiteralTypeNode; - readonly casing: TemplateCasing; readonly type: TypeNode; readonly literal: TemplateMiddle | TemplateTail; } - export const enum TemplateCasing { - None, - Uppercase, - Lowercase, - Capitalize, - Uncapitalize, - } - // Note: 'brands' in our syntax nodes serve to give us a small amount of nominal typing. // Consider 'Expression'. Without the brand, 'Expression' is actually no different // (structurally) than 'Node'. Because of this you can pass any Node to a function that @@ -4892,6 +4878,7 @@ namespace ts { Substitution = 1 << 25, // Type parameter substitution NonPrimitive = 1 << 26, // intrinsic object type TemplateLiteral = 1 << 27, // Template literal type + StringMapping = 1 << 28, // Uppercase/Lowercase type /* @internal */ AnyOrUnknown = Any | Unknown, @@ -4909,7 +4896,7 @@ namespace ts { Intrinsic = Any | Unknown | String | Number | BigInt | Boolean | BooleanLiteral | ESSymbol | Void | Undefined | Null | Never | NonPrimitive, /* @internal */ Primitive = String | Number | BigInt | Boolean | Enum | EnumLiteral | ESSymbol | Void | Undefined | Null | Literal | UniqueESSymbol, - StringLike = String | StringLiteral | TemplateLiteral, + StringLike = String | StringLiteral | TemplateLiteral | StringMapping, NumberLike = Number | NumberLiteral | Enum, BigIntLike = BigInt | BigIntLiteral, BooleanLike = Boolean | BooleanLiteral, @@ -4922,7 +4909,7 @@ namespace ts { StructuredType = Object | Union | Intersection, TypeVariable = TypeParameter | IndexedAccess, InstantiableNonPrimitive = TypeVariable | Conditional | Substitution, - InstantiablePrimitive = Index | TemplateLiteral, + InstantiablePrimitive = Index | TemplateLiteral | StringMapping, Instantiable = InstantiableNonPrimitive | InstantiablePrimitive, StructuredOrInstantiable = StructuredType | Instantiable, /* @internal */ @@ -4930,7 +4917,7 @@ namespace ts { /* @internal */ Simplifiable = IndexedAccess | Conditional, /* @internal */ - Substructure = Object | Union | Intersection | Index | IndexedAccess | Conditional | Substitution | TemplateLiteral, + Substructure = Object | Union | Intersection | Index | IndexedAccess | Conditional | Substitution | TemplateLiteral | StringMapping, // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BigIntLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive, @@ -5379,11 +5366,15 @@ namespace ts { } export interface TemplateLiteralType extends InstantiableType { - texts: readonly string[]; // Always one element longer than casings/types - casings: readonly TemplateCasing[]; // Always at least one element + texts: readonly string[]; // Always one element longer than types types: readonly Type[]; // Always at least one element } + export interface StringMappingType extends InstantiableType { + symbol: Symbol; + type: Type; + } + // Type parameter substitution (TypeFlags.Substitution) // Substitution types are created for type parameters or indexed access types that occur in the // true branch of a conditional type. For example, in 'T extends string ? Foo : Bar', the @@ -6774,8 +6765,8 @@ namespace ts { createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; /* @internal */ createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): IndexSignatureDeclaration; // eslint-disable-line @typescript-eslint/unified-signatures updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - createTemplateLiteralTypeSpan(casing: TemplateCasing, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; - updateTemplateLiteralTypeSpan(casing: TemplateCasing, node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; + createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; + updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; // // Types diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index fc3dce9e1ff..f946e2d8bc3 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -1065,6 +1065,10 @@ namespace FourSlashInterface { typeEntry("ConstructorParameters"), typeEntry("ReturnType"), typeEntry("InstanceType"), + typeEntry("Uppercase"), + typeEntry("Lowercase"), + typeEntry("Capitalize"), + typeEntry("Uncapitalize"), interfaceEntry("ThisType"), varEntry("ArrayBuffer"), interfaceEntry("ArrayBufferTypes"), diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index d40318a5e8e..cf95c473240 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1508,6 +1508,26 @@ type ReturnType any> = T extends (...args: any) => i */ type InstanceType any> = T extends new (...args: any) => infer R ? R : any; +/** + * Convert string literal type to uppercase + */ +type Uppercase = intrinsic; + +/** + * Convert string literal type to lowercase + */ +type Lowercase = intrinsic; + +/** + * Convert first character of string literal type to uppercase + */ +type Capitalize = intrinsic; + +/** + * Convert first character of string literal type to lowercase + */ +type Uncapitalize = intrinsic; + /** * Marker for contextual 'this' type */ diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 58167e3f7b9..621b4141291 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -240,215 +240,212 @@ declare namespace ts { DeclareKeyword = 133, GetKeyword = 134, InferKeyword = 135, - IsKeyword = 136, - KeyOfKeyword = 137, - ModuleKeyword = 138, - NamespaceKeyword = 139, - NeverKeyword = 140, - ReadonlyKeyword = 141, - RequireKeyword = 142, - NumberKeyword = 143, - ObjectKeyword = 144, - SetKeyword = 145, - StringKeyword = 146, - SymbolKeyword = 147, - TypeKeyword = 148, - UndefinedKeyword = 149, - UniqueKeyword = 150, - UnknownKeyword = 151, - FromKeyword = 152, - GlobalKeyword = 153, - BigIntKeyword = 154, - UppercaseKeyword = 155, - LowercaseKeyword = 156, - CapitalizeKeyword = 157, - UncapitalizeKeyword = 158, - OfKeyword = 159, - QualifiedName = 160, - ComputedPropertyName = 161, - TypeParameter = 162, - Parameter = 163, - Decorator = 164, - PropertySignature = 165, - PropertyDeclaration = 166, - MethodSignature = 167, - MethodDeclaration = 168, - Constructor = 169, - GetAccessor = 170, - SetAccessor = 171, - CallSignature = 172, - ConstructSignature = 173, - IndexSignature = 174, - TypePredicate = 175, - TypeReference = 176, - FunctionType = 177, - ConstructorType = 178, - TypeQuery = 179, - TypeLiteral = 180, - ArrayType = 181, - TupleType = 182, - OptionalType = 183, - RestType = 184, - UnionType = 185, - IntersectionType = 186, - ConditionalType = 187, - InferType = 188, - ParenthesizedType = 189, - ThisType = 190, - TypeOperator = 191, - IndexedAccessType = 192, - MappedType = 193, - LiteralType = 194, - NamedTupleMember = 195, - TemplateLiteralType = 196, - TemplateLiteralTypeSpan = 197, - ImportType = 198, - ObjectBindingPattern = 199, - ArrayBindingPattern = 200, - BindingElement = 201, - ArrayLiteralExpression = 202, - ObjectLiteralExpression = 203, - PropertyAccessExpression = 204, - ElementAccessExpression = 205, - CallExpression = 206, - NewExpression = 207, - TaggedTemplateExpression = 208, - TypeAssertionExpression = 209, - ParenthesizedExpression = 210, - FunctionExpression = 211, - ArrowFunction = 212, - DeleteExpression = 213, - TypeOfExpression = 214, - VoidExpression = 215, - AwaitExpression = 216, - PrefixUnaryExpression = 217, - PostfixUnaryExpression = 218, - BinaryExpression = 219, - ConditionalExpression = 220, - TemplateExpression = 221, - YieldExpression = 222, - SpreadElement = 223, - ClassExpression = 224, - OmittedExpression = 225, - ExpressionWithTypeArguments = 226, - AsExpression = 227, - NonNullExpression = 228, - MetaProperty = 229, - SyntheticExpression = 230, - TemplateSpan = 231, - SemicolonClassElement = 232, - Block = 233, - EmptyStatement = 234, - VariableStatement = 235, - ExpressionStatement = 236, - IfStatement = 237, - DoStatement = 238, - WhileStatement = 239, - ForStatement = 240, - ForInStatement = 241, - ForOfStatement = 242, - ContinueStatement = 243, - BreakStatement = 244, - ReturnStatement = 245, - WithStatement = 246, - SwitchStatement = 247, - LabeledStatement = 248, - ThrowStatement = 249, - TryStatement = 250, - DebuggerStatement = 251, - VariableDeclaration = 252, - VariableDeclarationList = 253, - FunctionDeclaration = 254, - ClassDeclaration = 255, - InterfaceDeclaration = 256, - TypeAliasDeclaration = 257, - EnumDeclaration = 258, - ModuleDeclaration = 259, - ModuleBlock = 260, - CaseBlock = 261, - NamespaceExportDeclaration = 262, - ImportEqualsDeclaration = 263, - ImportDeclaration = 264, - ImportClause = 265, - NamespaceImport = 266, - NamedImports = 267, - ImportSpecifier = 268, - ExportAssignment = 269, - ExportDeclaration = 270, - NamedExports = 271, - NamespaceExport = 272, - ExportSpecifier = 273, - MissingDeclaration = 274, - ExternalModuleReference = 275, - JsxElement = 276, - JsxSelfClosingElement = 277, - JsxOpeningElement = 278, - JsxClosingElement = 279, - JsxFragment = 280, - JsxOpeningFragment = 281, - JsxClosingFragment = 282, - JsxAttribute = 283, - JsxAttributes = 284, - JsxSpreadAttribute = 285, - JsxExpression = 286, - CaseClause = 287, - DefaultClause = 288, - HeritageClause = 289, - CatchClause = 290, - PropertyAssignment = 291, - ShorthandPropertyAssignment = 292, - SpreadAssignment = 293, - EnumMember = 294, - UnparsedPrologue = 295, - UnparsedPrepend = 296, - UnparsedText = 297, - UnparsedInternalText = 298, - UnparsedSyntheticReference = 299, - SourceFile = 300, - Bundle = 301, - UnparsedSource = 302, - InputFiles = 303, - JSDocTypeExpression = 304, - JSDocNameReference = 305, - JSDocAllType = 306, - JSDocUnknownType = 307, - JSDocNullableType = 308, - JSDocNonNullableType = 309, - JSDocOptionalType = 310, - JSDocFunctionType = 311, - JSDocVariadicType = 312, - JSDocNamepathType = 313, - JSDocComment = 314, - JSDocTypeLiteral = 315, - JSDocSignature = 316, - JSDocTag = 317, - JSDocAugmentsTag = 318, - JSDocImplementsTag = 319, - JSDocAuthorTag = 320, - JSDocDeprecatedTag = 321, - JSDocClassTag = 322, - JSDocPublicTag = 323, - JSDocPrivateTag = 324, - JSDocProtectedTag = 325, - JSDocReadonlyTag = 326, - JSDocCallbackTag = 327, - JSDocEnumTag = 328, - JSDocParameterTag = 329, - JSDocReturnTag = 330, - JSDocThisTag = 331, - JSDocTypeTag = 332, - JSDocTemplateTag = 333, - JSDocTypedefTag = 334, - JSDocSeeTag = 335, - JSDocPropertyTag = 336, - SyntaxList = 337, - NotEmittedStatement = 338, - PartiallyEmittedExpression = 339, - CommaListExpression = 340, - MergeDeclarationMarker = 341, - EndOfDeclarationMarker = 342, - SyntheticReferenceExpression = 343, - Count = 344, + IntrinsicKeyword = 136, + IsKeyword = 137, + KeyOfKeyword = 138, + ModuleKeyword = 139, + NamespaceKeyword = 140, + NeverKeyword = 141, + ReadonlyKeyword = 142, + RequireKeyword = 143, + NumberKeyword = 144, + ObjectKeyword = 145, + SetKeyword = 146, + StringKeyword = 147, + SymbolKeyword = 148, + TypeKeyword = 149, + UndefinedKeyword = 150, + UniqueKeyword = 151, + UnknownKeyword = 152, + FromKeyword = 153, + GlobalKeyword = 154, + BigIntKeyword = 155, + OfKeyword = 156, + QualifiedName = 157, + ComputedPropertyName = 158, + TypeParameter = 159, + Parameter = 160, + Decorator = 161, + PropertySignature = 162, + PropertyDeclaration = 163, + MethodSignature = 164, + MethodDeclaration = 165, + Constructor = 166, + GetAccessor = 167, + SetAccessor = 168, + CallSignature = 169, + ConstructSignature = 170, + IndexSignature = 171, + TypePredicate = 172, + TypeReference = 173, + FunctionType = 174, + ConstructorType = 175, + TypeQuery = 176, + TypeLiteral = 177, + ArrayType = 178, + TupleType = 179, + OptionalType = 180, + RestType = 181, + UnionType = 182, + IntersectionType = 183, + ConditionalType = 184, + InferType = 185, + ParenthesizedType = 186, + ThisType = 187, + TypeOperator = 188, + IndexedAccessType = 189, + MappedType = 190, + LiteralType = 191, + NamedTupleMember = 192, + TemplateLiteralType = 193, + TemplateLiteralTypeSpan = 194, + ImportType = 195, + ObjectBindingPattern = 196, + ArrayBindingPattern = 197, + BindingElement = 198, + ArrayLiteralExpression = 199, + ObjectLiteralExpression = 200, + PropertyAccessExpression = 201, + ElementAccessExpression = 202, + CallExpression = 203, + NewExpression = 204, + TaggedTemplateExpression = 205, + TypeAssertionExpression = 206, + ParenthesizedExpression = 207, + FunctionExpression = 208, + ArrowFunction = 209, + DeleteExpression = 210, + TypeOfExpression = 211, + VoidExpression = 212, + AwaitExpression = 213, + PrefixUnaryExpression = 214, + PostfixUnaryExpression = 215, + BinaryExpression = 216, + ConditionalExpression = 217, + TemplateExpression = 218, + YieldExpression = 219, + SpreadElement = 220, + ClassExpression = 221, + OmittedExpression = 222, + ExpressionWithTypeArguments = 223, + AsExpression = 224, + NonNullExpression = 225, + MetaProperty = 226, + SyntheticExpression = 227, + TemplateSpan = 228, + SemicolonClassElement = 229, + Block = 230, + EmptyStatement = 231, + VariableStatement = 232, + ExpressionStatement = 233, + IfStatement = 234, + DoStatement = 235, + WhileStatement = 236, + ForStatement = 237, + ForInStatement = 238, + ForOfStatement = 239, + ContinueStatement = 240, + BreakStatement = 241, + ReturnStatement = 242, + WithStatement = 243, + SwitchStatement = 244, + LabeledStatement = 245, + ThrowStatement = 246, + TryStatement = 247, + DebuggerStatement = 248, + VariableDeclaration = 249, + VariableDeclarationList = 250, + FunctionDeclaration = 251, + ClassDeclaration = 252, + InterfaceDeclaration = 253, + TypeAliasDeclaration = 254, + EnumDeclaration = 255, + ModuleDeclaration = 256, + ModuleBlock = 257, + CaseBlock = 258, + NamespaceExportDeclaration = 259, + ImportEqualsDeclaration = 260, + ImportDeclaration = 261, + ImportClause = 262, + NamespaceImport = 263, + NamedImports = 264, + ImportSpecifier = 265, + ExportAssignment = 266, + ExportDeclaration = 267, + NamedExports = 268, + NamespaceExport = 269, + ExportSpecifier = 270, + MissingDeclaration = 271, + ExternalModuleReference = 272, + JsxElement = 273, + JsxSelfClosingElement = 274, + JsxOpeningElement = 275, + JsxClosingElement = 276, + JsxFragment = 277, + JsxOpeningFragment = 278, + JsxClosingFragment = 279, + JsxAttribute = 280, + JsxAttributes = 281, + JsxSpreadAttribute = 282, + JsxExpression = 283, + CaseClause = 284, + DefaultClause = 285, + HeritageClause = 286, + CatchClause = 287, + PropertyAssignment = 288, + ShorthandPropertyAssignment = 289, + SpreadAssignment = 290, + EnumMember = 291, + UnparsedPrologue = 292, + UnparsedPrepend = 293, + UnparsedText = 294, + UnparsedInternalText = 295, + UnparsedSyntheticReference = 296, + SourceFile = 297, + Bundle = 298, + UnparsedSource = 299, + InputFiles = 300, + JSDocTypeExpression = 301, + JSDocNameReference = 302, + JSDocAllType = 303, + JSDocUnknownType = 304, + JSDocNullableType = 305, + JSDocNonNullableType = 306, + JSDocOptionalType = 307, + JSDocFunctionType = 308, + JSDocVariadicType = 309, + JSDocNamepathType = 310, + JSDocComment = 311, + JSDocTypeLiteral = 312, + JSDocSignature = 313, + JSDocTag = 314, + JSDocAugmentsTag = 315, + JSDocImplementsTag = 316, + JSDocAuthorTag = 317, + JSDocDeprecatedTag = 318, + JSDocClassTag = 319, + JSDocPublicTag = 320, + JSDocPrivateTag = 321, + JSDocProtectedTag = 322, + JSDocReadonlyTag = 323, + JSDocCallbackTag = 324, + JSDocEnumTag = 325, + JSDocParameterTag = 326, + JSDocReturnTag = 327, + JSDocThisTag = 328, + JSDocTypeTag = 329, + JSDocTemplateTag = 330, + JSDocTypedefTag = 331, + JSDocSeeTag = 332, + JSDocPropertyTag = 333, + SyntaxList = 334, + NotEmittedStatement = 335, + PartiallyEmittedExpression = 336, + CommaListExpression = 337, + MergeDeclarationMarker = 338, + EndOfDeclarationMarker = 339, + SyntheticReferenceExpression = 340, + Count = 341, FirstAssignment = 62, LastAssignment = 77, FirstCompoundAssignment = 63, @@ -456,15 +453,15 @@ declare namespace ts { FirstReservedWord = 80, LastReservedWord = 115, FirstKeyword = 80, - LastKeyword = 159, + LastKeyword = 156, FirstFutureReservedWord = 116, LastFutureReservedWord = 124, - FirstTypeNode = 175, - LastTypeNode = 198, + FirstTypeNode = 172, + LastTypeNode = 195, FirstPunctuation = 18, LastPunctuation = 77, FirstToken = 0, - LastToken = 159, + LastToken = 156, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -473,21 +470,21 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 77, - FirstStatement = 235, - LastStatement = 251, - FirstNode = 160, - FirstJSDocNode = 304, - LastJSDocNode = 336, - FirstJSDocTagNode = 317, - LastJSDocTagNode = 336, + FirstStatement = 232, + LastStatement = 248, + FirstNode = 157, + FirstJSDocNode = 301, + LastJSDocNode = 333, + FirstJSDocTagNode = 314, + LastJSDocTagNode = 333, } export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CapitalizeKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.LowercaseKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UncapitalizeKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.UppercaseKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.StaticKeyword; - export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; + export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; @@ -972,17 +969,9 @@ declare namespace ts { export interface TemplateLiteralTypeSpan extends TypeNode { readonly kind: SyntaxKind.TemplateLiteralTypeSpan; readonly parent: TemplateLiteralTypeNode; - readonly casing: TemplateCasing; readonly type: TypeNode; readonly literal: TemplateMiddle | TemplateTail; } - export enum TemplateCasing { - None = 0, - Uppercase = 1, - Lowercase = 2, - Capitalize = 3, - Uncapitalize = 4 - } export interface Expression extends Node { _expressionBrand: any; } @@ -2489,11 +2478,12 @@ declare namespace ts { Substitution = 33554432, NonPrimitive = 67108864, TemplateLiteral = 134217728, + StringMapping = 268435456, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, PossiblyFalsy = 117724, - StringLike = 134217860, + StringLike = 402653316, NumberLike = 296, BigIntLike = 2112, BooleanLike = 528, @@ -2504,10 +2494,10 @@ declare namespace ts { StructuredType = 3670016, TypeVariable = 8650752, InstantiableNonPrimitive = 58982400, - InstantiablePrimitive = 138412032, - Instantiable = 197394432, - StructuredOrInstantiable = 201064448, - Narrowable = 268188671, + InstantiablePrimitive = 406847488, + Instantiable = 465829888, + StructuredOrInstantiable = 469499904, + Narrowable = 536624127, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; export interface Type { @@ -2660,9 +2650,12 @@ declare namespace ts { } export interface TemplateLiteralType extends InstantiableType { texts: readonly string[]; - casings: readonly TemplateCasing[]; types: readonly Type[]; } + export interface StringMappingType extends InstantiableType { + symbol: Symbol; + type: Type; + } export interface SubstitutionType extends InstantiableType { baseType: Type; substitute: Type; @@ -3225,8 +3218,8 @@ declare namespace ts { updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - createTemplateLiteralTypeSpan(casing: TemplateCasing, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; - updateTemplateLiteralTypeSpan(casing: TemplateCasing, node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; + createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; + updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; createKeywordTypeNode(kind: TKind): KeywordTypeNode; createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode; updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 3a4fc7ae36e..0df67772e6e 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -240,215 +240,212 @@ declare namespace ts { DeclareKeyword = 133, GetKeyword = 134, InferKeyword = 135, - IsKeyword = 136, - KeyOfKeyword = 137, - ModuleKeyword = 138, - NamespaceKeyword = 139, - NeverKeyword = 140, - ReadonlyKeyword = 141, - RequireKeyword = 142, - NumberKeyword = 143, - ObjectKeyword = 144, - SetKeyword = 145, - StringKeyword = 146, - SymbolKeyword = 147, - TypeKeyword = 148, - UndefinedKeyword = 149, - UniqueKeyword = 150, - UnknownKeyword = 151, - FromKeyword = 152, - GlobalKeyword = 153, - BigIntKeyword = 154, - UppercaseKeyword = 155, - LowercaseKeyword = 156, - CapitalizeKeyword = 157, - UncapitalizeKeyword = 158, - OfKeyword = 159, - QualifiedName = 160, - ComputedPropertyName = 161, - TypeParameter = 162, - Parameter = 163, - Decorator = 164, - PropertySignature = 165, - PropertyDeclaration = 166, - MethodSignature = 167, - MethodDeclaration = 168, - Constructor = 169, - GetAccessor = 170, - SetAccessor = 171, - CallSignature = 172, - ConstructSignature = 173, - IndexSignature = 174, - TypePredicate = 175, - TypeReference = 176, - FunctionType = 177, - ConstructorType = 178, - TypeQuery = 179, - TypeLiteral = 180, - ArrayType = 181, - TupleType = 182, - OptionalType = 183, - RestType = 184, - UnionType = 185, - IntersectionType = 186, - ConditionalType = 187, - InferType = 188, - ParenthesizedType = 189, - ThisType = 190, - TypeOperator = 191, - IndexedAccessType = 192, - MappedType = 193, - LiteralType = 194, - NamedTupleMember = 195, - TemplateLiteralType = 196, - TemplateLiteralTypeSpan = 197, - ImportType = 198, - ObjectBindingPattern = 199, - ArrayBindingPattern = 200, - BindingElement = 201, - ArrayLiteralExpression = 202, - ObjectLiteralExpression = 203, - PropertyAccessExpression = 204, - ElementAccessExpression = 205, - CallExpression = 206, - NewExpression = 207, - TaggedTemplateExpression = 208, - TypeAssertionExpression = 209, - ParenthesizedExpression = 210, - FunctionExpression = 211, - ArrowFunction = 212, - DeleteExpression = 213, - TypeOfExpression = 214, - VoidExpression = 215, - AwaitExpression = 216, - PrefixUnaryExpression = 217, - PostfixUnaryExpression = 218, - BinaryExpression = 219, - ConditionalExpression = 220, - TemplateExpression = 221, - YieldExpression = 222, - SpreadElement = 223, - ClassExpression = 224, - OmittedExpression = 225, - ExpressionWithTypeArguments = 226, - AsExpression = 227, - NonNullExpression = 228, - MetaProperty = 229, - SyntheticExpression = 230, - TemplateSpan = 231, - SemicolonClassElement = 232, - Block = 233, - EmptyStatement = 234, - VariableStatement = 235, - ExpressionStatement = 236, - IfStatement = 237, - DoStatement = 238, - WhileStatement = 239, - ForStatement = 240, - ForInStatement = 241, - ForOfStatement = 242, - ContinueStatement = 243, - BreakStatement = 244, - ReturnStatement = 245, - WithStatement = 246, - SwitchStatement = 247, - LabeledStatement = 248, - ThrowStatement = 249, - TryStatement = 250, - DebuggerStatement = 251, - VariableDeclaration = 252, - VariableDeclarationList = 253, - FunctionDeclaration = 254, - ClassDeclaration = 255, - InterfaceDeclaration = 256, - TypeAliasDeclaration = 257, - EnumDeclaration = 258, - ModuleDeclaration = 259, - ModuleBlock = 260, - CaseBlock = 261, - NamespaceExportDeclaration = 262, - ImportEqualsDeclaration = 263, - ImportDeclaration = 264, - ImportClause = 265, - NamespaceImport = 266, - NamedImports = 267, - ImportSpecifier = 268, - ExportAssignment = 269, - ExportDeclaration = 270, - NamedExports = 271, - NamespaceExport = 272, - ExportSpecifier = 273, - MissingDeclaration = 274, - ExternalModuleReference = 275, - JsxElement = 276, - JsxSelfClosingElement = 277, - JsxOpeningElement = 278, - JsxClosingElement = 279, - JsxFragment = 280, - JsxOpeningFragment = 281, - JsxClosingFragment = 282, - JsxAttribute = 283, - JsxAttributes = 284, - JsxSpreadAttribute = 285, - JsxExpression = 286, - CaseClause = 287, - DefaultClause = 288, - HeritageClause = 289, - CatchClause = 290, - PropertyAssignment = 291, - ShorthandPropertyAssignment = 292, - SpreadAssignment = 293, - EnumMember = 294, - UnparsedPrologue = 295, - UnparsedPrepend = 296, - UnparsedText = 297, - UnparsedInternalText = 298, - UnparsedSyntheticReference = 299, - SourceFile = 300, - Bundle = 301, - UnparsedSource = 302, - InputFiles = 303, - JSDocTypeExpression = 304, - JSDocNameReference = 305, - JSDocAllType = 306, - JSDocUnknownType = 307, - JSDocNullableType = 308, - JSDocNonNullableType = 309, - JSDocOptionalType = 310, - JSDocFunctionType = 311, - JSDocVariadicType = 312, - JSDocNamepathType = 313, - JSDocComment = 314, - JSDocTypeLiteral = 315, - JSDocSignature = 316, - JSDocTag = 317, - JSDocAugmentsTag = 318, - JSDocImplementsTag = 319, - JSDocAuthorTag = 320, - JSDocDeprecatedTag = 321, - JSDocClassTag = 322, - JSDocPublicTag = 323, - JSDocPrivateTag = 324, - JSDocProtectedTag = 325, - JSDocReadonlyTag = 326, - JSDocCallbackTag = 327, - JSDocEnumTag = 328, - JSDocParameterTag = 329, - JSDocReturnTag = 330, - JSDocThisTag = 331, - JSDocTypeTag = 332, - JSDocTemplateTag = 333, - JSDocTypedefTag = 334, - JSDocSeeTag = 335, - JSDocPropertyTag = 336, - SyntaxList = 337, - NotEmittedStatement = 338, - PartiallyEmittedExpression = 339, - CommaListExpression = 340, - MergeDeclarationMarker = 341, - EndOfDeclarationMarker = 342, - SyntheticReferenceExpression = 343, - Count = 344, + IntrinsicKeyword = 136, + IsKeyword = 137, + KeyOfKeyword = 138, + ModuleKeyword = 139, + NamespaceKeyword = 140, + NeverKeyword = 141, + ReadonlyKeyword = 142, + RequireKeyword = 143, + NumberKeyword = 144, + ObjectKeyword = 145, + SetKeyword = 146, + StringKeyword = 147, + SymbolKeyword = 148, + TypeKeyword = 149, + UndefinedKeyword = 150, + UniqueKeyword = 151, + UnknownKeyword = 152, + FromKeyword = 153, + GlobalKeyword = 154, + BigIntKeyword = 155, + OfKeyword = 156, + QualifiedName = 157, + ComputedPropertyName = 158, + TypeParameter = 159, + Parameter = 160, + Decorator = 161, + PropertySignature = 162, + PropertyDeclaration = 163, + MethodSignature = 164, + MethodDeclaration = 165, + Constructor = 166, + GetAccessor = 167, + SetAccessor = 168, + CallSignature = 169, + ConstructSignature = 170, + IndexSignature = 171, + TypePredicate = 172, + TypeReference = 173, + FunctionType = 174, + ConstructorType = 175, + TypeQuery = 176, + TypeLiteral = 177, + ArrayType = 178, + TupleType = 179, + OptionalType = 180, + RestType = 181, + UnionType = 182, + IntersectionType = 183, + ConditionalType = 184, + InferType = 185, + ParenthesizedType = 186, + ThisType = 187, + TypeOperator = 188, + IndexedAccessType = 189, + MappedType = 190, + LiteralType = 191, + NamedTupleMember = 192, + TemplateLiteralType = 193, + TemplateLiteralTypeSpan = 194, + ImportType = 195, + ObjectBindingPattern = 196, + ArrayBindingPattern = 197, + BindingElement = 198, + ArrayLiteralExpression = 199, + ObjectLiteralExpression = 200, + PropertyAccessExpression = 201, + ElementAccessExpression = 202, + CallExpression = 203, + NewExpression = 204, + TaggedTemplateExpression = 205, + TypeAssertionExpression = 206, + ParenthesizedExpression = 207, + FunctionExpression = 208, + ArrowFunction = 209, + DeleteExpression = 210, + TypeOfExpression = 211, + VoidExpression = 212, + AwaitExpression = 213, + PrefixUnaryExpression = 214, + PostfixUnaryExpression = 215, + BinaryExpression = 216, + ConditionalExpression = 217, + TemplateExpression = 218, + YieldExpression = 219, + SpreadElement = 220, + ClassExpression = 221, + OmittedExpression = 222, + ExpressionWithTypeArguments = 223, + AsExpression = 224, + NonNullExpression = 225, + MetaProperty = 226, + SyntheticExpression = 227, + TemplateSpan = 228, + SemicolonClassElement = 229, + Block = 230, + EmptyStatement = 231, + VariableStatement = 232, + ExpressionStatement = 233, + IfStatement = 234, + DoStatement = 235, + WhileStatement = 236, + ForStatement = 237, + ForInStatement = 238, + ForOfStatement = 239, + ContinueStatement = 240, + BreakStatement = 241, + ReturnStatement = 242, + WithStatement = 243, + SwitchStatement = 244, + LabeledStatement = 245, + ThrowStatement = 246, + TryStatement = 247, + DebuggerStatement = 248, + VariableDeclaration = 249, + VariableDeclarationList = 250, + FunctionDeclaration = 251, + ClassDeclaration = 252, + InterfaceDeclaration = 253, + TypeAliasDeclaration = 254, + EnumDeclaration = 255, + ModuleDeclaration = 256, + ModuleBlock = 257, + CaseBlock = 258, + NamespaceExportDeclaration = 259, + ImportEqualsDeclaration = 260, + ImportDeclaration = 261, + ImportClause = 262, + NamespaceImport = 263, + NamedImports = 264, + ImportSpecifier = 265, + ExportAssignment = 266, + ExportDeclaration = 267, + NamedExports = 268, + NamespaceExport = 269, + ExportSpecifier = 270, + MissingDeclaration = 271, + ExternalModuleReference = 272, + JsxElement = 273, + JsxSelfClosingElement = 274, + JsxOpeningElement = 275, + JsxClosingElement = 276, + JsxFragment = 277, + JsxOpeningFragment = 278, + JsxClosingFragment = 279, + JsxAttribute = 280, + JsxAttributes = 281, + JsxSpreadAttribute = 282, + JsxExpression = 283, + CaseClause = 284, + DefaultClause = 285, + HeritageClause = 286, + CatchClause = 287, + PropertyAssignment = 288, + ShorthandPropertyAssignment = 289, + SpreadAssignment = 290, + EnumMember = 291, + UnparsedPrologue = 292, + UnparsedPrepend = 293, + UnparsedText = 294, + UnparsedInternalText = 295, + UnparsedSyntheticReference = 296, + SourceFile = 297, + Bundle = 298, + UnparsedSource = 299, + InputFiles = 300, + JSDocTypeExpression = 301, + JSDocNameReference = 302, + JSDocAllType = 303, + JSDocUnknownType = 304, + JSDocNullableType = 305, + JSDocNonNullableType = 306, + JSDocOptionalType = 307, + JSDocFunctionType = 308, + JSDocVariadicType = 309, + JSDocNamepathType = 310, + JSDocComment = 311, + JSDocTypeLiteral = 312, + JSDocSignature = 313, + JSDocTag = 314, + JSDocAugmentsTag = 315, + JSDocImplementsTag = 316, + JSDocAuthorTag = 317, + JSDocDeprecatedTag = 318, + JSDocClassTag = 319, + JSDocPublicTag = 320, + JSDocPrivateTag = 321, + JSDocProtectedTag = 322, + JSDocReadonlyTag = 323, + JSDocCallbackTag = 324, + JSDocEnumTag = 325, + JSDocParameterTag = 326, + JSDocReturnTag = 327, + JSDocThisTag = 328, + JSDocTypeTag = 329, + JSDocTemplateTag = 330, + JSDocTypedefTag = 331, + JSDocSeeTag = 332, + JSDocPropertyTag = 333, + SyntaxList = 334, + NotEmittedStatement = 335, + PartiallyEmittedExpression = 336, + CommaListExpression = 337, + MergeDeclarationMarker = 338, + EndOfDeclarationMarker = 339, + SyntheticReferenceExpression = 340, + Count = 341, FirstAssignment = 62, LastAssignment = 77, FirstCompoundAssignment = 63, @@ -456,15 +453,15 @@ declare namespace ts { FirstReservedWord = 80, LastReservedWord = 115, FirstKeyword = 80, - LastKeyword = 159, + LastKeyword = 156, FirstFutureReservedWord = 116, LastFutureReservedWord = 124, - FirstTypeNode = 175, - LastTypeNode = 198, + FirstTypeNode = 172, + LastTypeNode = 195, FirstPunctuation = 18, LastPunctuation = 77, FirstToken = 0, - LastToken = 159, + LastToken = 156, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -473,21 +470,21 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 77, - FirstStatement = 235, - LastStatement = 251, - FirstNode = 160, - FirstJSDocNode = 304, - LastJSDocNode = 336, - FirstJSDocTagNode = 317, - LastJSDocTagNode = 336, + FirstStatement = 232, + LastStatement = 248, + FirstNode = 157, + FirstJSDocNode = 301, + LastJSDocNode = 333, + FirstJSDocTagNode = 314, + LastJSDocTagNode = 333, } export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CapitalizeKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.LowercaseKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UncapitalizeKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.UppercaseKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.StaticKeyword; - export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; + export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; @@ -972,17 +969,9 @@ declare namespace ts { export interface TemplateLiteralTypeSpan extends TypeNode { readonly kind: SyntaxKind.TemplateLiteralTypeSpan; readonly parent: TemplateLiteralTypeNode; - readonly casing: TemplateCasing; readonly type: TypeNode; readonly literal: TemplateMiddle | TemplateTail; } - export enum TemplateCasing { - None = 0, - Uppercase = 1, - Lowercase = 2, - Capitalize = 3, - Uncapitalize = 4 - } export interface Expression extends Node { _expressionBrand: any; } @@ -2489,11 +2478,12 @@ declare namespace ts { Substitution = 33554432, NonPrimitive = 67108864, TemplateLiteral = 134217728, + StringMapping = 268435456, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, PossiblyFalsy = 117724, - StringLike = 134217860, + StringLike = 402653316, NumberLike = 296, BigIntLike = 2112, BooleanLike = 528, @@ -2504,10 +2494,10 @@ declare namespace ts { StructuredType = 3670016, TypeVariable = 8650752, InstantiableNonPrimitive = 58982400, - InstantiablePrimitive = 138412032, - Instantiable = 197394432, - StructuredOrInstantiable = 201064448, - Narrowable = 268188671, + InstantiablePrimitive = 406847488, + Instantiable = 465829888, + StructuredOrInstantiable = 469499904, + Narrowable = 536624127, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; export interface Type { @@ -2660,9 +2650,12 @@ declare namespace ts { } export interface TemplateLiteralType extends InstantiableType { texts: readonly string[]; - casings: readonly TemplateCasing[]; types: readonly Type[]; } + export interface StringMappingType extends InstantiableType { + symbol: Symbol; + type: Type; + } export interface SubstitutionType extends InstantiableType { baseType: Type; substitute: Type; @@ -3225,8 +3218,8 @@ declare namespace ts { updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - createTemplateLiteralTypeSpan(casing: TemplateCasing, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; - updateTemplateLiteralTypeSpan(casing: TemplateCasing, node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; + createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; + updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; createKeywordTypeNode(kind: TKind): KeywordTypeNode; createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode; updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode; diff --git a/tests/baselines/reference/intrinsicKeyword.errors.txt b/tests/baselines/reference/intrinsicKeyword.errors.txt new file mode 100644 index 00000000000..5164a75ae0b --- /dev/null +++ b/tests/baselines/reference/intrinsicKeyword.errors.txt @@ -0,0 +1,51 @@ +tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts(1,9): error TS2304: Cannot find name 'intrinsic'. +tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts(2,22): error TS2304: Cannot find name 'intrinsic'. +tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts(3,13): error TS2304: Cannot find name 'intrinsic'. +tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts(4,23): error TS2795: The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types. +tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts(5,20): error TS2304: Cannot find name 'intrinsic'. +tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts(6,28): error TS2313: Type parameter 'intrinsic' has a circular constraint. +tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts(6,41): error TS2795: The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types. +tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts(7,28): error TS2313: Type parameter 'intrinsic' has a circular constraint. +tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts(10,20): error TS2503: Cannot find namespace 'intrinsic'. + + +==== tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts (9 errors) ==== + let e1: intrinsic; + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'intrinsic'. + let e2: { intrinsic: intrinsic }; + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'intrinsic'. + type TE1 = (intrinsic); + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'intrinsic'. + type TE2 = intrinsic; + ~~~~~~~~~ +!!! error TS2795: The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types. + type TE3 = T; + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'intrinsic'. + type TE4 = intrinsic; + ~~~~~~~~~ +!!! error TS2313: Type parameter 'intrinsic' has a circular constraint. + ~~~~~~~~~ +!!! error TS2795: The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types. + type TE5 = (intrinsic); + ~~~~~~~~~ +!!! error TS2313: Type parameter 'intrinsic' has a circular constraint. + + function f1() { + let intrinsic: intrinsic.intrinsic; + ~~~~~~~~~ +!!! error TS2503: Cannot find namespace 'intrinsic'. + } + + function f2(intrinsic: string) { + return intrinsic; + } + + function f3() { + type intrinsic = string; + let s1: intrinsic = 'ok'; + } + \ No newline at end of file diff --git a/tests/baselines/reference/intrinsicKeyword.js b/tests/baselines/reference/intrinsicKeyword.js new file mode 100644 index 00000000000..f6e7596604f --- /dev/null +++ b/tests/baselines/reference/intrinsicKeyword.js @@ -0,0 +1,36 @@ +//// [intrinsicKeyword.ts] +let e1: intrinsic; +let e2: { intrinsic: intrinsic }; +type TE1 = (intrinsic); +type TE2 = intrinsic; +type TE3 = T; +type TE4 = intrinsic; +type TE5 = (intrinsic); + +function f1() { + let intrinsic: intrinsic.intrinsic; +} + +function f2(intrinsic: string) { + return intrinsic; +} + +function f3() { + type intrinsic = string; + let s1: intrinsic = 'ok'; +} + + +//// [intrinsicKeyword.js] +"use strict"; +var e1; +var e2; +function f1() { + var intrinsic; +} +function f2(intrinsic) { + return intrinsic; +} +function f3() { + var s1 = 'ok'; +} diff --git a/tests/baselines/reference/intrinsicKeyword.symbols b/tests/baselines/reference/intrinsicKeyword.symbols new file mode 100644 index 00000000000..ef61b04409b --- /dev/null +++ b/tests/baselines/reference/intrinsicKeyword.symbols @@ -0,0 +1,57 @@ +=== tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts === +let e1: intrinsic; +>e1 : Symbol(e1, Decl(intrinsicKeyword.ts, 0, 3)) + +let e2: { intrinsic: intrinsic }; +>e2 : Symbol(e2, Decl(intrinsicKeyword.ts, 1, 3)) +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 1, 9)) + +type TE1 = (intrinsic); +>TE1 : Symbol(TE1, Decl(intrinsicKeyword.ts, 1, 33)) + +type TE2 = intrinsic; +>TE2 : Symbol(TE2, Decl(intrinsicKeyword.ts, 2, 23)) +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 3, 9)) + +type TE3 = T; +>TE3 : Symbol(TE3, Decl(intrinsicKeyword.ts, 3, 32)) +>T : Symbol(T, Decl(intrinsicKeyword.ts, 4, 9)) +>T : Symbol(T, Decl(intrinsicKeyword.ts, 4, 9)) + +type TE4 = intrinsic; +>TE4 : Symbol(TE4, Decl(intrinsicKeyword.ts, 4, 34)) +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 5, 9)) +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 5, 9)) + +type TE5 = (intrinsic); +>TE5 : Symbol(TE5, Decl(intrinsicKeyword.ts, 5, 50)) +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 6, 9)) +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 6, 9)) +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 6, 9)) + +function f1() { +>f1 : Symbol(f1, Decl(intrinsicKeyword.ts, 6, 52)) + + let intrinsic: intrinsic.intrinsic; +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 9, 7)) +} + +function f2(intrinsic: string) { +>f2 : Symbol(f2, Decl(intrinsicKeyword.ts, 10, 1)) +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 12, 12)) + + return intrinsic; +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 12, 12)) +} + +function f3() { +>f3 : Symbol(f3, Decl(intrinsicKeyword.ts, 14, 1)) + + type intrinsic = string; +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 16, 15)) + + let s1: intrinsic = 'ok'; +>s1 : Symbol(s1, Decl(intrinsicKeyword.ts, 18, 7)) +>intrinsic : Symbol(intrinsic, Decl(intrinsicKeyword.ts, 16, 15)) +} + diff --git a/tests/baselines/reference/intrinsicKeyword.types b/tests/baselines/reference/intrinsicKeyword.types new file mode 100644 index 00000000000..b1fb4a480ce --- /dev/null +++ b/tests/baselines/reference/intrinsicKeyword.types @@ -0,0 +1,50 @@ +=== tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts === +let e1: intrinsic; +>e1 : any + +let e2: { intrinsic: intrinsic }; +>e2 : { intrinsic: any; } +>intrinsic : any + +type TE1 = (intrinsic); +>TE1 : any + +type TE2 = intrinsic; +>TE2 : intrinsic + +type TE3 = T; +>TE3 : T + +type TE4 = intrinsic; +>TE4 : intrinsic + +type TE5 = (intrinsic); +>TE5 : intrinsic + +function f1() { +>f1 : () => void + + let intrinsic: intrinsic.intrinsic; +>intrinsic : any +>intrinsic : any +} + +function f2(intrinsic: string) { +>f2 : (intrinsic: string) => string +>intrinsic : string + + return intrinsic; +>intrinsic : string +} + +function f3() { +>f3 : () => void + + type intrinsic = string; +>intrinsic : string + + let s1: intrinsic = 'ok'; +>s1 : string +>'ok' : "ok" +} + diff --git a/tests/baselines/reference/intrinsicTypes.errors.txt b/tests/baselines/reference/intrinsicTypes.errors.txt new file mode 100644 index 00000000000..46a3ab82ec1 --- /dev/null +++ b/tests/baselines/reference/intrinsicTypes.errors.txt @@ -0,0 +1,90 @@ +tests/cases/conformance/types/typeAliases/intrinsicTypes.ts(6,22): error TS2344: Type 'number' does not satisfy the constraint 'string'. +tests/cases/conformance/types/typeAliases/intrinsicTypes.ts(13,22): error TS2344: Type 'number' does not satisfy the constraint 'string'. +tests/cases/conformance/types/typeAliases/intrinsicTypes.ts(20,23): error TS2344: Type 'number' does not satisfy the constraint 'string'. +tests/cases/conformance/types/typeAliases/intrinsicTypes.ts(27,25): error TS2344: Type 'number' does not satisfy the constraint 'string'. +tests/cases/conformance/types/typeAliases/intrinsicTypes.ts(35,38): error TS2795: The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types. +tests/cases/conformance/types/typeAliases/intrinsicTypes.ts(40,5): error TS2322: Type 'string' is not assignable to type 'Uppercase'. +tests/cases/conformance/types/typeAliases/intrinsicTypes.ts(42,5): error TS2322: Type 'string' is not assignable to type 'Uppercase'. +tests/cases/conformance/types/typeAliases/intrinsicTypes.ts(43,5): error TS2322: Type 'Uppercase' is not assignable to type 'Uppercase'. + Type 'T' is not assignable to type 'U'. + 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'string'. + Type 'string' is not assignable to type 'U'. + 'string' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'string'. + + +==== tests/cases/conformance/types/typeAliases/intrinsicTypes.ts (8 errors) ==== + type TU1 = Uppercase<'hello'>; // "HELLO" + type TU2 = Uppercase<'foo' | 'bar'>; // "FOO" | "BAR" + type TU3 = Uppercase; // string + type TU4 = Uppercase; // any + type TU5 = Uppercase; // never + type TU6 = Uppercase<42>; // Error + ~~ +!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. + + type TL1 = Lowercase<'HELLO'>; // "hello" + type TL2 = Lowercase<'FOO' | 'BAR'>; // "foo" | "bar" + type TL3 = Lowercase; // string + type TL4 = Lowercase; // any + type TL5 = Lowercase; // never + type TL6 = Lowercase<42>; // Error + ~~ +!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. + + type TC1 = Capitalize<'hello'>; // "Hello" + type TC2 = Capitalize<'foo' | 'bar'>; // "Foo" | "Bar" + type TC3 = Capitalize; // string + type TC4 = Capitalize; // any + type TC5 = Capitalize; // never + type TC6 = Capitalize<42>; // Error + ~~ +!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. + + type TN1 = Uncapitalize<'Hello'>; // "hello" + type TN2 = Uncapitalize<'Foo' | 'Bar'>; // "foo" | "bar" + type TN3 = Uncapitalize; // string + type TN4 = Uncapitalize; // any + type TN5 = Uncapitalize; // never + type TN6 = Uncapitalize<42>; // Error + ~~ +!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. + + type TX1 = Uppercase<`aB${S}`>; + type TX2 = TX1<'xYz'>; // "ABXYZ" + type TX3 = Lowercase<`aB${S}`>; + type TX4 = TX3<'xYz'>; // "abxyz" + type TX5 = `${Uppercase<'abc'>}${Lowercase<'XYZ'>}`; // "ABCxyz" + + type MyUppercase = intrinsic; // Error + ~~~~~~~~~ +!!! error TS2795: The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types. + + function foo1(s: string, x: Uppercase, y: Uppercase) { + s = x; + s = y; + x = s; // Error + ~ +!!! error TS2322: Type 'string' is not assignable to type 'Uppercase'. + x = y; + y = s; // Error + ~ +!!! error TS2322: Type 'string' is not assignable to type 'Uppercase'. + y = x; // Error + ~ +!!! error TS2322: Type 'Uppercase' is not assignable to type 'Uppercase'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'string'. +!!! error TS2322: Type 'string' is not assignable to type 'U'. +!!! error TS2322: 'string' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'string'. + } + + function foo2(x: Uppercase) { + let s: 'FOO' | 'BAR' = x; + } + + declare function foo3(x: Uppercase): T; + + function foo4(x: Uppercase) { + return foo3(x); + } + \ No newline at end of file diff --git a/tests/baselines/reference/intrinsicTypes.js b/tests/baselines/reference/intrinsicTypes.js new file mode 100644 index 00000000000..697371da226 --- /dev/null +++ b/tests/baselines/reference/intrinsicTypes.js @@ -0,0 +1,110 @@ +//// [intrinsicTypes.ts] +type TU1 = Uppercase<'hello'>; // "HELLO" +type TU2 = Uppercase<'foo' | 'bar'>; // "FOO" | "BAR" +type TU3 = Uppercase; // string +type TU4 = Uppercase; // any +type TU5 = Uppercase; // never +type TU6 = Uppercase<42>; // Error + +type TL1 = Lowercase<'HELLO'>; // "hello" +type TL2 = Lowercase<'FOO' | 'BAR'>; // "foo" | "bar" +type TL3 = Lowercase; // string +type TL4 = Lowercase; // any +type TL5 = Lowercase; // never +type TL6 = Lowercase<42>; // Error + +type TC1 = Capitalize<'hello'>; // "Hello" +type TC2 = Capitalize<'foo' | 'bar'>; // "Foo" | "Bar" +type TC3 = Capitalize; // string +type TC4 = Capitalize; // any +type TC5 = Capitalize; // never +type TC6 = Capitalize<42>; // Error + +type TN1 = Uncapitalize<'Hello'>; // "hello" +type TN2 = Uncapitalize<'Foo' | 'Bar'>; // "foo" | "bar" +type TN3 = Uncapitalize; // string +type TN4 = Uncapitalize; // any +type TN5 = Uncapitalize; // never +type TN6 = Uncapitalize<42>; // Error + +type TX1 = Uppercase<`aB${S}`>; +type TX2 = TX1<'xYz'>; // "ABXYZ" +type TX3 = Lowercase<`aB${S}`>; +type TX4 = TX3<'xYz'>; // "abxyz" +type TX5 = `${Uppercase<'abc'>}${Lowercase<'XYZ'>}`; // "ABCxyz" + +type MyUppercase = intrinsic; // Error + +function foo1(s: string, x: Uppercase, y: Uppercase) { + s = x; + s = y; + x = s; // Error + x = y; + y = s; // Error + y = x; // Error +} + +function foo2(x: Uppercase) { + let s: 'FOO' | 'BAR' = x; +} + +declare function foo3(x: Uppercase): T; + +function foo4(x: Uppercase) { + return foo3(x); +} + + +//// [intrinsicTypes.js] +"use strict"; +function foo1(s, x, y) { + s = x; + s = y; + x = s; // Error + x = y; + y = s; // Error + y = x; // Error +} +function foo2(x) { + var s = x; +} +function foo4(x) { + return foo3(x); +} + + +//// [intrinsicTypes.d.ts] +declare type TU1 = Uppercase<'hello'>; +declare type TU2 = Uppercase<'foo' | 'bar'>; +declare type TU3 = Uppercase; +declare type TU4 = Uppercase; +declare type TU5 = Uppercase; +declare type TU6 = Uppercase<42>; +declare type TL1 = Lowercase<'HELLO'>; +declare type TL2 = Lowercase<'FOO' | 'BAR'>; +declare type TL3 = Lowercase; +declare type TL4 = Lowercase; +declare type TL5 = Lowercase; +declare type TL6 = Lowercase<42>; +declare type TC1 = Capitalize<'hello'>; +declare type TC2 = Capitalize<'foo' | 'bar'>; +declare type TC3 = Capitalize; +declare type TC4 = Capitalize; +declare type TC5 = Capitalize; +declare type TC6 = Capitalize<42>; +declare type TN1 = Uncapitalize<'Hello'>; +declare type TN2 = Uncapitalize<'Foo' | 'Bar'>; +declare type TN3 = Uncapitalize; +declare type TN4 = Uncapitalize; +declare type TN5 = Uncapitalize; +declare type TN6 = Uncapitalize<42>; +declare type TX1 = Uppercase<`aB${S}`>; +declare type TX2 = TX1<'xYz'>; +declare type TX3 = Lowercase<`aB${S}`>; +declare type TX4 = TX3<'xYz'>; +declare type TX5 = `${Uppercase<'abc'>}${Lowercase<'XYZ'>}`; +declare type MyUppercase = intrinsic; +declare function foo1(s: string, x: Uppercase, y: Uppercase): void; +declare function foo2(x: Uppercase): void; +declare function foo3(x: Uppercase): T; +declare function foo4(x: Uppercase): U; diff --git a/tests/baselines/reference/intrinsicTypes.symbols b/tests/baselines/reference/intrinsicTypes.symbols new file mode 100644 index 00000000000..13efe08aaa2 --- /dev/null +++ b/tests/baselines/reference/intrinsicTypes.symbols @@ -0,0 +1,196 @@ +=== tests/cases/conformance/types/typeAliases/intrinsicTypes.ts === +type TU1 = Uppercase<'hello'>; // "HELLO" +>TU1 : Symbol(TU1, Decl(intrinsicTypes.ts, 0, 0)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) + +type TU2 = Uppercase<'foo' | 'bar'>; // "FOO" | "BAR" +>TU2 : Symbol(TU2, Decl(intrinsicTypes.ts, 0, 30)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) + +type TU3 = Uppercase; // string +>TU3 : Symbol(TU3, Decl(intrinsicTypes.ts, 1, 36)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) + +type TU4 = Uppercase; // any +>TU4 : Symbol(TU4, Decl(intrinsicTypes.ts, 2, 29)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) + +type TU5 = Uppercase; // never +>TU5 : Symbol(TU5, Decl(intrinsicTypes.ts, 3, 26)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) + +type TU6 = Uppercase<42>; // Error +>TU6 : Symbol(TU6, Decl(intrinsicTypes.ts, 4, 28)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) + +type TL1 = Lowercase<'HELLO'>; // "hello" +>TL1 : Symbol(TL1, Decl(intrinsicTypes.ts, 5, 25)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) + +type TL2 = Lowercase<'FOO' | 'BAR'>; // "foo" | "bar" +>TL2 : Symbol(TL2, Decl(intrinsicTypes.ts, 7, 30)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) + +type TL3 = Lowercase; // string +>TL3 : Symbol(TL3, Decl(intrinsicTypes.ts, 8, 36)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) + +type TL4 = Lowercase; // any +>TL4 : Symbol(TL4, Decl(intrinsicTypes.ts, 9, 29)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) + +type TL5 = Lowercase; // never +>TL5 : Symbol(TL5, Decl(intrinsicTypes.ts, 10, 26)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) + +type TL6 = Lowercase<42>; // Error +>TL6 : Symbol(TL6, Decl(intrinsicTypes.ts, 11, 28)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) + +type TC1 = Capitalize<'hello'>; // "Hello" +>TC1 : Symbol(TC1, Decl(intrinsicTypes.ts, 12, 25)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) + +type TC2 = Capitalize<'foo' | 'bar'>; // "Foo" | "Bar" +>TC2 : Symbol(TC2, Decl(intrinsicTypes.ts, 14, 31)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) + +type TC3 = Capitalize; // string +>TC3 : Symbol(TC3, Decl(intrinsicTypes.ts, 15, 37)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) + +type TC4 = Capitalize; // any +>TC4 : Symbol(TC4, Decl(intrinsicTypes.ts, 16, 30)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) + +type TC5 = Capitalize; // never +>TC5 : Symbol(TC5, Decl(intrinsicTypes.ts, 17, 27)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) + +type TC6 = Capitalize<42>; // Error +>TC6 : Symbol(TC6, Decl(intrinsicTypes.ts, 18, 29)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) + +type TN1 = Uncapitalize<'Hello'>; // "hello" +>TN1 : Symbol(TN1, Decl(intrinsicTypes.ts, 19, 26)) +>Uncapitalize : Symbol(Uncapitalize, Decl(lib.es5.d.ts, --, --)) + +type TN2 = Uncapitalize<'Foo' | 'Bar'>; // "foo" | "bar" +>TN2 : Symbol(TN2, Decl(intrinsicTypes.ts, 21, 33)) +>Uncapitalize : Symbol(Uncapitalize, Decl(lib.es5.d.ts, --, --)) + +type TN3 = Uncapitalize; // string +>TN3 : Symbol(TN3, Decl(intrinsicTypes.ts, 22, 39)) +>Uncapitalize : Symbol(Uncapitalize, Decl(lib.es5.d.ts, --, --)) + +type TN4 = Uncapitalize; // any +>TN4 : Symbol(TN4, Decl(intrinsicTypes.ts, 23, 32)) +>Uncapitalize : Symbol(Uncapitalize, Decl(lib.es5.d.ts, --, --)) + +type TN5 = Uncapitalize; // never +>TN5 : Symbol(TN5, Decl(intrinsicTypes.ts, 24, 29)) +>Uncapitalize : Symbol(Uncapitalize, Decl(lib.es5.d.ts, --, --)) + +type TN6 = Uncapitalize<42>; // Error +>TN6 : Symbol(TN6, Decl(intrinsicTypes.ts, 25, 31)) +>Uncapitalize : Symbol(Uncapitalize, Decl(lib.es5.d.ts, --, --)) + +type TX1 = Uppercase<`aB${S}`>; +>TX1 : Symbol(TX1, Decl(intrinsicTypes.ts, 26, 28)) +>S : Symbol(S, Decl(intrinsicTypes.ts, 28, 9)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) +>S : Symbol(S, Decl(intrinsicTypes.ts, 28, 9)) + +type TX2 = TX1<'xYz'>; // "ABXYZ" +>TX2 : Symbol(TX2, Decl(intrinsicTypes.ts, 28, 49)) +>TX1 : Symbol(TX1, Decl(intrinsicTypes.ts, 26, 28)) + +type TX3 = Lowercase<`aB${S}`>; +>TX3 : Symbol(TX3, Decl(intrinsicTypes.ts, 29, 22)) +>S : Symbol(S, Decl(intrinsicTypes.ts, 30, 9)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) +>S : Symbol(S, Decl(intrinsicTypes.ts, 30, 9)) + +type TX4 = TX3<'xYz'>; // "abxyz" +>TX4 : Symbol(TX4, Decl(intrinsicTypes.ts, 30, 49)) +>TX3 : Symbol(TX3, Decl(intrinsicTypes.ts, 29, 22)) + +type TX5 = `${Uppercase<'abc'>}${Lowercase<'XYZ'>}`; // "ABCxyz" +>TX5 : Symbol(TX5, Decl(intrinsicTypes.ts, 31, 22)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) + +type MyUppercase = intrinsic; // Error +>MyUppercase : Symbol(MyUppercase, Decl(intrinsicTypes.ts, 32, 52)) +>S : Symbol(S, Decl(intrinsicTypes.ts, 34, 17)) + +function foo1(s: string, x: Uppercase, y: Uppercase) { +>foo1 : Symbol(foo1, Decl(intrinsicTypes.ts, 34, 47)) +>T : Symbol(T, Decl(intrinsicTypes.ts, 36, 14)) +>U : Symbol(U, Decl(intrinsicTypes.ts, 36, 31)) +>T : Symbol(T, Decl(intrinsicTypes.ts, 36, 14)) +>s : Symbol(s, Decl(intrinsicTypes.ts, 36, 45)) +>x : Symbol(x, Decl(intrinsicTypes.ts, 36, 55)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(intrinsicTypes.ts, 36, 14)) +>y : Symbol(y, Decl(intrinsicTypes.ts, 36, 72)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) +>U : Symbol(U, Decl(intrinsicTypes.ts, 36, 31)) + + s = x; +>s : Symbol(s, Decl(intrinsicTypes.ts, 36, 45)) +>x : Symbol(x, Decl(intrinsicTypes.ts, 36, 55)) + + s = y; +>s : Symbol(s, Decl(intrinsicTypes.ts, 36, 45)) +>y : Symbol(y, Decl(intrinsicTypes.ts, 36, 72)) + + x = s; // Error +>x : Symbol(x, Decl(intrinsicTypes.ts, 36, 55)) +>s : Symbol(s, Decl(intrinsicTypes.ts, 36, 45)) + + x = y; +>x : Symbol(x, Decl(intrinsicTypes.ts, 36, 55)) +>y : Symbol(y, Decl(intrinsicTypes.ts, 36, 72)) + + y = s; // Error +>y : Symbol(y, Decl(intrinsicTypes.ts, 36, 72)) +>s : Symbol(s, Decl(intrinsicTypes.ts, 36, 45)) + + y = x; // Error +>y : Symbol(y, Decl(intrinsicTypes.ts, 36, 72)) +>x : Symbol(x, Decl(intrinsicTypes.ts, 36, 55)) +} + +function foo2(x: Uppercase) { +>foo2 : Symbol(foo2, Decl(intrinsicTypes.ts, 43, 1)) +>T : Symbol(T, Decl(intrinsicTypes.ts, 45, 14)) +>x : Symbol(x, Decl(intrinsicTypes.ts, 45, 39)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(intrinsicTypes.ts, 45, 14)) + + let s: 'FOO' | 'BAR' = x; +>s : Symbol(s, Decl(intrinsicTypes.ts, 46, 7)) +>x : Symbol(x, Decl(intrinsicTypes.ts, 45, 39)) +} + +declare function foo3(x: Uppercase): T; +>foo3 : Symbol(foo3, Decl(intrinsicTypes.ts, 47, 1)) +>T : Symbol(T, Decl(intrinsicTypes.ts, 49, 22)) +>x : Symbol(x, Decl(intrinsicTypes.ts, 49, 40)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(intrinsicTypes.ts, 49, 22)) +>T : Symbol(T, Decl(intrinsicTypes.ts, 49, 22)) + +function foo4(x: Uppercase) { +>foo4 : Symbol(foo4, Decl(intrinsicTypes.ts, 49, 60)) +>U : Symbol(U, Decl(intrinsicTypes.ts, 51, 14)) +>x : Symbol(x, Decl(intrinsicTypes.ts, 51, 32)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) +>U : Symbol(U, Decl(intrinsicTypes.ts, 51, 14)) + + return foo3(x); +>foo3 : Symbol(foo3, Decl(intrinsicTypes.ts, 47, 1)) +>x : Symbol(x, Decl(intrinsicTypes.ts, 51, 32)) +} + diff --git a/tests/baselines/reference/intrinsicTypes.types b/tests/baselines/reference/intrinsicTypes.types new file mode 100644 index 00000000000..e57a5f22ed3 --- /dev/null +++ b/tests/baselines/reference/intrinsicTypes.types @@ -0,0 +1,151 @@ +=== tests/cases/conformance/types/typeAliases/intrinsicTypes.ts === +type TU1 = Uppercase<'hello'>; // "HELLO" +>TU1 : "HELLO" + +type TU2 = Uppercase<'foo' | 'bar'>; // "FOO" | "BAR" +>TU2 : "FOO" | "BAR" + +type TU3 = Uppercase; // string +>TU3 : string + +type TU4 = Uppercase; // any +>TU4 : any + +type TU5 = Uppercase; // never +>TU5 : never + +type TU6 = Uppercase<42>; // Error +>TU6 : 42 + +type TL1 = Lowercase<'HELLO'>; // "hello" +>TL1 : "hello" + +type TL2 = Lowercase<'FOO' | 'BAR'>; // "foo" | "bar" +>TL2 : "foo" | "bar" + +type TL3 = Lowercase; // string +>TL3 : string + +type TL4 = Lowercase; // any +>TL4 : any + +type TL5 = Lowercase; // never +>TL5 : never + +type TL6 = Lowercase<42>; // Error +>TL6 : 42 + +type TC1 = Capitalize<'hello'>; // "Hello" +>TC1 : "Hello" + +type TC2 = Capitalize<'foo' | 'bar'>; // "Foo" | "Bar" +>TC2 : "Foo" | "Bar" + +type TC3 = Capitalize; // string +>TC3 : string + +type TC4 = Capitalize; // any +>TC4 : any + +type TC5 = Capitalize; // never +>TC5 : never + +type TC6 = Capitalize<42>; // Error +>TC6 : 42 + +type TN1 = Uncapitalize<'Hello'>; // "hello" +>TN1 : "hello" + +type TN2 = Uncapitalize<'Foo' | 'Bar'>; // "foo" | "bar" +>TN2 : "foo" | "bar" + +type TN3 = Uncapitalize; // string +>TN3 : string + +type TN4 = Uncapitalize; // any +>TN4 : any + +type TN5 = Uncapitalize; // never +>TN5 : never + +type TN6 = Uncapitalize<42>; // Error +>TN6 : 42 + +type TX1 = Uppercase<`aB${S}`>; +>TX1 : Uppercase<`aB${S}`> + +type TX2 = TX1<'xYz'>; // "ABXYZ" +>TX2 : "ABXYZ" + +type TX3 = Lowercase<`aB${S}`>; +>TX3 : Lowercase<`aB${S}`> + +type TX4 = TX3<'xYz'>; // "abxyz" +>TX4 : "abxyz" + +type TX5 = `${Uppercase<'abc'>}${Lowercase<'XYZ'>}`; // "ABCxyz" +>TX5 : "ABCxyz" + +type MyUppercase = intrinsic; // Error +>MyUppercase : intrinsic + +function foo1(s: string, x: Uppercase, y: Uppercase) { +>foo1 : (s: string, x: Uppercase, y: Uppercase) => void +>s : string +>x : Uppercase +>y : Uppercase + + s = x; +>s = x : Uppercase +>s : string +>x : Uppercase + + s = y; +>s = y : Uppercase +>s : string +>y : Uppercase + + x = s; // Error +>x = s : string +>x : Uppercase +>s : string + + x = y; +>x = y : Uppercase +>x : Uppercase +>y : Uppercase + + y = s; // Error +>y = s : string +>y : Uppercase +>s : string + + y = x; // Error +>y = x : Uppercase +>y : Uppercase +>x : Uppercase +} + +function foo2(x: Uppercase) { +>foo2 : (x: Uppercase) => void +>x : Uppercase + + let s: 'FOO' | 'BAR' = x; +>s : "FOO" | "BAR" +>x : Uppercase +} + +declare function foo3(x: Uppercase): T; +>foo3 : (x: Uppercase) => T +>x : Uppercase + +function foo4(x: Uppercase) { +>foo4 : (x: Uppercase) => U +>x : Uppercase + + return foo3(x); +>foo3(x) : U +>foo3 : (x: Uppercase) => T +>x : Uppercase +} + diff --git a/tests/baselines/reference/mappedTypeAsClauses.js b/tests/baselines/reference/mappedTypeAsClauses.js index 9bb361db932..cefa284f1f4 100644 --- a/tests/baselines/reference/mappedTypeAsClauses.js +++ b/tests/baselines/reference/mappedTypeAsClauses.js @@ -1,7 +1,7 @@ //// [mappedTypeAsClauses.ts] // Mapped type 'as N' clauses -type Getters = { [P in keyof T & string as `get${capitalize P}`]: () => T[P] }; +type Getters = { [P in keyof T & string as `get${Capitalize

}`]: () => T[P] }; type TG1 = Getters<{ foo: string, bar: number, baz: { z: boolean } }>; // Mapped type with 'as N' clause has no constraint on 'in T' clause @@ -32,7 +32,7 @@ type TD3 = keyof DoubleProp; // `${keyof U & string}1` | `${keyof U & str // Repro from #40619 type Lazyify = { - [K in keyof T as `get${capitalize string & K}`]: () => T[K] + [K in keyof T as `get${Capitalize}`]: () => T[K] }; interface Person { @@ -51,7 +51,7 @@ type LazyPerson = Lazyify; //// [mappedTypeAsClauses.d.ts] declare type Getters = { - [P in keyof T & string as `get${capitalize P}`]: () => T[P]; + [P in keyof T & string as `get${Capitalize

}`]: () => T[P]; }; declare type TG1 = Getters<{ foo: string; @@ -97,7 +97,7 @@ declare type TD1 = DoubleProp<{ declare type TD2 = keyof TD1; declare type TD3 = keyof DoubleProp; declare type Lazyify = { - [K in keyof T as `get${capitalize string & K}`]: () => T[K]; + [K in keyof T as `get${Capitalize}`]: () => T[K]; }; interface Person { readonly name: string; diff --git a/tests/baselines/reference/mappedTypeAsClauses.symbols b/tests/baselines/reference/mappedTypeAsClauses.symbols index 31a9ca0bef8..ec340db38c2 100644 --- a/tests/baselines/reference/mappedTypeAsClauses.symbols +++ b/tests/baselines/reference/mappedTypeAsClauses.symbols @@ -1,17 +1,18 @@ === tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts === // Mapped type 'as N' clauses -type Getters = { [P in keyof T & string as `get${capitalize P}`]: () => T[P] }; +type Getters = { [P in keyof T & string as `get${Capitalize

}`]: () => T[P] }; >Getters : Symbol(Getters, Decl(mappedTypeAsClauses.ts, 0, 0)) >T : Symbol(T, Decl(mappedTypeAsClauses.ts, 2, 13)) >P : Symbol(P, Decl(mappedTypeAsClauses.ts, 2, 21)) >T : Symbol(T, Decl(mappedTypeAsClauses.ts, 2, 13)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) >P : Symbol(P, Decl(mappedTypeAsClauses.ts, 2, 21)) >T : Symbol(T, Decl(mappedTypeAsClauses.ts, 2, 13)) >P : Symbol(P, Decl(mappedTypeAsClauses.ts, 2, 21)) type TG1 = Getters<{ foo: string, bar: number, baz: { z: boolean } }>; ->TG1 : Symbol(TG1, Decl(mappedTypeAsClauses.ts, 2, 82)) +>TG1 : Symbol(TG1, Decl(mappedTypeAsClauses.ts, 2, 83)) >Getters : Symbol(Getters, Decl(mappedTypeAsClauses.ts, 0, 0)) >foo : Symbol(foo, Decl(mappedTypeAsClauses.ts, 3, 20)) >bar : Symbol(bar, Decl(mappedTypeAsClauses.ts, 3, 33)) @@ -114,9 +115,10 @@ type Lazyify = { >Lazyify : Symbol(Lazyify, Decl(mappedTypeAsClauses.ts, 28, 34)) >T : Symbol(T, Decl(mappedTypeAsClauses.ts, 32, 13)) - [K in keyof T as `get${capitalize string & K}`]: () => T[K] + [K in keyof T as `get${Capitalize}`]: () => T[K] >K : Symbol(K, Decl(mappedTypeAsClauses.ts, 33, 5)) >T : Symbol(T, Decl(mappedTypeAsClauses.ts, 32, 13)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) >K : Symbol(K, Decl(mappedTypeAsClauses.ts, 33, 5)) >T : Symbol(T, Decl(mappedTypeAsClauses.ts, 32, 13)) >K : Symbol(K, Decl(mappedTypeAsClauses.ts, 33, 5)) diff --git a/tests/baselines/reference/mappedTypeAsClauses.types b/tests/baselines/reference/mappedTypeAsClauses.types index f2426a9c74c..1ac3ff557b1 100644 --- a/tests/baselines/reference/mappedTypeAsClauses.types +++ b/tests/baselines/reference/mappedTypeAsClauses.types @@ -1,7 +1,7 @@ === tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts === // Mapped type 'as N' clauses -type Getters = { [P in keyof T & string as `get${capitalize P}`]: () => T[P] }; +type Getters = { [P in keyof T & string as `get${Capitalize

}`]: () => T[P] }; >Getters : Getters type TG1 = Getters<{ foo: string, bar: number, baz: { z: boolean } }>; @@ -71,7 +71,7 @@ type TD3 = keyof DoubleProp; // `${keyof U & string}1` | `${keyof U & str type Lazyify = { >Lazyify : Lazyify - [K in keyof T as `get${capitalize string & K}`]: () => T[K] + [K in keyof T as `get${Capitalize}`]: () => T[K] }; interface Person { diff --git a/tests/baselines/reference/templateLiteralTypes1.errors.txt b/tests/baselines/reference/templateLiteralTypes1.errors.txt index 6a453496896..66c5859bc7e 100644 --- a/tests/baselines/reference/templateLiteralTypes1.errors.txt +++ b/tests/baselines/reference/templateLiteralTypes1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/literal/templateLiteralTypes1.ts(34,5): error TS2322: Type 'T' is not assignable to type '{ [P in keyof T & string as `p_${P}`]: T[P]; }'. -tests/cases/conformance/types/literal/templateLiteralTypes1.ts(39,5): error TS2322: Type '{ [P in B as `p_${P}`]: T; }' is not assignable to type '{ [Q in A as `p_${Q}`]: U; }'. +tests/cases/conformance/types/literal/templateLiteralTypes1.ts(40,5): error TS2322: Type 'T' is not assignable to type '{ [P in keyof T & string as `p_${P}`]: T[P]; }'. +tests/cases/conformance/types/literal/templateLiteralTypes1.ts(45,5): error TS2322: Type '{ [P in B as `p_${P}`]: T; }' is not assignable to type '{ [Q in A as `p_${Q}`]: U; }'. Type 'A' is not assignable to type 'B'. 'A' is assignable to the constraint of type 'B', but 'B' could be instantiated with a different subtype of constraint 'string'. Type 'string' is not assignable to type 'B'. @@ -28,16 +28,22 @@ tests/cases/conformance/types/literal/templateLiteralTypes1.ts(205,16): error TS type ToString = `${T}`; type TS1 = ToString<'abc' | 42 | true | -1234n>; - // Casing modifiers + // Nested template literal type normalization - type Cases = `${uppercase T} ${lowercase T} ${capitalize T} ${uncapitalize T}`; + type TL1 = `a${T}b${T}c`; + type TL2 = TL1<`x${U}y`>; // `ax${U}ybx{$U}yc` + type TL3 = TL2<'o'>; // 'axoybxoyc' + + // Casing intrinsics + + type Cases = `${Uppercase} ${Lowercase} ${Capitalize} ${Uncapitalize}`; type TCA1 = Cases<'bar'>; // 'BAR bar Bar bar' type TCA2 = Cases<'BAR'>; // 'BAR bar BAR bAR' // Assignability - function test(name: `get${capitalize T}`) { + function test(name: `get${Capitalize}`) { let s1: string = name; let s2: 'getFoo' | 'getBar' = name; } @@ -83,14 +89,14 @@ tests/cases/conformance/types/literal/templateLiteralTypes1.ts(205,16): error TS type T24 = MatchPair<'[1,2,3,4]'>; // ['1', '2,3,4'] type SnakeToCamelCase = - S extends `${infer T}_${infer U}` ? `${lowercase T}${SnakeToPascalCase}` : - S extends `${infer T}` ? `${lowercase T}` : + S extends `${infer T}_${infer U}` ? `${Lowercase}${SnakeToPascalCase}` : + S extends `${infer T}` ? `${Lowercase}` : SnakeToPascalCase; type SnakeToPascalCase = string extends S ? string : - S extends `${infer T}_${infer U}` ? `${capitalize `${lowercase T}`}${SnakeToPascalCase}` : - S extends `${infer T}` ? `${capitalize `${lowercase T}`}` : + S extends `${infer T}_${infer U}` ? `${Capitalize>}${SnakeToPascalCase}` : + S extends `${infer T}` ? `${Capitalize>}` : never; type RR0 = SnakeToPascalCase<'hello_world_foo'>; // 'HelloWorldFoo' @@ -106,12 +112,6 @@ tests/cases/conformance/types/literal/templateLiteralTypes1.ts(205,16): error TS type T26 = FirstTwoAndRest<'ab'>; // ['ab', ''] type T27 = FirstTwoAndRest<'a'>; // unknown - type Capitalize = S extends `${infer H}${infer T}` ? `${uppercase H}${T}` : S; - type Uncapitalize = S extends `${infer H}${infer T}` ? `${lowercase H}${T}` : S; - - type TC1 = Capitalize<'foo'>; // 'Foo' - type TC2 = Uncapitalize<'Foo'>; // 'foo' - type HexDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' |'8' | '9' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'; type HexColor = diff --git a/tests/baselines/reference/templateLiteralTypes1.js b/tests/baselines/reference/templateLiteralTypes1.js index bc880baef8c..1b28a658d44 100644 --- a/tests/baselines/reference/templateLiteralTypes1.js +++ b/tests/baselines/reference/templateLiteralTypes1.js @@ -16,16 +16,22 @@ type Loc = `${'top' | 'middle' | 'bottom'}-${'left' | 'center' | 'right'}`; type ToString = `${T}`; type TS1 = ToString<'abc' | 42 | true | -1234n>; -// Casing modifiers +// Nested template literal type normalization -type Cases = `${uppercase T} ${lowercase T} ${capitalize T} ${uncapitalize T}`; +type TL1 = `a${T}b${T}c`; +type TL2 = TL1<`x${U}y`>; // `ax${U}ybx{$U}yc` +type TL3 = TL2<'o'>; // 'axoybxoyc' + +// Casing intrinsics + +type Cases = `${Uppercase} ${Lowercase} ${Capitalize} ${Uncapitalize}`; type TCA1 = Cases<'bar'>; // 'BAR bar Bar bar' type TCA2 = Cases<'BAR'>; // 'BAR bar BAR bAR' // Assignability -function test(name: `get${capitalize T}`) { +function test(name: `get${Capitalize}`) { let s1: string = name; let s2: 'getFoo' | 'getBar' = name; } @@ -63,14 +69,14 @@ type T23 = MatchPair<'[123]'>; // unknown type T24 = MatchPair<'[1,2,3,4]'>; // ['1', '2,3,4'] type SnakeToCamelCase = - S extends `${infer T}_${infer U}` ? `${lowercase T}${SnakeToPascalCase}` : - S extends `${infer T}` ? `${lowercase T}` : + S extends `${infer T}_${infer U}` ? `${Lowercase}${SnakeToPascalCase}` : + S extends `${infer T}` ? `${Lowercase}` : SnakeToPascalCase; type SnakeToPascalCase = string extends S ? string : - S extends `${infer T}_${infer U}` ? `${capitalize `${lowercase T}`}${SnakeToPascalCase}` : - S extends `${infer T}` ? `${capitalize `${lowercase T}`}` : + S extends `${infer T}_${infer U}` ? `${Capitalize>}${SnakeToPascalCase}` : + S extends `${infer T}` ? `${Capitalize>}` : never; type RR0 = SnakeToPascalCase<'hello_world_foo'>; // 'HelloWorldFoo' @@ -86,12 +92,6 @@ type T25 = FirstTwoAndRest<'abcde'>; // ['ab', 'cde'] type T26 = FirstTwoAndRest<'ab'>; // ['ab', ''] type T27 = FirstTwoAndRest<'a'>; // unknown -type Capitalize = S extends `${infer H}${infer T}` ? `${uppercase H}${T}` : S; -type Uncapitalize = S extends `${infer H}${infer T}` ? `${lowercase H}${T}` : S; - -type TC1 = Capitalize<'foo'>; // 'Foo' -type TC2 = Uncapitalize<'Foo'>; // 'foo' - type HexDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' |'8' | '9' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'; type HexColor = @@ -245,10 +245,13 @@ declare type EN1 = EventName<'Foo' | 'Bar' | 'Baz'>; declare type Loc = `${'top' | 'middle' | 'bottom'}-${'left' | 'center' | 'right'}`; declare type ToString = `${T}`; declare type TS1 = ToString<'abc' | 42 | true | -1234n>; -declare type Cases = `${uppercase T} ${lowercase T} ${capitalize T} ${uncapitalize T}`; +declare type TL1 = `a${T}b${T}c`; +declare type TL2 = TL1<`x${U}y`>; +declare type TL3 = TL2<'o'>; +declare type Cases = `${Uppercase} ${Lowercase} ${Capitalize} ${Uncapitalize}`; declare type TCA1 = Cases<'bar'>; declare type TCA2 = Cases<'BAR'>; -declare function test(name: `get${capitalize T}`): void; +declare function test(name: `get${Capitalize}`): void; declare function fa1(x: T, y: { [P in keyof T]: T[P]; }, z: { @@ -269,8 +272,8 @@ declare type T21 = MatchPair<'[foo,bar]'>; declare type T22 = MatchPair<' [1,2]'>; declare type T23 = MatchPair<'[123]'>; declare type T24 = MatchPair<'[1,2,3,4]'>; -declare type SnakeToCamelCase = S extends `${infer T}_${infer U}` ? `${lowercase T}${SnakeToPascalCase}` : S extends `${infer T}` ? `${lowercase T}` : SnakeToPascalCase; -declare type SnakeToPascalCase = string extends S ? string : S extends `${infer T}_${infer U}` ? `${capitalize `${lowercase T}`}${SnakeToPascalCase}` : S extends `${infer T}` ? `${capitalize `${lowercase T}`}` : never; +declare type SnakeToCamelCase = S extends `${infer T}_${infer U}` ? `${Lowercase}${SnakeToPascalCase}` : S extends `${infer T}` ? `${Lowercase}` : SnakeToPascalCase; +declare type SnakeToPascalCase = string extends S ? string : S extends `${infer T}_${infer U}` ? `${Capitalize>}${SnakeToPascalCase}` : S extends `${infer T}` ? `${Capitalize>}` : never; declare type RR0 = SnakeToPascalCase<'hello_world_foo'>; declare type RR1 = SnakeToPascalCase<'FOO_BAR_BAZ'>; declare type RR2 = SnakeToCamelCase<'hello_world_foo'>; @@ -279,10 +282,6 @@ declare type FirstTwoAndRest = S extends `${infer A}${infer B} declare type T25 = FirstTwoAndRest<'abcde'>; declare type T26 = FirstTwoAndRest<'ab'>; declare type T27 = FirstTwoAndRest<'a'>; -declare type Capitalize = S extends `${infer H}${infer T}` ? `${uppercase H}${T}` : S; -declare type Uncapitalize = S extends `${infer H}${infer T}` ? `${lowercase H}${T}` : S; -declare type TC1 = Capitalize<'foo'>; -declare type TC2 = Uncapitalize<'Foo'>; declare type HexDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'; declare type HexColor = S extends `#${infer R1}${infer R2}${infer G1}${infer G2}${infer B1}${infer B2}` ? [ R1, diff --git a/tests/baselines/reference/templateLiteralTypes1.symbols b/tests/baselines/reference/templateLiteralTypes1.symbols index 679348bcbea..727638c918b 100644 --- a/tests/baselines/reference/templateLiteralTypes1.symbols +++ b/tests/baselines/reference/templateLiteralTypes1.symbols @@ -47,277 +47,278 @@ type TS1 = ToString<'abc' | 42 | true | -1234n>; >TS1 : Symbol(TS1, Decl(templateLiteralTypes1.ts, 14, 69)) >ToString : Symbol(ToString, Decl(templateLiteralTypes1.ts, 10, 75)) -// Casing modifiers +// Nested template literal type normalization -type Cases = `${uppercase T} ${lowercase T} ${capitalize T} ${uncapitalize T}`; ->Cases : Symbol(Cases, Decl(templateLiteralTypes1.ts, 15, 48)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 19, 11)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 19, 11)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 19, 11)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 19, 11)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 19, 11)) +type TL1 = `a${T}b${T}c`; +>TL1 : Symbol(TL1, Decl(templateLiteralTypes1.ts, 15, 48)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 19, 9)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 19, 9)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 19, 9)) + +type TL2 = TL1<`x${U}y`>; // `ax${U}ybx{$U}yc` +>TL2 : Symbol(TL2, Decl(templateLiteralTypes1.ts, 19, 43)) +>U : Symbol(U, Decl(templateLiteralTypes1.ts, 20, 9)) +>TL1 : Symbol(TL1, Decl(templateLiteralTypes1.ts, 15, 48)) +>U : Symbol(U, Decl(templateLiteralTypes1.ts, 20, 9)) + +type TL3 = TL2<'o'>; // 'axoybxoyc' +>TL3 : Symbol(TL3, Decl(templateLiteralTypes1.ts, 20, 43)) +>TL2 : Symbol(TL2, Decl(templateLiteralTypes1.ts, 19, 43)) + +// Casing intrinsics + +type Cases = `${Uppercase} ${Lowercase} ${Capitalize} ${Uncapitalize}`; +>Cases : Symbol(Cases, Decl(templateLiteralTypes1.ts, 21, 20)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 25, 11)) +>Uppercase : Symbol(Uppercase, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 25, 11)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 25, 11)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 25, 11)) +>Uncapitalize : Symbol(Uncapitalize, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 25, 11)) type TCA1 = Cases<'bar'>; // 'BAR bar Bar bar' ->TCA1 : Symbol(TCA1, Decl(templateLiteralTypes1.ts, 19, 97)) ->Cases : Symbol(Cases, Decl(templateLiteralTypes1.ts, 15, 48)) +>TCA1 : Symbol(TCA1, Decl(templateLiteralTypes1.ts, 25, 101)) +>Cases : Symbol(Cases, Decl(templateLiteralTypes1.ts, 21, 20)) type TCA2 = Cases<'BAR'>; // 'BAR bar BAR bAR' ->TCA2 : Symbol(TCA2, Decl(templateLiteralTypes1.ts, 21, 25)) ->Cases : Symbol(Cases, Decl(templateLiteralTypes1.ts, 15, 48)) +>TCA2 : Symbol(TCA2, Decl(templateLiteralTypes1.ts, 27, 25)) +>Cases : Symbol(Cases, Decl(templateLiteralTypes1.ts, 21, 20)) // Assignability -function test(name: `get${capitalize T}`) { ->test : Symbol(test, Decl(templateLiteralTypes1.ts, 22, 25)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 26, 14)) ->name : Symbol(name, Decl(templateLiteralTypes1.ts, 26, 39)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 26, 14)) +function test(name: `get${Capitalize}`) { +>test : Symbol(test, Decl(templateLiteralTypes1.ts, 28, 25)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 32, 14)) +>name : Symbol(name, Decl(templateLiteralTypes1.ts, 32, 39)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 32, 14)) let s1: string = name; ->s1 : Symbol(s1, Decl(templateLiteralTypes1.ts, 27, 7)) ->name : Symbol(name, Decl(templateLiteralTypes1.ts, 26, 39)) +>s1 : Symbol(s1, Decl(templateLiteralTypes1.ts, 33, 7)) +>name : Symbol(name, Decl(templateLiteralTypes1.ts, 32, 39)) let s2: 'getFoo' | 'getBar' = name; ->s2 : Symbol(s2, Decl(templateLiteralTypes1.ts, 28, 7)) ->name : Symbol(name, Decl(templateLiteralTypes1.ts, 26, 39)) +>s2 : Symbol(s2, Decl(templateLiteralTypes1.ts, 34, 7)) +>name : Symbol(name, Decl(templateLiteralTypes1.ts, 32, 39)) } function fa1(x: T, y: { [P in keyof T]: T[P] }, z: { [P in keyof T & string as `p_${P}`]: T[P] }) { ->fa1 : Symbol(fa1, Decl(templateLiteralTypes1.ts, 29, 1)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 31, 13)) ->x : Symbol(x, Decl(templateLiteralTypes1.ts, 31, 16)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 31, 13)) ->y : Symbol(y, Decl(templateLiteralTypes1.ts, 31, 21)) ->P : Symbol(P, Decl(templateLiteralTypes1.ts, 31, 28)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 31, 13)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 31, 13)) ->P : Symbol(P, Decl(templateLiteralTypes1.ts, 31, 28)) ->z : Symbol(z, Decl(templateLiteralTypes1.ts, 31, 50)) ->P : Symbol(P, Decl(templateLiteralTypes1.ts, 31, 57)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 31, 13)) ->P : Symbol(P, Decl(templateLiteralTypes1.ts, 31, 57)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 31, 13)) ->P : Symbol(P, Decl(templateLiteralTypes1.ts, 31, 57)) +>fa1 : Symbol(fa1, Decl(templateLiteralTypes1.ts, 35, 1)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 37, 13)) +>x : Symbol(x, Decl(templateLiteralTypes1.ts, 37, 16)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 37, 13)) +>y : Symbol(y, Decl(templateLiteralTypes1.ts, 37, 21)) +>P : Symbol(P, Decl(templateLiteralTypes1.ts, 37, 28)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 37, 13)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 37, 13)) +>P : Symbol(P, Decl(templateLiteralTypes1.ts, 37, 28)) +>z : Symbol(z, Decl(templateLiteralTypes1.ts, 37, 50)) +>P : Symbol(P, Decl(templateLiteralTypes1.ts, 37, 57)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 37, 13)) +>P : Symbol(P, Decl(templateLiteralTypes1.ts, 37, 57)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 37, 13)) +>P : Symbol(P, Decl(templateLiteralTypes1.ts, 37, 57)) y = x; ->y : Symbol(y, Decl(templateLiteralTypes1.ts, 31, 21)) ->x : Symbol(x, Decl(templateLiteralTypes1.ts, 31, 16)) +>y : Symbol(y, Decl(templateLiteralTypes1.ts, 37, 21)) +>x : Symbol(x, Decl(templateLiteralTypes1.ts, 37, 16)) z = x; // Error ->z : Symbol(z, Decl(templateLiteralTypes1.ts, 31, 50)) ->x : Symbol(x, Decl(templateLiteralTypes1.ts, 31, 16)) +>z : Symbol(z, Decl(templateLiteralTypes1.ts, 37, 50)) +>x : Symbol(x, Decl(templateLiteralTypes1.ts, 37, 16)) } function fa2(x: { [P in B as `p_${P}`]: T }, y: { [Q in A as `p_${Q}`]: U }) { ->fa2 : Symbol(fa2, Decl(templateLiteralTypes1.ts, 34, 1)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 36, 13)) ->U : Symbol(U, Decl(templateLiteralTypes1.ts, 36, 15)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 36, 13)) ->A : Symbol(A, Decl(templateLiteralTypes1.ts, 36, 28)) ->B : Symbol(B, Decl(templateLiteralTypes1.ts, 36, 46)) ->A : Symbol(A, Decl(templateLiteralTypes1.ts, 36, 28)) ->x : Symbol(x, Decl(templateLiteralTypes1.ts, 36, 60)) ->P : Symbol(P, Decl(templateLiteralTypes1.ts, 36, 66)) ->B : Symbol(B, Decl(templateLiteralTypes1.ts, 36, 46)) ->P : Symbol(P, Decl(templateLiteralTypes1.ts, 36, 66)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 36, 13)) ->y : Symbol(y, Decl(templateLiteralTypes1.ts, 36, 91)) ->Q : Symbol(Q, Decl(templateLiteralTypes1.ts, 36, 98)) ->A : Symbol(A, Decl(templateLiteralTypes1.ts, 36, 28)) ->Q : Symbol(Q, Decl(templateLiteralTypes1.ts, 36, 98)) ->U : Symbol(U, Decl(templateLiteralTypes1.ts, 36, 15)) +>fa2 : Symbol(fa2, Decl(templateLiteralTypes1.ts, 40, 1)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 42, 13)) +>U : Symbol(U, Decl(templateLiteralTypes1.ts, 42, 15)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 42, 13)) +>A : Symbol(A, Decl(templateLiteralTypes1.ts, 42, 28)) +>B : Symbol(B, Decl(templateLiteralTypes1.ts, 42, 46)) +>A : Symbol(A, Decl(templateLiteralTypes1.ts, 42, 28)) +>x : Symbol(x, Decl(templateLiteralTypes1.ts, 42, 60)) +>P : Symbol(P, Decl(templateLiteralTypes1.ts, 42, 66)) +>B : Symbol(B, Decl(templateLiteralTypes1.ts, 42, 46)) +>P : Symbol(P, Decl(templateLiteralTypes1.ts, 42, 66)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 42, 13)) +>y : Symbol(y, Decl(templateLiteralTypes1.ts, 42, 91)) +>Q : Symbol(Q, Decl(templateLiteralTypes1.ts, 42, 98)) +>A : Symbol(A, Decl(templateLiteralTypes1.ts, 42, 28)) +>Q : Symbol(Q, Decl(templateLiteralTypes1.ts, 42, 98)) +>U : Symbol(U, Decl(templateLiteralTypes1.ts, 42, 15)) x = y; ->x : Symbol(x, Decl(templateLiteralTypes1.ts, 36, 60)) ->y : Symbol(y, Decl(templateLiteralTypes1.ts, 36, 91)) +>x : Symbol(x, Decl(templateLiteralTypes1.ts, 42, 60)) +>y : Symbol(y, Decl(templateLiteralTypes1.ts, 42, 91)) y = x; // Error ->y : Symbol(y, Decl(templateLiteralTypes1.ts, 36, 91)) ->x : Symbol(x, Decl(templateLiteralTypes1.ts, 36, 60)) +>y : Symbol(y, Decl(templateLiteralTypes1.ts, 42, 91)) +>x : Symbol(x, Decl(templateLiteralTypes1.ts, 42, 60)) } // String transformations using recursive conditional types type Join = ->Join : Symbol(Join, Decl(templateLiteralTypes1.ts, 39, 1)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 43, 10)) ->D : Symbol(D, Decl(templateLiteralTypes1.ts, 43, 30)) +>Join : Symbol(Join, Decl(templateLiteralTypes1.ts, 45, 1)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 49, 10)) +>D : Symbol(D, Decl(templateLiteralTypes1.ts, 49, 30)) T extends [] ? '' : ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 43, 10)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 49, 10)) T extends [string | number | boolean | bigint] ? `${T[0]}` : ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 43, 10)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 43, 10)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 49, 10)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 49, 10)) T extends [string | number | boolean | bigint, ...infer U] ? `${T[0]}${D}${Join}` : ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 43, 10)) ->U : Symbol(U, Decl(templateLiteralTypes1.ts, 46, 59)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 43, 10)) ->D : Symbol(D, Decl(templateLiteralTypes1.ts, 43, 30)) ->Join : Symbol(Join, Decl(templateLiteralTypes1.ts, 39, 1)) ->U : Symbol(U, Decl(templateLiteralTypes1.ts, 46, 59)) ->D : Symbol(D, Decl(templateLiteralTypes1.ts, 43, 30)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 49, 10)) +>U : Symbol(U, Decl(templateLiteralTypes1.ts, 52, 59)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 49, 10)) +>D : Symbol(D, Decl(templateLiteralTypes1.ts, 49, 30)) +>Join : Symbol(Join, Decl(templateLiteralTypes1.ts, 45, 1)) +>U : Symbol(U, Decl(templateLiteralTypes1.ts, 52, 59)) +>D : Symbol(D, Decl(templateLiteralTypes1.ts, 49, 30)) string; type TJ1 = Join<[1, 2, 3, 4], '.'> ->TJ1 : Symbol(TJ1, Decl(templateLiteralTypes1.ts, 47, 11)) ->Join : Symbol(Join, Decl(templateLiteralTypes1.ts, 39, 1)) +>TJ1 : Symbol(TJ1, Decl(templateLiteralTypes1.ts, 53, 11)) +>Join : Symbol(Join, Decl(templateLiteralTypes1.ts, 45, 1)) type TJ2 = Join<['foo', 'bar', 'baz'], '-'>; ->TJ2 : Symbol(TJ2, Decl(templateLiteralTypes1.ts, 49, 34)) ->Join : Symbol(Join, Decl(templateLiteralTypes1.ts, 39, 1)) +>TJ2 : Symbol(TJ2, Decl(templateLiteralTypes1.ts, 55, 34)) +>Join : Symbol(Join, Decl(templateLiteralTypes1.ts, 45, 1)) type TJ3 = Join<[], '.'> ->TJ3 : Symbol(TJ3, Decl(templateLiteralTypes1.ts, 50, 44)) ->Join : Symbol(Join, Decl(templateLiteralTypes1.ts, 39, 1)) +>TJ3 : Symbol(TJ3, Decl(templateLiteralTypes1.ts, 56, 44)) +>Join : Symbol(Join, Decl(templateLiteralTypes1.ts, 45, 1)) // Inference based on delimiters type MatchPair = S extends `[${infer A},${infer B}]` ? [A, B] : unknown; ->MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 51, 24)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 55, 15)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 55, 15)) ->A : Symbol(A, Decl(templateLiteralTypes1.ts, 55, 54)) ->B : Symbol(B, Decl(templateLiteralTypes1.ts, 55, 65)) ->A : Symbol(A, Decl(templateLiteralTypes1.ts, 55, 54)) ->B : Symbol(B, Decl(templateLiteralTypes1.ts, 55, 65)) +>MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 57, 24)) +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 61, 15)) +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 61, 15)) +>A : Symbol(A, Decl(templateLiteralTypes1.ts, 61, 54)) +>B : Symbol(B, Decl(templateLiteralTypes1.ts, 61, 65)) +>A : Symbol(A, Decl(templateLiteralTypes1.ts, 61, 54)) +>B : Symbol(B, Decl(templateLiteralTypes1.ts, 61, 65)) type T20 = MatchPair<'[1,2]'>; // ['1', '2'] ->T20 : Symbol(T20, Decl(templateLiteralTypes1.ts, 55, 90)) ->MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 51, 24)) +>T20 : Symbol(T20, Decl(templateLiteralTypes1.ts, 61, 90)) +>MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 57, 24)) type T21 = MatchPair<'[foo,bar]'>; // ['foo', 'bar'] ->T21 : Symbol(T21, Decl(templateLiteralTypes1.ts, 57, 30)) ->MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 51, 24)) +>T21 : Symbol(T21, Decl(templateLiteralTypes1.ts, 63, 30)) +>MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 57, 24)) type T22 = MatchPair<' [1,2]'>; // unknown ->T22 : Symbol(T22, Decl(templateLiteralTypes1.ts, 58, 34)) ->MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 51, 24)) +>T22 : Symbol(T22, Decl(templateLiteralTypes1.ts, 64, 34)) +>MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 57, 24)) type T23 = MatchPair<'[123]'>; // unknown ->T23 : Symbol(T23, Decl(templateLiteralTypes1.ts, 59, 31)) ->MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 51, 24)) +>T23 : Symbol(T23, Decl(templateLiteralTypes1.ts, 65, 31)) +>MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 57, 24)) type T24 = MatchPair<'[1,2,3,4]'>; // ['1', '2,3,4'] ->T24 : Symbol(T24, Decl(templateLiteralTypes1.ts, 60, 30)) ->MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 51, 24)) +>T24 : Symbol(T24, Decl(templateLiteralTypes1.ts, 66, 30)) +>MatchPair : Symbol(MatchPair, Decl(templateLiteralTypes1.ts, 57, 24)) type SnakeToCamelCase = ->SnakeToCamelCase : Symbol(SnakeToCamelCase, Decl(templateLiteralTypes1.ts, 61, 34)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 63, 22)) +>SnakeToCamelCase : Symbol(SnakeToCamelCase, Decl(templateLiteralTypes1.ts, 67, 34)) +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 69, 22)) - S extends `${infer T}_${infer U}` ? `${lowercase T}${SnakeToPascalCase}` : ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 63, 22)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 64, 22)) ->U : Symbol(U, Decl(templateLiteralTypes1.ts, 64, 33)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 64, 22)) ->SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 66, 25)) ->U : Symbol(U, Decl(templateLiteralTypes1.ts, 64, 33)) + S extends `${infer T}_${infer U}` ? `${Lowercase}${SnakeToPascalCase}` : +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 69, 22)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 70, 22)) +>U : Symbol(U, Decl(templateLiteralTypes1.ts, 70, 33)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 70, 22)) +>SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 72, 25)) +>U : Symbol(U, Decl(templateLiteralTypes1.ts, 70, 33)) - S extends `${infer T}` ? `${lowercase T}` : ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 63, 22)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 65, 22)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 65, 22)) + S extends `${infer T}` ? `${Lowercase}` : +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 69, 22)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 71, 22)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 71, 22)) SnakeToPascalCase; ->SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 66, 25)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 63, 22)) +>SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 72, 25)) +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 69, 22)) type SnakeToPascalCase = ->SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 66, 25)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 68, 23)) +>SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 72, 25)) +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 74, 23)) string extends S ? string : ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 68, 23)) +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 74, 23)) - S extends `${infer T}_${infer U}` ? `${capitalize `${lowercase T}`}${SnakeToPascalCase}` : ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 68, 23)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 70, 22)) ->U : Symbol(U, Decl(templateLiteralTypes1.ts, 70, 33)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 70, 22)) ->SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 66, 25)) ->U : Symbol(U, Decl(templateLiteralTypes1.ts, 70, 33)) + S extends `${infer T}_${infer U}` ? `${Capitalize>}${SnakeToPascalCase}` : +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 74, 23)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 76, 22)) +>U : Symbol(U, Decl(templateLiteralTypes1.ts, 76, 33)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 76, 22)) +>SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 72, 25)) +>U : Symbol(U, Decl(templateLiteralTypes1.ts, 76, 33)) - S extends `${infer T}` ? `${capitalize `${lowercase T}`}` : ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 68, 23)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 71, 22)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 71, 22)) + S extends `${infer T}` ? `${Capitalize>}` : +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 74, 23)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 77, 22)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) +>Lowercase : Symbol(Lowercase, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 77, 22)) never; type RR0 = SnakeToPascalCase<'hello_world_foo'>; // 'HelloWorldFoo' ->RR0 : Symbol(RR0, Decl(templateLiteralTypes1.ts, 72, 10)) ->SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 66, 25)) +>RR0 : Symbol(RR0, Decl(templateLiteralTypes1.ts, 78, 10)) +>SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 72, 25)) type RR1 = SnakeToPascalCase<'FOO_BAR_BAZ'>; // 'FooBarBaz' ->RR1 : Symbol(RR1, Decl(templateLiteralTypes1.ts, 74, 48)) ->SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 66, 25)) +>RR1 : Symbol(RR1, Decl(templateLiteralTypes1.ts, 80, 48)) +>SnakeToPascalCase : Symbol(SnakeToPascalCase, Decl(templateLiteralTypes1.ts, 72, 25)) type RR2 = SnakeToCamelCase<'hello_world_foo'>; // 'helloWorldFoo' ->RR2 : Symbol(RR2, Decl(templateLiteralTypes1.ts, 75, 44)) ->SnakeToCamelCase : Symbol(SnakeToCamelCase, Decl(templateLiteralTypes1.ts, 61, 34)) +>RR2 : Symbol(RR2, Decl(templateLiteralTypes1.ts, 81, 44)) +>SnakeToCamelCase : Symbol(SnakeToCamelCase, Decl(templateLiteralTypes1.ts, 67, 34)) type RR3 = SnakeToCamelCase<'FOO_BAR_BAZ'>; // 'fooBarBaz' ->RR3 : Symbol(RR3, Decl(templateLiteralTypes1.ts, 76, 47)) ->SnakeToCamelCase : Symbol(SnakeToCamelCase, Decl(templateLiteralTypes1.ts, 61, 34)) +>RR3 : Symbol(RR3, Decl(templateLiteralTypes1.ts, 82, 47)) +>SnakeToCamelCase : Symbol(SnakeToCamelCase, Decl(templateLiteralTypes1.ts, 67, 34)) // Single character inference type FirstTwoAndRest = S extends `${infer A}${infer B}${infer R}` ? [`${A}${B}`, R] : unknown; ->FirstTwoAndRest : Symbol(FirstTwoAndRest, Decl(templateLiteralTypes1.ts, 77, 43)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 81, 21)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 81, 21)) ->A : Symbol(A, Decl(templateLiteralTypes1.ts, 81, 59)) ->B : Symbol(B, Decl(templateLiteralTypes1.ts, 81, 69)) ->R : Symbol(R, Decl(templateLiteralTypes1.ts, 81, 79)) ->A : Symbol(A, Decl(templateLiteralTypes1.ts, 81, 59)) ->B : Symbol(B, Decl(templateLiteralTypes1.ts, 81, 69)) ->R : Symbol(R, Decl(templateLiteralTypes1.ts, 81, 79)) +>FirstTwoAndRest : Symbol(FirstTwoAndRest, Decl(templateLiteralTypes1.ts, 83, 43)) +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 87, 21)) +>S : Symbol(S, Decl(templateLiteralTypes1.ts, 87, 21)) +>A : Symbol(A, Decl(templateLiteralTypes1.ts, 87, 59)) +>B : Symbol(B, Decl(templateLiteralTypes1.ts, 87, 69)) +>R : Symbol(R, Decl(templateLiteralTypes1.ts, 87, 79)) +>A : Symbol(A, Decl(templateLiteralTypes1.ts, 87, 59)) +>B : Symbol(B, Decl(templateLiteralTypes1.ts, 87, 69)) +>R : Symbol(R, Decl(templateLiteralTypes1.ts, 87, 79)) type T25 = FirstTwoAndRest<'abcde'>; // ['ab', 'cde'] ->T25 : Symbol(T25, Decl(templateLiteralTypes1.ts, 81, 112)) ->FirstTwoAndRest : Symbol(FirstTwoAndRest, Decl(templateLiteralTypes1.ts, 77, 43)) +>T25 : Symbol(T25, Decl(templateLiteralTypes1.ts, 87, 112)) +>FirstTwoAndRest : Symbol(FirstTwoAndRest, Decl(templateLiteralTypes1.ts, 83, 43)) type T26 = FirstTwoAndRest<'ab'>; // ['ab', ''] ->T26 : Symbol(T26, Decl(templateLiteralTypes1.ts, 83, 36)) ->FirstTwoAndRest : Symbol(FirstTwoAndRest, Decl(templateLiteralTypes1.ts, 77, 43)) +>T26 : Symbol(T26, Decl(templateLiteralTypes1.ts, 89, 36)) +>FirstTwoAndRest : Symbol(FirstTwoAndRest, Decl(templateLiteralTypes1.ts, 83, 43)) type T27 = FirstTwoAndRest<'a'>; // unknown ->T27 : Symbol(T27, Decl(templateLiteralTypes1.ts, 84, 33)) ->FirstTwoAndRest : Symbol(FirstTwoAndRest, Decl(templateLiteralTypes1.ts, 77, 43)) - -type Capitalize = S extends `${infer H}${infer T}` ? `${uppercase H}${T}` : S; ->Capitalize : Symbol(Capitalize, Decl(templateLiteralTypes1.ts, 85, 32)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 87, 16)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 87, 16)) ->H : Symbol(H, Decl(templateLiteralTypes1.ts, 87, 54)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 87, 64)) ->H : Symbol(H, Decl(templateLiteralTypes1.ts, 87, 54)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 87, 64)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 87, 16)) - -type Uncapitalize = S extends `${infer H}${infer T}` ? `${lowercase H}${T}` : S; ->Uncapitalize : Symbol(Uncapitalize, Decl(templateLiteralTypes1.ts, 87, 96)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 88, 18)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 88, 18)) ->H : Symbol(H, Decl(templateLiteralTypes1.ts, 88, 56)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 88, 66)) ->H : Symbol(H, Decl(templateLiteralTypes1.ts, 88, 56)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 88, 66)) ->S : Symbol(S, Decl(templateLiteralTypes1.ts, 88, 18)) - -type TC1 = Capitalize<'foo'>; // 'Foo' ->TC1 : Symbol(TC1, Decl(templateLiteralTypes1.ts, 88, 98)) ->Capitalize : Symbol(Capitalize, Decl(templateLiteralTypes1.ts, 85, 32)) - -type TC2 = Uncapitalize<'Foo'>; // 'foo' ->TC2 : Symbol(TC2, Decl(templateLiteralTypes1.ts, 90, 29)) ->Uncapitalize : Symbol(Uncapitalize, Decl(templateLiteralTypes1.ts, 87, 96)) +>T27 : Symbol(T27, Decl(templateLiteralTypes1.ts, 90, 33)) +>FirstTwoAndRest : Symbol(FirstTwoAndRest, Decl(templateLiteralTypes1.ts, 83, 43)) type HexDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' |'8' | '9' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'; ->HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 31)) +>HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 32)) type HexColor = >HexColor : Symbol(HexColor, Decl(templateLiteralTypes1.ts, 93, 145)) @@ -339,12 +340,12 @@ type HexColor = >G2 : Symbol(G2, Decl(templateLiteralTypes1.ts, 96, 56)) >B1 : Symbol(B1, Decl(templateLiteralTypes1.ts, 96, 67)) >B2 : Symbol(B2, Decl(templateLiteralTypes1.ts, 96, 78)) ->HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 31)) ->HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 31)) ->HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 31)) ->HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 31)) ->HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 31)) ->HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 31)) +>HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 32)) +>HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 32)) +>HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 32)) +>HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 32)) +>HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 32)) +>HexDigit : Symbol(HexDigit, Decl(templateLiteralTypes1.ts, 91, 32)) S : >S : Symbol(S, Decl(templateLiteralTypes1.ts, 95, 14)) diff --git a/tests/baselines/reference/templateLiteralTypes1.types b/tests/baselines/reference/templateLiteralTypes1.types index b34eecce1fc..fe1d45d0c75 100644 --- a/tests/baselines/reference/templateLiteralTypes1.types +++ b/tests/baselines/reference/templateLiteralTypes1.types @@ -46,10 +46,21 @@ type TS1 = ToString<'abc' | 42 | true | -1234n>; >-1234n : -1234n >1234n : 1234n -// Casing modifiers +// Nested template literal type normalization -type Cases = `${uppercase T} ${lowercase T} ${capitalize T} ${uncapitalize T}`; ->Cases : `${uppercase T} ${lowercase T} ${capitalize T} ${uncapitalize T}` +type TL1 = `a${T}b${T}c`; +>TL1 : `a${T}b${T}c` + +type TL2 = TL1<`x${U}y`>; // `ax${U}ybx{$U}yc` +>TL2 : `ax${U}ybx${U}yc` + +type TL3 = TL2<'o'>; // 'axoybxoyc' +>TL3 : "axoybxoyc" + +// Casing intrinsics + +type Cases = `${Uppercase} ${Lowercase} ${Capitalize} ${Uncapitalize}`; +>Cases : `${Uppercase} ${Lowercase} ${Capitalize} ${Uncapitalize}` type TCA1 = Cases<'bar'>; // 'BAR bar Bar bar' >TCA1 : "BAR bar Bar bar" @@ -59,17 +70,17 @@ type TCA2 = Cases<'BAR'>; // 'BAR bar BAR bAR' // Assignability -function test(name: `get${capitalize T}`) { ->test : (name: `get${capitalize T}`) => void ->name : `get${capitalize T}` +function test(name: `get${Capitalize}`) { +>test : (name: `get${Capitalize}`) => void +>name : `get${Capitalize}` let s1: string = name; >s1 : string ->name : `get${capitalize T}` +>name : `get${Capitalize}` let s2: 'getFoo' | 'getBar' = name; >s2 : "getFoo" | "getBar" ->name : `get${capitalize T}` +>name : `get${Capitalize}` } function fa1(x: T, y: { [P in keyof T]: T[P] }, z: { [P in keyof T & string as `p_${P}`]: T[P] }) { @@ -147,16 +158,16 @@ type T24 = MatchPair<'[1,2,3,4]'>; // ['1', '2,3,4'] type SnakeToCamelCase = >SnakeToCamelCase : SnakeToCamelCase - S extends `${infer T}_${infer U}` ? `${lowercase T}${SnakeToPascalCase}` : - S extends `${infer T}` ? `${lowercase T}` : + S extends `${infer T}_${infer U}` ? `${Lowercase}${SnakeToPascalCase}` : + S extends `${infer T}` ? `${Lowercase}` : SnakeToPascalCase; type SnakeToPascalCase = >SnakeToPascalCase : SnakeToPascalCase string extends S ? string : - S extends `${infer T}_${infer U}` ? `${capitalize `${lowercase T}`}${SnakeToPascalCase}` : - S extends `${infer T}` ? `${capitalize `${lowercase T}`}` : + S extends `${infer T}_${infer U}` ? `${Capitalize>}${SnakeToPascalCase}` : + S extends `${infer T}` ? `${Capitalize>}` : never; type RR0 = SnakeToPascalCase<'hello_world_foo'>; // 'HelloWorldFoo' @@ -185,18 +196,6 @@ type T26 = FirstTwoAndRest<'ab'>; // ['ab', ''] type T27 = FirstTwoAndRest<'a'>; // unknown >T27 : unknown -type Capitalize = S extends `${infer H}${infer T}` ? `${uppercase H}${T}` : S; ->Capitalize : Capitalize - -type Uncapitalize = S extends `${infer H}${infer T}` ? `${lowercase H}${T}` : S; ->Uncapitalize : Uncapitalize - -type TC1 = Capitalize<'foo'>; // 'Foo' ->TC1 : "Foo" - -type TC2 = Uncapitalize<'Foo'>; // 'foo' ->TC2 : "foo" - type HexDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' |'8' | '9' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'; >HexDigit : HexDigit diff --git a/tests/cases/conformance/types/literal/templateLiteralTypes1.ts b/tests/cases/conformance/types/literal/templateLiteralTypes1.ts index a71badcc6ef..08e467d980c 100644 --- a/tests/cases/conformance/types/literal/templateLiteralTypes1.ts +++ b/tests/cases/conformance/types/literal/templateLiteralTypes1.ts @@ -18,16 +18,22 @@ type Loc = `${'top' | 'middle' | 'bottom'}-${'left' | 'center' | 'right'}`; type ToString = `${T}`; type TS1 = ToString<'abc' | 42 | true | -1234n>; -// Casing modifiers +// Nested template literal type normalization -type Cases = `${uppercase T} ${lowercase T} ${capitalize T} ${uncapitalize T}`; +type TL1 = `a${T}b${T}c`; +type TL2 = TL1<`x${U}y`>; // `ax${U}ybx{$U}yc` +type TL3 = TL2<'o'>; // 'axoybxoyc' + +// Casing intrinsics + +type Cases = `${Uppercase} ${Lowercase} ${Capitalize} ${Uncapitalize}`; type TCA1 = Cases<'bar'>; // 'BAR bar Bar bar' type TCA2 = Cases<'BAR'>; // 'BAR bar BAR bAR' // Assignability -function test(name: `get${capitalize T}`) { +function test(name: `get${Capitalize}`) { let s1: string = name; let s2: 'getFoo' | 'getBar' = name; } @@ -65,14 +71,14 @@ type T23 = MatchPair<'[123]'>; // unknown type T24 = MatchPair<'[1,2,3,4]'>; // ['1', '2,3,4'] type SnakeToCamelCase = - S extends `${infer T}_${infer U}` ? `${lowercase T}${SnakeToPascalCase}` : - S extends `${infer T}` ? `${lowercase T}` : + S extends `${infer T}_${infer U}` ? `${Lowercase}${SnakeToPascalCase}` : + S extends `${infer T}` ? `${Lowercase}` : SnakeToPascalCase; type SnakeToPascalCase = string extends S ? string : - S extends `${infer T}_${infer U}` ? `${capitalize `${lowercase T}`}${SnakeToPascalCase}` : - S extends `${infer T}` ? `${capitalize `${lowercase T}`}` : + S extends `${infer T}_${infer U}` ? `${Capitalize>}${SnakeToPascalCase}` : + S extends `${infer T}` ? `${Capitalize>}` : never; type RR0 = SnakeToPascalCase<'hello_world_foo'>; // 'HelloWorldFoo' @@ -88,12 +94,6 @@ type T25 = FirstTwoAndRest<'abcde'>; // ['ab', 'cde'] type T26 = FirstTwoAndRest<'ab'>; // ['ab', ''] type T27 = FirstTwoAndRest<'a'>; // unknown -type Capitalize = S extends `${infer H}${infer T}` ? `${uppercase H}${T}` : S; -type Uncapitalize = S extends `${infer H}${infer T}` ? `${lowercase H}${T}` : S; - -type TC1 = Capitalize<'foo'>; // 'Foo' -type TC2 = Uncapitalize<'Foo'>; // 'foo' - type HexDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' |'8' | '9' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'; type HexColor = diff --git a/tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts b/tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts index 542503e82dc..f9677a517ab 100644 --- a/tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts +++ b/tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts @@ -3,7 +3,7 @@ // Mapped type 'as N' clauses -type Getters = { [P in keyof T & string as `get${capitalize P}`]: () => T[P] }; +type Getters = { [P in keyof T & string as `get${Capitalize

}`]: () => T[P] }; type TG1 = Getters<{ foo: string, bar: number, baz: { z: boolean } }>; // Mapped type with 'as N' clause has no constraint on 'in T' clause @@ -34,7 +34,7 @@ type TD3 = keyof DoubleProp; // `${keyof U & string}1` | `${keyof U & str // Repro from #40619 type Lazyify = { - [K in keyof T as `get${capitalize string & K}`]: () => T[K] + [K in keyof T as `get${Capitalize}`]: () => T[K] }; interface Person { diff --git a/tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts b/tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts new file mode 100644 index 00000000000..21528e04caa --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/intrinsicKeyword.ts @@ -0,0 +1,22 @@ +// @strict: true + +let e1: intrinsic; +let e2: { intrinsic: intrinsic }; +type TE1 = (intrinsic); +type TE2 = intrinsic; +type TE3 = T; +type TE4 = intrinsic; +type TE5 = (intrinsic); + +function f1() { + let intrinsic: intrinsic.intrinsic; +} + +function f2(intrinsic: string) { + return intrinsic; +} + +function f3() { + type intrinsic = string; + let s1: intrinsic = 'ok'; +} diff --git a/tests/cases/conformance/types/typeAliases/intrinsicTypes.ts b/tests/cases/conformance/types/typeAliases/intrinsicTypes.ts new file mode 100644 index 00000000000..cfdf08d0609 --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/intrinsicTypes.ts @@ -0,0 +1,57 @@ +// @strict: true +// @declaration: true + +type TU1 = Uppercase<'hello'>; // "HELLO" +type TU2 = Uppercase<'foo' | 'bar'>; // "FOO" | "BAR" +type TU3 = Uppercase; // string +type TU4 = Uppercase; // any +type TU5 = Uppercase; // never +type TU6 = Uppercase<42>; // Error + +type TL1 = Lowercase<'HELLO'>; // "hello" +type TL2 = Lowercase<'FOO' | 'BAR'>; // "foo" | "bar" +type TL3 = Lowercase; // string +type TL4 = Lowercase; // any +type TL5 = Lowercase; // never +type TL6 = Lowercase<42>; // Error + +type TC1 = Capitalize<'hello'>; // "Hello" +type TC2 = Capitalize<'foo' | 'bar'>; // "Foo" | "Bar" +type TC3 = Capitalize; // string +type TC4 = Capitalize; // any +type TC5 = Capitalize; // never +type TC6 = Capitalize<42>; // Error + +type TN1 = Uncapitalize<'Hello'>; // "hello" +type TN2 = Uncapitalize<'Foo' | 'Bar'>; // "foo" | "bar" +type TN3 = Uncapitalize; // string +type TN4 = Uncapitalize; // any +type TN5 = Uncapitalize; // never +type TN6 = Uncapitalize<42>; // Error + +type TX1 = Uppercase<`aB${S}`>; +type TX2 = TX1<'xYz'>; // "ABXYZ" +type TX3 = Lowercase<`aB${S}`>; +type TX4 = TX3<'xYz'>; // "abxyz" +type TX5 = `${Uppercase<'abc'>}${Lowercase<'XYZ'>}`; // "ABCxyz" + +type MyUppercase = intrinsic; // Error + +function foo1(s: string, x: Uppercase, y: Uppercase) { + s = x; + s = y; + x = s; // Error + x = y; + y = s; // Error + y = x; // Error +} + +function foo2(x: Uppercase) { + let s: 'FOO' | 'BAR' = x; +} + +declare function foo3(x: Uppercase): T; + +function foo4(x: Uppercase) { + return foo3(x); +} From 63c518e819c28a140cb5a2ba759bd08aae819339 Mon Sep 17 00:00:00 2001 From: csigs Date: Mon, 21 Sep 2020 18:10:43 +0000 Subject: [PATCH 013/241] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ 7 files changed, 252 insertions(+) diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index dd48aeb050b..523dd5cdf75 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1428,6 +1428,24 @@ + + + + + + + + + + + + + + + + + + @@ -4893,6 +4911,15 @@ + + + + + + + + + @@ -10533,6 +10560,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index 2ca8f7ee2fb..c216a553b06 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1428,6 +1428,24 @@ + + + + + + + + + + + + + + + + + + @@ -4893,6 +4911,15 @@ + + + + + + + + + @@ -10533,6 +10560,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index cacc7e13f4d..43faf6229cc 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1416,6 +1416,24 @@ + + + + + + + + + + + + + + + + + + @@ -4881,6 +4899,15 @@ + + + + + + + + + @@ -10521,6 +10548,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 177c5c45894..f2f0f7bd0f0 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1416,6 +1416,24 @@ + + + + + + + + + + + + + + + + + + @@ -4881,6 +4899,15 @@ + + + + + + + + + @@ -10521,6 +10548,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index 5f7f91e078c..6fdc52cd9d9 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1416,6 +1416,24 @@ + + + + + + + + + + + + + + + + + + @@ -4881,6 +4899,15 @@ + + + + + + + + + @@ -10521,6 +10548,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index f69faf3087d..b0268eff1f2 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1406,6 +1406,24 @@ + + + + + + + + + + + + + + + + + + @@ -4871,6 +4889,15 @@ + + + + + + + + + @@ -10508,6 +10535,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 93b275ea1dc..5cb3bf38179 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1409,6 +1409,24 @@ + + + + + + + + + + + + + + + + + + @@ -4874,6 +4892,15 @@ + + + + + + + + + @@ -10514,6 +10541,15 @@ + + + + + + + + + From 0310b530d8874e8400382e50ff3b56d501392495 Mon Sep 17 00:00:00 2001 From: Alex T Date: Mon, 21 Sep 2020 21:20:01 +0300 Subject: [PATCH 014/241] feat(40663/40664): improve error messages for assignment assertions '!' (#40669) --- src/compiler/checker.ts | 13 +++- src/compiler/diagnosticMessages.json | 8 +++ .../definiteAssignmentAssertions.errors.txt | 31 +++++---- .../reference/definiteAssignmentAssertions.js | 2 + .../definiteAssignmentAssertions.symbols | 65 ++++++++++--------- .../definiteAssignmentAssertions.types | 3 + ...ssignmentWithErrorStillStripped.errors.txt | 4 +- .../definiteAssignmentAssertions.ts | 1 + 8 files changed, 79 insertions(+), 48 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8a74457f15a..c0443194b4e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -39485,11 +39485,13 @@ namespace ts { } if (node.exclamationToken && (node.parent.parent.kind !== SyntaxKind.VariableStatement || !node.type || node.initializer || node.flags & NodeFlags.Ambient)) { - return grammarErrorOnNode(node.exclamationToken, Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); + const message = node.initializer + ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions + : Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation; + return grammarErrorOnNode(node.exclamationToken, message); } const moduleKind = getEmitModuleKind(compilerOptions); - if (moduleKind < ModuleKind.ES2015 && moduleKind !== ModuleKind.System && !(node.parent.parent.flags & NodeFlags.Ambient) && hasSyntacticModifier(node.parent.parent, ModifierFlags.Export)) { checkESModuleMarker(node.name); @@ -39689,7 +39691,12 @@ namespace ts { if (isPropertyDeclaration(node) && node.exclamationToken && (!isClassLike(node.parent) || !node.type || node.initializer || node.flags & NodeFlags.Ambient || hasSyntacticModifier(node, ModifierFlags.Static | ModifierFlags.Abstract))) { - return grammarErrorOnNode(node.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); + const message = node.initializer + ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions + : !node.type + ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations + : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; + return grammarErrorOnNode(node.exclamationToken, message); } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 29a31559aa4..4b65ce9839e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -871,6 +871,14 @@ "category": "Error", "code": 1262 }, + "Declarations with initializers cannot also have definite assignment assertions.": { + "category": "Error", + "code": 1263 + }, + "Declarations with definite assignment assertions must also have type annotations.": { + "category": "Error", + "code": 1264 + }, "'with' statements are not allowed in an async function block.": { "category": "Error", diff --git a/tests/baselines/reference/definiteAssignmentAssertions.errors.txt b/tests/baselines/reference/definiteAssignmentAssertions.errors.txt index dea5e45aa82..9fc911e40c6 100644 --- a/tests/baselines/reference/definiteAssignmentAssertions.errors.txt +++ b/tests/baselines/reference/definiteAssignmentAssertions.errors.txt @@ -1,17 +1,19 @@ tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(5,5): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. -tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(20,6): error TS1255: A definite assignment assertion '!' is not permitted in this context. -tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(21,6): error TS1255: A definite assignment assertion '!' is not permitted in this context. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(20,6): error TS1263: Declarations with initializers cannot also have definite assignment assertions. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(21,6): error TS1263: Declarations with initializers cannot also have definite assignment assertions. tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(22,13): error TS1255: A definite assignment assertion '!' is not permitted in this context. -tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(28,6): error TS1255: A definite assignment assertion '!' is not permitted in this context. -tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(34,15): error TS1255: A definite assignment assertion '!' is not permitted in this context. -tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(68,10): error TS1258: Definite assignment assertions can only be used along with a type annotation. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(23,5): error TS7008: Member 'd' implicitly has an 'any' type. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(23,6): error TS1264: Declarations with definite assignment assertions must also have type annotations. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(29,6): error TS1255: A definite assignment assertion '!' is not permitted in this context. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(35,15): error TS1255: A definite assignment assertion '!' is not permitted in this context. tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(69,10): error TS1258: Definite assignment assertions can only be used along with a type annotation. -tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(70,10): error TS1258: Definite assignment assertions can only be used along with a type annotation. -tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(75,15): error TS1258: Definite assignment assertions can only be used along with a type annotation. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(70,10): error TS1263: Declarations with initializers cannot also have definite assignment assertions. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(71,10): error TS1263: Declarations with initializers cannot also have definite assignment assertions. tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(76,15): error TS1258: Definite assignment assertions can only be used along with a type annotation. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(77,15): error TS1258: Definite assignment assertions can only be used along with a type annotation. -==== tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts (11 errors) ==== +==== tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts (13 errors) ==== // Suppress strict property initialization check class C1 { @@ -35,13 +37,18 @@ tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(76,15): erro class C3 { a! = 1; ~ -!!! error TS1255: A definite assignment assertion '!' is not permitted in this context. +!!! error TS1263: Declarations with initializers cannot also have definite assignment assertions. b!: number = 1; ~ -!!! error TS1255: A definite assignment assertion '!' is not permitted in this context. +!!! error TS1263: Declarations with initializers cannot also have definite assignment assertions. static c!: number; ~ !!! error TS1255: A definite assignment assertion '!' is not permitted in this context. + d!; + ~ +!!! error TS7008: Member 'd' implicitly has an 'any' type. + ~ +!!! error TS1264: Declarations with definite assignment assertions must also have type annotations. } // Definite assignment assertion not permitted in ambient context @@ -96,10 +103,10 @@ tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(76,15): erro !!! error TS1258: Definite assignment assertions can only be used along with a type annotation. let b! = 1; ~ -!!! error TS1258: Definite assignment assertions can only be used along with a type annotation. +!!! error TS1263: Declarations with initializers cannot also have definite assignment assertions. let c!: number = 1; ~ -!!! error TS1258: Definite assignment assertions can only be used along with a type annotation. +!!! error TS1263: Declarations with initializers cannot also have definite assignment assertions. } // Definite assignment assertion not permitted in ambient context diff --git a/tests/baselines/reference/definiteAssignmentAssertions.js b/tests/baselines/reference/definiteAssignmentAssertions.js index 70bab1b9c23..6ee50717ec6 100644 --- a/tests/baselines/reference/definiteAssignmentAssertions.js +++ b/tests/baselines/reference/definiteAssignmentAssertions.js @@ -21,6 +21,7 @@ class C3 { a! = 1; b!: number = 1; static c!: number; + d!; } // Definite assignment assertion not permitted in ambient context @@ -151,6 +152,7 @@ declare class C3 { a: number; b: number; static c: number; + d: any; } declare class C4 { a: number; diff --git a/tests/baselines/reference/definiteAssignmentAssertions.symbols b/tests/baselines/reference/definiteAssignmentAssertions.symbols index a291172c83b..08cc5862f6b 100644 --- a/tests/baselines/reference/definiteAssignmentAssertions.symbols +++ b/tests/baselines/reference/definiteAssignmentAssertions.symbols @@ -41,106 +41,109 @@ class C3 { static c!: number; >c : Symbol(C3.c, Decl(definiteAssignmentAssertions.ts, 20, 19)) + + d!; +>d : Symbol(C3.d, Decl(definiteAssignmentAssertions.ts, 21, 22)) } // Definite assignment assertion not permitted in ambient context declare class C4 { ->C4 : Symbol(C4, Decl(definiteAssignmentAssertions.ts, 22, 1)) +>C4 : Symbol(C4, Decl(definiteAssignmentAssertions.ts, 23, 1)) a!: number; ->a : Symbol(C4.a, Decl(definiteAssignmentAssertions.ts, 26, 18)) +>a : Symbol(C4.a, Decl(definiteAssignmentAssertions.ts, 27, 18)) } // Definite assignment assertion not permitted on abstract property abstract class C5 { ->C5 : Symbol(C5, Decl(definiteAssignmentAssertions.ts, 28, 1)) +>C5 : Symbol(C5, Decl(definiteAssignmentAssertions.ts, 29, 1)) abstract a!: number; ->a : Symbol(C5.a, Decl(definiteAssignmentAssertions.ts, 32, 19)) +>a : Symbol(C5.a, Decl(definiteAssignmentAssertions.ts, 33, 19)) } // Suppress definite assignment check for variable function f1() { ->f1 : Symbol(f1, Decl(definiteAssignmentAssertions.ts, 34, 1)) +>f1 : Symbol(f1, Decl(definiteAssignmentAssertions.ts, 35, 1)) let x!: number; ->x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 39, 7)) +>x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 40, 7)) let y = x; ->y : Symbol(y, Decl(definiteAssignmentAssertions.ts, 40, 7)) ->x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 39, 7)) +>y : Symbol(y, Decl(definiteAssignmentAssertions.ts, 41, 7)) +>x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 40, 7)) var a!: number; ->a : Symbol(a, Decl(definiteAssignmentAssertions.ts, 41, 7)) +>a : Symbol(a, Decl(definiteAssignmentAssertions.ts, 42, 7)) var b = a; ->b : Symbol(b, Decl(definiteAssignmentAssertions.ts, 42, 7)) ->a : Symbol(a, Decl(definiteAssignmentAssertions.ts, 41, 7)) +>b : Symbol(b, Decl(definiteAssignmentAssertions.ts, 43, 7)) +>a : Symbol(a, Decl(definiteAssignmentAssertions.ts, 42, 7)) } function f2() { ->f2 : Symbol(f2, Decl(definiteAssignmentAssertions.ts, 43, 1)) +>f2 : Symbol(f2, Decl(definiteAssignmentAssertions.ts, 44, 1)) let x!: string | number; ->x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 46, 7)) +>x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 47, 7)) if (typeof x === "string") { ->x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 46, 7)) +>x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 47, 7)) let s: string = x; ->s : Symbol(s, Decl(definiteAssignmentAssertions.ts, 48, 11)) ->x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 46, 7)) +>s : Symbol(s, Decl(definiteAssignmentAssertions.ts, 49, 11)) +>x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 47, 7)) } else { let n: number = x; ->n : Symbol(n, Decl(definiteAssignmentAssertions.ts, 51, 11)) ->x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 46, 7)) +>n : Symbol(n, Decl(definiteAssignmentAssertions.ts, 52, 11)) +>x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 47, 7)) } } function f3() { ->f3 : Symbol(f3, Decl(definiteAssignmentAssertions.ts, 53, 1)) +>f3 : Symbol(f3, Decl(definiteAssignmentAssertions.ts, 54, 1)) let x!: number; ->x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 56, 7)) +>x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 57, 7)) const g = () => { ->g : Symbol(g, Decl(definiteAssignmentAssertions.ts, 57, 9)) +>g : Symbol(g, Decl(definiteAssignmentAssertions.ts, 58, 9)) x = 1; ->x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 56, 7)) +>x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 57, 7)) } g(); ->g : Symbol(g, Decl(definiteAssignmentAssertions.ts, 57, 9)) +>g : Symbol(g, Decl(definiteAssignmentAssertions.ts, 58, 9)) let y = x; ->y : Symbol(y, Decl(definiteAssignmentAssertions.ts, 61, 7)) ->x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 56, 7)) +>y : Symbol(y, Decl(definiteAssignmentAssertions.ts, 62, 7)) +>x : Symbol(x, Decl(definiteAssignmentAssertions.ts, 57, 7)) } // Definite assignment assertion requires type annotation and no initializer function f4() { ->f4 : Symbol(f4, Decl(definiteAssignmentAssertions.ts, 62, 1)) +>f4 : Symbol(f4, Decl(definiteAssignmentAssertions.ts, 63, 1)) let a!; ->a : Symbol(a, Decl(definiteAssignmentAssertions.ts, 67, 7)) +>a : Symbol(a, Decl(definiteAssignmentAssertions.ts, 68, 7)) let b! = 1; ->b : Symbol(b, Decl(definiteAssignmentAssertions.ts, 68, 7)) +>b : Symbol(b, Decl(definiteAssignmentAssertions.ts, 69, 7)) let c!: number = 1; ->c : Symbol(c, Decl(definiteAssignmentAssertions.ts, 69, 7)) +>c : Symbol(c, Decl(definiteAssignmentAssertions.ts, 70, 7)) } // Definite assignment assertion not permitted in ambient context declare let v1!: number; ->v1 : Symbol(v1, Decl(definiteAssignmentAssertions.ts, 74, 11)) +>v1 : Symbol(v1, Decl(definiteAssignmentAssertions.ts, 75, 11)) declare var v2!: number; ->v2 : Symbol(v2, Decl(definiteAssignmentAssertions.ts, 75, 11)) +>v2 : Symbol(v2, Decl(definiteAssignmentAssertions.ts, 76, 11)) diff --git a/tests/baselines/reference/definiteAssignmentAssertions.types b/tests/baselines/reference/definiteAssignmentAssertions.types index 95eaf7853b3..b98839d3383 100644 --- a/tests/baselines/reference/definiteAssignmentAssertions.types +++ b/tests/baselines/reference/definiteAssignmentAssertions.types @@ -43,6 +43,9 @@ class C3 { static c!: number; >c : number + + d!; +>d : any } // Definite assignment assertion not permitted in ambient context diff --git a/tests/baselines/reference/definiteAssignmentWithErrorStillStripped.errors.txt b/tests/baselines/reference/definiteAssignmentWithErrorStillStripped.errors.txt index d6625904b2b..1b2036fced6 100644 --- a/tests/baselines/reference/definiteAssignmentWithErrorStillStripped.errors.txt +++ b/tests/baselines/reference/definiteAssignmentWithErrorStillStripped.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/definiteAssignmentWithErrorStillStripped.ts(2,6): error TS1255: A definite assignment assertion '!' is not permitted in this context. +tests/cases/compiler/definiteAssignmentWithErrorStillStripped.ts(2,6): error TS1264: Declarations with definite assignment assertions must also have type annotations. ==== tests/cases/compiler/definiteAssignmentWithErrorStillStripped.ts (1 errors) ==== class C { p!; ~ -!!! error TS1255: A definite assignment assertion '!' is not permitted in this context. +!!! error TS1264: Declarations with definite assignment assertions must also have type annotations. } \ No newline at end of file diff --git a/tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts b/tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts index b35c18d83c2..958f7f4159c 100644 --- a/tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts +++ b/tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts @@ -23,6 +23,7 @@ class C3 { a! = 1; b!: number = 1; static c!: number; + d!; } // Definite assignment assertion not permitted in ambient context From 587252cbe9eac64a48216d5205a0c7a29f21b824 Mon Sep 17 00:00:00 2001 From: Alex T Date: Mon, 21 Sep 2020 23:22:15 +0300 Subject: [PATCH 015/241] feat(40674): make error messages more consistent (#40675) --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 4 ---- .../definiteAssignmentAssertions.errors.txt | 12 ++++++------ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c0443194b4e..a9d11787a14 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -39487,7 +39487,7 @@ namespace ts { if (node.exclamationToken && (node.parent.parent.kind !== SyntaxKind.VariableStatement || !node.type || node.initializer || node.flags & NodeFlags.Ambient)) { const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation; + : Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations; return grammarErrorOnNode(node.exclamationToken, message); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 4b65ce9839e..9e53407c437 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -851,10 +851,6 @@ "category": "Error", "code": 1257 }, - "Definite assignment assertions can only be used along with a type annotation.": { - "category": "Error", - "code": 1258 - }, "Module '{0}' can only be default-imported using the '{1}' flag": { "category": "Error", "code": 1259 diff --git a/tests/baselines/reference/definiteAssignmentAssertions.errors.txt b/tests/baselines/reference/definiteAssignmentAssertions.errors.txt index 9fc911e40c6..a4f7f80a51b 100644 --- a/tests/baselines/reference/definiteAssignmentAssertions.errors.txt +++ b/tests/baselines/reference/definiteAssignmentAssertions.errors.txt @@ -6,11 +6,11 @@ tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(23,5): error tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(23,6): error TS1264: Declarations with definite assignment assertions must also have type annotations. tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(29,6): error TS1255: A definite assignment assertion '!' is not permitted in this context. tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(35,15): error TS1255: A definite assignment assertion '!' is not permitted in this context. -tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(69,10): error TS1258: Definite assignment assertions can only be used along with a type annotation. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(69,10): error TS1264: Declarations with definite assignment assertions must also have type annotations. tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(70,10): error TS1263: Declarations with initializers cannot also have definite assignment assertions. tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(71,10): error TS1263: Declarations with initializers cannot also have definite assignment assertions. -tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(76,15): error TS1258: Definite assignment assertions can only be used along with a type annotation. -tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(77,15): error TS1258: Definite assignment assertions can only be used along with a type annotation. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(76,15): error TS1264: Declarations with definite assignment assertions must also have type annotations. +tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(77,15): error TS1264: Declarations with definite assignment assertions must also have type annotations. ==== tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts (13 errors) ==== @@ -100,7 +100,7 @@ tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(77,15): erro function f4() { let a!; ~ -!!! error TS1258: Definite assignment assertions can only be used along with a type annotation. +!!! error TS1264: Declarations with definite assignment assertions must also have type annotations. let b! = 1; ~ !!! error TS1263: Declarations with initializers cannot also have definite assignment assertions. @@ -113,8 +113,8 @@ tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(77,15): erro declare let v1!: number; ~ -!!! error TS1258: Definite assignment assertions can only be used along with a type annotation. +!!! error TS1264: Declarations with definite assignment assertions must also have type annotations. declare var v2!: number; ~ -!!! error TS1258: Definite assignment assertions can only be used along with a type annotation. +!!! error TS1264: Declarations with definite assignment assertions must also have type annotations. \ No newline at end of file From 7d4a801f0a20e14563f76b6762e9158375377d66 Mon Sep 17 00:00:00 2001 From: csigs Date: Tue, 22 Sep 2020 00:10:49 +0000 Subject: [PATCH 016/241] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 27 ++++++++++++++ 3 files changed, 99 insertions(+) diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index 3cc7f81d585..8b335e0e00b 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1425,6 +1425,24 @@ + + + + + + + + + + + + + + + + + + @@ -4890,6 +4908,15 @@ + + + + + + + + + @@ -10530,6 +10557,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index eb5a25d972f..0664da5e5c8 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1413,6 +1413,24 @@ + + + + + + + + + + + + + + + + + + @@ -4878,6 +4896,15 @@ + + + + + + + + + @@ -10515,6 +10542,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index efcc301de9f..e31c9e78eab 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1415,6 +1415,18 @@ + + + + + + + + + + + + @@ -4880,6 +4892,12 @@ + + + + + + @@ -10520,6 +10538,15 @@ + + + + + + + + + From ce338a40225772e4150abaa5c9ebb913a82a888b Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Mon, 21 Sep 2020 18:11:46 -0700 Subject: [PATCH 017/241] fix(40640) add missing notApplicableReason in protocol (#40680) * update protocol * fix lint error --- src/server/protocol.ts | 7 +++++++ tests/baselines/reference/api/tsserverlibrary.d.ts | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/server/protocol.ts b/src/server/protocol.ts index f9f3b1910cd..6a52afc8175 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -617,6 +617,12 @@ namespace ts.server.protocol { * so this description should make sense by itself if the parent is inlineable=true */ description: string; + + /** + * A message to show to the user if the refactoring cannot be applied in + * the current context. + */ + notApplicableReason?: string; } export interface GetEditsForRefactorRequest extends Request { @@ -3223,6 +3229,7 @@ namespace ts.server.protocol { readonly allowTextChangesInNewFiles?: boolean; readonly lazyConfiguredProjectsFromExternalProject?: boolean; readonly providePrefixAndSuffixTextForRename?: boolean; + readonly provideRefactorNotApplicableReason?: boolean; readonly allowRenameOfImportPath?: boolean; readonly includePackageJsonAutoImports?: "auto" | "on" | "off"; } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 621b4141291..2b5ca8d1f18 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -6956,6 +6956,11 @@ declare namespace ts.server.protocol { * so this description should make sense by itself if the parent is inlineable=true */ description: string; + /** + * A message to show to the user if the refactoring cannot be applied in + * the current context. + */ + notApplicableReason?: string; } interface GetEditsForRefactorRequest extends Request { command: CommandTypes.GetEditsForRefactor; @@ -8983,6 +8988,7 @@ declare namespace ts.server.protocol { readonly allowTextChangesInNewFiles?: boolean; readonly lazyConfiguredProjectsFromExternalProject?: boolean; readonly providePrefixAndSuffixTextForRename?: boolean; + readonly provideRefactorNotApplicableReason?: boolean; readonly allowRenameOfImportPath?: boolean; readonly includePackageJsonAutoImports?: "auto" | "on" | "off"; } From d2e8831c5f776a1b1bba2102e02aa21c8d0aac38 Mon Sep 17 00:00:00 2001 From: csigs Date: Tue, 22 Sep 2020 06:10:37 +0000 Subject: [PATCH 018/241] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 36 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++ 2 files changed, 45 insertions(+) diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 8430b58693b..da95f4bc36d 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1409,6 +1409,24 @@ + + + + + + + + + + + + + + + + + + @@ -4874,6 +4892,15 @@ + + + + + + + + + @@ -10511,6 +10538,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index e31c9e78eab..3f10e52009a 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1418,12 +1418,18 @@ + + + + + + @@ -4895,6 +4901,9 @@ + + + From 7c6462aa10329884618c51ff9af76c66b503f47c Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 22 Sep 2020 06:21:20 +0000 Subject: [PATCH 019/241] Update package-lock.json --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 676abd3b302..8906cb88f5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -550,9 +550,9 @@ "dev": true }, "@types/node": { - "version": "14.11.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.1.tgz", - "integrity": "sha512-oTQgnd0hblfLsJ6BvJzzSL+Inogp3lq9fGgqRkMB/ziKMgEUaFl801OncOzUmalfzt14N0oPHMK47ipl+wbTIw==", + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==", "dev": true }, "@types/node-fetch": { @@ -8126,9 +8126,9 @@ "dev": true }, "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", "dev": true, "requires": { "clone": "^2.1.1", From ace0732e72ec8753e47552ec67c9394908a3a898 Mon Sep 17 00:00:00 2001 From: csigs Date: Tue, 22 Sep 2020 18:10:35 +0000 Subject: [PATCH 020/241] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index ed19a1ed2bf..26e8b80b7b4 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -1416,6 +1416,24 @@ + + + + + + + + + + + + + + + + + + @@ -4881,6 +4899,12 @@ + + + + + + @@ -10521,6 +10545,15 @@ + + + + + + + + + From c5a28fcdeca3386b5998322f349e8e3bc6a90dab Mon Sep 17 00:00:00 2001 From: Alex T Date: Wed, 23 Sep 2020 01:34:56 +0300 Subject: [PATCH 021/241] fix(39589): add await before return promise expression (#39649) --- .../codefixes/convertToAsyncFunction.ts | 37 ++++++----- .../services/convertToAsyncFunction.ts | 61 ++++++++++++++++++- ...vertToAsyncFunction_PromiseAllAndThen1.js} | 2 +- ...vertToAsyncFunction_PromiseAllAndThen1.ts} | 2 +- ...nvertToAsyncFunction_PromiseAllAndThen3.js | 17 ++++++ ...nvertToAsyncFunction_PromiseAllAndThen3.ts | 17 ++++++ ...nvertToAsyncFunction_PromiseAllAndThen4.js | 18 ++++++ ...nvertToAsyncFunction_PromiseAllAndThen4.ts | 18 ++++++ .../convertToAsyncFunction_Return1.ts | 16 +++++ .../convertToAsyncFunction_Return2.ts | 14 +++++ .../convertToAsyncFunction_Return3.ts | 16 +++++ ...s.ts => convertToAsyncFunction_noArgs1.ts} | 5 +- .../convertToAsyncFunction_noArgs2.ts | 28 +++++++++ 13 files changed, 228 insertions(+), 23 deletions(-) rename tests/baselines/reference/convertToAsyncFunction/{convertToAsyncFunction_PromiseAllAndThen.js => convertToAsyncFunction_PromiseAllAndThen1.js} (79%) rename tests/baselines/reference/convertToAsyncFunction/{convertToAsyncFunction_PromiseAllAndThen.ts => convertToAsyncFunction_PromiseAllAndThen1.ts} (79%) create mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen3.js create mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen3.ts create mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen4.js create mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen4.ts create mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return1.ts create mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return2.ts create mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return3.ts rename tests/baselines/reference/convertToAsyncFunction/{convertToAsyncFunction_noArgs.ts => convertToAsyncFunction_noArgs1.ts} (93%) create mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs2.ts diff --git a/src/services/codefixes/convertToAsyncFunction.ts b/src/services/codefixes/convertToAsyncFunction.ts index 6474c84df9b..50e00740c68 100644 --- a/src/services/codefixes/convertToAsyncFunction.ts +++ b/src/services/codefixes/convertToAsyncFunction.ts @@ -302,7 +302,6 @@ namespace ts.codefix { const [onFulfilled, onRejected] = node.arguments; const onFulfilledArgumentName = getArgBindingName(onFulfilled, transformer); const transformationBody = getTransformationBody(onFulfilled, prevArgName, onFulfilledArgumentName, node, transformer); - if (onRejected) { const onRejectedArgumentName = getArgBindingName(onRejected, transformer); const tryBlock = factory.createBlock(transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody)); @@ -310,10 +309,8 @@ namespace ts.codefix { const catchArg = onRejectedArgumentName ? isSynthIdentifier(onRejectedArgumentName) ? onRejectedArgumentName.identifier.text : onRejectedArgumentName.bindingPattern : "e"; const catchVariableDeclaration = factory.createVariableDeclaration(catchArg); const catchClause = factory.createCatchClause(catchVariableDeclaration, factory.createBlock(transformationBody2)); - return [factory.createTryStatement(tryBlock, catchClause, /* finallyBlock */ undefined)]; } - return transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody); } @@ -395,11 +392,12 @@ namespace ts.codefix { case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: { const funcBody = (func as FunctionExpression | ArrowFunction).body; + const returnType = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)?.getReturnType(); + // Arrow functions with block bodies { } will enter this control flow if (isBlock(funcBody)) { let refactoredStmts: Statement[] = []; let seenReturnStatement = false; - for (const statement of funcBody.statements) { if (isReturnStatement(statement)) { seenReturnStatement = true; @@ -407,7 +405,8 @@ namespace ts.codefix { refactoredStmts = refactoredStmts.concat(getInnerTransformationBody(transformer, [statement], prevArgName)); } else { - refactoredStmts.push(...maybeAnnotateAndReturn(statement.expression, parent.typeArguments?.[0])); + const possiblyAwaitedRightHandSide = returnType && statement.expression ? getPossiblyAwaitedRightHandSide(transformer.checker, returnType, statement.expression) : statement.expression; + refactoredStmts.push(...maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, parent.typeArguments?.[0])); } } else { @@ -431,19 +430,21 @@ namespace ts.codefix { return innerCbBody; } - const type = transformer.checker.getTypeAtLocation(func); - const returnType = getLastCallSignature(type, transformer.checker)!.getReturnType(); - const rightHandSide = getSynthesizedDeepClone(funcBody); - const possiblyAwaitedRightHandSide = !!transformer.checker.getPromisedTypeOfPromise(returnType) ? factory.createAwaitExpression(rightHandSide) : rightHandSide; - if (!shouldReturn(parent, transformer)) { - const transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined); - if (prevArgName) { - prevArgName.types.push(returnType); + if (returnType) { + const possiblyAwaitedRightHandSide = getPossiblyAwaitedRightHandSide(transformer.checker, returnType, funcBody); + if (!shouldReturn(parent, transformer)) { + const transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined); + if (prevArgName) { + prevArgName.types.push(returnType); + } + return transformedStatement; + } + else { + return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, parent.typeArguments?.[0]); } - return transformedStatement; } else { - return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, parent.typeArguments?.[0]); + return silentFail(); } } } @@ -454,12 +455,16 @@ namespace ts.codefix { return emptyArray; } + function getPossiblyAwaitedRightHandSide(checker: TypeChecker, type: Type, expr: Expression): AwaitExpression | Expression { + const rightHandSide = getSynthesizedDeepClone(expr); + return !!checker.getPromisedTypeOfPromise(type) ? factory.createAwaitExpression(rightHandSide) : rightHandSide; + } + function getLastCallSignature(type: Type, checker: TypeChecker): Signature | undefined { const callSignatures = checker.getSignaturesOfType(type, SignatureKind.Call); return lastOrUndefined(callSignatures); } - function removeReturns(stmts: readonly Statement[], prevArgName: SynthBindingName | undefined, transformer: Transformer, seenReturnStatement: boolean): readonly Statement[] { const ret: Statement[] = []; for (const stmt of stmts) { diff --git a/src/testRunner/unittests/services/convertToAsyncFunction.ts b/src/testRunner/unittests/services/convertToAsyncFunction.ts index 952f6bf4d68..183f7bccb42 100644 --- a/src/testRunner/unittests/services/convertToAsyncFunction.ts +++ b/src/testRunner/unittests/services/convertToAsyncFunction.ts @@ -902,7 +902,7 @@ function [#|f|](): Promise { } ` ); - _testConvertToAsyncFunction("convertToAsyncFunction_PromiseAllAndThen", ` + _testConvertToAsyncFunction("convertToAsyncFunction_PromiseAllAndThen1", ` function [#|f|]() { return Promise.resolve().then(function () { return Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function () { @@ -921,6 +921,26 @@ function [#|f|]() { })]).then(res => res.toString()); }); } +` + ); + + _testConvertToAsyncFunction("convertToAsyncFunction_PromiseAllAndThen3", ` +function [#|f|]() { + return Promise.resolve().then(() => + Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function () { + return fetch("https://github.com"); + }).then(res => res.toString())])); +} +` + ); + + _testConvertToAsyncFunction("convertToAsyncFunction_PromiseAllAndThen4", ` +function [#|f|]() { + return Promise.resolve().then(() => + Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function () { + return fetch("https://github.com"); + })]).then(res => res.toString())); +} ` ); _testConvertToAsyncFunction("convertToAsyncFunction_Scope1", ` @@ -1124,6 +1144,27 @@ function [#|bar|](x: T): Promise { ` ); + _testConvertToAsyncFunction("convertToAsyncFunction_Return1", ` +function [#|f|](p: Promise) { + return p.catch((error: Error) => { + return Promise.reject(error); + }); +}` + ); + + _testConvertToAsyncFunction("convertToAsyncFunction_Return2", ` +function [#|f|](p: Promise) { + return p.catch((error: Error) => Promise.reject(error)); +}` + ); + + _testConvertToAsyncFunction("convertToAsyncFunction_Return3", ` +function [#|f|](p: Promise) { + return p.catch(function (error: Error) { + return Promise.reject(error); + }); +}` + ); _testConvertToAsyncFunction("convertToAsyncFunction_LocalReturn", ` function [#|f|]() { @@ -1352,7 +1393,7 @@ function [#|f|]() { } `); - _testConvertToAsyncFunction("convertToAsyncFunction_noArgs", ` + _testConvertToAsyncFunction("convertToAsyncFunction_noArgs1", ` function delay(millis: number): Promise { throw "no" } @@ -1364,7 +1405,21 @@ function [#|main2|]() { .then(() => { console.log("."); return delay(500); }) .then(() => { console.log("."); return delay(500); }) } -`); + `); + + _testConvertToAsyncFunction("convertToAsyncFunction_noArgs2", ` +function delay(millis: number): Promise { + throw "no" +} + +function [#|main2|]() { + console.log("Please wait. Loading."); + return delay(500) + .then(() => delay(500)) + .then(() => delay(500)) + .then(() => delay(500)) +} + `); _testConvertToAsyncFunction("convertToAsyncFunction_exportModifier", ` export function [#|foo|]() { diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen.js b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen1.js similarity index 79% rename from tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen.js rename to tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen1.js index 8b4b5afd88c..3dea02ec3b1 100644 --- a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen.js +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen1.js @@ -12,7 +12,7 @@ function /*[#|*/f/*|]*/() { async function f() { await Promise.resolve(); - return Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function() { + return await Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function() { return fetch("https://github.com"); }).then(res => res.toString())]); } diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen1.ts similarity index 79% rename from tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen.ts rename to tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen1.ts index 8b4b5afd88c..3dea02ec3b1 100644 --- a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen.ts +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen1.ts @@ -12,7 +12,7 @@ function /*[#|*/f/*|]*/() { async function f() { await Promise.resolve(); - return Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function() { + return await Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function() { return fetch("https://github.com"); }).then(res => res.toString())]); } diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen3.js b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen3.js new file mode 100644 index 00000000000..5219dc7358c --- /dev/null +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen3.js @@ -0,0 +1,17 @@ +// ==ORIGINAL== + +function /*[#|*/f/*|]*/() { + return Promise.resolve().then(() => + Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function () { + return fetch("https://github.com"); + }).then(res => res.toString())])); +} + +// ==ASYNC FUNCTION::Convert to async function== + +async function f() { + await Promise.resolve(); + return await Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function() { + return fetch("https://github.com"); + }).then(res => res.toString())]); +} diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen3.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen3.ts new file mode 100644 index 00000000000..5219dc7358c --- /dev/null +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen3.ts @@ -0,0 +1,17 @@ +// ==ORIGINAL== + +function /*[#|*/f/*|]*/() { + return Promise.resolve().then(() => + Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function () { + return fetch("https://github.com"); + }).then(res => res.toString())])); +} + +// ==ASYNC FUNCTION::Convert to async function== + +async function f() { + await Promise.resolve(); + return await Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function() { + return fetch("https://github.com"); + }).then(res => res.toString())]); +} diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen4.js b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen4.js new file mode 100644 index 00000000000..f3be8d3479c --- /dev/null +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen4.js @@ -0,0 +1,18 @@ +// ==ORIGINAL== + +function /*[#|*/f/*|]*/() { + return Promise.resolve().then(() => + Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function () { + return fetch("https://github.com"); + })]).then(res => res.toString())); +} + +// ==ASYNC FUNCTION::Convert to async function== + +async function f() { + await Promise.resolve(); + const res = await Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function() { + return fetch("https://github.com"); + })]); + return res.toString(); +} diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen4.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen4.ts new file mode 100644 index 00000000000..f3be8d3479c --- /dev/null +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_PromiseAllAndThen4.ts @@ -0,0 +1,18 @@ +// ==ORIGINAL== + +function /*[#|*/f/*|]*/() { + return Promise.resolve().then(() => + Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function () { + return fetch("https://github.com"); + })]).then(res => res.toString())); +} + +// ==ASYNC FUNCTION::Convert to async function== + +async function f() { + await Promise.resolve(); + const res = await Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function() { + return fetch("https://github.com"); + })]); + return res.toString(); +} diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return1.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return1.ts new file mode 100644 index 00000000000..75e1d23902e --- /dev/null +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return1.ts @@ -0,0 +1,16 @@ +// ==ORIGINAL== + +function /*[#|*/f/*|]*/(p: Promise) { + return p.catch((error: Error) => { + return Promise.reject(error); + }); +} +// ==ASYNC FUNCTION::Convert to async function== + +async function f(p: Promise) { + try { + return p; + } catch (error) { + return await Promise.reject(error); + } +} \ No newline at end of file diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return2.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return2.ts new file mode 100644 index 00000000000..01fea0275c6 --- /dev/null +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return2.ts @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +function /*[#|*/f/*|]*/(p: Promise) { + return p.catch((error: Error) => Promise.reject(error)); +} +// ==ASYNC FUNCTION::Convert to async function== + +async function f(p: Promise) { + try { + return p; + } catch (error) { + return await Promise.reject(error); + } +} \ No newline at end of file diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return3.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return3.ts new file mode 100644 index 00000000000..43cbe7e36b4 --- /dev/null +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Return3.ts @@ -0,0 +1,16 @@ +// ==ORIGINAL== + +function /*[#|*/f/*|]*/(p: Promise) { + return p.catch(function (error: Error) { + return Promise.reject(error); + }); +} +// ==ASYNC FUNCTION::Convert to async function== + +async function f(p: Promise) { + try { + return p; + } catch (error) { + return await Promise.reject(error); + } +} \ No newline at end of file diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs1.ts similarity index 93% rename from tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.ts rename to tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs1.ts index 088bf9f828e..d5be5a9f054 100644 --- a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.ts +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs1.ts @@ -11,7 +11,7 @@ function /*[#|*/main2/*|]*/() { .then(() => { console.log("."); return delay(500); }) .then(() => { console.log("."); return delay(500); }) } - + // ==ASYNC FUNCTION::Convert to async function== function delay(millis: number): Promise { @@ -26,5 +26,6 @@ async function main2() { console.log("."); await delay(500); console.log("."); - return delay(500); + return await delay(500); } + \ No newline at end of file diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs2.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs2.ts new file mode 100644 index 00000000000..04f75d9d78f --- /dev/null +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs2.ts @@ -0,0 +1,28 @@ +// ==ORIGINAL== + +function delay(millis: number): Promise { + throw "no" +} + +function /*[#|*/main2/*|]*/() { + console.log("Please wait. Loading."); + return delay(500) + .then(() => delay(500)) + .then(() => delay(500)) + .then(() => delay(500)) +} + +// ==ASYNC FUNCTION::Convert to async function== + +function delay(millis: number): Promise { + throw "no" +} + +async function main2() { + console.log("Please wait. Loading."); + await delay(500); + await delay(500); + await delay(500); + return await delay(500); +} + \ No newline at end of file From 5d6cce5ca7b15bec206f47c6e210d2460c47f6ba Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 22 Sep 2020 13:11:17 -1000 Subject: [PATCH 022/241] Const contexts for template literals (#40707) * Support const assertions with template literal expressions * Add tests * Accept new baselines --- src/compiler/checker.ts | 24 +-- .../reference/constAssertions.errors.txt | 46 ++++- tests/baselines/reference/constAssertions.js | 95 ++++++++- .../reference/constAssertions.symbols | 135 +++++++++++++ .../baselines/reference/constAssertions.types | 186 ++++++++++++++++++ .../typeAssertions/constAssertions.ts | 45 +++++ 6 files changed, 517 insertions(+), 14 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a9d11787a14..947ecc6e1ff 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -28212,6 +28212,7 @@ namespace ts { case SyntaxKind.FalseKeyword: case SyntaxKind.ArrayLiteralExpression: case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.TemplateExpression: return true; case SyntaxKind.ParenthesizedExpression: return isValidConstAssertionArgument((node).expression); @@ -30284,18 +30285,17 @@ namespace ts { } function checkTemplateExpression(node: TemplateExpression): Type { - // We just want to check each expressions, but we are unconcerned with - // the type of each expression, as any value may be coerced into a string. - // It is worth asking whether this is what we really want though. - // A place where we actually *are* concerned with the expressions' types are - // in tagged templates. - forEach(node.templateSpans, templateSpan => { - if (maybeTypeOfKind(checkExpression(templateSpan.expression), TypeFlags.ESSymbolLike)) { - error(templateSpan.expression, Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); + const texts = [node.head.text]; + const types = []; + for (const span of node.templateSpans) { + const type = checkExpression(span.expression); + if (maybeTypeOfKind(type, TypeFlags.ESSymbolLike)) { + error(span.expression, Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); } - }); - - return stringType; + texts.push(span.literal.text); + types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); + } + return isConstContext(node) ? getTemplateLiteralType(texts, types) : stringType; } function getContextNode(node: Expression): Node { @@ -30427,7 +30427,7 @@ namespace ts { const parent = node.parent; return isAssertionExpression(parent) && isConstTypeReference(parent.type) || (isParenthesizedExpression(parent) || isArrayLiteralExpression(parent) || isSpreadElement(parent)) && isConstContext(parent) || - (isPropertyAssignment(parent) || isShorthandPropertyAssignment(parent)) && isConstContext(parent.parent); + (isPropertyAssignment(parent) || isShorthandPropertyAssignment(parent) || isTemplateSpan(parent)) && isConstContext(parent.parent); } function checkExpressionForMutableLocation(node: Expression, checkMode: CheckMode | undefined, contextualType?: Type, forceTuple?: boolean): Type { diff --git a/tests/baselines/reference/constAssertions.errors.txt b/tests/baselines/reference/constAssertions.errors.txt index 8ecce1377e3..ef237f5017c 100644 --- a/tests/baselines/reference/constAssertions.errors.txt +++ b/tests/baselines/reference/constAssertions.errors.txt @@ -76,4 +76,48 @@ tests/cases/conformance/expressions/typeAssertions/constAssertions.ts(63,10): er let e3 = id(1) as const; // Error ~~~~~ !!! error TS1355: A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals. - \ No newline at end of file + + let t1 = 'foo' as const; + let t2 = 'bar' as const; + let t3 = `${t1}-${t2}` as const; + let t4 = `${`(${t1})`}-${`(${t2})`}` as const; + + function ff1(x: 'foo' | 'bar', y: 1 | 2) { + return `${x}-${y}` as const; + } + + function ff2(x: T, y: U) { + return `${x}-${y}` as const; + } + + const ts1 = ff2('foo', 'bar'); + const ts2 = ff2('foo', !!true ? '0' : '1'); + const ts3 = ff2(!!true ? 'top' : 'bottom', !!true ? 'left' : 'right'); + + function ff3(x: 'foo' | 'bar', y: object) { + return `${x}${y}` as const; + } + + type Action = "verify" | "write"; + type ContentMatch = "match" | "nonMatch"; + type Outcome = `${Action}_${ContentMatch}`; + + function ff4(verify: boolean, contentMatches: boolean) { + const action : Action = verify ? `verify` : `write`; + const contentMatch: ContentMatch = contentMatches ? `match` : `nonMatch`; + const outcome: Outcome = `${action}_${contentMatch}` as const; + return outcome; + } + + function ff5(verify: boolean, contentMatches: boolean) { + const action = verify ? `verify` : `write`; + const contentMatch = contentMatches ? `match` : `nonMatch`; + const outcome = `${action}_${contentMatch}` as const; + return outcome; + } + + function accessorNames(propName: S) { + return [`get-${propName}`, `set-${propName}`] as const; + } + + const ns1 = accessorNames('foo'); \ No newline at end of file diff --git a/tests/baselines/reference/constAssertions.js b/tests/baselines/reference/constAssertions.js index 1dc997a2c58..238d436adaf 100644 --- a/tests/baselines/reference/constAssertions.js +++ b/tests/baselines/reference/constAssertions.js @@ -62,7 +62,51 @@ declare function id(x: T): T; let e1 = v1 as const; // Error let e2 = (true ? 1 : 0) as const; // Error let e3 = id(1) as const; // Error - + +let t1 = 'foo' as const; +let t2 = 'bar' as const; +let t3 = `${t1}-${t2}` as const; +let t4 = `${`(${t1})`}-${`(${t2})`}` as const; + +function ff1(x: 'foo' | 'bar', y: 1 | 2) { + return `${x}-${y}` as const; +} + +function ff2(x: T, y: U) { + return `${x}-${y}` as const; +} + +const ts1 = ff2('foo', 'bar'); +const ts2 = ff2('foo', !!true ? '0' : '1'); +const ts3 = ff2(!!true ? 'top' : 'bottom', !!true ? 'left' : 'right'); + +function ff3(x: 'foo' | 'bar', y: object) { + return `${x}${y}` as const; +} + +type Action = "verify" | "write"; +type ContentMatch = "match" | "nonMatch"; +type Outcome = `${Action}_${ContentMatch}`; + +function ff4(verify: boolean, contentMatches: boolean) { + const action : Action = verify ? `verify` : `write`; + const contentMatch: ContentMatch = contentMatches ? `match` : `nonMatch`; + const outcome: Outcome = `${action}_${contentMatch}` as const; + return outcome; +} + +function ff5(verify: boolean, contentMatches: boolean) { + const action = verify ? `verify` : `write`; + const contentMatch = contentMatches ? `match` : `nonMatch`; + const outcome = `${action}_${contentMatch}` as const; + return outcome; +} + +function accessorNames(propName: S) { + return [`get-${propName}`, `set-${propName}`] as const; +} + +const ns1 = accessorNames('foo'); //// [constAssertions.js] "use strict"; @@ -117,6 +161,38 @@ let q5 = { x: 10, y: 20 }; let e1 = v1; // Error let e2 = (true ? 1 : 0); // Error let e3 = id(1); // Error +let t1 = 'foo'; +let t2 = 'bar'; +let t3 = `${t1}-${t2}`; +let t4 = `${`(${t1})`}-${`(${t2})`}`; +function ff1(x, y) { + return `${x}-${y}`; +} +function ff2(x, y) { + return `${x}-${y}`; +} +const ts1 = ff2('foo', 'bar'); +const ts2 = ff2('foo', !!true ? '0' : '1'); +const ts3 = ff2(!!true ? 'top' : 'bottom', !!true ? 'left' : 'right'); +function ff3(x, y) { + return `${x}${y}`; +} +function ff4(verify, contentMatches) { + const action = verify ? `verify` : `write`; + const contentMatch = contentMatches ? `match` : `nonMatch`; + const outcome = `${action}_${contentMatch}`; + return outcome; +} +function ff5(verify, contentMatches) { + const action = verify ? `verify` : `write`; + const contentMatch = contentMatches ? `match` : `nonMatch`; + const outcome = `${action}_${contentMatch}`; + return outcome; +} +function accessorNames(propName) { + return [`get-${propName}`, `set-${propName}`]; +} +const ns1 = accessorNames('foo'); //// [constAssertions.d.ts] @@ -218,3 +294,20 @@ declare function id(x: T): T; declare let e1: "abc"; declare let e2: 0 | 1; declare let e3: 1; +declare let t1: "foo"; +declare let t2: "bar"; +declare let t3: "foo-bar"; +declare let t4: "(foo)-(bar)"; +declare function ff1(x: 'foo' | 'bar', y: 1 | 2): "foo-1" | "foo-2" | "bar-1" | "bar-2"; +declare function ff2(x: T, y: U): `${T}-${U}`; +declare const ts1: "foo-bar"; +declare const ts2: "foo-1" | "foo-0"; +declare const ts3: "top-left" | "top-right" | "bottom-left" | "bottom-right"; +declare function ff3(x: 'foo' | 'bar', y: object): string; +declare type Action = "verify" | "write"; +declare type ContentMatch = "match" | "nonMatch"; +declare type Outcome = `${Action}_${ContentMatch}`; +declare function ff4(verify: boolean, contentMatches: boolean): "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch"; +declare function ff5(verify: boolean, contentMatches: boolean): "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch"; +declare function accessorNames(propName: S): readonly [`get-${S}`, `set-${S}`]; +declare const ns1: readonly ["get-foo", "set-foo"]; diff --git a/tests/baselines/reference/constAssertions.symbols b/tests/baselines/reference/constAssertions.symbols index 598210f42b3..6e81b68fa87 100644 --- a/tests/baselines/reference/constAssertions.symbols +++ b/tests/baselines/reference/constAssertions.symbols @@ -199,3 +199,138 @@ let e3 = id(1) as const; // Error >e3 : Symbol(e3, Decl(constAssertions.ts, 62, 3)) >id : Symbol(id, Decl(constAssertions.ts, 56, 34)) +let t1 = 'foo' as const; +>t1 : Symbol(t1, Decl(constAssertions.ts, 64, 3)) + +let t2 = 'bar' as const; +>t2 : Symbol(t2, Decl(constAssertions.ts, 65, 3)) + +let t3 = `${t1}-${t2}` as const; +>t3 : Symbol(t3, Decl(constAssertions.ts, 66, 3)) +>t1 : Symbol(t1, Decl(constAssertions.ts, 64, 3)) +>t2 : Symbol(t2, Decl(constAssertions.ts, 65, 3)) + +let t4 = `${`(${t1})`}-${`(${t2})`}` as const; +>t4 : Symbol(t4, Decl(constAssertions.ts, 67, 3)) +>t1 : Symbol(t1, Decl(constAssertions.ts, 64, 3)) +>t2 : Symbol(t2, Decl(constAssertions.ts, 65, 3)) + +function ff1(x: 'foo' | 'bar', y: 1 | 2) { +>ff1 : Symbol(ff1, Decl(constAssertions.ts, 67, 46)) +>x : Symbol(x, Decl(constAssertions.ts, 69, 13)) +>y : Symbol(y, Decl(constAssertions.ts, 69, 30)) + + return `${x}-${y}` as const; +>x : Symbol(x, Decl(constAssertions.ts, 69, 13)) +>y : Symbol(y, Decl(constAssertions.ts, 69, 30)) +} + +function ff2(x: T, y: U) { +>ff2 : Symbol(ff2, Decl(constAssertions.ts, 71, 1)) +>T : Symbol(T, Decl(constAssertions.ts, 73, 13)) +>U : Symbol(U, Decl(constAssertions.ts, 73, 30)) +>x : Symbol(x, Decl(constAssertions.ts, 73, 49)) +>T : Symbol(T, Decl(constAssertions.ts, 73, 13)) +>y : Symbol(y, Decl(constAssertions.ts, 73, 54)) +>U : Symbol(U, Decl(constAssertions.ts, 73, 30)) + + return `${x}-${y}` as const; +>x : Symbol(x, Decl(constAssertions.ts, 73, 49)) +>y : Symbol(y, Decl(constAssertions.ts, 73, 54)) +} + +const ts1 = ff2('foo', 'bar'); +>ts1 : Symbol(ts1, Decl(constAssertions.ts, 77, 5)) +>ff2 : Symbol(ff2, Decl(constAssertions.ts, 71, 1)) + +const ts2 = ff2('foo', !!true ? '0' : '1'); +>ts2 : Symbol(ts2, Decl(constAssertions.ts, 78, 5)) +>ff2 : Symbol(ff2, Decl(constAssertions.ts, 71, 1)) + +const ts3 = ff2(!!true ? 'top' : 'bottom', !!true ? 'left' : 'right'); +>ts3 : Symbol(ts3, Decl(constAssertions.ts, 79, 5)) +>ff2 : Symbol(ff2, Decl(constAssertions.ts, 71, 1)) + +function ff3(x: 'foo' | 'bar', y: object) { +>ff3 : Symbol(ff3, Decl(constAssertions.ts, 79, 70)) +>x : Symbol(x, Decl(constAssertions.ts, 81, 13)) +>y : Symbol(y, Decl(constAssertions.ts, 81, 30)) + + return `${x}${y}` as const; +>x : Symbol(x, Decl(constAssertions.ts, 81, 13)) +>y : Symbol(y, Decl(constAssertions.ts, 81, 30)) +} + +type Action = "verify" | "write"; +>Action : Symbol(Action, Decl(constAssertions.ts, 83, 1)) + +type ContentMatch = "match" | "nonMatch"; +>ContentMatch : Symbol(ContentMatch, Decl(constAssertions.ts, 85, 33)) + +type Outcome = `${Action}_${ContentMatch}`; +>Outcome : Symbol(Outcome, Decl(constAssertions.ts, 86, 41)) +>Action : Symbol(Action, Decl(constAssertions.ts, 83, 1)) +>ContentMatch : Symbol(ContentMatch, Decl(constAssertions.ts, 85, 33)) + +function ff4(verify: boolean, contentMatches: boolean) { +>ff4 : Symbol(ff4, Decl(constAssertions.ts, 87, 43)) +>verify : Symbol(verify, Decl(constAssertions.ts, 89, 13)) +>contentMatches : Symbol(contentMatches, Decl(constAssertions.ts, 89, 29)) + + const action : Action = verify ? `verify` : `write`; +>action : Symbol(action, Decl(constAssertions.ts, 90, 9)) +>Action : Symbol(Action, Decl(constAssertions.ts, 83, 1)) +>verify : Symbol(verify, Decl(constAssertions.ts, 89, 13)) + + const contentMatch: ContentMatch = contentMatches ? `match` : `nonMatch`; +>contentMatch : Symbol(contentMatch, Decl(constAssertions.ts, 91, 9)) +>ContentMatch : Symbol(ContentMatch, Decl(constAssertions.ts, 85, 33)) +>contentMatches : Symbol(contentMatches, Decl(constAssertions.ts, 89, 29)) + + const outcome: Outcome = `${action}_${contentMatch}` as const; +>outcome : Symbol(outcome, Decl(constAssertions.ts, 92, 9)) +>Outcome : Symbol(Outcome, Decl(constAssertions.ts, 86, 41)) +>action : Symbol(action, Decl(constAssertions.ts, 90, 9)) +>contentMatch : Symbol(contentMatch, Decl(constAssertions.ts, 91, 9)) + + return outcome; +>outcome : Symbol(outcome, Decl(constAssertions.ts, 92, 9)) +} + +function ff5(verify: boolean, contentMatches: boolean) { +>ff5 : Symbol(ff5, Decl(constAssertions.ts, 94, 1)) +>verify : Symbol(verify, Decl(constAssertions.ts, 96, 13)) +>contentMatches : Symbol(contentMatches, Decl(constAssertions.ts, 96, 29)) + + const action = verify ? `verify` : `write`; +>action : Symbol(action, Decl(constAssertions.ts, 97, 9)) +>verify : Symbol(verify, Decl(constAssertions.ts, 96, 13)) + + const contentMatch = contentMatches ? `match` : `nonMatch`; +>contentMatch : Symbol(contentMatch, Decl(constAssertions.ts, 98, 9)) +>contentMatches : Symbol(contentMatches, Decl(constAssertions.ts, 96, 29)) + + const outcome = `${action}_${contentMatch}` as const; +>outcome : Symbol(outcome, Decl(constAssertions.ts, 99, 9)) +>action : Symbol(action, Decl(constAssertions.ts, 97, 9)) +>contentMatch : Symbol(contentMatch, Decl(constAssertions.ts, 98, 9)) + + return outcome; +>outcome : Symbol(outcome, Decl(constAssertions.ts, 99, 9)) +} + +function accessorNames(propName: S) { +>accessorNames : Symbol(accessorNames, Decl(constAssertions.ts, 101, 1)) +>S : Symbol(S, Decl(constAssertions.ts, 103, 23)) +>propName : Symbol(propName, Decl(constAssertions.ts, 103, 41)) +>S : Symbol(S, Decl(constAssertions.ts, 103, 23)) + + return [`get-${propName}`, `set-${propName}`] as const; +>propName : Symbol(propName, Decl(constAssertions.ts, 103, 41)) +>propName : Symbol(propName, Decl(constAssertions.ts, 103, 41)) +} + +const ns1 = accessorNames('foo'); +>ns1 : Symbol(ns1, Decl(constAssertions.ts, 107, 5)) +>accessorNames : Symbol(accessorNames, Decl(constAssertions.ts, 101, 1)) + diff --git a/tests/baselines/reference/constAssertions.types b/tests/baselines/reference/constAssertions.types index 68b442e0c44..cdbebebd392 100644 --- a/tests/baselines/reference/constAssertions.types +++ b/tests/baselines/reference/constAssertions.types @@ -354,3 +354,189 @@ let e3 = id(1) as const; // Error >id : (x: T) => T >1 : 1 +let t1 = 'foo' as const; +>t1 : "foo" +>'foo' as const : "foo" +>'foo' : "foo" + +let t2 = 'bar' as const; +>t2 : "bar" +>'bar' as const : "bar" +>'bar' : "bar" + +let t3 = `${t1}-${t2}` as const; +>t3 : "foo-bar" +>`${t1}-${t2}` as const : "foo-bar" +>`${t1}-${t2}` : "foo-bar" +>t1 : "foo" +>t2 : "bar" + +let t4 = `${`(${t1})`}-${`(${t2})`}` as const; +>t4 : "(foo)-(bar)" +>`${`(${t1})`}-${`(${t2})`}` as const : "(foo)-(bar)" +>`${`(${t1})`}-${`(${t2})`}` : "(foo)-(bar)" +>`(${t1})` : "(foo)" +>t1 : "foo" +>`(${t2})` : "(bar)" +>t2 : "bar" + +function ff1(x: 'foo' | 'bar', y: 1 | 2) { +>ff1 : (x: 'foo' | 'bar', y: 1 | 2) => "foo-1" | "foo-2" | "bar-1" | "bar-2" +>x : "foo" | "bar" +>y : 1 | 2 + + return `${x}-${y}` as const; +>`${x}-${y}` as const : "foo-1" | "foo-2" | "bar-1" | "bar-2" +>`${x}-${y}` : "foo-1" | "foo-2" | "bar-1" | "bar-2" +>x : "foo" | "bar" +>y : 1 | 2 +} + +function ff2(x: T, y: U) { +>ff2 : (x: T, y: U) => `${T}-${U}` +>x : T +>y : U + + return `${x}-${y}` as const; +>`${x}-${y}` as const : `${T}-${U}` +>`${x}-${y}` : `${T}-${U}` +>x : T +>y : U +} + +const ts1 = ff2('foo', 'bar'); +>ts1 : "foo-bar" +>ff2('foo', 'bar') : "foo-bar" +>ff2 : (x: T, y: U) => `${T}-${U}` +>'foo' : "foo" +>'bar' : "bar" + +const ts2 = ff2('foo', !!true ? '0' : '1'); +>ts2 : "foo-1" | "foo-0" +>ff2('foo', !!true ? '0' : '1') : "foo-1" | "foo-0" +>ff2 : (x: T, y: U) => `${T}-${U}` +>'foo' : "foo" +>!!true ? '0' : '1' : "0" | "1" +>!!true : true +>!true : false +>true : true +>'0' : "0" +>'1' : "1" + +const ts3 = ff2(!!true ? 'top' : 'bottom', !!true ? 'left' : 'right'); +>ts3 : "top-left" | "top-right" | "bottom-left" | "bottom-right" +>ff2(!!true ? 'top' : 'bottom', !!true ? 'left' : 'right') : "top-left" | "top-right" | "bottom-left" | "bottom-right" +>ff2 : (x: T, y: U) => `${T}-${U}` +>!!true ? 'top' : 'bottom' : "top" | "bottom" +>!!true : true +>!true : false +>true : true +>'top' : "top" +>'bottom' : "bottom" +>!!true ? 'left' : 'right' : "left" | "right" +>!!true : true +>!true : false +>true : true +>'left' : "left" +>'right' : "right" + +function ff3(x: 'foo' | 'bar', y: object) { +>ff3 : (x: 'foo' | 'bar', y: object) => string +>x : "foo" | "bar" +>y : object + + return `${x}${y}` as const; +>`${x}${y}` as const : string +>`${x}${y}` : string +>x : "foo" | "bar" +>y : object +} + +type Action = "verify" | "write"; +>Action : Action + +type ContentMatch = "match" | "nonMatch"; +>ContentMatch : ContentMatch + +type Outcome = `${Action}_${ContentMatch}`; +>Outcome : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" + +function ff4(verify: boolean, contentMatches: boolean) { +>ff4 : (verify: boolean, contentMatches: boolean) => "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" +>verify : boolean +>contentMatches : boolean + + const action : Action = verify ? `verify` : `write`; +>action : Action +>verify ? `verify` : `write` : Action +>verify : boolean +>`verify` : "verify" +>`write` : "write" + + const contentMatch: ContentMatch = contentMatches ? `match` : `nonMatch`; +>contentMatch : ContentMatch +>contentMatches ? `match` : `nonMatch` : ContentMatch +>contentMatches : boolean +>`match` : "match" +>`nonMatch` : "nonMatch" + + const outcome: Outcome = `${action}_${contentMatch}` as const; +>outcome : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" +>`${action}_${contentMatch}` as const : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" +>`${action}_${contentMatch}` : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" +>action : Action +>contentMatch : ContentMatch + + return outcome; +>outcome : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" +} + +function ff5(verify: boolean, contentMatches: boolean) { +>ff5 : (verify: boolean, contentMatches: boolean) => "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" +>verify : boolean +>contentMatches : boolean + + const action = verify ? `verify` : `write`; +>action : "verify" | "write" +>verify ? `verify` : `write` : Action +>verify : boolean +>`verify` : "verify" +>`write` : "write" + + const contentMatch = contentMatches ? `match` : `nonMatch`; +>contentMatch : "match" | "nonMatch" +>contentMatches ? `match` : `nonMatch` : ContentMatch +>contentMatches : boolean +>`match` : "match" +>`nonMatch` : "nonMatch" + + const outcome = `${action}_${contentMatch}` as const; +>outcome : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" +>`${action}_${contentMatch}` as const : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" +>`${action}_${contentMatch}` : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" +>action : Action +>contentMatch : ContentMatch + + return outcome; +>outcome : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" +} + +function accessorNames(propName: S) { +>accessorNames : (propName: S) => readonly [`get-${S}`, `set-${S}`] +>propName : S + + return [`get-${propName}`, `set-${propName}`] as const; +>[`get-${propName}`, `set-${propName}`] as const : readonly [`get-${S}`, `set-${S}`] +>[`get-${propName}`, `set-${propName}`] : readonly [`get-${S}`, `set-${S}`] +>`get-${propName}` : `get-${S}` +>propName : S +>`set-${propName}` : `set-${S}` +>propName : S +} + +const ns1 = accessorNames('foo'); +>ns1 : readonly ["get-foo", "set-foo"] +>accessorNames('foo') : readonly ["get-foo", "set-foo"] +>accessorNames : (propName: S) => readonly [`get-${S}`, `set-${S}`] +>'foo' : "foo" + diff --git a/tests/cases/conformance/expressions/typeAssertions/constAssertions.ts b/tests/cases/conformance/expressions/typeAssertions/constAssertions.ts index e2ce7aba993..44428174b2a 100644 --- a/tests/cases/conformance/expressions/typeAssertions/constAssertions.ts +++ b/tests/cases/conformance/expressions/typeAssertions/constAssertions.ts @@ -65,3 +65,48 @@ declare function id(x: T): T; let e1 = v1 as const; // Error let e2 = (true ? 1 : 0) as const; // Error let e3 = id(1) as const; // Error + +let t1 = 'foo' as const; +let t2 = 'bar' as const; +let t3 = `${t1}-${t2}` as const; +let t4 = `${`(${t1})`}-${`(${t2})`}` as const; + +function ff1(x: 'foo' | 'bar', y: 1 | 2) { + return `${x}-${y}` as const; +} + +function ff2(x: T, y: U) { + return `${x}-${y}` as const; +} + +const ts1 = ff2('foo', 'bar'); +const ts2 = ff2('foo', !!true ? '0' : '1'); +const ts3 = ff2(!!true ? 'top' : 'bottom', !!true ? 'left' : 'right'); + +function ff3(x: 'foo' | 'bar', y: object) { + return `${x}${y}` as const; +} + +type Action = "verify" | "write"; +type ContentMatch = "match" | "nonMatch"; +type Outcome = `${Action}_${ContentMatch}`; + +function ff4(verify: boolean, contentMatches: boolean) { + const action : Action = verify ? `verify` : `write`; + const contentMatch: ContentMatch = contentMatches ? `match` : `nonMatch`; + const outcome: Outcome = `${action}_${contentMatch}` as const; + return outcome; +} + +function ff5(verify: boolean, contentMatches: boolean) { + const action = verify ? `verify` : `write`; + const contentMatch = contentMatches ? `match` : `nonMatch`; + const outcome = `${action}_${contentMatch}` as const; + return outcome; +} + +function accessorNames(propName: S) { + return [`get-${propName}`, `set-${propName}`] as const; +} + +const ns1 = accessorNames('foo'); \ No newline at end of file From 8f9ed58328a928e199f1d14666bd87b2259ab799 Mon Sep 17 00:00:00 2001 From: csigs Date: Wed, 23 Sep 2020 00:10:56 +0000 Subject: [PATCH 023/241] LEGO: check in for master to temporary branch. --- .../diagnosticMessages/diagnosticMessages.generated.json.lcl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index 26e8b80b7b4..60fc9adba5c 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -4902,6 +4902,9 @@ + + + From 9eb6424b8f6244b9a74cbea47c76b209c41b2cef Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Tue, 22 Sep 2020 17:16:09 -0700 Subject: [PATCH 024/241] Fix indentation of arrow functions returning parenthesized expressions (#40677) * Fix indentation of arrow functions returning parenthesized expressions * Add more test cases --- src/harness/fourslashImpl.ts | 3 +- src/services/formatting/smartIndenter.ts | 6 ++- ...ingArrowFunctionParenthesizedExpression.ts | 47 +++++++++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 tests/cases/fourslash/formattingArrowFunctionParenthesizedExpression.ts diff --git a/src/harness/fourslashImpl.ts b/src/harness/fourslashImpl.ts index 299403d8974..a87d0a9e1da 100644 --- a/src/harness/fourslashImpl.ts +++ b/src/harness/fourslashImpl.ts @@ -2461,8 +2461,7 @@ namespace FourSlash { const { fileName } = this.activeFile; const before = this.getFileContent(fileName); this.formatDocument(); - const after = this.getFileContent(fileName); - this.assertObjectsEqual(after, before); + this.verifyFileContent(fileName, before); } public verifyTextAtCaretIs(text: string) { diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 23011643811..b8af97350f7 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -558,11 +558,15 @@ namespace ts.formatting { case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.MethodDeclaration: - case SyntaxKind.ArrowFunction: case SyntaxKind.Constructor: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: return childKind !== SyntaxKind.Block; + case SyntaxKind.ArrowFunction: + if (sourceFile && childKind === SyntaxKind.ParenthesizedExpression) { + return rangeIsOnOneLine(sourceFile, child!); + } + return childKind !== SyntaxKind.Block; case SyntaxKind.ExportDeclaration: return childKind !== SyntaxKind.NamedExports; case SyntaxKind.ImportDeclaration: diff --git a/tests/cases/fourslash/formattingArrowFunctionParenthesizedExpression.ts b/tests/cases/fourslash/formattingArrowFunctionParenthesizedExpression.ts new file mode 100644 index 00000000000..de1021bf1c6 --- /dev/null +++ b/tests/cases/fourslash/formattingArrowFunctionParenthesizedExpression.ts @@ -0,0 +1,47 @@ +/// + +// @Filename: Bar.tsx +//// export const Bar = ({ +//// foo, +//// bar, +//// }: any) => ( +////

Hello world
+//// ) +//// +//// export const Bar2 = ({ +//// foo, +//// bar, +//// }) => (
Hello world
) +//// +//// export const Bar2 = ({ +//// foo, +//// bar, +//// }) =>
Hello world
+//// +//// export const Bar3 = ({ +//// foo, +//// bar, +//// }) => +//// (
Hello world
) +//// +//// export const Bar4 = ({ +//// foo, +//// bar, +//// }) => +////
Hello world
+//// +//// export const Bar5 = () => ( +////
Hello world
+//// ) +//// +//// export const Bar6 = () => (
Hello world
) +//// +//// export const Bar7 = () =>
Hello world
+//// +//// export const Bar8 = () => +//// (
Hello world
) +//// +//// export const Bar9 = () => +////
Hello world
+ +verify.formatDocumentChangesNothing(); From 78830f3be2a2feaff5e29c2bf41aeaec6c03cc30 Mon Sep 17 00:00:00 2001 From: Alex T Date: Wed, 23 Sep 2020 04:17:17 +0300 Subject: [PATCH 025/241] fix(40510): add element access expressions support in convertToOptionalChainExpression (#40524) --- .../convertToOptionalChainExpression.ts | 60 +++++++++++++------ ...hainExpression_ElementAccessExpression1.ts | 18 ++++++ ...hainExpression_ElementAccessExpression2.ts | 18 ++++++ 3 files changed, 77 insertions(+), 19 deletions(-) create mode 100644 tests/cases/fourslash/refactorConvertToOptionalChainExpression_ElementAccessExpression1.ts create mode 100644 tests/cases/fourslash/refactorConvertToOptionalChainExpression_ElementAccessExpression2.ts diff --git a/src/services/refactors/convertToOptionalChainExpression.ts b/src/services/refactors/convertToOptionalChainExpression.ts index 0333506b1e3..52365fc0ba5 100644 --- a/src/services/refactors/convertToOptionalChainExpression.ts +++ b/src/services/refactors/convertToOptionalChainExpression.ts @@ -51,9 +51,11 @@ namespace ts.refactor.convertToOptionalChainExpression { error: string; }; + type Occurrence = PropertyAccessExpression | ElementAccessExpression | Identifier; + interface Info { - finalExpression: PropertyAccessExpression | CallExpression, - occurrences: (PropertyAccessExpression | Identifier)[], + finalExpression: PropertyAccessExpression | ElementAccessExpression | CallExpression, + occurrences: Occurrence[], expression: ValidExpression, }; @@ -107,7 +109,7 @@ namespace ts.refactor.convertToOptionalChainExpression { if (!finalExpression || checker.isNullableType(checker.getTypeAtLocation(finalExpression))) { return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_convertible_access_expression) }; - }; + } if ((isPropertyAccessExpression(condition) || isIdentifier(condition)) && getMatchingStart(condition, finalExpression.expression)) { @@ -136,8 +138,8 @@ namespace ts.refactor.convertToOptionalChainExpression { /** * Gets a list of property accesses that appear in matchTo and occur in sequence in expression. */ - function getOccurrencesInExpression(matchTo: Expression, expression: Expression): (PropertyAccessExpression | Identifier)[] | undefined { - const occurrences: (PropertyAccessExpression | Identifier)[] = []; + function getOccurrencesInExpression(matchTo: Expression, expression: Expression): Occurrence[] | undefined { + const occurrences: Occurrence[] = []; while (isBinaryExpression(expression) && expression.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) { const match = getMatchingStart(skipParentheses(matchTo), skipParentheses(expression.right)); if (!match) { @@ -157,9 +159,11 @@ namespace ts.refactor.convertToOptionalChainExpression { /** * Returns subchain if chain begins with subchain syntactically. */ - function getMatchingStart(chain: Expression, subchain: Expression): PropertyAccessExpression | Identifier | undefined { - return (isIdentifier(subchain) || isPropertyAccessExpression(subchain)) && - chainStartsWith(chain, subchain) ? subchain : undefined; + function getMatchingStart(chain: Expression, subchain: Expression): PropertyAccessExpression | ElementAccessExpression | Identifier | undefined { + if (!isIdentifier(subchain) && !isPropertyAccessExpression(subchain) && !isElementAccessExpression(subchain)) { + return undefined; + } + return chainStartsWith(chain, subchain) ? subchain : undefined; } /** @@ -167,14 +171,14 @@ namespace ts.refactor.convertToOptionalChainExpression { */ function chainStartsWith(chain: Node, subchain: Node): boolean { // skip until we find a matching identifier. - while (isCallExpression(chain) || isPropertyAccessExpression(chain)) { - const subchainName = isPropertyAccessExpression(subchain) ? subchain.name.getText() : subchain.getText(); - if (isPropertyAccessExpression(chain) && chain.name.getText() === subchainName) break; + while (isCallExpression(chain) || isPropertyAccessExpression(chain) || isElementAccessExpression(chain)) { + if (getTextOfChainNode(chain) === getTextOfChainNode(subchain)) break; chain = chain.expression; } - // check that the chains match at each access. Call chains in subchain are not valid. - while (isPropertyAccessExpression(chain) && isPropertyAccessExpression(subchain)) { - if (chain.name.getText() !== subchain.name.getText()) return false; + // check that the chains match at each access. Call chains in subchain are not valid. + while ((isPropertyAccessExpression(chain) && isPropertyAccessExpression(subchain)) || + (isElementAccessExpression(chain) && isElementAccessExpression(subchain))) { + if (getTextOfChainNode(chain) !== getTextOfChainNode(subchain)) return false; chain = chain.expression; subchain = subchain.expression; } @@ -182,6 +186,19 @@ namespace ts.refactor.convertToOptionalChainExpression { return isIdentifier(chain) && isIdentifier(subchain) && chain.getText() === subchain.getText(); } + function getTextOfChainNode(node: Node): string | undefined { + if (isIdentifier(node) || isStringOrNumericLiteralLike(node)) { + return node.getText(); + } + if (isPropertyAccessExpression(node)) { + return getTextOfChainNode(node.name); + } + if (isElementAccessExpression(node)) { + return getTextOfChainNode(node.argumentExpression); + } + return undefined; + } + /** * Find the least ancestor of the input node that is a valid type for extraction and contains the input span. */ @@ -229,7 +246,7 @@ namespace ts.refactor.convertToOptionalChainExpression { * it is followed by a different binary operator. * @param node the right child of a binary expression or a call expression. */ - function getFinalExpressionInChain(node: Expression): CallExpression | PropertyAccessExpression | undefined { + function getFinalExpressionInChain(node: Expression): CallExpression | PropertyAccessExpression | ElementAccessExpression | undefined { // foo && |foo.bar === 1|; - here the right child of the && binary expression is another binary expression. // the rightmost member of the && chain should be the leftmost child of that expression. node = skipParentheses(node); @@ -237,7 +254,7 @@ namespace ts.refactor.convertToOptionalChainExpression { return getFinalExpressionInChain(node.left); } // foo && |foo.bar()()| - nested calls are treated like further accesses. - else if ((isPropertyAccessExpression(node) || isCallExpression(node)) && !isOptionalChain(node)) { + else if ((isPropertyAccessExpression(node) || isElementAccessExpression(node) || isCallExpression(node)) && !isOptionalChain(node)) { return node; } return undefined; @@ -246,8 +263,8 @@ namespace ts.refactor.convertToOptionalChainExpression { /** * Creates an access chain from toConvert with '?.' accesses at expressions appearing in occurrences. */ - function convertOccurrences(checker: TypeChecker, toConvert: Expression, occurrences: (PropertyAccessExpression | Identifier)[]): Expression { - if (isPropertyAccessExpression(toConvert) || isCallExpression(toConvert)) { + function convertOccurrences(checker: TypeChecker, toConvert: Expression, occurrences: Occurrence[]): Expression { + if (isPropertyAccessExpression(toConvert) || isElementAccessExpression(toConvert) || isCallExpression(toConvert)) { const chain = convertOccurrences(checker, toConvert.expression, occurrences); const lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : undefined; const isOccurrence = lastOccurrence?.getText() === toConvert.expression.getText(); @@ -262,6 +279,11 @@ namespace ts.refactor.convertToOptionalChainExpression { factory.createPropertyAccessChain(chain, factory.createToken(SyntaxKind.QuestionDotToken), toConvert.name) : factory.createPropertyAccessChain(chain, toConvert.questionDotToken, toConvert.name); } + else if (isElementAccessExpression(toConvert)) { + return isOccurrence ? + factory.createElementAccessChain(chain, factory.createToken(SyntaxKind.QuestionDotToken), toConvert.argumentExpression) : + factory.createElementAccessChain(chain, toConvert.questionDotToken, toConvert.argumentExpression); + } } return toConvert; } @@ -270,7 +292,7 @@ namespace ts.refactor.convertToOptionalChainExpression { const { finalExpression, occurrences, expression } = info; const firstOccurrence = occurrences[occurrences.length - 1]; const convertedChain = convertOccurrences(checker, finalExpression, occurrences); - if (convertedChain && (isPropertyAccessExpression(convertedChain) || isCallExpression(convertedChain))) { + if (convertedChain && (isPropertyAccessExpression(convertedChain) || isElementAccessExpression(convertedChain) || isCallExpression(convertedChain))) { if (isBinaryExpression(expression)) { changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain); } diff --git a/tests/cases/fourslash/refactorConvertToOptionalChainExpression_ElementAccessExpression1.ts b/tests/cases/fourslash/refactorConvertToOptionalChainExpression_ElementAccessExpression1.ts new file mode 100644 index 00000000000..df11f0e3417 --- /dev/null +++ b/tests/cases/fourslash/refactorConvertToOptionalChainExpression_ElementAccessExpression1.ts @@ -0,0 +1,18 @@ +/// + +////const a = { +//// b: { c: 1 } +////} +/////*a*/a && a['b'] && a['b']['c']/*b*/ + +goTo.select("a", "b"); +edit.applyRefactor({ + refactorName: "Convert to optional chain expression", + actionName: "Convert to optional chain expression", + actionDescription: "Convert to optional chain expression", + newContent: +`const a = { + b: { c: 1 } +} +a?.['b']?.['c']` +}); diff --git a/tests/cases/fourslash/refactorConvertToOptionalChainExpression_ElementAccessExpression2.ts b/tests/cases/fourslash/refactorConvertToOptionalChainExpression_ElementAccessExpression2.ts new file mode 100644 index 00000000000..2460fa86c70 --- /dev/null +++ b/tests/cases/fourslash/refactorConvertToOptionalChainExpression_ElementAccessExpression2.ts @@ -0,0 +1,18 @@ +/// + +////const a = { +//// b: { c: 1 } +////} +/////*a*/a && a.b && a.b['c']/*b*/ + +goTo.select("a", "b"); +edit.applyRefactor({ + refactorName: "Convert to optional chain expression", + actionName: "Convert to optional chain expression", + actionDescription: "Convert to optional chain expression", + newContent: +`const a = { + b: { c: 1 } +} +a?.b?.['c']` +}); From 10b240cde3ab3bfe95fa09275760389c082a4a80 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 22 Sep 2020 21:21:13 -0700 Subject: [PATCH 026/241] Allow an infer type node to resolve its own name (#40483) --- src/compiler/checker.ts | 9 +++ ...declarationEmitShadowingInferNotRenamed.js | 40 +++++++++++++ ...rationEmitShadowingInferNotRenamed.symbols | 58 +++++++++++++++++++ ...larationEmitShadowingInferNotRenamed.types | 40 +++++++++++++ ...declarationEmitShadowingInferNotRenamed.ts | 22 +++++++ 5 files changed, 169 insertions(+) create mode 100644 tests/baselines/reference/declarationEmitShadowingInferNotRenamed.js create mode 100644 tests/baselines/reference/declarationEmitShadowingInferNotRenamed.symbols create mode 100644 tests/baselines/reference/declarationEmitShadowingInferNotRenamed.types create mode 100644 tests/cases/compiler/declarationEmitShadowingInferNotRenamed.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 947ecc6e1ff..2e1ed38efe0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1954,6 +1954,15 @@ namespace ts { } } break; + case SyntaxKind.InferType: + if (meaning & SymbolFlags.TypeParameter) { + const parameterName = (location).typeParameter.name; + if (parameterName && name === parameterName.escapedText) { + result = (location).typeParameter.symbol; + break loop; + } + } + break; } if (isSelfReferenceLocation(location)) { lastSelfReferenceLocation = location; diff --git a/tests/baselines/reference/declarationEmitShadowingInferNotRenamed.js b/tests/baselines/reference/declarationEmitShadowingInferNotRenamed.js new file mode 100644 index 00000000000..d69903c0413 --- /dev/null +++ b/tests/baselines/reference/declarationEmitShadowingInferNotRenamed.js @@ -0,0 +1,40 @@ +//// [declarationEmitShadowingInferNotRenamed.ts] +// Any instance type +type Client = string + +// Modified instance +type UpdatedClient = C & {foo: number} + +export const createClient = < + D extends + | (new (...args: any[]) => Client) // accept class + | Record Client> // or map of classes +>( + clientDef: D +): D extends new (...args: any[]) => infer C + ? UpdatedClient // return instance + : { + [K in keyof D]: D[K] extends new (...args: any[]) => infer C // or map of instances respectively + ? UpdatedClient + : never + } => { + return null as any +} + +//// [declarationEmitShadowingInferNotRenamed.js] +"use strict"; +exports.__esModule = true; +exports.createClient = void 0; +var createClient = function (clientDef) { + return null; +}; +exports.createClient = createClient; + + +//// [declarationEmitShadowingInferNotRenamed.d.ts] +declare type Client = string; +declare type UpdatedClient = C & { + foo: number; +}; +export declare const createClient: Client> | (new (...args: any[]) => Client)>(clientDef: D) => D extends new (...args: any[]) => infer C ? UpdatedClient : { [K in keyof D]: D[K] extends new (...args: any[]) => infer C_1 ? UpdatedClient : never; }; +export {}; diff --git a/tests/baselines/reference/declarationEmitShadowingInferNotRenamed.symbols b/tests/baselines/reference/declarationEmitShadowingInferNotRenamed.symbols new file mode 100644 index 00000000000..923c839a7bc --- /dev/null +++ b/tests/baselines/reference/declarationEmitShadowingInferNotRenamed.symbols @@ -0,0 +1,58 @@ +=== tests/cases/compiler/declarationEmitShadowingInferNotRenamed.ts === +// Any instance type +type Client = string +>Client : Symbol(Client, Decl(declarationEmitShadowingInferNotRenamed.ts, 0, 0)) + +// Modified instance +type UpdatedClient = C & {foo: number} +>UpdatedClient : Symbol(UpdatedClient, Decl(declarationEmitShadowingInferNotRenamed.ts, 1, 20)) +>C : Symbol(C, Decl(declarationEmitShadowingInferNotRenamed.ts, 4, 19)) +>C : Symbol(C, Decl(declarationEmitShadowingInferNotRenamed.ts, 4, 19)) +>foo : Symbol(foo, Decl(declarationEmitShadowingInferNotRenamed.ts, 4, 29)) + +export const createClient = < +>createClient : Symbol(createClient, Decl(declarationEmitShadowingInferNotRenamed.ts, 6, 12)) + + D extends +>D : Symbol(D, Decl(declarationEmitShadowingInferNotRenamed.ts, 6, 29)) + + | (new (...args: any[]) => Client) // accept class +>args : Symbol(args, Decl(declarationEmitShadowingInferNotRenamed.ts, 8, 12)) +>Client : Symbol(Client, Decl(declarationEmitShadowingInferNotRenamed.ts, 0, 0)) + + | Record Client> // or map of classes +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>args : Symbol(args, Decl(declarationEmitShadowingInferNotRenamed.ts, 9, 26)) +>Client : Symbol(Client, Decl(declarationEmitShadowingInferNotRenamed.ts, 0, 0)) + +>( + clientDef: D +>clientDef : Symbol(clientDef, Decl(declarationEmitShadowingInferNotRenamed.ts, 10, 2)) +>D : Symbol(D, Decl(declarationEmitShadowingInferNotRenamed.ts, 6, 29)) + +): D extends new (...args: any[]) => infer C +>D : Symbol(D, Decl(declarationEmitShadowingInferNotRenamed.ts, 6, 29)) +>args : Symbol(args, Decl(declarationEmitShadowingInferNotRenamed.ts, 12, 18)) +>C : Symbol(C, Decl(declarationEmitShadowingInferNotRenamed.ts, 12, 42)) + + ? UpdatedClient // return instance +>UpdatedClient : Symbol(UpdatedClient, Decl(declarationEmitShadowingInferNotRenamed.ts, 1, 20)) +>C : Symbol(C, Decl(declarationEmitShadowingInferNotRenamed.ts, 12, 42)) + + : { + [K in keyof D]: D[K] extends new (...args: any[]) => infer C // or map of instances respectively +>K : Symbol(K, Decl(declarationEmitShadowingInferNotRenamed.ts, 15, 7)) +>D : Symbol(D, Decl(declarationEmitShadowingInferNotRenamed.ts, 6, 29)) +>D : Symbol(D, Decl(declarationEmitShadowingInferNotRenamed.ts, 6, 29)) +>K : Symbol(K, Decl(declarationEmitShadowingInferNotRenamed.ts, 15, 7)) +>args : Symbol(args, Decl(declarationEmitShadowingInferNotRenamed.ts, 15, 40)) +>C : Symbol(C, Decl(declarationEmitShadowingInferNotRenamed.ts, 15, 64)) + + ? UpdatedClient +>UpdatedClient : Symbol(UpdatedClient, Decl(declarationEmitShadowingInferNotRenamed.ts, 1, 20)) +>C : Symbol(C, Decl(declarationEmitShadowingInferNotRenamed.ts, 15, 64)) + + : never + } => { + return null as any +} diff --git a/tests/baselines/reference/declarationEmitShadowingInferNotRenamed.types b/tests/baselines/reference/declarationEmitShadowingInferNotRenamed.types new file mode 100644 index 00000000000..850a5565891 --- /dev/null +++ b/tests/baselines/reference/declarationEmitShadowingInferNotRenamed.types @@ -0,0 +1,40 @@ +=== tests/cases/compiler/declarationEmitShadowingInferNotRenamed.ts === +// Any instance type +type Client = string +>Client : string + +// Modified instance +type UpdatedClient = C & {foo: number} +>UpdatedClient : UpdatedClient +>foo : number + +export const createClient = < +>createClient : Client> | (new (...args: any[]) => Client)>(clientDef: D) => D extends new (...args: any[]) => infer C ? UpdatedClient : { [K in keyof D]: D[K] extends new (...args: any[]) => infer C ? UpdatedClient : never; } +>< D extends | (new (...args: any[]) => Client) // accept class | Record Client> // or map of classes>( clientDef: D): D extends new (...args: any[]) => infer C ? UpdatedClient // return instance : { [K in keyof D]: D[K] extends new (...args: any[]) => infer C // or map of instances respectively ? UpdatedClient : never } => { return null as any} : Client> | (new (...args: any[]) => Client)>(clientDef: D) => D extends new (...args: any[]) => infer C ? UpdatedClient : { [K in keyof D]: D[K] extends new (...args: any[]) => infer C ? UpdatedClient : never; } + + D extends + | (new (...args: any[]) => Client) // accept class +>args : any[] + + | Record Client> // or map of classes +>args : any[] + +>( + clientDef: D +>clientDef : D + +): D extends new (...args: any[]) => infer C +>args : any[] + + ? UpdatedClient // return instance + : { + [K in keyof D]: D[K] extends new (...args: any[]) => infer C // or map of instances respectively +>args : any[] + + ? UpdatedClient + : never + } => { + return null as any +>null as any : any +>null : null +} diff --git a/tests/cases/compiler/declarationEmitShadowingInferNotRenamed.ts b/tests/cases/compiler/declarationEmitShadowingInferNotRenamed.ts new file mode 100644 index 00000000000..ac29eeb9d80 --- /dev/null +++ b/tests/cases/compiler/declarationEmitShadowingInferNotRenamed.ts @@ -0,0 +1,22 @@ +// @declaration: true +// Any instance type +type Client = string + +// Modified instance +type UpdatedClient = C & {foo: number} + +export const createClient = < + D extends + | (new (...args: any[]) => Client) // accept class + | Record Client> // or map of classes +>( + clientDef: D +): D extends new (...args: any[]) => infer C + ? UpdatedClient // return instance + : { + [K in keyof D]: D[K] extends new (...args: any[]) => infer C // or map of instances respectively + ? UpdatedClient + : never + } => { + return null as any +} \ No newline at end of file From 61910e8c97665340e54327ec0ad8e6af0d220fd7 Mon Sep 17 00:00:00 2001 From: uhyo Date: Wed, 23 Sep 2020 16:48:40 +0900 Subject: [PATCH 027/241] Fix missing constraints for parenthesized `infer T` (#40406) * add tests * consider parenthesized types in getInferredTypeParameterConstraint * update tests --- src/compiler/checker.ts | 4 +- src/compiler/utilities.ts | 14 ++++ .../reference/inferTInParentheses.js | 17 +++++ .../reference/inferTInParentheses.symbols | 73 +++++++++++++++++++ .../reference/inferTInParentheses.types | 47 ++++++++++++ tests/cases/compiler/inferTInParentheses.ts | 14 ++++ 6 files changed, 167 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/inferTInParentheses.js create mode 100644 tests/baselines/reference/inferTInParentheses.symbols create mode 100644 tests/baselines/reference/inferTInParentheses.types create mode 100644 tests/cases/compiler/inferTInParentheses.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2e1ed38efe0..cf3827096d7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11941,12 +11941,12 @@ namespace ts { // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. - const grandParent = declaration.parent.parent; + const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent); if (grandParent.kind === SyntaxKind.TypeReference) { const typeReference = grandParent; const typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { - const index = typeReference.typeArguments!.indexOf(declaration.parent); + const index = typeReference.typeArguments!.indexOf(childTypeParameter); if (index < typeParameters.length) { const declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); if (declaredConstraint) { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 973528096a1..531fcafb7f1 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2730,6 +2730,20 @@ namespace ts { return walkUp(node, SyntaxKind.ParenthesizedExpression); } + /** + * Walks up parenthesized types. + * It returns both the outermost parenthesized type and its parent. + * If given node is not a parenthesiezd type, undefined is return as the former. + */ + export function walkUpParenthesizedTypesAndGetParentAndChild(node: Node): [ParenthesizedTypeNode | undefined, Node] { + let child: ParenthesizedTypeNode | undefined; + while (node && node.kind === SyntaxKind.ParenthesizedType) { + child = node; + node = node.parent; + } + return [child, node]; + } + export function skipParentheses(node: Expression): Expression; export function skipParentheses(node: Node): Node; export function skipParentheses(node: Node): Node { diff --git a/tests/baselines/reference/inferTInParentheses.js b/tests/baselines/reference/inferTInParentheses.js new file mode 100644 index 00000000000..f1b9db8e50a --- /dev/null +++ b/tests/baselines/reference/inferTInParentheses.js @@ -0,0 +1,17 @@ +//// [inferTInParentheses.ts] +type F1 = (num: [number]) => void; +type IsNumber = T; + +type T1 = F1 extends (...args: (infer T)) => void ? T : never; +type T2 = F1 extends (args: [...(infer T)]) => void ? T : never; +type T3 = T extends IsNumber<(infer N)> ? true : false; + +type T4 = F1 extends (...args: ((infer T))) => void ? T : never; +type T5 = F1 extends (args: [...((infer T))]) => void ? T : never; +type T6 = T extends IsNumber<((infer N))> ? true : false; + +type T7 = F1 extends (...args: ((((infer T))))) => void ? T : never; +type T8 = F1 extends (args: [...((((infer T))))]) => void ? T : never; +type T9 = T extends IsNumber<((((infer N))))> ? true : false; + +//// [inferTInParentheses.js] diff --git a/tests/baselines/reference/inferTInParentheses.symbols b/tests/baselines/reference/inferTInParentheses.symbols new file mode 100644 index 00000000000..ae3caebe8c8 --- /dev/null +++ b/tests/baselines/reference/inferTInParentheses.symbols @@ -0,0 +1,73 @@ +=== tests/cases/compiler/inferTInParentheses.ts === +type F1 = (num: [number]) => void; +>F1 : Symbol(F1, Decl(inferTInParentheses.ts, 0, 0)) +>num : Symbol(num, Decl(inferTInParentheses.ts, 0, 11)) + +type IsNumber = T; +>IsNumber : Symbol(IsNumber, Decl(inferTInParentheses.ts, 0, 34)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 1, 14)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 1, 14)) + +type T1 = F1 extends (...args: (infer T)) => void ? T : never; +>T1 : Symbol(T1, Decl(inferTInParentheses.ts, 1, 36)) +>F1 : Symbol(F1, Decl(inferTInParentheses.ts, 0, 0)) +>args : Symbol(args, Decl(inferTInParentheses.ts, 3, 22)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 3, 37)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 3, 37)) + +type T2 = F1 extends (args: [...(infer T)]) => void ? T : never; +>T2 : Symbol(T2, Decl(inferTInParentheses.ts, 3, 62)) +>F1 : Symbol(F1, Decl(inferTInParentheses.ts, 0, 0)) +>args : Symbol(args, Decl(inferTInParentheses.ts, 4, 22)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 4, 38)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 4, 38)) + +type T3 = T extends IsNumber<(infer N)> ? true : false; +>T3 : Symbol(T3, Decl(inferTInParentheses.ts, 4, 64)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 5, 8)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 5, 8)) +>IsNumber : Symbol(IsNumber, Decl(inferTInParentheses.ts, 0, 34)) +>N : Symbol(N, Decl(inferTInParentheses.ts, 5, 38)) + +type T4 = F1 extends (...args: ((infer T))) => void ? T : never; +>T4 : Symbol(T4, Decl(inferTInParentheses.ts, 5, 58)) +>F1 : Symbol(F1, Decl(inferTInParentheses.ts, 0, 0)) +>args : Symbol(args, Decl(inferTInParentheses.ts, 7, 22)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 7, 38)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 7, 38)) + +type T5 = F1 extends (args: [...((infer T))]) => void ? T : never; +>T5 : Symbol(T5, Decl(inferTInParentheses.ts, 7, 64)) +>F1 : Symbol(F1, Decl(inferTInParentheses.ts, 0, 0)) +>args : Symbol(args, Decl(inferTInParentheses.ts, 8, 22)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 8, 39)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 8, 39)) + +type T6 = T extends IsNumber<((infer N))> ? true : false; +>T6 : Symbol(T6, Decl(inferTInParentheses.ts, 8, 66)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 9, 8)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 9, 8)) +>IsNumber : Symbol(IsNumber, Decl(inferTInParentheses.ts, 0, 34)) +>N : Symbol(N, Decl(inferTInParentheses.ts, 9, 39)) + +type T7 = F1 extends (...args: ((((infer T))))) => void ? T : never; +>T7 : Symbol(T7, Decl(inferTInParentheses.ts, 9, 60)) +>F1 : Symbol(F1, Decl(inferTInParentheses.ts, 0, 0)) +>args : Symbol(args, Decl(inferTInParentheses.ts, 11, 22)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 11, 40)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 11, 40)) + +type T8 = F1 extends (args: [...((((infer T))))]) => void ? T : never; +>T8 : Symbol(T8, Decl(inferTInParentheses.ts, 11, 68)) +>F1 : Symbol(F1, Decl(inferTInParentheses.ts, 0, 0)) +>args : Symbol(args, Decl(inferTInParentheses.ts, 12, 22)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 12, 41)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 12, 41)) + +type T9 = T extends IsNumber<((((infer N))))> ? true : false; +>T9 : Symbol(T9, Decl(inferTInParentheses.ts, 12, 70)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 13, 8)) +>T : Symbol(T, Decl(inferTInParentheses.ts, 13, 8)) +>IsNumber : Symbol(IsNumber, Decl(inferTInParentheses.ts, 0, 34)) +>N : Symbol(N, Decl(inferTInParentheses.ts, 13, 41)) + diff --git a/tests/baselines/reference/inferTInParentheses.types b/tests/baselines/reference/inferTInParentheses.types new file mode 100644 index 00000000000..c95ebab700a --- /dev/null +++ b/tests/baselines/reference/inferTInParentheses.types @@ -0,0 +1,47 @@ +=== tests/cases/compiler/inferTInParentheses.ts === +type F1 = (num: [number]) => void; +>F1 : F1 +>num : [number] + +type IsNumber = T; +>IsNumber : T + +type T1 = F1 extends (...args: (infer T)) => void ? T : never; +>T1 : [num: [number]] +>args : T + +type T2 = F1 extends (args: [...(infer T)]) => void ? T : never; +>T2 : [number] +>args : [...T] + +type T3 = T extends IsNumber<(infer N)> ? true : false; +>T3 : T3 +>true : true +>false : false + +type T4 = F1 extends (...args: ((infer T))) => void ? T : never; +>T4 : [num: [number]] +>args : T + +type T5 = F1 extends (args: [...((infer T))]) => void ? T : never; +>T5 : [number] +>args : [...T] + +type T6 = T extends IsNumber<((infer N))> ? true : false; +>T6 : T6 +>true : true +>false : false + +type T7 = F1 extends (...args: ((((infer T))))) => void ? T : never; +>T7 : [num: [number]] +>args : T + +type T8 = F1 extends (args: [...((((infer T))))]) => void ? T : never; +>T8 : [number] +>args : [...T] + +type T9 = T extends IsNumber<((((infer N))))> ? true : false; +>T9 : T9 +>true : true +>false : false + diff --git a/tests/cases/compiler/inferTInParentheses.ts b/tests/cases/compiler/inferTInParentheses.ts new file mode 100644 index 00000000000..869583aeac5 --- /dev/null +++ b/tests/cases/compiler/inferTInParentheses.ts @@ -0,0 +1,14 @@ +type F1 = (num: [number]) => void; +type IsNumber = T; + +type T1 = F1 extends (...args: (infer T)) => void ? T : never; +type T2 = F1 extends (args: [...(infer T)]) => void ? T : never; +type T3 = T extends IsNumber<(infer N)> ? true : false; + +type T4 = F1 extends (...args: ((infer T))) => void ? T : never; +type T5 = F1 extends (args: [...((infer T))]) => void ? T : never; +type T6 = T extends IsNumber<((infer N))> ? true : false; + +type T7 = F1 extends (...args: ((((infer T))))) => void ? T : never; +type T8 = F1 extends (args: [...((((infer T))))]) => void ? T : never; +type T9 = T extends IsNumber<((((infer N))))> ? true : false; \ No newline at end of file From 83574ba135c7c21a9d90020365286dd45eecdeda Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 23 Sep 2020 00:49:12 -0700 Subject: [PATCH 028/241] Reorder LKG tasks so protocol build isn't using partial LKG (#40717) * Reorder LKG tasks so protocl build isnt using partial LKG * Update scripts/produceLKG.ts Co-authored-by: Daniel Rosenwasser Co-authored-by: Daniel Rosenwasser --- scripts/produceLKG.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/produceLKG.ts b/scripts/produceLKG.ts index 7439abe9fce..af99441208b 100644 --- a/scripts/produceLKG.ts +++ b/scripts/produceLKG.ts @@ -15,9 +15,9 @@ async function produceLKG() { await copyLibFiles(); await copyLocalizedDiagnostics(); await copyTypesMap(); - await buildProtocol(); await copyScriptOutputs(); await copyDeclarationOutputs(); + await buildProtocol(); await writeGitAttributes(); } From ad2a07440c75c1c481e94d908733e45515bce3ee Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 23 Sep 2020 00:50:12 -0700 Subject: [PATCH 029/241] Fix crash on js declaration emit of export assigned default augmented function (#40596) * Fix crash on js declaration emit of export assigned default augmented function * {sp} --- src/compiler/checker.ts | 16 ++++++------ ...ationsFunctionWithDefaultAssignedMember.js | 21 ++++++++++++++++ ...sFunctionWithDefaultAssignedMember.symbols | 22 ++++++++++++++++ ...onsFunctionWithDefaultAssignedMember.types | 25 +++++++++++++++++++ ...ationsFunctionWithDefaultAssignedMember.ts | 10 ++++++++ 5 files changed, 86 insertions(+), 8 deletions(-) create mode 100644 tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.js create mode 100644 tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.symbols create mode 100644 tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.types create mode 100644 tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionWithDefaultAssignedMember.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cf3827096d7..a131b3c55c2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6896,7 +6896,7 @@ namespace ts { const name = unescapeLeadingUnderscores(symbol.escapedName); const isExportEquals = name === InternalSymbolName.ExportEquals; const isDefault = name === InternalSymbolName.Default; - const isExportAssignment = isExportEquals || isDefault; + const isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault; // synthesize export = ref // ref should refer to either be a locally scoped symbol which we need to emit, or // a reference to another namespace/module which we may need to emit an `import` statement for @@ -6908,8 +6908,8 @@ namespace ts { // In case `target` refers to a namespace member, look at the declaration and serialize the leftmost symbol in it // eg, `namespace A { export class B {} }; exports = A.B;` // Technically, this is all that's required in the case where the assignment is an entity name expression - const expr = isExportAssignment ? getExportAssignmentExpression(aliasDecl as ExportAssignment | BinaryExpression) : getPropertyAssignmentAliasLikeExpression(aliasDecl as ShorthandPropertyAssignment | PropertyAssignment | PropertyAccessExpression); - const first = isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; + const expr = aliasDecl && ((isExportAssignment(aliasDecl) || isBinaryExpression(aliasDecl)) ? getExportAssignmentExpression(aliasDecl) : getPropertyAssignmentAliasLikeExpression(aliasDecl as ShorthandPropertyAssignment | PropertyAssignment | PropertyAccessExpression)); + const first = expr && isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; const referenced = first && resolveEntityName(first, SymbolFlags.All, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, enclosingDeclaration); if (referenced || target) { includePrivateSymbol(referenced || target); @@ -6922,7 +6922,7 @@ namespace ts { // into the containing scope anyway, so we want to skip the visibility checks. const oldTrack = context.tracker.trackSymbol; context.tracker.trackSymbol = noop; - if (isExportAssignment) { + if (isExportAssignmentCompatibleSymbolName) { results.push(factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -6931,11 +6931,11 @@ namespace ts { )); } else { - if (first === expr) { + if (first === expr && first) { // serialize as `export {target as name}` serializeExportSpecifier(name, idText(first)); } - else if (isClassExpression(expr)) { + else if (expr && isClassExpression(expr)) { serializeExportSpecifier(name, getInternalSymbolName(target, symbolName(target))); } else { @@ -6961,7 +6961,7 @@ namespace ts { const typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { // If there are no index signatures and `typeToSerialize` is an object type, emit as a namespace instead of a const - serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignment ? ModifierFlags.None : ModifierFlags.Export); + serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? ModifierFlags.None : ModifierFlags.Export); } else { const statement = factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([ @@ -6974,7 +6974,7 @@ namespace ts { : name === varName ? ModifierFlags.Export : ModifierFlags.None); } - if (isExportAssignment) { + if (isExportAssignmentCompatibleSymbolName) { results.push(factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, diff --git a/tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.js b/tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.js new file mode 100644 index 00000000000..57e0bc27bc4 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.js @@ -0,0 +1,21 @@ +//// [index.js] +function foo() {} + +foo.foo = foo; +foo.default = foo; +module.exports = foo; + +//// [index.js] +function foo() { } +foo.foo = foo; +foo["default"] = foo; +module.exports = foo; + + +//// [index.d.ts] +export = foo; +declare function foo(): void; +declare namespace foo { + export { foo }; + export { foo as default }; +} diff --git a/tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.symbols b/tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.symbols new file mode 100644 index 00000000000..fa5211a26e1 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/jsdoc/declarations/index.js === +function foo() {} +>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14)) + +foo.foo = foo; +>foo.foo : Symbol(foo.foo, Decl(index.js, 0, 17)) +>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14)) +>foo : Symbol(foo.foo, Decl(index.js, 0, 17)) +>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14)) + +foo.default = foo; +>foo.default : Symbol(foo.default, Decl(index.js, 2, 14)) +>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14)) +>default : Symbol(foo.default, Decl(index.js, 2, 14)) +>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14)) + +module.exports = foo; +>module.exports : Symbol("tests/cases/conformance/jsdoc/declarations/index", Decl(index.js, 0, 0)) +>module : Symbol(export=, Decl(index.js, 3, 18)) +>exports : Symbol(export=, Decl(index.js, 3, 18)) +>foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14)) + diff --git a/tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.types b/tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.types new file mode 100644 index 00000000000..00203c61f0e --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsFunctionWithDefaultAssignedMember.types @@ -0,0 +1,25 @@ +=== tests/cases/conformance/jsdoc/declarations/index.js === +function foo() {} +>foo : typeof foo + +foo.foo = foo; +>foo.foo = foo : typeof foo +>foo.foo : typeof foo +>foo : typeof foo +>foo : typeof foo +>foo : typeof foo + +foo.default = foo; +>foo.default = foo : typeof foo +>foo.default : typeof foo +>foo : typeof foo +>default : typeof foo +>foo : typeof foo + +module.exports = foo; +>module.exports = foo : typeof foo +>module.exports : typeof foo +>module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof foo; } +>exports : typeof foo +>foo : typeof foo + diff --git a/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionWithDefaultAssignedMember.ts b/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionWithDefaultAssignedMember.ts new file mode 100644 index 00000000000..21a4e485d1a --- /dev/null +++ b/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionWithDefaultAssignedMember.ts @@ -0,0 +1,10 @@ +// @allowJs: true +// @checkJs: true +// @outDir: ./out +// @declaration: true +// @filename: index.js +function foo() {} + +foo.foo = foo; +foo.default = foo; +module.exports = foo; \ No newline at end of file From a91c2879ef5adf19018b110b28b109da7d3eb4dd Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 23 Sep 2020 00:51:14 -0700 Subject: [PATCH 030/241] Allow discrimination to identical object types when discriminating contextual types (#40574) * Merge identical object types when discriminating contextual types Co-authored-by: Orta * Allow identical discriminants when discriminating, rather than trying to unify identical union members * Fix lint Co-authored-by: Orta --- src/compiler/checker.ts | 12 +++- src/compiler/types.ts | 2 +- ...renceUnionOfObjectsMappedContextualType.js | 25 +++++++++ ...UnionOfObjectsMappedContextualType.symbols | 56 +++++++++++++++++++ ...ceUnionOfObjectsMappedContextualType.types | 50 +++++++++++++++++ ...renceUnionOfObjectsMappedContextualType.ts | 16 ++++++ 6 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.js create mode 100644 tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.symbols create mode 100644 tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.types create mode 100644 tests/cases/compiler/inferenceUnionOfObjectsMappedContextualType.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a131b3c55c2..d6751e97654 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18348,8 +18348,18 @@ namespace ts { } } const match = discriminable.indexOf(/*searchElement*/ true); + if (match === -1) { + return defaultValue; + } // make sure exactly 1 matches before returning it - return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; + let nextMatch = discriminable.indexOf(/*searchElement*/ true, match + 1); + while (nextMatch !== -1) { + if (!isTypeIdenticalTo(target.types[match], target.types[nextMatch])) { + return defaultValue; + } + nextMatch = discriminable.indexOf(/*searchElement*/ true, nextMatch + 1); + } + return target.types[match]; } /** diff --git a/src/compiler/types.ts b/src/compiler/types.ts index fbf308707a1..6448ded8759 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4170,7 +4170,7 @@ namespace ts { export const enum UnionReduction { None = 0, Literal, - Subtype + Subtype, } /* @internal */ diff --git a/tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.js b/tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.js new file mode 100644 index 00000000000..b02b9ddf25d --- /dev/null +++ b/tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.js @@ -0,0 +1,25 @@ +//// [inferenceUnionOfObjectsMappedContextualType.ts] +type Entity = { + someDate: Date | null; +} & ({ id: string; } | { id: number; }) + +type RowRendererMeta = { + [key in keyof TInput]: { key: key; caption: string; formatter?: (value: TInput[key]) => string; }; +} + +type RowRenderer = RowRendererMeta[keyof RowRendererMeta]; + +const test: RowRenderer = { + key: 'someDate', + caption: 'My Date', + formatter: (value) => value ? value.toString() : '-' // value: any +} + + +//// [inferenceUnionOfObjectsMappedContextualType.js] +"use strict"; +var test = { + key: 'someDate', + caption: 'My Date', + formatter: function (value) { return value ? value.toString() : '-'; } // value: any +}; diff --git a/tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.symbols b/tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.symbols new file mode 100644 index 00000000000..08d473b61cd --- /dev/null +++ b/tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/inferenceUnionOfObjectsMappedContextualType.ts === +type Entity = { +>Entity : Symbol(Entity, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 0, 0)) + + someDate: Date | null; +>someDate : Symbol(someDate, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 0, 15)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --)) + +} & ({ id: string; } | { id: number; }) +>id : Symbol(id, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 2, 6)) +>id : Symbol(id, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 2, 24)) + +type RowRendererMeta = { +>RowRendererMeta : Symbol(RowRendererMeta, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 2, 39)) +>TInput : Symbol(TInput, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 4, 21)) + + [key in keyof TInput]: { key: key; caption: string; formatter?: (value: TInput[key]) => string; }; +>key : Symbol(key, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 5, 5)) +>TInput : Symbol(TInput, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 4, 21)) +>key : Symbol(key, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 5, 28)) +>key : Symbol(key, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 5, 5)) +>caption : Symbol(caption, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 5, 38)) +>formatter : Symbol(formatter, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 5, 55)) +>value : Symbol(value, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 5, 69)) +>TInput : Symbol(TInput, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 4, 21)) +>key : Symbol(key, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 5, 5)) +} + +type RowRenderer = RowRendererMeta[keyof RowRendererMeta]; +>RowRenderer : Symbol(RowRenderer, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 6, 1)) +>TInput : Symbol(TInput, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 8, 17)) +>RowRendererMeta : Symbol(RowRendererMeta, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 2, 39)) +>TInput : Symbol(TInput, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 8, 17)) +>RowRendererMeta : Symbol(RowRendererMeta, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 2, 39)) +>TInput : Symbol(TInput, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 8, 17)) + +const test: RowRenderer = { +>test : Symbol(test, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 10, 5)) +>RowRenderer : Symbol(RowRenderer, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 6, 1)) +>Entity : Symbol(Entity, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 0, 0)) + + key: 'someDate', +>key : Symbol(key, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 10, 35)) + + caption: 'My Date', +>caption : Symbol(caption, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 11, 20)) + + formatter: (value) => value ? value.toString() : '-' // value: any +>formatter : Symbol(formatter, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 12, 23)) +>value : Symbol(value, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 13, 16)) +>value : Symbol(value, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 13, 16)) +>value.toString : Symbol(Date.toString, Decl(lib.es5.d.ts, --, --)) +>value : Symbol(value, Decl(inferenceUnionOfObjectsMappedContextualType.ts, 13, 16)) +>toString : Symbol(Date.toString, Decl(lib.es5.d.ts, --, --)) +} + diff --git a/tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.types b/tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.types new file mode 100644 index 00000000000..7a0dc327a49 --- /dev/null +++ b/tests/baselines/reference/inferenceUnionOfObjectsMappedContextualType.types @@ -0,0 +1,50 @@ +=== tests/cases/compiler/inferenceUnionOfObjectsMappedContextualType.ts === +type Entity = { +>Entity : Entity + + someDate: Date | null; +>someDate : Date | null +>null : null + +} & ({ id: string; } | { id: number; }) +>id : string +>id : number + +type RowRendererMeta = { +>RowRendererMeta : RowRendererMeta + + [key in keyof TInput]: { key: key; caption: string; formatter?: (value: TInput[key]) => string; }; +>key : key +>caption : string +>formatter : ((value: TInput[key]) => string) | undefined +>value : TInput[key] +} + +type RowRenderer = RowRendererMeta[keyof RowRendererMeta]; +>RowRenderer : RowRenderer + +const test: RowRenderer = { +>test : RowRenderer +>{ key: 'someDate', caption: 'My Date', formatter: (value) => value ? value.toString() : '-' // value: any} : { key: "someDate"; caption: string; formatter: (value: Date | null) => string; } + + key: 'someDate', +>key : "someDate" +>'someDate' : "someDate" + + caption: 'My Date', +>caption : string +>'My Date' : "My Date" + + formatter: (value) => value ? value.toString() : '-' // value: any +>formatter : (value: Date | null) => string +>(value) => value ? value.toString() : '-' : (value: Date | null) => string +>value : Date | null +>value ? value.toString() : '-' : string +>value : Date | null +>value.toString() : string +>value.toString : () => string +>value : Date +>toString : () => string +>'-' : "-" +} + diff --git a/tests/cases/compiler/inferenceUnionOfObjectsMappedContextualType.ts b/tests/cases/compiler/inferenceUnionOfObjectsMappedContextualType.ts new file mode 100644 index 00000000000..2a91b6fb5f3 --- /dev/null +++ b/tests/cases/compiler/inferenceUnionOfObjectsMappedContextualType.ts @@ -0,0 +1,16 @@ +// @strict: true +type Entity = { + someDate: Date | null; +} & ({ id: string; } | { id: number; }) + +type RowRendererMeta = { + [key in keyof TInput]: { key: key; caption: string; formatter?: (value: TInput[key]) => string; }; +} + +type RowRenderer = RowRendererMeta[keyof RowRendererMeta]; + +const test: RowRenderer = { + key: 'someDate', + caption: 'My Date', + formatter: (value) => value ? value.toString() : '-' // value: any +} From a960463cf3ae379b670e0e3154445d9392c9b667 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 23 Sep 2020 01:08:58 -0700 Subject: [PATCH 031/241] Allow pattern literal types like `http://${string}` to exist and be reasoned about (#40598) * Allow pattern literal types like `http://${string}` to exist and be reasoned about * Allow bigint, number, null, and undefined in template holes * Add test of the trivia case * Handle `any` in template holes, add assignability rules for template -> template relations * Explicitly test concatenated patterns * PR Feedback --- src/compiler/checker.ts | 154 ++++- src/compiler/diagnosticMessages.json | 5 +- src/compiler/types.ts | 2 +- tests/baselines/reference/constAssertions.js | 2 +- .../baselines/reference/constAssertions.types | 6 +- .../templateLiteralTypesPatterns.errors.txt | 335 +++++++++++ .../reference/templateLiteralTypesPatterns.js | 282 +++++++++ .../templateLiteralTypesPatterns.symbols | 395 +++++++++++++ .../templateLiteralTypesPatterns.types | 554 ++++++++++++++++++ .../literal/templateLiteralTypesPatterns.ts | 162 +++++ 10 files changed, 1856 insertions(+), 41 deletions(-) create mode 100644 tests/baselines/reference/templateLiteralTypesPatterns.errors.txt create mode 100644 tests/baselines/reference/templateLiteralTypesPatterns.js create mode 100644 tests/baselines/reference/templateLiteralTypesPatterns.symbols create mode 100644 tests/baselines/reference/templateLiteralTypesPatterns.types create mode 100644 tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d6751e97654..7750d8af73e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -771,7 +771,7 @@ namespace ts { const stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); const keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; const numberOrBigIntType = getUnionType([numberType, bigintType]); - const templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType]); + const templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]) as UnionType; const restrictiveMapper: TypeMapper = makeFunctionTypeMapper(t => t.flags & TypeFlags.TypeParameter ? getRestrictiveTypeParameter(t) : t); const permissiveMapper: TypeMapper = makeFunctionTypeMapper(t => t.flags & TypeFlags.TypeParameter ? wildcardType : t); @@ -13207,6 +13207,30 @@ namespace ts { return true; } + /** + * Returns `true` if the intersection of the template literals and string literals is the empty set, eg `get${string}` & "setX", and should reduce to `never` + */ + function extractRedundantTemplateLiterals(types: Type[]): boolean { + let i = types.length; + const literals = filter(types, t => !!(t.flags & TypeFlags.StringLiteral)); + while (i > 0) { + i--; + const t = types[i]; + if (!(t.flags & TypeFlags.TemplateLiteral)) continue; + for (const t2 of literals) { + if (isTypeSubtypeOf(t2, t)) { + // eg, ``get${T}` & "getX"` is just `"getX"` + orderedRemoveItemAt(types, i); + break; + } + else if (isPatternLiteralType(t)) { + return true; + } + } + } + return false; + } + function extractIrreducible(types: Type[], flag: TypeFlags) { if (every(types, t => !!(t.flags & TypeFlags.Union) && some((t as UnionType).types, tt => !!(tt.flags & flag)))) { for (let i = 0; i < types.length; i++) { @@ -13355,7 +13379,12 @@ namespace ts { } } else { - result = createIntersectionType(typeSet, aliasSymbol, aliasTypeArguments); + if (includes & TypeFlags.TemplateLiteral && includes & TypeFlags.StringLiteral && extractRedundantTemplateLiterals(typeSet)) { + result = neverType; + } + else { + result = createIntersectionType(typeSet, aliasSymbol, aliasTypeArguments); + } } intersectionTypes.set(id, result); } @@ -13531,7 +13560,7 @@ namespace ts { function addSpans(texts: readonly string[], types: readonly Type[]): boolean { for (let i = 0; i < types.length; i++) { const t = types[i]; - if (t.flags & TypeFlags.Literal) { + if (t.flags & (TypeFlags.Literal | TypeFlags.Null | TypeFlags.Undefined)) { text += getTemplateStringForType(t) || ""; text += texts[i + 1]; } @@ -13540,7 +13569,7 @@ namespace ts { if (!addSpans((t).texts, (t).types)) return false; text += texts[i + 1]; } - else if (isGenericIndexType(t)) { + else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) { newTypes.push(t); newTexts.push(text); text = texts[i + 1]; @@ -13558,6 +13587,8 @@ namespace ts { type.flags & TypeFlags.NumberLiteral ? "" + (type).value : type.flags & TypeFlags.BigIntLiteral ? pseudoBigIntToString((type).value) : type.flags & TypeFlags.BooleanLiteral ? (type).intrinsicName : + type.flags & TypeFlags.Null ? "null" : + type.flags & TypeFlags.Undefined ? "undefined" : undefined; } @@ -13817,6 +13848,14 @@ namespace ts { accessNode; } + function isPatternLiteralPlaceholderType(type: Type) { + return templateConstraintType.types.indexOf(type) !== -1 || !!(type.flags & TypeFlags.Any); + } + + function isPatternLiteralType(type: Type) { + return !!(type.flags & TypeFlags.TemplateLiteral) && every((type as TemplateLiteralType).types, isPatternLiteralPlaceholderType); + } + function isGenericObjectType(type: Type): boolean { if (type.flags & TypeFlags.UnionOrIntersection) { if (!((type).objectFlags & ObjectFlags.IsGenericObjectTypeComputed)) { @@ -13836,7 +13875,7 @@ namespace ts { } return !!((type).objectFlags & ObjectFlags.IsGenericIndexType); } - return !!(type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.Index | TypeFlags.TemplateLiteral | TypeFlags.StringMapping)); + return !!(type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.Index | TypeFlags.TemplateLiteral | TypeFlags.StringMapping)) && !isPatternLiteralType(type); } function isThisTypeParameter(type: Type): boolean { @@ -14562,6 +14601,8 @@ namespace ts { return !!(type.flags & TypeFlags.Literal) && (type).freshType === type; } + function getLiteralType(value: string): StringLiteralType; + function getLiteralType(value: string | number | PseudoBigInt, enumId?: number, symbol?: Symbol): LiteralType; function getLiteralType(value: string | number | PseudoBigInt, enumId?: number, symbol?: Symbol) { // We store all literal types in a single map with keys of the form '#NNN' and '@SSS', // where NNN is the text representation of a numeric literal and SSS are the characters @@ -17346,6 +17387,15 @@ namespace ts { } } } + else if (target.flags & TypeFlags.TemplateLiteral && source.flags & TypeFlags.StringLiteral) { + if (isPatternLiteralType(target)) { + // match all non-`string` segments + const result = inferLiteralsFromTemplateLiteralType(source as StringLiteralType, target as TemplateLiteralType); + if (result && every(result, (r, i) => isStringLiteralTypeValueParsableAsType(r, (target as TemplateLiteralType).types[i]))) { + return Ternary.True; + } + } + } if (source.flags & TypeFlags.TypeVariable) { if (source.flags & TypeFlags.IndexedAccess && target.flags & TypeFlags.IndexedAccess) { @@ -17386,8 +17436,15 @@ namespace ts { } } else if (source.flags & TypeFlags.TemplateLiteral) { + if (target.flags & TypeFlags.TemplateLiteral && + (source as TemplateLiteralType).texts.length === (target as TemplateLiteralType).texts.length && + (source as TemplateLiteralType).types.length === (target as TemplateLiteralType).types.length && + every((source as TemplateLiteralType).texts, (t, i) => t === (target as TemplateLiteralType).texts[i]) && + every((instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)) as TemplateLiteralType).types, (t, i) => !!((target as TemplateLiteralType).types[i].flags & (TypeFlags.Any | TypeFlags.String)) || !!isRelatedTo(t, (target as TemplateLiteralType).types[i], /*reportErrors*/ false))) { + return Ternary.True; + } const constraint = getBaseConstraintOfType(source); - if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) { + if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, reportErrors))) { resetErrorInfo(saveErrorInfo); return result; } @@ -18308,12 +18365,12 @@ namespace ts { if (type.flags & TypeFlags.Instantiable) { const constraint = getConstraintOfType(type); - if (constraint) { + if (constraint && constraint !== type) { return typeCouldHaveTopLevelSingletonTypes(constraint); } } - return isUnitType(type); + return isUnitType(type) || !!(type.flags & TypeFlags.TemplateLiteral); } function getBestMatchingType(source: Type, target: UnionOrIntersectionType, isRelatedTo = compareTypesAssignable) { @@ -19693,6 +19750,63 @@ namespace ts { return !!(type.symbol && some(type.symbol.declarations, hasSkipDirectInferenceFlag)); } + function isValidBigIntString(s: string): boolean { + const scanner = createScanner(ScriptTarget.ESNext, /*skipTrivia*/ false); + let success = true; + scanner.setOnError(() => success = false); + scanner.setText(s + "n"); + let result = scanner.scan(); + if (result === SyntaxKind.MinusToken) { + result = scanner.scan(); + } + const flags = scanner.getTokenFlags(); + // validate that + // * scanning proceeded without error + // * a bigint can be scanned, and that when it is scanned, it is + // * the full length of the input string (so the scanner is one character beyond the augmented input length) + // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input) + return success && result === SyntaxKind.BigIntLiteral && scanner.getTextPos() === (s.length + 1) && !(flags & TokenFlags.ContainsSeparator); + } + + function isStringLiteralTypeValueParsableAsType(s: StringLiteralType, target: Type): boolean { + if (target.flags & TypeFlags.Union) { + return !!forEachType(target, t => isStringLiteralTypeValueParsableAsType(s, t)); + } + switch (target) { + case stringType: return true; + case numberType: return s.value !== "" && isFinite(+(s.value)); + case bigintType: return s.value !== "" && isValidBigIntString(s.value); + // the next 4 should be handled in `getTemplateLiteralType`, as they are all exactly one value, but are here for completeness, just in case + // this function is ever used on types which don't come from template literal holes + case trueType: return s.value === "true"; + case falseType: return s.value === "false"; + case undefinedType: return s.value === "undefined"; + case nullType: return s.value === "null"; + default: return !!(target.flags & TypeFlags.Any); + } + } + + function inferLiteralsFromTemplateLiteralType(source: StringLiteralType, target: TemplateLiteralType): StringLiteralType[] | undefined { + const value = source.value; + const texts = target.texts; + const lastIndex = texts.length - 1; + const startText = texts[0]; + const endText = texts[lastIndex]; + if (!(value.startsWith(startText) && value.endsWith(endText))) return undefined; + const matches = []; + const str = value.slice(startText.length, value.length - endText.length); + let pos = 0; + for (let i = 1; i < lastIndex; i++) { + const delim = texts[i]; + const delimPos = delim.length > 0 ? str.indexOf(delim, pos) : pos < str.length ? pos + 1 : -1; + if (delimPos < 0) return undefined; + matches.push(getLiteralType(str.slice(pos, delimPos))); + pos = delimPos + delim.length; + } + matches.push(getLiteralType(str.slice(pos))); + return matches; + } + function inferTypes(inferences: InferenceInfo[], originalSource: Type, originalTarget: Type, priority: InferencePriority = 0, contravariant = false) { let bivariant = false; let propagationType: Type; @@ -20170,27 +20284,6 @@ namespace ts { } } - function inferLiteralsFromTemplateLiteralType(source: StringLiteralType, target: TemplateLiteralType): Type[] | undefined { - const value = source.value; - const texts = target.texts; - const lastIndex = texts.length - 1; - const startText = texts[0]; - const endText = texts[lastIndex]; - if (!(value.startsWith(startText) && value.endsWith(endText))) return undefined; - const matches = []; - const str = value.slice(startText.length, value.length - endText.length); - let pos = 0; - for (let i = 1; i < lastIndex; i++) { - const delim = texts[i]; - const delimPos = delim.length > 0 ? str.indexOf(delim, pos) : pos < str.length ? pos + 1 : -1; - if (delimPos < 0) return undefined; - matches.push(getLiteralType(str.slice(pos, delimPos))); - pos = delimPos + delim.length; - } - matches.push(getLiteralType(str.slice(pos))); - return matches; - } - function inferFromObjectTypes(source: Type, target: Type) { if (getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference && ( (source).target === (target).target || isArrayType(source) && isArrayType(target))) { @@ -31688,9 +31781,6 @@ namespace ts { checkSourceElement(span.type); const type = getTypeFromTypeNode(span.type); checkTypeAssignableTo(type, templateConstraintType, span.type); - if (!everyType(type, t => !!(t.flags & TypeFlags.Literal) || isGenericIndexType(t))) { - error(span.type, Diagnostics.Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type, typeToString(type)); - } } getTypeFromTypeNode(node); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 9e53407c437..f2ea2fc68d6 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3039,10 +3039,7 @@ "category": "Error", "code": 2792 }, - "Template literal type argument '{0}' is not literal type or a generic type.": { - "category": "Error", - "code": 2793 - }, + "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?": { "category": "Error", "code": 2794 diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6448ded8759..a584cf7a099 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4925,7 +4925,7 @@ namespace ts { NotPrimitiveUnion = Any | Unknown | Enum | Void | Never | StructuredOrInstantiable, // The following flags are aggregated during union and intersection type construction /* @internal */ - IncludesMask = Any | Unknown | Primitive | Never | Object | Union | Intersection | NonPrimitive, + IncludesMask = Any | Unknown | Primitive | Never | Object | Union | Intersection | NonPrimitive | TemplateLiteral, // The following flags are used for different purposes during union and intersection type construction /* @internal */ IncludesStructuredOrInstantiable = TypeParameter, diff --git a/tests/baselines/reference/constAssertions.js b/tests/baselines/reference/constAssertions.js index 238d436adaf..5e3b2b8b187 100644 --- a/tests/baselines/reference/constAssertions.js +++ b/tests/baselines/reference/constAssertions.js @@ -303,7 +303,7 @@ declare function ff2(x: T, y: U): `${T}-${U} declare const ts1: "foo-bar"; declare const ts2: "foo-1" | "foo-0"; declare const ts3: "top-left" | "top-right" | "bottom-left" | "bottom-right"; -declare function ff3(x: 'foo' | 'bar', y: object): string; +declare function ff3(x: 'foo' | 'bar', y: object): `foo${string}` | `bar${string}`; declare type Action = "verify" | "write"; declare type ContentMatch = "match" | "nonMatch"; declare type Outcome = `${Action}_${ContentMatch}`; diff --git a/tests/baselines/reference/constAssertions.types b/tests/baselines/reference/constAssertions.types index cdbebebd392..15206af8c0e 100644 --- a/tests/baselines/reference/constAssertions.types +++ b/tests/baselines/reference/constAssertions.types @@ -441,13 +441,13 @@ const ts3 = ff2(!!true ? 'top' : 'bottom', !!true ? 'left' : 'right'); >'right' : "right" function ff3(x: 'foo' | 'bar', y: object) { ->ff3 : (x: 'foo' | 'bar', y: object) => string +>ff3 : (x: 'foo' | 'bar', y: object) => `foo${string}` | `bar${string}` >x : "foo" | "bar" >y : object return `${x}${y}` as const; ->`${x}${y}` as const : string ->`${x}${y}` : string +>`${x}${y}` as const : `foo${string}` | `bar${string}` +>`${x}${y}` : `foo${string}` | `bar${string}` >x : "foo" | "bar" >y : object } diff --git a/tests/baselines/reference/templateLiteralTypesPatterns.errors.txt b/tests/baselines/reference/templateLiteralTypesPatterns.errors.txt new file mode 100644 index 00000000000..de5efa3fe13 --- /dev/null +++ b/tests/baselines/reference/templateLiteralTypesPatterns.errors.txt @@ -0,0 +1,335 @@ +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(7,7): error TS2322: Type '"no slash"' is not assignable to type '`/${string}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(14,10): error TS2345: Argument of type '"example.com/noprotocol"' is not assignable to parameter of type '`http://${string}` | `https://${string}` | `ftp://${string}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(16,10): error TS2345: Argument of type '"gopher://example.com/protocol"' is not assignable to parameter of type '`http://${string}` | `https://${string}` | `ftp://${string}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(26,7): error TS2345: Argument of type '"other"' is not assignable to parameter of type '"false" | "true"'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(35,11): error TS2345: Argument of type '"0"' is not assignable to parameter of type '"undefined" | "null"'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(36,11): error TS2345: Argument of type '"false"' is not assignable to parameter of type '"undefined" | "null"'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(37,11): error TS2345: Argument of type '"NaN"' is not assignable to parameter of type '"undefined" | "null"'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(38,11): error TS2345: Argument of type '""' is not assignable to parameter of type '"undefined" | "null"'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(39,11): error TS2345: Argument of type '"other"' is not assignable to parameter of type '"undefined" | "null"'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(60,9): error TS2345: Argument of type '"?"' is not assignable to parameter of type '`${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(61,9): error TS2345: Argument of type '"NaN"' is not assignable to parameter of type '`${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(62,9): error TS2345: Argument of type '"Infinity"' is not assignable to parameter of type '`${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(63,9): error TS2345: Argument of type '"+Infinity"' is not assignable to parameter of type '`${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(64,9): error TS2345: Argument of type '"-Infinity"' is not assignable to parameter of type '`${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(65,9): error TS2345: Argument of type '"1_000"' is not assignable to parameter of type '`${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(68,9): error TS2345: Argument of type '"a10"' is not assignable to parameter of type '`${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(69,9): error TS2345: Argument of type '"10a"' is not assignable to parameter of type '`${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(72,9): error TS2345: Argument of type '"- 1"' is not assignable to parameter of type '`${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(73,9): error TS2345: Argument of type '"-/**/1"' is not assignable to parameter of type '`${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(85,9): error TS2345: Argument of type '"1e21"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(86,9): error TS2345: Argument of type '"1E21"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(87,9): error TS2345: Argument of type '"1e-21"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(88,9): error TS2345: Argument of type '"1E-21"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(91,9): error TS2345: Argument of type '"1.0"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(92,9): error TS2345: Argument of type '"1.1"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(93,9): error TS2345: Argument of type '"-1.1"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(94,9): error TS2345: Argument of type '"-1.1e-10"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(95,9): error TS2345: Argument of type '"-1.1E-10"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(96,9): error TS2345: Argument of type '"1.1e-10"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(99,9): error TS2345: Argument of type '"?"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(100,9): error TS2345: Argument of type '"NaN"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(101,9): error TS2345: Argument of type '"Infinity"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(102,9): error TS2345: Argument of type '"+Infinity"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(103,9): error TS2345: Argument of type '"-Infinity"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(104,9): error TS2345: Argument of type '"1_000"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(107,9): error TS2345: Argument of type '"- 1"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(108,9): error TS2345: Argument of type '"-/**/1"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(111,9): error TS2345: Argument of type '"a10n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(112,9): error TS2345: Argument of type '"10an"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(115,9): error TS2345: Argument of type '"1n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(116,9): error TS2345: Argument of type '"-1n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(117,9): error TS2345: Argument of type '"0n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(118,9): error TS2345: Argument of type '"0b1n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(119,9): error TS2345: Argument of type '"0x1n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(120,9): error TS2345: Argument of type '"0o1n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(121,9): error TS2345: Argument of type '"1e21n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(122,9): error TS2345: Argument of type '"1E21n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(123,9): error TS2345: Argument of type '"1e-21n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(124,9): error TS2345: Argument of type '"1E-21n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(125,9): error TS2345: Argument of type '"1.1n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(126,9): error TS2345: Argument of type '"-1.1n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(127,9): error TS2345: Argument of type '"-1.1e-10n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(128,9): error TS2345: Argument of type '"-1.1E-10n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(129,9): error TS2345: Argument of type '"1.1e-10n"' is not assignable to parameter of type '`${bigint}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(140,1): error TS2322: Type '`a${string}`' is not assignable to type '`a${number}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(141,1): error TS2322: Type '"bno"' is not assignable to type '`a${any}`'. +tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts(160,7): error TS2322: Type '"anything"' is not assignable to type '`${number} ${number}`'. + + +==== tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts (57 errors) ==== + type RequiresLeadingSlash = `/${string}`; + + // ok + const a: RequiresLeadingSlash = "/bin"; + + // not ok + const b: RequiresLeadingSlash = "no slash"; + ~ +!!! error TS2322: Type '"no slash"' is not assignable to type '`/${string}`'. + + type Protocol = `${T}://${U}`; + function download(hostSpec: Protocol<"http" | "https" | "ftp", string>) { } + // ok, has protocol + download("http://example.com/protocol"); + // issues error - no protocol + download("example.com/noprotocol"); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '"example.com/noprotocol"' is not assignable to parameter of type '`http://${string}` | `https://${string}` | `ftp://${string}`'. + // issues error, incorrect protocol + download("gopher://example.com/protocol"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '"gopher://example.com/protocol"' is not assignable to parameter of type '`http://${string}` | `https://${string}` | `ftp://${string}`'. + + const q: RequiresLeadingSlash extends string ? true : false = true; + + declare function bools(x: `${boolean}`): void; + // ok + bools("true"); + bools("false"); + + // not ok + bools("other"); + ~~~~~~~ +!!! error TS2345: Argument of type '"other"' is not assignable to parameter of type '"false" | "true"'. + + type Pat = `${T}` + declare function nullishes(x: Pat): void; + // ok + nullishes("null"); + nullishes("undefined"); + + // not ok + nullishes("0"); + ~~~ +!!! error TS2345: Argument of type '"0"' is not assignable to parameter of type '"undefined" | "null"'. + nullishes("false"); + ~~~~~~~ +!!! error TS2345: Argument of type '"false"' is not assignable to parameter of type '"undefined" | "null"'. + nullishes("NaN"); + ~~~~~ +!!! error TS2345: Argument of type '"NaN"' is not assignable to parameter of type '"undefined" | "null"'. + nullishes(""); + ~~ +!!! error TS2345: Argument of type '""' is not assignable to parameter of type '"undefined" | "null"'. + nullishes("other"); + ~~~~~~~ +!!! error TS2345: Argument of type '"other"' is not assignable to parameter of type '"undefined" | "null"'. + + declare function numbers(x: `${number}`): void; + // the following should work + numbers("1"); + numbers("-1"); + numbers("0"); + numbers("0b1"); + numbers("0x1"); + numbers("0o1"); + numbers("1e21"); + numbers("1E21"); + numbers("1e-21"); + numbers("1E-21"); + numbers("1.1"); + numbers("-1.1"); + numbers("-1.1e-10"); + numbers("-1.1E-10"); + numbers("1.1e-10"); + + // the following should be errors since they're not numbers + numbers("?"); + ~~~ +!!! error TS2345: Argument of type '"?"' is not assignable to parameter of type '`${number}`'. + numbers("NaN"); + ~~~~~ +!!! error TS2345: Argument of type '"NaN"' is not assignable to parameter of type '`${number}`'. + numbers("Infinity"); + ~~~~~~~~~~ +!!! error TS2345: Argument of type '"Infinity"' is not assignable to parameter of type '`${number}`'. + numbers("+Infinity"); + ~~~~~~~~~~~ +!!! error TS2345: Argument of type '"+Infinity"' is not assignable to parameter of type '`${number}`'. + numbers("-Infinity"); + ~~~~~~~~~~~ +!!! error TS2345: Argument of type '"-Infinity"' is not assignable to parameter of type '`${number}`'. + numbers("1_000"); + ~~~~~~~ +!!! error TS2345: Argument of type '"1_000"' is not assignable to parameter of type '`${number}`'. + + // the following should be errors since they don't match the pattern + numbers("a10"); + ~~~~~ +!!! error TS2345: Argument of type '"a10"' is not assignable to parameter of type '`${number}`'. + numbers("10a"); + ~~~~~ +!!! error TS2345: Argument of type '"10a"' is not assignable to parameter of type '`${number}`'. + + // whitespace and comments aren't part of numbers + numbers("- 1"); + ~~~~~ +!!! error TS2345: Argument of type '"- 1"' is not assignable to parameter of type '`${number}`'. + numbers("-/**/1"); + ~~~~~~~~ +!!! error TS2345: Argument of type '"-/**/1"' is not assignable to parameter of type '`${number}`'. + + declare function bigints(x: `${bigint}`): void; + // the following should work + bigints("1"); + bigints("-1"); + bigints("0"); + bigints("0b1"); + bigints("0x1"); + bigints("0o1"); + + // bigints do not allow scientific notation in their parsing/scanning, so these are all errors + bigints("1e21"); + ~~~~~~ +!!! error TS2345: Argument of type '"1e21"' is not assignable to parameter of type '`${bigint}`'. + bigints("1E21"); + ~~~~~~ +!!! error TS2345: Argument of type '"1E21"' is not assignable to parameter of type '`${bigint}`'. + bigints("1e-21"); + ~~~~~~~ +!!! error TS2345: Argument of type '"1e-21"' is not assignable to parameter of type '`${bigint}`'. + bigints("1E-21"); + ~~~~~~~ +!!! error TS2345: Argument of type '"1E-21"' is not assignable to parameter of type '`${bigint}`'. + + // these are all errors because they're not big_int_s + bigints("1.0"); + ~~~~~ +!!! error TS2345: Argument of type '"1.0"' is not assignable to parameter of type '`${bigint}`'. + bigints("1.1"); + ~~~~~ +!!! error TS2345: Argument of type '"1.1"' is not assignable to parameter of type '`${bigint}`'. + bigints("-1.1"); + ~~~~~~ +!!! error TS2345: Argument of type '"-1.1"' is not assignable to parameter of type '`${bigint}`'. + bigints("-1.1e-10"); + ~~~~~~~~~~ +!!! error TS2345: Argument of type '"-1.1e-10"' is not assignable to parameter of type '`${bigint}`'. + bigints("-1.1E-10"); + ~~~~~~~~~~ +!!! error TS2345: Argument of type '"-1.1E-10"' is not assignable to parameter of type '`${bigint}`'. + bigints("1.1e-10"); + ~~~~~~~~~ +!!! error TS2345: Argument of type '"1.1e-10"' is not assignable to parameter of type '`${bigint}`'. + + // the following should be errors since they're not numbers + bigints("?"); + ~~~ +!!! error TS2345: Argument of type '"?"' is not assignable to parameter of type '`${bigint}`'. + bigints("NaN"); + ~~~~~ +!!! error TS2345: Argument of type '"NaN"' is not assignable to parameter of type '`${bigint}`'. + bigints("Infinity"); + ~~~~~~~~~~ +!!! error TS2345: Argument of type '"Infinity"' is not assignable to parameter of type '`${bigint}`'. + bigints("+Infinity"); + ~~~~~~~~~~~ +!!! error TS2345: Argument of type '"+Infinity"' is not assignable to parameter of type '`${bigint}`'. + bigints("-Infinity"); + ~~~~~~~~~~~ +!!! error TS2345: Argument of type '"-Infinity"' is not assignable to parameter of type '`${bigint}`'. + bigints("1_000"); + ~~~~~~~ +!!! error TS2345: Argument of type '"1_000"' is not assignable to parameter of type '`${bigint}`'. + + // whitespace and comments aren't part of numbers + bigints("- 1"); + ~~~~~ +!!! error TS2345: Argument of type '"- 1"' is not assignable to parameter of type '`${bigint}`'. + bigints("-/**/1"); + ~~~~~~~~ +!!! error TS2345: Argument of type '"-/**/1"' is not assignable to parameter of type '`${bigint}`'. + + // the following should be errors since they don't match the pattern + bigints("a10n"); + ~~~~~~ +!!! error TS2345: Argument of type '"a10n"' is not assignable to parameter of type '`${bigint}`'. + bigints("10an"); + ~~~~~~ +!!! error TS2345: Argument of type '"10an"' is not assignable to parameter of type '`${bigint}`'. + + // the following should all be errors because the `BigInt` constructor (and thus bigint parsing) doesn't take the trailing `n` used in literals + bigints("1n"); + ~~~~ +!!! error TS2345: Argument of type '"1n"' is not assignable to parameter of type '`${bigint}`'. + bigints("-1n"); + ~~~~~ +!!! error TS2345: Argument of type '"-1n"' is not assignable to parameter of type '`${bigint}`'. + bigints("0n"); + ~~~~ +!!! error TS2345: Argument of type '"0n"' is not assignable to parameter of type '`${bigint}`'. + bigints("0b1n"); + ~~~~~~ +!!! error TS2345: Argument of type '"0b1n"' is not assignable to parameter of type '`${bigint}`'. + bigints("0x1n"); + ~~~~~~ +!!! error TS2345: Argument of type '"0x1n"' is not assignable to parameter of type '`${bigint}`'. + bigints("0o1n"); + ~~~~~~ +!!! error TS2345: Argument of type '"0o1n"' is not assignable to parameter of type '`${bigint}`'. + bigints("1e21n"); + ~~~~~~~ +!!! error TS2345: Argument of type '"1e21n"' is not assignable to parameter of type '`${bigint}`'. + bigints("1E21n"); + ~~~~~~~ +!!! error TS2345: Argument of type '"1E21n"' is not assignable to parameter of type '`${bigint}`'. + bigints("1e-21n"); + ~~~~~~~~ +!!! error TS2345: Argument of type '"1e-21n"' is not assignable to parameter of type '`${bigint}`'. + bigints("1E-21n"); + ~~~~~~~~ +!!! error TS2345: Argument of type '"1E-21n"' is not assignable to parameter of type '`${bigint}`'. + bigints("1.1n"); + ~~~~~~ +!!! error TS2345: Argument of type '"1.1n"' is not assignable to parameter of type '`${bigint}`'. + bigints("-1.1n"); + ~~~~~~~ +!!! error TS2345: Argument of type '"-1.1n"' is not assignable to parameter of type '`${bigint}`'. + bigints("-1.1e-10n"); + ~~~~~~~~~~~ +!!! error TS2345: Argument of type '"-1.1e-10n"' is not assignable to parameter of type '`${bigint}`'. + bigints("-1.1E-10n"); + ~~~~~~~~~~~ +!!! error TS2345: Argument of type '"-1.1E-10n"' is not assignable to parameter of type '`${bigint}`'. + bigints("1.1e-10n"); + ~~~~~~~~~~ +!!! error TS2345: Argument of type '"1.1e-10n"' is not assignable to parameter of type '`${bigint}`'. + + type AStr = `a${string}`; + type ANum = `a${number}`; + type AAny = `a${any}`; + + declare var str: AStr; + declare var num: ANum; + declare var anyish: AAny; + + // not ok + num = str; + ~~~ +!!! error TS2322: Type '`a${string}`' is not assignable to type '`a${number}`'. + anyish = `bno` + ~~~~~~ +!!! error TS2322: Type '"bno"' is not assignable to type '`a${any}`'. + + // ok + str = num; + anyish = str; + str = anyish; + anyish = num; + num = anyish; + anyish = `aok` + + + // Validates variance isn't measured as strictly covariant + type AGen = {field: `a${T}`}; + const shouldWork1: AGen = null as any as AGen<"yes">; + const shouldWork2: AGen = null as any as AGen; + + // validates concatenation of patterns + type A = `${number}`; + type B = `${A} ${A}`; + const exampleBad: B = "anything"; // fails + ~~~~~~~~~~ +!!! error TS2322: Type '"anything"' is not assignable to type '`${number} ${number}`'. + const exampleGood: B = "1 2"; // ok \ No newline at end of file diff --git a/tests/baselines/reference/templateLiteralTypesPatterns.js b/tests/baselines/reference/templateLiteralTypesPatterns.js new file mode 100644 index 00000000000..51fdba1113c --- /dev/null +++ b/tests/baselines/reference/templateLiteralTypesPatterns.js @@ -0,0 +1,282 @@ +//// [templateLiteralTypesPatterns.ts] +type RequiresLeadingSlash = `/${string}`; + +// ok +const a: RequiresLeadingSlash = "/bin"; + +// not ok +const b: RequiresLeadingSlash = "no slash"; + +type Protocol = `${T}://${U}`; +function download(hostSpec: Protocol<"http" | "https" | "ftp", string>) { } +// ok, has protocol +download("http://example.com/protocol"); +// issues error - no protocol +download("example.com/noprotocol"); +// issues error, incorrect protocol +download("gopher://example.com/protocol"); + +const q: RequiresLeadingSlash extends string ? true : false = true; + +declare function bools(x: `${boolean}`): void; +// ok +bools("true"); +bools("false"); + +// not ok +bools("other"); + +type Pat = `${T}` +declare function nullishes(x: Pat): void; +// ok +nullishes("null"); +nullishes("undefined"); + +// not ok +nullishes("0"); +nullishes("false"); +nullishes("NaN"); +nullishes(""); +nullishes("other"); + +declare function numbers(x: `${number}`): void; +// the following should work +numbers("1"); +numbers("-1"); +numbers("0"); +numbers("0b1"); +numbers("0x1"); +numbers("0o1"); +numbers("1e21"); +numbers("1E21"); +numbers("1e-21"); +numbers("1E-21"); +numbers("1.1"); +numbers("-1.1"); +numbers("-1.1e-10"); +numbers("-1.1E-10"); +numbers("1.1e-10"); + +// the following should be errors since they're not numbers +numbers("?"); +numbers("NaN"); +numbers("Infinity"); +numbers("+Infinity"); +numbers("-Infinity"); +numbers("1_000"); + +// the following should be errors since they don't match the pattern +numbers("a10"); +numbers("10a"); + +// whitespace and comments aren't part of numbers +numbers("- 1"); +numbers("-/**/1"); + +declare function bigints(x: `${bigint}`): void; +// the following should work +bigints("1"); +bigints("-1"); +bigints("0"); +bigints("0b1"); +bigints("0x1"); +bigints("0o1"); + +// bigints do not allow scientific notation in their parsing/scanning, so these are all errors +bigints("1e21"); +bigints("1E21"); +bigints("1e-21"); +bigints("1E-21"); + +// these are all errors because they're not big_int_s +bigints("1.0"); +bigints("1.1"); +bigints("-1.1"); +bigints("-1.1e-10"); +bigints("-1.1E-10"); +bigints("1.1e-10"); + +// the following should be errors since they're not numbers +bigints("?"); +bigints("NaN"); +bigints("Infinity"); +bigints("+Infinity"); +bigints("-Infinity"); +bigints("1_000"); + +// whitespace and comments aren't part of numbers +bigints("- 1"); +bigints("-/**/1"); + +// the following should be errors since they don't match the pattern +bigints("a10n"); +bigints("10an"); + +// the following should all be errors because the `BigInt` constructor (and thus bigint parsing) doesn't take the trailing `n` used in literals +bigints("1n"); +bigints("-1n"); +bigints("0n"); +bigints("0b1n"); +bigints("0x1n"); +bigints("0o1n"); +bigints("1e21n"); +bigints("1E21n"); +bigints("1e-21n"); +bigints("1E-21n"); +bigints("1.1n"); +bigints("-1.1n"); +bigints("-1.1e-10n"); +bigints("-1.1E-10n"); +bigints("1.1e-10n"); + +type AStr = `a${string}`; +type ANum = `a${number}`; +type AAny = `a${any}`; + +declare var str: AStr; +declare var num: ANum; +declare var anyish: AAny; + +// not ok +num = str; +anyish = `bno` + +// ok +str = num; +anyish = str; +str = anyish; +anyish = num; +num = anyish; +anyish = `aok` + + +// Validates variance isn't measured as strictly covariant +type AGen = {field: `a${T}`}; +const shouldWork1: AGen = null as any as AGen<"yes">; +const shouldWork2: AGen = null as any as AGen; + +// validates concatenation of patterns +type A = `${number}`; +type B = `${A} ${A}`; +const exampleBad: B = "anything"; // fails +const exampleGood: B = "1 2"; // ok + +//// [templateLiteralTypesPatterns.js] +"use strict"; +// ok +var a = "/bin"; +// not ok +var b = "no slash"; +function download(hostSpec) { } +// ok, has protocol +download("http://example.com/protocol"); +// issues error - no protocol +download("example.com/noprotocol"); +// issues error, incorrect protocol +download("gopher://example.com/protocol"); +var q = true; +// ok +bools("true"); +bools("false"); +// not ok +bools("other"); +// ok +nullishes("null"); +nullishes("undefined"); +// not ok +nullishes("0"); +nullishes("false"); +nullishes("NaN"); +nullishes(""); +nullishes("other"); +// the following should work +numbers("1"); +numbers("-1"); +numbers("0"); +numbers("0b1"); +numbers("0x1"); +numbers("0o1"); +numbers("1e21"); +numbers("1E21"); +numbers("1e-21"); +numbers("1E-21"); +numbers("1.1"); +numbers("-1.1"); +numbers("-1.1e-10"); +numbers("-1.1E-10"); +numbers("1.1e-10"); +// the following should be errors since they're not numbers +numbers("?"); +numbers("NaN"); +numbers("Infinity"); +numbers("+Infinity"); +numbers("-Infinity"); +numbers("1_000"); +// the following should be errors since they don't match the pattern +numbers("a10"); +numbers("10a"); +// whitespace and comments aren't part of numbers +numbers("- 1"); +numbers("-/**/1"); +// the following should work +bigints("1"); +bigints("-1"); +bigints("0"); +bigints("0b1"); +bigints("0x1"); +bigints("0o1"); +// bigints do not allow scientific notation in their parsing/scanning, so these are all errors +bigints("1e21"); +bigints("1E21"); +bigints("1e-21"); +bigints("1E-21"); +// these are all errors because they're not big_int_s +bigints("1.0"); +bigints("1.1"); +bigints("-1.1"); +bigints("-1.1e-10"); +bigints("-1.1E-10"); +bigints("1.1e-10"); +// the following should be errors since they're not numbers +bigints("?"); +bigints("NaN"); +bigints("Infinity"); +bigints("+Infinity"); +bigints("-Infinity"); +bigints("1_000"); +// whitespace and comments aren't part of numbers +bigints("- 1"); +bigints("-/**/1"); +// the following should be errors since they don't match the pattern +bigints("a10n"); +bigints("10an"); +// the following should all be errors because the `BigInt` constructor (and thus bigint parsing) doesn't take the trailing `n` used in literals +bigints("1n"); +bigints("-1n"); +bigints("0n"); +bigints("0b1n"); +bigints("0x1n"); +bigints("0o1n"); +bigints("1e21n"); +bigints("1E21n"); +bigints("1e-21n"); +bigints("1E-21n"); +bigints("1.1n"); +bigints("-1.1n"); +bigints("-1.1e-10n"); +bigints("-1.1E-10n"); +bigints("1.1e-10n"); +// not ok +num = str; +anyish = "bno"; +// ok +str = num; +anyish = str; +str = anyish; +anyish = num; +num = anyish; +anyish = "aok"; +var shouldWork1 = null; +var shouldWork2 = null; +var exampleBad = "anything"; // fails +var exampleGood = "1 2"; // ok diff --git a/tests/baselines/reference/templateLiteralTypesPatterns.symbols b/tests/baselines/reference/templateLiteralTypesPatterns.symbols new file mode 100644 index 00000000000..51810c9959e --- /dev/null +++ b/tests/baselines/reference/templateLiteralTypesPatterns.symbols @@ -0,0 +1,395 @@ +=== tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts === +type RequiresLeadingSlash = `/${string}`; +>RequiresLeadingSlash : Symbol(RequiresLeadingSlash, Decl(templateLiteralTypesPatterns.ts, 0, 0)) + +// ok +const a: RequiresLeadingSlash = "/bin"; +>a : Symbol(a, Decl(templateLiteralTypesPatterns.ts, 3, 5)) +>RequiresLeadingSlash : Symbol(RequiresLeadingSlash, Decl(templateLiteralTypesPatterns.ts, 0, 0)) + +// not ok +const b: RequiresLeadingSlash = "no slash"; +>b : Symbol(b, Decl(templateLiteralTypesPatterns.ts, 6, 5)) +>RequiresLeadingSlash : Symbol(RequiresLeadingSlash, Decl(templateLiteralTypesPatterns.ts, 0, 0)) + +type Protocol = `${T}://${U}`; +>Protocol : Symbol(Protocol, Decl(templateLiteralTypesPatterns.ts, 6, 43)) +>T : Symbol(T, Decl(templateLiteralTypesPatterns.ts, 8, 14)) +>U : Symbol(U, Decl(templateLiteralTypesPatterns.ts, 8, 31)) +>T : Symbol(T, Decl(templateLiteralTypesPatterns.ts, 8, 14)) +>U : Symbol(U, Decl(templateLiteralTypesPatterns.ts, 8, 31)) + +function download(hostSpec: Protocol<"http" | "https" | "ftp", string>) { } +>download : Symbol(download, Decl(templateLiteralTypesPatterns.ts, 8, 66)) +>hostSpec : Symbol(hostSpec, Decl(templateLiteralTypesPatterns.ts, 9, 18)) +>Protocol : Symbol(Protocol, Decl(templateLiteralTypesPatterns.ts, 6, 43)) + +// ok, has protocol +download("http://example.com/protocol"); +>download : Symbol(download, Decl(templateLiteralTypesPatterns.ts, 8, 66)) + +// issues error - no protocol +download("example.com/noprotocol"); +>download : Symbol(download, Decl(templateLiteralTypesPatterns.ts, 8, 66)) + +// issues error, incorrect protocol +download("gopher://example.com/protocol"); +>download : Symbol(download, Decl(templateLiteralTypesPatterns.ts, 8, 66)) + +const q: RequiresLeadingSlash extends string ? true : false = true; +>q : Symbol(q, Decl(templateLiteralTypesPatterns.ts, 17, 5)) +>RequiresLeadingSlash : Symbol(RequiresLeadingSlash, Decl(templateLiteralTypesPatterns.ts, 0, 0)) + +declare function bools(x: `${boolean}`): void; +>bools : Symbol(bools, Decl(templateLiteralTypesPatterns.ts, 17, 67)) +>x : Symbol(x, Decl(templateLiteralTypesPatterns.ts, 19, 23)) + +// ok +bools("true"); +>bools : Symbol(bools, Decl(templateLiteralTypesPatterns.ts, 17, 67)) + +bools("false"); +>bools : Symbol(bools, Decl(templateLiteralTypesPatterns.ts, 17, 67)) + +// not ok +bools("other"); +>bools : Symbol(bools, Decl(templateLiteralTypesPatterns.ts, 17, 67)) + +type Pat = `${T}` +>Pat : Symbol(Pat, Decl(templateLiteralTypesPatterns.ts, 25, 15)) +>T : Symbol(T, Decl(templateLiteralTypesPatterns.ts, 27, 9)) +>T : Symbol(T, Decl(templateLiteralTypesPatterns.ts, 27, 9)) + +declare function nullishes(x: Pat): void; +>nullishes : Symbol(nullishes, Decl(templateLiteralTypesPatterns.ts, 27, 54)) +>x : Symbol(x, Decl(templateLiteralTypesPatterns.ts, 28, 27)) +>Pat : Symbol(Pat, Decl(templateLiteralTypesPatterns.ts, 25, 15)) + +// ok +nullishes("null"); +>nullishes : Symbol(nullishes, Decl(templateLiteralTypesPatterns.ts, 27, 54)) + +nullishes("undefined"); +>nullishes : Symbol(nullishes, Decl(templateLiteralTypesPatterns.ts, 27, 54)) + +// not ok +nullishes("0"); +>nullishes : Symbol(nullishes, Decl(templateLiteralTypesPatterns.ts, 27, 54)) + +nullishes("false"); +>nullishes : Symbol(nullishes, Decl(templateLiteralTypesPatterns.ts, 27, 54)) + +nullishes("NaN"); +>nullishes : Symbol(nullishes, Decl(templateLiteralTypesPatterns.ts, 27, 54)) + +nullishes(""); +>nullishes : Symbol(nullishes, Decl(templateLiteralTypesPatterns.ts, 27, 54)) + +nullishes("other"); +>nullishes : Symbol(nullishes, Decl(templateLiteralTypesPatterns.ts, 27, 54)) + +declare function numbers(x: `${number}`): void; +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) +>x : Symbol(x, Decl(templateLiteralTypesPatterns.ts, 40, 25)) + +// the following should work +numbers("1"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("-1"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("0"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("0b1"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("0x1"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("0o1"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("1e21"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("1E21"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("1e-21"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("1E-21"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("1.1"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("-1.1"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("-1.1e-10"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("-1.1E-10"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("1.1e-10"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +// the following should be errors since they're not numbers +numbers("?"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("NaN"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("Infinity"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("+Infinity"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("-Infinity"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("1_000"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +// the following should be errors since they don't match the pattern +numbers("a10"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("10a"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +// whitespace and comments aren't part of numbers +numbers("- 1"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +numbers("-/**/1"); +>numbers : Symbol(numbers, Decl(templateLiteralTypesPatterns.ts, 38, 19)) + +declare function bigints(x: `${bigint}`): void; +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) +>x : Symbol(x, Decl(templateLiteralTypesPatterns.ts, 74, 25)) + +// the following should work +bigints("1"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("-1"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("0"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("0b1"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("0x1"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("0o1"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +// bigints do not allow scientific notation in their parsing/scanning, so these are all errors +bigints("1e21"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1E21"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1e-21"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1E-21"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +// these are all errors because they're not big_int_s +bigints("1.0"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1.1"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("-1.1"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("-1.1e-10"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("-1.1E-10"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1.1e-10"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +// the following should be errors since they're not numbers +bigints("?"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("NaN"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("Infinity"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("+Infinity"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("-Infinity"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1_000"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +// whitespace and comments aren't part of numbers +bigints("- 1"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("-/**/1"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +// the following should be errors since they don't match the pattern +bigints("a10n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("10an"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +// the following should all be errors because the `BigInt` constructor (and thus bigint parsing) doesn't take the trailing `n` used in literals +bigints("1n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("-1n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("0n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("0b1n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("0x1n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("0o1n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1e21n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1E21n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1e-21n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1E-21n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1.1n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("-1.1n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("-1.1e-10n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("-1.1E-10n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +bigints("1.1e-10n"); +>bigints : Symbol(bigints, Decl(templateLiteralTypesPatterns.ts, 72, 18)) + +type AStr = `a${string}`; +>AStr : Symbol(AStr, Decl(templateLiteralTypesPatterns.ts, 128, 20)) + +type ANum = `a${number}`; +>ANum : Symbol(ANum, Decl(templateLiteralTypesPatterns.ts, 130, 25)) + +type AAny = `a${any}`; +>AAny : Symbol(AAny, Decl(templateLiteralTypesPatterns.ts, 131, 25)) + +declare var str: AStr; +>str : Symbol(str, Decl(templateLiteralTypesPatterns.ts, 134, 11)) +>AStr : Symbol(AStr, Decl(templateLiteralTypesPatterns.ts, 128, 20)) + +declare var num: ANum; +>num : Symbol(num, Decl(templateLiteralTypesPatterns.ts, 135, 11)) +>ANum : Symbol(ANum, Decl(templateLiteralTypesPatterns.ts, 130, 25)) + +declare var anyish: AAny; +>anyish : Symbol(anyish, Decl(templateLiteralTypesPatterns.ts, 136, 11)) +>AAny : Symbol(AAny, Decl(templateLiteralTypesPatterns.ts, 131, 25)) + +// not ok +num = str; +>num : Symbol(num, Decl(templateLiteralTypesPatterns.ts, 135, 11)) +>str : Symbol(str, Decl(templateLiteralTypesPatterns.ts, 134, 11)) + +anyish = `bno` +>anyish : Symbol(anyish, Decl(templateLiteralTypesPatterns.ts, 136, 11)) + +// ok +str = num; +>str : Symbol(str, Decl(templateLiteralTypesPatterns.ts, 134, 11)) +>num : Symbol(num, Decl(templateLiteralTypesPatterns.ts, 135, 11)) + +anyish = str; +>anyish : Symbol(anyish, Decl(templateLiteralTypesPatterns.ts, 136, 11)) +>str : Symbol(str, Decl(templateLiteralTypesPatterns.ts, 134, 11)) + +str = anyish; +>str : Symbol(str, Decl(templateLiteralTypesPatterns.ts, 134, 11)) +>anyish : Symbol(anyish, Decl(templateLiteralTypesPatterns.ts, 136, 11)) + +anyish = num; +>anyish : Symbol(anyish, Decl(templateLiteralTypesPatterns.ts, 136, 11)) +>num : Symbol(num, Decl(templateLiteralTypesPatterns.ts, 135, 11)) + +num = anyish; +>num : Symbol(num, Decl(templateLiteralTypesPatterns.ts, 135, 11)) +>anyish : Symbol(anyish, Decl(templateLiteralTypesPatterns.ts, 136, 11)) + +anyish = `aok` +>anyish : Symbol(anyish, Decl(templateLiteralTypesPatterns.ts, 136, 11)) + + +// Validates variance isn't measured as strictly covariant +type AGen = {field: `a${T}`}; +>AGen : Symbol(AGen, Decl(templateLiteralTypesPatterns.ts, 148, 14)) +>T : Symbol(T, Decl(templateLiteralTypesPatterns.ts, 152, 10)) +>field : Symbol(field, Decl(templateLiteralTypesPatterns.ts, 152, 40)) +>T : Symbol(T, Decl(templateLiteralTypesPatterns.ts, 152, 10)) + +const shouldWork1: AGen = null as any as AGen<"yes">; +>shouldWork1 : Symbol(shouldWork1, Decl(templateLiteralTypesPatterns.ts, 153, 5)) +>AGen : Symbol(AGen, Decl(templateLiteralTypesPatterns.ts, 148, 14)) +>AGen : Symbol(AGen, Decl(templateLiteralTypesPatterns.ts, 148, 14)) + +const shouldWork2: AGen = null as any as AGen; +>shouldWork2 : Symbol(shouldWork2, Decl(templateLiteralTypesPatterns.ts, 154, 5)) +>AGen : Symbol(AGen, Decl(templateLiteralTypesPatterns.ts, 148, 14)) +>AGen : Symbol(AGen, Decl(templateLiteralTypesPatterns.ts, 148, 14)) + +// validates concatenation of patterns +type A = `${number}`; +>A : Symbol(A, Decl(templateLiteralTypesPatterns.ts, 154, 62)) + +type B = `${A} ${A}`; +>B : Symbol(B, Decl(templateLiteralTypesPatterns.ts, 157, 21)) +>A : Symbol(A, Decl(templateLiteralTypesPatterns.ts, 154, 62)) +>A : Symbol(A, Decl(templateLiteralTypesPatterns.ts, 154, 62)) + +const exampleBad: B = "anything"; // fails +>exampleBad : Symbol(exampleBad, Decl(templateLiteralTypesPatterns.ts, 159, 5)) +>B : Symbol(B, Decl(templateLiteralTypesPatterns.ts, 157, 21)) + +const exampleGood: B = "1 2"; // ok +>exampleGood : Symbol(exampleGood, Decl(templateLiteralTypesPatterns.ts, 160, 5)) +>B : Symbol(B, Decl(templateLiteralTypesPatterns.ts, 157, 21)) + diff --git a/tests/baselines/reference/templateLiteralTypesPatterns.types b/tests/baselines/reference/templateLiteralTypesPatterns.types new file mode 100644 index 00000000000..02dc985ee5b --- /dev/null +++ b/tests/baselines/reference/templateLiteralTypesPatterns.types @@ -0,0 +1,554 @@ +=== tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts === +type RequiresLeadingSlash = `/${string}`; +>RequiresLeadingSlash : `/${string}` + +// ok +const a: RequiresLeadingSlash = "/bin"; +>a : `/${string}` +>"/bin" : "/bin" + +// not ok +const b: RequiresLeadingSlash = "no slash"; +>b : `/${string}` +>"no slash" : "no slash" + +type Protocol = `${T}://${U}`; +>Protocol : `${T}://${U}` + +function download(hostSpec: Protocol<"http" | "https" | "ftp", string>) { } +>download : (hostSpec: Protocol<"http" | "https" | "ftp", string>) => void +>hostSpec : `http://${string}` | `https://${string}` | `ftp://${string}` + +// ok, has protocol +download("http://example.com/protocol"); +>download("http://example.com/protocol") : void +>download : (hostSpec: `http://${string}` | `https://${string}` | `ftp://${string}`) => void +>"http://example.com/protocol" : "http://example.com/protocol" + +// issues error - no protocol +download("example.com/noprotocol"); +>download("example.com/noprotocol") : void +>download : (hostSpec: `http://${string}` | `https://${string}` | `ftp://${string}`) => void +>"example.com/noprotocol" : "example.com/noprotocol" + +// issues error, incorrect protocol +download("gopher://example.com/protocol"); +>download("gopher://example.com/protocol") : void +>download : (hostSpec: `http://${string}` | `https://${string}` | `ftp://${string}`) => void +>"gopher://example.com/protocol" : "gopher://example.com/protocol" + +const q: RequiresLeadingSlash extends string ? true : false = true; +>q : true +>true : true +>false : false +>true : true + +declare function bools(x: `${boolean}`): void; +>bools : (x: `${boolean}`) => void +>x : "false" | "true" + +// ok +bools("true"); +>bools("true") : void +>bools : (x: "false" | "true") => void +>"true" : "true" + +bools("false"); +>bools("false") : void +>bools : (x: "false" | "true") => void +>"false" : "false" + +// not ok +bools("other"); +>bools("other") : void +>bools : (x: "false" | "true") => void +>"other" : "other" + +type Pat = `${T}` +>Pat : `${T}` +>null : null + +declare function nullishes(x: Pat): void; +>nullishes : (x: Pat) => void +>x : "undefined" | "null" +>null : null + +// ok +nullishes("null"); +>nullishes("null") : void +>nullishes : (x: "undefined" | "null") => void +>"null" : "null" + +nullishes("undefined"); +>nullishes("undefined") : void +>nullishes : (x: "undefined" | "null") => void +>"undefined" : "undefined" + +// not ok +nullishes("0"); +>nullishes("0") : void +>nullishes : (x: "undefined" | "null") => void +>"0" : "0" + +nullishes("false"); +>nullishes("false") : void +>nullishes : (x: "undefined" | "null") => void +>"false" : "false" + +nullishes("NaN"); +>nullishes("NaN") : void +>nullishes : (x: "undefined" | "null") => void +>"NaN" : "NaN" + +nullishes(""); +>nullishes("") : void +>nullishes : (x: "undefined" | "null") => void +>"" : "" + +nullishes("other"); +>nullishes("other") : void +>nullishes : (x: "undefined" | "null") => void +>"other" : "other" + +declare function numbers(x: `${number}`): void; +>numbers : (x: `${number}`) => void +>x : `${number}` + +// the following should work +numbers("1"); +>numbers("1") : void +>numbers : (x: `${number}`) => void +>"1" : "1" + +numbers("-1"); +>numbers("-1") : void +>numbers : (x: `${number}`) => void +>"-1" : "-1" + +numbers("0"); +>numbers("0") : void +>numbers : (x: `${number}`) => void +>"0" : "0" + +numbers("0b1"); +>numbers("0b1") : void +>numbers : (x: `${number}`) => void +>"0b1" : "0b1" + +numbers("0x1"); +>numbers("0x1") : void +>numbers : (x: `${number}`) => void +>"0x1" : "0x1" + +numbers("0o1"); +>numbers("0o1") : void +>numbers : (x: `${number}`) => void +>"0o1" : "0o1" + +numbers("1e21"); +>numbers("1e21") : void +>numbers : (x: `${number}`) => void +>"1e21" : "1e21" + +numbers("1E21"); +>numbers("1E21") : void +>numbers : (x: `${number}`) => void +>"1E21" : "1E21" + +numbers("1e-21"); +>numbers("1e-21") : void +>numbers : (x: `${number}`) => void +>"1e-21" : "1e-21" + +numbers("1E-21"); +>numbers("1E-21") : void +>numbers : (x: `${number}`) => void +>"1E-21" : "1E-21" + +numbers("1.1"); +>numbers("1.1") : void +>numbers : (x: `${number}`) => void +>"1.1" : "1.1" + +numbers("-1.1"); +>numbers("-1.1") : void +>numbers : (x: `${number}`) => void +>"-1.1" : "-1.1" + +numbers("-1.1e-10"); +>numbers("-1.1e-10") : void +>numbers : (x: `${number}`) => void +>"-1.1e-10" : "-1.1e-10" + +numbers("-1.1E-10"); +>numbers("-1.1E-10") : void +>numbers : (x: `${number}`) => void +>"-1.1E-10" : "-1.1E-10" + +numbers("1.1e-10"); +>numbers("1.1e-10") : void +>numbers : (x: `${number}`) => void +>"1.1e-10" : "1.1e-10" + +// the following should be errors since they're not numbers +numbers("?"); +>numbers("?") : void +>numbers : (x: `${number}`) => void +>"?" : "?" + +numbers("NaN"); +>numbers("NaN") : void +>numbers : (x: `${number}`) => void +>"NaN" : "NaN" + +numbers("Infinity"); +>numbers("Infinity") : void +>numbers : (x: `${number}`) => void +>"Infinity" : "Infinity" + +numbers("+Infinity"); +>numbers("+Infinity") : void +>numbers : (x: `${number}`) => void +>"+Infinity" : "+Infinity" + +numbers("-Infinity"); +>numbers("-Infinity") : void +>numbers : (x: `${number}`) => void +>"-Infinity" : "-Infinity" + +numbers("1_000"); +>numbers("1_000") : void +>numbers : (x: `${number}`) => void +>"1_000" : "1_000" + +// the following should be errors since they don't match the pattern +numbers("a10"); +>numbers("a10") : void +>numbers : (x: `${number}`) => void +>"a10" : "a10" + +numbers("10a"); +>numbers("10a") : void +>numbers : (x: `${number}`) => void +>"10a" : "10a" + +// whitespace and comments aren't part of numbers +numbers("- 1"); +>numbers("- 1") : void +>numbers : (x: `${number}`) => void +>"- 1" : "- 1" + +numbers("-/**/1"); +>numbers("-/**/1") : void +>numbers : (x: `${number}`) => void +>"-/**/1" : "-/**/1" + +declare function bigints(x: `${bigint}`): void; +>bigints : (x: `${bigint}`) => void +>x : `${bigint}` + +// the following should work +bigints("1"); +>bigints("1") : void +>bigints : (x: `${bigint}`) => void +>"1" : "1" + +bigints("-1"); +>bigints("-1") : void +>bigints : (x: `${bigint}`) => void +>"-1" : "-1" + +bigints("0"); +>bigints("0") : void +>bigints : (x: `${bigint}`) => void +>"0" : "0" + +bigints("0b1"); +>bigints("0b1") : void +>bigints : (x: `${bigint}`) => void +>"0b1" : "0b1" + +bigints("0x1"); +>bigints("0x1") : void +>bigints : (x: `${bigint}`) => void +>"0x1" : "0x1" + +bigints("0o1"); +>bigints("0o1") : void +>bigints : (x: `${bigint}`) => void +>"0o1" : "0o1" + +// bigints do not allow scientific notation in their parsing/scanning, so these are all errors +bigints("1e21"); +>bigints("1e21") : void +>bigints : (x: `${bigint}`) => void +>"1e21" : "1e21" + +bigints("1E21"); +>bigints("1E21") : void +>bigints : (x: `${bigint}`) => void +>"1E21" : "1E21" + +bigints("1e-21"); +>bigints("1e-21") : void +>bigints : (x: `${bigint}`) => void +>"1e-21" : "1e-21" + +bigints("1E-21"); +>bigints("1E-21") : void +>bigints : (x: `${bigint}`) => void +>"1E-21" : "1E-21" + +// these are all errors because they're not big_int_s +bigints("1.0"); +>bigints("1.0") : void +>bigints : (x: `${bigint}`) => void +>"1.0" : "1.0" + +bigints("1.1"); +>bigints("1.1") : void +>bigints : (x: `${bigint}`) => void +>"1.1" : "1.1" + +bigints("-1.1"); +>bigints("-1.1") : void +>bigints : (x: `${bigint}`) => void +>"-1.1" : "-1.1" + +bigints("-1.1e-10"); +>bigints("-1.1e-10") : void +>bigints : (x: `${bigint}`) => void +>"-1.1e-10" : "-1.1e-10" + +bigints("-1.1E-10"); +>bigints("-1.1E-10") : void +>bigints : (x: `${bigint}`) => void +>"-1.1E-10" : "-1.1E-10" + +bigints("1.1e-10"); +>bigints("1.1e-10") : void +>bigints : (x: `${bigint}`) => void +>"1.1e-10" : "1.1e-10" + +// the following should be errors since they're not numbers +bigints("?"); +>bigints("?") : void +>bigints : (x: `${bigint}`) => void +>"?" : "?" + +bigints("NaN"); +>bigints("NaN") : void +>bigints : (x: `${bigint}`) => void +>"NaN" : "NaN" + +bigints("Infinity"); +>bigints("Infinity") : void +>bigints : (x: `${bigint}`) => void +>"Infinity" : "Infinity" + +bigints("+Infinity"); +>bigints("+Infinity") : void +>bigints : (x: `${bigint}`) => void +>"+Infinity" : "+Infinity" + +bigints("-Infinity"); +>bigints("-Infinity") : void +>bigints : (x: `${bigint}`) => void +>"-Infinity" : "-Infinity" + +bigints("1_000"); +>bigints("1_000") : void +>bigints : (x: `${bigint}`) => void +>"1_000" : "1_000" + +// whitespace and comments aren't part of numbers +bigints("- 1"); +>bigints("- 1") : void +>bigints : (x: `${bigint}`) => void +>"- 1" : "- 1" + +bigints("-/**/1"); +>bigints("-/**/1") : void +>bigints : (x: `${bigint}`) => void +>"-/**/1" : "-/**/1" + +// the following should be errors since they don't match the pattern +bigints("a10n"); +>bigints("a10n") : void +>bigints : (x: `${bigint}`) => void +>"a10n" : "a10n" + +bigints("10an"); +>bigints("10an") : void +>bigints : (x: `${bigint}`) => void +>"10an" : "10an" + +// the following should all be errors because the `BigInt` constructor (and thus bigint parsing) doesn't take the trailing `n` used in literals +bigints("1n"); +>bigints("1n") : void +>bigints : (x: `${bigint}`) => void +>"1n" : "1n" + +bigints("-1n"); +>bigints("-1n") : void +>bigints : (x: `${bigint}`) => void +>"-1n" : "-1n" + +bigints("0n"); +>bigints("0n") : void +>bigints : (x: `${bigint}`) => void +>"0n" : "0n" + +bigints("0b1n"); +>bigints("0b1n") : void +>bigints : (x: `${bigint}`) => void +>"0b1n" : "0b1n" + +bigints("0x1n"); +>bigints("0x1n") : void +>bigints : (x: `${bigint}`) => void +>"0x1n" : "0x1n" + +bigints("0o1n"); +>bigints("0o1n") : void +>bigints : (x: `${bigint}`) => void +>"0o1n" : "0o1n" + +bigints("1e21n"); +>bigints("1e21n") : void +>bigints : (x: `${bigint}`) => void +>"1e21n" : "1e21n" + +bigints("1E21n"); +>bigints("1E21n") : void +>bigints : (x: `${bigint}`) => void +>"1E21n" : "1E21n" + +bigints("1e-21n"); +>bigints("1e-21n") : void +>bigints : (x: `${bigint}`) => void +>"1e-21n" : "1e-21n" + +bigints("1E-21n"); +>bigints("1E-21n") : void +>bigints : (x: `${bigint}`) => void +>"1E-21n" : "1E-21n" + +bigints("1.1n"); +>bigints("1.1n") : void +>bigints : (x: `${bigint}`) => void +>"1.1n" : "1.1n" + +bigints("-1.1n"); +>bigints("-1.1n") : void +>bigints : (x: `${bigint}`) => void +>"-1.1n" : "-1.1n" + +bigints("-1.1e-10n"); +>bigints("-1.1e-10n") : void +>bigints : (x: `${bigint}`) => void +>"-1.1e-10n" : "-1.1e-10n" + +bigints("-1.1E-10n"); +>bigints("-1.1E-10n") : void +>bigints : (x: `${bigint}`) => void +>"-1.1E-10n" : "-1.1E-10n" + +bigints("1.1e-10n"); +>bigints("1.1e-10n") : void +>bigints : (x: `${bigint}`) => void +>"1.1e-10n" : "1.1e-10n" + +type AStr = `a${string}`; +>AStr : `a${string}` + +type ANum = `a${number}`; +>ANum : `a${number}` + +type AAny = `a${any}`; +>AAny : `a${any}` + +declare var str: AStr; +>str : `a${string}` + +declare var num: ANum; +>num : `a${number}` + +declare var anyish: AAny; +>anyish : `a${any}` + +// not ok +num = str; +>num = str : `a${string}` +>num : `a${number}` +>str : `a${string}` + +anyish = `bno` +>anyish = `bno` : "bno" +>anyish : `a${any}` +>`bno` : "bno" + +// ok +str = num; +>str = num : `a${number}` +>str : `a${string}` +>num : `a${number}` + +anyish = str; +>anyish = str : `a${string}` +>anyish : `a${any}` +>str : `a${string}` + +str = anyish; +>str = anyish : `a${any}` +>str : `a${string}` +>anyish : `a${any}` + +anyish = num; +>anyish = num : `a${number}` +>anyish : `a${any}` +>num : `a${number}` + +num = anyish; +>num = anyish : `a${any}` +>num : `a${number}` +>anyish : `a${any}` + +anyish = `aok` +>anyish = `aok` : "aok" +>anyish : `a${any}` +>`aok` : "aok" + + +// Validates variance isn't measured as strictly covariant +type AGen = {field: `a${T}`}; +>AGen : AGen +>field : `a${T}` + +const shouldWork1: AGen = null as any as AGen<"yes">; +>shouldWork1 : AGen +>null as any as AGen<"yes"> : AGen<"yes"> +>null as any : any +>null : null + +const shouldWork2: AGen = null as any as AGen; +>shouldWork2 : AGen +>null as any as AGen : AGen +>null as any : any +>null : null + +// validates concatenation of patterns +type A = `${number}`; +>A : `${number}` + +type B = `${A} ${A}`; +>B : `${number} ${number}` + +const exampleBad: B = "anything"; // fails +>exampleBad : `${number} ${number}` +>"anything" : "anything" + +const exampleGood: B = "1 2"; // ok +>exampleGood : `${number} ${number}` +>"1 2" : "1 2" + diff --git a/tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts b/tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts new file mode 100644 index 00000000000..064fb5b06d6 --- /dev/null +++ b/tests/cases/conformance/types/literal/templateLiteralTypesPatterns.ts @@ -0,0 +1,162 @@ +// @strict: true +type RequiresLeadingSlash = `/${string}`; + +// ok +const a: RequiresLeadingSlash = "/bin"; + +// not ok +const b: RequiresLeadingSlash = "no slash"; + +type Protocol = `${T}://${U}`; +function download(hostSpec: Protocol<"http" | "https" | "ftp", string>) { } +// ok, has protocol +download("http://example.com/protocol"); +// issues error - no protocol +download("example.com/noprotocol"); +// issues error, incorrect protocol +download("gopher://example.com/protocol"); + +const q: RequiresLeadingSlash extends string ? true : false = true; + +declare function bools(x: `${boolean}`): void; +// ok +bools("true"); +bools("false"); + +// not ok +bools("other"); + +type Pat = `${T}` +declare function nullishes(x: Pat): void; +// ok +nullishes("null"); +nullishes("undefined"); + +// not ok +nullishes("0"); +nullishes("false"); +nullishes("NaN"); +nullishes(""); +nullishes("other"); + +declare function numbers(x: `${number}`): void; +// the following should work +numbers("1"); +numbers("-1"); +numbers("0"); +numbers("0b1"); +numbers("0x1"); +numbers("0o1"); +numbers("1e21"); +numbers("1E21"); +numbers("1e-21"); +numbers("1E-21"); +numbers("1.1"); +numbers("-1.1"); +numbers("-1.1e-10"); +numbers("-1.1E-10"); +numbers("1.1e-10"); + +// the following should be errors since they're not numbers +numbers("?"); +numbers("NaN"); +numbers("Infinity"); +numbers("+Infinity"); +numbers("-Infinity"); +numbers("1_000"); + +// the following should be errors since they don't match the pattern +numbers("a10"); +numbers("10a"); + +// whitespace and comments aren't part of numbers +numbers("- 1"); +numbers("-/**/1"); + +declare function bigints(x: `${bigint}`): void; +// the following should work +bigints("1"); +bigints("-1"); +bigints("0"); +bigints("0b1"); +bigints("0x1"); +bigints("0o1"); + +// bigints do not allow scientific notation in their parsing/scanning, so these are all errors +bigints("1e21"); +bigints("1E21"); +bigints("1e-21"); +bigints("1E-21"); + +// these are all errors because they're not big_int_s +bigints("1.0"); +bigints("1.1"); +bigints("-1.1"); +bigints("-1.1e-10"); +bigints("-1.1E-10"); +bigints("1.1e-10"); + +// the following should be errors since they're not numbers +bigints("?"); +bigints("NaN"); +bigints("Infinity"); +bigints("+Infinity"); +bigints("-Infinity"); +bigints("1_000"); + +// whitespace and comments aren't part of numbers +bigints("- 1"); +bigints("-/**/1"); + +// the following should be errors since they don't match the pattern +bigints("a10n"); +bigints("10an"); + +// the following should all be errors because the `BigInt` constructor (and thus bigint parsing) doesn't take the trailing `n` used in literals +bigints("1n"); +bigints("-1n"); +bigints("0n"); +bigints("0b1n"); +bigints("0x1n"); +bigints("0o1n"); +bigints("1e21n"); +bigints("1E21n"); +bigints("1e-21n"); +bigints("1E-21n"); +bigints("1.1n"); +bigints("-1.1n"); +bigints("-1.1e-10n"); +bigints("-1.1E-10n"); +bigints("1.1e-10n"); + +type AStr = `a${string}`; +type ANum = `a${number}`; +type AAny = `a${any}`; + +declare var str: AStr; +declare var num: ANum; +declare var anyish: AAny; + +// not ok +num = str; +anyish = `bno` + +// ok +str = num; +anyish = str; +str = anyish; +anyish = num; +num = anyish; +anyish = `aok` + + +// Validates variance isn't measured as strictly covariant +type AGen = {field: `a${T}`}; +const shouldWork1: AGen = null as any as AGen<"yes">; +const shouldWork2: AGen = null as any as AGen; + +// validates concatenation of patterns +type A = `${number}`; +type B = `${A} ${A}`; +const exampleBad: B = "anything"; // fails +const exampleGood: B = "1 2"; // ok \ No newline at end of file From 5305e4a44e4e08c911d181e207602bd4cf335ba1 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 23 Sep 2020 08:57:11 -0700 Subject: [PATCH 032/241] Fix spec links in README (#40711) * Fix spec links in README I forgot to update them. * specify that the spec is archived --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb0452217c1..c3e5c9ccb18 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob * Help each other in the [TypeScript Community Discord](https://discord.gg/typescript). * Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter. * [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md). -* Read the language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true), - [pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)). +* Read the archived language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.docx?raw=true), + [pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec-archived.md)). This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) From a1a9d6d2f8a626af64435c42b577937c37d3377e Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 24 Sep 2020 09:24:06 -0700 Subject: [PATCH 033/241] Update user baselines +cc @sandersn (#40156) Co-authored-by: typescript-bot --- .../baselines/reference/docker/azure-sdk.log | 60 +- .../reference/docker/office-ui-fabric.log | 2686 ++++++++++++++++- tests/baselines/reference/docker/vue-next.log | 76 +- .../user/TypeScript-React-Starter.log | 8 + .../reference/user/adonis-framework.log | 9 +- tests/baselines/reference/user/async.log | 104 + tests/baselines/reference/user/axios-src.log | 2 +- .../user/chrome-devtools-frontend.log | 2120 ++----------- tests/baselines/reference/user/debug.log | 18 +- tests/baselines/reference/user/lodash.log | 2 +- tests/baselines/reference/user/npm.log | 1768 ++++++----- tests/baselines/reference/user/npmlog.log | 2 +- tests/baselines/reference/user/prettier.log | 63 +- tests/baselines/reference/user/puppeteer.log | 7 + tests/baselines/reference/user/uglify-js.log | 369 +-- tests/baselines/reference/user/webpack.log | 211 +- 16 files changed, 4188 insertions(+), 3317 deletions(-) create mode 100644 tests/baselines/reference/user/TypeScript-React-Starter.log create mode 100644 tests/baselines/reference/user/puppeteer.log diff --git a/tests/baselines/reference/docker/azure-sdk.log b/tests/baselines/reference/docker/azure-sdk.log index 545849521bc..f8e59ce4c87 100644 --- a/tests/baselines/reference/docker/azure-sdk.log +++ b/tests/baselines/reference/docker/azure-sdk.log @@ -2,49 +2,55 @@ Exit Code: 1 Standard output: Rush Multi-Project Build Tool 5.X.X - https://rushjs.io -Node.js version is 14.8.0 (pre-LTS) +Node.js version is 14.11.0 (pre-LTS) Starting "rush rebuild" Executing a maximum of ?simultaneous processes... -XX of XX: [@azure/abort-controller] completed successfully in ? seconds XX of XX: [@azure/logger] completed successfully in ? seconds -XX of XX: [@azure/core-asynciterator-polyfill] completed successfully in ? seconds -XX of XX: [@azure/core-paging] completed successfully in ? seconds -SUCCESS (4) +SUCCESS (1) ================================ -@azure/abort-controller (? seconds) @azure/logger (? seconds) -@azure/core-asynciterator-polyfill (? seconds) -@azure/core-paging (? seconds) ================================ -BLOCKED (38) +BLOCKED (49) ================================ +@azure/abort-controller @azure/core-auth +@azure/core-asynciterator-polyfill @azure/core-http -@azure/core-lro -@azure/dev-tool -@azure/identity -@azure/test-utils-recorder +@azure/communication-common @azure/core-amqp +@azure/core-lro +@azure/core-paging +@azure/dev-tool +@azure/test-utils-recorder +@azure/communication-administration @azure/core-https @azure/core-xml +@azure/event-hubs @azure/event-processor-host @azure/keyvault-secrets @azure/storage-blob +@azure/ai-anomaly-detector @azure/ai-form-recognizer @azure/ai-text-analytics @azure/app-configuration +@azure/communication-chat +@azure/communication-sms @azure/core-arm @azure/core-client @azure/core-tracing @azure/cosmos -@azure/event-hubs +@azure/data-tables +@azure/digital-twins +@azure/eventgrid @azure/eventhubs-checkpointstore-blob +@azure/identity @azure/keyvault-admin @azure/keyvault-certificates @azure/keyvault-common @azure/keyvault-keys @azure/monitor-opentelemetry-exporter @azure/schema-registry +@azure/schema-registry-avro @azure/search-documents @azure/service-bus @azure/storage-blob-changefeed @@ -52,7 +58,6 @@ BLOCKED (38) @azure/storage-file-share @azure/storage-internal-avro @azure/storage-queue -@azure/tables @azure/template @azure/test-utils-perfstress testhub @@ -84,38 +89,49 @@ rush rebuild - Errors! (? seconds) Standard error: XX of XX: [@azure/eslint-plugin-azure-sdk] failed! -XX of XX: [@azure/ai-form-recognizer] blocked by [@azure/eslint-plugin-azure-sdk]! -XX of XX: [@azure/ai-text-analytics] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/abort-controller] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/communication-chat] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/communication-common] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/communication-administration] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/communication-sms] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/core-amqp] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/event-hubs] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/eventhubs-checkpointstore-blob] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/service-bus] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/core-auth] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/ai-anomaly-detector] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/ai-form-recognizer] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/ai-text-analytics] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/core-client] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/core-http] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/app-configuration] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/core-arm] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/core-lro] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/keyvault-admin] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/keyvault-certificates] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/keyvault-keys] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/keyvault-secrets] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/storage-blob] blocked by [@azure/eslint-plugin-azure-sdk]! -XX of XX: [@azure/eventhubs-checkpointstore-blob] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/storage-blob-changefeed] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/storage-file-datalake] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/data-tables] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/digital-twins] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/eventgrid] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/identity] blocked by [@azure/eslint-plugin-azure-sdk]! -XX of XX: [@azure/storage-internal-avro] blocked by [@azure/eslint-plugin-azure-sdk]! -XX of XX: [@azure/storage-queue] blocked by [@azure/eslint-plugin-azure-sdk]! -XX of XX: [@azure/keyvault-admin] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/keyvault-common] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/monitor-opentelemetry-exporter] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/schema-registry] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/schema-registry-avro] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/search-documents] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/storage-file-share] blocked by [@azure/eslint-plugin-azure-sdk]! -XX of XX: [@azure/tables] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/storage-queue] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/template] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/test-utils-perfstress] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/test-utils-recorder] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/storage-internal-avro] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/core-https] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/core-asynciterator-polyfill] blocked by [@azure/eslint-plugin-azure-sdk]! +XX of XX: [@azure/core-paging] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/core-tracing] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/core-xml] blocked by [@azure/eslint-plugin-azure-sdk]! XX of XX: [@azure/cosmos] blocked by [@azure/eslint-plugin-azure-sdk]! diff --git a/tests/baselines/reference/docker/office-ui-fabric.log b/tests/baselines/reference/docker/office-ui-fabric.log index c9edaacb33d..da84b91bcb4 100644 --- a/tests/baselines/reference/docker/office-ui-fabric.log +++ b/tests/baselines/reference/docker/office-ui-fabric.log @@ -1,57 +1,2647 @@ Exit Code: 1 Standard output: +@fluentui/eslint-plugin: yarn run vX.X.X +@fluentui/eslint-plugin: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/eslint-plugin: Done in ?s. +@fluentui/noop: yarn run vX.X.X +@fluentui/noop: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/noop: Done in ?s. @fluentui/web-components: yarn run vX.X.X -@fluentui/web-components: $ tsc -p ./tsconfig.json && rollup -c && npm run doc -@fluentui/web-components: ┌─────────────────────────────────────────┐ -@fluentui/web-components: │ │ -@fluentui/web-components: │ Destination: dist/web-components.js │ -@fluentui/web-components: │ Bundle Size: 504.97 KB │ -@fluentui/web-components: │ Gzipped Size: 52.01 KB │ -@fluentui/web-components: │ Brotli size: 77.25 KB │ -@fluentui/web-components: │ │ -@fluentui/web-components: └─────────────────────────────────────────┘ -@fluentui/web-components: ┌─────────────────────────────────────────────┐ -@fluentui/web-components: │ │ -@fluentui/web-components: │ Destination: dist/web-components.min.js │ -@fluentui/web-components: │ Bundle Size: 205.52 KB │ -@fluentui/web-components: │ Gzipped Size: 47.86 KB │ -@fluentui/web-components: │ Brotli size: 40.53 KB │ -@fluentui/web-components: │ │ -@fluentui/web-components: └─────────────────────────────────────────────┘ -@fluentui/web-components: > @fluentui/web-components@X.X.X doc /office-ui-fabric-react/packages/web-components -@fluentui/web-components: > api-extractor run --local -@fluentui/web-components: api-extractor 7.7.1 - https://api-extractor.com/ -@fluentui/web-components: Using configuration from /office-ui-fabric-react/packages/web-components/api-extractor.json -@fluentui/web-components: API Extractor completed successfully +@fluentui/web-components: $ /office-ui-fabric-react/node_modules/.bin/just ts @fluentui/web-components: Done in ?s. @fluentui/ability-attributes: yarn run vX.X.X -@fluentui/ability-attributes: $ npm run schema && gulp bundle:package:no-umd -@fluentui/ability-attributes: > @fluentui/ability-attributes@X.X.X schema /office-ui-fabric-react/packages/fluentui/ability-attributes -@fluentui/ability-attributes: > allyschema -c "process.env.NODE_ENV !== 'production'" schema.json > ./src/schema.ts -@fluentui/ability-attributes: [XX:XX:XX] Requiring external module @uifabric/build/babel/register -@fluentui/ability-attributes: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/ability-attributes: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/ability-attributes: Done in ?s. +@fluentui/digest: yarn run vX.X.X +@fluentui/digest: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/digest: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/fluentui/digest/tsconfig.json +@fluentui/digest: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --module esnext --outDir lib --project "/office-ui-fabric-react/packages/fluentui/digest/tsconfig.json" +@fluentui/digest: Done in ?s. +@uifabric/build: yarn run vX.X.X +@uifabric/build: $ /office-ui-fabric-react/node_modules/.bin/just ts +@uifabric/build: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/scripts/tsconfig.json +@uifabric/build: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/scripts/tsconfig.json" +@uifabric/build: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/scripts/tsconfig.json +@uifabric/build: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/scripts/tsconfig.json" +@uifabric/build: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@uifabric/pr-deploy-site: yarn run vX.X.X +@uifabric/pr-deploy-site: $ just-scripts ts +@uifabric/pr-deploy-site: Done in ?s. +@fluentui/a11y-rules: yarn run vX.X.X +@fluentui/a11y-rules: $ just-scripts ts +@fluentui/a11y-rules: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/a11y-rules/tsconfig.json +@fluentui/a11y-rules: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/a11y-rules/tsconfig.json" +@fluentui/a11y-rules: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/a11y-rules/tsconfig.json +@fluentui/a11y-rules: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/a11y-rules/tsconfig.json" +@fluentui/a11y-rules: Done in ?s. +@fluentui/common-styles: yarn run vX.X.X +@fluentui/common-styles: $ just-scripts ts +@fluentui/common-styles: Done in ?s. +@uifabric/example-data: yarn run vX.X.X +@uifabric/example-data: $ just-scripts ts +@uifabric/example-data: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/example-data/tsconfig.json +@uifabric/example-data: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/example-data/tsconfig.json" +@uifabric/example-data: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/example-data/tsconfig.json +@uifabric/example-data: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/example-data/tsconfig.json" +@uifabric/example-data: Done in ?s. +@fluentui/ie11-polyfills: yarn run vX.X.X +@fluentui/ie11-polyfills: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/ie11-polyfills: Done in ?s. +@fluentui/keyboard-key: yarn run vX.X.X +@fluentui/keyboard-key: $ just-scripts ts +@fluentui/keyboard-key: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/keyboard-key/tsconfig.json +@fluentui/keyboard-key: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/keyboard-key/tsconfig.json" +@fluentui/keyboard-key: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/keyboard-key/tsconfig.json +@fluentui/keyboard-key: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/keyboard-key/tsconfig.json" +@fluentui/keyboard-key: Done in ?s. +@uifabric/monaco-editor: yarn run vX.X.X +@uifabric/monaco-editor: $ just-scripts ts +@uifabric/monaco-editor: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/monaco-editor/tsconfig.json +@uifabric/monaco-editor: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/monaco-editor/tsconfig.json" +@uifabric/monaco-editor: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/monaco-editor/tsconfig.json +@uifabric/monaco-editor: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/monaco-editor/tsconfig.json" +@uifabric/monaco-editor: Done in ?s. +@fluentui/react-conformance: yarn run vX.X.X +@fluentui/react-conformance: $ just-scripts ts +@fluentui/react-conformance: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-conformance/tsconfig.json +@fluentui/react-conformance: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-conformance/tsconfig.json" +@fluentui/react-conformance: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-conformance/tsconfig.json +@fluentui/react-conformance: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-conformance/tsconfig.json" +@fluentui/react-conformance: Done in ?s. +@uifabric/set-version: yarn run vX.X.X +@uifabric/set-version: $ just-scripts ts +@uifabric/set-version: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/set-version/tsconfig.json +@uifabric/set-version: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/set-version/tsconfig.json" +@uifabric/set-version: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/set-version/tsconfig.json +@uifabric/set-version: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/set-version/tsconfig.json" +@uifabric/set-version: Done in ?s. +@uifabric/webpack-utils: yarn run vX.X.X +@uifabric/webpack-utils: $ just-scripts ts +@uifabric/webpack-utils: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/webpack-utils/tsconfig.json +@uifabric/webpack-utils: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/webpack-utils/tsconfig.json" +@uifabric/webpack-utils: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/webpack-utils/tsconfig.json +@uifabric/webpack-utils: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/webpack-utils/tsconfig.json" +@uifabric/webpack-utils: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/docs-components: yarn run vX.X.X +@fluentui/docs-components: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/docs-components: Done in ?s. +@fluentui/react-component-event-listener: yarn run vX.X.X +@fluentui/react-component-event-listener: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-component-event-listener: Done in ?s. +@fluentui/react-component-nesting-registry: yarn run vX.X.X +@fluentui/react-component-nesting-registry: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-component-nesting-registry: Done in ?s. +@fluentui/react-component-ref: yarn run vX.X.X +@fluentui/react-component-ref: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-component-ref: Done in ?s. +@fluentui/react-context-selector: yarn run vX.X.X +@fluentui/react-context-selector: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-context-selector: Done in ?s. +@fluentui/react-proptypes: yarn run vX.X.X +@fluentui/react-proptypes: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-proptypes: Done in ?s. +@fluentui/state: yarn run vX.X.X +@fluentui/state: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/state: Done in ?s. +@fluentui/styles: yarn run vX.X.X +@fluentui/styles: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/styles: Done in ?s. +@fluentui/a11y-testing: yarn run vX.X.X +@fluentui/a11y-testing: $ just-scripts ts +@fluentui/a11y-testing: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/a11y-testing/tsconfig.json +@fluentui/a11y-testing: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/a11y-testing/tsconfig.json" +@fluentui/a11y-testing: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/a11y-testing/tsconfig.json +@fluentui/a11y-testing: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/a11y-testing/tsconfig.json" +@fluentui/a11y-testing: Done in ?s. +@fluentui/accessibility: yarn run vX.X.X +@fluentui/accessibility: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/accessibility: Done in ?s. +@fluentui/date-time-utilities: yarn run vX.X.X +@fluentui/date-time-utilities: $ just-scripts ts +@fluentui/date-time-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/date-time-utilities/tsconfig.json +@fluentui/date-time-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/date-time-utilities/tsconfig.json" +@fluentui/date-time-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/date-time-utilities/tsconfig.json +@fluentui/date-time-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/date-time-utilities/tsconfig.json" +@fluentui/date-time-utilities: Done in ?s. +@fluentui/dom-utilities: yarn run vX.X.X +@fluentui/dom-utilities: $ just-scripts ts +@fluentui/dom-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/dom-utilities/tsconfig.json +@fluentui/dom-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/dom-utilities/tsconfig.json" +@fluentui/dom-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/dom-utilities/tsconfig.json +@fluentui/dom-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/dom-utilities/tsconfig.json" +@fluentui/dom-utilities: Done in ?s. +@uifabric/merge-styles: yarn run vX.X.X +@uifabric/merge-styles: $ just-scripts ts +@uifabric/merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/merge-styles/tsconfig.json +@uifabric/merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json" +@uifabric/merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/merge-styles/tsconfig.json +@uifabric/merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json" +@uifabric/merge-styles: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-northstar-styles-renderer: yarn run vX.X.X +@fluentui/react-northstar-styles-renderer: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-northstar-styles-renderer: Done in ?s. +@uifabric/jest-serializer-merge-styles: yarn run vX.X.X +@uifabric/jest-serializer-merge-styles: $ just-scripts ts +@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json +@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json" +@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json +@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json" +@uifabric/jest-serializer-merge-styles: Done in ?s. +@fluentui/react-northstar-emotion-renderer: yarn run vX.X.X +@fluentui/react-northstar-emotion-renderer: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-northstar-emotion-renderer: Done in ?s. +@fluentui/react-northstar-fela-renderer: yarn run vX.X.X +@fluentui/react-northstar-fela-renderer: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-northstar-fela-renderer: Done in ?s. +@fluentui/react-stylesheets: yarn run vX.X.X +@fluentui/react-stylesheets: $ just-scripts ts +@fluentui/react-stylesheets: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-stylesheets/tsconfig.json +@fluentui/react-stylesheets: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-stylesheets/tsconfig.json" +@fluentui/react-stylesheets: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-stylesheets/tsconfig.json +@fluentui/react-stylesheets: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-stylesheets/tsconfig.json" +@fluentui/react-stylesheets: Done in ?s. +@fluentui/react-utilities: yarn run vX.X.X +@fluentui/react-utilities: $ just-scripts ts +@fluentui/react-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-utilities/tsconfig.json +@fluentui/react-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-utilities/tsconfig.json" +@fluentui/react-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-utilities/tsconfig.json +@fluentui/react-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-utilities/tsconfig.json" +@fluentui/react-utilities: Done in ?s. +@uifabric/test-utilities: yarn run vX.X.X +@uifabric/test-utilities: $ just-scripts ts +@uifabric/test-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/test-utilities/tsconfig.json +@uifabric/test-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/test-utilities/tsconfig.json" +@uifabric/test-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/test-utilities/tsconfig.json +@uifabric/test-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/test-utilities/tsconfig.json" +@uifabric/test-utilities: Done in ?s. +@fluentui/react-window-provider: yarn run vX.X.X +@fluentui/react-window-provider: $ just-scripts ts +@fluentui/react-window-provider: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-window-provider/tsconfig.json +@fluentui/react-window-provider: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-window-provider/tsconfig.json" +@fluentui/react-window-provider: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-window-provider/tsconfig.json +@fluentui/react-window-provider: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-window-provider/tsconfig.json" +@fluentui/react-window-provider: Done in ?s. +@uifabric/utilities: yarn run vX.X.X +@uifabric/utilities: $ just-scripts ts +@uifabric/utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/utilities/tsconfig.json +@uifabric/utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/utilities/tsconfig.json" +@uifabric/utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/utilities/tsconfig.json +@uifabric/utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/utilities/tsconfig.json" +@uifabric/utilities: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-compose: yarn run vX.X.X +@fluentui/react-compose: $ just-scripts ts +@fluentui/react-compose: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-compose/tsconfig.json +@fluentui/react-compose: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-compose/tsconfig.json" +@fluentui/react-compose: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-compose/tsconfig.json +@fluentui/react-compose: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-compose/tsconfig.json" +@fluentui/react-compose: Done in ?s. +@uifabric/react-hooks: yarn run vX.X.X +@uifabric/react-hooks: $ just-scripts ts +@uifabric/react-hooks: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-hooks/tsconfig.json +@uifabric/react-hooks: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-hooks/tsconfig.json" +@uifabric/react-hooks: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-hooks/tsconfig.json +@uifabric/react-hooks: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-hooks/tsconfig.json" +@uifabric/react-hooks: Done in ?s. +@fluentui/react-icons: yarn run vX.X.X +@fluentui/react-icons: $ just-scripts ts +@fluentui/react-icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-icons/tsconfig.json +@fluentui/react-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-icons/tsconfig.json" +@fluentui/react-icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-icons/tsconfig.json +@fluentui/react-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-icons/tsconfig.json" +@fluentui/react-icons: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/theme: yarn run vX.X.X +@fluentui/theme: $ just-scripts ts +@fluentui/theme: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/theme/tsconfig.json +@fluentui/theme: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/theme/tsconfig.json" +@fluentui/theme: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/theme/tsconfig.json +@fluentui/theme: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/theme/tsconfig.json" +@fluentui/theme: Done in ?s. +@fluentui/react-bindings: yarn run vX.X.X +@fluentui/react-bindings: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-bindings: Done in ?s. +@uifabric/styling: yarn run vX.X.X +@uifabric/styling: $ just-scripts ts +@uifabric/styling: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/styling/tsconfig.json +@uifabric/styling: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/styling/tsconfig.json" +@uifabric/styling: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/styling/tsconfig.json +@uifabric/styling: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/styling/tsconfig.json" +@uifabric/styling: Done in ?s. +@fluentui/react-icons-northstar: yarn run vX.X.X +@fluentui/react-icons-northstar: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-icons-northstar: Done in ?s. +@fluentui/react-telemetry: yarn run vX.X.X +@fluentui/react-telemetry: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-telemetry: Done in ?s. +@uifabric/file-type-icons: yarn run vX.X.X +@uifabric/file-type-icons: $ just-scripts ts +@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/file-type-icons/tsconfig.json +@uifabric/file-type-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/file-type-icons/tsconfig.json" +@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/file-type-icons/tsconfig.json +@uifabric/file-type-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/file-type-icons/tsconfig.json" +@uifabric/file-type-icons: Done in ?s. +@uifabric/foundation: yarn run vX.X.X +@uifabric/foundation: $ just-scripts ts +@uifabric/foundation: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/foundation/tsconfig.json +@uifabric/foundation: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/foundation/tsconfig.json" +@uifabric/foundation: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/foundation/tsconfig.json +@uifabric/foundation: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/foundation/tsconfig.json" +@uifabric/foundation: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@uifabric/icons: yarn run vX.X.X +@uifabric/icons: $ just-scripts ts +@uifabric/icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/icons/tsconfig.json +@uifabric/icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/icons/tsconfig.json" +@uifabric/icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/icons/tsconfig.json +@uifabric/icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/icons/tsconfig.json" +@uifabric/icons: Done in ?s. +@fluentui/react-focus: yarn run vX.X.X +@fluentui/react-focus: $ just-scripts ts +@fluentui/react-focus: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-focus/tsconfig.json +@fluentui/react-focus: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-focus/tsconfig.json" +@fluentui/react-focus: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-focus/tsconfig.json +@fluentui/react-focus: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-focus/tsconfig.json" +@fluentui/react-focus: Done in ?s. +@fluentui/react-theme-provider: yarn run vX.X.X +@fluentui/react-theme-provider: $ just-scripts ts +@fluentui/react-theme-provider: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-theme-provider/tsconfig.json +@fluentui/react-theme-provider: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-theme-provider/tsconfig.json" +@fluentui/react-theme-provider: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-theme-provider/tsconfig.json +@fluentui/react-theme-provider: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-theme-provider/tsconfig.json" +@fluentui/react-theme-provider: Done in ?s. +@fluentui/react-northstar: yarn run vX.X.X +@fluentui/react-northstar: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-northstar: Done in ?s. +office-ui-fabric-react: yarn run vX.X.X +office-ui-fabric-react: $ just-scripts ts +office-ui-fabric-react: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/office-ui-fabric-react/tsconfig.json +office-ui-fabric-react: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/office-ui-fabric-react/tsconfig.json" +office-ui-fabric-react: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/office-ui-fabric-react/tsconfig.json +office-ui-fabric-react: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/office-ui-fabric-react/tsconfig.json" +office-ui-fabric-react: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/circulars-test: yarn run vX.X.X +@fluentui/circulars-test: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/circulars-test: Done in ?s. +@fluentui/code-sandbox: yarn run vX.X.X +@fluentui/code-sandbox: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/code-sandbox: Done in ?s. +@fluentui/local-sandbox: yarn run vX.X.X +@fluentui/local-sandbox: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/local-sandbox: Done in ?s. +@fluentui/projects-test: yarn run vX.X.X +@fluentui/projects-test: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/projects-test: Done in ?s. +server-rendered-app: yarn run vX.X.X +server-rendered-app: $ just-scripts ts +server-rendered-app: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/server-rendered-app/tsconfig.json +server-rendered-app: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/server-rendered-app/tsconfig.json" +server-rendered-app: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/server-rendered-app/tsconfig.json +server-rendered-app: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/server-rendered-app/tsconfig.json" +server-rendered-app: Done in ?s. +todo-app: yarn run vX.X.X +todo-app: $ just-scripts ts +todo-app: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/todo-app/tsconfig.json +todo-app: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/todo-app/tsconfig.json" +todo-app: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/todo-app/tsconfig.json +todo-app: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/todo-app/tsconfig.json" +todo-app: Done in ?s. +@uifabric/azure-themes: yarn run vX.X.X +@uifabric/azure-themes: $ just-scripts ts +@uifabric/azure-themes: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/azure-themes/tsconfig.json +@uifabric/azure-themes: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/azure-themes/tsconfig.json" +@uifabric/azure-themes: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/azure-themes/tsconfig.json +@uifabric/azure-themes: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/azure-themes/tsconfig.json" +@uifabric/azure-themes: Done in ?s. +@fluentui/codemods: yarn run vX.X.X +@fluentui/codemods: $ just-scripts ts +@fluentui/codemods: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/codemods/tsconfig.json +@fluentui/codemods: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/codemods/tsconfig.json" +@fluentui/codemods: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/codemods/tsconfig.json +@fluentui/codemods: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/codemods/tsconfig.json" +@fluentui/codemods: Done in ?s. +@fluentui/react: yarn run vX.X.X +@fluentui/react: $ just-scripts ts +@fluentui/react: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react/tsconfig.json +@fluentui/react: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react/tsconfig.json" +@fluentui/react: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react/tsconfig.json +@fluentui/react: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react/tsconfig.json" +@fluentui/react: Done in ?s. +@uifabric/tsx-editor: yarn run vX.X.X +@uifabric/tsx-editor: $ just-scripts ts +@uifabric/tsx-editor: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/tsx-editor/tsconfig.json +@uifabric/tsx-editor: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/tsx-editor/tsconfig.json" +@uifabric/tsx-editor: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/tsx-editor/tsconfig.json +@uifabric/tsx-editor: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/tsx-editor/tsconfig.json" +@uifabric/tsx-editor: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@uifabric/variants: yarn run vX.X.X +@uifabric/variants: $ just-scripts ts +@uifabric/variants: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/variants/tsconfig.json +@uifabric/variants: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/variants/tsconfig.json" +@uifabric/variants: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/variants/tsconfig.json +@uifabric/variants: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/variants/tsconfig.json" +@uifabric/variants: Done in ?s. +@fluentui/e2e: yarn run vX.X.X +@fluentui/e2e: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/e2e: Done in ?s. +@fluentui/perf-test: yarn run vX.X.X +@fluentui/perf-test: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/perf-test: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/fluentui/perf-test/tsconfig.json +@fluentui/perf-test: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/fluentui/perf-test/tsconfig.json" +@fluentui/perf-test: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/fluentui/perf-test/tsconfig.json +@fluentui/perf-test: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/fluentui/perf-test/tsconfig.json" +@fluentui/perf-test: Done in ?s. +codesandbox-react-northstar-template: yarn run vX.X.X +codesandbox-react-northstar-template: $ just-scripts ts +codesandbox-react-northstar-template: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/codesandbox-react-northstar-template/tsconfig.json +codesandbox-react-northstar-template: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/codesandbox-react-northstar-template/tsconfig.json" +codesandbox-react-northstar-template: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/codesandbox-react-northstar-template/tsconfig.json +codesandbox-react-northstar-template: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/codesandbox-react-northstar-template/tsconfig.json" +codesandbox-react-northstar-template: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-builder: yarn run vX.X.X +@fluentui/react-builder: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/react-builder: Done in ?s. +codesandbox-react-template: yarn run vX.X.X +codesandbox-react-template: $ just-scripts ts +codesandbox-react-template: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/codesandbox-react-template/tsconfig.json +codesandbox-react-template: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/codesandbox-react-template/tsconfig.json" +codesandbox-react-template: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/codesandbox-react-template/tsconfig.json +codesandbox-react-template: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/codesandbox-react-template/tsconfig.json" +codesandbox-react-template: Done in ?s. +@uifabric/fluent-theme: yarn run vX.X.X +@uifabric/fluent-theme: $ just-scripts ts +@uifabric/fluent-theme: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/fluent-theme/tsconfig.json +@uifabric/fluent-theme: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/fluent-theme/tsconfig.json" +@uifabric/fluent-theme: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/fluent-theme/tsconfig.json +@uifabric/fluent-theme: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/fluent-theme/tsconfig.json" +@uifabric/fluent-theme: Done in ?s. +@uifabric/mdl2-theme: yarn run vX.X.X +@uifabric/mdl2-theme: $ just-scripts ts +@uifabric/mdl2-theme: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/mdl2-theme/tsconfig.json +@uifabric/mdl2-theme: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/mdl2-theme/tsconfig.json" +@uifabric/mdl2-theme: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/mdl2-theme/tsconfig.json +@uifabric/mdl2-theme: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/mdl2-theme/tsconfig.json" +@uifabric/mdl2-theme: Done in ?s. +@uifabric/theme-samples: yarn run vX.X.X +@uifabric/theme-samples: $ just-scripts ts +@uifabric/theme-samples: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/theme-samples/tsconfig.json +@uifabric/theme-samples: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/theme-samples/tsconfig.json" +@uifabric/theme-samples: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/theme-samples/tsconfig.json +@uifabric/theme-samples: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/theme-samples/tsconfig.json" +@uifabric/theme-samples: Done in ?s. +@fluentui/docs: yarn run vX.X.X +@fluentui/docs: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/docs: Done in ?s. +@uifabric/example-app-base: yarn run vX.X.X +@uifabric/example-app-base: $ just-scripts ts +@uifabric/example-app-base: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/example-app-base/tsconfig.json +@uifabric/example-app-base: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/example-app-base/tsconfig.json" +@uifabric/example-app-base: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/example-app-base/tsconfig.json +@uifabric/example-app-base: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/example-app-base/tsconfig.json" +@uifabric/example-app-base: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/storybook: yarn run vX.X.X +@fluentui/storybook: $ just-scripts ts +@fluentui/storybook: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/storybook/tsconfig.json +@fluentui/storybook: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/storybook/tsconfig.json" +@fluentui/storybook: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/storybook/tsconfig.json +@fluentui/storybook: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/storybook/tsconfig.json" +@fluentui/storybook: Done in ?s. +@fluentui/perf: yarn run vX.X.X +@fluentui/perf: $ /office-ui-fabric-react/node_modules/.bin/just ts +@fluentui/perf: Done in ?s. +dom-tests: yarn run vX.X.X +dom-tests: $ just-scripts ts +dom-tests: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/dom-tests/tsconfig.json +dom-tests: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/dom-tests/tsconfig.json" +dom-tests: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/dom-tests/tsconfig.json +dom-tests: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/dom-tests/tsconfig.json" +dom-tests: Done in ?s. +@uifabric/charting: yarn run vX.X.X +@uifabric/charting: $ just-scripts ts +@uifabric/charting: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/charting/tsconfig.json +@uifabric/charting: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/charting/tsconfig.json" +@uifabric/charting: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/charting/tsconfig.json +@uifabric/charting: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/charting/tsconfig.json" +@uifabric/charting: Done in ?s. +@uifabric/date-time: yarn run vX.X.X +@uifabric/date-time: $ just-scripts ts +@uifabric/date-time: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/date-time/tsconfig.json +@uifabric/date-time: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/date-time/tsconfig.json" +@uifabric/date-time: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/date-time/tsconfig.json +@uifabric/date-time: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/date-time/tsconfig.json" +@uifabric/date-time: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@uifabric/experiments: yarn run vX.X.X +@uifabric/experiments: $ just-scripts ts +@uifabric/experiments: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/experiments/tsconfig.json +@uifabric/experiments: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/experiments/tsconfig.json" +@uifabric/experiments: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/experiments/tsconfig.json +@uifabric/experiments: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/experiments/tsconfig.json" +@uifabric/experiments: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@uifabric/react-cards: yarn run vX.X.X +@uifabric/react-cards: $ just-scripts ts +@uifabric/react-cards: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-cards/tsconfig.json +@uifabric/react-cards: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-cards/tsconfig.json" +@uifabric/react-cards: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-cards/tsconfig.json +@uifabric/react-cards: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-cards/tsconfig.json" +@uifabric/react-cards: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-avatar: yarn run vX.X.X +@fluentui/react-avatar: $ just-scripts ts +@fluentui/react-avatar: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-avatar/tsconfig.json +@fluentui/react-avatar: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-avatar/tsconfig.json" +@fluentui/react-avatar: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-avatar/tsconfig.json +@fluentui/react-avatar: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-avatar/tsconfig.json" +@fluentui/react-avatar: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-button: yarn run vX.X.X +@fluentui/react-button: $ just-scripts ts +@fluentui/react-button: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-button/tsconfig.json +@fluentui/react-button: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-button/tsconfig.json" +@fluentui/react-button: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-button/tsconfig.json +@fluentui/react-button: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-button/tsconfig.json" +@fluentui/react-button: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-checkbox: yarn run vX.X.X +@fluentui/react-checkbox: $ just-scripts ts +@fluentui/react-checkbox: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-checkbox/tsconfig.json +@fluentui/react-checkbox: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-checkbox/tsconfig.json" +@fluentui/react-checkbox: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-checkbox/tsconfig.json +@fluentui/react-checkbox: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-checkbox/tsconfig.json" +@fluentui/react-checkbox: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-image: yarn run vX.X.X +@fluentui/react-image: $ just-scripts ts +@fluentui/react-image: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-image/tsconfig.json +@fluentui/react-image: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-image/tsconfig.json" +@fluentui/react-image: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-image/tsconfig.json +@fluentui/react-image: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-image/tsconfig.json" +@fluentui/react-image: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-link: yarn run vX.X.X +@fluentui/react-link: $ just-scripts ts +@fluentui/react-link: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-link/tsconfig.json +@fluentui/react-link: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-link/tsconfig.json" +@fluentui/react-link: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-link/tsconfig.json +@fluentui/react-link: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-link/tsconfig.json" +@fluentui/react-link: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-slider: yarn run vX.X.X +@fluentui/react-slider: $ just-scripts ts +@fluentui/react-slider: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-slider/tsconfig.json +@fluentui/react-slider: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-slider/tsconfig.json" +@fluentui/react-slider: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-slider/tsconfig.json +@fluentui/react-slider: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-slider/tsconfig.json" +@fluentui/react-slider: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-spinbutton: yarn run vX.X.X +@fluentui/react-spinbutton: $ just-scripts ts +@fluentui/react-spinbutton: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-spinbutton/tsconfig.json +@fluentui/react-spinbutton: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-spinbutton/tsconfig.json" +@fluentui/react-spinbutton: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-spinbutton/tsconfig.json +@fluentui/react-spinbutton: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-spinbutton/tsconfig.json" +@fluentui/react-spinbutton: Done in ?s. +@fluentui/react-tabs: yarn run vX.X.X +@fluentui/react-tabs: $ just-scripts ts +@fluentui/react-tabs: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-tabs/tsconfig.json +@fluentui/react-tabs: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-tabs/tsconfig.json" +@fluentui/react-tabs: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-tabs/tsconfig.json +@fluentui/react-tabs: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-tabs/tsconfig.json" +@fluentui/react-tabs: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-toggle: yarn run vX.X.X +@fluentui/react-toggle: $ just-scripts ts +@fluentui/react-toggle: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-toggle/tsconfig.json +@fluentui/react-toggle: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-toggle/tsconfig.json" +@fluentui/react-toggle: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-toggle/tsconfig.json +@fluentui/react-toggle: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-toggle/tsconfig.json" +@fluentui/react-toggle: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +theming-designer: yarn run vX.X.X +theming-designer: $ just-scripts ts +theming-designer: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/theming-designer/tsconfig.json +theming-designer: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/theming-designer/tsconfig.json" +theming-designer: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/theming-designer/tsconfig.json +theming-designer: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/theming-designer/tsconfig.json" +theming-designer: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@uifabric/api-docs: yarn run vX.X.X +@uifabric/api-docs: $ just-scripts ts +@uifabric/api-docs: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/api-docs/tsconfig.json +@uifabric/api-docs: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/api-docs/tsconfig.json" +@uifabric/api-docs: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/api-docs/tsconfig.json +@uifabric/api-docs: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/api-docs/tsconfig.json" +@uifabric/api-docs: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-flex: yarn run vX.X.X +@fluentui/react-flex: $ just-scripts ts +@fluentui/react-flex: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-flex/tsconfig.json +@fluentui/react-flex: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-flex/tsconfig.json" +@fluentui/react-flex: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-flex/tsconfig.json +@fluentui/react-flex: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-flex/tsconfig.json" +@fluentui/react-flex: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@fluentui/react-next: yarn run vX.X.X +@fluentui/react-next: $ just-scripts ts +@fluentui/react-next: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-next/tsconfig.json +@fluentui/react-next: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-next/tsconfig.json" +@fluentui/react-next: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/react-next/tsconfig.json +@fluentui/react-next: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-next/tsconfig.json" +@fluentui/react-next: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +@uifabric/fabric-website-resources: yarn run vX.X.X +@uifabric/fabric-website-resources: $ just-scripts ts +@uifabric/fabric-website-resources: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/fabric-website-resources/tsconfig.json +@uifabric/fabric-website-resources: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/fabric-website-resources/tsconfig.json" +@uifabric/fabric-website-resources: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/fabric-website-resources/tsconfig.json +@uifabric/fabric-website-resources: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/fabric-website-resources/tsconfig.json" +@uifabric/fabric-website-resources: Done in ?s. +codesandbox-react-next-template: yarn run vX.X.X +codesandbox-react-next-template: $ just-scripts ts +codesandbox-react-next-template: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/codesandbox-react-next-template/tsconfig.json +codesandbox-react-next-template: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/codesandbox-react-next-template/tsconfig.json" +codesandbox-react-next-template: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/codesandbox-react-next-template/tsconfig.json +codesandbox-react-next-template: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/codesandbox-react-next-template/tsconfig.json" +codesandbox-react-next-template: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +perf-test: yarn run vX.X.X +perf-test: $ just-scripts ts +perf-test: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/perf-test/tsconfig.json +perf-test: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/perf-test/tsconfig.json" +perf-test: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/perf-test/tsconfig.json +perf-test: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/perf-test/tsconfig.json" +perf-test: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +test-bundles: yarn run vX.X.X +test-bundles: $ just-scripts ts +test-bundles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/test-bundles/tsconfig.json +test-bundles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/test-bundles/tsconfig.json" +test-bundles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/test-bundles/tsconfig.json +test-bundles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/test-bundles/tsconfig.json" +test-bundles: Done in ?s. +vr-tests: yarn run vX.X.X +vr-tests: $ just-scripts ts +vr-tests: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/vr-tests/tsconfig.json +vr-tests: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/vr-tests/tsconfig.json" +vr-tests: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/vr-tests/tsconfig.json +vr-tests: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/vr-tests/tsconfig.json" +vr-tests: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +a11y-tests: yarn run vX.X.X +a11y-tests: $ just-scripts ts +a11y-tests: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/a11y-tests/tsconfig.json +a11y-tests: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/a11y-tests/tsconfig.json" +a11y-tests: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/a11y-tests/tsconfig.json +a11y-tests: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/a11y-tests/tsconfig.json" +a11y-tests: Done in ?s. +@uifabric/fabric-website: yarn run vX.X.X +@uifabric/fabric-website: $ just-scripts ts +@uifabric/fabric-website: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/fabric-website/tsconfig.json +@uifabric/fabric-website: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/fabric-website/tsconfig.json" +@uifabric/fabric-website: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/apps/fabric-website/tsconfig.json +@uifabric/fabric-website: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/fabric-website/tsconfig.json" +@uifabric/fabric-website: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +ssr-tests: yarn run vX.X.X +ssr-tests: $ just-scripts ts +ssr-tests: Done in ?s. +@fluentui/examples: yarn run vX.X.X +@fluentui/examples: $ just-scripts ts +@fluentui/examples: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/examples/tsconfig.json +@fluentui/examples: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/examples/tsconfig.json" +@fluentui/examples: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/examples/tsconfig.json +@fluentui/examples: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/examples/tsconfig.json" +@fluentui/examples: Done in ?s. Standard error: -info cli using local version of lerna -@fluentui/web-components: src/index-rollup.ts → dist/web-components.js, dist/web-components.min.js... -@fluentui/web-components: created dist/web-components.js, dist/web-components.min.js in ?s -@fluentui/web-components: npm WARN lifecycle The node binary used for scripts is but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with. -@fluentui/ability-attributes: npm WARN lifecycle The node binary used for scripts is but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with. -@fluentui/ability-attributes: /office-ui-fabric-react/node_modules/electron/index.js:14 -@fluentui/ability-attributes: throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again') -@fluentui/ability-attributes: ^ -@fluentui/ability-attributes: Error: Electron failed to install correctly, please delete node_modules/electron and try installing again -@fluentui/ability-attributes: at getElectronPath (/office-ui-fabric-react/node_modules/electron/index.js:14:11) -@fluentui/ability-attributes: at Object. (/office-ui-fabric-react/node_modules/electron/index.js:18:18) -@fluentui/ability-attributes: at Module._compile (internal/modules/cjs/loader.js:1251:30) -@fluentui/ability-attributes: at Module._compile (/office-ui-fabric-react/node_modules/pirates/lib/index.js:99:24) -@fluentui/ability-attributes: at Module._extensions..js (internal/modules/cjs/loader.js:1272:10) -@fluentui/ability-attributes: at Object.newLoader [as .js] (/office-ui-fabric-react/node_modules/pirates/lib/index.js:104:7) -@fluentui/ability-attributes: at Module.load (internal/modules/cjs/loader.js:1100:32) -@fluentui/ability-attributes: at Function.Module._load (internal/modules/cjs/loader.js:962:14) -@fluentui/ability-attributes: at Module.require (internal/modules/cjs/loader.js:1140:19) -@fluentui/ability-attributes: at require (internal/modules/cjs/helpers.js:75:18) -@fluentui/ability-attributes: error Command failed with exit code 1. -lerna ERR! yarn run build exited 1 in '@fluentui/ability-attributes' +@fluentui/eslint-plugin: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/eslint-plugin: [XX:XX:XX XM] x Command not defined: ts +@fluentui/noop: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/noop: [XX:XX:XX XM] x Command not defined: ts +@fluentui/web-components: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/web-components: [XX:XX:XX XM] x Command not defined: ts +@fluentui/ability-attributes: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/ability-attributes: [XX:XX:XX XM] x Command not defined: ts +@uifabric/build: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@uifabric/build: [XX:XX:XX XM] x ------------------------------------ +@uifabric/build: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/scripts/tsconfig.json" +@uifabric/build: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/build: at ChildProcess.emit (events.js:315:20) +@uifabric/build: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/build: at maybeClose (internal/child_process.js:1021:16) +@uifabric/build: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/build: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/build: [XX:XX:XX XM] x stdout: +@uifabric/build: [XX:XX:XX XM] x create-package/plop-templates-node/just.config.ts:1:9 - error TS2451: Cannot redeclare block-scoped variable 'preset'. +@uifabric/build: 1 const { preset, just } = require('@uifabric/build'); +@uifabric/build: ~~~~~~ +@uifabric/build: create-package/plop-templates-react/just.config.ts:1:9 +@uifabric/build: 1 const { preset } = require('@uifabric/build'); +@uifabric/build: ~~~~~~ +@uifabric/build: 'preset' was also declared here. +@uifabric/build: tasks/preset.ts:1:7 +@uifabric/build: 1 const preset = require('../just.config'); +@uifabric/build: ~~~~~~ +@uifabric/build: and here. +@uifabric/build: create-package/plop-templates-node/just.config.ts:2:9 - error TS2451: Cannot redeclare block-scoped variable 'task'. +@uifabric/build: 2 const { task } = just; +@uifabric/build: ~~~~ +@uifabric/build: just.config.ts:3:9 +@uifabric/build: 3 const { task, series, parallel, condition, option, argv, addResolvePath, resolveCwd } = require('just-scripts'); +@uifabric/build: ~~~~ +@uifabric/build: 'task' was also declared here. +@uifabric/build: create-package/plop-templates-react/just.config.ts:1:9 - error TS2451: Cannot redeclare block-scoped variable 'preset'. +@uifabric/build: 1 const { preset } = require('@uifabric/build'); +@uifabric/build: ~~~~~~ +@uifabric/build: create-package/plop-templates-node/just.config.ts:1:9 +@uifabric/build: 1 const { preset, just } = require('@uifabric/build'); +@uifabric/build: ~~~~~~ +@uifabric/build: 'preset' was also declared here. +@uifabric/build: create-package/plop-templates-react/src/version.ts:3:28 - error TS2307: Cannot find module '@uifabric/set-version' or its corresponding type declarations. +@uifabric/build: 3 import { setVersion } from '@uifabric/set-version'; +@uifabric/build: ~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/build: gulp/plugins/util/getComponentInfo.ts:145:9 - error TS2322: Type 'Tag[]' is not assignable to type '{ title: string; description: string; type: null; name: string; }[]'. +@uifabric/build: Type 'Tag' is not assignable to type '{ title: string; description: string; type: null; name: string; }'. +@uifabric/build: Types of property 'type' are incompatible. +@uifabric/build: Type 'Type' is not assignable to type 'null'. +@uifabric/build: Type 'AllLiteral' is not assignable to type 'null'. +@uifabric/build: 145 tags, +@uifabric/build: ~~~~ +@uifabric/build: gulp/plugins/util/docs-types.ts:49:3 +@uifabric/build: 49 tags: { +@uifabric/build: ~~~~ +@uifabric/build: The expected type comes from property 'tags' which is declared here on type 'ComponentProp' +@uifabric/build: gulp/plugins/util/tsLanguageService.ts:25:18 - error TS2569: Type 'IterableIterator' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators. +@uifabric/build: 25 return [...files.keys()]; +@uifabric/build: ~~~~~~~~~~~~ +@uifabric/build: gulp/tasks/browserAdapters.ts:58:7 - error TS2794: Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'? +@uifabric/build: 58 resolve(); +@uifabric/build: ~~~~~~~~~ +@uifabric/build: ../node_modules/typescript/lib/lib.es2015.promise.d.ts:33:34 +@uifabric/build: 33 new (executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; +@uifabric/build: ~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/build: An argument for 'value' was not provided. +@uifabric/build: index.js:1:1 - error TS9006: Declaration emit for this file requires using private name 'CssLoaderOptions' from module '"/office-ui-fabric-react/node_modules/just-scripts/lib/webpack/overlays/stylesOverlay"'. An explicit type annotation may unblock declaration emit. +@uifabric/build: 1 const just = require('just-scripts'); +@uifabric/build: ~~~~~ +@uifabric/build: index.js:1:1 - error TS9006: Declaration emit for this file requires using private name 'PrettierTaskOptions' from module '"/office-ui-fabric-react/node_modules/just-scripts/lib/tasks/prettierTask"'. An explicit type annotation may unblock declaration emit. +@uifabric/build: 1 const just = require('just-scripts'); +@uifabric/build: ~~~~~ +@uifabric/build: just.config.ts:3:9 - error TS2451: Cannot redeclare block-scoped variable 'task'. +@uifabric/build: 3 const { task, series, parallel, condition, option, argv, addResolvePath, resolveCwd } = require('just-scripts'); +@uifabric/build: ~~~~ +@uifabric/build: create-package/plop-templates-node/just.config.ts:2:9 +@uifabric/build: 2 const { task } = just; +@uifabric/build: ~~~~ +@uifabric/build: 'task' was also declared here. +@uifabric/build: monorepo/findRepoDeps.js:51:18 - error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators. +@uifabric/build: 51 repoDeps = [...result].map(dep => packageInfo[dep]); +@uifabric/build: ~~~~~~ +@uifabric/build: publish-beta.js:18:12 - error TS1212: Identifier expected. 'package' is a reserved word in strict mode. +@uifabric/build: 18 for (const package of packages) { +@uifabric/build: ~~~~~~~ +@uifabric/build: publish-beta.js:19:53 - error TS1212: Identifier expected. 'package' is a reserved word in strict mode. +@uifabric/build: 19 const packagePath = path.resolve(__dirname, '..', package.packagePath); +@uifabric/build: ~~~~~~~ +@uifabric/build: publish-beta.js:21:43 - error TS1212: Identifier expected. 'package' is a reserved word in strict mode. +@uifabric/build: 21 console.log(`Publishing ${chalk.magenta(package.packageName)} in ${packagePath}`); +@uifabric/build: ~~~~~~~ +@uifabric/build: tasks/preset.ts:1:7 - error TS2451: Cannot redeclare block-scoped variable 'preset'. +@uifabric/build: 1 const preset = require('../just.config'); +@uifabric/build: ~~~~~~ +@uifabric/build: create-package/plop-templates-node/just.config.ts:1:9 +@uifabric/build: 1 const { preset, just } = require('@uifabric/build'); +@uifabric/build: ~~~~~~ +@uifabric/build: 'preset' was also declared here. +@uifabric/build: update-package-versions.js:11:7 - error TS6133: 'path' is declared but its value is never read. +@uifabric/build: 11 const path = require('path'); +@uifabric/build: ~~~~ +@uifabric/build: update-package-versions.js:47:12 - error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. +@uifabric/build: 47 function updateDependencies(deps) { +@uifabric/build: ~~~~~~~~~~~~~~~~~~ +@uifabric/build: Found 17 errors. +@uifabric/build: [XX:XX:XX XM] x ------------------------------------ +@uifabric/build: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/build: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@uifabric/build: error Command failed with exit code 1. +@fluentui/ie11-polyfills: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/ie11-polyfills: [XX:XX:XX XM] x Command not defined: ts +@uifabric/webpack-utils: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@uifabric/webpack-utils: [XX:XX:XX XM] x ------------------------------------ +@uifabric/webpack-utils: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/webpack-utils/tsconfig.json" +@uifabric/webpack-utils: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/webpack-utils: at ChildProcess.emit (events.js:315:20) +@uifabric/webpack-utils: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/webpack-utils: at maybeClose (internal/child_process.js:1021:16) +@uifabric/webpack-utils: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/webpack-utils: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/webpack-utils: [XX:XX:XX XM] x stdout: +@uifabric/webpack-utils: [XX:XX:XX XM] x src/fabricAsyncLoaderInclude.ts:7:1 - error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. +@uifabric/webpack-utils: 7 export = (input: string) => +@uifabric/webpack-utils: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/webpack-utils: 8 input.match(/office-ui-fabric-react[\\/]lib[\\/]components[\\/]ContextualMenu[\\/]ContextualMenu.js/) || +@uifabric/webpack-utils: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/webpack-utils: 9 input.match(/office-ui-fabric-react[\\/]lib[\\/]components[\\/]Callout[\\/]Callout.js/); +@uifabric/webpack-utils: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/webpack-utils: Found 1 error. +@uifabric/webpack-utils: [XX:XX:XX XM] x ------------------------------------ +@uifabric/webpack-utils: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/webpack-utils: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@uifabric/webpack-utils: error Command failed with exit code 1. +@fluentui/docs-components: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/docs-components: [XX:XX:XX XM] x Command not defined: ts +@fluentui/react-component-event-listener: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-component-event-listener: [XX:XX:XX XM] x Command not defined: ts +@fluentui/react-component-nesting-registry: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-component-nesting-registry: [XX:XX:XX XM] x Command not defined: ts +@fluentui/react-component-ref: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-component-ref: [XX:XX:XX XM] x Command not defined: ts +@fluentui/react-context-selector: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-context-selector: [XX:XX:XX XM] x Command not defined: ts +@fluentui/react-proptypes: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-proptypes: [XX:XX:XX XM] x Command not defined: ts +@fluentui/state: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/state: [XX:XX:XX XM] x Command not defined: ts +@fluentui/styles: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/styles: [XX:XX:XX XM] x Command not defined: ts +@fluentui/accessibility: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/accessibility: [XX:XX:XX XM] x Command not defined: ts +@uifabric/merge-styles: [XX:XX:XX XM] x Error detected while running '_wrapFunction' +@uifabric/merge-styles: [XX:XX:XX XM] x ------------------------------------ +@uifabric/merge-styles: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json" +@uifabric/merge-styles: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/merge-styles: at ChildProcess.emit (events.js:315:20) +@uifabric/merge-styles: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/merge-styles: at maybeClose (internal/child_process.js:1021:16) +@uifabric/merge-styles: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/merge-styles: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/merge-styles: [XX:XX:XX XM] x stdout: +@uifabric/merge-styles: [XX:XX:XX XM] x src/mergeStyleSets.test.ts:168:15 - error TS2310: Type 'ISubComponentStyles' recursively references itself as a base type. +@uifabric/merge-styles: 168 interface ISubComponentStyles extends IStyleSet { +@uifabric/merge-styles: ~~~~~~~~~~~~~~~~~~~ +@uifabric/merge-styles: src/mergeStyleSets.test.ts:176:15 - error TS2310: Type 'IStyles' recursively references itself as a base type. +@uifabric/merge-styles: 176 interface IStyles extends IStyleSet { +@uifabric/merge-styles: ~~~~~~~ +@uifabric/merge-styles: Found 2 errors. +@uifabric/merge-styles: [XX:XX:XX XM] x ------------------------------------ +@uifabric/merge-styles: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/merge-styles: [XX:XX:XX XM] x Other tasks that did not complete: [ts:esm] +@uifabric/merge-styles: error Command failed with exit code 1. +@fluentui/react-northstar-styles-renderer: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-northstar-styles-renderer: [XX:XX:XX XM] x Command not defined: ts +@fluentui/react-northstar-emotion-renderer: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-northstar-emotion-renderer: [XX:XX:XX XM] x Command not defined: ts +@fluentui/react-northstar-fela-renderer: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-northstar-fela-renderer: [XX:XX:XX XM] x Command not defined: ts +@uifabric/utilities: [XX:XX:XX XM] x Error detected while running '_wrapFunction' +@uifabric/utilities: [XX:XX:XX XM] x ------------------------------------ +@uifabric/utilities: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/utilities/tsconfig.json" +@uifabric/utilities: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/utilities: at ChildProcess.emit (events.js:315:20) +@uifabric/utilities: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/utilities: at maybeClose (internal/child_process.js:1021:16) +@uifabric/utilities: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/utilities: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/utilities: [XX:XX:XX XM] x stdout: +@uifabric/utilities: [XX:XX:XX XM] x src/AutoScroll.ts:143:14 - error TS2790: The operand of a 'delete' operator must be optional. +@uifabric/utilities: 143 delete this._timeoutId; +@uifabric/utilities: ~~~~~~~~~~~~~~~ +@uifabric/utilities: src/dom/getRect.ts:19:16 - error TS2774: This condition will always return true since the function is always defined. Did you mean to call it instead? +@uifabric/utilities: 19 } else if ((element as HTMLElement).getBoundingClientRect) { +@uifabric/utilities: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/utilities: src/object.ts:9:11 - error TS2339: Property 'hasOwnProperty' does not exist on type 'TA'. +@uifabric/utilities: 9 if (a.hasOwnProperty(propName)) { +@uifabric/utilities: ~~~~~~~~~~~~~~ +@uifabric/utilities: src/object.ts:10:14 - error TS2339: Property 'hasOwnProperty' does not exist on type 'TB'. +@uifabric/utilities: 10 if (!b.hasOwnProperty(propName) || b[propName] !== a[propName]) { +@uifabric/utilities: ~~~~~~~~~~~~~~ +@uifabric/utilities: src/object.ts:10:42 - error TS2536: Type 'Extract' cannot be used to index type 'TB'. +@uifabric/utilities: 10 if (!b.hasOwnProperty(propName) || b[propName] !== a[propName]) { +@uifabric/utilities: ~~~~~~~~~~~ +@uifabric/utilities: src/object.ts:16:11 - error TS2339: Property 'hasOwnProperty' does not exist on type 'TB'. +@uifabric/utilities: 16 if (b.hasOwnProperty(propName)) { +@uifabric/utilities: ~~~~~~~~~~~~~~ +@uifabric/utilities: src/object.ts:17:14 - error TS2339: Property 'hasOwnProperty' does not exist on type 'TA'. +@uifabric/utilities: 17 if (!a.hasOwnProperty(propName)) { +@uifabric/utilities: ~~~~~~~~~~~~~~ +@uifabric/utilities: Found 7 errors. +@uifabric/utilities: [XX:XX:XX XM] x ------------------------------------ +@uifabric/utilities: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/utilities: [XX:XX:XX XM] x Other tasks that did not complete: [ts:esm] +@uifabric/utilities: error Command failed with exit code 1. +@fluentui/react-icons: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@fluentui/react-icons: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-icons: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-icons/tsconfig.json" +@fluentui/react-icons: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-icons: at ChildProcess.emit (events.js:315:20) +@fluentui/react-icons: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-icons: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-icons: at Socket. (internal/child_process.js:443:11) +@fluentui/react-icons: at Socket.emit (events.js:315:20) +@fluentui/react-icons: at Socket.EventEmitter.emit (domain.js:506:15) +@fluentui/react-icons: at Pipe. (net.js:674:12) +@fluentui/react-icons: at Pipe.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-icons: [XX:XX:XX XM] x stdout: +@fluentui/react-icons: [XX:XX:XX XM] x src/utils/createSvgIcon.ts:3:26 - error TS2307: Cannot find module './SvgIcon.scss' or its corresponding type declarations. +@fluentui/react-icons: 3 import * as classes from './SvgIcon.scss'; +@fluentui/react-icons: ~~~~~~~~~~~~~~~~ +@fluentui/react-icons: Found 1 error. +@fluentui/react-icons: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-icons: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-icons: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@fluentui/react-icons: error Command failed with exit code 1. +@fluentui/react-bindings: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-bindings: [XX:XX:XX XM] x Command not defined: ts +@fluentui/react-icons-northstar: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-icons-northstar: [XX:XX:XX XM] x Command not defined: ts +@fluentui/react-telemetry: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-telemetry: [XX:XX:XX XM] x Command not defined: ts +@uifabric/foundation: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@uifabric/foundation: [XX:XX:XX XM] x ------------------------------------ +@uifabric/foundation: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/foundation/tsconfig.json" +@uifabric/foundation: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/foundation: at ChildProcess.emit (events.js:315:20) +@uifabric/foundation: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/foundation: at maybeClose (internal/child_process.js:1021:16) +@uifabric/foundation: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/foundation: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/foundation: [XX:XX:XX XM] x stdout: +@uifabric/foundation: [XX:XX:XX XM] x src/createComponent.tsx:81:23 - error TS2352: Conversion of type 'TComponentProps & { styles: IConcatenatedStyleSet; tokens: TTokens; _defaultStyles: IConcatenatedStyleSet; theme: ITheme; className?: string | undefined; }' to type 'TViewProps & IDefaultSlotProps' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. +@uifabric/foundation: Type 'TComponentProps & { styles: IConcatenatedStyleSet; tokens: TTokens; _defaultStyles: IConcatenatedStyleSet; theme: ITheme; className?: string | undefined; }' is not comparable to type 'TViewProps'. +@uifabric/foundation: 'TComponentProps & { styles: IConcatenatedStyleSet; tokens: TTokens; _defaultStyles: IConcatenatedStyleSet; theme: ITheme; className?: string | undefined; }' is assignable to the constraint of type 'TViewProps', but 'TViewProps' could be instantiated with a different subtype of constraint 'object'. +@uifabric/foundation: 81 const viewProps = { +@uifabric/foundation: ~ +@uifabric/foundation: 82 ...componentProps, +@uifabric/foundation: ~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/foundation: ... +@uifabric/foundation: 86 theme, +@uifabric/foundation: ~~~~~~~~~~~~ +@uifabric/foundation: 87 } as TViewProps & IDefaultSlotProps; +@uifabric/foundation: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/foundation: Found 1 error. +@uifabric/foundation: [XX:XX:XX XM] x ------------------------------------ +@uifabric/foundation: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/foundation: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@uifabric/foundation: error Command failed with exit code 1. +@fluentui/react-northstar: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-northstar: [XX:XX:XX XM] x Command not defined: ts +office-ui-fabric-react: [XX:XX:XX XM] x Error detected while running 'ts:esm' +office-ui-fabric-react: [XX:XX:XX XM] x ------------------------------------ +office-ui-fabric-react: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/office-ui-fabric-react/tsconfig.json" +office-ui-fabric-react: at ChildProcess.exithandler (child_process.js:303:12) +office-ui-fabric-react: at ChildProcess.emit (events.js:315:20) +office-ui-fabric-react: at ChildProcess.EventEmitter.emit (domain.js:506:15) +office-ui-fabric-react: at maybeClose (internal/child_process.js:1021:16) +office-ui-fabric-react: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +office-ui-fabric-react: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +office-ui-fabric-react: [XX:XX:XX XM] x stdout: +office-ui-fabric-react: [XX:XX:XX XM] x src/components/ChoiceGroup/ChoiceGroup.base.tsx:147:19 - error TS2783: 'key' is specified more than once, so this usage will be overwritten. +office-ui-fabric-react: 147 key={option.key} +office-ui-fabric-react: ~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/ChoiceGroup/ChoiceGroup.base.tsx:151:19 +office-ui-fabric-react: 151 {...innerOptionProps} +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: This spread always overwrites this property. +office-ui-fabric-react: src/components/ChoiceGroup/ChoiceGroupOption/ChoiceGroupOption.base.tsx:82:38 - error TS2554: Expected 1 arguments, but got 2. +office-ui-fabric-react: 82 {onRenderField(this.props, this._onRenderField)} +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/ComboBox/ComboBox.tsx:421:13 - error TS2554: Expected 1 arguments, but got 2. +office-ui-fabric-react: 421 this._onRenderContainer, +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/DetailsList/DetailsColumn.base.tsx:194:14 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 194 delete this._dragDropSubscription; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/DetailsList/DetailsColumn.base.tsx:208:14 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 208 delete this._dragDropSubscription; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/DetailsList/DetailsHeader.base.tsx:132:14 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 132 delete this._subscriptionObject; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/DetailsList/DetailsHeader.base.tsx:154:14 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 154 delete this._subscriptionObject; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/DetailsList/DetailsRow.base.tsx:109:16 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 109 delete this._dragDropSubscription; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/DetailsList/DetailsRow.base.tsx:147:14 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 147 delete this._dragDropSubscription; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SuggestionItemDefault.tsx:12:72 - error TS2339: Property 'peoplePickerPersonaContent' does not exist on type 'typeof import("*.scss")'. +office-ui-fabric-react: 12
+office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SuggestionItemDefault.tsx:16:64 - error TS2339: Property 'peoplePickerPersona' does not exist on type 'typeof import("*.scss")'. +office-ui-fabric-react: 16 className={css('ms-PeoplePicker-Persona', stylesImport.peoplePickerPersona)} +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/FocusTrapZone/FocusTrapZone.tsx:106:12 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 106 delete this._previouslyFocusedElementOutsideTrapZone; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/GroupedList/GroupedListSection.tsx:174:16 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 174 delete this._dragDropSubscription; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/List/List.tsx:340:12 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 340 delete this._scrollElement; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/MarqueeSelection/MarqueeSelection.base.tsx:88:12 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 88 delete this._scrollableParent; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/MarqueeSelection/MarqueeSelection.base.tsx:89:12 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 89 delete this._scrollableSurface; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: src/components/Persona/Persona.deprecated.test.tsx:113:13 - error TS2322: Type 'ReactWrapper>' is not assignable to type 'ReactWrapper, any, Component<{}, {}, any>>'. +office-ui-fabric-react: Type 'HTMLAttributes' is not assignable to type 'ImgHTMLAttributes'. +office-ui-fabric-react: Types of property 'crossOrigin' are incompatible. +office-ui-fabric-react: Type 'string | undefined' is not assignable to type '"" | "anonymous" | "use-credentials" | undefined'. +office-ui-fabric-react: Type 'string' is not assignable to type '"" | "anonymous" | "use-credentials" | undefined'. +office-ui-fabric-react: 113 const image: ReactWrapper, any> = wrapper.find('ImageBase'); +office-ui-fabric-react: ~~~~~ +office-ui-fabric-react: src/components/Persona/Persona.deprecated.test.tsx:120:13 - error TS2322: Type 'ReactWrapper>' is not assignable to type 'ReactWrapper, any, Component<{}, {}, any>>'. +office-ui-fabric-react: 120 const image: ReactWrapper, any> = wrapper.find('ImageBase'); +office-ui-fabric-react: ~~~~~ +office-ui-fabric-react: src/components/Persona/Persona.test.tsx:190:13 - error TS2322: Type 'ReactWrapper>' is not assignable to type 'ReactWrapper, any, Component<{}, {}, any>>'. +office-ui-fabric-react: 190 const image: ReactWrapper, any> = wrapper.find('ImageBase'); +office-ui-fabric-react: ~~~~~ +office-ui-fabric-react: src/components/Persona/Persona.test.tsx:197:13 - error TS2322: Type 'ReactWrapper>' is not assignable to type 'ReactWrapper, any, Component<{}, {}, any>>'. +office-ui-fabric-react: 197 const image: ReactWrapper, any> = wrapper.find('ImageBase'); +office-ui-fabric-react: ~~~~~ +office-ui-fabric-react: src/components/Popup/Popup.tsx:79:12 - error TS2790: The operand of a 'delete' operator must be optional. +office-ui-fabric-react: 79 delete this._originalFocusedElement; +office-ui-fabric-react: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +office-ui-fabric-react: Found 21 errors. +office-ui-fabric-react: [XX:XX:XX XM] x ------------------------------------ +office-ui-fabric-react: [XX:XX:XX XM] x Error previously detected. See above for error messages. +office-ui-fabric-react: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +office-ui-fabric-react: error Command failed with exit code 1. +@fluentui/circulars-test: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/circulars-test: [XX:XX:XX XM] x Command not defined: ts +@fluentui/code-sandbox: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/code-sandbox: [XX:XX:XX XM] x Command not defined: ts +@fluentui/local-sandbox: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/local-sandbox: [XX:XX:XX XM] x Command not defined: ts +@fluentui/projects-test: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/projects-test: [XX:XX:XX XM] x Command not defined: ts +@uifabric/tsx-editor: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@uifabric/tsx-editor: [XX:XX:XX XM] x ------------------------------------ +@uifabric/tsx-editor: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/tsx-editor/tsconfig.json" +@uifabric/tsx-editor: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/tsx-editor: at ChildProcess.emit (events.js:315:20) +@uifabric/tsx-editor: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/tsx-editor: at maybeClose (internal/child_process.js:1021:16) +@uifabric/tsx-editor: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/tsx-editor: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/tsx-editor: [XX:XX:XX XM] x stdout: +@uifabric/tsx-editor: [XX:XX:XX XM] x ../monaco-editor/monaco-typescript.d.ts:8:25 - error TS2307: Cannot find module '@uifabric/monaco-editor' or its corresponding type declarations. +@uifabric/tsx-editor: 8 import * as monaco from '@uifabric/monaco-editor'; +@uifabric/tsx-editor: ~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/tsx-editor: src/components/Editor.tsx:1:25 - error TS2307: Cannot find module '@uifabric/monaco-editor' or its corresponding type declarations. +@uifabric/tsx-editor: 1 import * as monaco from '@uifabric/monaco-editor'; +@uifabric/tsx-editor: ~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/tsx-editor: src/components/TsxEditor.tsx:3:25 - error TS2307: Cannot find module '@uifabric/monaco-editor' or its corresponding type declarations. +@uifabric/tsx-editor: 3 import * as monaco from '@uifabric/monaco-editor'; +@uifabric/tsx-editor: ~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/tsx-editor: src/interfaces/monaco.ts:5:25 - error TS2307: Cannot find module '@uifabric/monaco-editor/esm/vs/editor/editor.api' or its corresponding type declarations. +@uifabric/tsx-editor: 5 import * as monaco from '@uifabric/monaco-editor/esm/vs/editor/editor.api'; +@uifabric/tsx-editor: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/tsx-editor: src/transpiler/transpile.ts:2:25 - error TS2307: Cannot find module '@uifabric/monaco-editor' or its corresponding type declarations. +@uifabric/tsx-editor: 2 import * as monaco from '@uifabric/monaco-editor'; +@uifabric/tsx-editor: ~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/tsx-editor: src/transpiler/transpile.ts:26:11 - error TS7006: Parameter 'worker' implicitly has an 'any' type. +@uifabric/tsx-editor: 26 .then(worker => { +@uifabric/tsx-editor: ~~~~~~ +@uifabric/tsx-editor: src/transpiler/transpile.ts:31:62 - error TS7006: Parameter 'syntacticDiagnostics' implicitly has an 'any' type. +@uifabric/tsx-editor: 31 return worker.getSyntacticDiagnostics(filename).then(syntacticDiagnostics => { +@uifabric/tsx-editor: ~~~~~~~~~~~~~~~~~~~~ +@uifabric/tsx-editor: src/transpiler/transpile.ts:32:62 - error TS7006: Parameter 'd' implicitly has an 'any' type. +@uifabric/tsx-editor: 32 syntacticDiagnostics = syntacticDiagnostics.filter(d => d.category === 1 /*error*/); +@uifabric/tsx-editor: ~ +@uifabric/tsx-editor: src/transpiler/transpile.ts:50:12 - error TS7006: Parameter 'ex' implicitly has an 'any' type. +@uifabric/tsx-editor: 50 .catch(ex => { +@uifabric/tsx-editor: ~~ +@uifabric/tsx-editor: src/utilities/getQueryParam.test.ts:7:12 - error TS2790: The operand of a 'delete' operator must be optional. +@uifabric/tsx-editor: 7 delete window.location; +@uifabric/tsx-editor: ~~~~~~~~~~~~~~~ +@uifabric/tsx-editor: Found 10 errors. +@uifabric/tsx-editor: [XX:XX:XX XM] x ------------------------------------ +@uifabric/tsx-editor: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/tsx-editor: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@uifabric/tsx-editor: error Command failed with exit code 1. +@fluentui/e2e: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/e2e: [XX:XX:XX XM] x Command not defined: ts +codesandbox-react-northstar-template: [XX:XX:XX XM] x Error detected while running '_wrapFunction' +codesandbox-react-northstar-template: [XX:XX:XX XM] x ------------------------------------ +codesandbox-react-northstar-template: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/codesandbox-react-northstar-template/tsconfig.json" +codesandbox-react-northstar-template: at ChildProcess.exithandler (child_process.js:303:12) +codesandbox-react-northstar-template: at ChildProcess.emit (events.js:315:20) +codesandbox-react-northstar-template: at ChildProcess.EventEmitter.emit (domain.js:506:15) +codesandbox-react-northstar-template: at maybeClose (internal/child_process.js:1021:16) +codesandbox-react-northstar-template: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +codesandbox-react-northstar-template: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +codesandbox-react-northstar-template: [XX:XX:XX XM] x stdout: +codesandbox-react-northstar-template: [XX:XX:XX XM] x src/index.tsx:15:8 - error TS2307: Cannot find module '@fluentui/react-northstar' or its corresponding type declarations. +codesandbox-react-northstar-template: 15 } from '@fluentui/react-northstar'; +codesandbox-react-northstar-template: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-northstar-template: src/index.tsx:16:28 - error TS2307: Cannot find module '@fluentui/code-sandbox' or its corresponding type declarations. +codesandbox-react-northstar-template: 16 import { SandboxApp } from '@fluentui/code-sandbox'; +codesandbox-react-northstar-template: ~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-northstar-template: Found 2 errors. +codesandbox-react-northstar-template: [XX:XX:XX XM] x ------------------------------------ +codesandbox-react-northstar-template: [XX:XX:XX XM] x Error previously detected. See above for error messages. +codesandbox-react-northstar-template: [XX:XX:XX XM] x Other tasks that did not complete: [ts:esm] +codesandbox-react-northstar-template: error Command failed with exit code 1. +@fluentui/react-builder: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/react-builder: [XX:XX:XX XM] x Command not defined: ts +@fluentui/docs: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/docs: [XX:XX:XX XM] x Command not defined: ts +@uifabric/example-app-base: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@uifabric/example-app-base: [XX:XX:XX XM] x ------------------------------------ +@uifabric/example-app-base: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/example-app-base/tsconfig.json" +@uifabric/example-app-base: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/example-app-base: at ChildProcess.emit (events.js:315:20) +@uifabric/example-app-base: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/example-app-base: at maybeClose (internal/child_process.js:1021:16) +@uifabric/example-app-base: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/example-app-base: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/example-app-base: [XX:XX:XX XM] x stdout: +@uifabric/example-app-base: [XX:XX:XX XM] x src/components/Page/Page.tsx:21:25 - error TS2307: Cannot find module './Page.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 21 import * as styles from './Page.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/Page/sections/BestPracticesSection.tsx:7:25 - error TS2307: Cannot find module '../Page.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 7 import * as styles from '../Page.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/Page/sections/ExamplesSection.tsx:4:25 - error TS2307: Cannot find module '../Page.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 4 import * as styles from '../Page.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/Page/sections/FeedbackSection.tsx:5:25 - error TS2307: Cannot find module '../Page.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 5 import * as styles from '../Page.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/Page/sections/ImplementationSection.tsx:5:25 - error TS2307: Cannot find module '../Page.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 5 import * as styles from '../Page.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/Page/sections/MarkdownSection.tsx:7:25 - error TS2307: Cannot find module '../Page.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 7 import * as styles from '../Page.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/Page/sections/OtherPageSection.tsx:4:25 - error TS2307: Cannot find module '../Page.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 4 import * as styles from '../Page.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/Page/sections/OverviewSection.tsx:4:25 - error TS2307: Cannot find module '../Page.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 4 import * as styles from '../Page.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/PlatformPicker/PlatformPicker.tsx:12:25 - error TS2307: Cannot find module './PlatformPicker.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 12 import * as styles from './PlatformPicker.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/Table/Table.tsx:4:25 - error TS2307: Cannot find module './Table.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 4 import * as styles from './Table.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/TopNav/TopNav.tsx:7:25 - error TS2307: Cannot find module './TopNav.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 7 import * as styles from './TopNav.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/components/Video/Video.tsx:4:25 - error TS2307: Cannot find module './Video.module.scss' or its corresponding type declarations. +@uifabric/example-app-base: 4 import * as styles from './Video.module.scss'; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/utilities/createDemoApp.tsx:52:71 - error TS2783: 'appDefinition' is specified more than once, so this usage will be overwritten. +@uifabric/example-app-base: 52 const App: React.FunctionComponent = props => ; +@uifabric/example-app-base: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/example-app-base: src/utilities/createDemoApp.tsx:52:101 +@uifabric/example-app-base: 52 const App: React.FunctionComponent = props => ; +@uifabric/example-app-base: ~~~~~~~~~~ +@uifabric/example-app-base: This spread always overwrites this property. +@uifabric/example-app-base: Found 13 errors. +@uifabric/example-app-base: [XX:XX:XX XM] x ------------------------------------ +@uifabric/example-app-base: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/example-app-base: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@uifabric/example-app-base: error Command failed with exit code 1. +@fluentui/perf: [XX:XX:XX XM] x Cannot find config file "null". Please create a file called "just.config.js" in the root of the project next to "package.json". +@fluentui/perf: [XX:XX:XX XM] x Command not defined: ts +@uifabric/date-time: [XX:XX:XX XM] x Error detected while running '_wrapFunction' +@uifabric/date-time: [XX:XX:XX XM] x ------------------------------------ +@uifabric/date-time: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/date-time/tsconfig.json" +@uifabric/date-time: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/date-time: at ChildProcess.emit (events.js:315:20) +@uifabric/date-time: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/date-time: at maybeClose (internal/child_process.js:1021:16) +@uifabric/date-time: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/date-time: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/date-time: [XX:XX:XX XM] x stdout: +@uifabric/date-time: [XX:XX:XX XM] x src/components/Calendar/examples/Calendar.Inline.ContiguousWorkWeekDays.Example.tsx:30:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 30
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.CustomDayCellRef.Example.tsx:28:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 28
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.DateBoundaries.Example.tsx:27:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 27
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.MonthOnly.Example.tsx:30:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 30
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.MonthSelection.Example.tsx:34:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 34
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.MonthSelection.Example.tsx:54:44 - error TS2339: Property 'button' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 54 +@uifabric/date-time: ~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.MonthSelection.Example.tsx:55:44 - error TS2339: Property 'button' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 55 +@uifabric/date-time: ~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.MultidayDayView.Example.tsx:35:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 35
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.MultidayDayView.Example.tsx:59:31 - error TS2339: Property 'dropdown' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 59 className={styles.dropdown} +@uifabric/date-time: ~~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.NonContiguousWorkWeekDays.Example.tsx:30:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 30
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.OverlayedMonthPicker.Example.tsx:21:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 21
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.SixWeeks.tsx:21:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 21
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.WeekNumbers.Example.tsx:21:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 21
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.WeekSelection.Example.tsx:34:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 34
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.WeekSelection.Example.tsx:54:44 - error TS2339: Property 'button' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 54 +@uifabric/date-time: ~~~~~~ +@uifabric/date-time: src/components/Calendar/examples/Calendar.Inline.WeekSelection.Example.tsx:55:44 - error TS2339: Property 'button' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 55 +@uifabric/date-time: ~~~~~~ +@uifabric/date-time: src/components/WeeklyDayPicker/examples/WeeklyDayPicker.Inline.Example.tsx:22:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 22
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/WeeklyDayPicker/examples/WeeklyDayPicker.Inline.Example.tsx:34:44 - error TS2339: Property 'button' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 34 +@uifabric/date-time: ~~~~~~ +@uifabric/date-time: src/components/WeeklyDayPicker/examples/WeeklyDayPicker.Inline.Example.tsx:35:44 - error TS2339: Property 'button' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 35 +@uifabric/date-time: ~~~~~~ +@uifabric/date-time: src/components/WeeklyDayPicker/examples/WeeklyDayPicker.Inline.Expandable.Example.tsx:27:30 - error TS2339: Property 'wrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 27
+@uifabric/date-time: ~~~~~~~ +@uifabric/date-time: src/components/WeeklyDayPicker/examples/WeeklyDayPicker.Inline.Expandable.Example.tsx:34:31 - error TS2339: Property 'button' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 34 className={styles.button} +@uifabric/date-time: ~~~~~~ +@uifabric/date-time: src/components/WeeklyDayPicker/examples/WeeklyDayPicker.Inline.Expandable.Example.tsx:49:44 - error TS2339: Property 'button' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 49 +@uifabric/date-time: ~~~~~~ +@uifabric/date-time: src/components/WeeklyDayPicker/examples/WeeklyDayPicker.Inline.Expandable.Example.tsx:50:44 - error TS2339: Property 'button' does not exist on type 'typeof import("*.scss")'. +@uifabric/date-time: 50 +@uifabric/date-time: ~~~~~~ +@uifabric/date-time: ../tsx-editor/lib/interfaces/monaco.d.ts:1:25 - error TS2307: Cannot find module '@uifabric/monaco-editor/esm/vs/editor/editor.api' or its corresponding type declarations. +@uifabric/date-time: 1 import * as monaco from '@uifabric/monaco-editor/esm/vs/editor/editor.api'; +@uifabric/date-time: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/date-time: Found 24 errors. +@uifabric/date-time: [XX:XX:XX XM] x ------------------------------------ +@uifabric/date-time: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/date-time: [XX:XX:XX XM] x Other tasks that did not complete: [ts:esm] +@uifabric/date-time: error Command failed with exit code 1. +@uifabric/experiments: [XX:XX:XX XM] x Error detected while running '_wrapFunction' +@uifabric/experiments: [XX:XX:XX XM] x ------------------------------------ +@uifabric/experiments: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/experiments/tsconfig.json" +@uifabric/experiments: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/experiments: at ChildProcess.emit (events.js:315:20) +@uifabric/experiments: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/experiments: at maybeClose (internal/child_process.js:1021:16) +@uifabric/experiments: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/experiments: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/experiments: [XX:XX:XX XM] x stdout: +@uifabric/experiments: [XX:XX:XX XM] x src/components/FloatingSuggestions/FloatingPeopleSuggestions/defaults/DefaultPeopleSuggestionsItem.tsx:12:72 - error TS2339: Property 'peoplePickerPersonaContent' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 12
+@uifabric/experiments: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/FloatingSuggestions/FloatingPeopleSuggestions/defaults/DefaultPeopleSuggestionsItem.tsx:16:64 - error TS2339: Property 'peoplePickerPersona' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 16 className={css('ms-PeoplePicker-Persona', stylesImport.peoplePickerPersona)} +@uifabric/experiments: ~~~~~~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/FloatingSuggestions/FloatingSuggestions.tsx:202:27 - error TS2339: Property 'callout' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 202 className={styles.callout} +@uifabric/experiments: ~~~~~~~ +@uifabric/experiments: src/components/SelectedItemsList/Items/subcomponents/DefaultEditingItem.tsx:75:102 - error TS2339: Property 'editingContainer' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 75 +@uifabric/experiments: ~~~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/SelectedItemsList/Items/subcomponents/DefaultEditingItem.tsx:86:29 - error TS2339: Property 'editingInput' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 86 className={styles.editingInput} +@uifabric/experiments: ~~~~~~~~~~~~ +@uifabric/experiments: src/components/SelectedItemsList/SelectedPeopleList/SelectedPeopleList.test.tsx:135:9 - error TS2322: Type 'ComponentType>' is not assignable to type 'ComponentClass, any> | FunctionComponent> | undefined'. +@uifabric/experiments: Type 'ComponentClass, any>' is not assignable to type 'ComponentClass, any> | FunctionComponent> | undefined'. +@uifabric/experiments: Type 'ComponentClass, any>' is not assignable to type 'ComponentClass, any>'. +@uifabric/experiments: Types of property 'propTypes' are incompatible. +@uifabric/experiments: Type 'WeakValidationMap> | undefined' is not assignable to type 'WeakValidationMap> | undefined'. +@uifabric/experiments: Type 'WeakValidationMap>' is not assignable to type 'WeakValidationMap>'. +@uifabric/experiments: Types of property 'item' are incompatible. +@uifabric/experiments: Type 'Validator | undefined' is not assignable to type 'Validator | undefined'. +@uifabric/experiments: Type 'Validator' is not assignable to type 'Validator'. +@uifabric/experiments: Type 'unknown' is not assignable to type 'IPersonaProps & BaseSelectedItem'. +@uifabric/experiments: Type 'unknown' is not assignable to type 'IPersonaProps'. +@uifabric/experiments: 135 onRenderItem={SelectedItem} +@uifabric/experiments: ~~~~~~~~~~~~ +@uifabric/experiments: src/components/SelectedItemsList/SelectedItemsList.types.ts:75:3 +@uifabric/experiments: 75 onRenderItem?: React.ComponentType>; +@uifabric/experiments: ~~~~~~~~~~~~ +@uifabric/experiments: The expected type comes from property 'onRenderItem' which is declared here on type 'IntrinsicAttributes & Pick, "onChange" | ... 15 more ... | "dropItemsAt"> & RefAttributes<...>' +@uifabric/experiments: src/components/StaticList/StaticList.tsx:14:37 - error TS2339: Property 'root' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 14 { className: css(stylesImport.root, className) }, +@uifabric/experiments: ~~~~ +@uifabric/experiments: src/components/Tile/Tile.tsx:175:97 - error TS2339: Property 'label' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 175 +@uifabric/experiments: ~~~~~ +@uifabric/experiments: src/components/Tile/Tile.tsx:253:68 - error TS2339: Property 'description' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 253 className={css('ms-Tile-description', TileStylesModule.description)} +@uifabric/experiments: ~~~~~~~~~~~ +@uifabric/experiments: src/components/Tile/examples/Tile.Folder.Example.tsx:85:56 - error TS2339: Property 'tileFolder' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 85 +@uifabric/experiments: ~~~~~~~~~~ +@uifabric/experiments: src/components/Tile/examples/Tile.Media.Example.tsx:21:50 - error TS2339: Property 'activityBlock' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 21 +@uifabric/experiments: ~~~~~~~~~~~~~ +@uifabric/experiments: src/components/Tile/examples/Tile.Media.Example.tsx:41:50 - error TS2339: Property 'activityBlock' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 41 +@uifabric/experiments: ~~~~~~~~~~~~~ +@uifabric/experiments: src/components/Tile/examples/Tile.Media.Example.tsx:61:50 - error TS2339: Property 'activityBlock' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 61 +@uifabric/experiments: ~~~~~~~~~~~~~ +@uifabric/experiments: src/components/Tile/examples/Tile.Media.Example.tsx:81:50 - error TS2339: Property 'activityBlock' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 81 +@uifabric/experiments: ~~~~~~~~~~~~~ +@uifabric/experiments: src/components/VirtualizedList/examples/VirtualizedList.Basic.Example.tsx:33:72 - error TS2339: Property 'fixedHeight' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 33 +@uifabric/experiments: ~~~~~~~~~~~ +@uifabric/experiments: src/components/VirtualizedList/examples/VirtualizedList.Basic2.Example.tsx:39:98 - error TS2339: Property 'fixedHeight' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 39 +@uifabric/experiments: ~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signal.tsx:15:83 - error TS2339: Property 'signal' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 15 +@uifabric/experiments: ~~~~~~ +@uifabric/experiments: src/components/signals/SignalField.tsx:24:27 - error TS2339: Property 'signalField' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 24 SignalFieldStyles.signalField, +@uifabric/experiments: ~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/SignalField.tsx:26:30 - error TS2339: Property 'wide' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 26 [SignalFieldStyles.wide]: signalsFieldMode === 'wide', +@uifabric/experiments: ~~~~ +@uifabric/experiments: src/components/signals/SignalField.tsx:27:30 - error TS2339: Property 'compact' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 27 [SignalFieldStyles.compact]: signalsFieldMode === 'compact', +@uifabric/experiments: ~~~~~~~ +@uifabric/experiments: src/components/signals/SignalField.tsx:33:42 - error TS2339: Property 'signalFieldValue' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 33 {props.children} +@uifabric/experiments: ~~~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:13:60 - error TS2339: Property 'youCheckedOut' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 13 return ; +@uifabric/experiments: ~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:17:60 - error TS2339: Property 'blocked' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 17 return ; +@uifabric/experiments: ~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:24:34 - error TS2339: Property 'missingMetadata' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 24 signalClass={SignalsStyles.missingMetadata} +@uifabric/experiments: ~~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:31:60 - error TS2339: Property 'warning' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 31 return ; +@uifabric/experiments: ~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:35:60 - error TS2339: Property 'awaitingApproval' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 35 return ; +@uifabric/experiments: ~~~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:39:60 - error TS2339: Property 'trending' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 39 return ; +@uifabric/experiments: ~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:43:60 - error TS2339: Property 'someoneCheckedOut' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 43 return ; +@uifabric/experiments: ~~~~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:47:60 - error TS2339: Property 'record' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 47 return ; +@uifabric/experiments: ~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:51:60 - error TS2339: Property 'needsRepublishing' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 51 return ; +@uifabric/experiments: ~~~~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:55:60 - error TS2339: Property 'itemScheduled' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 55 return ; +@uifabric/experiments: ~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:65:54 - error TS2339: Property 'signal' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 65 +@uifabric/experiments: ~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:65:76 - error TS2339: Property 'newSignal' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 65 +@uifabric/experiments: ~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:66:70 - error TS2339: Property 'newIcon' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 66 +@uifabric/experiments: ~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:77:58 - error TS2339: Property 'liveEdit' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 77 return ; +@uifabric/experiments: ~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:81:60 - error TS2339: Property 'mention' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 81 return ; +@uifabric/experiments: ~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:91:42 - error TS2339: Property 'comments' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 91 +@uifabric/experiments: ~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:92:70 - error TS2339: Property 'commentsIcon' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 92 +@uifabric/experiments: ~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:93:54 - error TS2339: Property 'commentsCount' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 93 {children ? {children} : null} +@uifabric/experiments: ~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:102:60 - error TS2339: Property 'unseenReply' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 102 return ; +@uifabric/experiments: ~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:106:60 - error TS2339: Property 'unseenEdit' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 106 return ; +@uifabric/experiments: ~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:110:60 - error TS2339: Property 'readOnly' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 110 return ; +@uifabric/experiments: ~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:114:60 - error TS2339: Property 'emailed' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 114 return ; +@uifabric/experiments: ~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:118:60 - error TS2339: Property 'shared' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 118 return ; +@uifabric/experiments: ~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:122:60 - error TS2339: Property 'folder' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 122 return ; +@uifabric/experiments: ~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:126:60 - error TS2339: Property 'folder' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 126 return ; +@uifabric/experiments: ~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:130:60 - error TS2339: Property 'folder' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 130 return ; +@uifabric/experiments: ~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:134:60 - error TS2339: Property 'malwareDetected' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 134 return ; +@uifabric/experiments: ~~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:143:60 - error TS2339: Property 'external' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 143 return ; +@uifabric/experiments: ~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:147:60 - error TS2339: Property 'bookmarkOutline' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 147 return ; +@uifabric/experiments: ~~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:151:60 - error TS2339: Property 'bookmarkFilled' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 151 return ; +@uifabric/experiments: ~~~~~~~~~~~~~~ +@uifabric/experiments: src/components/signals/Signals.tsx:169:82 - error TS2339: Property 'signal' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 169 +@uifabric/experiments: ~~~~~~ +@uifabric/experiments: src/utilities/scrolling/ScrollContainer.tsx:76:68 - error TS2339: Property 'root' does not exist on type 'typeof import("*.scss")'. +@uifabric/experiments: 76 className={css('ms-ScrollContainer', ScrollContainerStyles.root, className)} +@uifabric/experiments: ~~~~ +@uifabric/experiments: Found 53 errors. +@uifabric/experiments: [XX:XX:XX XM] x ------------------------------------ +@uifabric/experiments: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/experiments: [XX:XX:XX XM] x Other tasks that did not complete: [ts:esm] +@uifabric/experiments: error Command failed with exit code 1. +@uifabric/react-cards: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@uifabric/react-cards: [XX:XX:XX XM] x ------------------------------------ +@uifabric/react-cards: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-cards/tsconfig.json" +@uifabric/react-cards: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/react-cards: at ChildProcess.emit (events.js:315:20) +@uifabric/react-cards: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/react-cards: at maybeClose (internal/child_process.js:1021:16) +@uifabric/react-cards: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/react-cards: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/react-cards: [XX:XX:XX XM] x stdout: +@uifabric/react-cards: [XX:XX:XX XM] x src/next/Card.stories.tsx:16:57 - error TS2339: Property 'hStack' does not exist on type 'typeof import("*.scss")'. +@uifabric/react-cards: 16 return
; +@uifabric/react-cards: ~~~~~~ +@uifabric/react-cards: src/next/Card.stories.tsx:16:74 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@uifabric/react-cards: 16 return
; +@uifabric/react-cards: ~~~~~~ +@uifabric/react-cards: ../tsx-editor/lib/interfaces/monaco.d.ts:1:25 - error TS2307: Cannot find module '@uifabric/monaco-editor/esm/vs/editor/editor.api' or its corresponding type declarations. +@uifabric/react-cards: 1 import * as monaco from '@uifabric/monaco-editor/esm/vs/editor/editor.api'; +@uifabric/react-cards: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@uifabric/react-cards: Found 3 errors. +@uifabric/react-cards: [XX:XX:XX XM] x ------------------------------------ +@uifabric/react-cards: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/react-cards: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@uifabric/react-cards: error Command failed with exit code 1. +@fluentui/react-avatar: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@fluentui/react-avatar: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-avatar: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-avatar/tsconfig.json" +@fluentui/react-avatar: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-avatar: at ChildProcess.emit (events.js:315:20) +@fluentui/react-avatar: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-avatar: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-avatar: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@fluentui/react-avatar: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-avatar: [XX:XX:XX XM] x stdout: +@fluentui/react-avatar: [XX:XX:XX XM] x src/components/Avatar/Avatar.tsx:10:38 - error TS2345: Argument of type 'typeof import("*.scss")' is not assignable to parameter of type 'Record'. +@fluentui/react-avatar: 10 const useAvatarClasses = makeClasses(classes); +@fluentui/react-avatar: ~~~~~~~ +@fluentui/react-avatar: src/components/Badge/Badge.tsx:9:44 - error TS2345: Argument of type 'typeof import("*.scss")' is not assignable to parameter of type 'Record'. +@fluentui/react-avatar: Property 'styles' is incompatible with index signature. +@fluentui/react-avatar: Type '{ [className: string]: string; }' is not assignable to type 'string'. +@fluentui/react-avatar: 9 export const useBadgeClasses = makeClasses(classes); +@fluentui/react-avatar: ~~~~~~~ +@fluentui/react-avatar: src/components/utils/StoryExample.tsx:5:27 - error TS2339: Property 'root' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-avatar: 5
+@fluentui/react-avatar: ~~~~ +@fluentui/react-avatar: src/components/utils/StoryExample.tsx:7:29 - error TS2339: Property 'content' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-avatar: 7
{children}
+@fluentui/react-avatar: ~~~~~~~ +@fluentui/react-avatar: Found 4 errors. +@fluentui/react-avatar: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-avatar: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-avatar: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@fluentui/react-avatar: error Command failed with exit code 1. +@fluentui/react-button: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@fluentui/react-button: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-button: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-button/tsconfig.json" +@fluentui/react-button: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-button: at ChildProcess.emit (events.js:315:20) +@fluentui/react-button: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-button: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-button: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@fluentui/react-button: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-button: [XX:XX:XX XM] x stdout: +@fluentui/react-button: [XX:XX:XX XM] x src/components/Button/Button.stories.tsx:12:57 - error TS2339: Property 'hStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 12 return
; +@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/Button/Button.stories.tsx:12:74 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 12 return
; +@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/Button/Button.stories.tsx:19:88 - error TS2339: Property 'text' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 19 const Text = (props: React.PropsWithChildren<{}>) =>

; +@fluentui/react-button: ~~~~ +@fluentui/react-button: src/components/CompoundButton/CompoundButton.stories.tsx:12:57 - error TS2339: Property 'hStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 12 return
; +@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/CompoundButton/CompoundButton.stories.tsx:12:74 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 12 return
; +@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/CompoundButton/CompoundButton.stories.tsx:19:88 - error TS2339: Property 'text' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 19 const Text = (props: React.PropsWithChildren<{}>) =>

; +@fluentui/react-button: ~~~~ +@fluentui/react-button: src/components/MenuButton/MenuButton.stories.tsx:21:27 - error TS2339: Property 'hStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 21
+@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/MenuButton/MenuButton.stories.tsx:52:29 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 52
+@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/MenuButton/MenuButton.stories.tsx:83:29 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 83
+@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/SplitButton/SplitButton.stories.tsx:21:27 - error TS2339: Property 'hStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 21
+@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/SplitButton/SplitButton.stories.tsx:52:29 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 52
+@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/SplitButton/SplitButton.stories.tsx:83:29 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 83
+@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/ToggleButton/ToggleButton.stories.tsx:8:27 - error TS2339: Property 'hStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 8
+@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/ToggleButton/ToggleButton.stories.tsx:39:29 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 39
+@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/ToggleButton/ToggleButton.stories.tsx:67:29 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 67
+@fluentui/react-button: ~~~~~~ +@fluentui/react-button: src/components/ToggleButton/ToggleButton.stories.tsx:76:29 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-button: 76
+@fluentui/react-button: ~~~~~~ +@fluentui/react-button: ../tsx-editor/lib/interfaces/monaco.d.ts:1:25 - error TS2307: Cannot find module '@uifabric/monaco-editor/esm/vs/editor/editor.api' or its corresponding type declarations. +@fluentui/react-button: 1 import * as monaco from '@uifabric/monaco-editor/esm/vs/editor/editor.api'; +@fluentui/react-button: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-button: Found 17 errors. +@fluentui/react-button: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-button: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-button: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@fluentui/react-button: error Command failed with exit code 1. +@fluentui/react-checkbox: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@fluentui/react-checkbox: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-checkbox: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-checkbox/tsconfig.json" +@fluentui/react-checkbox: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-checkbox: at ChildProcess.emit (events.js:315:20) +@fluentui/react-checkbox: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-checkbox: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-checkbox: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@fluentui/react-checkbox: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-checkbox: [XX:XX:XX XM] x stdout: +@fluentui/react-checkbox: [XX:XX:XX XM] x src/next/useCheckboxClasses.tsx:15:50 - error TS2345: Argument of type 'typeof import("*.scss")' is not assignable to parameter of type 'Record'. +@fluentui/react-checkbox: Property 'styles' is incompatible with index signature. +@fluentui/react-checkbox: Type '{ [className: string]: string; }' is not assignable to type 'string'. +@fluentui/react-checkbox: 15 const defaultClassResolver = createClassResolver(classes); +@fluentui/react-checkbox: ~~~~~~~ +@fluentui/react-checkbox: Found 1 error. +@fluentui/react-checkbox: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-checkbox: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-checkbox: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@fluentui/react-checkbox: error Command failed with exit code 1. +@fluentui/react-image: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@fluentui/react-image: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-image: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-image/tsconfig.json" +@fluentui/react-image: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-image: at ChildProcess.emit (events.js:315:20) +@fluentui/react-image: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-image: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-image: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@fluentui/react-image: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-image: [XX:XX:XX XM] x stdout: +@fluentui/react-image: [XX:XX:XX XM] x src/components/Image/Image.stories.tsx:12:57 - error TS2339: Property 'hStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-image: 12 return
; +@fluentui/react-image: ~~~~~~ +@fluentui/react-image: src/components/Image/Image.stories.tsx:12:74 - error TS2339: Property 'vStack' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-image: 12 return
; +@fluentui/react-image: ~~~~~~ +@fluentui/react-image: src/components/Image/Image.tsx:9:44 - error TS2345: Argument of type 'typeof import("*.scss")' is not assignable to parameter of type 'Record'. +@fluentui/react-image: Property 'styles' is incompatible with index signature. +@fluentui/react-image: Type '{ [className: string]: string; }' is not assignable to type 'string'. +@fluentui/react-image: 9 export const useImageClasses = makeClasses(classes); +@fluentui/react-image: ~~~~~~~ +@fluentui/react-image: Found 3 errors. +@fluentui/react-image: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-image: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-image: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@fluentui/react-image: error Command failed with exit code 1. +@fluentui/react-link: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@fluentui/react-link: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-link: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-link/tsconfig.json" +@fluentui/react-link: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-link: at ChildProcess.emit (events.js:315:20) +@fluentui/react-link: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-link: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-link: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@fluentui/react-link: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-link: [XX:XX:XX XM] x stdout: +@fluentui/react-link: [XX:XX:XX XM] x src/next/Link.tsx:16:56 - error TS2339: Property 'button' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-link: 16 const propControlledClasses = [isButton && classes.button, isDisabled && classes.disabled]; +@fluentui/react-link: ~~~~~~ +@fluentui/react-link: src/next/Link.tsx:16:86 - error TS2339: Property 'disabled' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-link: 16 const propControlledClasses = [isButton && classes.button, isDisabled && classes.disabled]; +@fluentui/react-link: ~~~~~~~~ +@fluentui/react-link: src/next/Link.tsx:21:36 - error TS2339: Property 'root' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-link: 21 root: css(className, classes.root, globalClassNames.root, ...rootStaticClasses, ...propControlledClasses), +@fluentui/react-link: ~~~~ +@fluentui/react-link: Found 3 errors. +@fluentui/react-link: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-link: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-link: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@fluentui/react-link: error Command failed with exit code 1. +@fluentui/react-slider: [XX:XX:XX XM] x Error detected while running '_wrapFunction' +@fluentui/react-slider: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-slider: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-slider/tsconfig.json" +@fluentui/react-slider: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-slider: at ChildProcess.emit (events.js:315:20) +@fluentui/react-slider: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-slider: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-slider: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@fluentui/react-slider: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-slider: [XX:XX:XX XM] x stdout: +@fluentui/react-slider: [XX:XX:XX XM] x src/next/Slider.tsx:38:27 - error TS2339: Property 'disabled' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 38 disabled && classes.disabled, +@fluentui/react-slider: ~~~~~~~~ +@fluentui/react-slider: src/next/Slider.tsx:39:27 - error TS2339: Property 'vertical' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 39 vertical && classes.vertical, +@fluentui/react-slider: ~~~~~~~~ +@fluentui/react-slider: src/next/Slider.tsx:46:36 - error TS2339: Property 'root' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 46 root: css(className, classes.root, globalClassNames.root, ...propClasses), +@fluentui/react-slider: ~~~~ +@fluentui/react-slider: src/next/Slider.tsx:47:30 - error TS2339: Property 'container' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 47 container: css(classes.container, globalClassNames.container, ...propClasses), +@fluentui/react-slider: ~~~~~~~~~ +@fluentui/react-slider: src/next/Slider.tsx:48:29 - error TS2339: Property 'slideBox' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 48 slideBox: css(classes.slideBox, globalClassNames.slideBox, ...propClasses), +@fluentui/react-slider: ~~~~~~~~ +@fluentui/react-slider: src/next/Slider.tsx:49:25 - error TS2339: Property 'line' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 49 line: css(classes.line, globalClassNames.line, ...propClasses), +@fluentui/react-slider: ~~~~ +@fluentui/react-slider: src/next/Slider.tsx:50:26 - error TS2339: Property 'thumb' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 50 thumb: css(classes.thumb, globalClassNames.thumb, ...propClasses), +@fluentui/react-slider: ~~~~~ +@fluentui/react-slider: src/next/Slider.tsx:51:34 - error TS2339: Property 'activeSection' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 51 activeSection: css(classes.activeSection, globalClassNames.activeSection, ...propClasses), +@fluentui/react-slider: ~~~~~~~~~~~~~ +@fluentui/react-slider: src/next/Slider.tsx:52:36 - error TS2339: Property 'inactiveSection' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 52 inactiveSection: css(classes.inactiveSection, globalClassNames.inactiveSection, ...propClasses), +@fluentui/react-slider: ~~~~~~~~~~~~~~~ +@fluentui/react-slider: src/next/Slider.tsx:53:34 - error TS2339: Property 'lineContainer' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 53 lineContainer: css(classes.lineContainer, ...propClasses), +@fluentui/react-slider: ~~~~~~~~~~~~~ +@fluentui/react-slider: src/next/Slider.tsx:54:31 - error TS2339: Property 'valueLabel' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 54 valueLabel: css(classes.valueLabel, globalClassNames.valueLabel, ...propClasses), +@fluentui/react-slider: ~~~~~~~~~~ +@fluentui/react-slider: src/next/Slider.tsx:55:31 - error TS2339: Property 'titleLabel' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 55 titleLabel: css(classes.titleLabel, titleLabelClassName, ...propClasses), +@fluentui/react-slider: ~~~~~~~~~~ +@fluentui/react-slider: src/next/Slider.tsx:57:29 - error TS2339: Property 'zeroTick' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-slider: 57 zeroTick: css(classes.zeroTick, globalClassNames.zeroTick, ...propClasses), +@fluentui/react-slider: ~~~~~~~~ +@fluentui/react-slider: Found 13 errors. +@fluentui/react-slider: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-slider: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-slider: [XX:XX:XX XM] x Other tasks that did not complete: [ts:esm] +@fluentui/react-slider: error Command failed with exit code 1. +@fluentui/react-tabs: [XX:XX:XX XM] x Error detected while running '_wrapFunction' +@fluentui/react-tabs: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-tabs: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-tabs/tsconfig.json" +@fluentui/react-tabs: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-tabs: at ChildProcess.emit (events.js:315:20) +@fluentui/react-tabs: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-tabs: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-tabs: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@fluentui/react-tabs: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-tabs: [XX:XX:XX XM] x stdout: +@fluentui/react-tabs: [XX:XX:XX XM] x src/next/Pivot.tsx:33:39 - error TS2339: Property 'linkSize_large' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 33 linkSize === 'large' && classes.linkSize_large, +@fluentui/react-tabs: ~~~~~~~~~~~~~~ +@fluentui/react-tabs: src/next/Pivot.tsx:34:40 - error TS2339: Property 'linkFormat_tabs' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 34 linkFormat === 'tabs' && classes.linkFormat_tabs, +@fluentui/react-tabs: ~~~~~~~~~~~~~~~ +@fluentui/react-tabs: src/next/Pivot.tsx:40:17 - error TS2339: Property 'root' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 40 classes.root, +@fluentui/react-tabs: ~~~~ +@fluentui/react-tabs: src/next/Pivot.tsx:46:25 - error TS2339: Property 'link' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 46 link: css(classes.link, globalClassNames.link, ...modifierClasses), +@fluentui/react-tabs: ~~~~ +@fluentui/react-tabs: src/next/Pivot.tsx:47:31 - error TS2339: Property 'linkInMenu' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 47 linkInMenu: css(classes.linkInMenu, globalClassNames.linkInMenu, ...modifierClasses), +@fluentui/react-tabs: ~~~~~~~~~~ +@fluentui/react-tabs: src/next/Pivot.tsx:49:35 - error TS2339: Property 'linkIsSelected' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 49 linkIsSelected: css(classes.linkIsSelected, globalClassNames.linkIsSelected), +@fluentui/react-tabs: ~~~~~~~~~~~~~~ +@fluentui/react-tabs: src/next/Pivot.tsx:50:32 - error TS2339: Property 'linkContent' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 50 linkContent: css(classes.linkContent, globalClassNames.linkContent, ...modifierClasses), +@fluentui/react-tabs: ~~~~~~~~~~~ +@fluentui/react-tabs: src/next/Pivot.tsx:51:25 - error TS2339: Property 'text' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 51 text: css(classes.text, globalClassNames.text, ...modifierClasses), +@fluentui/react-tabs: ~~~~ +@fluentui/react-tabs: src/next/Pivot.tsx:52:26 - error TS2339: Property 'count' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 52 count: css(classes.count, globalClassNames.count, ...modifierClasses), +@fluentui/react-tabs: ~~~~~ +@fluentui/react-tabs: src/next/Pivot.tsx:54:34 - error TS2339: Property 'itemContainer' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 54 itemContainer: css(classes.itemContainer, ...modifierClasses), +@fluentui/react-tabs: ~~~~~~~~~~~~~ +@fluentui/react-tabs: src/next/Pivot.tsx:55:39 - error TS2339: Property 'overflowMenuButton' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-tabs: 55 overflowMenuButton: css(classes.overflowMenuButton, globalClassNames.overflowMenuButton, ...modifierClasses), +@fluentui/react-tabs: ~~~~~~~~~~~~~~~~~~ +@fluentui/react-tabs: Found 11 errors. +@fluentui/react-tabs: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-tabs: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-tabs: [XX:XX:XX XM] x Other tasks that did not complete: [ts:esm] +@fluentui/react-tabs: error Command failed with exit code 1. +@fluentui/react-toggle: [XX:XX:XX XM] x Error detected while running '_wrapFunction' +@fluentui/react-toggle: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-toggle: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/react-toggle/tsconfig.json" +@fluentui/react-toggle: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-toggle: at ChildProcess.emit (events.js:315:20) +@fluentui/react-toggle: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-toggle: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-toggle: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@fluentui/react-toggle: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-toggle: [XX:XX:XX XM] x stdout: +@fluentui/react-toggle: [XX:XX:XX XM] x src/next/Toggle.tsx:31:26 - error TS2339: Property 'checked' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-toggle: 31 checked && classes.checked, +@fluentui/react-toggle: ~~~~~~~ +@fluentui/react-toggle: src/next/Toggle.tsx:32:27 - error TS2339: Property 'disabled' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-toggle: 32 disabled && classes.disabled, +@fluentui/react-toggle: ~~~~~~~~ +@fluentui/react-toggle: src/next/Toggle.tsx:33:30 - error TS2339: Property 'inlineLabel' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-toggle: 33 inlineLabel && classes.inlineLabel, +@fluentui/react-toggle: ~~~~~~~~~~~ +@fluentui/react-toggle: src/next/Toggle.tsx:34:31 - error TS2339: Property 'onOffMissing' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-toggle: 34 onOffMissing && classes.onOffMissing, +@fluentui/react-toggle: ~~~~~~~~~~~~ +@fluentui/react-toggle: src/next/Toggle.tsx:40:36 - error TS2339: Property 'root' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-toggle: 40 root: css(className, classes.root, globalClassNames.root, ...rootStaticClasses, ...propControlledClasses), +@fluentui/react-toggle: ~~~~ +@fluentui/react-toggle: src/next/Toggle.tsx:41:26 - error TS2339: Property 'label' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-toggle: 41 label: css(classes.label, globalClassNames.label, ...propControlledClasses), +@fluentui/react-toggle: ~~~~~ +@fluentui/react-toggle: src/next/Toggle.tsx:42:30 - error TS2339: Property 'container' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-toggle: 42 container: css(classes.container, globalClassNames.container, ...propControlledClasses), +@fluentui/react-toggle: ~~~~~~~~~ +@fluentui/react-toggle: src/next/Toggle.tsx:43:25 - error TS2339: Property 'pill' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-toggle: 43 pill: css(classes.pill, globalClassNames.pill, ...propControlledClasses), +@fluentui/react-toggle: ~~~~ +@fluentui/react-toggle: src/next/Toggle.tsx:44:26 - error TS2339: Property 'thumb' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-toggle: 44 thumb: css(classes.thumb, globalClassNames.thumb, ...propControlledClasses), +@fluentui/react-toggle: ~~~~~ +@fluentui/react-toggle: src/next/Toggle.tsx:45:25 - error TS2339: Property 'text' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-toggle: 45 text: css(classes.text, globalClassNames.text, ...propControlledClasses), +@fluentui/react-toggle: ~~~~ +@fluentui/react-toggle: Found 10 errors. +@fluentui/react-toggle: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-toggle: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-toggle: [XX:XX:XX XM] x Other tasks that did not complete: [ts:esm] +@fluentui/react-toggle: error Command failed with exit code 1. +theming-designer: [XX:XX:XX XM] x Error detected while running '_wrapFunction' +theming-designer: [XX:XX:XX XM] x ------------------------------------ +theming-designer: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/apps/theming-designer/tsconfig.json" +theming-designer: at ChildProcess.exithandler (child_process.js:303:12) +theming-designer: at ChildProcess.emit (events.js:315:20) +theming-designer: at ChildProcess.EventEmitter.emit (domain.js:506:15) +theming-designer: at maybeClose (internal/child_process.js:1021:16) +theming-designer: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +theming-designer: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +theming-designer: [XX:XX:XX XM] x stdout: +theming-designer: [XX:XX:XX XM] x ../../packages/tsx-editor/lib/interfaces/monaco.d.ts:1:25 - error TS2307: Cannot find module '@uifabric/monaco-editor/esm/vs/editor/editor.api' or its corresponding type declarations. +theming-designer: 1 import * as monaco from '@uifabric/monaco-editor/esm/vs/editor/editor.api'; +theming-designer: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +theming-designer: Found 1 error. +theming-designer: [XX:XX:XX XM] x ------------------------------------ +theming-designer: [XX:XX:XX XM] x Error previously detected. See above for error messages. +theming-designer: [XX:XX:XX XM] x Other tasks that did not complete: [ts:esm] +theming-designer: error Command failed with exit code 1. +@uifabric/api-docs: [XX:XX:XX XM] x Error detected while running '_wrapFunction' +@uifabric/api-docs: [XX:XX:XX XM] x ------------------------------------ +@uifabric/api-docs: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/api-docs/tsconfig.json" +@uifabric/api-docs: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/api-docs: at ChildProcess.emit (events.js:315:20) +@uifabric/api-docs: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/api-docs: at maybeClose (internal/child_process.js:1021:16) +@uifabric/api-docs: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@uifabric/api-docs: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/api-docs: [XX:XX:XX XM] x stdout: +@uifabric/api-docs: [XX:XX:XX XM] x src/tableJson.ts:52:9 - error TS2322: Type 'readonly HeritageType[] | undefined' is not assignable to type 'HeritageType[] | undefined'. +@uifabric/api-docs: The type 'readonly HeritageType[]' is 'readonly' and cannot be assigned to the mutable type 'HeritageType[]'. +@uifabric/api-docs: 52 const extendsArr: HeritageType[] | undefined = +@uifabric/api-docs: ~~~~~~~~~~ +@uifabric/api-docs: Found 1 error. +@uifabric/api-docs: [XX:XX:XX XM] x ------------------------------------ +@uifabric/api-docs: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@uifabric/api-docs: [XX:XX:XX XM] x Other tasks that did not complete: [ts:esm] +@uifabric/api-docs: error Command failed with exit code 1. +@fluentui/react-flex: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@fluentui/react-flex: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-flex: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-flex/tsconfig.json" +@fluentui/react-flex: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-flex: at ChildProcess.emit (events.js:315:20) +@fluentui/react-flex: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-flex: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-flex: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@fluentui/react-flex: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-flex: [XX:XX:XX XM] x stdout: +@fluentui/react-flex: [XX:XX:XX XM] x src/components/Flex/Flex.tsx:22:34 - error TS2345: Argument of type 'typeof import("*.scss")' is not assignable to parameter of type 'Record'. +@fluentui/react-flex: Property 'styles' is incompatible with index signature. +@fluentui/react-flex: Type '{ [className: string]: string; }' is not assignable to type 'string'. +@fluentui/react-flex: 22 classes: createClassResolver(classes), +@fluentui/react-flex: ~~~~~~~ +@fluentui/react-flex: src/components/FlexItem/FlexItem.tsx:20:34 - error TS2345: Argument of type 'typeof import("*.scss")' is not assignable to parameter of type 'Record'. +@fluentui/react-flex: 20 classes: createClassResolver(classes), +@fluentui/react-flex: ~~~~~~~ +@fluentui/react-flex: Found 2 errors. +@fluentui/react-flex: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-flex: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-flex: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@fluentui/react-flex: error Command failed with exit code 1. +@fluentui/react-next: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@fluentui/react-next: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-next: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/react-next/tsconfig.json" +@fluentui/react-next: at ChildProcess.exithandler (child_process.js:303:12) +@fluentui/react-next: at ChildProcess.emit (events.js:315:20) +@fluentui/react-next: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@fluentui/react-next: at maybeClose (internal/child_process.js:1021:16) +@fluentui/react-next: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +@fluentui/react-next: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +@fluentui/react-next: [XX:XX:XX XM] x stdout: +@fluentui/react-next: [XX:XX:XX XM] x ../office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroup.base.tsx:147:19 - error TS2783: 'key' is specified more than once, so this usage will be overwritten. +@fluentui/react-next: 147 key={option.key} +@fluentui/react-next: ~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroup.base.tsx:151:19 +@fluentui/react-next: 151 {...innerOptionProps} +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: This spread always overwrites this property. +@fluentui/react-next: ../office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroupOption/ChoiceGroupOption.base.tsx:82:38 - error TS2554: Expected 1 arguments, but got 2. +@fluentui/react-next: 82 {onRenderField(this.props, this._onRenderField)} +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/ComboBox/ComboBox.tsx:421:13 - error TS2554: Expected 1 arguments, but got 2. +@fluentui/react-next: 421 this._onRenderContainer, +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/DetailsList/DetailsColumn.base.tsx:194:14 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 194 delete this._dragDropSubscription; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/DetailsList/DetailsColumn.base.tsx:208:14 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 208 delete this._dragDropSubscription; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/DetailsList/DetailsHeader.base.tsx:132:14 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 132 delete this._subscriptionObject; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/DetailsList/DetailsHeader.base.tsx:154:14 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 154 delete this._subscriptionObject; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/DetailsList/DetailsRow.base.tsx:109:16 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 109 delete this._dragDropSubscription; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/DetailsList/DetailsRow.base.tsx:147:14 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 147 delete this._dragDropSubscription; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SuggestionItemDefault.tsx:12:72 - error TS2339: Property 'peoplePickerPersonaContent' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-next: 12
+@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SuggestionItemDefault.tsx:16:64 - error TS2339: Property 'peoplePickerPersona' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-next: 16 className={css('ms-PeoplePicker-Persona', stylesImport.peoplePickerPersona)} +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/FocusTrapZone/FocusTrapZone.tsx:106:12 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 106 delete this._previouslyFocusedElementOutsideTrapZone; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/GroupedList/GroupedListSection.tsx:174:16 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 174 delete this._dragDropSubscription; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/List/List.tsx:340:12 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 340 delete this._scrollElement; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/MarqueeSelection/MarqueeSelection.base.tsx:88:12 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 88 delete this._scrollableParent; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/MarqueeSelection/MarqueeSelection.base.tsx:89:12 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 89 delete this._scrollableSurface; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: ../office-ui-fabric-react/src/components/Popup/Popup.tsx:79:12 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 79 delete this._originalFocusedElement; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: src/components/ComboBox/ComboBox.tsx:465:13 - error TS2554: Expected 1 arguments, but got 2. +@fluentui/react-next: 465 this._onRenderContainer, +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SuggestionItemDefault.tsx:12:72 - error TS2339: Property 'peoplePickerPersonaContent' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-next: 12
+@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SuggestionItemDefault.tsx:16:64 - error TS2339: Property 'peoplePickerPersona' does not exist on type 'typeof import("*.scss")'. +@fluentui/react-next: 16 className={css('ms-PeoplePicker-Persona', stylesImport.peoplePickerPersona)} +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: src/components/FocusTrapZone/FocusTrapZone.tsx:90:12 - error TS2790: The operand of a 'delete' operator must be optional. +@fluentui/react-next: 90 delete this._previouslyFocusedElementOutsideTrapZone; +@fluentui/react-next: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@fluentui/react-next: src/components/Persona/Persona.test.tsx:194:13 - error TS2322: Type 'ReactWrapper>' is not assignable to type 'ReactWrapper, unknown, Component<{}, {}, any>>'. +@fluentui/react-next: Type 'HTMLAttributes' is not assignable to type 'ImgHTMLAttributes'. +@fluentui/react-next: Types of property 'crossOrigin' are incompatible. +@fluentui/react-next: Type 'string | undefined' is not assignable to type '"" | "anonymous" | "use-credentials" | undefined'. +@fluentui/react-next: Type 'string' is not assignable to type '"" | "anonymous" | "use-credentials" | undefined'. +@fluentui/react-next: 194 const image: ReactWrapper, unknown> = wrapper.find('ImageBase'); +@fluentui/react-next: ~~~~~ +@fluentui/react-next: src/components/Persona/Persona.test.tsx:201:13 - error TS2322: Type 'ReactWrapper>' is not assignable to type 'ReactWrapper, unknown, Component<{}, {}, any>>'. +@fluentui/react-next: 201 const image: ReactWrapper, unknown> = wrapper.find('ImageBase'); +@fluentui/react-next: ~~~~~ +@fluentui/react-next: Found 23 errors. +@fluentui/react-next: [XX:XX:XX XM] x ------------------------------------ +@fluentui/react-next: [XX:XX:XX XM] x Error previously detected. See above for error messages. +@fluentui/react-next: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +@fluentui/react-next: error Command failed with exit code 1. +codesandbox-react-next-template: [XX:XX:XX XM] x Error detected while running 'ts:esm' +codesandbox-react-next-template: [XX:XX:XX XM] x ------------------------------------ +codesandbox-react-next-template: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/codesandbox-react-next-template/tsconfig.json" +codesandbox-react-next-template: at ChildProcess.exithandler (child_process.js:303:12) +codesandbox-react-next-template: at ChildProcess.emit (events.js:315:20) +codesandbox-react-next-template: at ChildProcess.EventEmitter.emit (domain.js:506:15) +codesandbox-react-next-template: at maybeClose (internal/child_process.js:1021:16) +codesandbox-react-next-template: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +codesandbox-react-next-template: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +codesandbox-react-next-template: [XX:XX:XX XM] x stdout: +codesandbox-react-next-template: [XX:XX:XX XM] x ../../packages/office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroup.base.tsx:147:19 - error TS2783: 'key' is specified more than once, so this usage will be overwritten. +codesandbox-react-next-template: 147 key={option.key} +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroup.base.tsx:151:19 +codesandbox-react-next-template: 151 {...innerOptionProps} +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: This spread always overwrites this property. +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroupOption/ChoiceGroupOption.base.tsx:82:38 - error TS2554: Expected 1 arguments, but got 2. +codesandbox-react-next-template: 82 {onRenderField(this.props, this._onRenderField)} +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/ComboBox/ComboBox.tsx:421:13 - error TS2554: Expected 1 arguments, but got 2. +codesandbox-react-next-template: 421 this._onRenderContainer, +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsColumn.base.tsx:194:14 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 194 delete this._dragDropSubscription; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsColumn.base.tsx:208:14 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 208 delete this._dragDropSubscription; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsHeader.base.tsx:132:14 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 132 delete this._subscriptionObject; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsHeader.base.tsx:154:14 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 154 delete this._subscriptionObject; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsRow.base.tsx:109:16 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 109 delete this._dragDropSubscription; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsRow.base.tsx:147:14 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 147 delete this._dragDropSubscription; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SuggestionItemDefault.tsx:12:72 - error TS2339: Property 'peoplePickerPersonaContent' does not exist on type 'typeof import("*.scss")'. +codesandbox-react-next-template: 12
+codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SuggestionItemDefault.tsx:16:64 - error TS2339: Property 'peoplePickerPersona' does not exist on type 'typeof import("*.scss")'. +codesandbox-react-next-template: 16 className={css('ms-PeoplePicker-Persona', stylesImport.peoplePickerPersona)} +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/FocusTrapZone/FocusTrapZone.tsx:106:12 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 106 delete this._previouslyFocusedElementOutsideTrapZone; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/GroupedList/GroupedListSection.tsx:174:16 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 174 delete this._dragDropSubscription; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/List/List.tsx:340:12 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 340 delete this._scrollElement; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/MarqueeSelection/MarqueeSelection.base.tsx:88:12 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 88 delete this._scrollableParent; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/MarqueeSelection/MarqueeSelection.base.tsx:89:12 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 89 delete this._scrollableSurface; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: ../../packages/office-ui-fabric-react/src/components/Popup/Popup.tsx:79:12 - error TS2790: The operand of a 'delete' operator must be optional. +codesandbox-react-next-template: 79 delete this._originalFocusedElement; +codesandbox-react-next-template: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +codesandbox-react-next-template: Found 17 errors. +codesandbox-react-next-template: [XX:XX:XX XM] x ------------------------------------ +codesandbox-react-next-template: [XX:XX:XX XM] x Error previously detected. See above for error messages. +codesandbox-react-next-template: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +codesandbox-react-next-template: error Command failed with exit code 1. +perf-test: [XX:XX:XX XM] x Error detected while running 'ts:esm' +perf-test: [XX:XX:XX XM] x ------------------------------------ +perf-test: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/perf-test/tsconfig.json" +perf-test: at ChildProcess.exithandler (child_process.js:303:12) +perf-test: at ChildProcess.emit (events.js:315:20) +perf-test: at ChildProcess.EventEmitter.emit (domain.js:506:15) +perf-test: at maybeClose (internal/child_process.js:1021:16) +perf-test: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +perf-test: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +perf-test: [XX:XX:XX XM] x stdout: +perf-test: [XX:XX:XX XM] x ../../packages/office-ui-fabric-react/src/components/Calendar/Calendar.tsx:22:31 - error TS2307: Cannot find module './Calendar.scss' or its corresponding type declarations. +perf-test: 22 import * as stylesImport from './Calendar.scss'; +perf-test: ~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/Calendar/CalendarDay.tsx:32:31 - error TS2307: Cannot find module './Calendar.scss' or its corresponding type declarations. +perf-test: 32 import * as stylesImport from './Calendar.scss'; +perf-test: ~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/Calendar/CalendarMonth.tsx:15:31 - error TS2307: Cannot find module './Calendar.scss' or its corresponding type declarations. +perf-test: 15 import * as stylesImport from './Calendar.scss'; +perf-test: ~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/Calendar/CalendarYear.tsx:5:31 - error TS2307: Cannot find module './Calendar.scss' or its corresponding type declarations. +perf-test: 5 import * as stylesImport from './Calendar.scss'; +perf-test: ~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroup.base.tsx:147:19 - error TS2783: 'key' is specified more than once, so this usage will be overwritten. +perf-test: 147 key={option.key} +perf-test: ~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroup.base.tsx:151:19 +perf-test: 151 {...innerOptionProps} +perf-test: ~~~~~~~~~~~~~~~~~~~~~ +perf-test: This spread always overwrites this property. +perf-test: ../../packages/office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroupOption/ChoiceGroupOption.base.tsx:82:38 - error TS2554: Expected 1 arguments, but got 2. +perf-test: 82 {onRenderField(this.props, this._onRenderField)} +perf-test: ~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/ComboBox/ComboBox.tsx:421:13 - error TS2554: Expected 1 arguments, but got 2. +perf-test: 421 this._onRenderContainer, +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsColumn.base.tsx:194:14 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 194 delete this._dragDropSubscription; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsColumn.base.tsx:208:14 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 208 delete this._dragDropSubscription; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsHeader.base.tsx:132:14 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 132 delete this._subscriptionObject; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsHeader.base.tsx:154:14 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 154 delete this._subscriptionObject; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsRow.base.tsx:109:16 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 109 delete this._dragDropSubscription; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsRow.base.tsx:147:14 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 147 delete this._dragDropSubscription; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/ExtendedPicker/BaseExtendedPicker.tsx:5:31 - error TS2307: Cannot find module './BaseExtendedPicker.scss' or its corresponding type declarations. +perf-test: 5 import * as stylesImport from './BaseExtendedPicker.scss'; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/FloatingPicker/BaseFloatingPicker.tsx:2:31 - error TS2307: Cannot find module './BaseFloatingPicker.scss' or its corresponding type declarations. +perf-test: 2 import * as stylesImport from './BaseFloatingPicker.scss'; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SuggestionItemDefault.tsx:5:31 - error TS2307: Cannot find module '../PeoplePicker.scss' or its corresponding type declarations. +perf-test: 5 import * as stylesImport from '../PeoplePicker.scss'; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/FloatingPicker/Suggestions/SuggestionsControl.tsx:12:31 - error TS2307: Cannot find module './SuggestionsControl.scss' or its corresponding type declarations. +perf-test: 12 import * as stylesImport from './SuggestionsControl.scss'; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/FloatingPicker/Suggestions/SuggestionsCore.tsx:5:31 - error TS2307: Cannot find module './SuggestionsCore.scss' or its corresponding type declarations. +perf-test: 5 import * as stylesImport from './SuggestionsCore.scss'; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/FocusTrapZone/FocusTrapZone.tsx:106:12 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 106 delete this._previouslyFocusedElementOutsideTrapZone; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/GroupedList/GroupedListSection.tsx:174:16 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 174 delete this._dragDropSubscription; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/List/List.tsx:340:12 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 340 delete this._scrollElement; +perf-test: ~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/MarqueeSelection/MarqueeSelection.base.tsx:88:12 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 88 delete this._scrollableParent; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/MarqueeSelection/MarqueeSelection.base.tsx:89:12 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 89 delete this._scrollableSurface; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/Popup/Popup.tsx:79:12 - error TS2790: The operand of a 'delete' operator must be optional. +perf-test: 79 delete this._originalFocusedElement; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/SelectedItemsList/SelectedPeopleList/Items/ExtendedSelectedItem.tsx:6:31 - error TS2307: Cannot find module './ExtendedSelectedItem.scss' or its corresponding type declarations. +perf-test: 6 import * as stylesImport from './ExtendedSelectedItem.scss'; +perf-test: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/pickers/BasePicker.tsx:34:31 - error TS2307: Cannot find module './BasePicker.scss' or its corresponding type declarations. +perf-test: 34 import * as stylesImport from './BasePicker.scss'; +perf-test: ~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/pickers/Suggestions/Suggestions.tsx:25:31 - error TS2307: Cannot find module './Suggestions.scss' or its corresponding type declarations. +perf-test: 25 import * as stylesImport from './Suggestions.scss'; +perf-test: ~~~~~~~~~~~~~~~~~~~~ +perf-test: ../../packages/office-ui-fabric-react/src/components/pickers/Suggestions/SuggestionsItem.tsx:8:31 - error TS2307: Cannot find module './Suggestions.scss' or its corresponding type declarations. +perf-test: 8 import * as stylesImport from './Suggestions.scss'; +perf-test: ~~~~~~~~~~~~~~~~~~~~ +perf-test: Found 28 errors. +perf-test: [XX:XX:XX XM] x ------------------------------------ +perf-test: [XX:XX:XX XM] x Error previously detected. See above for error messages. +perf-test: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +perf-test: error Command failed with exit code 1. +vr-tests: [XX:XX:XX XM] x Error detected while running 'ts:esm' +vr-tests: [XX:XX:XX XM] x ------------------------------------ +vr-tests: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/vr-tests/tsconfig.json" +vr-tests: at ChildProcess.exithandler (child_process.js:303:12) +vr-tests: at ChildProcess.emit (events.js:315:20) +vr-tests: at ChildProcess.EventEmitter.emit (domain.js:506:15) +vr-tests: at maybeClose (internal/child_process.js:1021:16) +vr-tests: at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) +vr-tests: at Process.callbackTrampoline (internal/async_hooks.js:120:14) +vr-tests: [XX:XX:XX XM] x stdout: +vr-tests: [XX:XX:XX XM] x ../../packages/office-ui-fabric-react/src/components/Calendar/Calendar.tsx:22:31 - error TS2307: Cannot find module './Calendar.scss' or its corresponding type declarations. +vr-tests: 22 import * as stylesImport from './Calendar.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/Calendar/CalendarDay.tsx:32:31 - error TS2307: Cannot find module './Calendar.scss' or its corresponding type declarations. +vr-tests: 32 import * as stylesImport from './Calendar.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/Calendar/CalendarMonth.tsx:15:31 - error TS2307: Cannot find module './Calendar.scss' or its corresponding type declarations. +vr-tests: 15 import * as stylesImport from './Calendar.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/Calendar/CalendarYear.tsx:5:31 - error TS2307: Cannot find module './Calendar.scss' or its corresponding type declarations. +vr-tests: 5 import * as stylesImport from './Calendar.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroup.base.tsx:147:19 - error TS2783: 'key' is specified more than once, so this usage will be overwritten. +vr-tests: 147 key={option.key} +vr-tests: ~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroup.base.tsx:151:19 +vr-tests: 151 {...innerOptionProps} +vr-tests: ~~~~~~~~~~~~~~~~~~~~~ +vr-tests: This spread always overwrites this property. +vr-tests: ../../packages/office-ui-fabric-react/src/components/ChoiceGroup/ChoiceGroupOption/ChoiceGroupOption.base.tsx:82:38 - error TS2554: Expected 1 arguments, but got 2. +vr-tests: 82 {onRenderField(this.props, this._onRenderField)} +vr-tests: ~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/ComboBox/ComboBox.tsx:421:13 - error TS2554: Expected 1 arguments, but got 2. +vr-tests: 421 this._onRenderContainer, +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsColumn.base.tsx:194:14 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 194 delete this._dragDropSubscription; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsColumn.base.tsx:208:14 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 208 delete this._dragDropSubscription; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsHeader.base.tsx:132:14 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 132 delete this._subscriptionObject; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsHeader.base.tsx:154:14 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 154 delete this._subscriptionObject; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsRow.base.tsx:109:16 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 109 delete this._dragDropSubscription; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/DetailsList/DetailsRow.base.tsx:147:14 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 147 delete this._dragDropSubscription; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/ExtendedPicker/BaseExtendedPicker.tsx:5:31 - error TS2307: Cannot find module './BaseExtendedPicker.scss' or its corresponding type declarations. +vr-tests: 5 import * as stylesImport from './BaseExtendedPicker.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/FloatingPicker/BaseFloatingPicker.tsx:2:31 - error TS2307: Cannot find module './BaseFloatingPicker.scss' or its corresponding type declarations. +vr-tests: 2 import * as stylesImport from './BaseFloatingPicker.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/FloatingPicker/PeoplePicker/PeoplePickerItems/SuggestionItemDefault.tsx:5:31 - error TS2307: Cannot find module '../PeoplePicker.scss' or its corresponding type declarations. +vr-tests: 5 import * as stylesImport from '../PeoplePicker.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/FloatingPicker/Suggestions/SuggestionsControl.tsx:12:31 - error TS2307: Cannot find module './SuggestionsControl.scss' or its corresponding type declarations. +vr-tests: 12 import * as stylesImport from './SuggestionsControl.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/FloatingPicker/Suggestions/SuggestionsCore.tsx:5:31 - error TS2307: Cannot find module './SuggestionsCore.scss' or its corresponding type declarations. +vr-tests: 5 import * as stylesImport from './SuggestionsCore.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/FocusTrapZone/FocusTrapZone.tsx:106:12 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 106 delete this._previouslyFocusedElementOutsideTrapZone; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/GroupedList/GroupedListSection.tsx:174:16 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 174 delete this._dragDropSubscription; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/List/List.tsx:340:12 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 340 delete this._scrollElement; +vr-tests: ~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/MarqueeSelection/MarqueeSelection.base.tsx:88:12 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 88 delete this._scrollableParent; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/MarqueeSelection/MarqueeSelection.base.tsx:89:12 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 89 delete this._scrollableSurface; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/Popup/Popup.tsx:79:12 - error TS2790: The operand of a 'delete' operator must be optional. +vr-tests: 79 delete this._originalFocusedElement; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/SelectedItemsList/SelectedPeopleList/Items/ExtendedSelectedItem.tsx:6:31 - error TS2307: Cannot find module './ExtendedSelectedItem.scss' or its corresponding type declarations. +vr-tests: 6 import * as stylesImport from './ExtendedSelectedItem.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/pickers/BasePicker.tsx:34:31 - error TS2307: Cannot find module './BasePicker.scss' or its corresponding type declarations. +vr-tests: 34 import * as stylesImport from './BasePicker.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/pickers/Suggestions/Suggestions.tsx:25:31 - error TS2307: Cannot find module './Suggestions.scss' or its corresponding type declarations. +vr-tests: 25 import * as stylesImport from './Suggestions.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~~~~ +vr-tests: ../../packages/office-ui-fabric-react/src/components/pickers/Suggestions/SuggestionsItem.tsx:8:31 - error TS2307: Cannot find module './Suggestions.scss' or its corresponding type declarations. +vr-tests: 8 import * as stylesImport from './Suggestions.scss'; +vr-tests: ~~~~~~~~~~~~~~~~~~~~ +vr-tests: Found 28 errors. +vr-tests: [XX:XX:XX XM] x ------------------------------------ +vr-tests: [XX:XX:XX XM] x Error previously detected. See above for error messages. +vr-tests: [XX:XX:XX XM] x Other tasks that did not complete: [ts:commonjs] +vr-tests: error Command failed with exit code 1. +@uifabric/fabric-website: [XX:XX:XX XM] x Error detected while running 'ts:esm' +@uifabric/fabric-website: [XX:XX:XX XM] x ------------------------------------ +@uifabric/fabric-website: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/apps/fabric-website/tsconfig.json" +@uifabric/fabric-website: at ChildProcess.exithandler (child_process.js:303:12) +@uifabric/fabric-website: at ChildProcess.emit (events.js:315:20) +@uifabric/fabric-website: at ChildProcess.EventEmitter.emit (domain.js:506:15) +@uifabric/fabric-website: at maybeClose (internal/child_process.js:1021:16) +@uifabric/fabric-website: at Socket. (internal/child_process.js:443:11) +@uifabric/fabric-website: at Socket.emit (events.js:315:20) +@uifabric/fabric-website: at Socket.EventEmitter.emit (domain.js:506:15) +@uifabric/fabric-website: at Pipe. (net.js:674:12) +@uifabric/fabric-website: at Pipe.callbackTrampoline (internal/async_hooks.js:120:14) +@uifabric/fabric-website: [XX:XX:XX XM] x stdout: +@uifabric/fabric-website: [XX:XX:XX XM] x src/components/Nav/Nav.tsx:73:35 - error TS2339: Property 'navWrapper' does not exist on type 'typeof import("*.scss")'. +@uifabric/fabric-website: 73 return
{this._renderPageNav(pages)}
; +@uifabric/fabric-website: ~~~~~~~~~~ +@uifabric/fabric-website: src/components/Nav/Nav.tsx:90:34 - error TS2339: Property 'nav' does not exist on type 'typeof import("*.scss")'. +@uifabric/fabric-website: 90