From 91d292db29ab25003445c3b65be18b27c2ff197f Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 31 May 2018 15:24:16 -0700 Subject: [PATCH 01/16] Add ncie deep elaborations --- Jakefile.js | 2 +- src/compiler/checker.ts | 144 ++++++++++++++---- src/compiler/utilities.ts | 19 +++ src/services/utilities.ts | 17 --- src/tsconfig-base.json | 2 +- .../deeplyNestedAssignabilityIssue.ts | 29 ++++ 6 files changed, 168 insertions(+), 45 deletions(-) create mode 100644 tests/cases/compiler/deeplyNestedAssignabilityIssue.ts diff --git a/Jakefile.js b/Jakefile.js index 55729eecaad7d..b854c709b1fd3 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -249,7 +249,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts options += " --lib " + opts.lib; } else { - options += " --lib es5"; + options += " --lib es2015"; } options += " --noUnusedLocals --noUnusedParameters --strictNullChecks"; diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index fcddb03f63d1c..59afd10f697bd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10056,6 +10056,121 @@ namespace ts { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } + function checkTypeAssignableToAndOptionallyElaborate(source: Type, target: Type, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean { + if (!isTypeAssignableTo(source, target) && !elaborateError(expr, source, target)) { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); + } + return false; + } + + function elaborateError(node: Expression | undefined, source: Type, target: Type): boolean { + if (!node) return false; + switch (node.kind) { + case SyntaxKind.ParenthesizedExpression: + return elaborateError((node as ParenthesizedExpression).expression, source, target); + case SyntaxKind.BinaryExpression: + switch ((node as BinaryExpression).operatorToken.kind) { + case SyntaxKind.EqualsToken: + case SyntaxKind.CommaToken: + return elaborateError((node as BinaryExpression).right, source, target); + } + break; + case SyntaxKind.ObjectLiteralExpression: + return elaborateObjectLiteral(node as ObjectLiteralExpression, source, target); + case SyntaxKind.ArrayLiteralExpression: + return elaborateArrayLiteral(node as ArrayLiteralExpression, source, target); + case SyntaxKind.JsxAttributes: + return elaborateJsxAttributes(node as JsxAttributes, source, target); + } + return false; + } + + type ElaborationIterator = IterableIterator<[Node, Expression | undefined, Type]>; + function elaborateElementwise(iterator: ElaborationIterator, source: Type, target: Type) { + // Assignability failure - check each prop individually, and if that fails, fall back on the bad error span + let reportedError = false; + for (let status = iterator.next(); !status.done; status = iterator.next()) { + const [prop, next, nameType] = status.value; + const sourcePropType = getIndexedAccessType(source, nameType); + const targetPropType = getIndexedAccessType(target, nameType); + //const rootChain = () => chainDiagnosticMessages( + // /*details*/ undefined, + // Diagnostics.Types_of_property_0_are_incompatible, + // stripQuotes(typeToString(nameType)), // quotes removed from string literal names so they aren't double quoted in the output + //); + if (!isTypeAssignableTo(sourcePropType, targetPropType)) { + const elaborated = next && elaborateError(next, sourcePropType, targetPropType); + if (elaborated) { + reportedError = true; + } + else { + // Issue error on the prop itself, since the prop couldn't elaborate the error + checkTypeAssignableTo(sourcePropType, targetPropType, prop); + reportedError = true; + } + } + } + return reportedError; + } + + function *generateJsxAttributes(node: JsxAttributes): ElaborationIterator { + if (!length(node.properties)) return; + for (const prop of node.properties) { + if (isJsxSpreadAttribute(prop)) continue; + yield [prop.name, prop.initializer, getLiteralType(idText(prop.name))]; + } + } + + function elaborateJsxAttributes(node: JsxAttributes, source: Type, target: Type) { + return elaborateElementwise(generateJsxAttributes(node), source, target); + } + + function *generateArrayElements(node: ArrayLiteralExpression): ElaborationIterator { + const len = length(node.elements); + if (!len) return; + for (let i = 0; i < len; i++) { + const elem = node.elements[i]; + if (isOmittedExpression(elem)) continue; + const nameType = getLiteralType(i); + yield [elem, elem, nameType]; + } + } + + function elaborateArrayLiteral(node: ArrayLiteralExpression, source: Type, target: Type) { + if (isTupleLikeType(source)) { + return elaborateElementwise(generateArrayElements(node), source, target); + } + return false; + } + + function *generateObjectliteralElements(node: ObjectLiteralExpression): ElaborationIterator { + if (!length(node.properties)) return; + for (const prop of node.properties) { + if (isSpreadAssignment(prop)) continue; + const type = getLiteralTypeFromPropertyName(getSymbolOfNode(prop), TypeFlags.StringOrNumberLiteralOrUnique); + if (!type || (type.flags & TypeFlags.Never)) { + continue; + } + switch (prop.kind) { + case SyntaxKind.SetAccessor: + case SyntaxKind.GetAccessor: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.ShorthandPropertyAssignment: + yield [prop.name, undefined, type]; + break; + case SyntaxKind.PropertyAssignment: + yield [prop.name, prop.initializer, type]; + break; + default: + Debug.assertNever(prop); + } + } + } + + function elaborateObjectLiteral(node: ObjectLiteralExpression, source: Type, target: Type) { + return elaborateElementwise(generateObjectliteralElements(node), source, target); + } + /** * This is *not* a bi-directional relationship. * If one needs to check both directions for comparability, use a second call to this function or 'isTypeComparableTo'. @@ -16940,30 +17055,7 @@ namespace ts { } } else if (!isSourceAttributeTypeAssignableToTarget) { - // Assignability failure - check each prop individually, and if that fails, fall back on the bad error span - if (length(openingLikeElement.attributes.properties)) { - let reportedError = false; - for (const prop of openingLikeElement.attributes.properties) { - if (isJsxSpreadAttribute(prop)) continue; - const name = idText(prop.name); - const sourcePropType = getIndexedAccessType(sourceAttributesType, getLiteralType(name)); - const targetPropType = getIndexedAccessType(targetAttributesType, getLiteralType(name)); - const rootChain = () => chainDiagnosticMessages( - /*details*/ undefined, - Diagnostics.Types_of_property_0_are_incompatible, - name, - ); - if (!checkTypeAssignableTo(sourcePropType, targetPropType, prop, /*headMessage*/ undefined, rootChain)) { - reportedError = true; - } - } - - if (reportedError) { - return; - } - } - // Report fallback error on just the component name - checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.tagName); + checkTypeAssignableToAndOptionallyElaborate(sourceAttributesType, targetAttributesType, openingLikeElement.tagName, openingLikeElement.attributes); } } @@ -23321,7 +23413,7 @@ namespace ts { // Don't validate for-in initializer as it is already an error const initializer = getEffectiveInitializer(node); if (initializer && node.parent.parent.kind !== SyntaxKind.ForInStatement) { - checkTypeAssignableTo(checkExpressionCached(initializer), type, node, /*headMessage*/ undefined); + checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); checkParameterInitializer(node); } } @@ -23336,7 +23428,7 @@ namespace ts { errorNextVariableOrPropertyDeclarationMustHaveSameType(type, node, declarationType); } if (node.initializer) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, /*headMessage*/ undefined); + checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(node.initializer), declarationType, node, node.initializer, /*headMessage*/ undefined); } if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) { error(getNameOfDeclaration(symbol.valueDeclaration), Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 8b4e12dc2220b..e59028c0c64e2 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -6487,4 +6487,23 @@ namespace ts { export function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports { return node.kind === SyntaxKind.NamedImports || node.kind === SyntaxKind.NamedExports; } + + /* @internal */ + /** + * Strip off existed single quotes or double quotes from a given string + * + * @return non-quoted string + */ + export function stripQuotes(name: string) { + const length = name.length; + if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && startsWithQuote(name)) { + return name.substring(1, length - 1); + } + return name; + } + + /* @internal */ + export function startsWithQuote(name: string): boolean { + return isSingleOrDoubleQuote(name.charCodeAt(0)); + } } diff --git a/src/services/utilities.ts b/src/services/utilities.ts index fbccd72c2aad7..6bcfa9b38213c 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1549,23 +1549,6 @@ namespace ts { (location.parent).propertyName === location; } - /** - * Strip off existed single quotes or double quotes from a given string - * - * @return non-quoted string - */ - export function stripQuotes(name: string) { - const length = name.length; - if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && startsWithQuote(name)) { - return name.substring(1, length - 1); - } - return name; - } - - export function startsWithQuote(name: string): boolean { - return isSingleOrDoubleQuote(name.charCodeAt(0)); - } - export function scriptKindIs(fileName: string, host: LanguageServiceHost, ...scriptKinds: ScriptKind[]): boolean { const scriptKind = getScriptKind(fileName, host); return some(scriptKinds, k => k === scriptKind); diff --git a/src/tsconfig-base.json b/src/tsconfig-base.json index 92c32e73fcc5b..4c0252cfe4256 100644 --- a/src/tsconfig-base.json +++ b/src/tsconfig-base.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "lib": ["es5"], + "lib": ["es2015"], "noEmitOnError": true, "strictNullChecks": true, "noImplicitAny": true, diff --git a/tests/cases/compiler/deeplyNestedAssignabilityIssue.ts b/tests/cases/compiler/deeplyNestedAssignabilityIssue.ts new file mode 100644 index 0000000000000..0ebdaf6caefe7 --- /dev/null +++ b/tests/cases/compiler/deeplyNestedAssignabilityIssue.ts @@ -0,0 +1,29 @@ +interface A { + a: number; +} + +interface Large { + something: { + another: { + more: { + thing: A; + } + yetstill: { + another: A; + } + } + } +} + +const x: Large = { + something: { + another: { + more: { + thing: {} + }, + yetstill: { + another: {} + } + } + } +} From c463bd59a0cc86ece7f4d4cfa02060fa4a21b188 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 15 Jun 2018 13:26:27 -0700 Subject: [PATCH 02/16] Nice stuff --- src/compiler/checker.ts | 34 +++++++++++++------ src/parser/diagnosticMessages.json | 5 +++ .../deeplyNestedAssignabilityIssue.ts | 1 + 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f779a6190407a..47791c0f2a83f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10124,12 +10124,13 @@ namespace ts { return isTypeComparableTo(type1, type2) || isTypeComparableTo(type2, type1); } - function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); + function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined, errorOutputObject?: { error?: Diagnostic }): boolean { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain, errorOutputObject); } function checkTypeAssignableToAndOptionallyElaborate(source: Type, target: Type, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean { - if (!isTypeAssignableTo(source, target) && !elaborateError(expr, source, target)) { + if (isTypeAssignableTo(source, target)) return true; + if (!elaborateError(expr, source, target)) { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } return false; @@ -10165,11 +10166,6 @@ namespace ts { const [prop, next, nameType] = status.value; const sourcePropType = getIndexedAccessType(source, nameType); const targetPropType = getIndexedAccessType(target, nameType); - //const rootChain = () => chainDiagnosticMessages( - // /*details*/ undefined, - // Diagnostics.Types_of_property_0_are_incompatible, - // stripQuotes(typeToString(nameType)), // quotes removed from string literal names so they aren't double quoted in the output - //); if (!isTypeAssignableTo(sourcePropType, targetPropType)) { const elaborated = next && elaborateError(next, sourcePropType, targetPropType); if (elaborated) { @@ -10177,7 +10173,17 @@ namespace ts { } else { // Issue error on the prop itself, since the prop couldn't elaborate the error - checkTypeAssignableTo(sourcePropType, targetPropType, prop); + const resultObj: { error?: Diagnostic } = {}; + checkTypeAssignableTo(sourcePropType, targetPropType, prop, /*headMessage*/ undefined, /*containingChain*/ undefined, resultObj); + if (resultObj.error && target.symbol && length(target.symbol.declarations)) { + const reportedDiag = resultObj.error; + const relatededInfo = (reportedDiag.relatedInformation = reportedDiag.relatedInformation || []); + const propertyName = typeToString(nameType); + const targetType = typeToString(target); + for (const declaration of target.symbol.declarations!) { + relatededInfo.push(createDiagnosticForNode(declaration, Diagnostics.Which_is_from_property_0_of_type_1_declared_here, propertyName, targetType)); + } + } reportedError = true; } } @@ -10581,7 +10587,9 @@ namespace ts { relation: Map, errorNode: Node | undefined, headMessage?: DiagnosticMessage, - containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean { + containingMessageChain?: () => DiagnosticMessageChain | undefined, + errorOutputContainer?: { error?: Diagnostic } + ): boolean { let errorInfo: DiagnosticMessageChain | undefined; let maybeKeys: string[]; @@ -10621,7 +10629,11 @@ namespace ts { } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode!, errorInfo, relatedInformation)); // TODO: GH#18217 + const diag = createDiagnosticForNodeFromMessageChain(errorNode!, errorInfo, relatedInformation); + if (errorOutputContainer) { + errorOutputContainer.error = diag; + } + diagnostics.add(diag); // TODO: GH#18217 } return result !== Ternary.False; diff --git a/src/parser/diagnosticMessages.json b/src/parser/diagnosticMessages.json index 24b3031b8771e..3e86c2cb55523 100644 --- a/src/parser/diagnosticMessages.json +++ b/src/parser/diagnosticMessages.json @@ -3710,6 +3710,11 @@ "code": 6371 }, + "Which is from property '{0}' of type '{1}', declared here.": { + "category": "Message", + "code": 6500 + }, + "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", "code": 7005 diff --git a/tests/cases/compiler/deeplyNestedAssignabilityIssue.ts b/tests/cases/compiler/deeplyNestedAssignabilityIssue.ts index 0ebdaf6caefe7..7392c41545f3b 100644 --- a/tests/cases/compiler/deeplyNestedAssignabilityIssue.ts +++ b/tests/cases/compiler/deeplyNestedAssignabilityIssue.ts @@ -1,3 +1,4 @@ +// @pretty: true interface A { a: number; } From f832eae0f318ed85646d7d9aace597bb494e6197 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 21 Jun 2018 14:04:28 -0700 Subject: [PATCH 03/16] Modify tuple error to use length error mroe often --- src/compiler/checker.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e05bcda9622a5..81ee84e06c304 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10166,10 +10166,12 @@ namespace ts { return elaborateElementwise(generateJsxAttributes(node), source, target); } - function *generateArrayElements(node: ArrayLiteralExpression): ElaborationIterator { + function *generateLimitedTupleElements(node: ArrayLiteralExpression, target: Type): ElaborationIterator { const len = length(node.elements); if (!len) return; for (let i = 0; i < len; i++) { + // Skip elements which do not exist in the target - a length error on the tuple overall is likely better than an error on a mismatched index signature + if (isTupleLikeType(target) && !getPropertyOfType(target, ("" + i) as __String)) continue; const elem = node.elements[i]; if (isOmittedExpression(elem)) continue; const nameType = getLiteralType(i); @@ -10179,7 +10181,7 @@ namespace ts { function elaborateArrayLiteral(node: ArrayLiteralExpression, source: Type, target: Type) { if (isTupleLikeType(source)) { - return elaborateElementwise(generateArrayElements(node), source, target); + return elaborateElementwise(generateLimitedTupleElements(node, target), source, target); } return false; } From 36206c8013567428412e226fe3636afb598f5e3b Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 21 Jun 2018 15:39:56 -0700 Subject: [PATCH 04/16] Accept good baselines --- src/compiler/checker.ts | 28 ++- .../reference/api/tsserverlibrary.d.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 224 ------------------ .../reference/arrayLiterals3.errors.txt | 16 +- .../assignmentToObjectAndFunction.errors.txt | 10 +- ...nmentToParenthesizedIdentifiers.errors.txt | 30 +-- ...xGenericTagHasCorrectInferences.errors.txt | 12 +- ...ropertyNamesContextualType8_ES5.errors.txt | 17 +- ...ropertyNamesContextualType8_ES6.errors.txt | 17 +- ...rWithAssignableReturnExpression.errors.txt | 10 +- .../reference/contextualTypeAny.errors.txt | 10 +- .../contextualTypeWithTuple.errors.txt | 12 +- ...lTypeWithUnionTypeObjectLiteral.errors.txt | 22 +- ...StringLiteralsInJsxAttributes01.errors.txt | 16 +- .../deeplyNestedAssignabilityIssue.errors.txt | 67 ++++++ .../deeplyNestedAssignabilityIssue.js | 45 ++++ .../deeplyNestedAssignabilityIssue.symbols | 62 +++++ .../deeplyNestedAssignabilityIssue.types | 69 ++++++ ...rayBindingPatternAndAssignment2.errors.txt | 8 +- ...structuringVariableDeclaration2.errors.txt | 27 +-- ...AnnotationAndInvalidInitializer.errors.txt | 10 +- tests/baselines/reference/fuzzy.errors.txt | 14 +- ...AssignmentCompatWithInterfaces1.errors.txt | 26 +- .../genericCallWithTupleType.errors.txt | 24 +- ...nvariantGenericErrorElaboration.errors.txt | 18 +- ...xChildrenGenericContextualTypes.errors.txt | 12 +- .../reference/mappedTypeErrors.errors.txt | 30 +-- .../reference/nestedFreshLiteral.errors.txt | 24 +- .../nonPrimitiveAsProperty.errors.txt | 10 +- ...rConstrainsPropertyDeclarations.errors.txt | 8 +- ...ConstrainsPropertyDeclarations2.errors.txt | 8 +- .../objectLiteralExcessProperties.errors.txt | 12 +- .../objectLiteralIndexerErrors.errors.txt | 24 +- .../objectLiteralNormalization.errors.txt | 10 +- ...rthandPropertiesAssignmentError.errors.txt | 15 +- ...nmentErrorFromMissingIdentifier.errors.txt | 15 +- ...tLiteralWithNumericPropertyName.errors.txt | 10 +- .../objectSpreadStrictNull.errors.txt | 10 +- .../reference/returnInConstructor1.errors.txt | 10 +- ...pertyAssignmentsInDestructuring.errors.txt | 15 +- ...yAssignmentsInDestructuring_ES6.errors.txt | 15 +- .../reference/spreadUnion3.errors.txt | 12 +- ...rConstrainsPropertyDeclarations.errors.txt | 30 ++- ...ConstrainsPropertyDeclarations2.errors.txt | 21 +- .../reference/tsxAttributeErrors.errors.txt | 16 +- .../tsxAttributeResolution1.errors.txt | 24 +- .../tsxAttributeResolution10.errors.txt | 8 +- .../tsxAttributeResolution14.errors.txt | 16 +- .../tsxAttributeResolution3.errors.txt | 8 +- .../tsxAttributeResolution6.errors.txt | 14 +- .../tsxAttributeResolution7.errors.txt | 8 +- .../tsxAttributeResolution9.errors.txt | 8 +- ...tsxDefaultAttributesResolution3.errors.txt | 6 +- .../tsxElementResolution12.errors.txt | 8 +- ...ponentWithDefaultTypeParameter3.errors.txt | 8 +- ...tsxSpreadAttributesResolution10.errors.txt | 30 +-- ...tsxSpreadAttributesResolution12.errors.txt | 14 +- .../tsxSpreadAttributesResolution2.errors.txt | 12 +- ...elessFunctionComponentOverload4.errors.txt | 46 ++-- ...elessFunctionComponentOverload5.errors.txt | 20 +- ...ponentWithDefaultTypeParameter2.errors.txt | 8 +- ...tsxStatelessFunctionComponents1.errors.txt | 8 +- ...ionComponentsWithTypeArguments2.errors.txt | 34 +-- ...entPartialDefinitionStillErrors.errors.txt | 8 +- .../tsxTypeArgumentResolution.errors.txt | 48 ++-- .../reference/tsxUnionElementType2.errors.txt | 8 +- .../reference/tsxUnionElementType4.errors.txt | 6 +- .../reference/tsxUnionElementType6.errors.txt | 8 +- .../baselines/reference/tupleTypes.errors.txt | 13 +- ...IndexInObjectWithIndexSignature.errors.txt | 10 +- .../reference/widenedTypes.errors.txt | 10 +- 71 files changed, 649 insertions(+), 844 deletions(-) create mode 100644 tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt create mode 100644 tests/baselines/reference/deeplyNestedAssignabilityIssue.js create mode 100644 tests/baselines/reference/deeplyNestedAssignabilityIssue.symbols create mode 100644 tests/baselines/reference/deeplyNestedAssignabilityIssue.types diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 81ee84e06c304..f2b5b5a44f19f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10137,7 +10137,13 @@ namespace ts { else { // Issue error on the prop itself, since the prop couldn't elaborate the error const resultObj: { error?: Diagnostic } = {}; - checkTypeAssignableTo(sourcePropType, targetPropType, prop, /*headMessage*/ undefined, /*containingChain*/ undefined, resultObj); + // Use the expression type, if available + const specificSource = next ? checkExpressionCached(next) : sourcePropType; + const result = checkTypeAssignableTo(specificSource, targetPropType, prop, /*headMessage*/ undefined, /*containingChain*/ undefined, resultObj); + if (result && specificSource !== sourcePropType) { + // If for whatever reason the expression type doesn't yield an error, make sure we still issue an error on the sourcePropType + checkTypeAssignableTo(sourcePropType, targetPropType, prop, /*headMessage*/ undefined, /*containingChain*/ undefined, resultObj) + } if (resultObj.error && target.symbol && length(target.symbol.declarations)) { const reportedDiag = resultObj.error; const relatededInfo = (reportedDiag.relatedInformation = reportedDiag.relatedInformation || []); @@ -15630,7 +15636,7 @@ namespace ts { const discriminatingType = checkExpression(prop.initializer); for (const type of (contextualType as UnionType).types) { const targetType = getTypeOfPropertyOfType(type, prop.symbol.escapedName); - if (targetType && checkTypeAssignableTo(discriminatingType, targetType, /*errorNode*/ undefined)) { + if (targetType && isTypeAssignableTo(discriminatingType, targetType)) { if (match) { if (type === match) continue; // Finding multiple fields which discriminate to the same type is fine match = undefined; @@ -19907,10 +19913,10 @@ namespace ts { if (returnOrPromisedType) { if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Async) { // Async function const awaitedType = checkAwaitedType(exprType, node.body, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); - checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); + checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, node.body, node.body); } else { // Normal function - checkTypeAssignableTo(exprType, returnOrPromisedType, node.body); + checkTypeAssignableToAndOptionallyElaborate(exprType, returnOrPromisedType, node.body, node.body); } } } @@ -20329,7 +20335,7 @@ namespace ts { Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { - checkTypeAssignableTo(sourceType, targetType, target, /*headMessage*/ undefined); + checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target); } return sourceType; } @@ -20628,7 +20634,7 @@ namespace ts { if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access) && (!isIdentifier(left) || unescapeLeadingUnderscores(left.escapedText) !== "exports")) { // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported - checkTypeAssignableTo(valueType, leftType, left, /*headMessage*/ undefined); + checkTypeAssignableToAndOptionallyElaborate(valueType, leftType, left, right); } } } @@ -20717,7 +20723,7 @@ namespace ts { const returnType = getEffectiveReturnTypeNode(func); if (returnType) { const signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(returnType), isAsync) || anyType; - checkTypeAssignableTo(yieldedType, signatureElementType, node.expression || node, /*headMessage*/ undefined); + checkTypeAssignableToAndOptionallyElaborate(yieldedType, signatureElementType, node.expression || node, node.expression); } // Both yield and yield* expressions have type 'any' @@ -23416,7 +23422,7 @@ namespace ts { checkNonNullType(initializerType, node); } else { - checkTypeAssignableTo(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); + checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer); } checkParameterInitializer(node); } @@ -23623,7 +23629,7 @@ namespace ts { // because we accessed properties from anyType, or it may have led to an error inside // getElementTypeOfIterable. if (iteratedType) { - checkTypeAssignableTo(iteratedType, leftType, varExpr, /*headMessage*/ undefined); + checkTypeAssignableToAndOptionallyElaborate(iteratedType, leftType, varExpr, node.expression); } } } @@ -24067,7 +24073,7 @@ namespace ts { } } else if (func.kind === SyntaxKind.Constructor) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } @@ -24083,7 +24089,7 @@ namespace ts { } } else { - checkTypeAssignableTo(exprType, returnType, node); + checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression); } } } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index c3869a610e27e..4ab41e83a4829 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5737,6 +5737,7 @@ declare namespace ts { Option_build_must_be_the_first_command_line_argument: DiagnosticMessage; Options_0_and_1_cannot_be_combined: DiagnosticMessage; Skipping_clean_because_not_all_projects_could_be_located: DiagnosticMessage; + Which_is_from_property_0_of_type_1_declared_here: DiagnosticMessage; Variable_0_implicitly_has_an_1_type: DiagnosticMessage; Parameter_0_implicitly_has_an_1_type: DiagnosticMessage; Member_0_implicitly_has_an_1_type: DiagnosticMessage; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index c679012c2e43f..86215a7b7ba50 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5424,230 +5424,6 @@ declare namespace ts { jsxAttributeStringLiteralValue = 24 } } -<<<<<<< HEAD -interface PromiseConstructor { - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - reject(reason: any): Promise; - all(values: (T | PromiseLike)[]): Promise; -} -declare var Promise: PromiseConstructor; -declare namespace ts { - const scanner: Scanner; - enum SemanticMeaning { - None = 0, - Value = 1, - Type = 2, - Namespace = 4, - All = 7 - } - function getMeaningFromDeclaration(node: Node): SemanticMeaning; - function getMeaningFromLocation(node: Node): SemanticMeaning; - function isInRightSideOfInternalImportEqualsDeclaration(node: Node): boolean; - function isCallExpressionTarget(node: Node): boolean; - function isNewExpressionTarget(node: Node): boolean; - function climbPastPropertyAccess(node: Node): Node; - function getTargetLabel(referenceNode: Node, labelName: string): Identifier | undefined; - function isJumpStatementTarget(node: Node): node is Identifier & { - parent: BreakOrContinueStatement; - }; - function isLabelOfLabeledStatement(node: Node): node is Identifier; - function isLabelName(node: Node): boolean; - function isRightSideOfQualifiedName(node: Node): boolean; - function isRightSideOfPropertyAccess(node: Node): boolean; - function isNameOfModuleDeclaration(node: Node): boolean; - function isNameOfFunctionDeclaration(node: Node): boolean; - function isLiteralNameOfPropertyDeclarationOrIndexAccess(node: StringLiteral | NumericLiteral): boolean; - function isExpressionOfExternalModuleImportEqualsDeclaration(node: Node): boolean; - function getContainerNode(node: Node): Declaration | undefined; - function getNodeKind(node: Node): ScriptElementKind; - function isThis(node: Node): boolean; - interface ListItemInfo { - listItemIndex: number; - list: Node; - } - function getLineStartPositionForPosition(position: number, sourceFile: SourceFileLike): number; - function rangeContainsRange(r1: TextRange, r2: TextRange): boolean; - function rangeContainsPosition(r: TextRange, pos: number): boolean; - function rangeContainsPositionExclusive(r: TextRange, pos: number): boolean; - function startEndContainsRange(start: number, end: number, range: TextRange): boolean; - function rangeContainsStartEnd(range: TextRange, start: number, end: number): boolean; - function rangeOverlapsWithStartEnd(r1: TextRange, start: number, end: number): boolean; - function startEndOverlapsWithStartEnd(start1: number, end1: number, start2: number, end2: number): boolean; - /** - * Assumes `candidate.start <= position` holds. - */ - function positionBelongsToNode(candidate: Node, position: number, sourceFile: SourceFile): boolean; - function findListItemInfo(node: Node): ListItemInfo | undefined; - function hasChildOfKind(n: Node, kind: SyntaxKind, sourceFile: SourceFile): boolean; - function findChildOfKind(n: Node, kind: T["kind"], sourceFile: SourceFileLike): T | undefined; - function findContainingList(node: Node): SyntaxList | undefined; - /** - * Gets the token whose text has range [start, end) and - * position >= start and (position < end or (position === end && token is literal or keyword or identifier)) - */ - function getTouchingPropertyName(sourceFile: SourceFile, position: number): Node; - /** - * Returns the token if position is in [start, end). - * If position === end, returns the preceding token if includeItemAtEndPosition(previousToken) === true - */ - function getTouchingToken(sourceFile: SourceFile, position: number, includeJsDocComment: boolean, includePrecedingTokenAtEndPosition?: (n: Node) => boolean): Node; - /** Returns a token if position is in [start-of-leading-trivia, end) */ - function getTokenAtPosition(sourceFile: SourceFile, position: number, includeJsDocComment: boolean, includeEndPosition?: boolean): Node; - /** - * The token on the left of the position is the token that strictly includes the position - * or sits to the left of the cursor if it is on a boundary. For example - * - * fo|o -> will return foo - * foo |bar -> will return foo - * - */ - function findTokenOnLeftOfPosition(file: SourceFile, position: number): Node | undefined; - function findNextToken(previousToken: Node, parent: Node, sourceFile: SourceFile): Node | undefined; - /** - * Finds the rightmost token satisfying `token.end <= position`, - * excluding `JsxText` tokens containing only whitespace. - */ - function findPrecedingToken(position: number, sourceFile: SourceFile, startNode?: Node, includeJsDoc?: boolean): Node | undefined; - function isInString(sourceFile: SourceFile, position: number, previousToken?: Node | undefined): boolean; - /** - * returns true if the position is in between the open and close elements of an JSX expression. - */ - function isInsideJsxElementOrAttribute(sourceFile: SourceFile, position: number): boolean; - function isInTemplateString(sourceFile: SourceFile, position: number): boolean; - function findPrecedingMatchingToken(token: Node, matchingTokenKind: SyntaxKind, sourceFile: SourceFile): Node | undefined; - interface PossibleTypeArgumentInfo { - readonly called: Identifier; - readonly nTypeArguments: number; - } - function isPossiblyTypeArgumentPosition(tokenIn: Node, sourceFile: SourceFile): PossibleTypeArgumentInfo | undefined; - /** - * Returns true if the cursor at position in sourceFile is within a comment. - * - * @param tokenAtPosition Must equal `getTokenAtPosition(sourceFile, position) - * @param predicate Additional predicate to test on the comment range. - */ - function isInComment(sourceFile: SourceFile, position: number, tokenAtPosition?: Node, predicate?: (c: CommentRange) => boolean): boolean; - function hasDocComment(sourceFile: SourceFile, position: number): boolean | undefined; - function getNodeModifiers(node: Node): string; - function getTypeArgumentOrTypeParameterList(node: Node): NodeArray | undefined; - function isComment(kind: SyntaxKind): boolean; - function isStringOrRegularExpressionOrTemplateLiteral(kind: SyntaxKind): boolean; - function isPunctuation(kind: SyntaxKind): boolean; - function isInsideTemplateLiteral(node: TemplateLiteralToken, position: number, sourceFile: SourceFile): boolean; - function isAccessibilityModifier(kind: SyntaxKind): boolean; - function cloneCompilerOptions(options: CompilerOptions): CompilerOptions; - function isArrayLiteralOrObjectLiteralDestructuringPattern(node: Node): boolean; - function isInReferenceComment(sourceFile: SourceFile, position: number): boolean; - function isInNonReferenceComment(sourceFile: SourceFile, position: number): boolean; - function createTextSpanFromNode(node: Node, sourceFile?: SourceFile): TextSpan; - function createTextSpanFromRange(range: TextRange): TextSpan; - function createTextRangeFromSpan(span: TextSpan): TextRange; - function createTextChangeFromStartLength(start: number, length: number, newText: string): TextChange; - function createTextChange(span: TextSpan, newText: string): TextChange; - const typeKeywords: ReadonlyArray; - function isTypeKeyword(kind: SyntaxKind): boolean; - /** True if the symbol is for an external module, as opposed to a namespace. */ - function isExternalModuleSymbol(moduleSymbol: Symbol): boolean; - /** Returns `true` the first time it encounters a node and `false` afterwards. */ - type NodeSeenTracker = (node: T) => boolean; - function nodeSeenTracker(): NodeSeenTracker; - function getSnapshotText(snap: IScriptSnapshot): string; - function repeatString(str: string, count: number): string; - function skipConstraint(type: Type): Type; - function getNameFromPropertyName(name: PropertyName): string | undefined; - function programContainsEs6Modules(program: Program): boolean; - function compilerOptionsIndicateEs6Modules(compilerOptions: CompilerOptions): boolean; - function hostUsesCaseSensitiveFileNames(host: LanguageServiceHost): boolean; - function hostGetCanonicalFileName(host: LanguageServiceHost): GetCanonicalFileName; - function makeImportIfNecessary(defaultImport: Identifier | undefined, namedImports: ReadonlyArray | undefined, moduleSpecifier: string, quotePreference: QuotePreference): ImportDeclaration | undefined; - function makeImport(defaultImport: Identifier | undefined, namedImports: ReadonlyArray | undefined, moduleSpecifier: string | Expression, quotePreference: QuotePreference): ImportDeclaration; - function makeStringLiteral(text: string, quotePreference: QuotePreference): StringLiteral; - enum QuotePreference { - Single = 0, - Double = 1 - } - function getQuotePreference(sourceFile: SourceFile, preferences: UserPreferences): QuotePreference; - function symbolNameNoDefault(symbol: Symbol): string | undefined; - function symbolEscapedNameNoDefault(symbol: Symbol): __String | undefined; - function getPropertySymbolFromBindingElement(checker: TypeChecker, bindingElement: BindingElement & { - name: Identifier; - }): Symbol | undefined; - /** - * Find symbol of the given property-name and add the symbol to the given result array - * @param symbol a symbol to start searching for the given propertyName - * @param propertyName a name of property to search for - * @param result an array of symbol of found property symbols - * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol. - * The value of previousIterationSymbol is undefined when the function is first called. - */ - function getPropertySymbolsFromBaseTypes(symbol: Symbol, propertyName: string, checker: TypeChecker, cb: (symbol: Symbol) => T | undefined): T | undefined; - function isMemberSymbolInBaseType(memberSymbol: Symbol, checker: TypeChecker): boolean; - class NodeSet { - private map; - add(node: Node): void; - has(node: Node): boolean; - forEach(cb: (node: Node) => void): void; - some(pred: (node: Node) => boolean): boolean; - } - function getParentNodeInSpan(node: Node | undefined, file: SourceFile, span: TextSpan): Node | undefined; - function insertImport(changes: textChanges.ChangeTracker, sourceFile: SourceFile, importDecl: Statement): void; -} -declare namespace ts { - function isFirstDeclarationOfSymbolParameter(symbol: Symbol): boolean; - function symbolPart(text: string, symbol: Symbol): SymbolDisplayPart; - function displayPart(text: string, kind: SymbolDisplayPartKind): SymbolDisplayPart; - function spacePart(): SymbolDisplayPart; - function keywordPart(kind: SyntaxKind): SymbolDisplayPart; - function punctuationPart(kind: SyntaxKind): SymbolDisplayPart; - function operatorPart(kind: SyntaxKind): SymbolDisplayPart; - function textOrKeywordPart(text: string): SymbolDisplayPart; - function textPart(text: string): SymbolDisplayPart; - /** - * The default is CRLF. - */ - function getNewLineOrDefaultFromHost(host: LanguageServiceHost | LanguageServiceShimHost, formatSettings?: FormatCodeSettings): string; - function lineBreakPart(): SymbolDisplayPart; - function mapToDisplayParts(writeDisplayParts: (writer: DisplayPartsSymbolWriter) => void): SymbolDisplayPart[]; - function typeToDisplayParts(typechecker: TypeChecker, type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; - function symbolToDisplayParts(typeChecker: TypeChecker, symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): SymbolDisplayPart[]; - function signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; - function isImportOrExportSpecifierName(location: Node): location is Identifier; - function scriptKindIs(fileName: string, host: LanguageServiceHost, ...scriptKinds: ScriptKind[]): boolean; - function getScriptKind(fileName: string, host?: LanguageServiceHost): ScriptKind; - function getUniqueSymbolId(symbol: Symbol, checker: TypeChecker): number; - function getFirstNonSpaceCharacterPosition(text: string, position: number): number; - /** - * Creates a deep, memberwise clone of a node with no source map location. - * - * WARNING: This is an expensive operation and is only intended to be used in refactorings - * and code fixes (because those are triggered by explicit user actions). - */ - function getSynthesizedDeepClone(node: T, includeTrivia?: boolean): T; - function getSynthesizedDeepClones(nodes: NodeArray, includeTrivia?: boolean): NodeArray; - function getSynthesizedDeepClones(nodes: NodeArray | undefined, includeTrivia?: boolean): NodeArray | undefined; - /** - * Sets EmitFlags to suppress leading and trailing trivia on the node. - */ - function suppressLeadingAndTrailingTrivia(node: Node): void; - /** - * Sets EmitFlags to suppress leading trivia on the node. - */ - function suppressLeadingTrivia(node: Node): void; - /** - * Sets EmitFlags to suppress trailing trivia on the node. - */ - function suppressTrailingTrivia(node: Node): void; - function getUniqueName(baseName: string, sourceFile: SourceFile): string; - /** - * @return The index of the (only) reference to the extracted symbol. We want the cursor - * to be on the reference, rather than the declaration, because it's closer to where the - * user was before extracting it. - */ - function getRenameLocation(edits: ReadonlyArray, renameFilename: string, name: string, preferLastLocation: boolean): number; - function copyComments(sourceNode: Node, targetNode: Node, sourceFile: SourceFile, commentKind?: CommentKind, hasTrailingNewLine?: boolean): void; -} -======= ->>>>>>> master declare namespace ts { function createClassifier(): Classifier; } diff --git a/tests/baselines/reference/arrayLiterals3.errors.txt b/tests/baselines/reference/arrayLiterals3.errors.txt index a3a3b88bc4a8a..5ec709833cd8b 100644 --- a/tests/baselines/reference/arrayLiterals3.errors.txt +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -1,7 +1,8 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(10,5): error TS2322: Type 'undefined[]' is not assignable to type '[any, any, any]'. Property '0' is missing in type 'undefined[]'. -tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,38): error TS2322: Type '"string"' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,48): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,51): error TS2322: Type 'true' is not assignable to type 'number'. tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'. Types of property 'length' are incompatible. Type '4' is not assignable to type '2'. @@ -18,7 +19,7 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error 'number' is a primitive, but 'Number' is a wrapper object. Prefer using 'number' when possible. -==== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts (6 errors) ==== +==== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts (8 errors) ==== // Each element expression in a non-empty array literal is processed as follows: // - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) // by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, @@ -33,9 +34,12 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error !!! error TS2322: Type 'undefined[]' is not assignable to type '[any, any, any]'. !!! error TS2322: Property '0' is missing in type 'undefined[]'. var a1: [boolean, string, number] = ["string", 1, true]; // Error - ~~ -!!! error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. + ~~~~~~~~ +!!! error TS2322: Type '"string"' is not assignable to type 'boolean'. + ~ +!!! error TS2322: Type '1' is not assignable to type 'string'. + ~~~~ +!!! error TS2322: Type 'true' is not assignable to type 'number'. // The resulting type an array literal expression is determined as follows: // - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt index 204135cd004e5..b5bd8545b6698 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt +++ b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt @@ -1,6 +1,4 @@ -tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. - Types of property 'toString' are incompatible. - Type 'number' is not assignable to type '() => string'. +tests/cases/compiler/assignmentToObjectAndFunction.ts(1,24): error TS2322: Type '0' is not assignable to type '() => string'. tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function'. Property 'apply' is missing in type '{}'. tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function'. @@ -10,10 +8,8 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type ==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ==== var errObj: Object = { toString: 0 }; // Error, incompatible toString - ~~~~~~ -!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. -!!! error TS2322: Types of property 'toString' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type '() => string'. + ~~~~~~~~ +!!! error TS2322: Type '0' is not assignable to type '() => string'. var goodObj: Object = { toString(x?) { return ""; diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt index 907fcce4c315b..88a40598f82dd 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt @@ -6,15 +6,9 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2539: Cannot assign to 'M' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,2): error TS2539: Cannot assign to 'M' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2539: Cannot assign to 'M3' because it is not a variable. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. - Types of property 'x' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. - Types of property 'x' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. - Types of property 'x' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,11): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,13): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,13): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2539: Cannot assign to 'fn' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,2): error TS2539: Cannot assign to 'fn' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type '""' is not assignable to type 'number'. @@ -78,20 +72,14 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (M2.M3) = { x: 3 }; // OK M2.M3 = { x: '' }; // Error - ~~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. -!!! error TS2322: Types of property 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2322: Type '""' is not assignable to type 'number'. (M2).M3 = { x: '' }; // Error - ~~~~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. -!!! error TS2322: Types of property 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2322: Type '""' is not assignable to type 'number'. (M2.M3) = { x: '' }; // Error - ~~~~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. -!!! error TS2322: Types of property 'x' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2322: Type '""' is not assignable to type 'number'. function fn() { } diff --git a/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt b/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt index 6a7143b85b2ed..9ebee71ba406c 100644 --- a/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt +++ b/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt @@ -1,6 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(13,54): error TS2326: Types of property 'nextValues' are incompatible. - Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'. - Type 'string' is not assignable to type '{ x: string; }'. +tests/cases/conformance/jsx/file.tsx(13,54): error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'. + Type 'string' is not assignable to type '{ x: string; }'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -17,7 +16,6 @@ tests/cases/conformance/jsx/file.tsx(13,54): error TS2326: Types of property 'ne let b = a} />; // No error - Values should be reinstantiated with `number` (since `object` is a default, not a constraint) let c = ({ x: a.x })} />; // No Error let d = a.x} />; // Error - `string` is not assignable to `{x: string}` - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2326: Types of property 'nextValues' are incompatible. -!!! error TS2326: Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'. -!!! error TS2326: Type 'string' is not assignable to type '{ x: string; }'. \ No newline at end of file + ~~~~~~~~~~ +!!! error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'. +!!! error TS2322: Type 'string' is not assignable to type '{ x: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt index ee36609095a04..4fa8aa552fa28 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt @@ -1,21 +1,18 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. - Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(7,5): error TS2322: Type '""' is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(8,5): error TS2322: Type '0' is not assignable to type 'boolean'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (1 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (2 errors) ==== interface I { [s: string]: boolean; [s: number]: boolean; } var o: I = { - ~ -!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. -!!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. [""+"foo"]: "", + ~~~~~~~~~~ +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [""+"bar"]: 0 + ~~~~~~~~~~ +!!! error TS2322: Type '0' is not assignable to type 'boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt index 1048fd2e119e7..c18ee67aefe65 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt @@ -1,21 +1,18 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. - Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(7,5): error TS2322: Type '""' is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(8,5): error TS2322: Type '0' is not assignable to type 'boolean'. -==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts (1 errors) ==== +==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts (2 errors) ==== interface I { [s: string]: boolean; [s: number]: boolean; } var o: I = { - ~ -!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. -!!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. [""+"foo"]: "", + ~~~~~~~~~~ +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [""+"bar"]: 0 + ~~~~~~~~~~ +!!! error TS2322: Type '0' is not assignable to type 'boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt index ef1765eb017a1..d2a4d6a7b2df6 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt @@ -1,9 +1,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,9): error TS2322: Type '1' is not assignable to type 'D'. tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. -tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,9): error TS2322: Type '{ x: number; }' is not assignable to type 'F'. - Types of property 'x' are incompatible. - Type 'number' is not assignable to type 'T'. tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. +tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,18): error TS2322: Type '1' is not assignable to type 'T'. ==== tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts (4 errors) ==== @@ -38,11 +36,9 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignabl constructor() { return { x: 1 }; // error ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type 'F'. -!!! error TS2322: Types of property 'x' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'T'. - ~~~~~~~~~~~~~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class. + ~ +!!! error TS2322: Type '1' is not assignable to type 'T'. } } diff --git a/tests/baselines/reference/contextualTypeAny.errors.txt b/tests/baselines/reference/contextualTypeAny.errors.txt index 09970be986ddb..bf06bfc7787ac 100644 --- a/tests/baselines/reference/contextualTypeAny.errors.txt +++ b/tests/baselines/reference/contextualTypeAny.errors.txt @@ -1,15 +1,11 @@ -tests/cases/compiler/contextualTypeAny.ts(3,5): error TS2322: Type '{ p: string; q: any; }' is not assignable to type '{ [s: string]: number; }'. - Property 'p' is incompatible with index signature. - Type 'string' is not assignable to type 'number'. +tests/cases/compiler/contextualTypeAny.ts(3,38): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTypeAny.ts (1 errors) ==== var x: any; var obj: { [s: string]: number } = { p: "", q: x }; - ~~~ -!!! error TS2322: Type '{ p: string; q: any; }' is not assignable to type '{ [s: string]: number; }'. -!!! error TS2322: Property 'p' is incompatible with index signature. -!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2322: Type '""' is not assignable to type 'number'. var arr: number[] = ["", x]; \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypeWithTuple.errors.txt b/tests/baselines/reference/contextualTypeWithTuple.errors.txt index 58a90919c5b29..9d9c015457bbc 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.errors.txt +++ b/tests/baselines/reference/contextualTypeWithTuple.errors.txt @@ -2,9 +2,8 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS232 Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(15,1): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(18,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. - Type '{}' is not assignable to type '{ a: string; }'. - Property 'a' is missing in type '{}'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(18,17): error TS2322: Type '{}' is not assignable to type '{ a: string; }'. + Property 'a' is missing in type '{}'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(19,1): error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]'. Property '2' is missing in type '[number, string]'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(20,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. @@ -45,10 +44,9 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23 // error objNumTuple = [ {}, 5]; - ~~~~~~~~~~~ -!!! error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. -!!! error TS2322: Type '{}' is not assignable to type '{ a: string; }'. -!!! error TS2322: Property 'a' is missing in type '{}'. + ~~ +!!! error TS2322: Type '{}' is not assignable to type '{ a: string; }'. +!!! error TS2322: Property 'a' is missing in type '{}'. numStrBoolTuple = numStrTuple; ~~~~~~~~~~~~~~~ !!! error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]'. diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt index 651d4f5381f4d..7a4e5a74ce227 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt @@ -21,12 +21,10 @@ tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts( Types of property 'prop' are incompatible. Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(57,5): error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I11 | I21'. - Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I21'. - Types of property 'commonMethodDifferentReturnType' are incompatible. - Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. - Type 'string | number' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(58,5): error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '((a: string, b: number) => string) | ((a: string, b: number) => number)'. + Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts (6 errors) ==== @@ -115,12 +113,10 @@ tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts( }; var strOrNumber: string | number; var i11Ori21: I11 | I21 = { // Like i1 and i2 both - ~~~~~~~~ -!!! error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I11 | I21'. -!!! error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I21'. -!!! error TS2322: Types of property 'commonMethodDifferentReturnType' are incompatible. -!!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. -!!! error TS2322: Type 'string | number' is not assignable to type 'number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. commonMethodDifferentReturnType: (a, b) => strOrNumber, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '((a: string, b: number) => string) | ((a: string, b: number) => number)'. +!!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. }; \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt index a3ddd397a6495..0a600991dac1a 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt @@ -1,7 +1,5 @@ -tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx(15,15): error TS2326: Types of property 'foo' are incompatible. - Type '"f"' is not assignable to type '"A" | "B" | "C"'. -tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx(16,15): error TS2326: Types of property 'foo' are incompatible. - Type '"f"' is not assignable to type '"A" | "B" | "C"'. +tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx(15,15): error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'. +tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx(16,15): error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'. ==== tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx (2 errors) ==== @@ -20,10 +18,8 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStr ; ; - ~~~~~~~~~ -!!! error TS2326: Types of property 'foo' are incompatible. -!!! error TS2326: Type '"f"' is not assignable to type '"A" | "B" | "C"'. + ~~~ +!!! error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'. ; - ~~~~~~~ -!!! error TS2326: Types of property 'foo' are incompatible. -!!! error TS2326: Type '"f"' is not assignable to type '"A" | "B" | "C"'. \ No newline at end of file + ~~~ +!!! error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'. \ No newline at end of file diff --git a/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt b/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt new file mode 100644 index 0000000000000..13c809b933da2 --- /dev/null +++ b/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt @@ -0,0 +1,67 @@ +tests/cases/compiler/deeplyNestedAssignabilityIssue.ts:22:17 - error TS2322: Type '{}' is not assignable to type 'A'. + Property 'a' is missing in type '{}'. + +22 thing: {} +   ~~~~~ + + tests/cases/compiler/deeplyNestedAssignabilityIssue.ts:8:19 +  8 more: { +    ~ +  9 thing: A; +   ~~~~~~~~~~~~~~~~~~~~~~~~~ + 10 } +   ~~~~~~~~~~~~~ + Which is from property '"thing"' of type '{ thing: A; }', declared here. +tests/cases/compiler/deeplyNestedAssignabilityIssue.ts:25:17 - error TS2322: Type '{}' is not assignable to type 'A'. + Property 'a' is missing in type '{}'. + +25 another: {} +   ~~~~~~~ + + tests/cases/compiler/deeplyNestedAssignabilityIssue.ts:11:23 + 11 yetstill: { +    ~ + 12 another: A; +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 13 } +   ~~~~~~~~~~~~~ + Which is from property '"another"' of type '{ another: A; }', declared here. + + +==== tests/cases/compiler/deeplyNestedAssignabilityIssue.ts (2 errors) ==== + interface A { + a: number; + } + + interface Large { + something: { + another: { + more: { + thing: A; + } + yetstill: { + another: A; + } + } + } + } + + const x: Large = { + something: { + another: { + more: { + thing: {} + ~~~~~ +!!! error TS2322: Type '{}' is not assignable to type 'A'. +!!! error TS2322: Property 'a' is missing in type '{}'. + }, + yetstill: { + another: {} + ~~~~~~~ +!!! error TS2322: Type '{}' is not assignable to type 'A'. +!!! error TS2322: Property 'a' is missing in type '{}'. + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/deeplyNestedAssignabilityIssue.js b/tests/baselines/reference/deeplyNestedAssignabilityIssue.js new file mode 100644 index 0000000000000..8d7ed1ec2edd9 --- /dev/null +++ b/tests/baselines/reference/deeplyNestedAssignabilityIssue.js @@ -0,0 +1,45 @@ +//// [deeplyNestedAssignabilityIssue.ts] +interface A { + a: number; +} + +interface Large { + something: { + another: { + more: { + thing: A; + } + yetstill: { + another: A; + } + } + } +} + +const x: Large = { + something: { + another: { + more: { + thing: {} + }, + yetstill: { + another: {} + } + } + } +} + + +//// [deeplyNestedAssignabilityIssue.js] +var x = { + something: { + another: { + more: { + thing: {} + }, + yetstill: { + another: {} + } + } + } +}; diff --git a/tests/baselines/reference/deeplyNestedAssignabilityIssue.symbols b/tests/baselines/reference/deeplyNestedAssignabilityIssue.symbols new file mode 100644 index 0000000000000..b77c310cfc870 --- /dev/null +++ b/tests/baselines/reference/deeplyNestedAssignabilityIssue.symbols @@ -0,0 +1,62 @@ +=== tests/cases/compiler/deeplyNestedAssignabilityIssue.ts === +interface A { +>A : Symbol(A, Decl(deeplyNestedAssignabilityIssue.ts, 0, 0)) + + a: number; +>a : Symbol(A.a, Decl(deeplyNestedAssignabilityIssue.ts, 0, 13)) +} + +interface Large { +>Large : Symbol(Large, Decl(deeplyNestedAssignabilityIssue.ts, 2, 1)) + + something: { +>something : Symbol(Large.something, Decl(deeplyNestedAssignabilityIssue.ts, 4, 17)) + + another: { +>another : Symbol(another, Decl(deeplyNestedAssignabilityIssue.ts, 5, 16)) + + more: { +>more : Symbol(more, Decl(deeplyNestedAssignabilityIssue.ts, 6, 18)) + + thing: A; +>thing : Symbol(thing, Decl(deeplyNestedAssignabilityIssue.ts, 7, 19)) +>A : Symbol(A, Decl(deeplyNestedAssignabilityIssue.ts, 0, 0)) + } + yetstill: { +>yetstill : Symbol(yetstill, Decl(deeplyNestedAssignabilityIssue.ts, 9, 13)) + + another: A; +>another : Symbol(another, Decl(deeplyNestedAssignabilityIssue.ts, 10, 23)) +>A : Symbol(A, Decl(deeplyNestedAssignabilityIssue.ts, 0, 0)) + } + } + } +} + +const x: Large = { +>x : Symbol(x, Decl(deeplyNestedAssignabilityIssue.ts, 17, 5)) +>Large : Symbol(Large, Decl(deeplyNestedAssignabilityIssue.ts, 2, 1)) + + something: { +>something : Symbol(something, Decl(deeplyNestedAssignabilityIssue.ts, 17, 18)) + + another: { +>another : Symbol(another, Decl(deeplyNestedAssignabilityIssue.ts, 18, 16)) + + more: { +>more : Symbol(more, Decl(deeplyNestedAssignabilityIssue.ts, 19, 18)) + + thing: {} +>thing : Symbol(thing, Decl(deeplyNestedAssignabilityIssue.ts, 20, 19)) + + }, + yetstill: { +>yetstill : Symbol(yetstill, Decl(deeplyNestedAssignabilityIssue.ts, 22, 14)) + + another: {} +>another : Symbol(another, Decl(deeplyNestedAssignabilityIssue.ts, 23, 23)) + } + } + } +} + diff --git a/tests/baselines/reference/deeplyNestedAssignabilityIssue.types b/tests/baselines/reference/deeplyNestedAssignabilityIssue.types new file mode 100644 index 0000000000000..4c358bc47a454 --- /dev/null +++ b/tests/baselines/reference/deeplyNestedAssignabilityIssue.types @@ -0,0 +1,69 @@ +=== tests/cases/compiler/deeplyNestedAssignabilityIssue.ts === +interface A { +>A : A + + a: number; +>a : number +} + +interface Large { +>Large : Large + + something: { +>something : { another: { more: { thing: A; }; yetstill: { another: A; }; }; } + + another: { +>another : { more: { thing: A; }; yetstill: { another: A; }; } + + more: { +>more : { thing: A; } + + thing: A; +>thing : A +>A : A + } + yetstill: { +>yetstill : { another: A; } + + another: A; +>another : A +>A : A + } + } + } +} + +const x: Large = { +>x : Large +>Large : Large +>{ something: { another: { more: { thing: {} }, yetstill: { another: {} } } }} : { something: { another: { more: { thing: {}; }; yetstill: { another: {}; }; }; }; } + + something: { +>something : { another: { more: { thing: {}; }; yetstill: { another: {}; }; }; } +>{ another: { more: { thing: {} }, yetstill: { another: {} } } } : { another: { more: { thing: {}; }; yetstill: { another: {}; }; }; } + + another: { +>another : { more: { thing: {}; }; yetstill: { another: {}; }; } +>{ more: { thing: {} }, yetstill: { another: {} } } : { more: { thing: {}; }; yetstill: { another: {}; }; } + + more: { +>more : { thing: {}; } +>{ thing: {} } : { thing: {}; } + + thing: {} +>thing : {} +>{} : {} + + }, + yetstill: { +>yetstill : { another: {}; } +>{ another: {} } : { another: {}; } + + another: {} +>another : {} +>{} : {} + } + } + } +} + diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt index 848093e11616a..964c722a38ea5 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -3,8 +3,7 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2461: Type 'undefined' is not an array type. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(4,5): error TS2461: Type 'undefined' is not an array type. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,5): error TS2322: Type '[number, number, string]' is not assignable to type '[number, boolean, string]'. - Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,51): error TS2322: Type '2' is not assignable to type 'boolean'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(22,5): error TS2322: Type 'number[]' is not assignable to type '[number, number]'. Property '0' is missing in type 'number[]'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(23,5): error TS2322: Type 'number[]' is not assignable to type '[string, string]'. @@ -32,9 +31,8 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss // S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, // where N is the numeric index of E in the array assignment pattern, or var [b0, b1, b2]: [number, boolean, string] = [1, 2, "string"]; // Error - ~~~~~~~~~~~~ -!!! error TS2322: Type '[number, number, string]' is not assignable to type '[number, boolean, string]'. -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. + ~ +!!! error TS2322: Type '2' is not assignable to type 'boolean'. interface J extends Array { 2: number; } diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt index c831b10a467fb..8830c102b71f3 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt @@ -1,28 +1,21 @@ -tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(3,5): error TS2322: Type '{ a1: boolean; a2: number; }' is not assignable to type '{ a1: number; a2: string; }'. - Types of property 'a1' are incompatible. - Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4,5): error TS2322: Type '[number, [[boolean]], true]' is not assignable to type '[number, [[string]], boolean]'. - Type '[[boolean]]' is not assignable to type '[[string]]'. - Type '[boolean]' is not assignable to type '[string]'. - Type 'boolean' is not assignable to type 'string'. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(3,46): error TS2322: Type 'true' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(3,56): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4,61): error TS2322: Type 'false' is not assignable to type 'string'. tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(14,16): error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c3' and no string index signature. tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(14,24): error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c5' and no string index signature. -==== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts (4 errors) ==== +==== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts (5 errors) ==== // The type T associated with a destructuring variable declaration is determined as follows: // If the declaration includes a type annotation, T is that type. var {a1, a2}: { a1: number, a2: string } = { a1: true, a2: 1 } // Error - ~~~~~~~~ -!!! error TS2322: Type '{ a1: boolean; a2: number; }' is not assignable to type '{ a1: number; a2: string; }'. -!!! error TS2322: Types of property 'a1' are incompatible. -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + ~~ +!!! error TS2322: Type 'true' is not assignable to type 'number'. + ~~ +!!! error TS2322: Type '1' is not assignable to type 'string'. var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], true]; // Error - ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '[number, [[boolean]], true]' is not assignable to type '[number, [[string]], boolean]'. -!!! error TS2322: Type '[[boolean]]' is not assignable to type '[[string]]'. -!!! error TS2322: Type '[boolean]' is not assignable to type '[string]'. -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. + ~~~~~ +!!! error TS2322: Type 'false' is not assignable to type 'string'. // The type T associated with a destructuring variable declaration is determined as follows: // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 5302f856c6f29..666962ee5d630 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -8,9 +8,7 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd Property 'id' is missing in type 'D<{}>'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(42,5): error TS2322: Type 'C' is not assignable to type 'D'. Property 'source' is missing in type 'C'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,5): error TS2322: Type '{ id: string; }' is not assignable to type 'I'. - Types of property 'id' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,28): error TS2322: Type '"a string"' is not assignable to type 'number'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(44,5): error TS2322: Type 'C' is not assignable to type '{ id: string; }'. Types of property 'id' are incompatible. Type 'number' is not assignable to type 'string'. @@ -93,10 +91,8 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd !!! error TS2322: Type 'C' is not assignable to type 'D'. !!! error TS2322: Property 'source' is missing in type 'C'. var anObjectLiteral: I = { id: 'a string' }; - ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ id: string; }' is not assignable to type 'I'. -!!! error TS2322: Types of property 'id' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~~ +!!! error TS2322: Type '"a string"' is not assignable to type 'number'. var anOtherObjectLiteral: { id: string } = new C(); ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'C' is not assignable to type '{ id: string; }'. diff --git a/tests/baselines/reference/fuzzy.errors.txt b/tests/baselines/reference/fuzzy.errors.txt index c3f05fd7f2f04..370be879553d3 100644 --- a/tests/baselines/reference/fuzzy.errors.txt +++ b/tests/baselines/reference/fuzzy.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/fuzzy.ts(13,18): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'alsoWorks' is missing in type 'C'. -tests/cases/compiler/fuzzy.ts(21,13): error TS2322: Type '{ anything: number; oneI: this; }' is not assignable to type 'R'. - Types of property 'oneI' are incompatible. - Type 'this' is not assignable to type 'I'. - Type 'C' is not assignable to type 'I'. +tests/cases/compiler/fuzzy.ts(21,34): error TS2322: Type 'this' is not assignable to type 'I'. + Type 'C' is not assignable to type 'I'. tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Type '{ oneI: this; }' cannot be converted to type 'R'. Property 'anything' is missing in type '{ oneI: this; }'. @@ -33,11 +31,9 @@ tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Type '{ oneI: this; }' canno doesntWork():R { return { anything:1, oneI:this }; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ anything: number; oneI: this; }' is not assignable to type 'R'. -!!! error TS2322: Types of property 'oneI' are incompatible. -!!! error TS2322: Type 'this' is not assignable to type 'I'. -!!! error TS2322: Type 'C' is not assignable to type 'I'. + ~~~~ +!!! error TS2322: Type 'this' is not assignable to type 'I'. +!!! error TS2322: Type 'C' is not assignable to type 'I'. } worksToo():R { diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt index 63679ff03b74d..8310321568512 100644 --- a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt @@ -1,10 +1,8 @@ -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. - Types of property 'x' are incompatible. - Type 'A' is not assignable to type 'Comparable'. - Types of property 'compareTo' are incompatible. - Type '(other: number) => number' is not assignable to type '(other: string) => number'. - Types of parameters 'other' and 'other' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,23): error TS2322: Type 'A' is not assignable to type 'Comparable'. + Types of property 'compareTo' are incompatible. + Type '(other: number) => number' is not assignable to type '(other: string) => number'. + Types of parameters 'other' and 'other' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. Types of property 'x' are incompatible. Type 'A' is not assignable to type 'Comparable'. @@ -29,14 +27,12 @@ tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS23 class A implements Comparable { compareTo(other: T) { return 1; } } var z = { x: new A() }; var a1: I = { x: new A() }; - ~~ -!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. -!!! error TS2322: Types of property 'x' are incompatible. -!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. -!!! error TS2322: Types of property 'compareTo' are incompatible. -!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number'. -!!! error TS2322: Types of parameters 'other' and 'other' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2322: Types of property 'compareTo' are incompatible. +!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number'. +!!! error TS2322: Types of parameters 'other' and 'other' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a2: I = function (): { x: A } { ~~ !!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. diff --git a/tests/baselines/reference/genericCallWithTupleType.errors.txt b/tests/baselines/reference/genericCallWithTupleType.errors.txt index 65920596c456b..2d920348dbeb6 100644 --- a/tests/baselines/reference/genericCallWithTupleType.errors.txt +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -3,15 +3,15 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup Type '4' is not assignable to type '2'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'. Type '{ a: string; }' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2322: Type '[number, string]' is not assignable to type '[string, number]'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,1): error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]'. - Type '{}' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,14): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,17): error TS2322: Type '"foo"' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,14): error TS2322: Type '{}' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,18): error TS2322: Type '{}' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(24,1): error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. Property '1' is missing in type '[{}]'. -==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts (5 errors) ==== +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts (7 errors) ==== interface I { tuple1: [T, U]; } @@ -41,13 +41,15 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup // error i1.tuple1 = [5, "foo"]; - ~~~~~~~~~ -!!! error TS2322: Type '[number, string]' is not assignable to type '[string, number]'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type '5' is not assignable to type 'string'. + ~~~~~ +!!! error TS2322: Type '"foo"' is not assignable to type 'number'. i1.tuple1 = [{}, {}]; - ~~~~~~~~~ -!!! error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]'. -!!! error TS2322: Type '{}' is not assignable to type 'string'. + ~~ +!!! error TS2322: Type '{}' is not assignable to type 'string'. + ~~ +!!! error TS2322: Type '{}' is not assignable to type 'number'. i2.tuple1 = [{}]; ~~~~~~~~~ !!! error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. diff --git a/tests/baselines/reference/invariantGenericErrorElaboration.errors.txt b/tests/baselines/reference/invariantGenericErrorElaboration.errors.txt index 5142b665d7146..e3fe3ecb9c219 100644 --- a/tests/baselines/reference/invariantGenericErrorElaboration.errors.txt +++ b/tests/baselines/reference/invariantGenericErrorElaboration.errors.txt @@ -1,13 +1,8 @@ tests/cases/compiler/invariantGenericErrorElaboration.ts(3,7): error TS2322: Type 'Num' is not assignable to type 'Runtype'. Types of property 'constraint' are incompatible. Type 'Constraint' is not assignable to type 'Constraint>'. - Types of property 'constraint' are incompatible. - Type 'Constraint>' is not assignable to type 'Constraint>>'. - Types of property 'constraint' are incompatible. - Type 'Constraint>>' is not assignable to type 'Constraint>>>'. - Type 'Constraint>>' is not assignable to type 'Constraint>'. - Types of property 'underlying' are incompatible. - Type 'Constraint>' is not assignable to type 'Constraint'. + Types of property 'underlying' are incompatible. + Type 'Num' is not assignable to type 'Runtype'. tests/cases/compiler/invariantGenericErrorElaboration.ts(4,17): error TS2345: Argument of type '{ foo: Num; }' is not assignable to parameter of type '{ [_: string]: Runtype; }'. Property 'foo' is incompatible with index signature. Type 'Num' is not assignable to type 'Runtype'. @@ -21,13 +16,8 @@ tests/cases/compiler/invariantGenericErrorElaboration.ts(4,17): error TS2345: Ar !!! error TS2322: Type 'Num' is not assignable to type 'Runtype'. !!! error TS2322: Types of property 'constraint' are incompatible. !!! error TS2322: Type 'Constraint' is not assignable to type 'Constraint>'. -!!! error TS2322: Types of property 'constraint' are incompatible. -!!! error TS2322: Type 'Constraint>' is not assignable to type 'Constraint>>'. -!!! error TS2322: Types of property 'constraint' are incompatible. -!!! error TS2322: Type 'Constraint>>' is not assignable to type 'Constraint>>>'. -!!! error TS2322: Type 'Constraint>>' is not assignable to type 'Constraint>'. -!!! error TS2322: Types of property 'underlying' are incompatible. -!!! error TS2322: Type 'Constraint>' is not assignable to type 'Constraint'. +!!! error TS2322: Types of property 'underlying' are incompatible. +!!! error TS2322: Type 'Num' is not assignable to type 'Runtype'. const Foo = Obj({ foo: Num }) ~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ foo: Num; }' is not assignable to parameter of type '{ [_: string]: Runtype; }'. diff --git a/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt b/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt index 632264144dd36..813263e45e42a 100644 --- a/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt +++ b/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt @@ -1,6 +1,5 @@ -tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(20,31): error TS2326: Types of property 'children' are incompatible. - Type '(p: IntrinsicAttributes & LitProps<"x">) => "y"' is not assignable to type '(x: IntrinsicAttributes & LitProps<"x">) => "x"'. - Type '"y"' is not assignable to type '"x"'. +tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(20,31): error TS2322: Type '(p: IntrinsicAttributes & LitProps<"x">) => "y"' is not assignable to type '(x: IntrinsicAttributes & LitProps<"x">) => "x"'. + Type '"y"' is not assignable to type '"x"'. tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(21,19): error TS2322: Type '{ children: (p: IntrinsicAttributes & LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x" | "y">'. Type '{ children: (p: IntrinsicAttributes & LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'LitProps<"x" | "y">'. Types of property 'children' are incompatible. @@ -39,10 +38,9 @@ tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(22,21): error TS2322: // Should error const arg = "y"} /> - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2326: Types of property 'children' are incompatible. -!!! error TS2326: Type '(p: IntrinsicAttributes & LitProps<"x">) => "y"' is not assignable to type '(x: IntrinsicAttributes & LitProps<"x">) => "x"'. -!!! error TS2326: Type '"y"' is not assignable to type '"x"'. + ~~~~~~~~ +!!! error TS2322: Type '(p: IntrinsicAttributes & LitProps<"x">) => "y"' is not assignable to type '(x: IntrinsicAttributes & LitProps<"x">) => "x"'. +!!! error TS2322: Type '"y"' is not assignable to type '"x"'. const argchild = {p => "y"} ~~~~~~~ !!! error TS2322: Type '{ children: (p: IntrinsicAttributes & LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x" | "y">'. diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index f78c32531a486..bf3072723a94f 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -37,15 +37,9 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(123,12): error TS2345: Type 'undefined' is not assignable to type 'string'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(124,14): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,5): error TS2322: Type '{ a: string; }' is not assignable to type 'T2'. - Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'number | undefined'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,5): error TS2322: Type '{ a: string; }' is not assignable to type 'Partial'. - Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'number | undefined'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,5): error TS2322: Type '{ a: string; }' is not assignable to type '{ [x: string]: any; a?: number | undefined; }'. - Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'number | undefined'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: Type '"no"' is not assignable to type 'number | undefined'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type '"no"' is not assignable to type 'number | undefined'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type '"no"' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,16): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. Type 'T' is not assignable to type 'symbol'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: Type 'P' cannot be used to index type 'T'. @@ -239,20 +233,14 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: type T2 = { a?: number, [key: string]: any }; let x1: T2 = { a: 'no' }; // Error - ~~ -!!! error TS2322: Type '{ a: string; }' is not assignable to type 'T2'. -!!! error TS2322: Types of property 'a' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'. + ~ +!!! error TS2322: Type '"no"' is not assignable to type 'number | undefined'. let x2: Partial = { a: 'no' }; // Error - ~~ -!!! error TS2322: Type '{ a: string; }' is not assignable to type 'Partial'. -!!! error TS2322: Types of property 'a' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'. + ~ +!!! error TS2322: Type '"no"' is not assignable to type 'number | undefined'. let x3: { [P in keyof T2]: T2[P]} = { a: 'no' }; // Error - ~~ -!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ [x: string]: any; a?: number | undefined; }'. -!!! error TS2322: Types of property 'a' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'. + ~ +!!! error TS2322: Type '"no"' is not assignable to type 'number | undefined'. // Repro from #13044 diff --git a/tests/baselines/reference/nestedFreshLiteral.errors.txt b/tests/baselines/reference/nestedFreshLiteral.errors.txt index d68b398449d53..24e664c820fc3 100644 --- a/tests/baselines/reference/nestedFreshLiteral.errors.txt +++ b/tests/baselines/reference/nestedFreshLiteral.errors.txt @@ -1,10 +1,8 @@ -tests/cases/compiler/nestedFreshLiteral.ts(12,21): error TS2322: Type '{ nested: { prop: { colour: string; }; }; }' is not assignable to type 'NestedCSSProps'. - Types of property 'nested' are incompatible. - Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector | undefined'. - Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector'. - Types of property 'prop' are incompatible. - Type '{ colour: string; }' is not assignable to type 'CSSProps'. - Object literal may only specify known properties, but 'colour' does not exist in type 'CSSProps'. Did you mean to write 'color'? +tests/cases/compiler/nestedFreshLiteral.ts(12,21): error TS2322: Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector | undefined'. + Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector'. + Types of property 'prop' are incompatible. + Type '{ colour: string; }' is not assignable to type 'CSSProps'. + Object literal may only specify known properties, but 'colour' does not exist in type 'CSSProps'. Did you mean to write 'color'? ==== tests/cases/compiler/nestedFreshLiteral.ts (1 errors) ==== @@ -21,11 +19,9 @@ tests/cases/compiler/nestedFreshLiteral.ts(12,21): error TS2322: Type '{ nested: let stylen: NestedCSSProps = { nested: { prop: { colour: 'red' } } ~~~~~~~~~~~~~ -!!! error TS2322: Type '{ nested: { prop: { colour: string; }; }; }' is not assignable to type 'NestedCSSProps'. -!!! error TS2322: Types of property 'nested' are incompatible. -!!! error TS2322: Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector | undefined'. -!!! error TS2322: Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector'. -!!! error TS2322: Types of property 'prop' are incompatible. -!!! error TS2322: Type '{ colour: string; }' is not assignable to type 'CSSProps'. -!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'CSSProps'. Did you mean to write 'color'? +!!! error TS2322: Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector | undefined'. +!!! error TS2322: Type '{ prop: { colour: string; }; }' is not assignable to type 'NestedSelector'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type '{ colour: string; }' is not assignable to type 'CSSProps'. +!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'CSSProps'. Did you mean to write 'color'? } \ No newline at end of file diff --git a/tests/baselines/reference/nonPrimitiveAsProperty.errors.txt b/tests/baselines/reference/nonPrimitiveAsProperty.errors.txt index 8d4042c92f052..1f35fd649bfc0 100644 --- a/tests/baselines/reference/nonPrimitiveAsProperty.errors.txt +++ b/tests/baselines/reference/nonPrimitiveAsProperty.errors.txt @@ -1,6 +1,4 @@ -tests/cases/conformance/types/nonPrimitive/nonPrimitiveAsProperty.ts(7,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'WithNonPrimitive'. - Types of property 'foo' are incompatible. - Type 'string' is not assignable to type 'object'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveAsProperty.ts(7,28): error TS2322: Type '"bar"' is not assignable to type 'object'. ==== tests/cases/conformance/types/nonPrimitive/nonPrimitiveAsProperty.ts (1 errors) ==== @@ -11,8 +9,6 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveAsProperty.ts(7,5): error var a: WithNonPrimitive = { foo: {bar: "bar"} }; var b: WithNonPrimitive = {foo: "bar"}; // expect error - ~ -!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'WithNonPrimitive'. -!!! error TS2322: Types of property 'foo' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'object'. + ~~~ +!!! error TS2322: Type '"bar"' is not assignable to type 'object'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt index 1c25a4a03822a..ef95ff8796ab5 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt @@ -5,8 +5,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(50,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(68,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(79,5): error TS2322: Type '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; }' is not assignable to type '{ [x: number]: string; }'. - Object literal may only specify known properties, and 'a' does not exist in type '{ [x: number]: string; }'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(85,5): error TS2322: Type '1' is not assignable to type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(88,9): error TS2304: Cannot find name 'Myn'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(90,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(93,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -106,15 +105,14 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo // error var b: { [x: number]: string; } = { a: '', - ~~~~~ -!!! error TS2322: Type '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; }' is not assignable to type '{ [x: number]: string; }'. -!!! error TS2322: Object literal may only specify known properties, and 'a' does not exist in type '{ [x: number]: string; }'. b: 1, c: () => { }, "d": '', "e": 1, 1.0: '', 2.0: 1, + ~~~ +!!! error TS2322: Type '1' is not assignable to type 'string'. "3.0": '', "4.0": 1, f: null, diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt index b327c613f30a4..54b4f301ad966 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt @@ -1,8 +1,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(16,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(25,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(34,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(44,5): error TS2322: Type '{ 1.0: A; 2.0: B; "2.5": B; 3.0: number; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. - Object literal may only specify known properties, and '"4.0"' does not exist in type '{ [x: number]: A; }'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(43,5): error TS2322: Type '1' is not assignable to type 'A'. ==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts (4 errors) ==== @@ -55,8 +54,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo 2.0: new B(), "2.5": new B(), 3.0: 1, + ~~~ +!!! error TS2322: Type '1' is not assignable to type 'A'. "4.0": '' - ~~~~~~~~~ -!!! error TS2322: Type '{ 1.0: A; 2.0: B; "2.5": B; 3.0: number; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. -!!! error TS2322: Object literal may only specify known properties, and '"4.0"' does not exist in type '{ [x: number]: A; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralExcessProperties.errors.txt b/tests/baselines/reference/objectLiteralExcessProperties.errors.txt index 0c5909dc4ed45..4f081c6632148 100644 --- a/tests/baselines/reference/objectLiteralExcessProperties.errors.txt +++ b/tests/baselines/reference/objectLiteralExcessProperties.errors.txt @@ -19,10 +19,8 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(23,29): error TS2322: Type Object literal may only specify known properties, and 'couleur' does not exist in type 'Cover | Cover[]'. tests/cases/compiler/objectLiteralExcessProperties.ts(25,27): error TS2322: Type '{ forewarned: string; }' is not assignable to type 'Book | Book[]'. Object literal may only specify known properties, and 'forewarned' does not exist in type 'Book | Book[]'. -tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type '{ 0: { colour: string; }; }' is not assignable to type 'Indexed'. - Property '0' is incompatible with index signature. - Type '{ colour: string; }' is not assignable to type 'Cover'. - Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? +tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type '{ colour: string; }' is not assignable to type 'Cover'. + Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? ==== tests/cases/compiler/objectLiteralExcessProperties.ts (10 errors) ==== @@ -90,8 +88,6 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type var b11: Indexed = { 0: { colour: "blue" } }; // nested object literal still errors ~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ 0: { colour: string; }; }' is not assignable to type 'Indexed'. -!!! error TS2322: Property '0' is incompatible with index signature. -!!! error TS2322: Type '{ colour: string; }' is not assignable to type 'Cover'. -!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? +!!! error TS2322: Type '{ colour: string; }' is not assignable to type 'Cover'. +!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt index 53abb5b7658d1..2d0433389404e 100644 --- a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt @@ -1,10 +1,6 @@ -tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ x: B; 0: A; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'. - Property '0' is incompatible with index signature. - Type 'A' is not assignable to type 'B'. - Property 'y' is missing in type 'A'. -tests/cases/compiler/objectLiteralIndexerErrors.ts(14,1): error TS2322: Type '{ x: any; 0: A; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'. - Property '0' is incompatible with index signature. - Type 'A' is not assignable to type 'B'. +tests/cases/compiler/objectLiteralIndexerErrors.ts(13,54): error TS2322: Type 'A' is not assignable to type 'B'. + Property 'y' is missing in type 'A'. +tests/cases/compiler/objectLiteralIndexerErrors.ts(14,14): error TS2322: Type 'A' is not assignable to type 'B'. ==== tests/cases/compiler/objectLiteralIndexerErrors.ts (2 errors) ==== @@ -21,13 +17,9 @@ tests/cases/compiler/objectLiteralIndexerErrors.ts(14,1): error TS2322: Type '{ var c: any; var o1: { [s: string]: A;[n: number]: B; } = { x: b, 0: a }; // both indexers are A - ~~ -!!! error TS2322: Type '{ x: B; 0: A; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'. -!!! error TS2322: Property '0' is incompatible with index signature. -!!! error TS2322: Type 'A' is not assignable to type 'B'. -!!! error TS2322: Property 'y' is missing in type 'A'. + ~ +!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'y' is missing in type 'A'. o1 = { x: c, 0: a }; // string indexer is any, number indexer is A - ~~ -!!! error TS2322: Type '{ x: any; 0: A; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'. -!!! error TS2322: Property '0' is incompatible with index signature. -!!! error TS2322: Type 'A' is not assignable to type 'B'. \ No newline at end of file + ~ +!!! error TS2322: Type 'A' is not assignable to type 'B'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralNormalization.errors.txt b/tests/baselines/reference/objectLiteralNormalization.errors.txt index 6bdc9b955e324..de2d8b570f52c 100644 --- a/tests/baselines/reference/objectLiteralNormalization.errors.txt +++ b/tests/baselines/reference/objectLiteralNormalization.errors.txt @@ -1,6 +1,4 @@ -tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(7,1): error TS2322: Type '{ a: number; b: number; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. - Type '{ a: number; b: number; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. - Property 'c' is missing in type '{ a: number; b: number; }'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(7,14): error TS2322: Type '0' is not assignable to type 'string | undefined'. tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(8,1): error TS2322: Type '{ b: string; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. Type '{ b: string; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. Property 'a' is missing in type '{ b: string; }'. @@ -25,10 +23,8 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts a1.c; // boolean | undefined a1 = { a: 1 }; a1 = { a: 0, b: 0 }; // Error - ~~ -!!! error TS2322: Type '{ a: number; b: number; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. -!!! error TS2322: Type '{ a: number; b: number; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. -!!! error TS2322: Property 'c' is missing in type '{ a: number; b: number; }'. + ~ +!!! error TS2322: Type '0' is not assignable to type 'string | undefined'. a1 = { b: "y" }; // Error ~~ !!! error TS2322: Type '{ b: string; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt index c0e6e10d8de3c..f1570f6ff56ad 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt @@ -1,14 +1,13 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(4,43): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,72): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'. - Types of property 'id' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,81): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,87): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(8,5): error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ name: string; id: boolean; }'. Types of property 'id' are incompatible. Type 'number' is not assignable to type 'boolean'. -==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts (3 errors) ==== +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts (4 errors) ==== var id: number = 10000; var name: string = "my name"; @@ -18,10 +17,10 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr !!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. var person1: { name, id }; // ok function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'. -!!! error TS2322: Types of property 'id' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. function bar(obj: { name: string; id: boolean }) { } bar({ name, id }); // error ~~~~~~~~~~~~ diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt index 6b227fce71086..99e5a0cdac8fc 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt @@ -1,14 +1,13 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(4,43): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,72): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ name: number; id: string; }'. - Types of property 'name' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,81): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,87): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,5): error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'. Types of property 'name' are incompatible. Type 'number' is not assignable to type 'string'. -==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts (3 errors) ==== +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts (4 errors) ==== var id: number = 10000; var name: string = "my name"; @@ -17,10 +16,10 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr !!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'. function bar(name: string, id: number): { name: number, id: string } { return { name, id }; } // error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ name: number; id: string; }'. -!!! error TS2322: Types of property 'name' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. function foo(name: string, id: number): { name: string, id: number } { return { name, id }; } // error var person1: { name, id }; // ok var person2: { name: string, id: number } = bar("hello", 5); diff --git a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt index 3f499b0a580ac..631bbd36503a8 100644 --- a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt +++ b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt @@ -1,6 +1,4 @@ -tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2322: Type '{ 0: number; }' is not assignable to type 'A'. - Types of property '0' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(5,5): error TS2322: Type '3' is not assignable to type 'string'. ==== tests/cases/compiler/objectLiteralWithNumericPropertyName.ts (1 errors) ==== @@ -8,10 +6,8 @@ tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2322: 0: string; } var x: A = { - ~ -!!! error TS2322: Type '{ 0: number; }' is not assignable to type 'A'. -!!! error TS2322: Types of property '0' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. 0: 3 + ~ +!!! error TS2322: Type '3' is not assignable to type 'string'. }; \ No newline at end of file diff --git a/tests/baselines/reference/objectSpreadStrictNull.errors.txt b/tests/baselines/reference/objectSpreadStrictNull.errors.txt index 791b5419eb1bc..4756cac2f6a00 100644 --- a/tests/baselines/reference/objectSpreadStrictNull.errors.txt +++ b/tests/baselines/reference/objectSpreadStrictNull.errors.txt @@ -10,9 +10,7 @@ tests/cases/conformance/types/spread/objectSpreadStrictNull.ts(18,9): error TS23 Types of property 'sn' are incompatible. Type 'string | number | undefined' is not assignable to type 'string | number | boolean'. Type 'undefined' is not assignable to type 'string | number | boolean'. -tests/cases/conformance/types/spread/objectSpreadStrictNull.ts(28,7): error TS2322: Type '{ title: undefined; yearReleased: number; }' is not assignable to type 'Movie'. - Types of property 'title' are incompatible. - Type 'undefined' is not assignable to type 'string'. +tests/cases/conformance/types/spread/objectSpreadStrictNull.ts(28,26): error TS2322: Type 'undefined' is not assignable to type 'string'. tests/cases/conformance/types/spread/objectSpreadStrictNull.ts(42,5): error TS2322: Type '{ foo: number | undefined; bar: string | undefined; }' is not assignable to type 'Fields'. Types of property 'foo' are incompatible. Type 'number | undefined' is not assignable to type 'number'. @@ -63,10 +61,8 @@ tests/cases/conformance/types/spread/objectSpreadStrictNull.ts(42,5): error TS23 const m = { title: "The Matrix", yearReleased: 1999 }; // should error here because title: undefined is not assignable to string const x: Movie = { ...m, title: undefined }; - ~ -!!! error TS2322: Type '{ title: undefined; yearReleased: number; }' is not assignable to type 'Movie'. -!!! error TS2322: Types of property 'title' are incompatible. -!!! error TS2322: Type 'undefined' is not assignable to type 'string'. + ~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. interface Fields { foo: number; diff --git a/tests/baselines/reference/returnInConstructor1.errors.txt b/tests/baselines/reference/returnInConstructor1.errors.txt index d4fb6a0b50e90..2c9fe1e34e1cd 100644 --- a/tests/baselines/reference/returnInConstructor1.errors.txt +++ b/tests/baselines/reference/returnInConstructor1.errors.txt @@ -2,10 +2,8 @@ tests/cases/compiler/returnInConstructor1.ts(11,9): error TS2322: Type '1' is no tests/cases/compiler/returnInConstructor1.ts(11,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. tests/cases/compiler/returnInConstructor1.ts(25,9): error TS2322: Type '"test"' is not assignable to type 'D'. tests/cases/compiler/returnInConstructor1.ts(25,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. -tests/cases/compiler/returnInConstructor1.ts(39,9): error TS2322: Type '{ foo: number; }' is not assignable to type 'F'. - Types of property 'foo' are incompatible. - Type 'number' is not assignable to type 'string'. tests/cases/compiler/returnInConstructor1.ts(39,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. +tests/cases/compiler/returnInConstructor1.ts(39,18): error TS2322: Type '1' is not assignable to type 'string'. tests/cases/compiler/returnInConstructor1.ts(55,9): error TS2322: Type 'G' is not assignable to type 'H'. Types of property 'foo' are incompatible. Type '() => void' is not assignable to type 'string'. @@ -61,11 +59,9 @@ tests/cases/compiler/returnInConstructor1.ts(55,9): error TS2409: Return type of constructor() { return { foo: 1 }; //error ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'F'. -!!! error TS2322: Types of property 'foo' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - ~~~~~~~~~~~~~~~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class. + ~~~ +!!! error TS2322: Type '1' is not assignable to type 'string'. } } diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt index 1225f9ab2ce60..53938fe4ec398 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt @@ -6,19 +6,18 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(70,5): error tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(75,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(75,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(80,5): error TS2322: Type '5' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(80,13): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. - Types of property 'x' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(80,20): error TS2322: Type '1' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(85,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(85,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(85,19): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(85,26): error TS2322: Type '1' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(111,12): error TS2304: Cannot find name 's'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(111,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. -==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts (14 errors) ==== +==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts (15 errors) ==== (function() { var s0; for ({ s0 = 5 } of [{ s0: 1 }]) { @@ -115,10 +114,8 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(111,14): err ({ y2 = 5, y3 = { x: 1 } } = {}) ~~ !!! error TS2322: Type '5' is not assignable to type 'string'. - ~~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. -!!! error TS2322: Types of property 'x' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type '1' is not assignable to type 'string'. }); (function() { @@ -132,6 +129,8 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(111,14): err !!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. !!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type '1' is not assignable to type 'string'. }); (function() { diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt index acff36b6d1f3f..5f871db8f51bb 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt @@ -6,19 +6,18 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(70,5): e tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(75,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(75,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(80,5): error TS2322: Type '5' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(80,13): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. - Types of property 'x' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(80,20): error TS2322: Type '1' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(85,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(85,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(85,19): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(85,26): error TS2322: Type '1' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(111,12): error TS2304: Cannot find name 's'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(111,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. -==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts (14 errors) ==== +==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts (15 errors) ==== (function() { var s0; for ({ s0 = 5 } of [{ s0: 1 }]) { @@ -115,10 +114,8 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(111,14): ({ y2 = 5, y3 = { x: 1 } } = {}) ~~ !!! error TS2322: Type '5' is not assignable to type 'string'. - ~~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. -!!! error TS2322: Types of property 'x' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type '1' is not assignable to type 'string'. }); (function() { @@ -132,6 +129,8 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(111,14): !!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. !!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type '1' is not assignable to type 'string'. }); (function() { diff --git a/tests/baselines/reference/spreadUnion3.errors.txt b/tests/baselines/reference/spreadUnion3.errors.txt index b1fa3316d34e0..4cb7ad33b1a00 100644 --- a/tests/baselines/reference/spreadUnion3.errors.txt +++ b/tests/baselines/reference/spreadUnion3.errors.txt @@ -1,7 +1,4 @@ -tests/cases/conformance/types/spread/spreadUnion3.ts(2,5): error TS2322: Type '{ y: number; } | { y: string; }' is not assignable to type '{ y: string; }'. - Type '{ y: number; }' is not assignable to type '{ y: string; }'. - Types of property 'y' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/spread/spreadUnion3.ts(2,14): error TS2322: Type '123' is not assignable to type 'string'. tests/cases/conformance/types/spread/spreadUnion3.ts(9,23): error TS2339: Property 'a' does not exist on type '{}'. tests/cases/conformance/types/spread/spreadUnion3.ts(17,11): error TS2698: Spread types may only be created from object types. tests/cases/conformance/types/spread/spreadUnion3.ts(18,11): error TS2698: Spread types may only be created from object types. @@ -10,11 +7,8 @@ tests/cases/conformance/types/spread/spreadUnion3.ts(18,11): error TS2698: Sprea ==== tests/cases/conformance/types/spread/spreadUnion3.ts (4 errors) ==== function f(x: { y: string } | undefined): { y: string } { return { y: 123, ...x } // y: string | number - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ y: number; } | { y: string; }' is not assignable to type '{ y: string; }'. -!!! error TS2322: Type '{ y: number; }' is not assignable to type '{ y: string; }'. -!!! error TS2322: Types of property 'y' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type '123' is not assignable to type 'string'. } f(undefined) diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt index 2a847e98b7495..d22408299d2ce 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt @@ -22,14 +22,18 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(71,5): error TS2411: Property 'foo' of type '() => string' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(73,5): error TS2411: Property '"4.0"' of type 'number' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(74,5): error TS2411: Property 'f' of type 'MyString' is not assignable to string index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'. - Property 'b' is incompatible with index signature. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(80,5): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(81,5): error TS2322: Type '() => void' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(83,5): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(85,5): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(87,5): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(88,5): error TS2322: Type 'MyString' is not assignable to type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(90,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(93,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(94,5): error TS2322: Type '() => string' is not assignable to type 'string'. -==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts (27 errors) ==== +==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts (33 errors) ==== // String indexer types constrain the types of named properties in their containing type interface MyString extends String { @@ -156,20 +160,28 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon // error var b: { [x: string]: string; } = { - ~ -!!! error TS2322: Type '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'. -!!! error TS2322: Property 'b' is incompatible with index signature. -!!! error TS2322: Type 'number' is not assignable to type 'string'. a: '', b: 1, + ~ +!!! error TS2322: Type '1' is not assignable to type 'string'. c: () => { }, + ~ +!!! error TS2322: Type '() => void' is not assignable to type 'string'. "d": '', "e": 1, + ~~~ +!!! error TS2322: Type '1' is not assignable to type 'string'. 1.0: '', 2.0: 1, + ~~~ +!!! error TS2322: Type '1' is not assignable to type 'string'. "3.0": '', "4.0": 1, + ~~~~~ +!!! error TS2322: Type '1' is not assignable to type 'string'. f: null, + ~ +!!! error TS2322: Type 'MyString' is not assignable to type 'string'. get X() { ~ @@ -180,6 +192,8 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. foo() { + ~~~ +!!! error TS2322: Type '() => string' is not assignable to type 'string'. return ''; } } \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt index 891da8c8ce9db..fb4bd693c3bbe 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt @@ -4,13 +4,13 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(24,5): error TS2411: Property 'd' of type 'string' is not assignable to string index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(31,5): error TS2411: Property 'c' of type 'number' is not assignable to string index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(32,5): error TS2411: Property 'd' of type 'string' is not assignable to string index type 'A'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(36,5): error TS2322: Type '{ a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }'. - Property 'a' is incompatible with index signature. - Type 'typeof A' is not assignable to type 'A'. - Property 'foo' is missing in type 'typeof A'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(37,5): error TS2322: Type 'typeof A' is not assignable to type 'A'. + Property 'foo' is missing in type 'typeof A'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(38,5): error TS2322: Type 'typeof B' is not assignable to type 'A'. + Property 'foo' is missing in type 'typeof B'. -==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts (7 errors) ==== +==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts (8 errors) ==== // String indexer providing a constraint of a user defined type class A { @@ -59,11 +59,12 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon // error var b: { [x: string]: A } = { - ~ -!!! error TS2322: Type '{ a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }'. -!!! error TS2322: Property 'a' is incompatible with index signature. -!!! error TS2322: Type 'typeof A' is not assignable to type 'A'. -!!! error TS2322: Property 'foo' is missing in type 'typeof A'. a: A, + ~ +!!! error TS2322: Type 'typeof A' is not assignable to type 'A'. +!!! error TS2322: Property 'foo' is missing in type 'typeof A'. b: B + ~ +!!! error TS2322: Type 'typeof B' is not assignable to type 'A'. +!!! error TS2322: Property 'foo' is missing in type 'typeof B'. } \ No newline at end of file diff --git a/tests/baselines/reference/tsxAttributeErrors.errors.txt b/tests/baselines/reference/tsxAttributeErrors.errors.txt index 081f7b4fd6b98..0856c2c7432f4 100644 --- a/tests/baselines/reference/tsxAttributeErrors.errors.txt +++ b/tests/baselines/reference/tsxAttributeErrors.errors.txt @@ -1,7 +1,5 @@ -tests/cases/conformance/jsx/tsxAttributeErrors.tsx(14,6): error TS2326: Types of property 'text' are incompatible. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/tsxAttributeErrors.tsx(17,6): error TS2326: Types of property 'width' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/tsxAttributeErrors.tsx(14,6): error TS2322: Type '42' is not assignable to type 'string'. +tests/cases/conformance/jsx/tsxAttributeErrors.tsx(17,6): error TS2322: Type '"foo"' is not assignable to type 'number'. tests/cases/conformance/jsx/tsxAttributeErrors.tsx(21,2): error TS2322: Type '{ text: number; }' is not assignable to type '{ text?: string; width?: number; }'. Types of property 'text' are incompatible. Type 'number' is not assignable to type 'string'. @@ -22,15 +20,13 @@ tests/cases/conformance/jsx/tsxAttributeErrors.tsx(21,2): error TS2322: Type '{ // Error, number is not assignable to string
; - ~~~~~~~~~ -!!! error TS2326: Types of property 'text' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~~~~ +!!! error TS2322: Type '42' is not assignable to type 'string'. // Error, string is not assignable to number
; - ~~~~~~~~~~~~~ -!!! error TS2326: Types of property 'width' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'number'. + ~~~~~ +!!! error TS2322: Type '"foo"' is not assignable to type 'number'. // Error, number is not assignable to string var attribs = { text: 100 }; diff --git a/tests/baselines/reference/tsxAttributeResolution1.errors.txt b/tests/baselines/reference/tsxAttributeResolution1.errors.txt index ab881bfa6f902..9aabc86c91dac 100644 --- a/tests/baselines/reference/tsxAttributeResolution1.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution1.errors.txt @@ -1,14 +1,11 @@ -tests/cases/conformance/jsx/file.tsx(23,8): error TS2326: Types of property 'x' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type '"0"' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(24,2): error TS2559: Type '{ y: number; }' has no properties in common with type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(25,2): error TS2559: Type '{ y: string; }' has no properties in common with type 'Attribs1'. -tests/cases/conformance/jsx/file.tsx(26,8): error TS2326: Types of property 'x' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type '"32"' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(27,2): error TS2559: Type '{ var: string; }' has no properties in common with type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(29,2): error TS2322: Type '{}' is not assignable to type '{ reqd: string; }'. Property 'reqd' is missing in type '{}'. -tests/cases/conformance/jsx/file.tsx(30,8): error TS2326: Types of property 'reqd' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '10' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (7 errors) ==== @@ -35,9 +32,8 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2326: Types of property 'req // Errors ; // Error, '0' is not number - ~~~~~~~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2322: Type '"0"' is not assignable to type 'number'. ; // Error, no property "y" ~~~~~ !!! error TS2559: Type '{ y: number; }' has no properties in common with type 'Attribs1'. @@ -45,9 +41,8 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2326: Types of property 'req ~~~~~ !!! error TS2559: Type '{ y: string; }' has no properties in common with type 'Attribs1'. ; // Error, "32" is not number - ~~~~~~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2322: Type '"32"' is not assignable to type 'number'. ; // Error, no 'var' property ~~~~~ !!! error TS2559: Type '{ var: string; }' has no properties in common with type 'Attribs1'. @@ -57,9 +52,8 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2326: Types of property 'req !!! error TS2322: Type '{}' is not assignable to type '{ reqd: string; }'. !!! error TS2322: Property 'reqd' is missing in type '{}'. ; // Error, reqd is not string - ~~~~~~~~~ -!!! error TS2326: Types of property 'reqd' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~~~~ +!!! error TS2322: Type '10' is not assignable to type 'string'. // Should be OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution10.errors.txt b/tests/baselines/reference/tsxAttributeResolution10.errors.txt index 2da8c1466b078..d7561fe1336e8 100644 --- a/tests/baselines/reference/tsxAttributeResolution10.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution10.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(11,14): error TS2326: Types of property 'bar' are incompatible. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type '"world"' is not assignable to type 'boolean'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -24,9 +23,8 @@ tests/cases/conformance/jsx/file.tsx(11,14): error TS2326: Types of property 'ba // Should be an error ; - ~~~~~~~~~~~ -!!! error TS2326: Types of property 'bar' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'boolean'. + ~~~ +!!! error TS2322: Type '"world"' is not assignable to type 'boolean'. // Should be OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution14.errors.txt b/tests/baselines/reference/tsxAttributeResolution14.errors.txt index eefddf7d2a5c5..df623eed88c06 100644 --- a/tests/baselines/reference/tsxAttributeResolution14.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution14.errors.txt @@ -1,7 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(13,28): error TS2326: Types of property 'primaryText' are incompatible. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(15,28): error TS2326: Types of property 'justRandomProp1' are incompatible. - Type 'boolean' is not assignable to type 'string | number'. +tests/cases/conformance/jsx/file.tsx(13,28): error TS2322: Type '2' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(15,28): error TS2322: Type 'true' is not assignable to type 'string | number'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -27,14 +25,12 @@ tests/cases/conformance/jsx/file.tsx(15,28): error TS2326: Types of property 'ju return (
// error - ~~~~~~~~~~~~~~~ -!!! error TS2326: Types of property 'primaryText' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~~~~~~~~~~~ +!!! error TS2322: Type '2' is not assignable to type 'string'. // ok // error - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2326: Types of property 'justRandomProp1' are incompatible. -!!! error TS2326: Type 'boolean' is not assignable to type 'string | number'. + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'true' is not assignable to type 'string | number'.
) } \ No newline at end of file diff --git a/tests/baselines/reference/tsxAttributeResolution3.errors.txt b/tests/baselines/reference/tsxAttributeResolution3.errors.txt index 94205714803b2..498327780d4a7 100644 --- a/tests/baselines/reference/tsxAttributeResolution3.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution3.errors.txt @@ -3,8 +3,7 @@ tests/cases/conformance/jsx/file.tsx(19,2): error TS2322: Type '{ x: number; }' Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(23,2): error TS2322: Type '{ y: number; }' is not assignable to type 'Attribs1'. Property 'x' is missing in type '{ y: number; }'. -tests/cases/conformance/jsx/file.tsx(31,8): error TS2326: Types of property 'x' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(31,8): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -46,9 +45,8 @@ tests/cases/conformance/jsx/file.tsx(31,8): error TS2326: Types of property 'x' // Error var obj5 = { x: 32, y: 32 }; - ~~~~~~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. // Ok var obj6 = { x: 'ok', y: 32, extra: 100 }; diff --git a/tests/baselines/reference/tsxAttributeResolution6.errors.txt b/tests/baselines/reference/tsxAttributeResolution6.errors.txt index e9ad3c3e8deb4..7904283aa39c6 100644 --- a/tests/baselines/reference/tsxAttributeResolution6.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution6.errors.txt @@ -1,7 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(10,8): error TS2326: Types of property 's' are incompatible. - Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(11,8): error TS2326: Types of property 'n' are incompatible. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(10,8): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(11,8): error TS2322: Type '"true"' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(12,2): error TS2322: Type '{}' is not assignable to type '{ n: boolean; }'. Property 'n' is missing in type '{}'. @@ -18,12 +16,10 @@ tests/cases/conformance/jsx/file.tsx(12,2): error TS2322: Type '{}' is not assig // Error ; ~ -!!! error TS2326: Types of property 's' are incompatible. -!!! error TS2326: Type 'true' is not assignable to type 'string'. +!!! error TS2322: Type 'true' is not assignable to type 'string'. ; - ~~~~~~~~ -!!! error TS2326: Types of property 'n' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'boolean'. + ~ +!!! error TS2322: Type '"true"' is not assignable to type 'boolean'. ; ~~~~~ !!! error TS2322: Type '{}' is not assignable to type '{ n: boolean; }'. diff --git a/tests/baselines/reference/tsxAttributeResolution7.errors.txt b/tests/baselines/reference/tsxAttributeResolution7.errors.txt index 074bd49f3f096..4b9c54a7a8d26 100644 --- a/tests/baselines/reference/tsxAttributeResolution7.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution7.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(9,8): error TS2326: Types of property 'data-foo' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type '32' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -12,9 +11,8 @@ tests/cases/conformance/jsx/file.tsx(9,8): error TS2326: Types of property 'data // Error ; - ~~~~~~~~~~~~~ -!!! error TS2326: Types of property 'data-foo' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~~~~~~~~ +!!! error TS2322: Type '32' is not assignable to type 'string'. // OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution9.errors.txt b/tests/baselines/reference/tsxAttributeResolution9.errors.txt index 9193531609c0f..47436ec42abe0 100644 --- a/tests/baselines/reference/tsxAttributeResolution9.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution9.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(9,14): error TS2326: Types of property 'foo' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type '0' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -26,7 +25,6 @@ tests/cases/conformance/jsx/file.tsx(9,14): error TS2326: Types of property 'foo ; // ok ; // should be an error - ~~~~~~~ -!!! error TS2326: Types of property 'foo' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~~~ +!!! error TS2322: Type '0' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt b/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt index 565da6c8432ca..14b178e0ef469 100644 --- a/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt +++ b/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(13,19): error TS2326: Types of property 'x' are incompatible. - Type 'true' is not assignable to type 'false'. +tests/cases/conformance/jsx/file.tsx(13,19): error TS2322: Type 'true' is not assignable to type 'false'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/conformance/jsx/file.tsx(13,19): error TS2326: Types of property 'x' // Error let p = ; ~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'true' is not assignable to type 'false'. \ No newline at end of file +!!! error TS2322: Type 'true' is not assignable to type 'false'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution12.errors.txt b/tests/baselines/reference/tsxElementResolution12.errors.txt index 317e86026cc69..8a248c2388106 100644 --- a/tests/baselines/reference/tsxElementResolution12.errors.txt +++ b/tests/baselines/reference/tsxElementResolution12.errors.txt @@ -2,8 +2,7 @@ tests/cases/conformance/jsx/file.tsx(23,1): error TS2607: JSX element class does tests/cases/conformance/jsx/file.tsx(23,7): error TS2339: Property 'x' does not exist on type '{}'. tests/cases/conformance/jsx/file.tsx(25,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property. tests/cases/conformance/jsx/file.tsx(26,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property. -tests/cases/conformance/jsx/file.tsx(33,7): error TS2326: Types of property 'x' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(33,7): error TS2322: Type '"10"' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (5 errors) ==== @@ -48,7 +47,6 @@ tests/cases/conformance/jsx/file.tsx(33,7): error TS2326: Types of property 'x' var Obj4: Obj4type; ; // OK ; // Error - ~~~~~~~~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2322: Type '"10"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt b/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt index 669c315b71a38..aa86e86867f1b 100644 --- a/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt +++ b/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt @@ -1,7 +1,6 @@ tests/cases/conformance/jsx/file.tsx(13,11): error TS2322: Type '{}' is not assignable to type 'Prop'. Property 'a' is missing in type '{}'. -tests/cases/conformance/jsx/file.tsx(19,18): error TS2326: Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(19,18): error TS2322: Type '"hi"' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -27,6 +26,5 @@ tests/cases/conformance/jsx/file.tsx(19,18): error TS2326: Types of property 'a' // Error let x2 = - ~~~~~~ -!!! error TS2326: Types of property 'a' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'number'. \ No newline at end of file + ~ +!!! error TS2322: Type '"hi"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt index 111a2e4768611..49cb020d7f443 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt @@ -1,11 +1,7 @@ -tests/cases/conformance/jsx/file.tsx(19,23): error TS2326: Types of property 'x' are incompatible. - Type '3' is not assignable to type '2'. -tests/cases/conformance/jsx/file.tsx(20,25): error TS2326: Types of property 'x' are incompatible. - Type 'string' is not assignable to type '2'. -tests/cases/conformance/jsx/file.tsx(21,25): error TS2326: Types of property 'x' are incompatible. - Type '3' is not assignable to type '2'. -tests/cases/conformance/jsx/file.tsx(22,15): error TS2326: Types of property 'x' are incompatible. - Type 'true' is not assignable to type '2'. +tests/cases/conformance/jsx/file.tsx(19,23): error TS2322: Type '3' is not assignable to type '2'. +tests/cases/conformance/jsx/file.tsx(20,25): error TS2322: Type '"Hi"' is not assignable to type '2'. +tests/cases/conformance/jsx/file.tsx(21,25): error TS2322: Type '3' is not assignable to type '2'. +tests/cases/conformance/jsx/file.tsx(22,15): error TS2322: Type 'true' is not assignable to type '2'. ==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== @@ -28,19 +24,15 @@ tests/cases/conformance/jsx/file.tsx(22,15): error TS2326: Types of property 'x' // Error let y = ; - ~~~~~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type '3' is not assignable to type '2'. + ~ +!!! error TS2322: Type '3' is not assignable to type '2'. let y1 = ; - ~~~~~~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type '2'. + ~ +!!! error TS2322: Type '"Hi"' is not assignable to type '2'. let y2 = ; - ~~~~~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type '3' is not assignable to type '2'. + ~ +!!! error TS2322: Type '3' is not assignable to type '2'. let y3 = ; ~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'true' is not assignable to type '2'. +!!! error TS2322: Type 'true' is not assignable to type '2'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt index 68a7a8a356d03..a09f157b600be 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt @@ -1,7 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(27,33): error TS2326: Types of property 'y' are incompatible. - Type 'true' is not assignable to type 'false'. -tests/cases/conformance/jsx/file.tsx(28,50): error TS2326: Types of property 'x' are incompatible. - Type '3' is not assignable to type '2'. +tests/cases/conformance/jsx/file.tsx(27,33): error TS2322: Type 'true' is not assignable to type 'false'. +tests/cases/conformance/jsx/file.tsx(28,50): error TS2322: Type '3' is not assignable to type '2'. tests/cases/conformance/jsx/file.tsx(30,11): error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'Prop'. Types of property 'y' are incompatible. Type 'true' is not assignable to type 'false'. @@ -36,12 +34,10 @@ tests/cases/conformance/jsx/file.tsx(30,11): error TS2322: Type '{ y: true; x: 2 // Error let x = ~ -!!! error TS2326: Types of property 'y' are incompatible. -!!! error TS2326: Type 'true' is not assignable to type 'false'. +!!! error TS2322: Type 'true' is not assignable to type 'false'. let x1 = - ~~~~~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type '3' is not assignable to type '2'. + ~ +!!! error TS2322: Type '3' is not assignable to type '2'. let x2 = let x3 = ~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt index d472e032a1e03..c1ba099c5cec5 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt @@ -2,10 +2,8 @@ tests/cases/conformance/jsx/file.tsx(17,10): error TS2322: Type '{}' is not assi Property 'x' is missing in type '{}'. tests/cases/conformance/jsx/file.tsx(18,10): error TS2322: Type '{}' is not assignable to type 'PoisonedProp'. Property 'x' is missing in type '{}'. -tests/cases/conformance/jsx/file.tsx(19,19): error TS2326: Types of property 'x' are incompatible. - Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(19,21): error TS2326: Types of property 'y' are incompatible. - Type 'true' is not assignable to type '"2"'. +tests/cases/conformance/jsx/file.tsx(19,19): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(19,21): error TS2322: Type 'true' is not assignable to type '"2"'. tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'PoisonedProp'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -41,11 +39,9 @@ tests/cases/conformance/jsx/file.tsx(21,11): error TS2322: Type '{ X: string; x: !!! error TS2322: Property 'x' is missing in type '{}'. let z = ; ~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'true' is not assignable to type 'string'. +!!! error TS2322: Type 'true' is not assignable to type 'string'. ~ -!!! error TS2326: Types of property 'y' are incompatible. -!!! error TS2326: Type 'true' is not assignable to type '"2"'. +!!! error TS2322: Type 'true' is not assignable to type '"2"'. let w = ; ~~~~~~~~ !!! error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'PoisonedProp'. diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index a9019c17e0db6..a3e5e7519bcf7 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -2,24 +2,18 @@ tests/cases/conformance/jsx/file.tsx(12,13): error TS2322: Type '{ extraProp: tr Property 'yy' is missing in type '{ extraProp: true; }'. tests/cases/conformance/jsx/file.tsx(13,13): error TS2322: Type '{ yy: number; }' is not assignable to type '{ yy: number; yy1: string; }'. Property 'yy1' is missing in type '{ yy: number; }'. -tests/cases/conformance/jsx/file.tsx(14,31): error TS2326: Types of property 'yy1' are incompatible. - Type 'true' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(14,31): error TS2322: Type 'true' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(16,31): error TS2339: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. tests/cases/conformance/jsx/file.tsx(17,13): error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'. Types of property 'yy' are incompatible. Type 'boolean' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(25,13): error TS2322: Type '{ extra-data: true; }' is not assignable to type '{ yy: string; direction?: number; }'. Property 'yy' is missing in type '{ extra-data: true; }'. -tests/cases/conformance/jsx/file.tsx(26,40): error TS2326: Types of property 'direction' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(33,32): error TS2326: Types of property 'y3' are incompatible. - Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(34,29): error TS2326: Types of property 'y1' are incompatible. - Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(35,29): error TS2326: Types of property 'y1' are incompatible. - Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(36,29): error TS2326: Types of property 'y1' are incompatible. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(26,40): error TS2322: Type '"left"' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(33,32): error TS2322: Type '"hello"' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(34,29): error TS2322: Type '"hello"' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(35,29): error TS2322: Type '"hello"' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type '"hello"' is not assignable to type 'boolean'. ==== tests/cases/conformance/jsx/file.tsx (11 errors) ==== @@ -44,8 +38,7 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2326: Types of property 'y1 !!! error TS2322: Property 'yy1' is missing in type '{ yy: number; }'. const c2 = ; // type incompatible; ~~~ -!!! error TS2326: Types of property 'yy1' are incompatible. -!!! error TS2326: Type 'true' is not assignable to type 'string'. +!!! error TS2322: Type 'true' is not assignable to type 'string'. const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; ~~~~~~~~~~ @@ -67,9 +60,8 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2326: Types of property 'y1 !!! error TS2322: Type '{ extra-data: true; }' is not assignable to type '{ yy: string; direction?: number; }'. !!! error TS2322: Property 'yy' is missing in type '{ extra-data: true; }'. const d2 = - ~~~~~~~~~~~~~~~~ -!!! error TS2326: Types of property 'direction' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'number'. + ~~~~~~~~~ +!!! error TS2322: Type '"left"' is not assignable to type 'number'. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -77,19 +69,15 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2326: Types of property 'y1 // Error const e1 = - ~~~~~~~~~~ -!!! error TS2326: Types of property 'y3' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'boolean'. + ~~ +!!! error TS2322: Type '"hello"' is not assignable to type 'boolean'. const e2 = - ~~~~~~~~~~ -!!! error TS2326: Types of property 'y1' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'boolean'. + ~~ +!!! error TS2322: Type '"hello"' is not assignable to type 'boolean'. const e3 = - ~~~~~~~~~~ -!!! error TS2326: Types of property 'y1' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'boolean'. + ~~ +!!! error TS2322: Type '"hello"' is not assignable to type 'boolean'. const e4 = Hi - ~~~~~~~~~~ -!!! error TS2326: Types of property 'y1' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'boolean'. + ~~ +!!! error TS2322: Type '"hello"' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index b0b05adfa6a8f..d12ca71cb5f92 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -8,12 +8,9 @@ tests/cases/conformance/jsx/file.tsx(51,13): error TS2322: Type '{ onClick: (k: Property '"data-format"' is missing in type '{ onClick: (k: MouseEvent) => void; to: string; }'. tests/cases/conformance/jsx/file.tsx(53,13): error TS2322: Type '{ to: string; onClick(e: any): void; }' is not assignable to type 'HyphenProps'. Property '"data-format"' is missing in type '{ to: string; onClick(e: any): void; }'. -tests/cases/conformance/jsx/file.tsx(54,51): error TS2326: Types of property 'children' are incompatible. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(55,68): error TS2326: Types of property 'className' are incompatible. - Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(56,24): error TS2326: Types of property 'data-format' are incompatible. - Type 'true' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(54,51): error TS2322: Type '10' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(55,68): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(56,24): error TS2322: Type 'true' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (8 errors) ==== @@ -86,14 +83,11 @@ tests/cases/conformance/jsx/file.tsx(56,24): error TS2326: Types of property 'da !!! error TS2322: Type '{ to: string; onClick(e: any): void; }' is not assignable to type 'HyphenProps'. !!! error TS2322: Property '"data-format"' is missing in type '{ to: string; onClick(e: any): void; }'. const b6 = ; // incorrect type for optional attribute - ~~~~~~~~~~~~~ -!!! error TS2326: Types of property 'children' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~~~~~~~~ +!!! error TS2322: Type '10' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~ -!!! error TS2326: Types of property 'className' are incompatible. -!!! error TS2326: Type 'true' is not assignable to type 'string'. +!!! error TS2322: Type 'true' is not assignable to type 'string'. const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~ -!!! error TS2326: Types of property 'data-format' are incompatible. -!!! error TS2326: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt index cfec023b3228e..8115539ec7b45 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(13,24): error TS2326: Types of property 'values' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(13,24): error TS2322: Type '5' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -16,6 +15,5 @@ tests/cases/conformance/jsx/file.tsx(13,24): error TS2326: Types of property 'va // Error let i1 = ; - ~~~~~~~~~~ -!!! error TS2326: Types of property 'values' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. \ No newline at end of file + ~~~~~~ +!!! error TS2322: Type '5' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt index 2a5f87adb97e6..626a562ff2cd0 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt @@ -1,7 +1,6 @@ tests/cases/conformance/jsx/file.tsx(19,10): error TS2322: Type '{ naaame: string; }' is not assignable to type '{ name: string; }'. Property 'name' is missing in type '{ naaame: string; }'. -tests/cases/conformance/jsx/file.tsx(27,15): error TS2326: Types of property 'name' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(27,15): error TS2322: Type '42' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(29,10): error TS2559: Type '{ naaaaaaame: string; }' has no properties in common with type 'IntrinsicAttributes & { name?: string; }'. tests/cases/conformance/jsx/file.tsx(34,10): error TS2322: Type '{ extra-prop-name: string; }' is not assignable to type '{ "prop-name": string; }'. Property '"prop-name"' is missing in type '{ extra-prop-name: string; }'. @@ -42,9 +41,8 @@ tests/cases/conformance/jsx/file.tsx(45,11): error TS2559: Type '{ prop1: boolea let d = ; // Error let e = ; - ~~~~~~~~~ -!!! error TS2326: Types of property 'name' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~~~~ +!!! error TS2322: Type '42' is not assignable to type 'string'. // Error let f = ; ~~~~ diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt index 710a443029f66..6164f9a77d8a9 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt @@ -1,14 +1,10 @@ -tests/cases/conformance/jsx/file.tsx(8,43): error TS2326: Types of property 'ignore-prop' are incompatible. - Type '(T & { ignore-prop: number; })["ignore-prop"]' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(8,43): error TS2322: Type '10' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(13,15): error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes & { prop: {}; "ignore-prop": string; }'. Type 'T' is not assignable to type '{ prop: {}; "ignore-prop": string; }'. -tests/cases/conformance/jsx/file.tsx(20,19): error TS2326: Types of property 'func' are incompatible. - Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. -tests/cases/conformance/jsx/file.tsx(31,52): error TS2326: Types of property 'selectHandler' are incompatible. - Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'. - Types of parameters 'val' and 'selectedVal' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(20,19): error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. +tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'. + Types of parameters 'val' and 'selectedVal' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== @@ -20,10 +16,8 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2326: Types of property 'se // Error function Bar(arg: T) { let a1 = ; - ~~~~~~~~~~~~~~~~ -!!! error TS2326: Types of property 'ignore-prop' are incompatible. -!!! error TS2326: Type '(T & { ignore-prop: number; })["ignore-prop"]' is not assignable to type 'string'. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~~~~~~~~~~~ +!!! error TS2322: Type '10' is not assignable to type 'string'. } // Error @@ -39,9 +33,8 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2326: Types of property 'se // Error function createLink(func: (a: number, b: string)=>void) { let o = - ~~~~~~~~~~~ -!!! error TS2326: Types of property 'func' are incompatible. -!!! error TS2326: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. + ~~~~ +!!! error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. } interface InferParamProp { @@ -53,9 +46,8 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2326: Types of property 'se // Error let i = { }} />; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2326: Types of property 'selectHandler' are incompatible. -!!! error TS2326: Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'. -!!! error TS2326: Types of parameters 'val' and 'selectedVal' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~~~~~~~~~~~~~ +!!! error TS2322: Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'. +!!! error TS2322: Types of parameters 'val' and 'selectedVal' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt b/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt index c01bd40dbfb5d..ccf988482f7a3 100644 --- a/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt @@ -1,5 +1,4 @@ -tests/cases/compiler/file.tsx(11,14): error TS2326: Types of property 'prop' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/compiler/file.tsx(11,14): error TS2322: Type '1' is not assignable to type 'string'. ==== tests/cases/compiler/file.tsx (1 errors) ==== @@ -14,7 +13,6 @@ tests/cases/compiler/file.tsx(11,14): error TS2326: Types of property 'prop' are } prop={1}>; // should error - ~~~~~~~~ -!!! error TS2326: Types of property 'prop' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~~~~ +!!! error TS2322: Type '1' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt index 950d9549ba8be..1c4b9ffb04731 100644 --- a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt @@ -1,7 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(16,26): error TS2326: Types of property 'b' are incompatible. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(18,26): error TS2326: Types of property 'b' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(16,26): error TS2322: Type '20' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(18,26): error TS2322: Type '20' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(20,13): error TS2558: Expected 1 type arguments, but got 2. tests/cases/conformance/jsx/file.tsx(22,13): error TS2558: Expected 1 type arguments, but got 2. tests/cases/conformance/jsx/file.tsx(24,12): error TS1099: Type argument list cannot be empty. @@ -9,19 +7,15 @@ tests/cases/conformance/jsx/file.tsx(26,12): error TS1099: Type argument list ca tests/cases/conformance/jsx/file.tsx(39,14): error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. Types of property 'a' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(39,20): error TS2326: Types of property 'a' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(39,20): error TS2322: Type '10' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(41,14): error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. -tests/cases/conformance/jsx/file.tsx(41,20): error TS2326: Types of property 'a' are incompatible. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(41,20): error TS2322: Type '10' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(47,14): error TS2558: Expected 1-2 type arguments, but got 3. tests/cases/conformance/jsx/file.tsx(47,53): error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }'. tests/cases/conformance/jsx/file.tsx(49,14): error TS2558: Expected 1-2 type arguments, but got 3. tests/cases/conformance/jsx/file.tsx(49,53): error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }'. -tests/cases/conformance/jsx/file.tsx(51,47): error TS2326: Types of property 'b' are incompatible. - Type 'string' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(53,47): error TS2326: Types of property 'b' are incompatible. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(51,47): error TS2322: Type '"hi"' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type '"hi"' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (16 errors) ==== @@ -41,14 +35,12 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2326: Types of property 'b' x = a={10} b="hi">; // OK x = a={10} b={20} />; // error - ~~~~~~ -!!! error TS2326: Types of property 'b' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type '20' is not assignable to type 'string'. x = a={10} b={20}>; // error - ~~~~~~ -!!! error TS2326: Types of property 'b' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type '20' is not assignable to type 'string'. x = a={10} b="hi" />; // error ~~~~~~~~~~ @@ -82,16 +74,14 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2326: Types of property 'b' !!! error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. !!! error TS2344: Types of property 'a' are incompatible. !!! error TS2344: Type 'number' is not assignable to type 'string'. - ~~~~~~ -!!! error TS2326: Types of property 'a' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type '10' is not assignable to type 'string'. x = a={10} b="hi">; // error ~~~~ !!! error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. - ~~~~~~ -!!! error TS2326: Types of property 'a' are incompatible. -!!! error TS2326: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2322: Type '10' is not assignable to type 'string'. x = a="hi" b="hi" />; // OK @@ -110,12 +100,10 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2326: Types of property 'b' !!! error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }'. x = a="hi" b="hi" />; // error - ~~~~~~ -!!! error TS2326: Types of property 'b' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2322: Type '"hi"' is not assignable to type 'number'. x = a="hi" b="hi">; // error - ~~~~~~ -!!! error TS2326: Types of property 'b' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2322: Type '"hi"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType2.errors.txt b/tests/baselines/reference/tsxUnionElementType2.errors.txt index c113df8650255..e196a2905b3c8 100644 --- a/tests/baselines/reference/tsxUnionElementType2.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType2.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(12,10): error TS2326: Types of property 'x' are incompatible. - Type 'string' is not assignable to type 'number | boolean'. +tests/cases/conformance/jsx/file.tsx(12,10): error TS2322: Type '"hi"' is not assignable to type 'number | boolean'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -15,6 +14,5 @@ tests/cases/conformance/jsx/file.tsx(12,10): error TS2326: Types of property 'x' var SFCComp = SFC1 || SFC2; - ~~~~~~~~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'number | boolean'. \ No newline at end of file + ~ +!!! error TS2322: Type '"hi"' is not assignable to type 'number | boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType4.errors.txt b/tests/baselines/reference/tsxUnionElementType4.errors.txt index 6bd8092d74983..cda4537b2d727 100644 --- a/tests/baselines/reference/tsxUnionElementType4.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType4.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(32,17): error TS2326: Types of property 'x' are incompatible. - Type 'true' is not assignable to type 'ReactText'. +tests/cases/conformance/jsx/file.tsx(32,17): error TS2322: Type 'true' is not assignable to type 'ReactText'. tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ x: number; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. tests/cases/conformance/jsx/file.tsx(34,10): error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. @@ -38,8 +37,7 @@ tests/cases/conformance/jsx/file.tsx(34,10): error TS2559: Type '{ prop: true; } // Error let a = ; ~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'true' is not assignable to type 'ReactText'. +!!! error TS2322: Type 'true' is not assignable to type 'ReactText'. let b = ~~~~~~~~~~ !!! error TS2559: Type '{ x: number; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. diff --git a/tests/baselines/reference/tsxUnionElementType6.errors.txt b/tests/baselines/reference/tsxUnionElementType6.errors.txt index 1dc5a05f8b529..81fcce6c4a439 100644 --- a/tests/baselines/reference/tsxUnionElementType6.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType6.errors.txt @@ -1,6 +1,5 @@ tests/cases/conformance/jsx/file.tsx(18,10): error TS2559: Type '{ x: true; }' has no properties in common with type 'IntrinsicAttributes'. -tests/cases/conformance/jsx/file.tsx(19,27): error TS2326: Types of property 'x' are incompatible. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(19,27): error TS2322: Type '"hi"' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{}' is not assignable to type '{ x: boolean; }'. Property 'x' is missing in type '{}'. tests/cases/conformance/jsx/file.tsx(21,10): error TS2322: Type '{ data-prop: true; }' is not assignable to type '{ x: boolean; }'. @@ -29,9 +28,8 @@ tests/cases/conformance/jsx/file.tsx(21,10): error TS2322: Type '{ data-prop: tr ~~~~~~~~~~~~ !!! error TS2559: Type '{ x: true; }' has no properties in common with type 'IntrinsicAttributes'. let b = ; - ~~~~~~ -!!! error TS2326: Types of property 'x' are incompatible. -!!! error TS2326: Type 'string' is not assignable to type 'boolean'. + ~ +!!! error TS2322: Type '"hi"' is not assignable to type 'boolean'. let c = ; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type '{}' is not assignable to type '{ x: boolean; }'. diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index 16a8f66ba79a3..c26c6826ef539 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -3,8 +3,8 @@ tests/cases/compiler/tupleTypes.ts(14,1): error TS2322: Type 'undefined[]' is no Property '0' is missing in type 'undefined[]'. tests/cases/compiler/tupleTypes.ts(15,1): error TS2322: Type '[number]' is not assignable to type '[number, string]'. Property '1' is missing in type '[number]'. -tests/cases/compiler/tupleTypes.ts(17,1): error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. - Type 'string' is not assignable to type 'number'. +tests/cases/compiler/tupleTypes.ts(17,6): error TS2322: Type '"hello"' is not assignable to type 'number'. +tests/cases/compiler/tupleTypes.ts(17,15): error TS2322: Type '1' is not assignable to type 'string'. tests/cases/compiler/tupleTypes.ts(18,1): error TS2322: Type '[number, string, number]' is not assignable to type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. @@ -25,7 +25,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n Type '{}' is not assignable to type 'string'. -==== tests/cases/compiler/tupleTypes.ts (10 errors) ==== +==== tests/cases/compiler/tupleTypes.ts (11 errors) ==== var v1: []; // Error ~~ !!! error TS1122: A tuple type element list cannot be empty. @@ -51,9 +51,10 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n !!! error TS2322: Property '1' is missing in type '[number]'. t = [1, "hello"]; // Ok t = ["hello", 1]; // Error - ~ -!!! error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~~~~~~~ +!!! error TS2322: Type '"hello"' is not assignable to type 'number'. + ~ +!!! error TS2322: Type '1' is not assignable to type 'string'. t = [1, "hello", 2]; // Error ~ !!! error TS2322: Type '[number, string, number]' is not assignable to type '[number, string]'. diff --git a/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt b/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt index eca289e819344..672d3e7b8ea2d 100644 --- a/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt +++ b/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt @@ -1,6 +1,4 @@ -tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts(10,5): error TS2322: Type '{ [SYM]: "str"; }' is not assignable to type 'I'. - Types of property '[SYM]' are incompatible. - Type '"str"' is not assignable to type '"sym"'. +tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts(10,13): error TS2322: Type '"str"' is not assignable to type '"sym"'. ==== tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts (1 errors) ==== @@ -14,8 +12,6 @@ tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts(10,5): let a: I = {[SYM]: 'sym'}; // Expect ok let b: I = {[SYM]: 'str'}; // Expect error - ~ -!!! error TS2322: Type '{ [SYM]: "str"; }' is not assignable to type 'I'. -!!! error TS2322: Types of property '[SYM]' are incompatible. -!!! error TS2322: Type '"str"' is not assignable to type '"sym"'. + ~~~~~ +!!! error TS2322: Type '"str"' is not assignable to type '"sym"'. \ No newline at end of file diff --git a/tests/baselines/reference/widenedTypes.errors.txt b/tests/baselines/reference/widenedTypes.errors.txt index a16dfafb5fe3e..e5c58df89d3ed 100644 --- a/tests/baselines/reference/widenedTypes.errors.txt +++ b/tests/baselines/reference/widenedTypes.errors.txt @@ -7,9 +7,7 @@ tests/cases/compiler/widenedTypes.ts(10,1): error TS2322: Type '""' is not assig tests/cases/compiler/widenedTypes.ts(17,1): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/widenedTypes.ts(22,5): error TS2322: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/widenedTypes.ts(23,5): error TS2322: Type '{ x: number; y: null; }' is not assignable to type '{ [x: string]: string; }'. - Property 'x' is incompatible with index signature. - Type 'number' is not assignable to type 'string'. +tests/cases/compiler/widenedTypes.ts(23,39): error TS2322: Type '3' is not assignable to type 'string'. ==== tests/cases/compiler/widenedTypes.ts (9 errors) ==== @@ -53,7 +51,5 @@ tests/cases/compiler/widenedTypes.ts(23,5): error TS2322: Type '{ x: number; y: !!! error TS2322: Type 'number[]' is not assignable to type 'string[]'. !!! error TS2322: Type 'number' is not assignable to type 'string'. var obj: { [x: string]: string; } = { x: 3, y: null }; // assignable because null is widened, and therefore BCT is any - ~~~ -!!! error TS2322: Type '{ x: number; y: null; }' is not assignable to type '{ [x: string]: string; }'. -!!! error TS2322: Property 'x' is incompatible with index signature. -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file + ~ +!!! error TS2322: Type '3' is not assignable to type 'string'. \ No newline at end of file From c8fc8db0ce6d1506cae56dce117cbba9a1d89b37 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 21 Jun 2018 15:40:19 -0700 Subject: [PATCH 05/16] Accept meh baselines --- .../enumAssignmentCompat3.errors.txt | 10 - .../mutuallyRecursiveCallbacks.errors.txt | 6 +- .../typeComparisonCaching.errors.txt | 16 +- ...typedArraysCrossAssignability01.errors.txt | 640 +++++++++++------- 4 files changed, 396 insertions(+), 276 deletions(-) diff --git a/tests/baselines/reference/enumAssignmentCompat3.errors.txt b/tests/baselines/reference/enumAssignmentCompat3.errors.txt index a458733bcc296..bae429823e3de 100644 --- a/tests/baselines/reference/enumAssignmentCompat3.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat3.errors.txt @@ -1,19 +1,14 @@ tests/cases/compiler/enumAssignmentCompat3.ts(68,1): error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'. - Property 'd' is missing in type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(70,1): error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. - Property 'd' is missing in type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(71,1): error TS2322: Type 'Nope' is not assignable to type 'E'. tests/cases/compiler/enumAssignmentCompat3.ts(72,1): error TS2322: Type 'Decl.E' is not assignable to type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(75,1): error TS2322: Type 'First.E' is not assignable to type 'Ab.E'. - Property 'c' is missing in type 'Ab.E'. tests/cases/compiler/enumAssignmentCompat3.ts(76,1): error TS2322: Type 'First.E' is not assignable to type 'Cd.E'. - Property 'a' is missing in type 'Cd.E'. tests/cases/compiler/enumAssignmentCompat3.ts(77,1): error TS2322: Type 'E' is not assignable to type 'Nope'. tests/cases/compiler/enumAssignmentCompat3.ts(78,1): error TS2322: Type 'First.E' is not assignable to type 'Decl.E'. tests/cases/compiler/enumAssignmentCompat3.ts(82,1): error TS2322: Type 'Const.E' is not assignable to type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(83,1): error TS2322: Type 'First.E' is not assignable to type 'Const.E'. tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged.E' is not assignable to type 'First.E'. - Property 'd' is missing in type 'First.E'. ==== tests/cases/compiler/enumAssignmentCompat3.ts (11 errors) ==== @@ -87,12 +82,10 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. abc = secondAbcd; // missing 'd' ~~~ !!! error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'. -!!! error TS2322: Property 'd' is missing in type 'First.E'. abc = secondAb; // ok abc = secondCd; // missing 'd' ~~~ !!! error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. -!!! error TS2322: Property 'd' is missing in type 'First.E'. abc = nope; // nope! ~~~ !!! error TS2322: Type 'Nope' is not assignable to type 'E'. @@ -104,11 +97,9 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. secondAb = abc; // missing 'c' ~~~~~~~~ !!! error TS2322: Type 'First.E' is not assignable to type 'Ab.E'. -!!! error TS2322: Property 'c' is missing in type 'Ab.E'. secondCd = abc; // missing 'a' and 'b' ~~~~~~~~ !!! error TS2322: Type 'First.E' is not assignable to type 'Cd.E'. -!!! error TS2322: Property 'a' is missing in type 'Cd.E'. nope = abc; // nope! ~~~~ !!! error TS2322: Type 'E' is not assignable to type 'Nope'. @@ -129,7 +120,6 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. abc = merged; // missing 'd' ~~~ !!! error TS2322: Type 'Merged.E' is not assignable to type 'First.E'. -!!! error TS2322: Property 'd' is missing in type 'First.E'. merged = abc; // ok abc = merged2; // ok merged2 = abc; // ok \ No newline at end of file diff --git a/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt b/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt index 0682caad5b8aa..b36548451b233 100644 --- a/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt +++ b/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt @@ -3,7 +3,8 @@ tests/cases/compiler/mutuallyRecursiveCallbacks.ts(7,1): error TS2322: Type ' Types of parameters 'bar' and 'foo' are incompatible. Type 'Foo<{}>' is not assignable to type 'Bar<{}>'. Types of parameters 'bar' and 'foo' are incompatible. - Type 'void' is not assignable to type 'Foo<{}>'. + Types of parameters 'bar' and 'foo' are incompatible. + Type 'Foo<{}>' is not assignable to type 'Bar<{}>'. ==== tests/cases/compiler/mutuallyRecursiveCallbacks.ts (1 errors) ==== @@ -20,5 +21,6 @@ tests/cases/compiler/mutuallyRecursiveCallbacks.ts(7,1): error TS2322: Type ' !!! error TS2322: Types of parameters 'bar' and 'foo' are incompatible. !!! error TS2322: Type 'Foo<{}>' is not assignable to type 'Bar<{}>'. !!! error TS2322: Types of parameters 'bar' and 'foo' are incompatible. -!!! error TS2322: Type 'void' is not assignable to type 'Foo<{}>'. +!!! error TS2322: Types of parameters 'bar' and 'foo' are incompatible. +!!! error TS2322: Type 'Foo<{}>' is not assignable to type 'Bar<{}>'. \ No newline at end of file diff --git a/tests/baselines/reference/typeComparisonCaching.errors.txt b/tests/baselines/reference/typeComparisonCaching.errors.txt index 8a94bdf835cef..b7628b73ba999 100644 --- a/tests/baselines/reference/typeComparisonCaching.errors.txt +++ b/tests/baselines/reference/typeComparisonCaching.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/typeComparisonCaching.ts(26,1): error TS2322: Type 'B' is not assignable to type 'A'. - Types of property 's' are incompatible. - Type 'number' is not assignable to type 'string'. + Types of property 'p' are incompatible. + Type 'D' is not assignable to type 'C'. + Types of property 'q' are incompatible. + Type 'B' is not assignable to type 'A'. tests/cases/compiler/typeComparisonCaching.ts(27,1): error TS2322: Type 'D' is not assignable to type 'C'. - Types of property 'q' are incompatible. - Type 'B' is not assignable to type 'A'. ==== tests/cases/compiler/typeComparisonCaching.ts (2 errors) ==== @@ -35,11 +35,11 @@ tests/cases/compiler/typeComparisonCaching.ts(27,1): error TS2322: Type 'D' is n a = b; ~ !!! error TS2322: Type 'B' is not assignable to type 'A'. -!!! error TS2322: Types of property 's' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Types of property 'p' are incompatible. +!!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Types of property 'q' are incompatible. +!!! error TS2322: Type 'B' is not assignable to type 'A'. c = d; // Should not be allowed ~ !!! error TS2322: Type 'D' is not assignable to type 'C'. -!!! error TS2322: Types of property 'q' are incompatible. -!!! error TS2322: Type 'B' is not assignable to type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt b/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt index ad94980642943..7ae66c5d09f18 100644 --- a/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt +++ b/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt @@ -1,195 +1,259 @@ tests/cases/compiler/typedArraysCrossAssignability01.ts(13,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"UInt8Array"' is not assignable to type '"Int8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. + Type 'Uint8Array' is not assignable to type 'Int8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(14,5): error TS2322: Type 'Int16Array' is not assignable to type 'Int8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int16Array"' is not assignable to type '"Int8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. + Type 'Int16Array' is not assignable to type 'Int8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(15,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint16Array"' is not assignable to type '"Int8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. + Type 'Uint16Array' is not assignable to type 'Int8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(16,5): error TS2322: Type 'Int32Array' is not assignable to type 'Int8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int32Array"' is not assignable to type '"Int8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. + Type 'Int32Array' is not assignable to type 'Int8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(17,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint32Array"' is not assignable to type '"Int8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. + Type 'Uint32Array' is not assignable to type 'Int8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(18,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float32Array"' is not assignable to type '"Int8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. + Type 'Float32Array' is not assignable to type 'Int8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(19,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float64Array"' is not assignable to type '"Int8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. + Type 'Float64Array' is not assignable to type 'Int8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(20,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint8ClampedArray"' is not assignable to type '"Int8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. + Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(22,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int8Array"' is not assignable to type '"UInt8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. + Type 'Int8Array' is not assignable to type 'Uint8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(24,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int16Array"' is not assignable to type '"UInt8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. + Type 'Int16Array' is not assignable to type 'Uint8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(25,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint16Array"' is not assignable to type '"UInt8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. + Type 'Uint16Array' is not assignable to type 'Uint8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(26,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int32Array"' is not assignable to type '"UInt8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. + Type 'Int32Array' is not assignable to type 'Uint8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(27,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint32Array"' is not assignable to type '"UInt8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. + Type 'Uint32Array' is not assignable to type 'Uint8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(28,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float32Array"' is not assignable to type '"UInt8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. + Type 'Float32Array' is not assignable to type 'Uint8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(29,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float64Array"' is not assignable to type '"UInt8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. + Type 'Float64Array' is not assignable to type 'Uint8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(30,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint8ClampedArray"' is not assignable to type '"UInt8Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. + Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(32,5): error TS2322: Type 'Int8Array' is not assignable to type 'Int16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int8Array"' is not assignable to type '"Int16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. + Type 'Int8Array' is not assignable to type 'Int16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(33,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"UInt8Array"' is not assignable to type '"Int16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. + Type 'Uint8Array' is not assignable to type 'Int16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(35,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint16Array"' is not assignable to type '"Int16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. + Type 'Uint16Array' is not assignable to type 'Int16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(36,5): error TS2322: Type 'Int32Array' is not assignable to type 'Int16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int32Array"' is not assignable to type '"Int16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. + Type 'Int32Array' is not assignable to type 'Int16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(37,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint32Array"' is not assignable to type '"Int16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. + Type 'Uint32Array' is not assignable to type 'Int16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(38,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float32Array"' is not assignable to type '"Int16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. + Type 'Float32Array' is not assignable to type 'Int16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(39,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float64Array"' is not assignable to type '"Int16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. + Type 'Float64Array' is not assignable to type 'Int16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(40,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint8ClampedArray"' is not assignable to type '"Int16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. + Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(42,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int8Array"' is not assignable to type '"Uint16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. + Type 'Int8Array' is not assignable to type 'Uint16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(43,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Uint16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"UInt8Array"' is not assignable to type '"Uint16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. + Type 'Uint8Array' is not assignable to type 'Uint16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(44,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int16Array"' is not assignable to type '"Uint16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. + Type 'Int16Array' is not assignable to type 'Uint16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(46,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int32Array"' is not assignable to type '"Uint16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. + Type 'Int32Array' is not assignable to type 'Uint16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(47,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint32Array"' is not assignable to type '"Uint16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. + Type 'Uint32Array' is not assignable to type 'Uint16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(48,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float32Array"' is not assignable to type '"Uint16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. + Type 'Float32Array' is not assignable to type 'Uint16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(49,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float64Array"' is not assignable to type '"Uint16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. + Type 'Float64Array' is not assignable to type 'Uint16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(50,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint8ClampedArray"' is not assignable to type '"Uint16Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. + Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(52,5): error TS2322: Type 'Int8Array' is not assignable to type 'Int32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int8Array"' is not assignable to type '"Int32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. + Type 'Int8Array' is not assignable to type 'Int32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(53,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"UInt8Array"' is not assignable to type '"Int32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. + Type 'Uint8Array' is not assignable to type 'Int32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(54,5): error TS2322: Type 'Int16Array' is not assignable to type 'Int32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int16Array"' is not assignable to type '"Int32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. + Type 'Int16Array' is not assignable to type 'Int32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(55,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint16Array"' is not assignable to type '"Int32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. + Type 'Uint16Array' is not assignable to type 'Int32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(57,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint32Array"' is not assignable to type '"Int32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. + Type 'Uint32Array' is not assignable to type 'Int32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(58,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float32Array"' is not assignable to type '"Int32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. + Type 'Float32Array' is not assignable to type 'Int32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(59,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float64Array"' is not assignable to type '"Int32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. + Type 'Float64Array' is not assignable to type 'Int32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(60,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint8ClampedArray"' is not assignable to type '"Int32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. + Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(62,5): error TS2322: Type 'Int8Array' is not assignable to type 'Float32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int8Array"' is not assignable to type '"Float32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. + Type 'Int8Array' is not assignable to type 'Float32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(63,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Float32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"UInt8Array"' is not assignable to type '"Float32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. + Type 'Uint8Array' is not assignable to type 'Float32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(64,5): error TS2322: Type 'Int16Array' is not assignable to type 'Float32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int16Array"' is not assignable to type '"Float32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. + Type 'Int16Array' is not assignable to type 'Float32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(65,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Float32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint16Array"' is not assignable to type '"Float32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. + Type 'Uint16Array' is not assignable to type 'Float32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(66,5): error TS2322: Type 'Int32Array' is not assignable to type 'Float32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int32Array"' is not assignable to type '"Float32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. + Type 'Int32Array' is not assignable to type 'Float32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(67,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Float32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint32Array"' is not assignable to type '"Float32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. + Type 'Uint32Array' is not assignable to type 'Float32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(69,5): error TS2322: Type 'Float64Array' is not assignable to type 'Float32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float64Array"' is not assignable to type '"Float32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. + Type 'Float64Array' is not assignable to type 'Float32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(70,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint8ClampedArray"' is not assignable to type '"Float32Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. + Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(72,5): error TS2322: Type 'Int8Array' is not assignable to type 'Float64Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int8Array"' is not assignable to type '"Float64Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. + Type 'Int8Array' is not assignable to type 'Float64Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(73,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Float64Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"UInt8Array"' is not assignable to type '"Float64Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. + Type 'Uint8Array' is not assignable to type 'Float64Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(74,5): error TS2322: Type 'Int16Array' is not assignable to type 'Float64Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int16Array"' is not assignable to type '"Float64Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. + Type 'Int16Array' is not assignable to type 'Float64Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(75,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Float64Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint16Array"' is not assignable to type '"Float64Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. + Type 'Uint16Array' is not assignable to type 'Float64Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(76,5): error TS2322: Type 'Int32Array' is not assignable to type 'Float64Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int32Array"' is not assignable to type '"Float64Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. + Type 'Int32Array' is not assignable to type 'Float64Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(77,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Float64Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint32Array"' is not assignable to type '"Float64Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. + Type 'Uint32Array' is not assignable to type 'Float64Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(78,5): error TS2322: Type 'Float32Array' is not assignable to type 'Float64Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float32Array"' is not assignable to type '"Float64Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. + Type 'Float32Array' is not assignable to type 'Float64Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(80,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint8ClampedArray"' is not assignable to type '"Float64Array"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. + Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'. tests/cases/compiler/typedArraysCrossAssignability01.ts(82,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int8Array"' is not assignable to type '"Uint8ClampedArray"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. + Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'. tests/cases/compiler/typedArraysCrossAssignability01.ts(83,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"UInt8Array"' is not assignable to type '"Uint8ClampedArray"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. + Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'. tests/cases/compiler/typedArraysCrossAssignability01.ts(84,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int16Array"' is not assignable to type '"Uint8ClampedArray"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. + Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'. tests/cases/compiler/typedArraysCrossAssignability01.ts(85,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint16Array"' is not assignable to type '"Uint8ClampedArray"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. + Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'. tests/cases/compiler/typedArraysCrossAssignability01.ts(86,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Int32Array"' is not assignable to type '"Uint8ClampedArray"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. + Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'. tests/cases/compiler/typedArraysCrossAssignability01.ts(87,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Uint32Array"' is not assignable to type '"Uint8ClampedArray"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. + Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'. tests/cases/compiler/typedArraysCrossAssignability01.ts(88,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float32Array"' is not assignable to type '"Uint8ClampedArray"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. + Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'. tests/cases/compiler/typedArraysCrossAssignability01.ts(89,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'. - Types of property '[Symbol.toStringTag]' are incompatible. - Type '"Float64Array"' is not assignable to type '"Uint8ClampedArray"'. + Types of property 'copyWithin' are incompatible. + Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. + Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'. ==== tests/cases/compiler/typedArraysCrossAssignability01.ts (64 errors) ==== @@ -208,336 +272,400 @@ tests/cases/compiler/typedArraysCrossAssignability01.ts(89,5): error TS2322: Typ arr_Int8Array = arr_Uint8Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int8Array'. arr_Int8Array = arr_Int16Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Int8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Int8Array'. arr_Int8Array = arr_Uint16Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int8Array'. arr_Int8Array = arr_Int32Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Int8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Int8Array'. arr_Int8Array = arr_Uint32Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int8Array'. arr_Int8Array = arr_Float32Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int8Array'. arr_Int8Array = arr_Float64Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int8Array'. arr_Int8Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'. arr_Uint8Array = arr_Int8Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int8Array"' is not assignable to type '"UInt8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8Array'. arr_Uint8Array = arr_Uint8Array; arr_Uint8Array = arr_Int16Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int16Array"' is not assignable to type '"UInt8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8Array'. arr_Uint8Array = arr_Uint16Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"UInt8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8Array'. arr_Uint8Array = arr_Int32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int32Array"' is not assignable to type '"UInt8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8Array'. arr_Uint8Array = arr_Uint32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"UInt8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8Array'. arr_Uint8Array = arr_Float32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float32Array"' is not assignable to type '"UInt8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8Array'. arr_Uint8Array = arr_Float64Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float64Array"' is not assignable to type '"UInt8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8Array'. arr_Uint8Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"UInt8Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'. arr_Int16Array = arr_Int8Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Int16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Int16Array'. arr_Int16Array = arr_Uint8Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int16Array'. arr_Int16Array = arr_Int16Array; arr_Int16Array = arr_Uint16Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int16Array'. arr_Int16Array = arr_Int32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Int16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Int16Array'. arr_Int16Array = arr_Uint32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int16Array'. arr_Int16Array = arr_Float32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int16Array'. arr_Int16Array = arr_Float64Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int16Array'. arr_Int16Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'. arr_Uint16Array = arr_Int8Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Uint16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint16Array'. arr_Uint16Array = arr_Uint8Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Uint16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint16Array'. arr_Uint16Array = arr_Int16Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Uint16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint16Array'. arr_Uint16Array = arr_Uint16Array; arr_Uint16Array = arr_Int32Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Uint16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint16Array'. arr_Uint16Array = arr_Uint32Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Uint16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint16Array'. arr_Uint16Array = arr_Float32Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Uint16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint16Array'. arr_Uint16Array = arr_Float64Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Uint16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint16Array'. arr_Uint16Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Uint16Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'. arr_Int32Array = arr_Int8Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Int32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Int32Array'. arr_Int32Array = arr_Uint8Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int32Array'. arr_Int32Array = arr_Int16Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Int32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Int32Array'. arr_Int32Array = arr_Uint16Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int32Array'. arr_Int32Array = arr_Int32Array; arr_Int32Array = arr_Uint32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int32Array'. arr_Int32Array = arr_Float32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int32Array'. arr_Int32Array = arr_Float64Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int32Array'. arr_Int32Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'. arr_Float32Array = arr_Int8Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Float32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Float32Array'. arr_Float32Array = arr_Uint8Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Float32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float32Array'. arr_Float32Array = arr_Int16Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Float32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Float32Array'. arr_Float32Array = arr_Uint16Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Float32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float32Array'. arr_Float32Array = arr_Int32Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Float32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Float32Array'. arr_Float32Array = arr_Uint32Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Float32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float32Array'. arr_Float32Array = arr_Float32Array; arr_Float32Array = arr_Float64Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Float32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Float32Array'. arr_Float32Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Float32Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'. arr_Float64Array = arr_Int8Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Float64Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Float64Array'. arr_Float64Array = arr_Uint8Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Float64Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float64Array'. arr_Float64Array = arr_Int16Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Float64Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Float64Array'. arr_Float64Array = arr_Uint16Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Float64Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float64Array'. arr_Float64Array = arr_Int32Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Float64Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Float64Array'. arr_Float64Array = arr_Uint32Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Float64Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float64Array'. arr_Float64Array = arr_Float32Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Float64Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Float64Array'. arr_Float64Array = arr_Float64Array; arr_Float64Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Float64Array"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. +!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'. arr_Uint8ClampedArray = arr_Int8Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Uint8ClampedArray"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. +!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'. arr_Uint8ClampedArray = arr_Uint8Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Uint8ClampedArray"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. +!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'. arr_Uint8ClampedArray = arr_Int16Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Uint8ClampedArray"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. +!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'. arr_Uint8ClampedArray = arr_Uint16Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Uint8ClampedArray"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. +!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'. arr_Uint8ClampedArray = arr_Int32Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Uint8ClampedArray"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. +!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'. arr_Uint8ClampedArray = arr_Uint32Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Uint8ClampedArray"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. +!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'. arr_Uint8ClampedArray = arr_Float32Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Uint8ClampedArray"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. +!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'. arr_Uint8ClampedArray = arr_Float64Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. -!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Uint8ClampedArray"'. +!!! error TS2322: Types of property 'copyWithin' are incompatible. +!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. +!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'. arr_Uint8ClampedArray = arr_Uint8ClampedArray; } From f52c9b9629af3c334e4304fd4c9017829501bc7c Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 21 Jun 2018 17:24:47 -0700 Subject: [PATCH 06/16] Fix literal types --- src/compiler/checker.ts | 6 ++--- .../reference/arrayLiterals3.errors.txt | 8 +++---- .../assignmentToObjectAndFunction.errors.txt | 4 ++-- ...nmentToParenthesizedIdentifiers.errors.txt | 12 +++++----- ...ropertyNamesContextualType8_ES5.errors.txt | 8 +++---- ...ropertyNamesContextualType8_ES6.errors.txt | 8 +++---- ...rWithAssignableReturnExpression.errors.txt | 4 ++-- .../reference/contextualTypeAny.errors.txt | 4 ++-- ...rayBindingPatternAndAssignment2.errors.txt | 4 ++-- ...structuringVariableDeclaration2.errors.txt | 4 ++-- ...AnnotationAndInvalidInitializer.errors.txt | 4 ++-- .../genericCallWithTupleType.errors.txt | 8 +++---- .../reference/mappedTypeErrors.errors.txt | 12 +++++----- .../nonPrimitiveAsProperty.errors.txt | 4 ++-- ...rConstrainsPropertyDeclarations.errors.txt | 4 ++-- ...ConstrainsPropertyDeclarations2.errors.txt | 4 ++-- .../objectLiteralNormalization.errors.txt | 4 ++-- ...tLiteralWithNumericPropertyName.errors.txt | 4 ++-- .../reference/returnInConstructor1.errors.txt | 4 ++-- ...pertyAssignmentsInDestructuring.errors.txt | 8 +++---- ...yAssignmentsInDestructuring_ES6.errors.txt | 8 +++---- .../reference/spreadUnion3.errors.txt | 4 ++-- ...rConstrainsPropertyDeclarations.errors.txt | 16 ++++++------- .../reference/tsxAttributeErrors.errors.txt | 8 +++---- .../tsxAttributeResolution1.errors.txt | 12 +++++----- .../tsxAttributeResolution10.errors.txt | 4 ++-- .../tsxAttributeResolution14.errors.txt | 4 ++-- .../tsxAttributeResolution6.errors.txt | 4 ++-- .../tsxAttributeResolution7.errors.txt | 4 ++-- .../tsxAttributeResolution9.errors.txt | 4 ++-- .../tsxElementResolution12.errors.txt | 4 ++-- ...ponentWithDefaultTypeParameter3.errors.txt | 4 ++-- ...tsxSpreadAttributesResolution10.errors.txt | 4 ++-- ...elessFunctionComponentOverload4.errors.txt | 20 ++++++++-------- ...elessFunctionComponentOverload5.errors.txt | 4 ++-- ...ponentWithDefaultTypeParameter2.errors.txt | 4 ++-- ...tsxStatelessFunctionComponents1.errors.txt | 4 ++-- ...entPartialDefinitionStillErrors.errors.txt | 4 ++-- .../tsxTypeArgumentResolution.errors.txt | 24 +++++++++---------- .../reference/tsxUnionElementType2.errors.txt | 4 ++-- .../reference/tsxUnionElementType6.errors.txt | 4 ++-- .../baselines/reference/tupleTypes.errors.txt | 8 +++---- .../reference/widenedTypes.errors.txt | 4 ++-- 43 files changed, 139 insertions(+), 139 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f2b5b5a44f19f..e370627ad6a6d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10138,18 +10138,18 @@ namespace ts { // Issue error on the prop itself, since the prop couldn't elaborate the error const resultObj: { error?: Diagnostic } = {}; // Use the expression type, if available - const specificSource = next ? checkExpressionCached(next) : sourcePropType; + const specificSource = next ? checkExpressionForMutableLocation(next, CheckMode.Normal, sourcePropType) : sourcePropType; const result = checkTypeAssignableTo(specificSource, targetPropType, prop, /*headMessage*/ undefined, /*containingChain*/ undefined, resultObj); if (result && specificSource !== sourcePropType) { // If for whatever reason the expression type doesn't yield an error, make sure we still issue an error on the sourcePropType - checkTypeAssignableTo(sourcePropType, targetPropType, prop, /*headMessage*/ undefined, /*containingChain*/ undefined, resultObj) + checkTypeAssignableTo(sourcePropType, targetPropType, prop, /*headMessage*/ undefined, /*containingChain*/ undefined, resultObj); } if (resultObj.error && target.symbol && length(target.symbol.declarations)) { const reportedDiag = resultObj.error; const relatededInfo = (reportedDiag.relatedInformation = reportedDiag.relatedInformation || []); const propertyName = typeToString(nameType); const targetType = typeToString(target); - for (const declaration of target.symbol.declarations!) { + for (const declaration of target.symbol.declarations) { relatededInfo.push(createDiagnosticForNode(declaration, Diagnostics.Which_is_from_property_0_of_type_1_declared_here, propertyName, targetType)); } } diff --git a/tests/baselines/reference/arrayLiterals3.errors.txt b/tests/baselines/reference/arrayLiterals3.errors.txt index 5ec709833cd8b..6ab4204a79fc5 100644 --- a/tests/baselines/reference/arrayLiterals3.errors.txt +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(10,5): error TS2322: Type 'undefined[]' is not assignable to type '[any, any, any]'. Property '0' is missing in type 'undefined[]'. -tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,38): error TS2322: Type '"string"' is not assignable to type 'boolean'. -tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,48): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,38): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,48): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,51): error TS2322: Type 'true' is not assignable to type 'number'. tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'. Types of property 'length' are incompatible. @@ -35,9 +35,9 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error !!! error TS2322: Property '0' is missing in type 'undefined[]'. var a1: [boolean, string, number] = ["string", 1, true]; // Error ~~~~~~~~ -!!! error TS2322: Type '"string"' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. ~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. ~~~~ !!! error TS2322: Type 'true' is not assignable to type 'number'. diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt index b5bd8545b6698..9e28f5e917782 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt +++ b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentToObjectAndFunction.ts(1,24): error TS2322: Type '0' is not assignable to type '() => string'. +tests/cases/compiler/assignmentToObjectAndFunction.ts(1,24): error TS2322: Type 'number' is not assignable to type '() => string'. tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function'. Property 'apply' is missing in type '{}'. tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function'. @@ -9,7 +9,7 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type ==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ==== var errObj: Object = { toString: 0 }; // Error, incompatible toString ~~~~~~~~ -!!! error TS2322: Type '0' is not assignable to type '() => string'. +!!! error TS2322: Type 'number' is not assignable to type '() => string'. var goodObj: Object = { toString(x?) { return ""; diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt index 88a40598f82dd..55e0adf52a4ec 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt @@ -6,9 +6,9 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2539: Cannot assign to 'M' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,2): error TS2539: Cannot assign to 'M' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2539: Cannot assign to 'M3' because it is not a variable. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,11): error TS2322: Type '""' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,13): error TS2322: Type '""' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,13): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,11): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,13): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,13): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2539: Cannot assign to 'fn' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,2): error TS2539: Cannot assign to 'fn' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type '""' is not assignable to type 'number'. @@ -73,13 +73,13 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize M2.M3 = { x: '' }; // Error ~ -!!! error TS2322: Type '""' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M2).M3 = { x: '' }; // Error ~ -!!! error TS2322: Type '""' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M2.M3) = { x: '' }; // Error ~ -!!! error TS2322: Type '""' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. function fn() { } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt index 4fa8aa552fa28..b3be8c74bbac4 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(7,5): error TS2322: Type '""' is not assignable to type 'boolean'. -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(8,5): error TS2322: Type '0' is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(7,5): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(8,5): error TS2322: Type 'number' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (2 errors) ==== @@ -11,8 +11,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { [""+"foo"]: "", ~~~~~~~~~~ -!!! error TS2322: Type '""' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. [""+"bar"]: 0 ~~~~~~~~~~ -!!! error TS2322: Type '0' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt index c18ee67aefe65..67b33de3c6c86 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(7,5): error TS2322: Type '""' is not assignable to type 'boolean'. -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(8,5): error TS2322: Type '0' is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(7,5): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(8,5): error TS2322: Type 'number' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts (2 errors) ==== @@ -11,8 +11,8 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { [""+"foo"]: "", ~~~~~~~~~~ -!!! error TS2322: Type '""' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. [""+"bar"]: 0 ~~~~~~~~~~ -!!! error TS2322: Type '0' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt index d2a4d6a7b2df6..cdf450cd7f208 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,9): error TS2322: Type '1' is not assignable to type 'D'. tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. -tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,18): error TS2322: Type '1' is not assignable to type 'T'. +tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,18): error TS2322: Type 'number' is not assignable to type 'T'. ==== tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts (4 errors) ==== @@ -38,7 +38,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignabl ~~~~~~~~~~~~~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class. ~ -!!! error TS2322: Type '1' is not assignable to type 'T'. +!!! error TS2322: Type 'number' is not assignable to type 'T'. } } diff --git a/tests/baselines/reference/contextualTypeAny.errors.txt b/tests/baselines/reference/contextualTypeAny.errors.txt index bf06bfc7787ac..710f0bacef905 100644 --- a/tests/baselines/reference/contextualTypeAny.errors.txt +++ b/tests/baselines/reference/contextualTypeAny.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTypeAny.ts(3,38): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/compiler/contextualTypeAny.ts(3,38): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTypeAny.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/compiler/contextualTypeAny.ts(3,38): error TS2322: Type '""' is not var obj: { [s: string]: number } = { p: "", q: x }; ~ -!!! error TS2322: Type '""' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var arr: number[] = ["", x]; \ No newline at end of file diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt index 964c722a38ea5..78f5720894bb2 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2461: Type 'undefined' is not an array type. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(4,5): error TS2461: Type 'undefined' is not an array type. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,51): error TS2322: Type '2' is not assignable to type 'boolean'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,51): error TS2322: Type 'number' is not assignable to type 'boolean'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(22,5): error TS2322: Type 'number[]' is not assignable to type '[number, number]'. Property '0' is missing in type 'number[]'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(23,5): error TS2322: Type 'number[]' is not assignable to type '[string, string]'. @@ -32,7 +32,7 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss // where N is the numeric index of E in the array assignment pattern, or var [b0, b1, b2]: [number, boolean, string] = [1, 2, "string"]; // Error ~ -!!! error TS2322: Type '2' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. interface J extends Array { 2: number; } diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt index 8830c102b71f3..0ddba90819acf 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(3,46): error TS2322: Type 'true' is not assignable to type 'number'. -tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(3,56): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(3,56): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4,61): error TS2322: Type 'false' is not assignable to type 'string'. tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(14,16): error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c3' and no string index signature. tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(14,24): error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c5' and no string index signature. @@ -12,7 +12,7 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(1 ~~ !!! error TS2322: Type 'true' is not assignable to type 'number'. ~~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], true]; // Error ~~~~~ !!! error TS2322: Type 'false' is not assignable to type 'string'. diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 666962ee5d630..9a37a37d97821 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -8,7 +8,7 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd Property 'id' is missing in type 'D<{}>'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(42,5): error TS2322: Type 'C' is not assignable to type 'D'. Property 'source' is missing in type 'C'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,28): error TS2322: Type '"a string"' is not assignable to type 'number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,28): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(44,5): error TS2322: Type 'C' is not assignable to type '{ id: string; }'. Types of property 'id' are incompatible. Type 'number' is not assignable to type 'string'. @@ -92,7 +92,7 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd !!! error TS2322: Property 'source' is missing in type 'C'. var anObjectLiteral: I = { id: 'a string' }; ~~ -!!! error TS2322: Type '"a string"' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var anOtherObjectLiteral: { id: string } = new C(); ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'C' is not assignable to type '{ id: string; }'. diff --git a/tests/baselines/reference/genericCallWithTupleType.errors.txt b/tests/baselines/reference/genericCallWithTupleType.errors.txt index 2d920348dbeb6..1136022e2fe42 100644 --- a/tests/baselines/reference/genericCallWithTupleType.errors.txt +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -3,8 +3,8 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup Type '4' is not assignable to type '2'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'. Type '{ a: string; }' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,14): error TS2322: Type '5' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,17): error TS2322: Type '"foo"' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,14): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,17): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,14): error TS2322: Type '{}' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,18): error TS2322: Type '{}' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(24,1): error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. @@ -42,9 +42,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup // error i1.tuple1 = [5, "foo"]; ~ -!!! error TS2322: Type '5' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. ~~~~~ -!!! error TS2322: Type '"foo"' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. i1.tuple1 = [{}, {}]; ~~ !!! error TS2322: Type '{}' is not assignable to type 'string'. diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index bf3072723a94f..cce1f2f76fbdc 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -37,9 +37,9 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(123,12): error TS2345: Type 'undefined' is not assignable to type 'string'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(124,14): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: Type '"no"' is not assignable to type 'number | undefined'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type '"no"' is not assignable to type 'number | undefined'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type '"no"' is not assignable to type 'number | undefined'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: Type 'string' is not assignable to type 'number | undefined'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number | undefined'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,16): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. Type 'T' is not assignable to type 'symbol'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: Type 'P' cannot be used to index type 'T'. @@ -234,13 +234,13 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: let x1: T2 = { a: 'no' }; // Error ~ -!!! error TS2322: Type '"no"' is not assignable to type 'number | undefined'. +!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'. let x2: Partial = { a: 'no' }; // Error ~ -!!! error TS2322: Type '"no"' is not assignable to type 'number | undefined'. +!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'. let x3: { [P in keyof T2]: T2[P]} = { a: 'no' }; // Error ~ -!!! error TS2322: Type '"no"' is not assignable to type 'number | undefined'. +!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'. // Repro from #13044 diff --git a/tests/baselines/reference/nonPrimitiveAsProperty.errors.txt b/tests/baselines/reference/nonPrimitiveAsProperty.errors.txt index 1f35fd649bfc0..23f1e856979c4 100644 --- a/tests/baselines/reference/nonPrimitiveAsProperty.errors.txt +++ b/tests/baselines/reference/nonPrimitiveAsProperty.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/nonPrimitive/nonPrimitiveAsProperty.ts(7,28): error TS2322: Type '"bar"' is not assignable to type 'object'. +tests/cases/conformance/types/nonPrimitive/nonPrimitiveAsProperty.ts(7,28): error TS2322: Type 'string' is not assignable to type 'object'. ==== tests/cases/conformance/types/nonPrimitive/nonPrimitiveAsProperty.ts (1 errors) ==== @@ -10,5 +10,5 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveAsProperty.ts(7,28): erro var b: WithNonPrimitive = {foo: "bar"}; // expect error ~~~ -!!! error TS2322: Type '"bar"' is not assignable to type 'object'. +!!! error TS2322: Type 'string' is not assignable to type 'object'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt index ef95ff8796ab5..fbcdfaf5bcf03 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(50,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(68,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(85,5): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(85,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(88,9): error TS2304: Cannot find name 'Myn'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(90,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(93,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -112,7 +112,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo 1.0: '', 2.0: 1, ~~~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. "3.0": '', "4.0": 1, f: null, diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt index 54b4f301ad966..7d3dfa8a13cdd 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(16,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(25,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(34,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(43,5): error TS2322: Type '1' is not assignable to type 'A'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(43,5): error TS2322: Type 'number' is not assignable to type 'A'. ==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts (4 errors) ==== @@ -55,6 +55,6 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo "2.5": new B(), 3.0: 1, ~~~ -!!! error TS2322: Type '1' is not assignable to type 'A'. +!!! error TS2322: Type 'number' is not assignable to type 'A'. "4.0": '' } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralNormalization.errors.txt b/tests/baselines/reference/objectLiteralNormalization.errors.txt index de2d8b570f52c..dec1e1b118ddd 100644 --- a/tests/baselines/reference/objectLiteralNormalization.errors.txt +++ b/tests/baselines/reference/objectLiteralNormalization.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(7,14): error TS2322: Type '0' is not assignable to type 'string | undefined'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(7,14): error TS2322: Type 'number' is not assignable to type 'string | undefined'. tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(8,1): error TS2322: Type '{ b: string; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. Type '{ b: string; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. Property 'a' is missing in type '{ b: string; }'. @@ -24,7 +24,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts a1 = { a: 1 }; a1 = { a: 0, b: 0 }; // Error ~ -!!! error TS2322: Type '0' is not assignable to type 'string | undefined'. +!!! error TS2322: Type 'number' is not assignable to type 'string | undefined'. a1 = { b: "y" }; // Error ~~ !!! error TS2322: Type '{ b: string; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. diff --git a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt index 631bbd36503a8..39fccca3c813c 100644 --- a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt +++ b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(5,5): error TS2322: Type '3' is not assignable to type 'string'. +tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(5,5): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/objectLiteralWithNumericPropertyName.ts (1 errors) ==== @@ -8,6 +8,6 @@ tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(5,5): error TS2322: var x: A = { 0: 3 ~ -!!! error TS2322: Type '3' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. }; \ No newline at end of file diff --git a/tests/baselines/reference/returnInConstructor1.errors.txt b/tests/baselines/reference/returnInConstructor1.errors.txt index 2c9fe1e34e1cd..13e6a251b0c3c 100644 --- a/tests/baselines/reference/returnInConstructor1.errors.txt +++ b/tests/baselines/reference/returnInConstructor1.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/returnInConstructor1.ts(11,9): error TS2409: Return type of tests/cases/compiler/returnInConstructor1.ts(25,9): error TS2322: Type '"test"' is not assignable to type 'D'. tests/cases/compiler/returnInConstructor1.ts(25,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. tests/cases/compiler/returnInConstructor1.ts(39,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. -tests/cases/compiler/returnInConstructor1.ts(39,18): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/compiler/returnInConstructor1.ts(39,18): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/returnInConstructor1.ts(55,9): error TS2322: Type 'G' is not assignable to type 'H'. Types of property 'foo' are incompatible. Type '() => void' is not assignable to type 'string'. @@ -61,7 +61,7 @@ tests/cases/compiler/returnInConstructor1.ts(55,9): error TS2409: Return type of ~~~~~~~~~~~~~~~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class. ~~~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } } diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt index 53938fe4ec398..1bd37d4e43596 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt @@ -6,13 +6,13 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(70,5): error tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(75,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(75,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(80,5): error TS2322: Type '5' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(80,20): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(80,20): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(85,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(85,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(85,19): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(85,26): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(85,26): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(111,12): error TS2304: Cannot find name 's'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(111,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. @@ -115,7 +115,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(111,14): err ~~ !!! error TS2322: Type '5' is not assignable to type 'string'. ~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. }); (function() { @@ -130,7 +130,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(111,14): err !!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. ~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. }); (function() { diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt index 5f871db8f51bb..d4a536bec085a 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt @@ -6,13 +6,13 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(70,5): e tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(75,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(75,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(80,5): error TS2322: Type '5' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(80,20): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(80,20): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(85,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(85,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(85,19): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(85,26): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(85,26): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(111,12): error TS2304: Cannot find name 's'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(111,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. @@ -115,7 +115,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(111,14): ~~ !!! error TS2322: Type '5' is not assignable to type 'string'. ~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. }); (function() { @@ -130,7 +130,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(111,14): !!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. ~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. }); (function() { diff --git a/tests/baselines/reference/spreadUnion3.errors.txt b/tests/baselines/reference/spreadUnion3.errors.txt index 4cb7ad33b1a00..af8ebdda65e13 100644 --- a/tests/baselines/reference/spreadUnion3.errors.txt +++ b/tests/baselines/reference/spreadUnion3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/spread/spreadUnion3.ts(2,14): error TS2322: Type '123' is not assignable to type 'string'. +tests/cases/conformance/types/spread/spreadUnion3.ts(2,14): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/spread/spreadUnion3.ts(9,23): error TS2339: Property 'a' does not exist on type '{}'. tests/cases/conformance/types/spread/spreadUnion3.ts(17,11): error TS2698: Spread types may only be created from object types. tests/cases/conformance/types/spread/spreadUnion3.ts(18,11): error TS2698: Spread types may only be created from object types. @@ -8,7 +8,7 @@ tests/cases/conformance/types/spread/spreadUnion3.ts(18,11): error TS2698: Sprea function f(x: { y: string } | undefined): { y: string } { return { y: 123, ...x } // y: string | number ~ -!!! error TS2322: Type '123' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } f(undefined) diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt index d22408299d2ce..b444da62e8403 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt @@ -22,11 +22,11 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(71,5): error TS2411: Property 'foo' of type '() => string' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(73,5): error TS2411: Property '"4.0"' of type 'number' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(74,5): error TS2411: Property 'f' of type 'MyString' is not assignable to string index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(80,5): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(80,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(81,5): error TS2322: Type '() => void' is not assignable to type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(83,5): error TS2322: Type '1' is not assignable to type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(85,5): error TS2322: Type '1' is not assignable to type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(87,5): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(83,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(85,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(87,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(88,5): error TS2322: Type 'MyString' is not assignable to type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(90,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(93,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -163,22 +163,22 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon a: '', b: 1, ~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. c: () => { }, ~ !!! error TS2322: Type '() => void' is not assignable to type 'string'. "d": '', "e": 1, ~~~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. 1.0: '', 2.0: 1, ~~~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. "3.0": '', "4.0": 1, ~~~~~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. f: null, ~ !!! error TS2322: Type 'MyString' is not assignable to type 'string'. diff --git a/tests/baselines/reference/tsxAttributeErrors.errors.txt b/tests/baselines/reference/tsxAttributeErrors.errors.txt index 0856c2c7432f4..61518370e842e 100644 --- a/tests/baselines/reference/tsxAttributeErrors.errors.txt +++ b/tests/baselines/reference/tsxAttributeErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsx/tsxAttributeErrors.tsx(14,6): error TS2322: Type '42' is not assignable to type 'string'. -tests/cases/conformance/jsx/tsxAttributeErrors.tsx(17,6): error TS2322: Type '"foo"' is not assignable to type 'number'. +tests/cases/conformance/jsx/tsxAttributeErrors.tsx(14,6): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/tsxAttributeErrors.tsx(17,6): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/jsx/tsxAttributeErrors.tsx(21,2): error TS2322: Type '{ text: number; }' is not assignable to type '{ text?: string; width?: number; }'. Types of property 'text' are incompatible. Type 'number' is not assignable to type 'string'. @@ -21,12 +21,12 @@ tests/cases/conformance/jsx/tsxAttributeErrors.tsx(21,2): error TS2322: Type '{ // Error, number is not assignable to string
; ~~~~ -!!! error TS2322: Type '42' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. // Error, string is not assignable to number
; ~~~~~ -!!! error TS2322: Type '"foo"' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. // Error, number is not assignable to string var attribs = { text: 100 }; diff --git a/tests/baselines/reference/tsxAttributeResolution1.errors.txt b/tests/baselines/reference/tsxAttributeResolution1.errors.txt index 9aabc86c91dac..9cb31bddf9b66 100644 --- a/tests/baselines/reference/tsxAttributeResolution1.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution1.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type '"0"' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(24,2): error TS2559: Type '{ y: number; }' has no properties in common with type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(25,2): error TS2559: Type '{ y: string; }' has no properties in common with type 'Attribs1'. -tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type '"32"' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(27,2): error TS2559: Type '{ var: string; }' has no properties in common with type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(29,2): error TS2322: Type '{}' is not assignable to type '{ reqd: string; }'. Property 'reqd' is missing in type '{}'. -tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '10' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (7 errors) ==== @@ -33,7 +33,7 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '10' is not assig // Errors ; // Error, '0' is not number ~ -!!! error TS2322: Type '"0"' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. ; // Error, no property "y" ~~~~~ !!! error TS2559: Type '{ y: number; }' has no properties in common with type 'Attribs1'. @@ -42,7 +42,7 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '10' is not assig !!! error TS2559: Type '{ y: string; }' has no properties in common with type 'Attribs1'. ; // Error, "32" is not number ~ -!!! error TS2322: Type '"32"' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. ; // Error, no 'var' property ~~~~~ !!! error TS2559: Type '{ var: string; }' has no properties in common with type 'Attribs1'. @@ -53,7 +53,7 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '10' is not assig !!! error TS2322: Property 'reqd' is missing in type '{}'. ; // Error, reqd is not string ~~~~ -!!! error TS2322: Type '10' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. // Should be OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution10.errors.txt b/tests/baselines/reference/tsxAttributeResolution10.errors.txt index d7561fe1336e8..3e8d041640a41 100644 --- a/tests/baselines/reference/tsxAttributeResolution10.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution10.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type '"world"' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -24,7 +24,7 @@ tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type '"world"' is not // Should be an error ; ~~~ -!!! error TS2322: Type '"world"' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. // Should be OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution14.errors.txt b/tests/baselines/reference/tsxAttributeResolution14.errors.txt index df623eed88c06..c7f707655d3d8 100644 --- a/tests/baselines/reference/tsxAttributeResolution14.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution14.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(13,28): error TS2322: Type '2' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(13,28): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(15,28): error TS2322: Type 'true' is not assignable to type 'string | number'. @@ -26,7 +26,7 @@ tests/cases/conformance/jsx/file.tsx(15,28): error TS2322: Type 'true' is not as
// error ~~~~~~~~~~~ -!!! error TS2322: Type '2' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. // ok // error ~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/tsxAttributeResolution6.errors.txt b/tests/baselines/reference/tsxAttributeResolution6.errors.txt index 7904283aa39c6..13da7bcc15a35 100644 --- a/tests/baselines/reference/tsxAttributeResolution6.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/jsx/file.tsx(10,8): error TS2322: Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(11,8): error TS2322: Type '"true"' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(11,8): error TS2322: Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(12,2): error TS2322: Type '{}' is not assignable to type '{ n: boolean; }'. Property 'n' is missing in type '{}'. @@ -19,7 +19,7 @@ tests/cases/conformance/jsx/file.tsx(12,2): error TS2322: Type '{}' is not assig !!! error TS2322: Type 'true' is not assignable to type 'string'. ; ~ -!!! error TS2322: Type '"true"' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. ; ~~~~~ !!! error TS2322: Type '{}' is not assignable to type '{ n: boolean; }'. diff --git a/tests/baselines/reference/tsxAttributeResolution7.errors.txt b/tests/baselines/reference/tsxAttributeResolution7.errors.txt index 4b9c54a7a8d26..fb3b8bf07cdaf 100644 --- a/tests/baselines/reference/tsxAttributeResolution7.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution7.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type '32' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type '32' is not assign // Error ; ~~~~~~~~ -!!! error TS2322: Type '32' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. // OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution9.errors.txt b/tests/baselines/reference/tsxAttributeResolution9.errors.txt index 47436ec42abe0..425acd213329f 100644 --- a/tests/baselines/reference/tsxAttributeResolution9.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution9.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type '0' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -26,5 +26,5 @@ tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type '0' is not assign ; // ok ; // should be an error ~~~ -!!! error TS2322: Type '0' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution12.errors.txt b/tests/baselines/reference/tsxElementResolution12.errors.txt index 8a248c2388106..16d6ded6ff13f 100644 --- a/tests/baselines/reference/tsxElementResolution12.errors.txt +++ b/tests/baselines/reference/tsxElementResolution12.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/jsx/file.tsx(23,1): error TS2607: JSX element class does tests/cases/conformance/jsx/file.tsx(23,7): error TS2339: Property 'x' does not exist on type '{}'. tests/cases/conformance/jsx/file.tsx(25,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property. tests/cases/conformance/jsx/file.tsx(26,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property. -tests/cases/conformance/jsx/file.tsx(33,7): error TS2322: Type '"10"' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(33,7): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (5 errors) ==== @@ -48,5 +48,5 @@ tests/cases/conformance/jsx/file.tsx(33,7): error TS2322: Type '"10"' is not ass ; // OK ; // Error ~ -!!! error TS2322: Type '"10"' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt b/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt index aa86e86867f1b..7747c893f317c 100644 --- a/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt +++ b/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/jsx/file.tsx(13,11): error TS2322: Type '{}' is not assignable to type 'Prop'. Property 'a' is missing in type '{}'. -tests/cases/conformance/jsx/file.tsx(19,18): error TS2322: Type '"hi"' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(19,18): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -27,4 +27,4 @@ tests/cases/conformance/jsx/file.tsx(19,18): error TS2322: Type '"hi"' is not as // Error let x2 = ~ -!!! error TS2322: Type '"hi"' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt index 49cb020d7f443..8161575bf8d31 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/jsx/file.tsx(19,23): error TS2322: Type '3' is not assignable to type '2'. -tests/cases/conformance/jsx/file.tsx(20,25): error TS2322: Type '"Hi"' is not assignable to type '2'. +tests/cases/conformance/jsx/file.tsx(20,25): error TS2322: Type 'string' is not assignable to type '2'. tests/cases/conformance/jsx/file.tsx(21,25): error TS2322: Type '3' is not assignable to type '2'. tests/cases/conformance/jsx/file.tsx(22,15): error TS2322: Type 'true' is not assignable to type '2'. @@ -28,7 +28,7 @@ tests/cases/conformance/jsx/file.tsx(22,15): error TS2322: Type 'true' is not as !!! error TS2322: Type '3' is not assignable to type '2'. let y1 = ; ~ -!!! error TS2322: Type '"Hi"' is not assignable to type '2'. +!!! error TS2322: Type 'string' is not assignable to type '2'. let y2 = ; ~ !!! error TS2322: Type '3' is not assignable to type '2'. diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index a3e5e7519bcf7..848c172859271 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -9,11 +9,11 @@ tests/cases/conformance/jsx/file.tsx(17,13): error TS2322: Type '{ yy: boolean; Type 'boolean' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(25,13): error TS2322: Type '{ extra-data: true; }' is not assignable to type '{ yy: string; direction?: number; }'. Property 'yy' is missing in type '{ extra-data: true; }'. -tests/cases/conformance/jsx/file.tsx(26,40): error TS2322: Type '"left"' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(33,32): error TS2322: Type '"hello"' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(34,29): error TS2322: Type '"hello"' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(35,29): error TS2322: Type '"hello"' is not assignable to type 'boolean'. -tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type '"hello"' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(26,40): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(33,32): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(34,29): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(35,29): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/jsx/file.tsx (11 errors) ==== @@ -61,7 +61,7 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type '"hello"' is not !!! error TS2322: Property 'yy' is missing in type '{ extra-data: true; }'. const d2 = ~~~~~~~~~ -!!! error TS2322: Type '"left"' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -70,14 +70,14 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type '"hello"' is not // Error const e1 = ~~ -!!! error TS2322: Type '"hello"' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. const e2 = ~~ -!!! error TS2322: Type '"hello"' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. const e3 = ~~ -!!! error TS2322: Type '"hello"' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. const e4 = Hi ~~ -!!! error TS2322: Type '"hello"' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index d12ca71cb5f92..3e9952fdc5515 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -8,7 +8,7 @@ tests/cases/conformance/jsx/file.tsx(51,13): error TS2322: Type '{ onClick: (k: Property '"data-format"' is missing in type '{ onClick: (k: MouseEvent) => void; to: string; }'. tests/cases/conformance/jsx/file.tsx(53,13): error TS2322: Type '{ to: string; onClick(e: any): void; }' is not assignable to type 'HyphenProps'. Property '"data-format"' is missing in type '{ to: string; onClick(e: any): void; }'. -tests/cases/conformance/jsx/file.tsx(54,51): error TS2322: Type '10' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(54,51): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(55,68): error TS2322: Type 'true' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(56,24): error TS2322: Type 'true' is not assignable to type 'string'. @@ -84,7 +84,7 @@ tests/cases/conformance/jsx/file.tsx(56,24): error TS2322: Type 'true' is not as !!! error TS2322: Property '"data-format"' is missing in type '{ to: string; onClick(e: any): void; }'. const b6 = ; // incorrect type for optional attribute ~~~~~~~~ -!!! error TS2322: Type '10' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~ !!! error TS2322: Type 'true' is not assignable to type 'string'. diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt index 8115539ec7b45..5d2e066a573f5 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(13,24): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(13,24): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -16,4 +16,4 @@ tests/cases/conformance/jsx/file.tsx(13,24): error TS2322: Type '5' is not assig // Error let i1 = ; ~~~~~~ -!!! error TS2322: Type '5' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt index 626a562ff2cd0..fa5e8e113cba7 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/jsx/file.tsx(19,10): error TS2322: Type '{ naaame: string; }' is not assignable to type '{ name: string; }'. Property 'name' is missing in type '{ naaame: string; }'. -tests/cases/conformance/jsx/file.tsx(27,15): error TS2322: Type '42' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(27,15): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(29,10): error TS2559: Type '{ naaaaaaame: string; }' has no properties in common with type 'IntrinsicAttributes & { name?: string; }'. tests/cases/conformance/jsx/file.tsx(34,10): error TS2322: Type '{ extra-prop-name: string; }' is not assignable to type '{ "prop-name": string; }'. Property '"prop-name"' is missing in type '{ extra-prop-name: string; }'. @@ -42,7 +42,7 @@ tests/cases/conformance/jsx/file.tsx(45,11): error TS2559: Type '{ prop1: boolea // Error let e = ; ~~~~ -!!! error TS2322: Type '42' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. // Error let f = ; ~~~~ diff --git a/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt b/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt index ccf988482f7a3..565485f03b70b 100644 --- a/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/file.tsx(11,14): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/compiler/file.tsx(11,14): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/file.tsx (1 errors) ==== @@ -14,5 +14,5 @@ tests/cases/compiler/file.tsx(11,14): error TS2322: Type '1' is not assignable t prop={1}>; // should error ~~~~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt index 1c4b9ffb04731..054bcf7222ecf 100644 --- a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(16,26): error TS2322: Type '20' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(18,26): error TS2322: Type '20' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(16,26): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(18,26): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(20,13): error TS2558: Expected 1 type arguments, but got 2. tests/cases/conformance/jsx/file.tsx(22,13): error TS2558: Expected 1 type arguments, but got 2. tests/cases/conformance/jsx/file.tsx(24,12): error TS1099: Type argument list cannot be empty. @@ -7,15 +7,15 @@ tests/cases/conformance/jsx/file.tsx(26,12): error TS1099: Type argument list ca tests/cases/conformance/jsx/file.tsx(39,14): error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. Types of property 'a' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(39,20): error TS2322: Type '10' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(39,20): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(41,14): error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. -tests/cases/conformance/jsx/file.tsx(41,20): error TS2322: Type '10' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(41,20): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(47,14): error TS2558: Expected 1-2 type arguments, but got 3. tests/cases/conformance/jsx/file.tsx(47,53): error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }'. tests/cases/conformance/jsx/file.tsx(49,14): error TS2558: Expected 1-2 type arguments, but got 3. tests/cases/conformance/jsx/file.tsx(49,53): error TS2339: Property 'b' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }'. -tests/cases/conformance/jsx/file.tsx(51,47): error TS2322: Type '"hi"' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type '"hi"' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(51,47): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (16 errors) ==== @@ -36,11 +36,11 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type '"hi"' is not as x = a={10} b={20} />; // error ~ -!!! error TS2322: Type '20' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. x = a={10} b={20}>; // error ~ -!!! error TS2322: Type '20' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. x = a={10} b="hi" />; // error ~~~~~~~~~~ @@ -75,13 +75,13 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type '"hi"' is not as !!! error TS2344: Types of property 'a' are incompatible. !!! error TS2344: Type 'number' is not assignable to type 'string'. ~ -!!! error TS2322: Type '10' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. x = a={10} b="hi">; // error ~~~~ !!! error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. ~ -!!! error TS2322: Type '10' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. x = a="hi" b="hi" />; // OK @@ -101,9 +101,9 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type '"hi"' is not as x = a="hi" b="hi" />; // error ~ -!!! error TS2322: Type '"hi"' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. x = a="hi" b="hi">; // error ~ -!!! error TS2322: Type '"hi"' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType2.errors.txt b/tests/baselines/reference/tsxUnionElementType2.errors.txt index e196a2905b3c8..bb7389b162da7 100644 --- a/tests/baselines/reference/tsxUnionElementType2.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(12,10): error TS2322: Type '"hi"' is not assignable to type 'number | boolean'. +tests/cases/conformance/jsx/file.tsx(12,10): error TS2322: Type 'string' is not assignable to type 'number | boolean'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -15,4 +15,4 @@ tests/cases/conformance/jsx/file.tsx(12,10): error TS2322: Type '"hi"' is not as var SFCComp = SFC1 || SFC2; ~ -!!! error TS2322: Type '"hi"' is not assignable to type 'number | boolean'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number | boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType6.errors.txt b/tests/baselines/reference/tsxUnionElementType6.errors.txt index 81fcce6c4a439..28cbb10fb17cf 100644 --- a/tests/baselines/reference/tsxUnionElementType6.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/jsx/file.tsx(18,10): error TS2559: Type '{ x: true; }' has no properties in common with type 'IntrinsicAttributes'. -tests/cases/conformance/jsx/file.tsx(19,27): error TS2322: Type '"hi"' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(19,27): error TS2322: Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{}' is not assignable to type '{ x: boolean; }'. Property 'x' is missing in type '{}'. tests/cases/conformance/jsx/file.tsx(21,10): error TS2322: Type '{ data-prop: true; }' is not assignable to type '{ x: boolean; }'. @@ -29,7 +29,7 @@ tests/cases/conformance/jsx/file.tsx(21,10): error TS2322: Type '{ data-prop: tr !!! error TS2559: Type '{ x: true; }' has no properties in common with type 'IntrinsicAttributes'. let b = ; ~ -!!! error TS2322: Type '"hi"' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. let c = ; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type '{}' is not assignable to type '{ x: boolean; }'. diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index c26c6826ef539..3d2f9439fe0f2 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -3,8 +3,8 @@ tests/cases/compiler/tupleTypes.ts(14,1): error TS2322: Type 'undefined[]' is no Property '0' is missing in type 'undefined[]'. tests/cases/compiler/tupleTypes.ts(15,1): error TS2322: Type '[number]' is not assignable to type '[number, string]'. Property '1' is missing in type '[number]'. -tests/cases/compiler/tupleTypes.ts(17,6): error TS2322: Type '"hello"' is not assignable to type 'number'. -tests/cases/compiler/tupleTypes.ts(17,15): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/compiler/tupleTypes.ts(17,6): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/tupleTypes.ts(17,15): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/tupleTypes.ts(18,1): error TS2322: Type '[number, string, number]' is not assignable to type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. @@ -52,9 +52,9 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n t = [1, "hello"]; // Ok t = ["hello", 1]; // Error ~~~~~~~ -!!! error TS2322: Type '"hello"' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. ~ -!!! error TS2322: Type '1' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. t = [1, "hello", 2]; // Error ~ !!! error TS2322: Type '[number, string, number]' is not assignable to type '[number, string]'. diff --git a/tests/baselines/reference/widenedTypes.errors.txt b/tests/baselines/reference/widenedTypes.errors.txt index e5c58df89d3ed..eb351d85c1f6e 100644 --- a/tests/baselines/reference/widenedTypes.errors.txt +++ b/tests/baselines/reference/widenedTypes.errors.txt @@ -7,7 +7,7 @@ tests/cases/compiler/widenedTypes.ts(10,1): error TS2322: Type '""' is not assig tests/cases/compiler/widenedTypes.ts(17,1): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/widenedTypes.ts(22,5): error TS2322: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/widenedTypes.ts(23,39): error TS2322: Type '3' is not assignable to type 'string'. +tests/cases/compiler/widenedTypes.ts(23,39): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/widenedTypes.ts (9 errors) ==== @@ -52,4 +52,4 @@ tests/cases/compiler/widenedTypes.ts(23,39): error TS2322: Type '3' is not assig !!! error TS2322: Type 'number' is not assignable to type 'string'. var obj: { [x: string]: string; } = { x: 3, y: null }; // assignable because null is widened, and therefore BCT is any ~ -!!! error TS2322: Type '3' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file From ea3300aba7387c951206706eaac1e23a267d054a Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 21 Jun 2018 17:34:26 -0700 Subject: [PATCH 07/16] Calculate elaborations like it was the very first time again~ --- src/compiler/checker.ts | 5 +- ...baseClassImprovedMismatchErrors.errors.txt | 4 - ...nvariantGenericErrorElaboration.errors.txt | 18 +- .../mutuallyRecursiveCallbacks.errors.txt | 6 +- .../typeComparisonCaching.errors.txt | 16 +- ...typedArraysCrossAssignability01.errors.txt | 640 +++++++----------- 6 files changed, 282 insertions(+), 407 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e370627ad6a6d..586fe364ddacb 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11087,9 +11087,8 @@ namespace ts { const related = relation.get(id); if (related !== undefined) { if (reportErrors && related === RelationComparisonResult.Failed) { - // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported - // failure and continue computing the relation such that errors get reported. - relation.set(id, RelationComparisonResult.FailedAndReported); + // We are elaborating errors and the cached result is an unreported failure. The result will be reported + // as a failure, and should be updated as a reported failure by the bottom of this function. } else { return related === RelationComparisonResult.Succeeded ? Ternary.True : Ternary.False; diff --git a/tests/baselines/reference/baseClassImprovedMismatchErrors.errors.txt b/tests/baselines/reference/baseClassImprovedMismatchErrors.errors.txt index 031fe18375415..5f46ee70d2aaa 100644 --- a/tests/baselines/reference/baseClassImprovedMismatchErrors.errors.txt +++ b/tests/baselines/reference/baseClassImprovedMismatchErrors.errors.txt @@ -5,7 +5,6 @@ tests/cases/compiler/baseClassImprovedMismatchErrors.ts(8,5): error TS2416: Prop Types of property 'n' are incompatible. Type 'string | Derived' is not assignable to type 'string | Base'. Type 'Derived' is not assignable to type 'string | Base'. - Type 'Derived' is not assignable to type 'Base'. tests/cases/compiler/baseClassImprovedMismatchErrors.ts(9,5): error TS2416: Property 'fn' in type 'Derived' is not assignable to the same property in base type 'Base'. Type '() => string | number' is not assignable to type '() => number'. Type 'string | number' is not assignable to type 'number'. @@ -17,7 +16,6 @@ tests/cases/compiler/baseClassImprovedMismatchErrors.ts(14,5): error TS2416: Pro Types of property 'n' are incompatible. Type 'string | DerivedInterface' is not assignable to type 'string | Base'. Type 'DerivedInterface' is not assignable to type 'string | Base'. - Type 'DerivedInterface' is not assignable to type 'Base'. tests/cases/compiler/baseClassImprovedMismatchErrors.ts(15,5): error TS2416: Property 'fn' in type 'DerivedInterface' is not assignable to the same property in base type 'Base'. Type '() => string | number' is not assignable to type '() => number'. Type 'string | number' is not assignable to type 'number'. @@ -41,7 +39,6 @@ tests/cases/compiler/baseClassImprovedMismatchErrors.ts(15,5): error TS2416: Pro !!! error TS2416: Types of property 'n' are incompatible. !!! error TS2416: Type 'string | Derived' is not assignable to type 'string | Base'. !!! error TS2416: Type 'Derived' is not assignable to type 'string | Base'. -!!! error TS2416: Type 'Derived' is not assignable to type 'Base'. fn() { ~~ !!! error TS2416: Property 'fn' in type 'Derived' is not assignable to the same property in base type 'Base'. @@ -61,7 +58,6 @@ tests/cases/compiler/baseClassImprovedMismatchErrors.ts(15,5): error TS2416: Pro !!! error TS2416: Types of property 'n' are incompatible. !!! error TS2416: Type 'string | DerivedInterface' is not assignable to type 'string | Base'. !!! error TS2416: Type 'DerivedInterface' is not assignable to type 'string | Base'. -!!! error TS2416: Type 'DerivedInterface' is not assignable to type 'Base'. fn() { ~~ !!! error TS2416: Property 'fn' in type 'DerivedInterface' is not assignable to the same property in base type 'Base'. diff --git a/tests/baselines/reference/invariantGenericErrorElaboration.errors.txt b/tests/baselines/reference/invariantGenericErrorElaboration.errors.txt index e3fe3ecb9c219..5142b665d7146 100644 --- a/tests/baselines/reference/invariantGenericErrorElaboration.errors.txt +++ b/tests/baselines/reference/invariantGenericErrorElaboration.errors.txt @@ -1,8 +1,13 @@ tests/cases/compiler/invariantGenericErrorElaboration.ts(3,7): error TS2322: Type 'Num' is not assignable to type 'Runtype'. Types of property 'constraint' are incompatible. Type 'Constraint' is not assignable to type 'Constraint>'. - Types of property 'underlying' are incompatible. - Type 'Num' is not assignable to type 'Runtype'. + Types of property 'constraint' are incompatible. + Type 'Constraint>' is not assignable to type 'Constraint>>'. + Types of property 'constraint' are incompatible. + Type 'Constraint>>' is not assignable to type 'Constraint>>>'. + Type 'Constraint>>' is not assignable to type 'Constraint>'. + Types of property 'underlying' are incompatible. + Type 'Constraint>' is not assignable to type 'Constraint'. tests/cases/compiler/invariantGenericErrorElaboration.ts(4,17): error TS2345: Argument of type '{ foo: Num; }' is not assignable to parameter of type '{ [_: string]: Runtype; }'. Property 'foo' is incompatible with index signature. Type 'Num' is not assignable to type 'Runtype'. @@ -16,8 +21,13 @@ tests/cases/compiler/invariantGenericErrorElaboration.ts(4,17): error TS2345: Ar !!! error TS2322: Type 'Num' is not assignable to type 'Runtype'. !!! error TS2322: Types of property 'constraint' are incompatible. !!! error TS2322: Type 'Constraint' is not assignable to type 'Constraint>'. -!!! error TS2322: Types of property 'underlying' are incompatible. -!!! error TS2322: Type 'Num' is not assignable to type 'Runtype'. +!!! error TS2322: Types of property 'constraint' are incompatible. +!!! error TS2322: Type 'Constraint>' is not assignable to type 'Constraint>>'. +!!! error TS2322: Types of property 'constraint' are incompatible. +!!! error TS2322: Type 'Constraint>>' is not assignable to type 'Constraint>>>'. +!!! error TS2322: Type 'Constraint>>' is not assignable to type 'Constraint>'. +!!! error TS2322: Types of property 'underlying' are incompatible. +!!! error TS2322: Type 'Constraint>' is not assignable to type 'Constraint'. const Foo = Obj({ foo: Num }) ~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ foo: Num; }' is not assignable to parameter of type '{ [_: string]: Runtype; }'. diff --git a/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt b/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt index b36548451b233..0682caad5b8aa 100644 --- a/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt +++ b/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt @@ -3,8 +3,7 @@ tests/cases/compiler/mutuallyRecursiveCallbacks.ts(7,1): error TS2322: Type ' Types of parameters 'bar' and 'foo' are incompatible. Type 'Foo<{}>' is not assignable to type 'Bar<{}>'. Types of parameters 'bar' and 'foo' are incompatible. - Types of parameters 'bar' and 'foo' are incompatible. - Type 'Foo<{}>' is not assignable to type 'Bar<{}>'. + Type 'void' is not assignable to type 'Foo<{}>'. ==== tests/cases/compiler/mutuallyRecursiveCallbacks.ts (1 errors) ==== @@ -21,6 +20,5 @@ tests/cases/compiler/mutuallyRecursiveCallbacks.ts(7,1): error TS2322: Type ' !!! error TS2322: Types of parameters 'bar' and 'foo' are incompatible. !!! error TS2322: Type 'Foo<{}>' is not assignable to type 'Bar<{}>'. !!! error TS2322: Types of parameters 'bar' and 'foo' are incompatible. -!!! error TS2322: Types of parameters 'bar' and 'foo' are incompatible. -!!! error TS2322: Type 'Foo<{}>' is not assignable to type 'Bar<{}>'. +!!! error TS2322: Type 'void' is not assignable to type 'Foo<{}>'. \ No newline at end of file diff --git a/tests/baselines/reference/typeComparisonCaching.errors.txt b/tests/baselines/reference/typeComparisonCaching.errors.txt index b7628b73ba999..8a94bdf835cef 100644 --- a/tests/baselines/reference/typeComparisonCaching.errors.txt +++ b/tests/baselines/reference/typeComparisonCaching.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/typeComparisonCaching.ts(26,1): error TS2322: Type 'B' is not assignable to type 'A'. - Types of property 'p' are incompatible. - Type 'D' is not assignable to type 'C'. - Types of property 'q' are incompatible. - Type 'B' is not assignable to type 'A'. + Types of property 's' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/typeComparisonCaching.ts(27,1): error TS2322: Type 'D' is not assignable to type 'C'. + Types of property 'q' are incompatible. + Type 'B' is not assignable to type 'A'. ==== tests/cases/compiler/typeComparisonCaching.ts (2 errors) ==== @@ -35,11 +35,11 @@ tests/cases/compiler/typeComparisonCaching.ts(27,1): error TS2322: Type 'D' is n a = b; ~ !!! error TS2322: Type 'B' is not assignable to type 'A'. -!!! error TS2322: Types of property 'p' are incompatible. -!!! error TS2322: Type 'D' is not assignable to type 'C'. -!!! error TS2322: Types of property 'q' are incompatible. -!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Types of property 's' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. c = d; // Should not be allowed ~ !!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Types of property 'q' are incompatible. +!!! error TS2322: Type 'B' is not assignable to type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt b/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt index 7ae66c5d09f18..ad94980642943 100644 --- a/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt +++ b/tests/baselines/reference/typedArraysCrossAssignability01.errors.txt @@ -1,259 +1,195 @@ tests/cases/compiler/typedArraysCrossAssignability01.ts(13,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. - Type 'Uint8Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Int8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(14,5): error TS2322: Type 'Int16Array' is not assignable to type 'Int8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. - Type 'Int16Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Int8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(15,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. - Type 'Uint16Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Int8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(16,5): error TS2322: Type 'Int32Array' is not assignable to type 'Int8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. - Type 'Int32Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Int8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(17,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. - Type 'Uint32Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Int8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(18,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. - Type 'Float32Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Int8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(19,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. - Type 'Float64Array' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Int8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(20,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. - Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Int8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(22,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. - Type 'Int8Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"UInt8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(24,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. - Type 'Int16Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"UInt8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(25,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. - Type 'Uint16Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"UInt8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(26,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. - Type 'Int32Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"UInt8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(27,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. - Type 'Uint32Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"UInt8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(28,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. - Type 'Float32Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"UInt8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(29,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. - Type 'Float64Array' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"UInt8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(30,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. - Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"UInt8Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(32,5): error TS2322: Type 'Int8Array' is not assignable to type 'Int16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. - Type 'Int8Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Int16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(33,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. - Type 'Uint8Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Int16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(35,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. - Type 'Uint16Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Int16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(36,5): error TS2322: Type 'Int32Array' is not assignable to type 'Int16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. - Type 'Int32Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Int16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(37,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. - Type 'Uint32Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Int16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(38,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. - Type 'Float32Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Int16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(39,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. - Type 'Float64Array' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Int16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(40,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. - Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Int16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(42,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. - Type 'Int8Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Uint16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(43,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Uint16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. - Type 'Uint8Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Uint16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(44,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. - Type 'Int16Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Uint16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(46,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. - Type 'Int32Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Uint16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(47,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. - Type 'Uint32Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Uint16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(48,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. - Type 'Float32Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Uint16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(49,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. - Type 'Float64Array' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Uint16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(50,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. - Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Uint16Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(52,5): error TS2322: Type 'Int8Array' is not assignable to type 'Int32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. - Type 'Int8Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Int32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(53,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Int32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. - Type 'Uint8Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Int32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(54,5): error TS2322: Type 'Int16Array' is not assignable to type 'Int32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. - Type 'Int16Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Int32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(55,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Int32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. - Type 'Uint16Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Int32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(57,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Int32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. - Type 'Uint32Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Int32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(58,5): error TS2322: Type 'Float32Array' is not assignable to type 'Int32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. - Type 'Float32Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Int32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(59,5): error TS2322: Type 'Float64Array' is not assignable to type 'Int32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. - Type 'Float64Array' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Int32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(60,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. - Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Int32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(62,5): error TS2322: Type 'Int8Array' is not assignable to type 'Float32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. - Type 'Int8Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Float32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(63,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Float32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. - Type 'Uint8Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Float32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(64,5): error TS2322: Type 'Int16Array' is not assignable to type 'Float32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. - Type 'Int16Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Float32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(65,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Float32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. - Type 'Uint16Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Float32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(66,5): error TS2322: Type 'Int32Array' is not assignable to type 'Float32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. - Type 'Int32Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Float32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(67,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Float32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. - Type 'Uint32Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Float32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(69,5): error TS2322: Type 'Float64Array' is not assignable to type 'Float32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. - Type 'Float64Array' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Float32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(70,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. - Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Float32Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(72,5): error TS2322: Type 'Int8Array' is not assignable to type 'Float64Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. - Type 'Int8Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Float64Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(73,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Float64Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. - Type 'Uint8Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Float64Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(74,5): error TS2322: Type 'Int16Array' is not assignable to type 'Float64Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. - Type 'Int16Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Float64Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(75,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Float64Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. - Type 'Uint16Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Float64Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(76,5): error TS2322: Type 'Int32Array' is not assignable to type 'Float64Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. - Type 'Int32Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Float64Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(77,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Float64Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. - Type 'Uint32Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Float64Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(78,5): error TS2322: Type 'Float32Array' is not assignable to type 'Float64Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. - Type 'Float32Array' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Float64Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(80,5): error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. - Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint8ClampedArray"' is not assignable to type '"Float64Array"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(82,5): error TS2322: Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. - Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int8Array"' is not assignable to type '"Uint8ClampedArray"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(83,5): error TS2322: Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. - Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"UInt8Array"' is not assignable to type '"Uint8ClampedArray"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(84,5): error TS2322: Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. - Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int16Array"' is not assignable to type '"Uint8ClampedArray"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(85,5): error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. - Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint16Array"' is not assignable to type '"Uint8ClampedArray"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(86,5): error TS2322: Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. - Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Int32Array"' is not assignable to type '"Uint8ClampedArray"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(87,5): error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. - Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Uint32Array"' is not assignable to type '"Uint8ClampedArray"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(88,5): error TS2322: Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. - Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float32Array"' is not assignable to type '"Uint8ClampedArray"'. tests/cases/compiler/typedArraysCrossAssignability01.ts(89,5): error TS2322: Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'. - Types of property 'copyWithin' are incompatible. - Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. - Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'. + Types of property '[Symbol.toStringTag]' are incompatible. + Type '"Float64Array"' is not assignable to type '"Uint8ClampedArray"'. ==== tests/cases/compiler/typedArraysCrossAssignability01.ts (64 errors) ==== @@ -272,400 +208,336 @@ tests/cases/compiler/typedArraysCrossAssignability01.ts(89,5): error TS2322: Typ arr_Int8Array = arr_Uint8Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. -!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int8Array"'. arr_Int8Array = arr_Int16Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. -!!! error TS2322: Type 'Int16Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Int8Array"'. arr_Int8Array = arr_Uint16Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. -!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int8Array"'. arr_Int8Array = arr_Int32Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. -!!! error TS2322: Type 'Int32Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Int8Array"'. arr_Int8Array = arr_Uint32Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. -!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int8Array"'. arr_Int8Array = arr_Float32Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. -!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int8Array"'. arr_Int8Array = arr_Float64Array; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. -!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int8Array"'. arr_Int8Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int8Array'. -!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int8Array"'. arr_Uint8Array = arr_Int8Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. -!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"UInt8Array"'. arr_Uint8Array = arr_Uint8Array; arr_Uint8Array = arr_Int16Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. -!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"UInt8Array"'. arr_Uint8Array = arr_Uint16Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. -!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"UInt8Array"'. arr_Uint8Array = arr_Int32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. -!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"UInt8Array"'. arr_Uint8Array = arr_Uint32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. -!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"UInt8Array"'. arr_Uint8Array = arr_Float32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. -!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"UInt8Array"'. arr_Uint8Array = arr_Float64Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. -!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"UInt8Array"'. arr_Uint8Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Uint8Array'. -!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"UInt8Array"'. arr_Int16Array = arr_Int8Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. -!!! error TS2322: Type 'Int8Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Int16Array"'. arr_Int16Array = arr_Uint8Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. -!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int16Array"'. arr_Int16Array = arr_Int16Array; arr_Int16Array = arr_Uint16Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. -!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int16Array"'. arr_Int16Array = arr_Int32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. -!!! error TS2322: Type 'Int32Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Int16Array"'. arr_Int16Array = arr_Uint32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. -!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int16Array"'. arr_Int16Array = arr_Float32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. -!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int16Array"'. arr_Int16Array = arr_Float64Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. -!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int16Array"'. arr_Int16Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int16Array'. -!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int16Array"'. arr_Uint16Array = arr_Int8Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. -!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Uint16Array"'. arr_Uint16Array = arr_Uint8Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. -!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Uint16Array"'. arr_Uint16Array = arr_Int16Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. -!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Uint16Array"'. arr_Uint16Array = arr_Uint16Array; arr_Uint16Array = arr_Int32Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. -!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Uint16Array"'. arr_Uint16Array = arr_Uint32Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. -!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Uint16Array"'. arr_Uint16Array = arr_Float32Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. -!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Uint16Array"'. arr_Uint16Array = arr_Float64Array; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. -!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Uint16Array"'. arr_Uint16Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Uint16Array'. -!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Uint16Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Uint16Array"'. arr_Int32Array = arr_Int8Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. -!!! error TS2322: Type 'Int8Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Int32Array"'. arr_Int32Array = arr_Uint8Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. -!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Int32Array"'. arr_Int32Array = arr_Int16Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. -!!! error TS2322: Type 'Int16Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Int32Array"'. arr_Int32Array = arr_Uint16Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. -!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Int32Array"'. arr_Int32Array = arr_Int32Array; arr_Int32Array = arr_Uint32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. -!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Int32Array"'. arr_Int32Array = arr_Float32Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. -!!! error TS2322: Type 'Float32Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Int32Array"'. arr_Int32Array = arr_Float64Array; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. -!!! error TS2322: Type 'Float64Array' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Int32Array"'. arr_Int32Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Int32Array'. -!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Int32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Int32Array"'. arr_Float32Array = arr_Int8Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. -!!! error TS2322: Type 'Int8Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Float32Array"'. arr_Float32Array = arr_Uint8Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. -!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Float32Array"'. arr_Float32Array = arr_Int16Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. -!!! error TS2322: Type 'Int16Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Float32Array"'. arr_Float32Array = arr_Uint16Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. -!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Float32Array"'. arr_Float32Array = arr_Int32Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. -!!! error TS2322: Type 'Int32Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Float32Array"'. arr_Float32Array = arr_Uint32Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. -!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Float32Array"'. arr_Float32Array = arr_Float32Array; arr_Float32Array = arr_Float64Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. -!!! error TS2322: Type 'Float64Array' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Float32Array"'. arr_Float32Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Float32Array'. -!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float32Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Float32Array"'. arr_Float64Array = arr_Int8Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. -!!! error TS2322: Type 'Int8Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Float64Array"'. arr_Float64Array = arr_Uint8Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. -!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Float64Array"'. arr_Float64Array = arr_Int16Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. -!!! error TS2322: Type 'Int16Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Float64Array"'. arr_Float64Array = arr_Uint16Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. -!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Float64Array"'. arr_Float64Array = arr_Int32Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. -!!! error TS2322: Type 'Int32Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Float64Array"'. arr_Float64Array = arr_Uint32Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. -!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Float64Array"'. arr_Float64Array = arr_Float32Array; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. -!!! error TS2322: Type 'Float32Array' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Float64Array"'. arr_Float64Array = arr_Float64Array; arr_Float64Array = arr_Uint8ClampedArray; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8ClampedArray' is not assignable to type '(target: number, start: number, end?: number) => Float64Array'. -!!! error TS2322: Type 'Uint8ClampedArray' is not assignable to type 'Float64Array'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint8ClampedArray"' is not assignable to type '"Float64Array"'. arr_Uint8ClampedArray = arr_Int8Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. -!!! error TS2322: Type 'Int8Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int8Array"' is not assignable to type '"Uint8ClampedArray"'. arr_Uint8ClampedArray = arr_Uint8Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint8Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. -!!! error TS2322: Type 'Uint8Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"UInt8Array"' is not assignable to type '"Uint8ClampedArray"'. arr_Uint8ClampedArray = arr_Int16Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. -!!! error TS2322: Type 'Int16Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int16Array"' is not assignable to type '"Uint8ClampedArray"'. arr_Uint8ClampedArray = arr_Uint16Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint16Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. -!!! error TS2322: Type 'Uint16Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint16Array"' is not assignable to type '"Uint8ClampedArray"'. arr_Uint8ClampedArray = arr_Int32Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Int32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. -!!! error TS2322: Type 'Int32Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Int32Array"' is not assignable to type '"Uint8ClampedArray"'. arr_Uint8ClampedArray = arr_Uint32Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Uint32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. -!!! error TS2322: Type 'Uint32Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Uint32Array"' is not assignable to type '"Uint8ClampedArray"'. arr_Uint8ClampedArray = arr_Float32Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float32Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. -!!! error TS2322: Type 'Float32Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float32Array"' is not assignable to type '"Uint8ClampedArray"'. arr_Uint8ClampedArray = arr_Float64Array; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'. -!!! error TS2322: Types of property 'copyWithin' are incompatible. -!!! error TS2322: Type '(target: number, start: number, end?: number) => Float64Array' is not assignable to type '(target: number, start: number, end?: number) => Uint8ClampedArray'. -!!! error TS2322: Type 'Float64Array' is not assignable to type 'Uint8ClampedArray'. +!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. +!!! error TS2322: Type '"Float64Array"' is not assignable to type '"Uint8ClampedArray"'. arr_Uint8ClampedArray = arr_Uint8ClampedArray; } From 23d1e1767439f9f0d513ab9622b7c2fd52a701c3 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 21 Jun 2018 17:50:09 -0700 Subject: [PATCH 08/16] Use tristate for enum relationship to ensure elaborations are printed at least once --- src/compiler/checker.ts | 15 +++++++++------ .../reference/enumAssignmentCompat3.errors.txt | 10 ++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 586fe364ddacb..2ac435ef652b1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -596,7 +596,7 @@ namespace ts { const definitelyAssignableRelation = createMap(); const comparableRelation = createMap(); const identityRelation = createMap(); - const enumRelation = createMap(); + const enumRelation = createMap(); type TypeSystemEntity = Symbol | Type | Signature; @@ -10452,11 +10452,11 @@ namespace ts { } const id = getSymbolId(sourceSymbol) + "," + getSymbolId(targetSymbol); const relation = enumRelation.get(id); - if (relation !== undefined) { - return relation; + if (relation !== undefined && !(relation === RelationComparisonResult.Failed && errorReporter)) { + return relation === RelationComparisonResult.Succeeded; } if (sourceSymbol.escapedName !== targetSymbol.escapedName || !(sourceSymbol.flags & SymbolFlags.RegularEnum) || !(targetSymbol.flags & SymbolFlags.RegularEnum)) { - enumRelation.set(id, false); + enumRelation.set(id, RelationComparisonResult.FailedAndReported); return false; } const targetEnumType = getTypeOfSymbol(targetSymbol); @@ -10467,13 +10467,16 @@ namespace ts { if (errorReporter) { errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, TypeFormatFlags.UseFullyQualifiedType)); + enumRelation.set(id, RelationComparisonResult.FailedAndReported); + } + else { + enumRelation.set(id, RelationComparisonResult.Failed); } - enumRelation.set(id, false); return false; } } } - enumRelation.set(id, true); + enumRelation.set(id, RelationComparisonResult.Succeeded); return true; } diff --git a/tests/baselines/reference/enumAssignmentCompat3.errors.txt b/tests/baselines/reference/enumAssignmentCompat3.errors.txt index bae429823e3de..a458733bcc296 100644 --- a/tests/baselines/reference/enumAssignmentCompat3.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat3.errors.txt @@ -1,14 +1,19 @@ tests/cases/compiler/enumAssignmentCompat3.ts(68,1): error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'. + Property 'd' is missing in type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(70,1): error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. + Property 'd' is missing in type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(71,1): error TS2322: Type 'Nope' is not assignable to type 'E'. tests/cases/compiler/enumAssignmentCompat3.ts(72,1): error TS2322: Type 'Decl.E' is not assignable to type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(75,1): error TS2322: Type 'First.E' is not assignable to type 'Ab.E'. + Property 'c' is missing in type 'Ab.E'. tests/cases/compiler/enumAssignmentCompat3.ts(76,1): error TS2322: Type 'First.E' is not assignable to type 'Cd.E'. + Property 'a' is missing in type 'Cd.E'. tests/cases/compiler/enumAssignmentCompat3.ts(77,1): error TS2322: Type 'E' is not assignable to type 'Nope'. tests/cases/compiler/enumAssignmentCompat3.ts(78,1): error TS2322: Type 'First.E' is not assignable to type 'Decl.E'. tests/cases/compiler/enumAssignmentCompat3.ts(82,1): error TS2322: Type 'Const.E' is not assignable to type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(83,1): error TS2322: Type 'First.E' is not assignable to type 'Const.E'. tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged.E' is not assignable to type 'First.E'. + Property 'd' is missing in type 'First.E'. ==== tests/cases/compiler/enumAssignmentCompat3.ts (11 errors) ==== @@ -82,10 +87,12 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. abc = secondAbcd; // missing 'd' ~~~ !!! error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'. +!!! error TS2322: Property 'd' is missing in type 'First.E'. abc = secondAb; // ok abc = secondCd; // missing 'd' ~~~ !!! error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. +!!! error TS2322: Property 'd' is missing in type 'First.E'. abc = nope; // nope! ~~~ !!! error TS2322: Type 'Nope' is not assignable to type 'E'. @@ -97,9 +104,11 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. secondAb = abc; // missing 'c' ~~~~~~~~ !!! error TS2322: Type 'First.E' is not assignable to type 'Ab.E'. +!!! error TS2322: Property 'c' is missing in type 'Ab.E'. secondCd = abc; // missing 'a' and 'b' ~~~~~~~~ !!! error TS2322: Type 'First.E' is not assignable to type 'Cd.E'. +!!! error TS2322: Property 'a' is missing in type 'Cd.E'. nope = abc; // nope! ~~~~ !!! error TS2322: Type 'E' is not assignable to type 'Nope'. @@ -120,6 +129,7 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. abc = merged; // missing 'd' ~~~ !!! error TS2322: Type 'Merged.E' is not assignable to type 'First.E'. +!!! error TS2322: Property 'd' is missing in type 'First.E'. merged = abc; // ok abc = merged2; // ok merged2 = abc; // ok \ No newline at end of file From e663505564ebbec4fe6acb6aec10d72ae26ec9c9 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 28 Jun 2018 17:03:48 -0700 Subject: [PATCH 09/16] Update message text, nits --- src/compiler/checker.ts | 6 +++--- src/compiler/diagnosticMessages.json | 2 +- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 +- .../reference/deeplyNestedAssignabilityIssue.errors.txt | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 70058b55cbba9..183090d102aab 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10243,7 +10243,7 @@ namespace ts { const propertyName = typeToString(nameType); const targetType = typeToString(target); for (const declaration of target.symbol.declarations) { - relatededInfo.push(createDiagnosticForNode(declaration, Diagnostics.Which_is_from_property_0_of_type_1_declared_here, propertyName, targetType)); + relatededInfo.push(createDiagnosticForNode(declaration, Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, propertyName, targetType)); } } reportedError = true; @@ -10285,7 +10285,7 @@ namespace ts { return false; } - function *generateObjectliteralElements(node: ObjectLiteralExpression): ElaborationIterator { + function *generateObjectLiteralElements(node: ObjectLiteralExpression): ElaborationIterator { if (!length(node.properties)) return; for (const prop of node.properties) { if (isSpreadAssignment(prop)) continue; @@ -10310,7 +10310,7 @@ namespace ts { } function elaborateObjectLiteral(node: ObjectLiteralExpression, source: Type, target: Type) { - return elaborateElementwise(generateObjectliteralElements(node), source, target); + return elaborateElementwise(generateObjectLiteralElements(node), source, target); } /** diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 629a51f07b185..f9dedaa2f70bf 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3730,7 +3730,7 @@ "code": 6371 }, - "Which is from property '{0}' of type '{1}', declared here.": { + "The expected type comes from property '{0}' which is declared here on type '{1}'": { "category": "Message", "code": 6500 }, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 939667c0c42e7..3bdb36d4debee 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5767,7 +5767,7 @@ declare namespace ts { Option_build_must_be_the_first_command_line_argument: DiagnosticMessage; Options_0_and_1_cannot_be_combined: DiagnosticMessage; Skipping_clean_because_not_all_projects_could_be_located: DiagnosticMessage; - Which_is_from_property_0_of_type_1_declared_here: DiagnosticMessage; + The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: DiagnosticMessage; Variable_0_implicitly_has_an_1_type: DiagnosticMessage; Parameter_0_implicitly_has_an_1_type: DiagnosticMessage; Member_0_implicitly_has_an_1_type: DiagnosticMessage; diff --git a/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt b/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt index 13c809b933da2..3aac620fb0db0 100644 --- a/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt +++ b/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt @@ -11,7 +11,7 @@   ~~~~~~~~~~~~~~~~~~~~~~~~~ 10 }   ~~~~~~~~~~~~~ - Which is from property '"thing"' of type '{ thing: A; }', declared here. + The expected type comes from property '"thing"' which is declared here on type '{ thing: A; }' tests/cases/compiler/deeplyNestedAssignabilityIssue.ts:25:17 - error TS2322: Type '{}' is not assignable to type 'A'. Property 'a' is missing in type '{}'. @@ -25,7 +25,7 @@   ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 13 }   ~~~~~~~~~~~~~ - Which is from property '"another"' of type '{ another: A; }', declared here. + The expected type comes from property '"another"' which is declared here on type '{ another: A; }' ==== tests/cases/compiler/deeplyNestedAssignabilityIssue.ts (2 errors) ==== From b8191656c47fab321430e58a664a152059cf8d2b Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 2 Jul 2018 12:10:50 -0700 Subject: [PATCH 10/16] move some functions back to where they were --- src/compiler/utilities.ts | 19 ------------------- src/services/utilities.ts | 17 +++++++++++++++++ .../reference/api/tsserverlibrary.d.ts | 14 +++++++------- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 2f5d27fbc6f9e..a1c6d5137b27d 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -6679,25 +6679,6 @@ namespace ts { return node.kind === SyntaxKind.NamedImports || node.kind === SyntaxKind.NamedExports; } - /* @internal */ - /** - * Strip off existed single quotes or double quotes from a given string - * - * @return non-quoted string - */ - export function stripQuotes(name: string) { - const length = name.length; - if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && startsWithQuote(name)) { - return name.substring(1, length - 1); - } - return name; - } - - /* @internal */ - export function startsWithQuote(name: string): boolean { - return isSingleOrDoubleQuote(name.charCodeAt(0)); - } - export interface ObjectAllocator { getNodeConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Node; getTokenConstructor(): new (kind: TKind, pos?: number, end?: number) => Token; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 6ad73b4965c81..789882a491c24 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1569,6 +1569,23 @@ namespace ts { (location.parent).propertyName === location; } + /** + * Strip off existed single quotes or double quotes from a given string + * + * @return non-quoted string + */ + export function stripQuotes(name: string) { + const length = name.length; + if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && startsWithQuote(name)) { + return name.substring(1, length - 1); + } + return name; + } + + export function startsWithQuote(name: string): boolean { + return isSingleOrDoubleQuote(name.charCodeAt(0)); + } + export function scriptKindIs(fileName: string, host: LanguageServiceHost, ...scriptKinds: ScriptKind[]): boolean { const scriptKind = getScriptKind(fileName, host); return some(scriptKinds, k => k === scriptKind); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 36190ca10e1b3..57299d0b69fae 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -7069,13 +7069,6 @@ declare namespace ts { declare namespace ts { /** @internal */ function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports; - /** - * Strip off existed single quotes or double quotes from a given string - * - * @return non-quoted string - */ - function stripQuotes(name: string): string; - function startsWithQuote(name: string): boolean; interface ObjectAllocator { getNodeConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Node; getTokenConstructor(): new (kind: TKind, pos?: number, end?: number) => Token; @@ -10860,6 +10853,13 @@ declare namespace ts { function symbolToDisplayParts(typeChecker: TypeChecker, symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): SymbolDisplayPart[]; function signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; function isImportOrExportSpecifierName(location: Node): location is Identifier; + /** + * Strip off existed single quotes or double quotes from a given string + * + * @return non-quoted string + */ + function stripQuotes(name: string): string; + function startsWithQuote(name: string): boolean; function scriptKindIs(fileName: string, host: LanguageServiceHost, ...scriptKinds: ScriptKind[]): boolean; function getScriptKind(fileName: string, host?: LanguageServiceHost): ScriptKind; function getUniqueSymbolId(symbol: Symbol, checker: TypeChecker): number; From 1bcf91edcf5fe784df2640ba0873ec4b6e6ba4fb Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 2 Jul 2018 12:24:18 -0700 Subject: [PATCH 11/16] Add test of deep JSX elaboration --- src/compiler/checker.ts | 3 +- ...DeepAttributeAssignabilityError.errors.txt | 30 +++++++++++ .../tsxDeepAttributeAssignabilityError.js | 43 +++++++++++++++ ...tsxDeepAttributeAssignabilityError.symbols | 50 +++++++++++++++++ .../tsxDeepAttributeAssignabilityError.types | 54 +++++++++++++++++++ .../tsxDeepAttributeAssignabilityError.tsx | 29 ++++++++++ 6 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/tsxDeepAttributeAssignabilityError.errors.txt create mode 100644 tests/baselines/reference/tsxDeepAttributeAssignabilityError.js create mode 100644 tests/baselines/reference/tsxDeepAttributeAssignabilityError.symbols create mode 100644 tests/baselines/reference/tsxDeepAttributeAssignabilityError.types create mode 100644 tests/cases/compiler/tsxDeepAttributeAssignabilityError.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d0d7fe8cd3219..5d10a0d55c053 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10118,8 +10118,9 @@ namespace ts { function elaborateError(node: Expression | undefined, source: Type, target: Type): boolean { if (!node) return false; switch (node.kind) { + case SyntaxKind.JsxExpression: case SyntaxKind.ParenthesizedExpression: - return elaborateError((node as ParenthesizedExpression).expression, source, target); + return elaborateError((node as ParenthesizedExpression | JsxExpression).expression, source, target); case SyntaxKind.BinaryExpression: switch ((node as BinaryExpression).operatorToken.kind) { case SyntaxKind.EqualsToken: diff --git a/tests/baselines/reference/tsxDeepAttributeAssignabilityError.errors.txt b/tests/baselines/reference/tsxDeepAttributeAssignabilityError.errors.txt new file mode 100644 index 0000000000000..8005afbdd55cd --- /dev/null +++ b/tests/baselines/reference/tsxDeepAttributeAssignabilityError.errors.txt @@ -0,0 +1,30 @@ +tests/cases/compiler/file1.tsx(5,5): error TS2322: Type 'number' is not assignable to type 'string'. + + +==== tests/cases/compiler/my-component.tsx (0 errors) ==== + import * as React from 'react' + + interface MyProps { + x: string; + y: MyInnerProps; + } + + interface MyInnerProps { + value: string; + } + + export function MyComponent(_props: MyProps) { + return my component; + } + +==== tests/cases/compiler/file1.tsx (1 errors) ==== + import * as React from 'react' + import { MyComponent } from './my-component' + + export const result = ; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxDeepAttributeAssignabilityError.js b/tests/baselines/reference/tsxDeepAttributeAssignabilityError.js new file mode 100644 index 0000000000000..c452336da462d --- /dev/null +++ b/tests/baselines/reference/tsxDeepAttributeAssignabilityError.js @@ -0,0 +1,43 @@ +//// [tests/cases/compiler/tsxDeepAttributeAssignabilityError.tsx] //// + +//// [my-component.tsx] +import * as React from 'react' + +interface MyProps { + x: string; + y: MyInnerProps; +} + +interface MyInnerProps { + value: string; +} + +export function MyComponent(_props: MyProps) { + return my component; +} + +//// [file1.tsx] +import * as React from 'react' +import { MyComponent } from './my-component' + +export const result = ; + + +//// [my-component.js] +"use strict"; +exports.__esModule = true; +var React = require("react"); +function MyComponent(_props) { + return React.createElement("span", null, "my component"); +} +exports.MyComponent = MyComponent; +//// [file1.js] +"use strict"; +exports.__esModule = true; +var React = require("react"); +var my_component_1 = require("./my-component"); +exports.result = React.createElement(my_component_1.MyComponent, { x: "yes", y: { + value: 42 + } }); diff --git a/tests/baselines/reference/tsxDeepAttributeAssignabilityError.symbols b/tests/baselines/reference/tsxDeepAttributeAssignabilityError.symbols new file mode 100644 index 0000000000000..2ae8d453bd4d6 --- /dev/null +++ b/tests/baselines/reference/tsxDeepAttributeAssignabilityError.symbols @@ -0,0 +1,50 @@ +=== tests/cases/compiler/my-component.tsx === +import * as React from 'react' +>React : Symbol(React, Decl(my-component.tsx, 0, 6)) + +interface MyProps { +>MyProps : Symbol(MyProps, Decl(my-component.tsx, 0, 30)) + + x: string; +>x : Symbol(MyProps.x, Decl(my-component.tsx, 2, 19)) + + y: MyInnerProps; +>y : Symbol(MyProps.y, Decl(my-component.tsx, 3, 14)) +>MyInnerProps : Symbol(MyInnerProps, Decl(my-component.tsx, 5, 1)) +} + +interface MyInnerProps { +>MyInnerProps : Symbol(MyInnerProps, Decl(my-component.tsx, 5, 1)) + + value: string; +>value : Symbol(MyInnerProps.value, Decl(my-component.tsx, 7, 24)) +} + +export function MyComponent(_props: MyProps) { +>MyComponent : Symbol(MyComponent, Decl(my-component.tsx, 9, 1)) +>_props : Symbol(_props, Decl(my-component.tsx, 11, 28)) +>MyProps : Symbol(MyProps, Decl(my-component.tsx, 0, 30)) + + return my component; +>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2461, 51)) +>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2461, 51)) +} + +=== tests/cases/compiler/file1.tsx === +import * as React from 'react' +>React : Symbol(React, Decl(file1.tsx, 0, 6)) + +import { MyComponent } from './my-component' +>MyComponent : Symbol(MyComponent, Decl(file1.tsx, 1, 8)) + +export const result = result : Symbol(result, Decl(file1.tsx, 3, 12)) +>MyComponent : Symbol(MyComponent, Decl(file1.tsx, 1, 8)) +>x : Symbol(x, Decl(file1.tsx, 3, 34)) +>y : Symbol(y, Decl(file1.tsx, 3, 42)) + + value: 42 +>value : Symbol(value, Decl(file1.tsx, 3, 47)) + +}} />; + diff --git a/tests/baselines/reference/tsxDeepAttributeAssignabilityError.types b/tests/baselines/reference/tsxDeepAttributeAssignabilityError.types new file mode 100644 index 0000000000000..16c81ed8d878b --- /dev/null +++ b/tests/baselines/reference/tsxDeepAttributeAssignabilityError.types @@ -0,0 +1,54 @@ +=== tests/cases/compiler/my-component.tsx === +import * as React from 'react' +>React : typeof React + +interface MyProps { +>MyProps : MyProps + + x: string; +>x : string + + y: MyInnerProps; +>y : MyInnerProps +>MyInnerProps : MyInnerProps +} + +interface MyInnerProps { +>MyInnerProps : MyInnerProps + + value: string; +>value : string +} + +export function MyComponent(_props: MyProps) { +>MyComponent : (_props: MyProps) => JSX.Element +>_props : MyProps +>MyProps : MyProps + + return my component; +>my component : JSX.Element +>span : any +>span : any +} + +=== tests/cases/compiler/file1.tsx === +import * as React from 'react' +>React : typeof React + +import { MyComponent } from './my-component' +>MyComponent : (_props: MyProps) => JSX.Element + +export const result = result : JSX.Element +> : JSX.Element +>MyComponent : (_props: MyProps) => JSX.Element +>x : string +>y : { value: number; } +>{ value: 42} : { value: number; } + + value: 42 +>value : number +>42 : 42 + +}} />; + diff --git a/tests/cases/compiler/tsxDeepAttributeAssignabilityError.tsx b/tests/cases/compiler/tsxDeepAttributeAssignabilityError.tsx new file mode 100644 index 0000000000000..c52b4b66167b0 --- /dev/null +++ b/tests/cases/compiler/tsxDeepAttributeAssignabilityError.tsx @@ -0,0 +1,29 @@ +// @jsx: react +// @noLib: true +// @skipLibCheck: true +// @libFiles: react.d.ts,lib.d.ts + +// @Filename: my-component.tsx +import * as React from 'react' + +interface MyProps { + x: string; + y: MyInnerProps; +} + +interface MyInnerProps { + value: string; +} + +export function MyComponent(_props: MyProps) { + return my component; +} + +// @Filename: file1.tsx + +import * as React from 'react' +import { MyComponent } from './my-component' + +export const result = ; From 9eb759b01d6d54b1d93879cb8875618f9f4be7bc Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 2 Jul 2018 12:27:44 -0700 Subject: [PATCH 12/16] Add elaboration test with parenthesized expressions, comma expressions, and assignments --- ...edDeepObjectLiteralElaborations.errors.txt | 28 ++++++++++ ...IndirectedDeepObjectLiteralElaborations.js | 34 +++++++++++ ...ectedDeepObjectLiteralElaborations.symbols | 45 +++++++++++++++ ...irectedDeepObjectLiteralElaborations.types | 56 +++++++++++++++++++ ...IndirectedDeepObjectLiteralElaborations.ts | 20 +++++++ 5 files changed, 183 insertions(+) create mode 100644 tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.errors.txt create mode 100644 tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.js create mode 100644 tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.symbols create mode 100644 tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.types create mode 100644 tests/cases/compiler/slightlyIndirectedDeepObjectLiteralElaborations.ts diff --git a/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.errors.txt b/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.errors.txt new file mode 100644 index 0000000000000..b2f976e7ab947 --- /dev/null +++ b/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.errors.txt @@ -0,0 +1,28 @@ +tests/cases/compiler/slightlyIndirectedDeepObjectLiteralElaborations.ts(16,17): error TS2322: Type 'number' is not assignable to type 'string'. + + +==== tests/cases/compiler/slightlyIndirectedDeepObjectLiteralElaborations.ts (1 errors) ==== + interface Foo { + a: { + b: { + c: { + d: string + } + } + } + } + + let q: Foo["a"] | undefined; + const x: Foo = (void 0, { + a: q = { + b: ({ + c: { + d: 42 + ~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/compiler/slightlyIndirectedDeepObjectLiteralElaborations.ts:5:17: The expected type comes from property 'd' which is declared here on type '{ d: string; }' + } + }) + } + }); + \ No newline at end of file diff --git a/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.js b/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.js new file mode 100644 index 0000000000000..eea1e1b79ea3a --- /dev/null +++ b/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.js @@ -0,0 +1,34 @@ +//// [slightlyIndirectedDeepObjectLiteralElaborations.ts] +interface Foo { + a: { + b: { + c: { + d: string + } + } + } +} + +let q: Foo["a"] | undefined; +const x: Foo = (void 0, { + a: q = { + b: ({ + c: { + d: 42 + } + }) + } +}); + + +//// [slightlyIndirectedDeepObjectLiteralElaborations.js] +var q; +var x = (void 0, { + a: q = { + b: ({ + c: { + d: 42 + } + }) + } +}); diff --git a/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.symbols b/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.symbols new file mode 100644 index 0000000000000..49c853a20aaf4 --- /dev/null +++ b/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/slightlyIndirectedDeepObjectLiteralElaborations.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 0, 0)) + + a: { +>a : Symbol(Foo.a, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 0, 15)) + + b: { +>b : Symbol(b, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 1, 8)) + + c: { +>c : Symbol(c, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 2, 12)) + + d: string +>d : Symbol(d, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 3, 16)) + } + } + } +} + +let q: Foo["a"] | undefined; +>q : Symbol(q, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 10, 3)) +>Foo : Symbol(Foo, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 0, 0)) + +const x: Foo = (void 0, { +>x : Symbol(x, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 11, 5)) +>Foo : Symbol(Foo, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 0, 0)) + + a: q = { +>a : Symbol(a, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 11, 25)) +>q : Symbol(q, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 10, 3)) + + b: ({ +>b : Symbol(b, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 12, 12)) + + c: { +>c : Symbol(c, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 13, 13)) + + d: 42 +>d : Symbol(d, Decl(slightlyIndirectedDeepObjectLiteralElaborations.ts, 14, 16)) + } + }) + } +}); + diff --git a/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.types b/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.types new file mode 100644 index 0000000000000..34bf86d8d9ab6 --- /dev/null +++ b/tests/baselines/reference/slightlyIndirectedDeepObjectLiteralElaborations.types @@ -0,0 +1,56 @@ +=== tests/cases/compiler/slightlyIndirectedDeepObjectLiteralElaborations.ts === +interface Foo { +>Foo : Foo + + a: { +>a : { b: { c: { d: string; }; }; } + + b: { +>b : { c: { d: string; }; } + + c: { +>c : { d: string; } + + d: string +>d : string + } + } + } +} + +let q: Foo["a"] | undefined; +>q : { b: { c: { d: string; }; }; } +>Foo : Foo + +const x: Foo = (void 0, { +>x : Foo +>Foo : Foo +>(void 0, { a: q = { b: ({ c: { d: 42 } }) }}) : { a: { b: { c: { d: number; }; }; }; } +>void 0, { a: q = { b: ({ c: { d: 42 } }) }} : { a: { b: { c: { d: number; }; }; }; } +>void 0 : undefined +>0 : 0 +>{ a: q = { b: ({ c: { d: 42 } }) }} : { a: { b: { c: { d: number; }; }; }; } + + a: q = { +>a : { b: { c: { d: number; }; }; } +>q = { b: ({ c: { d: 42 } }) } : { b: { c: { d: number; }; }; } +>q : { b: { c: { d: string; }; }; } +>{ b: ({ c: { d: 42 } }) } : { b: { c: { d: number; }; }; } + + b: ({ +>b : { c: { d: number; }; } +>({ c: { d: 42 } }) : { c: { d: number; }; } +>{ c: { d: 42 } } : { c: { d: number; }; } + + c: { +>c : { d: number; } +>{ d: 42 } : { d: number; } + + d: 42 +>d : number +>42 : 42 + } + }) + } +}); + diff --git a/tests/cases/compiler/slightlyIndirectedDeepObjectLiteralElaborations.ts b/tests/cases/compiler/slightlyIndirectedDeepObjectLiteralElaborations.ts new file mode 100644 index 0000000000000..41100f4a19a8a --- /dev/null +++ b/tests/cases/compiler/slightlyIndirectedDeepObjectLiteralElaborations.ts @@ -0,0 +1,20 @@ +interface Foo { + a: { + b: { + c: { + d: string + } + } + } +} + +let q: Foo["a"] | undefined; +const x: Foo = (void 0, { + a: q = { + b: ({ + c: { + d: 42 + } + }) + } +}); From 62ba57caa16a7f617fa6da3cd161c25cfc30c9f6 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 2 Jul 2018 12:55:16 -0700 Subject: [PATCH 13/16] Move check to allow elaborations on more anonymous types --- src/compiler/checker.ts | 6 +++--- .../checkJsxGenericTagHasCorrectInferences.errors.txt | 3 ++- .../contextualTypeWithUnionTypeObjectLiteral.errors.txt | 1 + .../reference/jsxChildrenGenericContextualTypes.errors.txt | 1 + .../reference/objectLiteralNormalization.errors.txt | 1 + .../reference/tsxDefaultAttributesResolution3.errors.txt | 3 ++- .../reference/tsxLibraryManagedAttributes.errors.txt | 5 +++++ .../tsxReactComponentWithDefaultTypeParameter3.errors.txt | 3 ++- .../reference/tsxSpreadAttributesResolution10.errors.txt | 4 ++++ .../reference/tsxSpreadAttributesResolution12.errors.txt | 2 ++ .../reference/tsxSpreadAttributesResolution2.errors.txt | 2 ++ .../tsxStatelessFunctionComponentOverload4.errors.txt | 6 ++++++ .../tsxStatelessFunctionComponentOverload5.errors.txt | 5 ++++- ...essFunctionComponentWithDefaultTypeParameter2.errors.txt | 3 ++- ...StatelessFunctionComponentsWithTypeArguments2.errors.txt | 3 +++ .../reference/tsxTypeArgumentResolution.errors.txt | 6 ++++++ tests/baselines/reference/tsxUnionElementType2.errors.txt | 3 ++- tests/baselines/reference/tsxUnionElementType4.errors.txt | 1 + tests/baselines/reference/tsxUnionElementType6.errors.txt | 1 + 19 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5d10a0d55c053..f62f60d00a54f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10161,7 +10161,7 @@ namespace ts { // If for whatever reason the expression type doesn't yield an error, make sure we still issue an error on the sourcePropType checkTypeAssignableTo(sourcePropType, targetPropType, prop, /*headMessage*/ undefined, /*containingChain*/ undefined, resultObj); } - if (resultObj.error && target.symbol && length(target.symbol.declarations)) { + if (resultObj.error) { const reportedDiag = resultObj.error; const propertyName = isTypeUsableAsLateBoundName(nameType) ? getLateBoundNameFromType(nameType) : undefined; const targetProp = propertyName !== undefined ? getPropertyOfType(target, propertyName) : undefined; @@ -10177,9 +10177,9 @@ namespace ts { } } - if (!issuedElaboration) { + if (!issuedElaboration && (length(targetProp && targetProp.declarations) || length(target.symbol && target.symbol.declarations))) { addRelatedInfo(reportedDiag, createDiagnosticForNode( - targetProp && targetProp.declarations ? targetProp.declarations[0] : target.symbol.declarations[0], + targetProp ? targetProp.declarations[0] : target.symbol.declarations[0], Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, propertyName && !(nameType.flags & TypeFlags.UniqueESSymbol) ? unescapeLeadingUnderscores(propertyName) : typeToString(nameType), typeToString(target) diff --git a/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt b/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt index 9ebee71ba406c..6b81ccd77e1b7 100644 --- a/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt +++ b/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt @@ -18,4 +18,5 @@ tests/cases/conformance/jsx/file.tsx(13,54): error TS2322: Type '(a: { x: string let d = a.x} />; // Error - `string` is not assignable to `{x: string}` ~~~~~~~~~~ !!! error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'. -!!! error TS2322: Type 'string' is not assignable to type '{ x: string; }'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type '{ x: string; }'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:13:54: The expected type comes from property 'nextValues' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { initialValues: { x: string; }; nextValues: {}; } & BaseProps<{ x: string; }> & { children?: ReactNode; }' \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt index 7a4e5a74ce227..e4ffa209e6fd2 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt @@ -119,4 +119,5 @@ tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts( !!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. !!! error TS2322: Type 'string | number' is not assignable to type 'number'. !!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! related TS6500 tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts:35:5: The expected type comes from property 'commonMethodDifferentReturnType' which is declared here on type 'I11 | I21' }; \ No newline at end of file diff --git a/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt b/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt index 813263e45e42a..9c9b85fd04d9f 100644 --- a/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt +++ b/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt @@ -41,6 +41,7 @@ tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(22,21): error TS2322: ~~~~~~~~ !!! error TS2322: Type '(p: IntrinsicAttributes & LitProps<"x">) => "y"' is not assignable to type '(x: IntrinsicAttributes & LitProps<"x">) => "x"'. !!! error TS2322: Type '"y"' is not assignable to type '"x"'. +!!! related TS6500 tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx:13:34: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & LitProps<"x">' const argchild = {p => "y"} ~~~~~~~ !!! error TS2322: Type '{ children: (p: IntrinsicAttributes & LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x" | "y">'. diff --git a/tests/baselines/reference/objectLiteralNormalization.errors.txt b/tests/baselines/reference/objectLiteralNormalization.errors.txt index dec1e1b118ddd..3cdda885277eb 100644 --- a/tests/baselines/reference/objectLiteralNormalization.errors.txt +++ b/tests/baselines/reference/objectLiteralNormalization.errors.txt @@ -25,6 +25,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts a1 = { a: 0, b: 0 }; // Error ~ !!! error TS2322: Type 'number' is not assignable to type 'string | undefined'. +!!! related TS6500 tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts:2:47: The expected type comes from property 'b' which is declared here on type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }' a1 = { b: "y" }; // Error ~~ !!! error TS2322: Type '{ b: string; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt b/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt index 14b178e0ef469..ebeaa5384861d 100644 --- a/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt +++ b/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt @@ -16,4 +16,5 @@ tests/cases/conformance/jsx/file.tsx(13,19): error TS2322: Type 'true' is not as // Error let p = ; ~ -!!! error TS2322: Type 'true' is not assignable to type 'false'. \ No newline at end of file +!!! error TS2322: Type 'true' is not assignable to type 'false'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & Prop & { children?: ReactNode; }' \ No newline at end of file diff --git a/tests/baselines/reference/tsxLibraryManagedAttributes.errors.txt b/tests/baselines/reference/tsxLibraryManagedAttributes.errors.txt index 11586fbc767be..c7ed5d0151947 100644 --- a/tests/baselines/reference/tsxLibraryManagedAttributes.errors.txt +++ b/tests/baselines/reference/tsxLibraryManagedAttributes.errors.txt @@ -119,6 +119,7 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(123,49): error TS232 const m = ; // error, wrong type ~~~ !!! error TS2322: Type 'string' is not assignable to type 'number | undefined'. +!!! related TS6500 tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx:75:9: The expected type comes from property 'foo' which is declared here on type 'Defaultize<{}, { foo: number; }>' interface FooProps { foo: string; @@ -159,12 +160,15 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(123,49): error TS232 const u = ; // error, wrong type ~~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx:84:5: The expected type comes from property 'foo' which is declared here on type 'FooProps & InferredPropTypes<{ foo: PropTypeChecker; bar: PropTypeChecker; }>' const v = ; // generic overrides propTypes required-ness, null isn't valid ~~~ !!! error TS2322: Type 'null' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx:84:5: The expected type comes from property 'foo' which is declared here on type 'FooProps & InferredPropTypes<{ foo: PropTypeChecker; bar: PropTypeChecker; }>' const w = ; // error, bar is required ~~~ !!! error TS2322: Type 'null' is not assignable to type 'ReactNode'. +!!! related TS6500 tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx:107:9: The expected type comes from property 'bar' which is declared here on type 'FooProps & InferredPropTypes<{ foo: PropTypeChecker; bar: PropTypeChecker; }>' class JustDefaultPropsWithSpecifiedGeneric extends ReactComponent { static defaultProps = { @@ -179,5 +183,6 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(123,49): error TS232 const z = ; // error, wrong type ~~~ !!! error TS2322: Type 'number' is not assignable to type 'string | undefined'. +!!! related TS6500 tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx:117:9: The expected type comes from property 'foo' which is declared here on type 'Defaultize' const aa = ; \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt b/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt index 7747c893f317c..bda5bb597e0f8 100644 --- a/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt +++ b/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt @@ -27,4 +27,5 @@ tests/cases/conformance/jsx/file.tsx(19,18): error TS2322: Type 'string' is not // Error let x2 = ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'a' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Prop & { children?: ReactNode; }' \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt index 8161575bf8d31..3167f8ae4eb90 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt @@ -26,13 +26,17 @@ tests/cases/conformance/jsx/file.tsx(22,15): error TS2322: Type 'true' is not as let y = ; ~ !!! error TS2322: Type '3' is not assignable to type '2'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & OptionProp & { children?: ReactNode; }' let y1 = ; ~ !!! error TS2322: Type 'string' is not assignable to type '2'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & OptionProp & { children?: ReactNode; }' let y2 = ; ~ !!! error TS2322: Type '3' is not assignable to type '2'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & OptionProp & { children?: ReactNode; }' let y3 = ; ~ !!! error TS2322: Type 'true' is not assignable to type '2'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & OptionProp & { children?: ReactNode; }' \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt index a09f157b600be..36b86e8aaf27c 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt @@ -35,9 +35,11 @@ tests/cases/conformance/jsx/file.tsx(30,11): error TS2322: Type '{ y: true; x: 2 let x = ~ !!! error TS2322: Type 'true' is not assignable to type 'false'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:14:5: The expected type comes from property 'y' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & Prop & { children?: ReactNode; }' let x1 = ~ !!! error TS2322: Type '3' is not assignable to type '2'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:13:5: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & Prop & { children?: ReactNode; }' let x2 = let x3 = ~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt index c1ba099c5cec5..62a3db1de1638 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt @@ -40,8 +40,10 @@ tests/cases/conformance/jsx/file.tsx(21,11): error TS2322: Type '{ X: string; x: let z = ; ~ !!! error TS2322: Type 'true' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }' ~ !!! error TS2322: Type 'true' is not assignable to type '"2"'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'y' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & PoisonedProp & { children?: ReactNode; }' let w = ; ~~~~~~~~ !!! error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'PoisonedProp'. diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt index 848c172859271..9d461f46cc314 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt @@ -39,6 +39,7 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not const c2 = ; // type incompatible; ~~~ !!! error TS2322: Type 'true' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }' const c3 = ; // This is OK becuase all attribute are spread const c4 = ; // extra property; ~~~~~~~~~~ @@ -62,6 +63,7 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not const d2 = ~~~~~~~~~ !!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:22:50: The expected type comes from property 'direction' which is declared here on type 'IntrinsicAttributes & { yy: string; direction?: number; }' declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -71,13 +73,17 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2322: Type 'string' is not const e1 = ~~ !!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:64: The expected type comes from property 'y3' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' const e2 = ~~ !!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' const e3 = ~~ !!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' const e4 = Hi ~~ !!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt index 3e9952fdc5515..d862ad93c8466 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt @@ -85,9 +85,12 @@ tests/cases/conformance/jsx/file.tsx(56,24): error TS2322: Type 'true' is not as const b6 = ; // incorrect type for optional attribute ~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & HyphenProps' const b7 = ; // incorrect type for optional attribute ~~~~~~~~~ !!! error TS2322: Type 'true' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & HyphenProps' const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~~ -!!! error TS2322: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'true' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:17:5: The expected type comes from property 'data-format' which is declared here on type 'IntrinsicAttributes & HyphenProps' \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt index 5d2e066a573f5..8ce6ec6d8ddd0 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentWithDefaultTypeParameter2.errors.txt @@ -16,4 +16,5 @@ tests/cases/conformance/jsx/file.tsx(13,24): error TS2322: Type 'number' is not // Error let i1 = ; ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:4:5: The expected type comes from property 'values' which is declared here on type 'IntrinsicAttributes & MyComponentProp' \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt index 6164f9a77d8a9..742957b66ad4b 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt @@ -18,6 +18,7 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) = let a1 = ; ~~~~~~~~~~~ !!! error TS2322: Type '10' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:53: The expected type comes from property 'ignore-prop' which is declared here on type 'IntrinsicAttributes & { prop: number; "ignore-prop": string; }' } // Error @@ -35,6 +36,7 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) = let o = ~~~~ !!! error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:16:30: The expected type comes from property 'func' which is declared here on type 'IntrinsicAttributes & { func: (arg: number) => void; }' } interface InferParamProp { @@ -50,4 +52,5 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) = !!! error TS2322: Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'. !!! error TS2322: Types of parameters 'val' and 'selectedVal' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:25:5: The expected type comes from property 'selectHandler' which is declared here on type 'IntrinsicAttributes & InferParamProp' \ No newline at end of file diff --git a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt index 054bcf7222ecf..fea0689425c3d 100644 --- a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt @@ -37,10 +37,12 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type 'string' is not x = a={10} b={20} />; // error ~ !!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'b' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Prop & { children?: ReactNode; }' x = a={10} b={20}>; // error ~ !!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:5:5: The expected type comes from property 'b' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Prop & { children?: ReactNode; }' x = a={10} b="hi" />; // error ~~~~~~~~~~ @@ -76,12 +78,14 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type 'string' is not !!! error TS2344: Type 'number' is not assignable to type 'string'. ~ !!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:32:35: The expected type comes from property 'a' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }' x = a={10} b="hi">; // error ~~~~ !!! error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. ~ !!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:32:35: The expected type comes from property 'a' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { children?: ReactNode; }' x = a="hi" b="hi" />; // OK @@ -102,8 +106,10 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type 'string' is not x = a="hi" b="hi" />; // error ~ !!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:51:28: The expected type comes from property 'b' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { b: number; } & { children?: ReactNode; }' x = a="hi" b="hi">; // error ~ !!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:53:28: The expected type comes from property 'b' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { a: string; } & { b: number; } & { children?: ReactNode; }' \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType2.errors.txt b/tests/baselines/reference/tsxUnionElementType2.errors.txt index bb7389b162da7..be9fbecb391cf 100644 --- a/tests/baselines/reference/tsxUnionElementType2.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType2.errors.txt @@ -15,4 +15,5 @@ tests/cases/conformance/jsx/file.tsx(12,10): error TS2322: Type 'string' is not var SFCComp = SFC1 || SFC2; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number | boolean'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number | boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:23: The expected type comes from property 'x' which is declared here on type '(IntrinsicAttributes & { x: number; }) | (IntrinsicAttributes & { x: boolean; })' \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType4.errors.txt b/tests/baselines/reference/tsxUnionElementType4.errors.txt index cda4537b2d727..dcde6f1e9dbad 100644 --- a/tests/baselines/reference/tsxUnionElementType4.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType4.errors.txt @@ -38,6 +38,7 @@ tests/cases/conformance/jsx/file.tsx(34,10): error TS2559: Type '{ prop: true; } let a = ; ~ !!! error TS2322: Type 'true' is not assignable to type 'ReactText'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:36: The expected type comes from property 'x' which is declared here on type '(IntrinsicAttributes & IntrinsicClassAttributes & { x: number; } & { children?: ReactNode; }) | (IntrinsicAttributes & IntrinsicClassAttributes & { x: string; } & { children?: ReactNode; })' let b = ~~~~~~~~~~ !!! error TS2559: Type '{ x: number; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. diff --git a/tests/baselines/reference/tsxUnionElementType6.errors.txt b/tests/baselines/reference/tsxUnionElementType6.errors.txt index 28cbb10fb17cf..0c2c41abb8d1e 100644 --- a/tests/baselines/reference/tsxUnionElementType6.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType6.errors.txt @@ -30,6 +30,7 @@ tests/cases/conformance/jsx/file.tsx(21,10): error TS2322: Type '{ data-prop: tr let b = ; ~ !!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:11:23: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & { x: boolean; }' let c = ; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type '{}' is not assignable to type '{ x: boolean; }'. From 7a344f56f50cb908bd9f1fb39b45678aadc07625 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 2 Jul 2018 17:55:43 -0700 Subject: [PATCH 14/16] Fix nits --- src/compiler/checker.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f62f60d00a54f..eaf3196dca3ae 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10107,6 +10107,10 @@ namespace ts { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain, errorOutputObject); } + /** + * Like `checkTypeAssignableTo`, but if it would issue an error, instead performs structural comparisons of the types using the given expression node to + * attempt to issue more specific errors on, for example, specific object literal properties or tuple members. + */ function checkTypeAssignableToAndOptionallyElaborate(source: Type, target: Type, errorNode: Node | undefined, expr: Expression | undefined, headMessage?: DiagnosticMessage, containingMessageChain?: () => DiagnosticMessageChain | undefined): boolean { if (isTypeAssignableTo(source, target)) return true; if (!elaborateError(expr, source, target)) { @@ -10138,12 +10142,17 @@ namespace ts { return false; } - type ElaborationIterator = IterableIterator<[Node, Expression | undefined, Type]>; + type ElaborationIterator = IterableIterator<{ errorNode: Node, innerExpression: Expression | undefined, nameType: Type }>; + /** + * For every element returned from the iterator, checks that element to issue an error on a property of that element's type + * If that element would issue an error, we first attempt to dive into that element's inner expression and issue a more specific error by recuring into `elaborateError` + * Otherwise, we issue an error on _every_ element which fail the assignability check + */ function elaborateElementwise(iterator: ElaborationIterator, source: Type, target: Type) { // Assignability failure - check each prop individually, and if that fails, fall back on the bad error span let reportedError = false; for (let status = iterator.next(); !status.done; status = iterator.next()) { - const [prop, next, nameType] = status.value; + const { errorNode: prop, innerExpression: next, nameType } = status.value; const sourcePropType = getIndexedAccessType(source, nameType); const targetPropType = getIndexedAccessType(target, nameType); if (!isTypeAssignableTo(sourcePropType, targetPropType)) { @@ -10197,7 +10206,7 @@ namespace ts { if (!length(node.properties)) return; for (const prop of node.properties) { if (isJsxSpreadAttribute(prop)) continue; - yield [prop.name, prop.initializer, getLiteralType(idText(prop.name))]; + yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: getLiteralType(idText(prop.name)) }; } } @@ -10214,7 +10223,7 @@ namespace ts { const elem = node.elements[i]; if (isOmittedExpression(elem)) continue; const nameType = getLiteralType(i); - yield [elem, elem, nameType]; + yield { errorNode: elem, innerExpression: elem, nameType }; } } @@ -10238,10 +10247,10 @@ namespace ts { case SyntaxKind.GetAccessor: case SyntaxKind.MethodDeclaration: case SyntaxKind.ShorthandPropertyAssignment: - yield [prop.name, undefined, type]; + yield { errorNode: prop.name, innerExpression: undefined, nameType: type }; break; case SyntaxKind.PropertyAssignment: - yield [prop.name, prop.initializer, type]; + yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type }; break; default: Debug.assertNever(prop); From dcbf33a7226f32d7176cd1fc9c7c634157614339 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 3 Jul 2018 11:29:52 -0700 Subject: [PATCH 15/16] Add specialized error to elaborations of nonliteral computed named-members --- src/compiler/checker.ts | 10 +++++----- src/compiler/diagnosticMessages.json | 4 ++++ tests/baselines/reference/api/tsserverlibrary.d.ts | 1 + ...computedPropertyNamesContextualType8_ES5.errors.txt | 8 ++++---- ...computedPropertyNamesContextualType8_ES6.errors.txt | 8 ++++---- ...bolAllowsIndexInObjectWithIndexSignature.errors.txt | 4 ++-- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index eaf3196dca3ae..f2c40c4bebf4b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10142,7 +10142,7 @@ namespace ts { return false; } - type ElaborationIterator = IterableIterator<{ errorNode: Node, innerExpression: Expression | undefined, nameType: Type }>; + type ElaborationIterator = IterableIterator<{ errorNode: Node, innerExpression: Expression | undefined, nameType: Type, errorMessage?: DiagnosticMessage | undefined }>; /** * For every element returned from the iterator, checks that element to issue an error on a property of that element's type * If that element would issue an error, we first attempt to dive into that element's inner expression and issue a more specific error by recuring into `elaborateError` @@ -10152,7 +10152,7 @@ namespace ts { // Assignability failure - check each prop individually, and if that fails, fall back on the bad error span let reportedError = false; for (let status = iterator.next(); !status.done; status = iterator.next()) { - const { errorNode: prop, innerExpression: next, nameType } = status.value; + const { errorNode: prop, innerExpression: next, nameType, errorMessage } = status.value; const sourcePropType = getIndexedAccessType(source, nameType); const targetPropType = getIndexedAccessType(target, nameType); if (!isTypeAssignableTo(sourcePropType, targetPropType)) { @@ -10165,10 +10165,10 @@ namespace ts { const resultObj: { error?: Diagnostic } = {}; // Use the expression type, if available const specificSource = next ? checkExpressionForMutableLocation(next, CheckMode.Normal, sourcePropType) : sourcePropType; - const result = checkTypeAssignableTo(specificSource, targetPropType, prop, /*headMessage*/ undefined, /*containingChain*/ undefined, resultObj); + const result = checkTypeAssignableTo(specificSource, targetPropType, prop, errorMessage, /*containingChain*/ undefined, resultObj); if (result && specificSource !== sourcePropType) { // If for whatever reason the expression type doesn't yield an error, make sure we still issue an error on the sourcePropType - checkTypeAssignableTo(sourcePropType, targetPropType, prop, /*headMessage*/ undefined, /*containingChain*/ undefined, resultObj); + checkTypeAssignableTo(sourcePropType, targetPropType, prop, errorMessage, /*containingChain*/ undefined, resultObj); } if (resultObj.error) { const reportedDiag = resultObj.error; @@ -10250,7 +10250,7 @@ namespace ts { yield { errorNode: prop.name, innerExpression: undefined, nameType: type }; break; case SyntaxKind.PropertyAssignment: - yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type }; + yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_value_is_0_which_is_not_assignable_to_type_1 : undefined }; break; default: Debug.assertNever(prop); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index d55db8cf7ea4b..fe2c58037cfec 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1452,6 +1452,10 @@ "category": "Error", "code": 2417 }, + "Type of computed property value is '{0}', which is not assignable to type '{1}'.": { + "category": "Error", + "code": 2418 + }, "Class '{0}' incorrectly implements interface '{1}'.": { "category": "Error", "code": 2420 diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 57299d0b69fae..f93a55a9e73ad 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5182,6 +5182,7 @@ declare namespace ts { Class_0_incorrectly_extends_base_class_1: DiagnosticMessage; Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: DiagnosticMessage; Class_static_side_0_incorrectly_extends_base_class_static_side_1: DiagnosticMessage; + Type_of_computed_property_value_is_0_which_is_not_assignable_to_type_1: DiagnosticMessage; Class_0_incorrectly_implements_interface_1: DiagnosticMessage; A_class_may_only_implement_another_class_or_interface: DiagnosticMessage; Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: DiagnosticMessage; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt index 9d0b2559622f1..01d8564b6c0b2 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(7,5): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(8,5): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(7,5): error TS2418: Type of computed property value is 'string', which is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(8,5): error TS2418: Type of computed property value is 'number', which is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (2 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { [""+"foo"]: "", ~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2418: Type of computed property value is 'string', which is not assignable to type 'boolean'. !!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts:2:5: The expected type comes from this index signature. [""+"bar"]: 0 ~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2418: Type of computed property value is 'number', which is not assignable to type 'boolean'. !!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts:2:5: The expected type comes from this index signature. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt index 533b5f6a95991..1ec9aaa86353c 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(7,5): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(8,5): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(7,5): error TS2418: Type of computed property value is 'string', which is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(8,5): error TS2418: Type of computed property value is 'number', which is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts (2 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { [""+"foo"]: "", ~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2418: Type of computed property value is 'string', which is not assignable to type 'boolean'. !!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts:2:5: The expected type comes from this index signature. [""+"bar"]: 0 ~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2418: Type of computed property value is 'number', which is not assignable to type 'boolean'. !!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts:2:5: The expected type comes from this index signature. } \ No newline at end of file diff --git a/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt b/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt index a7c92816ecdb2..659453006010c 100644 --- a/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt +++ b/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts(10,13): error TS2322: Type '"str"' is not assignable to type '"sym"'. +tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts(10,13): error TS2418: Type of computed property value is '"str"', which is not assignable to type '"sym"'. ==== tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts (1 errors) ==== @@ -13,6 +13,6 @@ tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts(10,13) let a: I = {[SYM]: 'sym'}; // Expect ok let b: I = {[SYM]: 'str'}; // Expect error ~~~~~ -!!! error TS2322: Type '"str"' is not assignable to type '"sym"'. +!!! error TS2418: Type of computed property value is '"str"', which is not assignable to type '"sym"'. !!! related TS6500 tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts:5:3: The expected type comes from property 'unique symbol' which is declared here on type 'I' \ No newline at end of file From ae4681691391543e16d6e4d4edfbd579904833f9 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 3 Jul 2018 18:15:06 -0700 Subject: [PATCH 16/16] Update error message --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 +- .../computedPropertyNamesContextualType8_ES5.errors.txt | 8 ++++---- .../computedPropertyNamesContextualType8_ES6.errors.txt | 8 ++++---- ...SymbolAllowsIndexInObjectWithIndexSignature.errors.txt | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f2c40c4bebf4b..9f56a299df659 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10250,7 +10250,7 @@ namespace ts { yield { errorNode: prop.name, innerExpression: undefined, nameType: type }; break; case SyntaxKind.PropertyAssignment: - yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_value_is_0_which_is_not_assignable_to_type_1 : undefined }; + yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : undefined }; break; default: Debug.assertNever(prop); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index fe2c58037cfec..af27042b17f16 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1452,7 +1452,7 @@ "category": "Error", "code": 2417 }, - "Type of computed property value is '{0}', which is not assignable to type '{1}'.": { + "Type of computed property's value is '{0}', which is not assignable to type '{1}'.": { "category": "Error", "code": 2418 }, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index f93a55a9e73ad..b6d98f589bc90 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5182,7 +5182,7 @@ declare namespace ts { Class_0_incorrectly_extends_base_class_1: DiagnosticMessage; Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: DiagnosticMessage; Class_static_side_0_incorrectly_extends_base_class_static_side_1: DiagnosticMessage; - Type_of_computed_property_value_is_0_which_is_not_assignable_to_type_1: DiagnosticMessage; + Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: DiagnosticMessage; Class_0_incorrectly_implements_interface_1: DiagnosticMessage; A_class_may_only_implement_another_class_or_interface: DiagnosticMessage; Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: DiagnosticMessage; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt index 01d8564b6c0b2..56e374f0d5352 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(7,5): error TS2418: Type of computed property value is 'string', which is not assignable to type 'boolean'. -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(8,5): error TS2418: Type of computed property value is 'number', which is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(7,5): error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (2 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { [""+"foo"]: "", ~~~~~~~~~~ -!!! error TS2418: Type of computed property value is 'string', which is not assignable to type 'boolean'. +!!! error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'. !!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts:2:5: The expected type comes from this index signature. [""+"bar"]: 0 ~~~~~~~~~~ -!!! error TS2418: Type of computed property value is 'number', which is not assignable to type 'boolean'. +!!! error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'. !!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts:2:5: The expected type comes from this index signature. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt index 1ec9aaa86353c..c24b53eaa1709 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(7,5): error TS2418: Type of computed property value is 'string', which is not assignable to type 'boolean'. -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(8,5): error TS2418: Type of computed property value is 'number', which is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(7,5): error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts (2 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { [""+"foo"]: "", ~~~~~~~~~~ -!!! error TS2418: Type of computed property value is 'string', which is not assignable to type 'boolean'. +!!! error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'. !!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts:2:5: The expected type comes from this index signature. [""+"bar"]: 0 ~~~~~~~~~~ -!!! error TS2418: Type of computed property value is 'number', which is not assignable to type 'boolean'. +!!! error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'. !!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts:2:5: The expected type comes from this index signature. } \ No newline at end of file diff --git a/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt b/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt index 659453006010c..a7426f815bee3 100644 --- a/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt +++ b/tests/baselines/reference/uniqueSymbolAllowsIndexInObjectWithIndexSignature.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts(10,13): error TS2418: Type of computed property value is '"str"', which is not assignable to type '"sym"'. +tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts(10,13): error TS2418: Type of computed property's value is '"str"', which is not assignable to type '"sym"'. ==== tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts (1 errors) ==== @@ -13,6 +13,6 @@ tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts(10,13) let a: I = {[SYM]: 'sym'}; // Expect ok let b: I = {[SYM]: 'str'}; // Expect error ~~~~~ -!!! error TS2418: Type of computed property value is '"str"', which is not assignable to type '"sym"'. +!!! error TS2418: Type of computed property's value is '"str"', which is not assignable to type '"sym"'. !!! related TS6500 tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts:5:3: The expected type comes from property 'unique symbol' which is declared here on type 'I' \ No newline at end of file