From a560fd663785f864f83b147ca0a4b248d2cedd64 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 28 Mar 2019 14:56:29 -0700 Subject: [PATCH 1/4] Change the default type parameter constraint and default to unknown from {} --- src/compiler/checker.ts | 40 ++-- ...onWithIncorrectNumberOfTypeArguments.types | 24 +- ...GenericFunctionWithZeroTypeArguments.types | 12 +- ...nalNoInfiniteInstantiationDepth.errors.txt | 144 +++++++++++ ...lySimplifyingConditionalTypesNoCrash.types | 4 +- .../classWithBaseClassButNoConstructor.types | 12 +- .../reference/classWithConstructors.types | 12 +- .../classWithNoConstructorOrBaseClass.types | 4 +- .../reference/conditionalTypes1.types | 4 +- .../constraintSatisfactionWithAny2.types | 2 +- .../contextualSignatureInstantiation2.types | 6 +- ...ypingTwoInstancesOfSameTypeParameter.types | 14 +- .../defaultExportInAwaitExpression01.types | 20 +- .../defaultExportInAwaitExpression02.types | 20 +- ...AnnotationAndInvalidInitializer.errors.txt | 8 +- ...eWithAnnotationAndInvalidInitializer.types | 4 +- .../externalModuleExportingGenericClass.types | 8 +- ...illInMissingTypeArgsOnConstructCalls.types | 4 +- ...ionTypeArgumentAssignmentCompat.errors.txt | 4 +- .../genericCallTypeArgumentInference.types | 28 +-- ...ithConstraintsTypeArgumentInference2.types | 8 +- ...lWithConstructorTypedArguments5.errors.txt | 8 +- ...enericCallWithFunctionTypedArguments.types | 12 +- ...nericCallWithFunctionTypedArguments2.types | 24 +- ...CallWithFunctionTypedArguments5.errors.txt | 6 +- ...ricCallWithGenericSignatureArguments.types | 44 ++-- ...hOverloadedConstructorTypedArguments.types | 20 +- ...oadedConstructorTypedArguments2.errors.txt | 4 +- ...OverloadedConstructorTypedArguments2.types | 12 +- ...WithOverloadedFunctionTypedArguments.types | 20 +- ...erloadedFunctionTypedArguments2.errors.txt | 4 +- ...ithOverloadedFunctionTypedArguments2.types | 12 +- ...lassWithFunctionTypedMemberArguments.types | 12 +- ...enericConstructExpressionWithoutArgs.types | 4 +- tests/baselines/reference/genericDefaults.js | 2 +- .../baselines/reference/genericDefaults.types | 44 ++-- ...CallSignatureReturnTypeMismatch.errors.txt | 4 +- .../reference/genericFunctionInference1.types | 6 +- .../reference/genericFunctionParameters.js | 4 +- .../reference/genericFunctionParameters.types | 8 +- ...ericFunctionsWithOptionalParameters1.types | 8 +- ...ericFunctionsWithOptionalParameters2.types | 6 +- ...genericObjectCreationWithoutTypeArgs.types | 8 +- .../genericRestParameters3.errors.txt | 24 +- .../getAndSetNotIdenticalType2.types | 22 +- .../getAndSetNotIdenticalType3.types | 8 +- .../reference/implicitAnyGenerics.types | 6 +- .../indexSignatureTypeInference.errors.txt | 8 +- .../indexSignatureTypeInference.types | 2 +- .../indexerReturningTypeParameter1.types | 8 +- tests/baselines/reference/inferTypes1.types | 4 +- .../baselines/reference/inferenceLimit.types | 22 +- .../inferentialTypingUsingApparentType3.types | 6 +- ...inferentialTypingWithFunctionTypeZip.types | 8 +- ...heritanceOfGenericConstructorMethod1.types | 4 +- ...heritanceOfGenericConstructorMethod2.types | 4 +- ...ateGenericClassWithZeroTypeArguments.types | 8 +- .../reference/jsxInExtendsClause.types | 2 +- .../reference/keyofAndIndexedAccess.js | 6 +- .../reference/keyofAndIndexedAccess.types | 14 +- .../mappedTypeInferenceErrors.errors.txt | 6 +- .../mappedTypeRecursiveInference.errors.txt | 8 +- ...eLibrary_NoErrorDuplicateLibOptions1.types | 16 +- ...eLibrary_NoErrorDuplicateLibOptions2.types | 16 +- ...dularizeLibrary_TargetES5UsingES6Lib.types | 16 +- .../mutuallyRecursiveCallbacks.errors.txt | 8 +- ...wingGenericTypeFromInstanceof01.errors.txt | 8 +- .../reference/newOperatorConformance.types | 6 +- .../reference/newOperatorErrorCases.types | 6 +- .../objectLiteralContextualTyping.errors.txt | 36 +++ .../objectLiteralContextualTyping.types | 6 +- .../overloadResolutionClassConstructors.types | 6 +- .../parameterReferenceInInitializer1.types | 4 +- ...ivacyCheckAnonymousFunctionParameter.types | 8 +- ...vacyCheckAnonymousFunctionParameter2.types | 2 +- .../reference/promisePermutations.types | 112 ++++----- .../reference/promisePermutations2.types | 112 ++++----- .../reference/promisePermutations3.errors.txt | 8 +- .../reference/promisePermutations3.types | 108 ++++----- ...TypeParameterWithoutConstraints.errors.txt | 40 ++++ ...sOnTypeParameterWithoutConstraints.symbols | 3 - ...essOnTypeParameterWithoutConstraints.types | 14 +- ...ferredInferenceAllowsAssignment.errors.txt | 225 ++++++++++++++++++ .../reference/recursiveBaseCheck3.errors.txt | 4 +- .../reference/recursiveBaseCheck3.types | 4 +- .../reference/recursiveBaseCheck4.errors.txt | 4 +- .../reference/recursiveBaseCheck4.types | 4 +- .../reference/recursiveBaseCheck5.errors.txt | 4 +- .../reference/recursiveBaseCheck5.types | 4 +- .../reference/recursiveBaseCheck6.errors.txt | 4 +- .../reference/recursiveBaseCheck6.types | 4 +- .../reference/restTupleElements1.errors.txt | 8 +- .../returnTypeParameterWithModules.types | 2 +- ...TemplateStringsTypeArgumentInference.types | 72 +++--- ...plateStringsTypeArgumentInferenceES6.types | 72 +++--- .../tsxElementResolution12.errors.txt | 7 +- ...ionComponentsWithTypeArguments2.errors.txt | 8 +- ...ionComponentsWithTypeArguments4.errors.txt | 12 +- .../reference/tsxTypeErrors.errors.txt | 46 ---- tests/baselines/reference/tsxTypeErrors.types | 24 +- .../reference/tupleTypeInference2.types | 4 +- .../reference/typeArgumentInference.types | 36 +-- ...ArgumentInferenceConstructSignatures.types | 36 +-- ...ntInferenceWithClassExpression2.errors.txt | 4 +- ...typeArgumentInferenceWithConstraints.types | 12 +- .../reference/typeInferenceFixEarly.types | 6 +- .../reference/typeOfThisInStaticMembers.types | 4 +- .../reference/underscoreTest1.errors.txt | 10 +- .../baselines/reference/underscoreTest1.types | 8 +- .../useObjectValuesAndEntries1.types | 24 +- .../reference/usePromiseFinally.types | 14 +- .../fourslash/automaticConstructorToggling.ts | 4 +- tests/cases/fourslash/constructorQuickInfo.ts | 4 +- tests/cases/fourslash/genericCombinators2.ts | 4 +- ...genericDerivedTypeAcrossModuleBoundary1.ts | 2 +- .../genericFunctionSignatureHelp1.ts | 2 +- .../genericFunctionSignatureHelp2.ts | 2 +- .../genericFunctionSignatureHelp3.ts | 10 +- .../genericFunctionSignatureHelp3MultiFile.ts | 10 +- ...ParametershasInstantiatedSignatureHelp.tsx | 2 +- ...Info_errorSignatureFillsInTypeParameter.ts | 2 +- .../shims-pp/getQuickInfoAtPosition.ts | 4 +- .../fourslash/shims/getQuickInfoAtPosition.ts | 4 +- .../signatureHelpExplicitTypeArguments.ts | 4 +- .../signatureHelpInCompleteGenericsCall.ts | 2 +- .../signatureHelpOnTypePredicates.ts | 2 +- .../fourslash/signatureHelpWithTriggers02.ts | 2 +- .../fourslash/staticGenericOverloads1.ts | 2 +- 128 files changed, 1238 insertions(+), 849 deletions(-) create mode 100644 tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt create mode 100644 tests/baselines/reference/objectLiteralContextualTyping.errors.txt create mode 100644 tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.errors.txt create mode 100644 tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt delete mode 100644 tests/baselines/reference/tsxTypeErrors.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 98a459b6ccd3d..f903e48c64463 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7325,7 +7325,7 @@ namespace ts { const declaredType = getTypeFromMappedTypeNode(type.declaration); const constraint = getConstraintTypeFromMappedType(declaredType); const extendedConstraint = constraint && constraint.flags & TypeFlags.TypeParameter ? getConstraintOfTypeParameter(constraint) : constraint; - type.modifiersType = extendedConstraint && extendedConstraint.flags & TypeFlags.Index ? instantiateType((extendedConstraint).type, type.mapper || identityMapper) : emptyObjectType; + type.modifiersType = extendedConstraint && extendedConstraint.flags & TypeFlags.Index ? instantiateType((extendedConstraint).type, type.mapper || identityMapper) : unknownType; } } return type.modifiersType; @@ -7768,7 +7768,7 @@ namespace ts { * type itself. Note that the apparent type of a union type is the union type itself. */ function getApparentType(type: Type): Type { - const t = type.flags & TypeFlags.Instantiable ? getBaseConstraintOfType(type) || emptyObjectType : type; + const t = type.flags & TypeFlags.Instantiable ? getBaseConstraintOfType(type) || (strictNullChecks ? unknownType : emptyObjectType) : type; return getObjectFlags(t) & ObjectFlags.Mapped ? getApparentTypeOfMappedType(t) : t.flags & TypeFlags.Intersection ? getApparentTypeOfIntersectionType(t) : t.flags & TypeFlags.StringLike ? globalStringType : @@ -8101,7 +8101,7 @@ namespace ts { const baseDefaultType = getDefaultTypeArgumentType(isJavaScriptImplicitAny); for (let i = numTypeArguments; i < numTypeParameters; i++) { let defaultType = getDefaultFromTypeParameter(typeParameters![i]); - if (isJavaScriptImplicitAny && defaultType && isTypeIdenticalTo(defaultType, emptyObjectType)) { + if (isJavaScriptImplicitAny && defaultType && (isTypeIdenticalTo(defaultType, unknownType) || isTypeIdenticalTo(defaultType, emptyObjectType))) { defaultType = anyType; } result[i] = defaultType ? instantiateType(defaultType, createTypeMapper(typeParameters!, result)) : baseDefaultType; @@ -8480,7 +8480,7 @@ namespace ts { const typeParameters = signature.typeParameters; if (typeParameters) { const typeEraser = createTypeEraser(typeParameters); - const baseConstraints = map(typeParameters, tp => instantiateType(getBaseConstraintOfType(tp), typeEraser) || emptyObjectType); + const baseConstraints = map(typeParameters, tp => instantiateType(getBaseConstraintOfType(tp), typeEraser) || unknownType); return instantiateSignature(signature, createTypeMapper(typeParameters, baseConstraints), /*eraseTypeParameters*/ true); } return signature; @@ -10794,7 +10794,7 @@ namespace ts { * This is used during inference when instantiating type parameter defaults. */ function createBackreferenceMapper(context: InferenceContext, index: number): TypeMapper { - return t => findIndex(context.inferences, info => info.typeParameter === t) >= index ? emptyObjectType : t; + return t => findIndex(context.inferences, info => info.typeParameter === t) >= index ? unknownType : t; } function combineTypeMappers(mapper1: TypeMapper | undefined, mapper2: TypeMapper): TypeMapper; @@ -11341,7 +11341,7 @@ namespace ts { function isTypeDerivedFrom(source: Type, target: Type): boolean { return source.flags & TypeFlags.Union ? every((source).types, t => isTypeDerivedFrom(t, target)) : target.flags & TypeFlags.Union ? some((target).types, t => isTypeDerivedFrom(source, t)) : - source.flags & TypeFlags.InstantiableNonPrimitive ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : + source.flags & TypeFlags.InstantiableNonPrimitive ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (TypeFlags.Object | TypeFlags.NonPrimitive)) : target === globalFunctionType ? !!(source.flags & TypeFlags.Object) && isFunctionObjectType(source as ObjectType) : hasBaseType(source, getTargetType(target)); @@ -14539,7 +14539,7 @@ namespace ts { function getTypeFromInference(inference: InferenceInfo) { return inference.candidates ? getUnionType(inference.candidates, UnionReduction.Subtype) : inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : - emptyObjectType; + unknownType; } function inferTypes(inferences: InferenceInfo[], originalSource: Type, originalTarget: Type, priority: InferencePriority = 0, contravariant = false) { @@ -15097,7 +15097,7 @@ namespace ts { } function getDefaultTypeArgumentType(isInJavaScriptFile: boolean): Type { - return isInJavaScriptFile ? anyType : emptyObjectType; + return isInJavaScriptFile ? anyType : unknownType; } function getInferredTypes(context: InferenceContext): Type[] { @@ -15441,7 +15441,7 @@ namespace ts { return strictNullChecks ? TypeFacts.ObjectStrictFacts : TypeFacts.ObjectFacts; } if (flags & TypeFlags.Instantiable) { - return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); + return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & TypeFlags.UnionOrIntersection) { return getTypeFactsOfTypes((type).types); @@ -16752,7 +16752,7 @@ namespace ts { } function typeHasNullableConstraint(type: Type) { - return type.flags & TypeFlags.InstantiableNonPrimitive && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, TypeFlags.Nullable); + return type.flags & TypeFlags.InstantiableNonPrimitive && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, TypeFlags.Nullable); } function getConstraintForLocation(type: Type, node: Node): Type; @@ -18194,7 +18194,7 @@ namespace ts { } function getJsxPropsTypeFromCallSignature(sig: Signature, context: JsxOpeningLikeElement) { - let propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, emptyObjectType); + let propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType); propsType = getJsxManagedAttributesFromLocatedAttributes(context, getJsxNamespaceAt(context), propsType); const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context); if (intrinsicAttribs !== errorType) { @@ -18268,7 +18268,7 @@ namespace ts { const forcedLookupLocation = getJsxElementPropertiesName(ns); let attributesType = forcedLookupLocation === undefined // If there is no type ElementAttributesProperty, return the type of the first parameter of the signature, which should be the props type - ? getTypeOfFirstParameterOfSignatureWithFallback(sig, emptyObjectType) + ? getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType) : forcedLookupLocation === "" // If there is no e.g. 'props' member in ElementAttributesProperty, use the element class type instead ? getReturnTypeOfSignature(sig) @@ -18280,7 +18280,7 @@ namespace ts { if (!!forcedLookupLocation && !!length(context.attributes.properties)) { error(context, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, unescapeLeadingUnderscores(forcedLookupLocation)); } - return emptyObjectType; + return unknownType; } attributesType = getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType); @@ -21986,7 +21986,7 @@ namespace ts { const decl = parameter.valueDeclaration as ParameterDeclaration; if (decl.name.kind !== SyntaxKind.Identifier) { // if inference didn't come up with anything but {}, fall back to the binding pattern if present. - if (links.type === emptyObjectType) { + if (links.type === unknownType) { links.type = getTypeFromBindingPattern(decl.name); } assignBindingElementTypes(decl.name); @@ -21999,11 +21999,11 @@ namespace ts { const globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = getAwaitedType(promisedType) || emptyObjectType; + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseType, [promisedType]); } - return emptyObjectType; + return unknownType; } function createPromiseLikeType(promisedType: Type): Type { @@ -22011,16 +22011,16 @@ namespace ts { const globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true); if (globalPromiseLikeType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = getAwaitedType(promisedType) || emptyObjectType; + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseLikeType, [promisedType]); } - return emptyObjectType; + return unknownType; } function createPromiseReturnType(func: FunctionLikeDeclaration | ImportCall, promisedType: Type) { const promiseType = createPromiseType(promisedType); - if (promiseType === emptyObjectType) { + if (promiseType === unknownType) { error(func, isImportCall(func) ? Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option); @@ -23453,7 +23453,7 @@ namespace ts { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. - const constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; + const constraint = getBaseConstraintOfType(contextualType) || unknownType; return maybeTypeOfKind(constraint, TypeFlags.String) && maybeTypeOfKind(candidateType, TypeFlags.StringLiteral) || maybeTypeOfKind(constraint, TypeFlags.Number) && maybeTypeOfKind(candidateType, TypeFlags.NumberLiteral) || maybeTypeOfKind(constraint, TypeFlags.BigInt) && maybeTypeOfKind(candidateType, TypeFlags.BigIntLiteral) || diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types index 992b8f30ba356..9d5d0e19ebb64 100644 --- a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types @@ -136,24 +136,24 @@ class C2 { } } var r6 = (new C2()).f(1, ''); ->r6 : {} ->(new C2()).f(1, '') : {} ->(new C2()).f : (x: {}, y: {}) => {} ->(new C2()) : C2<{}, {}> ->new C2() : C2<{}, {}> +>r6 : unknown +>(new C2()).f(1, '') : unknown +>(new C2()).f : (x: unknown, y: unknown) => unknown +>(new C2()) : C2 +>new C2() : C2 >C2 : typeof C2 ->f : (x: {}, y: {}) => {} +>f : (x: unknown, y: unknown) => unknown >1 : 1 >'' : "" var r6b = (new C2()).f(1, ''); ->r6b : {} ->(new C2()).f(1, '') : {} ->(new C2()).f : (x: {}, y: {}) => {} ->(new C2()) : C2<{}, {}> ->new C2() : C2<{}, {}> +>r6b : unknown +>(new C2()).f(1, '') : unknown +>(new C2()).f : (x: unknown, y: unknown) => unknown +>(new C2()) : C2 +>new C2() : C2 >C2 : typeof C2 ->f : (x: {}, y: {}) => {} +>f : (x: unknown, y: unknown) => unknown >1 : 1 >'' : "" diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types index 63798c4225d4f..2828694d9fa36 100644 --- a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types @@ -83,13 +83,13 @@ class C2 { } } var r6 = (new C2()).f(1); ->r6 : {} ->(new C2()).f(1) : {} ->(new C2()).f : (x: {}) => {} ->(new C2()) : C2<{}> ->new C2() : C2<{}> +>r6 : unknown +>(new C2()).f(1) : unknown +>(new C2()).f : (x: unknown) => unknown +>(new C2()) : C2 +>new C2() : C2 >C2 : typeof C2 ->f : (x: {}) => {} +>f : (x: unknown) => unknown >1 : 1 interface I2 { diff --git a/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt b/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt new file mode 100644 index 0000000000000..69ea8e1afd245 --- /dev/null +++ b/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt @@ -0,0 +1,144 @@ +tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.ts(63,84): error TS2344: Type 'GetProps' does not satisfy the constraint 'Shared>'. + Type 'unknown' is not assignable to type 'Shared>'. + Type 'Matching>' is not assignable to type 'Shared>'. + Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[P] | (TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + + +==== tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.ts (1 errors) ==== + declare class Component

{ + constructor(props: Readonly

); + constructor(props: P, context?: any); + readonly props: Readonly

& Readonly<{ children?: {} }>; + } + interface ComponentClass

{ + new (props: P, context?: any): Component

; + propTypes?: WeakValidationMap

; + defaultProps?: Partial

; + displayName?: string; + } + interface FunctionComponent

{ + (props: P & { children?: {} }, context?: any): {} | null; + propTypes?: WeakValidationMap

; + defaultProps?: Partial

; + displayName?: string; + } + + export declare const nominalTypeHack: unique symbol; + export interface Validator { + (props: object, propName: string, componentName: string, location: string, propFullName: string): Error | null; + [nominalTypeHack]?: T; + } + type WeakValidationMap = { + [K in keyof T]?: null extends T[K] + ? Validator + : undefined extends T[K] + ? Validator + : Validator + }; + type ComponentType

= ComponentClass

| FunctionComponent

; + + export type Shared< + InjectedProps, + DecorationTargetProps extends Shared + > = { + [P in Extract]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never; + }; + + // Infers prop type from component C + export type GetProps = C extends ComponentType ? P : never; + + export type ConnectedComponentClass< + C extends ComponentType, + P + > = ComponentClass

& { + WrappedComponent: C; + }; + + export type Matching = { + [P in keyof DecorationTargetProps]: P extends keyof InjectedProps + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; + }; + + export type Omit = Pick>; + + export type InferableComponentEnhancerWithProps = + >>>( + component: C + ) => ConnectedComponentClass, keyof Shared>> & TNeedsProps>; + ~~~~~~~~~~~ +!!! error TS2344: Type 'GetProps' does not satisfy the constraint 'Shared>'. +!!! error TS2344: Type 'unknown' is not assignable to type 'Shared>'. +!!! error TS2344: Type 'Matching>' is not assignable to type 'Shared>'. +!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[P] | (TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + \ No newline at end of file diff --git a/tests/baselines/reference/circularlySimplifyingConditionalTypesNoCrash.types b/tests/baselines/reference/circularlySimplifyingConditionalTypesNoCrash.types index 4a3a1fdbe53aa..ab58c85568c79 100644 --- a/tests/baselines/reference/circularlySimplifyingConditionalTypesNoCrash.types +++ b/tests/baselines/reference/circularlySimplifyingConditionalTypesNoCrash.types @@ -56,7 +56,7 @@ declare var connect: Connect; const myStoreConnect: Connect = function( >myStoreConnect : Connect ->function( mapStateToProps?: any, mapDispatchToProps?: any, mergeProps?: any, options: unknown = {},) { return connect( mapStateToProps, mapDispatchToProps, mergeProps, options, );} : (mapStateToProps?: any, mapDispatchToProps?: any, mergeProps?: any, options?: unknown) => InferableComponentEnhancerWithProps<{}, {}> +>function( mapStateToProps?: any, mapDispatchToProps?: any, mergeProps?: any, options: unknown = {},) { return connect( mapStateToProps, mapDispatchToProps, mergeProps, options, );} : (mapStateToProps?: any, mapDispatchToProps?: any, mergeProps?: any, options?: unknown) => InferableComponentEnhancerWithProps mapStateToProps?: any, >mapStateToProps : any @@ -73,7 +73,7 @@ const myStoreConnect: Connect = function( ) { return connect( ->connect( mapStateToProps, mapDispatchToProps, mergeProps, options, ) : InferableComponentEnhancerWithProps<{}, {}> +>connect( mapStateToProps, mapDispatchToProps, mergeProps, options, ) : InferableComponentEnhancerWithProps >connect : Connect mapStateToProps, diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.types b/tests/baselines/reference/classWithBaseClassButNoConstructor.types index 416e195f5b2a8..1b8aa28818441 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.types +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.types @@ -54,8 +54,8 @@ var d = new D(); // error >D : typeof D var d2 = new D(1); // ok ->d2 : D ->new D(1) : D +>d2 : D +>new D(1) : D >D : typeof D >1 : 1 @@ -78,8 +78,8 @@ var d3 = new D(); // error >D : typeof D var d4 = new D(1); // ok ->d4 : D ->new D(1) : D +>d4 : D +>new D(1) : D >D : typeof D >1 : 1 @@ -101,8 +101,8 @@ var d5 = new D(); // error >D : typeof D var d6 = new D(1); // ok ->d6 : D ->new D(1) : D +>d6 : D +>new D(1) : D >D : typeof D >1 : 1 diff --git a/tests/baselines/reference/classWithConstructors.types b/tests/baselines/reference/classWithConstructors.types index db2d88969bf33..07a5be543eb8c 100644 --- a/tests/baselines/reference/classWithConstructors.types +++ b/tests/baselines/reference/classWithConstructors.types @@ -113,8 +113,8 @@ module Generics { >C2 : typeof C2 var c4 = new C2(''); // ok ->c4 : C2 ->new C2('') : C2 +>c4 : C2 +>new C2('') : C2 >C2 : typeof C2 >'' : "" @@ -135,14 +135,14 @@ module Generics { >D : typeof D var d2 = new D(1); // ok ->d2 : D ->new D(1) : D +>d2 : D +>new D(1) : D >D : typeof D >1 : 1 var d3 = new D(''); // ok ->d3 : D ->new D('') : D +>d3 : D +>new D('') : D >D : typeof D >'' : "" } diff --git a/tests/baselines/reference/classWithNoConstructorOrBaseClass.types b/tests/baselines/reference/classWithNoConstructorOrBaseClass.types index 21b0642652c90..6ad0a5357b29a 100644 --- a/tests/baselines/reference/classWithNoConstructorOrBaseClass.types +++ b/tests/baselines/reference/classWithNoConstructorOrBaseClass.types @@ -26,8 +26,8 @@ class D { } var d = new D(); ->d : D<{}, {}> ->new D() : D<{}, {}> +>d : D +>new D() : D >D : typeof D var d2 = new D(); diff --git a/tests/baselines/reference/conditionalTypes1.types b/tests/baselines/reference/conditionalTypes1.types index 125324d60d44a..bc70e68f0caf2 100644 --- a/tests/baselines/reference/conditionalTypes1.types +++ b/tests/baselines/reference/conditionalTypes1.types @@ -673,8 +673,8 @@ function f22(x: T extends (infer U)[] ? U[] : never) { >x : T extends (infer U)[] ? U[] : never let e = x[0]; // {} ->e : {} ->x[0] : {} +>e : unknown +>x[0] : unknown >x : T extends (infer U)[] ? U[] : never >0 : 0 } diff --git a/tests/baselines/reference/constraintSatisfactionWithAny2.types b/tests/baselines/reference/constraintSatisfactionWithAny2.types index 78505b6bbb817..751f88b81ebf5 100644 --- a/tests/baselines/reference/constraintSatisfactionWithAny2.types +++ b/tests/baselines/reference/constraintSatisfactionWithAny2.types @@ -11,7 +11,7 @@ var a: any; >a : any foo(a); ->foo(a) : {} +>foo(a) : unknown >foo : (x: U) => Z>(y: T) => Z >a : any diff --git a/tests/baselines/reference/contextualSignatureInstantiation2.types b/tests/baselines/reference/contextualSignatureInstantiation2.types index 44776b5c01e4d..1b97094ed4af6 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation2.types +++ b/tests/baselines/reference/contextualSignatureInstantiation2.types @@ -31,9 +31,9 @@ var id: (x:T) => T; >x : T var r23 = dot(id)(id); ->r23 : (_: T) => {} ->dot(id)(id) : (_: T) => {} ->dot(id) : (g: (_: U) => {}) => (_: U) => {} +>r23 : (_: T) => unknown +>dot(id)(id) : (_: T) => unknown +>dot(id) : (g: (_: U) => unknown) => (_: U) => unknown >dot : (f: (_: T) => S) => (g: (_: U) => T) => (_: U) => S >id : (x: T) => T >id : (x: T) => T diff --git a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types index 4f1d28c39d4de..a25bd5eb3a8bb 100644 --- a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types +++ b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types @@ -10,13 +10,13 @@ function f6(x: (a: T) => T) { f6(x => f6(y => x = y)); >f6(x => f6(y => x = y)) : any >f6 : (x: (a: T) => T) => any ->x => f6(y => x = y) : (x: {}) => any ->x : {} +>x => f6(y => x = y) : (x: unknown) => any +>x : unknown >f6(y => x = y) : any >f6 : (x: (a: T) => T) => any ->y => x = y : (y: {}) => {} ->y : {} ->x = y : {} ->x : {} ->y : {} +>y => x = y : (y: unknown) => unknown +>y : unknown +>x = y : unknown +>x : unknown +>y : unknown diff --git a/tests/baselines/reference/defaultExportInAwaitExpression01.types b/tests/baselines/reference/defaultExportInAwaitExpression01.types index 1f7de76b90eae..5c8620ae1dc35 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression01.types +++ b/tests/baselines/reference/defaultExportInAwaitExpression01.types @@ -1,21 +1,21 @@ === tests/cases/conformance/es6/modules/a.ts === const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); ->x : Promise<{}> ->new Promise( ( resolve, reject ) => { resolve( {} ); } ) : Promise<{}> +>x : Promise +>new Promise( ( resolve, reject ) => { resolve( {} ); } ) : Promise >Promise : PromiseConstructor ->( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: unknown) => void, reject: (reason?: any) => void) => void +>resolve : (value?: unknown) => void >reject : (reason?: any) => void >resolve( {} ) : void ->resolve : (value?: {} | PromiseLike<{}>) => void +>resolve : (value?: unknown) => void >{} : {} export default x; ->x : Promise<{}> +>x : Promise === tests/cases/conformance/es6/modules/b.ts === import x from './a'; ->x : Promise<{}> +>x : Promise ( async function() { >( async function() { const value = await x;}() ) : Promise @@ -23,9 +23,9 @@ import x from './a'; >async function() { const value = await x;} : () => Promise const value = await x; ->value : {} ->await x : {} ->x : Promise<{}> +>value : unknown +>await x : unknown +>x : Promise }() ); diff --git a/tests/baselines/reference/defaultExportInAwaitExpression02.types b/tests/baselines/reference/defaultExportInAwaitExpression02.types index 1f7de76b90eae..5c8620ae1dc35 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression02.types +++ b/tests/baselines/reference/defaultExportInAwaitExpression02.types @@ -1,21 +1,21 @@ === tests/cases/conformance/es6/modules/a.ts === const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); ->x : Promise<{}> ->new Promise( ( resolve, reject ) => { resolve( {} ); } ) : Promise<{}> +>x : Promise +>new Promise( ( resolve, reject ) => { resolve( {} ); } ) : Promise >Promise : PromiseConstructor ->( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: unknown) => void, reject: (reason?: any) => void) => void +>resolve : (value?: unknown) => void >reject : (reason?: any) => void >resolve( {} ) : void ->resolve : (value?: {} | PromiseLike<{}>) => void +>resolve : (value?: unknown) => void >{} : {} export default x; ->x : Promise<{}> +>x : Promise === tests/cases/conformance/es6/modules/b.ts === import x from './a'; ->x : Promise<{}> +>x : Promise ( async function() { >( async function() { const value = await x;}() ) : Promise @@ -23,9 +23,9 @@ import x from './a'; >async function() { const value = await x;} : () => Promise const value = await x; ->value : {} ->await x : {} ->x : Promise<{}> +>value : unknown +>await x : unknown +>x : Promise }() ); diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 31b834ba86343..d052166905e38 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -2,8 +2,8 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2322: Type '9.9' is not assignable to type 'string'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type '9.9' is not assignable to type 'Date'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2322: Type '9.9' is not assignable to type 'void'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2741: Property 'id' is missing in type 'D<{}>' but required in type 'I'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(41,5): error TS2741: Property 'id' is missing in type 'D<{}>' but required in type 'C'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2741: Property 'id' is missing in type 'D' but required in type 'I'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(41,5): error TS2741: Property 'id' is missing in type 'D' but required in type 'C'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(42,5): error TS2739: Type 'C' is missing the following properties from type 'D': source, recurse, wrapped 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; }'. @@ -75,11 +75,11 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd var anInterface: I = new D(); ~~~~~~~~~~~ -!!! error TS2741: Property 'id' is missing in type 'D<{}>' but required in type 'I'. +!!! error TS2741: Property 'id' is missing in type 'D' but required in type 'I'. !!! related TS2728 tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts:2:5: 'id' is declared here. var aClass: C = new D(); ~~~~~~ -!!! error TS2741: Property 'id' is missing in type 'D<{}>' but required in type 'C'. +!!! error TS2741: Property 'id' is missing in type 'D' but required in type 'C'. !!! related TS2728 tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts:6:5: 'id' is declared here. var aGenericClass: D = new C(); ~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.types b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.types index 7141a6738d465..f1fab1ab39057 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.types +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.types @@ -92,12 +92,12 @@ var aVoid: void = 9.9; var anInterface: I = new D(); >anInterface : I ->new D() : D<{}> +>new D() : D >D : typeof D var aClass: C = new D(); >aClass : C ->new D() : D<{}> +>new D() : D >D : typeof D var aGenericClass: D = new C(); diff --git a/tests/baselines/reference/externalModuleExportingGenericClass.types b/tests/baselines/reference/externalModuleExportingGenericClass.types index 6e85b06145855..a6820981012b8 100644 --- a/tests/baselines/reference/externalModuleExportingGenericClass.types +++ b/tests/baselines/reference/externalModuleExportingGenericClass.types @@ -7,11 +7,11 @@ var v: a; // this should report error var v2: any = (new a()).foo; >v2 : any ->(new a()).foo : {} ->(new a()) : a<{}> ->new a() : a<{}> +>(new a()).foo : unknown +>(new a()) : a +>new a() : a >a : typeof a ->foo : {} +>foo : unknown var v3: number = (new a()).foo; >v3 : number diff --git a/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.types b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.types index 7a5f49d638f61..b98b8a30e477b 100644 --- a/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.types +++ b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.types @@ -6,7 +6,7 @@ class A{ >list : T } var a = new A(); ->a : A<{}> ->new A() : A<{}> +>a : A +>new A() : A >A : typeof A diff --git a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt index def0ff8811e71..33d06763bbea2 100644 --- a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt +++ b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts(9,1): error TS2322: Type '() => S[]' is not assignable to type '(x: T) => T'. - Type '{}[]' is not assignable to type 'T'. + Type 'unknown[]' is not assignable to type 'T'. ==== tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts (1 errors) ==== @@ -14,7 +14,7 @@ tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts(9,1): error TS2322: f = g; ~ !!! error TS2322: Type '() => S[]' is not assignable to type '(x: T) => T'. -!!! error TS2322: Type '{}[]' is not assignable to type 'T'. +!!! error TS2322: Type 'unknown[]' is not assignable to type 'T'. var s = f("str").toUpperCase(); console.log(s); diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.types b/tests/baselines/reference/genericCallTypeArgumentInference.types index 36707a7da4d83..0cd6e21427307 100644 --- a/tests/baselines/reference/genericCallTypeArgumentInference.types +++ b/tests/baselines/reference/genericCallTypeArgumentInference.types @@ -43,8 +43,8 @@ var r2 = foo2('', 1); // number >1 : 1 var r3 = foo2b(1); // {} ->r3 : {} ->foo2b(1) : {} +>r3 : unknown +>foo2b(1) : unknown >foo2b : (u: U) => T >1 : 1 @@ -186,23 +186,23 @@ var r8 = c.foo5(true, 1); // boolean >1 : 1 var r9 = c.foo6(); // {} ->r9 : {} ->c.foo6() : {} +>r9 : unknown +>c.foo6() : unknown >c.foo6 : () => T >c : C >foo6 : () => T var r10 = c.foo7(''); // {} ->r10 : {} ->c.foo7('') : {} +>r10 : unknown +>c.foo7('') : unknown >c.foo7 : (u: U) => T >c : C >foo7 : (u: U) => T >'' : "" var r11 = c.foo8(); // {} ->r11 : {} ->c.foo8() : {} +>r11 : unknown +>c.foo8() : unknown >c.foo8 : () => T >c : C >foo8 : () => T @@ -297,23 +297,23 @@ var r8 = i.foo5(true, 1); // boolean >1 : 1 var r9 = i.foo6(); // {} ->r9 : {} ->i.foo6() : {} +>r9 : unknown +>i.foo6() : unknown >i.foo6 : () => T >i : I >foo6 : () => T var r10 = i.foo7(''); // {} ->r10 : {} ->i.foo7('') : {} +>r10 : unknown +>i.foo7('') : unknown >i.foo7 : (u: U) => T >i : I >foo7 : (u: U) => T >'' : "" var r11 = i.foo8(); // {} ->r11 : {} ->i.foo8() : {} +>r11 : unknown +>i.foo8() : unknown >i.foo8 : () => T >i : I >foo8 : () => T diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types index cfd9e24182bec..0020f4fbaf5c4 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types @@ -19,14 +19,14 @@ var r = foo(1); // ok >1 : 1 var r2 = foo(null); // {} ->r2 : {} ->foo(null) : {} +>r2 : unknown +>foo(null) : unknown >foo : (t: T) => U >null : null var r3 = foo(new Object()); // {} ->r3 : {} ->foo(new Object()) : {} +>r3 : Object +>foo(new Object()) : Object >foo : (t: T) => U >new Object() : Object >Object : ObjectConstructor diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt index 4aa29b1e0502b..fe2d76b23de89 100644 --- a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: {}) => string; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'. Types of property 'cb' are incompatible. - Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: {}) => string'. + Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(13,14): error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. Types of property 'cb' are incompatible. Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'. @@ -19,9 +19,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithCon var arg2: { cb: new (x: T, y: T) => string }; var r2 = foo(arg2); // error ~~~~ -!!! error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: {}) => string; }'. +!!! error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'. !!! error TS2345: Types of property 'cb' are incompatible. -!!! error TS2345: Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: {}) => string'. +!!! error TS2345: Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'. var arg3: { cb: new (x: string, y: number) => string }; var r3 = foo(arg3); // error ~~~~ diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments.types index 32a10d3cad40a..0297af07b23cd 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.types @@ -14,8 +14,8 @@ function foo(x: (a: T) => T) { } var r = foo((x: U) => ''); // {} ->r : {} ->foo((x: U) => '') : {} +>r : unknown +>foo((x: U) => '') : unknown >foo : (x: (a: T) => T) => T >(x: U) => '' : (x: U) => string >x : U @@ -30,11 +30,11 @@ var r2 = foo((x: U) => ''); // string >'' : "" var r3 = foo(x => ''); // {} ->r3 : {} ->foo(x => '') : {} +>r3 : unknown +>foo(x => '') : unknown >foo : (x: (a: T) => T) => T ->x => '' : (x: {}) => string ->x : {} +>x => '' : (x: unknown) => string +>x : unknown >'' : "" function foo2(x: T, cb: (a: T) => U) { diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types index 43391dd7cc6e4..1cd9e7ccd111f 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types @@ -35,8 +35,8 @@ var a: { } var r = foo(i); // any ->r : {} ->foo(i) : {} +>r : unknown +>foo(i) : unknown >foo : (x: new (a: T) => T) => T >i : I @@ -53,8 +53,8 @@ var r3 = foo(i2); // string >i2 : I2 var r3b = foo(a); // any ->r3b : {} ->foo(a) : {} +>r3b : unknown +>foo(a) : unknown >foo : (x: new (a: T) => T) => T >a : new (x: T) => T @@ -78,15 +78,15 @@ var r4 = foo2(1, i2); // error >i2 : I2 var r4b = foo2(1, a); // any ->r4b : {} ->foo2(1, a) : {} +>r4b : unknown +>foo2(1, a) : unknown >foo2 : (x: T, cb: new (a: T) => U) => U >1 : 1 >a : new (x: T) => T var r5 = foo2(1, i); // any ->r5 : {} ->foo2(1, i) : {} +>r5 : unknown +>foo2(1, i) : unknown >foo2 : (x: T, cb: new (a: T) => U) => U >1 : 1 >i : I @@ -112,16 +112,16 @@ function foo3(x: T, cb: new(a: T) => U, y: U) { } var r7 = foo3(null, i, ''); // any ->r7 : {} ->foo3(null, i, '') : {} +>r7 : unknown +>foo3(null, i, '') : unknown >foo3 : (x: T, cb: new (a: T) => U, y: U) => U >null : null >i : I >'' : "" var r7b = foo3(null, a, ''); // any ->r7b : {} ->foo3(null, a, '') : {} +>r7b : unknown +>foo3(null, a, '') : unknown >foo3 : (x: T, cb: new (a: T) => U, y: U) => U >null : null >a : new (x: T) => T diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt index ee15ac0597c4b..9af10d79a7d3d 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,16): error TS2322: Type '(x: T, y: T) => string' is not assignable to type '(t: {}) => string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,16): error TS2322: Type '(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(11,16): error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. @@ -14,8 +14,8 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun // more args not allowed var r2 = foo({ cb: (x: T, y: T) => '' }); // error ~~ -!!! error TS2322: Type '(x: T, y: T) => string' is not assignable to type '(t: {}) => string'. -!!! related TS6500 tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: {}) => string; }' +!!! error TS2322: Type '(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'. +!!! related TS6500 tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: unknown) => string; }' var r3 = foo({ cb: (x: string, y: number) => '' }); // error ~~ !!! error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments.types b/tests/baselines/reference/genericCallWithGenericSignatureArguments.types index 21649aef5495b..af5e123d823bd 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments.types +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments.types @@ -19,14 +19,14 @@ function foo(a: (x: T) => T, b: (x: T) => T) { //var r1 = foo((x: number) => 1, (x: string) => ''); // error var r1b = foo((x) => 1, (x) => ''); // {} => {} ->r1b : (x: {}) => {} ->foo((x) => 1, (x) => '') : (x: {}) => {} +>r1b : (x: unknown) => unknown +>foo((x) => 1, (x) => '') : (x: unknown) => unknown >foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x) => 1 : (x: {}) => number ->x : {} +>(x) => 1 : (x: unknown) => number +>x : unknown >1 : 1 ->(x) => '' : (x: {}) => string ->x : {} +>(x) => '' : (x: unknown) => string +>x : unknown >'' : "" var r2 = foo((x: Object) => null, (x: string) => ''); // Object => Object @@ -114,15 +114,15 @@ function other(x: T) { >b : T var r6b = foo((a) => a, (b) => b); // {} => {} ->r6b : (x: {}) => {} ->foo((a) => a, (b) => b) : (x: {}) => {} +>r6b : (x: unknown) => unknown +>foo((a) => a, (b) => b) : (x: unknown) => unknown >foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(a) => a : (a: {}) => {} ->a : {} ->a : {} ->(b) => b : (b: {}) => {} ->b : {} ->b : {} +>(a) => a : (a: unknown) => unknown +>a : unknown +>a : unknown +>(b) => b : (b: unknown) => unknown +>b : unknown +>b : unknown } function other2(x: T) { @@ -141,15 +141,15 @@ function other2(x: T) { >b : T var r7b = foo((a) => a, (b) => b); // {} => {} ->r7b : (x: {}) => {} ->foo((a) => a, (b) => b) : (x: {}) => {} +>r7b : (x: unknown) => unknown +>foo((a) => a, (b) => b) : (x: unknown) => unknown >foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(a) => a : (a: {}) => {} ->a : {} ->a : {} ->(b) => b : (b: {}) => {} ->b : {} ->b : {} +>(a) => a : (a: unknown) => unknown +>a : unknown +>a : unknown +>(b) => b : (b: unknown) => unknown +>b : unknown +>b : unknown var r8 = r7(null); >r8 : T diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types index e1b41363477b7..435b69bd75346 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types @@ -77,8 +77,8 @@ module GenericParameter { >x : number var r7 = foo5(b); // new any => string; new(x:number) => any ->r7 : { new (x: {}): string; new (x: number): {}; } ->foo5(b) : { new (x: {}): string; new (x: number): {}; } +>r7 : { new (x: unknown): string; new (x: number): unknown; } +>foo5(b) : { new (x: unknown): string; new (x: number): unknown; } >foo5 : (cb: { new (x: T): string; new (x: number): T; }) => { new (x: T): string; new (x: number): T; } >b : { new (x: T): string; new (x: number): T; } @@ -100,8 +100,8 @@ module GenericParameter { >a : { new (x: boolean): string; new (x: number): boolean; } var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string ->r9 : { new (x: {}): string; new (x: {}, y?: {}): string; } ->foo6(b) : { new (x: {}): string; new (x: {}, y?: {}): string; } +>r9 : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } +>foo6(b) : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } >foo6 : (cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >b : { new (x: T): string; new (x: number): T; } @@ -118,8 +118,8 @@ module GenericParameter { } var r13 = foo7(1, b); // new any => string; new(x:any, y?:any) => string ->r13 : { new (x: {}): string; new (x: {}, y?: {}): string; } ->foo7(1, b) : { new (x: {}): string; new (x: {}, y?: {}): string; } +>r13 : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } +>foo7(1, b) : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } >foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >1 : 1 >b : { new (x: T): string; new (x: number): T; } @@ -135,15 +135,15 @@ module GenericParameter { >x : number var r14 = foo7(1, c); // new any => string; new(x:any, y?:any) => string ->r14 : { new (x: {}): string; new (x: {}, y?: {}): string; } ->foo7(1, c) : { new (x: {}): string; new (x: {}, y?: {}): string; } +>r14 : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } +>foo7(1, c) : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } >foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >1 : 1 >c : { (x: number): T; new (x: T): string; } var r15 = foo7(1, c2); // new any => string; new(x:any, y?:any) => string ->r15 : { new (x: {}): string; new (x: {}, y?: {}): string; } ->foo7(1, c2) : { new (x: {}): string; new (x: {}, y?: {}): string; } +>r15 : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } +>foo7(1, c2) : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } >foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >1 : 1 >c2 : { new (x: T): string; new (x: number): T; } diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt index cb40b4acb7a9e..2e52a9d482c69 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: {}): string; new (x: {}, y?: {}): string; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts (1 errors) ==== @@ -34,7 +34,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var b: { new (x: T, y: T): string }; var r10 = foo6(b); // error ~ -!!! error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: {}): string; new (x: {}, y?: {}): string; }'. +!!! error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'. function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types index 7c2075c4fa6a3..94183b183549f 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types @@ -53,8 +53,8 @@ module GenericParameter { >x : T var r6 = foo5(a); // ok ->r6 : { new (x: {}): string; new (x: number): {}; } ->foo5(a) : { new (x: {}): string; new (x: number): {}; } +>r6 : { new (x: unknown): string; new (x: number): unknown; } +>foo5(a) : { new (x: unknown): string; new (x: number): unknown; } >foo5 : (cb: { new (x: T): string; new (x: number): T; }) => { new (x: T): string; new (x: number): T; } >a : new (x: T) => T @@ -93,8 +93,8 @@ module GenericParameter { } var r13 = foo7(1, a); // ok ->r13 : { new (x: {}): string; new (x: {}, y?: {}): string; } ->foo7(1, a) : { new (x: {}): string; new (x: {}, y?: {}): string; } +>r13 : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } +>foo7(1, a) : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } >foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >1 : 1 >a : new (x: T) => T @@ -105,8 +105,8 @@ module GenericParameter { >x : number var r14 = foo7(1, c); // ok ->r14 : { new (x: {}): string; new (x: {}, y?: {}): string; } ->foo7(1, c) : { new (x: {}): string; new (x: {}, y?: {}): string; } +>r14 : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } +>foo7(1, c) : { new (x: unknown): string; new (x: unknown, y?: unknown): string; } >foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >1 : 1 >c : { new (x: T): number; new (x: number): T; } diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types index 78917f68af40d..b37c03962acaf 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types @@ -74,8 +74,8 @@ module GenericParameter { >x : number var r7 = foo5(a); // any => string (+1 overload) ->r7 : { (x: {}): string; (x: number): {}; } ->foo5(a) : { (x: {}): string; (x: number): {}; } +>r7 : { (x: unknown): string; (x: number): unknown; } +>foo5(a) : { (x: unknown): string; (x: number): unknown; } >foo5 : (cb: { (x: T): string; (x: number): T; }) => { (x: T): string; (x: number): T; } >a : { (x: T): string; (x: number): T; } @@ -99,16 +99,16 @@ module GenericParameter { >x : any var r9 = foo6((x: T) => ''); // any => string (+1 overload) ->r9 : { (x: {}): string; (x: {}, y?: {}): string; } ->foo6((x: T) => '') : { (x: {}): string; (x: {}, y?: {}): string; } +>r9 : { (x: unknown): string; (x: unknown, y?: unknown): string; } +>foo6((x: T) => '') : { (x: unknown): string; (x: unknown, y?: unknown): string; } >foo6 : (cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >(x: T) => '' : (x: T) => string >x : T >'' : "" var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) ->r11 : { (x: {}): string; (x: {}, y?: {}): string; } ->foo6((x: T, y?: T) => '') : { (x: {}): string; (x: {}, y?: {}): string; } +>r11 : { (x: unknown): string; (x: unknown, y?: unknown): string; } +>foo6((x: T, y?: T) => '') : { (x: unknown): string; (x: unknown, y?: unknown): string; } >foo6 : (cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >(x: T, y?: T) => '' : (x: T, y?: T) => string >x : T @@ -137,8 +137,8 @@ module GenericParameter { >x : any var r13 = foo7(1, (x: T) => ''); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] ->r13 : { (x: {}): string; (x: {}, y?: {}): string; } ->foo7(1, (x: T) => '') : { (x: {}): string; (x: {}, y?: {}): string; } +>r13 : { (x: unknown): string; (x: unknown, y?: unknown): string; } +>foo7(1, (x: T) => '') : { (x: unknown): string; (x: unknown, y?: unknown): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >1 : 1 >(x: T) => '' : (x: T) => string @@ -151,8 +151,8 @@ module GenericParameter { >x : number var r14 = foo7(1, a); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] ->r14 : { (x: {}): string; (x: {}, y?: {}): string; } ->foo7(1, a) : { (x: {}): string; (x: {}, y?: {}): string; } +>r14 : { (x: unknown): string; (x: unknown, y?: unknown): string; } +>foo7(1, a) : { (x: unknown): string; (x: unknown, y?: unknown): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >1 : 1 >a : { (x: T): string; (x: number): T; } diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt index 9ee5e6f0cfe79..2e5b19bcf1b50 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: {}): string; (x: {}, y?: {}): string; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts (1 errors) ==== @@ -31,7 +31,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var r10 = foo6((x: T, y: T) => ''); // error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: {}): string; (x: {}, y?: {}): string; }'. +!!! error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'. function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types index 6c982af9f917e..1d18c07210ec6 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types @@ -48,8 +48,8 @@ module GenericParameter { } var r6 = foo5((x: T) => x); // ok ->r6 : { (x: {}): string; (x: number): {}; } ->foo5((x: T) => x) : { (x: {}): string; (x: number): {}; } +>r6 : { (x: unknown): string; (x: number): unknown; } +>foo5((x: T) => x) : { (x: unknown): string; (x: number): unknown; } >foo5 : (cb: { (x: T): string; (x: number): T; }) => { (x: T): string; (x: number): T; } >(x: T) => x : (x: T) => T >x : T @@ -88,8 +88,8 @@ module GenericParameter { } var r13 = foo7(1, (x: T) => x); // ok ->r13 : { (x: {}): string; (x: {}, y?: {}): string; } ->foo7(1, (x: T) => x) : { (x: {}): string; (x: {}, y?: {}): string; } +>r13 : { (x: unknown): string; (x: unknown, y?: unknown): string; } +>foo7(1, (x: T) => x) : { (x: unknown): string; (x: unknown, y?: unknown): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >1 : 1 >(x: T) => x : (x: T) => T @@ -102,8 +102,8 @@ module GenericParameter { >x : number var r14 = foo7(1, a); // ok ->r14 : { (x: {}): string; (x: {}, y?: {}): string; } ->foo7(1, a) : { (x: {}): string; (x: {}, y?: {}): string; } +>r14 : { (x: unknown): string; (x: unknown, y?: unknown): string; } +>foo7(1, a) : { (x: unknown): string; (x: unknown, y?: unknown): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >1 : 1 >a : { (x: T): number; (x: number): T; } diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types index 3e4c0c1e3a50f..01f98d4bbfcaa 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types @@ -26,8 +26,8 @@ module ImmediatelyFix { >C : typeof C var r = c.foo((x: U) => ''); // {} ->r : {} ->c.foo((x: U) => '') : {} +>r : unknown +>c.foo((x: U) => '') : unknown >c.foo : (x: (a: T) => T) => T >c : C >foo : (x: (a: T) => T) => T @@ -46,13 +46,13 @@ module ImmediatelyFix { >'' : "" var r3 = c.foo(x => ''); // {} ->r3 : {} ->c.foo(x => '') : {} +>r3 : unknown +>c.foo(x => '') : unknown >c.foo : (x: (a: T) => T) => T >c : C >foo : (x: (a: T) => T) => T ->x => '' : (x: {}) => string ->x : {} +>x => '' : (x: unknown) => string +>x : unknown >'' : "" class C2 { diff --git a/tests/baselines/reference/genericConstructExpressionWithoutArgs.types b/tests/baselines/reference/genericConstructExpressionWithoutArgs.types index 5771e1536cd2f..a3ee837c292de 100644 --- a/tests/baselines/reference/genericConstructExpressionWithoutArgs.types +++ b/tests/baselines/reference/genericConstructExpressionWithoutArgs.types @@ -15,8 +15,8 @@ class C { } var c = new C // C ->c : C<{}> ->new C : C<{}> +>c : C +>new C : C >C : typeof C var c2 = new C // error, type params are actually part of the arg list so you need both diff --git a/tests/baselines/reference/genericDefaults.js b/tests/baselines/reference/genericDefaults.js index 4cd1127724f11..842abbde52fb4 100644 --- a/tests/baselines/reference/genericDefaults.js +++ b/tests/baselines/reference/genericDefaults.js @@ -980,7 +980,7 @@ declare const Base01c02: Base01; declare const Base01c03: Base01; declare class Derived01 extends Base01 { } -declare const Derived01c00: Derived01<{}>; +declare const Derived01c00: Derived01; declare const Derived01c01: Derived01; declare const Derived01c02: Derived01; declare const Derived01c03: Derived01; diff --git a/tests/baselines/reference/genericDefaults.types b/tests/baselines/reference/genericDefaults.types index c439d96a08b44..5bea18de7c3e3 100644 --- a/tests/baselines/reference/genericDefaults.types +++ b/tests/baselines/reference/genericDefaults.types @@ -62,7 +62,7 @@ declare function f01(a?: T): T; // inference f01(); ->f01() : {} +>f01() : unknown >f01 : (a?: T) => T f01(a); @@ -126,7 +126,7 @@ declare function f03(a?: T): T; // inference f03(); ->f03() : {} +>f03() : unknown >f03 : (a?: T) => T f03(a); @@ -166,7 +166,7 @@ declare function f04(a?: T, b?: U): [T, U]; // inference f04(); ->f04() : [{}, B] +>f04() : [unknown, B] >f04 : (a?: T, b?: U) => [T, U] f04(a); @@ -241,7 +241,7 @@ declare function f05(a?: T, b?: U): [T, U]; // inference f05(); ->f05() : [{}, {}] +>f05() : [unknown, unknown] >f05 : (a?: T, b?: U) => [T, U] f05(a); @@ -404,7 +404,7 @@ declare function f07(a?: T, b?: U, c?: V): [T, U, V]; // inference f07(); ->f07() : [{}, B, B] +>f07() : [unknown, B, B] >f07 : (a?: T, b?: U, c?: V) => [T, U, V] f07(a, b); @@ -627,7 +627,7 @@ declare function f09(a?: T, b?: U): [T, U]; // inference f09(); ->f09() : [{}, {}] +>f09() : [unknown, unknown] >f09 : (a?: T, b?: U) => [T, U] f09(a); @@ -780,7 +780,7 @@ declare function f11(a?: T, b?: U): [T, U]; // inference f11(); ->f11() : [{}, {} | B] +>f11() : [unknown, unknown] >f11 : (a?: T, b?: U) => [T, U] f11(a); @@ -852,7 +852,7 @@ declare function f12(a?: T, b?: U): [T, U]; // inference f12(); ->f12() : [{}, B] +>f12() : [unknown, B] >f12 : (a?: T, b?: U) => [T, U] f12(a); @@ -918,7 +918,7 @@ declare function f13(a?: T, b?: U): [T, U]; // inference f13(); ->f13() : [{}, B] +>f13() : [unknown, B] >f13 : (a?: T, b?: U) => [T, U] f13(a); @@ -985,11 +985,11 @@ declare function f14(a?: T, b?: U, c?: V): [T, U, V]; // inference f14(); ->f14() : [{}, {}, C] +>f14() : [unknown, unknown, C] >f14 : (a?: T, b?: U, c?: V) => [T, U, V] f14(a); ->f14(a) : [A, {}, C] +>f14(a) : [A, unknown, C] >f14 : (a?: T, b?: U, c?: V) => [T, U, V] >a : A @@ -1089,7 +1089,7 @@ declare function f15(a?: T, b?: U): [T, U]; // inference f15(); ->f15() : [{}, {}] +>f15() : [unknown, unknown] >f15 : (a?: T, b?: U) => [T, U] f15(a); @@ -1144,11 +1144,11 @@ declare function f16(a?: T, b?: U, c?: V): [T, U, V]; // no inference f16(); ->f16() : [{}, {}, {}] +>f16() : [unknown, unknown, unknown] >f16 : (a?: T, b?: U, c?: V) => [T, U, V] f16(a); ->f16(a) : [A, {}, {}] +>f16(a) : [A, unknown, unknown] >f16 : (a?: T, b?: U, c?: V) => [T, U, V] >a : A @@ -1241,7 +1241,7 @@ declare function f17(a?: T, b?: U): [T, U]; // inference f17(); ->f17() : [{}, {} | B] +>f17() : [unknown, unknown] >f17 : (a?: T, b?: U) => [T, U] f17(a); @@ -1314,11 +1314,11 @@ declare function f18(a?: T, b?: U, c?: V): [T, U, V]; // inference f18(); ->f18() : [{}, {}, {} | C] +>f18() : [unknown, unknown, unknown] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] f18(a); ->f18(a) : [A, {}, {} | C] +>f18(a) : [A, unknown, unknown] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >a : A @@ -1432,7 +1432,7 @@ declare function f19(a?: T, b?: U): [T, U]; // inference f19(); ->f19() : [{}, B] +>f19() : [unknown, B] >f19 : (a?: T, b?: U) => [T, U] f19(a); @@ -1505,11 +1505,11 @@ declare function f20(a?: T, b?: U, c?: V): [T, U, V]; // inference f20(); ->f20() : [{}, {}, C] +>f20() : [unknown, unknown, C] >f20 : (a?: T, b?: U, c?: V) => [T, U, V] f20(a); ->f20(a) : [A, {}, C] +>f20(a) : [A, unknown, C] >f20 : (a?: T, b?: U, c?: V) => [T, U, V] >a : A @@ -1843,8 +1843,8 @@ declare class Derived01 extends Base01 { } >Base01 : Base01 const Derived01c00 = new Derived01(); ->Derived01c00 : Derived01<{}> ->new Derived01() : Derived01<{}> +>Derived01c00 : Derived01 +>new Derived01() : Derived01 >Derived01 : typeof Derived01 const Derived01c01 = new Derived01(1); diff --git a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt index c84308189838f..4f24a4560235e 100644 --- a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt +++ b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts(6,1): error TS2322: Type '() => S[]' is not assignable to type '(x: T) => T'. - Type '{}[]' is not assignable to type 'T'. + Type 'unknown[]' is not assignable to type 'T'. ==== tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts (1 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts(6,1): err f = g; ~ !!! error TS2322: Type '() => S[]' is not assignable to type '(x: T) => T'. -!!! error TS2322: Type '{}[]' is not assignable to type 'T'. +!!! error TS2322: Type 'unknown[]' is not assignable to type 'T'. var s = f("str").toUpperCase(); diff --git a/tests/baselines/reference/genericFunctionInference1.types b/tests/baselines/reference/genericFunctionInference1.types index 7b0cb2a0e363d..5df3fa398c51c 100644 --- a/tests/baselines/reference/genericFunctionInference1.types +++ b/tests/baselines/reference/genericFunctionInference1.types @@ -416,8 +416,8 @@ declare function pipe5(f: (a: A) => B): { f: (a: A) => B }; >a : A const f50 = pipe5(list); // No higher order inference ->f50 : { f: (a: {}) => {}[]; } ->pipe5(list) : { f: (a: {}) => {}[]; } +>f50 : { f: (a: unknown) => unknown[]; } +>pipe5(list) : { f: (a: unknown) => unknown[]; } >pipe5 : (f: (a: A) => B) => { f: (a: A) => B; } >list : (a: T) => T[] @@ -835,7 +835,7 @@ foo2(() => {}); >() => {} : () => void foo2(identity); ->foo2(identity) : [(value: T) => T, {}] +>foo2(identity) : [(value: T) => T, unknown] >foo2 : (fn: T, a?: U | undefined, b?: U | undefined) => [T, U] >identity : (value: T) => T diff --git a/tests/baselines/reference/genericFunctionParameters.js b/tests/baselines/reference/genericFunctionParameters.js index 55f4196e77b3c..92663cabdb2cc 100644 --- a/tests/baselines/reference/genericFunctionParameters.js +++ b/tests/baselines/reference/genericFunctionParameters.js @@ -25,10 +25,10 @@ var x = s(function (a) { return a.init(); }); // x is any, should have been {} declare function f1(cb: (x: S) => T): T; declare function f2(cb: (x: S) => T): T; declare function f3(cb: >(x: S) => T): T; -declare let x1: {}; +declare let x1: unknown; declare let x2: number; declare let x3: any[]; declare const s: (go: (ops: { init(): S; }) => R) => R; -declare const x: {}; +declare const x: unknown; diff --git a/tests/baselines/reference/genericFunctionParameters.types b/tests/baselines/reference/genericFunctionParameters.types index b297eb0813bfc..6f59aea1fbf07 100644 --- a/tests/baselines/reference/genericFunctionParameters.types +++ b/tests/baselines/reference/genericFunctionParameters.types @@ -15,8 +15,8 @@ declare function f3(cb: >(x: S) => T): T; >x : S let x1 = f1(x => x); // {} ->x1 : {} ->f1(x => x) : {} +>x1 : unknown +>f1(x => x) : unknown >f1 : (cb: (x: S) => T) => T >x => x : (x: S) => S >x : S @@ -47,8 +47,8 @@ declare const s: (go: (ops: { init(): S; }) => R) => R; >init : () => S const x = s(a => a.init()); // x is any, should have been {} ->x : {} ->s(a => a.init()) : {} +>x : unknown +>s(a => a.init()) : unknown >s : (go: (ops: { init(): S; }) => R) => R >a => a.init() : (a: { init(): S; }) => S >a : { init(): S; } diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types index 4cfcb93dfd049..4a7498563ccd6 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types @@ -13,20 +13,20 @@ var utils: Utils; >utils : Utils utils.fold(); // no error ->utils.fold() : {} +>utils.fold() : unknown >utils.fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T utils.fold(null); // no error ->utils.fold(null) : {} +>utils.fold(null) : unknown >utils.fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >null : null utils.fold(null, null); // no error ->utils.fold(null, null) : {} +>utils.fold(null, null) : unknown >utils.fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T @@ -34,7 +34,7 @@ utils.fold(null, null); // no error >null : null utils.fold(null, null, null); // no error ->utils.fold(null, null, null) : {} +>utils.fold(null, null, null) : unknown >utils.fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.types b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.types index 345ec740a86ff..7c385445c07e2 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.types +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.types @@ -19,14 +19,14 @@ utils.fold(); // error >fold : (c: T[], folder?: (s: S, t: T) => T, init?: S) => T utils.fold(null); // no error ->utils.fold(null) : {} +>utils.fold(null) : unknown >utils.fold : (c: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c: T[], folder?: (s: S, t: T) => T, init?: S) => T >null : null utils.fold(null, null); // no error ->utils.fold(null, null) : {} +>utils.fold(null, null) : unknown >utils.fold : (c: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c: T[], folder?: (s: S, t: T) => T, init?: S) => T @@ -34,7 +34,7 @@ utils.fold(null, null); // no error >null : null utils.fold(null, null, null); // error: Unable to invoke type with no call signatures ->utils.fold(null, null, null) : {} +>utils.fold(null, null, null) : unknown >utils.fold : (c: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c: T[], folder?: (s: S, t: T) => T, init?: S) => T diff --git a/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.types b/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.types index 0f3db6e957292..dad4ebdc4dde1 100644 --- a/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.types +++ b/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.types @@ -15,12 +15,12 @@ var x2 = new SS < number>; // Correctly give error >SS : typeof SS var x3 = new SS(); // OK ->x3 : SS<{}> ->new SS() : SS<{}> +>x3 : SS +>new SS() : SS >SS : typeof SS var x4 = new SS; // Should be allowed, but currently give error ('supplied parameters do not match any signature of the call target') ->x4 : SS<{}> ->new SS : SS<{}> +>x4 : SS +>new SS : SS >SS : typeof SS diff --git a/tests/baselines/reference/genericRestParameters3.errors.txt b/tests/baselines/reference/genericRestParameters3.errors.txt index cd9f677c54984..612140ea9408f 100644 --- a/tests/baselines/reference/genericRestParameters3.errors.txt +++ b/tests/baselines/reference/genericRestParameters3.errors.txt @@ -22,12 +22,12 @@ tests/cases/conformance/types/rest/genericRestParameters3.ts(31,21): error TS234 Property '0' is missing in type 'CoolArray' but required in type '[(...args: any[]) => void]'. tests/cases/conformance/types/rest/genericRestParameters3.ts(38,32): error TS2345: Argument of type '[10, 20]' is not assignable to parameter of type 'CoolArray'. Property 'hello' is missing in type '[10, 20]' but required in type 'CoolArray'. -tests/cases/conformance/types/rest/genericRestParameters3.ts(43,1): error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray<{}>'. - Property 'hello' is missing in type '[]' but required in type 'CoolArray<{}>'. -tests/cases/conformance/types/rest/genericRestParameters3.ts(44,5): error TS2345: Argument of type '[number]' is not assignable to parameter of type 'CoolArray<{}>'. - Property 'hello' is missing in type '[number]' but required in type 'CoolArray<{}>'. -tests/cases/conformance/types/rest/genericRestParameters3.ts(45,5): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type 'CoolArray<{}>'. - Property 'hello' is missing in type '[number, number]' but required in type 'CoolArray<{}>'. +tests/cases/conformance/types/rest/genericRestParameters3.ts(43,1): error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray'. + Property 'hello' is missing in type '[]' but required in type 'CoolArray'. +tests/cases/conformance/types/rest/genericRestParameters3.ts(44,5): error TS2345: Argument of type '[number]' is not assignable to parameter of type 'CoolArray'. + Property 'hello' is missing in type '[number]' but required in type 'CoolArray'. +tests/cases/conformance/types/rest/genericRestParameters3.ts(45,5): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type 'CoolArray'. + Property 'hello' is missing in type '[number, number]' but required in type 'CoolArray'. tests/cases/conformance/types/rest/genericRestParameters3.ts(46,5): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'CoolArray'. Property 'hello' is missing in type 'number[]' but required in type 'CoolArray'. tests/cases/conformance/types/rest/genericRestParameters3.ts(53,5): error TS2345: Argument of type '["what"]' is not assignable to parameter of type '[] | [number, string]'. @@ -115,18 +115,18 @@ tests/cases/conformance/types/rest/genericRestParameters3.ts(53,5): error TS2345 baz(); // Error ~~~~~ -!!! error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray<{}>'. -!!! error TS2345: Property 'hello' is missing in type '[]' but required in type 'CoolArray<{}>'. +!!! error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray'. +!!! error TS2345: Property 'hello' is missing in type '[]' but required in type 'CoolArray'. !!! related TS2728 tests/cases/conformance/types/rest/genericRestParameters3.ts:24:5: 'hello' is declared here. baz(1); // Error ~ -!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type 'CoolArray<{}>'. -!!! error TS2345: Property 'hello' is missing in type '[number]' but required in type 'CoolArray<{}>'. +!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type 'CoolArray'. +!!! error TS2345: Property 'hello' is missing in type '[number]' but required in type 'CoolArray'. !!! related TS2728 tests/cases/conformance/types/rest/genericRestParameters3.ts:24:5: 'hello' is declared here. baz(1, 2); // Error ~ -!!! error TS2345: Argument of type '[number, number]' is not assignable to parameter of type 'CoolArray<{}>'. -!!! error TS2345: Property 'hello' is missing in type '[number, number]' but required in type 'CoolArray<{}>'. +!!! error TS2345: Argument of type '[number, number]' is not assignable to parameter of type 'CoolArray'. +!!! error TS2345: Property 'hello' is missing in type '[number, number]' but required in type 'CoolArray'. !!! related TS2728 tests/cases/conformance/types/rest/genericRestParameters3.ts:24:5: 'hello' is declared here. baz(...ca); // Error ~~~~~ diff --git a/tests/baselines/reference/getAndSetNotIdenticalType2.types b/tests/baselines/reference/getAndSetNotIdenticalType2.types index db6ff47a809df..b5d4705fd6bc4 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType2.types +++ b/tests/baselines/reference/getAndSetNotIdenticalType2.types @@ -31,20 +31,20 @@ class C { } var x = new C(); ->x : C<{}> ->new C() : C<{}> +>x : C +>new C() : C >C : typeof C var r = x.x; ->r : A<{}> ->x.x : A<{}> ->x : C<{}> ->x : A<{}> +>r : A +>x.x : A +>x : C +>x : A x.x = r; ->x.x = r : A<{}> ->x.x : A<{}> ->x : C<{}> ->x : A<{}> ->r : A<{}> +>x.x = r : A +>x.x : A +>x : C +>x : A +>r : A diff --git a/tests/baselines/reference/getAndSetNotIdenticalType3.types b/tests/baselines/reference/getAndSetNotIdenticalType3.types index 2e24acff99c80..e5722f57393fb 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType3.types +++ b/tests/baselines/reference/getAndSetNotIdenticalType3.types @@ -31,20 +31,20 @@ class C { } var x = new C(); ->x : C<{}> ->new C() : C<{}> +>x : C +>new C() : C >C : typeof C var r = x.x; >r : A >x.x : A ->x : C<{}> +>x : C >x : A x.x = r; >x.x = r : A >x.x : A ->x : C<{}> +>x : C >x : A >r : A diff --git a/tests/baselines/reference/implicitAnyGenerics.types b/tests/baselines/reference/implicitAnyGenerics.types index 426c22a9330e5..f7f3d0596fbe5 100644 --- a/tests/baselines/reference/implicitAnyGenerics.types +++ b/tests/baselines/reference/implicitAnyGenerics.types @@ -7,8 +7,8 @@ class C { } var c = new C(); ->c : C<{}> ->new C() : C<{}> +>c : C +>new C() : C >C : typeof C var c2 = new C(); @@ -69,7 +69,7 @@ function foo(): T { return null; }; >null : null foo() ->foo() : {} +>foo() : unknown >foo : () => T foo(); diff --git a/tests/baselines/reference/indexSignatureTypeInference.errors.txt b/tests/baselines/reference/indexSignatureTypeInference.errors.txt index f93bfc6ce40d2..3002c47127948 100644 --- a/tests/baselines/reference/indexSignatureTypeInference.errors.txt +++ b/tests/baselines/reference/indexSignatureTypeInference.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts(18,27): error TS2345: Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap<{}>'. - Index signature is missing in type 'NumberMap'. +tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts(18,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v1' must be of type 'Function[]', but here has type 'unknown[]'. ==== tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts (1 errors) ==== @@ -21,8 +20,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureType var v1 = numberMapToArray(numberMap); // Ok var v1 = numberMapToArray(stringMap); // Ok var v1 = stringMapToArray(numberMap); // Error expected here - ~~~~~~~~~ -!!! error TS2345: Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap<{}>'. -!!! error TS2345: Index signature is missing in type 'NumberMap'. + ~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v1' must be of type 'Function[]', but here has type 'unknown[]'. var v1 = stringMapToArray(stringMap); // Ok \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureTypeInference.types b/tests/baselines/reference/indexSignatureTypeInference.types index b29a1d002dd1f..830af609193d6 100644 --- a/tests/baselines/reference/indexSignatureTypeInference.types +++ b/tests/baselines/reference/indexSignatureTypeInference.types @@ -40,7 +40,7 @@ var v1 = numberMapToArray(stringMap); // Ok var v1 = stringMapToArray(numberMap); // Error expected here >v1 : Function[] ->stringMapToArray(numberMap) : any +>stringMapToArray(numberMap) : unknown[] >stringMapToArray : (object: StringMap) => T[] >numberMap : NumberMap diff --git a/tests/baselines/reference/indexerReturningTypeParameter1.types b/tests/baselines/reference/indexerReturningTypeParameter1.types index 635e7e4b77824..2e43313b3d61f 100644 --- a/tests/baselines/reference/indexerReturningTypeParameter1.types +++ b/tests/baselines/reference/indexerReturningTypeParameter1.types @@ -8,8 +8,8 @@ var a: f; >a : f var r = a.groupBy(); ->r : { [key: string]: {}[]; } ->a.groupBy() : { [key: string]: {}[]; } +>r : { [key: string]: unknown[]; } +>a.groupBy() : { [key: string]: unknown[]; } >a.groupBy : () => { [key: string]: T[]; } >a : f >groupBy : () => { [key: string]: T[]; } @@ -29,8 +29,8 @@ var a2: c; >a2 : c var r2 = a2.groupBy(); ->r2 : { [key: string]: {}[]; } ->a2.groupBy() : { [key: string]: {}[]; } +>r2 : { [key: string]: unknown[]; } +>a2.groupBy() : { [key: string]: unknown[]; } >a2.groupBy : () => { [key: string]: T[]; } >a2 : c >groupBy : () => { [key: string]: T[]; } diff --git a/tests/baselines/reference/inferTypes1.types b/tests/baselines/reference/inferTypes1.types index c3f51879979e4..149ee287d6b6b 100644 --- a/tests/baselines/reference/inferTypes1.types +++ b/tests/baselines/reference/inferTypes1.types @@ -62,7 +62,7 @@ type T11 = ReturnType<(s: string) => void>; // void >s : string type T12 = ReturnType<(() => T)>; // {} ->T12 : {} +>T12 : unknown type T13 = ReturnType<(() => T)>; // number[] >T13 : number[] @@ -110,7 +110,7 @@ type ArgumentType any> = T extends (a: infer A) => any ? A >a : A type T20 = ArgumentType<() => void>; // {} ->T20 : {} +>T20 : unknown type T21 = ArgumentType<(x: string) => number>; // string >T21 : string diff --git a/tests/baselines/reference/inferenceLimit.types b/tests/baselines/reference/inferenceLimit.types index be4c6b63a5800..6aa7ab501ea16 100644 --- a/tests/baselines/reference/inferenceLimit.types +++ b/tests/baselines/reference/inferenceLimit.types @@ -29,15 +29,15 @@ export class BrokenClass { >[] : undefined[] let populateItems = (order) => { ->populateItems : (order: any) => Promise<{}> ->(order) => { return new Promise((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }); } : (order: any) => Promise<{}> +>populateItems : (order: any) => Promise +>(order) => { return new Promise((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }); } : (order: any) => Promise >order : any return new Promise((resolve, reject) => { ->new Promise((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }) : Promise<{}> +>new Promise((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }) : Promise >Promise : PromiseConstructor ->(resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>(resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); } : (resolve: (value?: unknown) => void, reject: (reason?: any) => void) => void +>resolve : (value?: unknown) => void >reject : (reason?: any) => void this.doStuff(order.id) @@ -65,7 +65,7 @@ export class BrokenClass { resolve(order); >resolve(order) : void ->resolve : (value?: {} | PromiseLike<{}>) => void +>resolve : (value?: unknown) => void >order : any }); @@ -74,19 +74,19 @@ export class BrokenClass { return Promise.all(result.map(populateItems)) >Promise.all(result.map(populateItems)) .then((orders: Array) => { resolve(orders); }) : Promise ->Promise.all(result.map(populateItems)) .then : (onfulfilled?: (value: {}[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->Promise.all(result.map(populateItems)) : Promise<{}[]> +>Promise.all(result.map(populateItems)) .then : (onfulfilled?: (value: unknown[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>Promise.all(result.map(populateItems)) : Promise >Promise.all : { (values: Iterable>): Promise; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: (T | PromiseLike)[]): Promise; } >Promise : PromiseConstructor >all : { (values: Iterable>): Promise; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: (T | PromiseLike)[]): Promise; } ->result.map(populateItems) : Promise<{}>[] +>result.map(populateItems) : Promise[] >result.map : (callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any) => U[] >result : MyModule.MyModel[] >map : (callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any) => U[] ->populateItems : (order: any) => Promise<{}> +>populateItems : (order: any) => Promise .then((orders: Array) => { ->then : (onfulfilled?: (value: {}[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>then : (onfulfilled?: (value: unknown[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >(orders: Array) => { resolve(orders); } : (orders: MyModule.MyModel[]) => void >orders : MyModule.MyModel[] >MyModule : any diff --git a/tests/baselines/reference/inferentialTypingUsingApparentType3.types b/tests/baselines/reference/inferentialTypingUsingApparentType3.types index 355351cbbadb4..046bf9a92dbdc 100644 --- a/tests/baselines/reference/inferentialTypingUsingApparentType3.types +++ b/tests/baselines/reference/inferentialTypingUsingApparentType3.types @@ -38,8 +38,8 @@ class ObjectField }> { } var person = new ObjectField({ ->person : ObjectField<{}, { id: NumberField; name: CharField; }> ->new ObjectField({ id: new NumberField(), name: new CharField()}) : ObjectField<{}, { id: NumberField; name: CharField; }> +>person : ObjectField +>new ObjectField({ id: new NumberField(), name: new CharField()}) : ObjectField >ObjectField : typeof ObjectField >{ id: new NumberField(), name: new CharField()} : { id: NumberField; name: CharField; } @@ -58,7 +58,7 @@ var person = new ObjectField({ person.fields.id; >person.fields.id : NumberField >person.fields : { id: NumberField; name: CharField; } ->person : ObjectField<{}, { id: NumberField; name: CharField; }> +>person : ObjectField >fields : { id: NumberField; name: CharField; } >id : NumberField diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types index 698cc127675dc..59ea4a78fa250 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types @@ -15,8 +15,8 @@ var zipWith: (a: T[], b: S[], f: (x: T) => (y: S) => U) => U[]; >y : S var result = zipWith([1, 2], ['a', 'b'], pair); ->result : { x: number; y: {}; }[] ->zipWith([1, 2], ['a', 'b'], pair) : { x: number; y: {}; }[] +>result : { x: number; y: unknown; }[] +>zipWith([1, 2], ['a', 'b'], pair) : { x: number; y: unknown; }[] >zipWith : (a: T[], b: S[], f: (x: T) => (y: S) => U) => U[] >[1, 2] : number[] >1 : 1 @@ -29,8 +29,8 @@ var result = zipWith([1, 2], ['a', 'b'], pair); var i = result[0].x; // number >i : number >result[0].x : number ->result[0] : { x: number; y: {}; } ->result : { x: number; y: {}; }[] +>result[0] : { x: number; y: unknown; } +>result : { x: number; y: unknown; }[] >0 : 0 >x : number diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.types b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.types index d1332d42a0829..4cb3e4b312693 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.types +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.types @@ -12,8 +12,8 @@ var a = new A(); >A : typeof A var b1 = new B(); // no error ->b1 : B<{}> ->new B() : B<{}> +>b1 : B +>new B() : B >B : typeof B var b2: B = new B(); // no error diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types index 5b318a9f86ea2..ccb614a0f4ded 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types @@ -46,8 +46,8 @@ var n2 = new N.D2(); // error >D2 : typeof N.D2 var n3 = new N.D2(); // no error, D2 ->n3 : N.D2<{}> ->new N.D2() : N.D2<{}> +>n3 : N.D2 +>new N.D2() : N.D2 >N.D2 : typeof N.D2 >N : typeof N >D2 : typeof N.D2 diff --git a/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.types b/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.types index 8f3c0a5dcabdf..bc252b5588184 100644 --- a/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.types +++ b/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.types @@ -9,8 +9,8 @@ class C { } var c = new C(); ->c : C<{}> ->new C() : C<{}> +>c : C +>new C() : C >C : typeof C class D { @@ -24,7 +24,7 @@ class D { } var d = new D(); ->d : D<{}, {}> ->new D() : D<{}, {}> +>d : D +>new D() : D >D : typeof D diff --git a/tests/baselines/reference/jsxInExtendsClause.types b/tests/baselines/reference/jsxInExtendsClause.types index 7f8de51b0817b..2ac03db06939d 100644 --- a/tests/baselines/reference/jsxInExtendsClause.types +++ b/tests/baselines/reference/jsxInExtendsClause.types @@ -15,7 +15,7 @@ declare function createComponentClass

(factory: () => React.ComponentClass

) class Foo extends createComponentClass(() => class extends React.Component<{}, {}> { >Foo : Foo ->createComponentClass(() => class extends React.Component<{}, {}> { render() { return Hello, world!; }}) : React.Component<{}, {}> +>createComponentClass(() => class extends React.Component<{}, {}> { render() { return Hello, world!; }}) : React.Component >createComponentClass :

(factory: () => React.ComponentClass

) => React.ComponentClass

>() => class extends React.Component<{}, {}> { render() { return Hello, world!; }} : () => typeof (Anonymous class) >class extends React.Component<{}, {}> { render() { return Hello, world!; }} : typeof (Anonymous class) diff --git a/tests/baselines/reference/keyofAndIndexedAccess.js b/tests/baselines/reference/keyofAndIndexedAccess.js index 793313fdaa535..7328bfe3feed9 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.js +++ b/tests/baselines/reference/keyofAndIndexedAccess.js @@ -1255,13 +1255,13 @@ declare type Thing = { declare function f1(thing: Thing): void; declare const assignTo2: (object: T, key1: K1, key2: K2) => (value: T[K1][K2]) => T[K1][K2]; declare function one(handler: (t: T) => void): T; -declare var empty: {}; +declare var empty: unknown; declare type Handlers = { [K in keyof T]: (t: T[K]) => void; }; declare function on(handlerHash: Handlers): T; declare var hashOfEmpty1: { - test: {}; + test: unknown; }; declare var hashOfEmpty2: { test: boolean; @@ -1276,7 +1276,7 @@ declare class Component1 { } declare let c1: Component1<{ hello: string; -}, {}>; +}, unknown>; interface Options2 { data?: Data; computed?: Computed; diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index 2a7a19ea30cfc..e30aa81a79092 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -1523,8 +1523,8 @@ declare function one(handler: (t: T) => void): T >t : T var empty = one(() => {}) // inferred as {}, expected ->empty : {} ->one(() => {}) : {} +>empty : unknown +>one(() => {}) : unknown >one : (handler: (t: T) => void) => T >() => {} : () => void @@ -1537,8 +1537,8 @@ declare function on(handlerHash: Handlers): T >handlerHash : Handlers var hashOfEmpty1 = on({ test: () => {} }); // {} ->hashOfEmpty1 : { test: {}; } ->on({ test: () => {} }) : { test: {}; } +>hashOfEmpty1 : { test: unknown; } +>on({ test: () => {} }) : { test: unknown; } >on : (handlerHash: Handlers) => T >{ test: () => {} } : { test: () => void; } >test : () => void @@ -1575,8 +1575,8 @@ declare class Component1 { } let c1 = new Component1({ ->c1 : Component1<{ hello: string; }, {}> ->new Component1({ data: { hello: "" }}) : Component1<{ hello: string; }, {}> +>c1 : Component1<{ hello: string; }, unknown> +>new Component1({ data: { hello: "" }}) : Component1<{ hello: string; }, unknown> >Component1 : typeof Component1 >{ data: { hello: "" }} : { data: { hello: string; }; } @@ -1593,7 +1593,7 @@ let c1 = new Component1({ c1.get("hello"); >c1.get("hello") : string >c1.get : (key: K) => { hello: string; }[K] ->c1 : Component1<{ hello: string; }, {}> +>c1 : Component1<{ hello: string; }, unknown> >get : (key: K) => { hello: string; }[K] >"hello" : "hello" diff --git a/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt b/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt index 41edb0f692407..f83f01f77bf60 100644 --- a/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts(16,9): error TS2322: Type 'number' is not assignable to type '() => {}'. +tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts(16,9): error TS2322: Type 'number' is not assignable to type '() => unknown'. ==== tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts (1 errors) ==== @@ -19,8 +19,8 @@ tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts(16,9): error T }, baz: 42 ~~~ -!!! error TS2322: Type 'number' is not assignable to type '() => {}'. -!!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts:16:9: The expected type comes from property 'baz' which is declared here on type 'ComputedOf<{ bar: number; baz: {}; }>' +!!! error TS2322: Type 'number' is not assignable to type '() => unknown'. +!!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts:16:9: The expected type comes from property 'baz' which is declared here on type 'ComputedOf<{ bar: number; baz: unknown; }>' } }); \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypeRecursiveInference.errors.txt b/tests/baselines/reference/mappedTypeRecursiveInference.errors.txt index c0916c0a6c855..f58b3cd61c060 100644 --- a/tests/baselines/reference/mappedTypeRecursiveInference.errors.txt +++ b/tests/baselines/reference/mappedTypeRecursiveInference.errors.txt @@ -1,8 +1,8 @@ -error TS2321: Excessive stack depth comparing types 'XMLHttpRequest' and 'Deep<{ onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseXML: { readonly URL: any; readonly activeElement: any; alinkColor: any; readonly all: any; readonly anchors: any; readonly applets: any; bgColor: any; body: any; readonly characterSet: any; readonly charset: any; readonly compatMode: any; readonly contentType: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; readonly documentElement: any; readonly documentURI: any; domain: any; readonly embeds: any; fgColor: any; readonly forms: any; readonly fullscreen: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; readonly images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; readonly links: any; location: any; onfullscreenchange: any; onfullscreenerror: any; onpointerlockchange: any; onpointerlockerror: any; onreadystatechange: any; onvisibilitychange: any; readonly origin: any; readonly plugins: any; readonly readyState: any; readonly referrer: any; readonly scripts: any; readonly scrollingElement: any; readonly timeline: any; title: any; readonly visibilityState: any; vlinkColor: any; adoptNode: any; captureEvents: any; caretPositionFromPoint: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createEvent: any; createNodeIterator: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; elementsFromPoint: any; evaluate: any; execCommand: any; exitFullscreen: any; exitPointerLock: any; getAnimations: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandValue: any; releaseEvents: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly isConnected: any; readonly lastChild: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; getRootNode: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; readonly fullscreenElement: any; readonly pointerLockElement: any; readonly styleSheets: any; readonly childElementCount: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; append: any; prepend: any; querySelector: any; querySelectorAll: any; onabort: any; onanimationcancel: any; onanimationend: any; onanimationiteration: any; onanimationstart: any; onauxclick: any; onblur: any; oncancel: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; onclose: any; oncontextmenu: any; oncuechange: any; ondblclick: any; ondrag: any; ondragend: any; ondragenter: any; ondragexit: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; ongotpointercapture: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadend: any; onloadstart: any; onlostpointercapture: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onpause: any; onplay: any; onplaying: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onprogress: any; onratechange: any; onreset: any; onresize: any; onscroll: any; onsecuritypolicyviolation: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontoggle: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; ontransitioncancel: any; ontransitionend: any; ontransitionrun: any; ontransitionstart: any; onvolumechange: any; onwaiting: any; onwheel: any; oncopy: any; oncut: any; onpaste: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; dispatchEvent: any; }; withCredentials: { valueOf: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; dispatchEvent: {}; }>'. -tests/cases/compiler/mappedTypeRecursiveInference.ts(19,18): error TS2321: Excessive stack depth comparing types 'XMLHttpRequest' and 'Deep<{ onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseXML: { readonly URL: any; readonly activeElement: any; alinkColor: any; readonly all: any; readonly anchors: any; readonly applets: any; bgColor: any; body: any; readonly characterSet: any; readonly charset: any; readonly compatMode: any; readonly contentType: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; readonly documentElement: any; readonly documentURI: any; domain: any; readonly embeds: any; fgColor: any; readonly forms: any; readonly fullscreen: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; readonly images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; readonly links: any; location: any; onfullscreenchange: any; onfullscreenerror: any; onpointerlockchange: any; onpointerlockerror: any; onreadystatechange: any; onvisibilitychange: any; readonly origin: any; readonly plugins: any; readonly readyState: any; readonly referrer: any; readonly scripts: any; readonly scrollingElement: any; readonly timeline: any; title: any; readonly visibilityState: any; vlinkColor: any; adoptNode: any; captureEvents: any; caretPositionFromPoint: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createEvent: any; createNodeIterator: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; elementsFromPoint: any; evaluate: any; execCommand: any; exitFullscreen: any; exitPointerLock: any; getAnimations: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandValue: any; releaseEvents: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly isConnected: any; readonly lastChild: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; getRootNode: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; readonly fullscreenElement: any; readonly pointerLockElement: any; readonly styleSheets: any; readonly childElementCount: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; append: any; prepend: any; querySelector: any; querySelectorAll: any; onabort: any; onanimationcancel: any; onanimationend: any; onanimationiteration: any; onanimationstart: any; onauxclick: any; onblur: any; oncancel: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; onclose: any; oncontextmenu: any; oncuechange: any; ondblclick: any; ondrag: any; ondragend: any; ondragenter: any; ondragexit: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; ongotpointercapture: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadend: any; onloadstart: any; onlostpointercapture: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onpause: any; onplay: any; onplaying: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onprogress: any; onratechange: any; onreset: any; onresize: any; onscroll: any; onsecuritypolicyviolation: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontoggle: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; ontransitioncancel: any; ontransitionend: any; ontransitionrun: any; ontransitionstart: any; onvolumechange: any; onwaiting: any; onwheel: any; oncopy: any; oncut: any; onpaste: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; dispatchEvent: any; }; withCredentials: { valueOf: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; dispatchEvent: {}; }>'. +error TS2321: Excessive stack depth comparing types 'XMLHttpRequest' and 'Deep<{ onreadystatechange: unknown; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: unknown; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseXML: { readonly URL: any; readonly activeElement: any; alinkColor: any; readonly all: any; readonly anchors: any; readonly applets: any; bgColor: any; body: any; readonly characterSet: any; readonly charset: any; readonly compatMode: any; readonly contentType: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; readonly documentElement: any; readonly documentURI: any; domain: any; readonly embeds: any; fgColor: any; readonly forms: any; readonly fullscreen: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; readonly images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; readonly links: any; location: any; onfullscreenchange: any; onfullscreenerror: any; onpointerlockchange: any; onpointerlockerror: any; onreadystatechange: any; onvisibilitychange: any; readonly origin: any; readonly plugins: any; readonly readyState: any; readonly referrer: any; readonly scripts: any; readonly scrollingElement: any; readonly timeline: any; title: any; readonly visibilityState: any; vlinkColor: any; adoptNode: any; captureEvents: any; caretPositionFromPoint: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createEvent: any; createNodeIterator: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; elementsFromPoint: any; evaluate: any; execCommand: any; exitFullscreen: any; exitPointerLock: any; getAnimations: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandValue: any; releaseEvents: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly isConnected: any; readonly lastChild: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; getRootNode: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; readonly fullscreenElement: any; readonly pointerLockElement: any; readonly styleSheets: any; readonly childElementCount: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; append: any; prepend: any; querySelector: any; querySelectorAll: any; onabort: any; onanimationcancel: any; onanimationend: any; onanimationiteration: any; onanimationstart: any; onauxclick: any; onblur: any; oncancel: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; onclose: any; oncontextmenu: any; oncuechange: any; ondblclick: any; ondrag: any; ondragend: any; ondragenter: any; ondragexit: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; ongotpointercapture: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadend: any; onloadstart: any; onlostpointercapture: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onpause: any; onplay: any; onplaying: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onprogress: any; onratechange: any; onreset: any; onresize: any; onscroll: any; onsecuritypolicyviolation: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontoggle: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; ontransitioncancel: any; ontransitionend: any; ontransitionrun: any; ontransitionstart: any; onvolumechange: any; onwaiting: any; onwheel: any; oncopy: any; oncut: any; onpaste: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; dispatchEvent: any; }; withCredentials: { valueOf: any; }; abort: unknown; getAllResponseHeaders: unknown; getResponseHeader: unknown; open: unknown; overrideMimeType: unknown; send: unknown; setRequestHeader: unknown; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: unknown; removeEventListener: unknown; onabort: unknown; onerror: unknown; onload: unknown; onloadend: unknown; onloadstart: unknown; onprogress: unknown; ontimeout: unknown; dispatchEvent: unknown; }>'. +tests/cases/compiler/mappedTypeRecursiveInference.ts(19,18): error TS2321: Excessive stack depth comparing types 'XMLHttpRequest' and 'Deep<{ onreadystatechange: unknown; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: unknown; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseXML: { readonly URL: any; readonly activeElement: any; alinkColor: any; readonly all: any; readonly anchors: any; readonly applets: any; bgColor: any; body: any; readonly characterSet: any; readonly charset: any; readonly compatMode: any; readonly contentType: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; readonly documentElement: any; readonly documentURI: any; domain: any; readonly embeds: any; fgColor: any; readonly forms: any; readonly fullscreen: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; readonly images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; readonly links: any; location: any; onfullscreenchange: any; onfullscreenerror: any; onpointerlockchange: any; onpointerlockerror: any; onreadystatechange: any; onvisibilitychange: any; readonly origin: any; readonly plugins: any; readonly readyState: any; readonly referrer: any; readonly scripts: any; readonly scrollingElement: any; readonly timeline: any; title: any; readonly visibilityState: any; vlinkColor: any; adoptNode: any; captureEvents: any; caretPositionFromPoint: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createEvent: any; createNodeIterator: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; elementsFromPoint: any; evaluate: any; execCommand: any; exitFullscreen: any; exitPointerLock: any; getAnimations: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandValue: any; releaseEvents: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly isConnected: any; readonly lastChild: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; getRootNode: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; readonly fullscreenElement: any; readonly pointerLockElement: any; readonly styleSheets: any; readonly childElementCount: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; append: any; prepend: any; querySelector: any; querySelectorAll: any; onabort: any; onanimationcancel: any; onanimationend: any; onanimationiteration: any; onanimationstart: any; onauxclick: any; onblur: any; oncancel: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; onclose: any; oncontextmenu: any; oncuechange: any; ondblclick: any; ondrag: any; ondragend: any; ondragenter: any; ondragexit: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; ongotpointercapture: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadend: any; onloadstart: any; onlostpointercapture: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onpause: any; onplay: any; onplaying: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onprogress: any; onratechange: any; onreset: any; onresize: any; onscroll: any; onsecuritypolicyviolation: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontoggle: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; ontransitioncancel: any; ontransitionend: any; ontransitionrun: any; ontransitionstart: any; onvolumechange: any; onwaiting: any; onwheel: any; oncopy: any; oncut: any; onpaste: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; dispatchEvent: any; }; withCredentials: { valueOf: any; }; abort: unknown; getAllResponseHeaders: unknown; getResponseHeader: unknown; open: unknown; overrideMimeType: unknown; send: unknown; setRequestHeader: unknown; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: unknown; removeEventListener: unknown; onabort: unknown; onerror: unknown; onload: unknown; onloadend: unknown; onloadstart: unknown; onprogress: unknown; ontimeout: unknown; dispatchEvent: unknown; }>'. -!!! error TS2321: Excessive stack depth comparing types 'XMLHttpRequest' and 'Deep<{ onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseXML: { readonly URL: any; readonly activeElement: any; alinkColor: any; readonly all: any; readonly anchors: any; readonly applets: any; bgColor: any; body: any; readonly characterSet: any; readonly charset: any; readonly compatMode: any; readonly contentType: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; readonly documentElement: any; readonly documentURI: any; domain: any; readonly embeds: any; fgColor: any; readonly forms: any; readonly fullscreen: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; readonly images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; readonly links: any; location: any; onfullscreenchange: any; onfullscreenerror: any; onpointerlockchange: any; onpointerlockerror: any; onreadystatechange: any; onvisibilitychange: any; readonly origin: any; readonly plugins: any; readonly readyState: any; readonly referrer: any; readonly scripts: any; readonly scrollingElement: any; readonly timeline: any; title: any; readonly visibilityState: any; vlinkColor: any; adoptNode: any; captureEvents: any; caretPositionFromPoint: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createEvent: any; createNodeIterator: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; elementsFromPoint: any; evaluate: any; execCommand: any; exitFullscreen: any; exitPointerLock: any; getAnimations: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandValue: any; releaseEvents: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly isConnected: any; readonly lastChild: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; getRootNode: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; readonly fullscreenElement: any; readonly pointerLockElement: any; readonly styleSheets: any; readonly childElementCount: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; append: any; prepend: any; querySelector: any; querySelectorAll: any; onabort: any; onanimationcancel: any; onanimationend: any; onanimationiteration: any; onanimationstart: any; onauxclick: any; onblur: any; oncancel: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; onclose: any; oncontextmenu: any; oncuechange: any; ondblclick: any; ondrag: any; ondragend: any; ondragenter: any; ondragexit: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; ongotpointercapture: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadend: any; onloadstart: any; onlostpointercapture: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onpause: any; onplay: any; onplaying: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onprogress: any; onratechange: any; onreset: any; onresize: any; onscroll: any; onsecuritypolicyviolation: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontoggle: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; ontransitioncancel: any; ontransitionend: any; ontransitionrun: any; ontransitionstart: any; onvolumechange: any; onwaiting: any; onwheel: any; oncopy: any; oncut: any; onpaste: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; dispatchEvent: any; }; withCredentials: { valueOf: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; dispatchEvent: {}; }>'. +!!! error TS2321: Excessive stack depth comparing types 'XMLHttpRequest' and 'Deep<{ onreadystatechange: unknown; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: unknown; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseXML: { readonly URL: any; readonly activeElement: any; alinkColor: any; readonly all: any; readonly anchors: any; readonly applets: any; bgColor: any; body: any; readonly characterSet: any; readonly charset: any; readonly compatMode: any; readonly contentType: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; readonly documentElement: any; readonly documentURI: any; domain: any; readonly embeds: any; fgColor: any; readonly forms: any; readonly fullscreen: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; readonly images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; readonly links: any; location: any; onfullscreenchange: any; onfullscreenerror: any; onpointerlockchange: any; onpointerlockerror: any; onreadystatechange: any; onvisibilitychange: any; readonly origin: any; readonly plugins: any; readonly readyState: any; readonly referrer: any; readonly scripts: any; readonly scrollingElement: any; readonly timeline: any; title: any; readonly visibilityState: any; vlinkColor: any; adoptNode: any; captureEvents: any; caretPositionFromPoint: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createEvent: any; createNodeIterator: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; elementsFromPoint: any; evaluate: any; execCommand: any; exitFullscreen: any; exitPointerLock: any; getAnimations: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandValue: any; releaseEvents: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly isConnected: any; readonly lastChild: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; getRootNode: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; readonly fullscreenElement: any; readonly pointerLockElement: any; readonly styleSheets: any; readonly childElementCount: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; append: any; prepend: any; querySelector: any; querySelectorAll: any; onabort: any; onanimationcancel: any; onanimationend: any; onanimationiteration: any; onanimationstart: any; onauxclick: any; onblur: any; oncancel: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; onclose: any; oncontextmenu: any; oncuechange: any; ondblclick: any; ondrag: any; ondragend: any; ondragenter: any; ondragexit: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; ongotpointercapture: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadend: any; onloadstart: any; onlostpointercapture: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onpause: any; onplay: any; onplaying: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onprogress: any; onratechange: any; onreset: any; onresize: any; onscroll: any; onsecuritypolicyviolation: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontoggle: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; ontransitioncancel: any; ontransitionend: any; ontransitionrun: any; ontransitionstart: any; onvolumechange: any; onwaiting: any; onwheel: any; oncopy: any; oncut: any; onpaste: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; dispatchEvent: any; }; withCredentials: { valueOf: any; }; abort: unknown; getAllResponseHeaders: unknown; getResponseHeader: unknown; open: unknown; overrideMimeType: unknown; send: unknown; setRequestHeader: unknown; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: unknown; removeEventListener: unknown; onabort: unknown; onerror: unknown; onload: unknown; onloadend: unknown; onloadstart: unknown; onprogress: unknown; ontimeout: unknown; dispatchEvent: unknown; }>'. ==== tests/cases/compiler/mappedTypeRecursiveInference.ts (1 errors) ==== interface A { a: A } declare let a: A; @@ -24,7 +24,7 @@ tests/cases/compiler/mappedTypeRecursiveInference.ts(19,18): error TS2321: Exces let xhr: XMLHttpRequest; const out2 = foo(xhr); ~~~ -!!! error TS2321: Excessive stack depth comparing types 'XMLHttpRequest' and 'Deep<{ onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseXML: { readonly URL: any; readonly activeElement: any; alinkColor: any; readonly all: any; readonly anchors: any; readonly applets: any; bgColor: any; body: any; readonly characterSet: any; readonly charset: any; readonly compatMode: any; readonly contentType: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; readonly documentElement: any; readonly documentURI: any; domain: any; readonly embeds: any; fgColor: any; readonly forms: any; readonly fullscreen: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; readonly images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; readonly links: any; location: any; onfullscreenchange: any; onfullscreenerror: any; onpointerlockchange: any; onpointerlockerror: any; onreadystatechange: any; onvisibilitychange: any; readonly origin: any; readonly plugins: any; readonly readyState: any; readonly referrer: any; readonly scripts: any; readonly scrollingElement: any; readonly timeline: any; title: any; readonly visibilityState: any; vlinkColor: any; adoptNode: any; captureEvents: any; caretPositionFromPoint: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createEvent: any; createNodeIterator: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; elementsFromPoint: any; evaluate: any; execCommand: any; exitFullscreen: any; exitPointerLock: any; getAnimations: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandValue: any; releaseEvents: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly isConnected: any; readonly lastChild: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; getRootNode: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; readonly fullscreenElement: any; readonly pointerLockElement: any; readonly styleSheets: any; readonly childElementCount: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; append: any; prepend: any; querySelector: any; querySelectorAll: any; onabort: any; onanimationcancel: any; onanimationend: any; onanimationiteration: any; onanimationstart: any; onauxclick: any; onblur: any; oncancel: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; onclose: any; oncontextmenu: any; oncuechange: any; ondblclick: any; ondrag: any; ondragend: any; ondragenter: any; ondragexit: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; ongotpointercapture: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadend: any; onloadstart: any; onlostpointercapture: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onpause: any; onplay: any; onplaying: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onprogress: any; onratechange: any; onreset: any; onresize: any; onscroll: any; onsecuritypolicyviolation: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontoggle: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; ontransitioncancel: any; ontransitionend: any; ontransitionrun: any; ontransitionstart: any; onvolumechange: any; onwaiting: any; onwheel: any; oncopy: any; oncut: any; onpaste: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; dispatchEvent: any; }; withCredentials: { valueOf: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; dispatchEvent: {}; }>'. +!!! error TS2321: Excessive stack depth comparing types 'XMLHttpRequest' and 'Deep<{ onreadystatechange: unknown; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: unknown; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; readonly responseXML: { readonly URL: any; readonly activeElement: any; alinkColor: any; readonly all: any; readonly anchors: any; readonly applets: any; bgColor: any; body: any; readonly characterSet: any; readonly charset: any; readonly compatMode: any; readonly contentType: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; readonly documentElement: any; readonly documentURI: any; domain: any; readonly embeds: any; fgColor: any; readonly forms: any; readonly fullscreen: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; readonly images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; readonly links: any; location: any; onfullscreenchange: any; onfullscreenerror: any; onpointerlockchange: any; onpointerlockerror: any; onreadystatechange: any; onvisibilitychange: any; readonly origin: any; readonly plugins: any; readonly readyState: any; readonly referrer: any; readonly scripts: any; readonly scrollingElement: any; readonly timeline: any; title: any; readonly visibilityState: any; vlinkColor: any; adoptNode: any; captureEvents: any; caretPositionFromPoint: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createEvent: any; createNodeIterator: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; elementsFromPoint: any; evaluate: any; execCommand: any; exitFullscreen: any; exitPointerLock: any; getAnimations: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandValue: any; releaseEvents: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly isConnected: any; readonly lastChild: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; getRootNode: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; readonly fullscreenElement: any; readonly pointerLockElement: any; readonly styleSheets: any; readonly childElementCount: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; append: any; prepend: any; querySelector: any; querySelectorAll: any; onabort: any; onanimationcancel: any; onanimationend: any; onanimationiteration: any; onanimationstart: any; onauxclick: any; onblur: any; oncancel: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; onclose: any; oncontextmenu: any; oncuechange: any; ondblclick: any; ondrag: any; ondragend: any; ondragenter: any; ondragexit: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; ongotpointercapture: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadend: any; onloadstart: any; onlostpointercapture: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onpause: any; onplay: any; onplaying: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onprogress: any; onratechange: any; onreset: any; onresize: any; onscroll: any; onsecuritypolicyviolation: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontoggle: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; ontransitioncancel: any; ontransitionend: any; ontransitionrun: any; ontransitionstart: any; onvolumechange: any; onwaiting: any; onwheel: any; oncopy: any; oncut: any; onpaste: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; [Symbol.iterator]: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; dispatchEvent: any; }; withCredentials: { valueOf: any; }; abort: unknown; getAllResponseHeaders: unknown; getResponseHeader: unknown; open: unknown; overrideMimeType: unknown; send: unknown; setRequestHeader: unknown; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: unknown; removeEventListener: unknown; onabort: unknown; onerror: unknown; onload: unknown; onloadend: unknown; onloadstart: unknown; onprogress: unknown; ontimeout: unknown; dispatchEvent: unknown; }>'. out2.responseXML out2.responseXML.activeElement.className.length \ No newline at end of file diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index 4bfd9b37441ad..c32e65901568e 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -133,13 +133,13 @@ o.hasOwnProperty(Symbol.hasInstance); // Using ES6 promise async function out() { ->out : () => Promise<{}> +>out : () => Promise return new Promise(function (resolve, reject) {}); ->new Promise(function (resolve, reject) {}) : Promise<{}> +>new Promise(function (resolve, reject) {}) : Promise >Promise : PromiseConstructor ->function (resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function (resolve, reject) {} : (resolve: (value?: unknown) => void, reject: (reason?: any) => void) => void +>resolve : (value?: unknown) => void >reject : (reason?: any) => void } @@ -148,10 +148,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->out() : Promise<{}> ->out : () => Promise<{}> ->then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out().then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out() : Promise +>out : () => Promise +>then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => { console.log("Yea!");} : () => void console.log("Yea!"); diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index cfc9dd398232c..a8dd60b1f8c51 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -133,13 +133,13 @@ o.hasOwnProperty(Symbol.hasInstance); // Using ES6 promise async function out() { ->out : () => Promise<{}> +>out : () => Promise return new Promise(function (resolve, reject) {}); ->new Promise(function (resolve, reject) {}) : Promise<{}> +>new Promise(function (resolve, reject) {}) : Promise >Promise : PromiseConstructor ->function (resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function (resolve, reject) {} : (resolve: (value?: unknown) => void, reject: (reason?: any) => void) => void +>resolve : (value?: unknown) => void >reject : (reason?: any) => void } @@ -148,10 +148,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->out() : Promise<{}> ->out : () => Promise<{}> ->then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out().then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out() : Promise +>out : () => Promise +>then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => { console.log("Yea!");} : () => void console.log("Yea!"); diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index f9203bbc639e4..222c5ab0c11af 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -133,13 +133,13 @@ o.hasOwnProperty(Symbol.hasInstance); // Using ES6 promise async function out() { ->out : () => Promise<{}> +>out : () => Promise return new Promise(function (resolve, reject) {}); ->new Promise(function (resolve, reject) {}) : Promise<{}> +>new Promise(function (resolve, reject) {}) : Promise >Promise : PromiseConstructor ->function (resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function (resolve, reject) {} : (resolve: (value?: unknown) => void, reject: (reason?: any) => void) => void +>resolve : (value?: unknown) => void >reject : (reason?: any) => void } @@ -148,10 +148,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->out() : Promise<{}> ->out : () => Promise<{}> ->then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out().then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out() : Promise +>out : () => Promise +>then : (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => { console.log("Yea!");} : () => void console.log("Yea!"); diff --git a/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt b/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt index 0682caad5b8aa..bb90bcee99943 100644 --- a/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt +++ b/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/mutuallyRecursiveCallbacks.ts(7,1): error TS2322: Type '(bar: Bar) => void' 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 'Foo' is not assignable to type 'Bar<{}>'. Types of parameters 'bar' and 'foo' are incompatible. - Type 'void' is not assignable to type 'Foo<{}>'. + Type 'void' is not assignable to type 'Foo'. ==== tests/cases/compiler/mutuallyRecursiveCallbacks.ts (1 errors) ==== @@ -18,7 +18,7 @@ tests/cases/compiler/mutuallyRecursiveCallbacks.ts(7,1): error TS2322: Type ' !!! error TS2322: Type '(bar: Bar) => void' 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 '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: Type 'void' is not assignable to type 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.errors.txt b/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.errors.txt index 4ba7f6ba09eac..70b04d2658000 100644 --- a/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.errors.txt +++ b/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeRelationships/instanceOf/narrowingGenericTypeFromInstanceof01.ts(13,17): error TS2345: Argument of type 'B' is not assignable to parameter of type 'A<{}>'. - Property 'a' is missing in type 'B' but required in type 'A<{}>'. +tests/cases/conformance/types/typeRelationships/instanceOf/narrowingGenericTypeFromInstanceof01.ts(13,17): error TS2345: Argument of type 'B' is not assignable to parameter of type 'A'. + Property 'a' is missing in type 'B' but required in type 'A'. ==== tests/cases/conformance/types/typeRelationships/instanceOf/narrowingGenericTypeFromInstanceof01.ts (1 errors) ==== @@ -17,8 +17,8 @@ tests/cases/conformance/types/typeRelationships/instanceOf/narrowingGenericTypeF if (x instanceof B) { acceptA(x); ~ -!!! error TS2345: Argument of type 'B' is not assignable to parameter of type 'A<{}>'. -!!! error TS2345: Property 'a' is missing in type 'B' but required in type 'A<{}>'. +!!! error TS2345: Argument of type 'B' is not assignable to parameter of type 'A'. +!!! error TS2345: Property 'a' is missing in type 'B' but required in type 'A'. !!! related TS2728 tests/cases/conformance/types/typeRelationships/instanceOf/narrowingGenericTypeFromInstanceof01.ts:2:17: 'a' is declared here. } diff --git a/tests/baselines/reference/newOperatorConformance.types b/tests/baselines/reference/newOperatorConformance.types index 242ef19bd85e6..d7755c3b8efa3 100644 --- a/tests/baselines/reference/newOperatorConformance.types +++ b/tests/baselines/reference/newOperatorConformance.types @@ -50,12 +50,12 @@ var a: C0; // Generic construct expression with no parentheses var c1 = new T; ->c1 : T<{}> ->new T : T<{}> +>c1 : T +>new T : T >T : typeof T var c1: T<{}>; ->c1 : T<{}> +>c1 : T // Construct expression where constructor is of type 'any' with no parentheses var d = new anyCtor; diff --git a/tests/baselines/reference/newOperatorErrorCases.types b/tests/baselines/reference/newOperatorErrorCases.types index 1813b581c0024..dd2d57413fad5 100644 --- a/tests/baselines/reference/newOperatorErrorCases.types +++ b/tests/baselines/reference/newOperatorErrorCases.types @@ -49,12 +49,12 @@ var b = new C0 32, ''; // Parse error // Generic construct expression with no parentheses var c1 = new T; ->c1 : T<{}> ->new T : T<{}> +>c1 : T +>new T : T >T : typeof T var c1: T<{}>; ->c1 : T<{}> +>c1 : T var c2 = new T; // Parse error >c2 : T diff --git a/tests/baselines/reference/objectLiteralContextualTyping.errors.txt b/tests/baselines/reference/objectLiteralContextualTyping.errors.txt new file mode 100644 index 0000000000000..b73b7b43a89c9 --- /dev/null +++ b/tests/baselines/reference/objectLiteralContextualTyping.errors.txt @@ -0,0 +1,36 @@ +tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts(29,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'unknown', but here has type '{}'. + + +==== tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts (1 errors) ==== + // In a contextually typed object literal, each property value expression is contextually typed by + // the type of the property with a matching name in the contextual type, if any, or otherwise + // for a numerically named property, the numeric index type of the contextual type, if any, or otherwise + // the string index type of the contextual type, if any. + + interface Item { + name: string; + description?: string; + } + + declare function foo(item: Item): string; + declare function foo(item: any): number; + + var x = foo({ name: "Sprocket" }); + var x: string; + + var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); + var y: string; + + var z = foo({ name: "Sprocket", description: false }); + var z: number; + + var w = foo({ a: 10 }); + var w: number; + + declare function bar(param: { x?: T }): T; + + var b = bar({}); + var b: {}; + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'unknown', but here has type '{}'. + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralContextualTyping.types b/tests/baselines/reference/objectLiteralContextualTyping.types index 357ed863ab6d4..d2982298ad955 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.types +++ b/tests/baselines/reference/objectLiteralContextualTyping.types @@ -74,11 +74,11 @@ declare function bar(param: { x?: T }): T; >x : T var b = bar({}); ->b : {} ->bar({}) : {} +>b : unknown +>bar({}) : unknown >bar : (param: { x?: T; }) => T >{} : {} var b: {}; ->b : {} +>b : unknown diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.types b/tests/baselines/reference/overloadResolutionClassConstructors.types index 65adbe6c669dd..a1f86b9a97285 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.types +++ b/tests/baselines/reference/overloadResolutionClassConstructors.types @@ -94,7 +94,7 @@ new fn2('', 0); // OK // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments new fn2('', 0); // OK ->new fn2('', 0) : fn2<{}> +>new fn2('', 0) : fn2 >fn2 : typeof fn2 >'' : "" >0 : 0 @@ -120,12 +120,12 @@ class fn3 { } new fn3(3); ->new fn3(3) : fn3 +>new fn3(3) : fn3 >fn3 : typeof fn3 >3 : 3 new fn3('', 3, ''); ->new fn3('', 3, '') : fn3 +>new fn3('', 3, '') : fn3 >fn3 : typeof fn3 >'' : "" >3 : 3 diff --git a/tests/baselines/reference/parameterReferenceInInitializer1.types b/tests/baselines/reference/parameterReferenceInInitializer1.types index 16924d311a483..3ea9bd81b03f9 100644 --- a/tests/baselines/reference/parameterReferenceInInitializer1.types +++ b/tests/baselines/reference/parameterReferenceInInitializer1.types @@ -20,8 +20,8 @@ class C { >y : Y public x = fn(y, (y, x) => y.x = x) // expected to work, but actually doesn't ->x : {} ->fn(y, (y, x) => y.x = x) : {} +>x : unknown +>fn(y, (y, x) => y.x = x) : unknown >fn : (y: Y, set: (y: Y, x: number) => void) => a >y : Y >(y, x) => y.x = x : (y: Y, x: number) => number diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types index bebee723fc9f8..9920cac1b432c 100644 --- a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types @@ -19,13 +19,13 @@ module Query { } function fromOrderBy() { ->fromOrderBy : () => Iterator<{}> +>fromOrderBy : () => Iterator return fromDoWhile(test => { ->fromDoWhile(test => { return true; }) : Iterator<{}> +>fromDoWhile(test => { return true; }) : Iterator >fromDoWhile : (doWhile: (test: Iterator) => boolean) => Iterator ->test => { return true; } : (test: Iterator<{}>) => true ->test : Iterator<{}> +>test => { return true; } : (test: Iterator) => true +>test : Iterator return true; >true : true diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types index db5ef5ee38d10..a14f69145c861 100644 --- a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types @@ -26,7 +26,7 @@ module Q { >bar : () => void foo(null); ->foo(null) : (a: Iterator<{}>) => number +>foo(null) : (a: Iterator) => number >foo : (x: (a: Iterator) => number) => (a: Iterator) => number >null : null } diff --git a/tests/baselines/reference/promisePermutations.types b/tests/baselines/reference/promisePermutations.types index 8020dba47a882..0dbe5f7ec0eb0 100644 --- a/tests/baselines/reference/promisePermutations.types +++ b/tests/baselines/reference/promisePermutations.types @@ -1018,19 +1018,19 @@ var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, >sIPromise : (x: any) => IPromise var r10 = testFunction10(x => x); ->r10 : IPromise<{}> ->testFunction10(x => x) : IPromise<{}> +>r10 : IPromise +>testFunction10(x => x) : IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >x => x : (x: U) => U >x : U >x : U var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok ->r10a : IPromise<{}> ->r10.then(testFunction10, testFunction10, testFunction10) : IPromise<{}> ->r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->r10 : IPromise<{}> ->then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10a : IPromise +>r10.then(testFunction10, testFunction10, testFunction10) : IPromise +>r10.then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10 : IPromise +>then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1038,9 +1038,9 @@ var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok >r10b : IPromise >r10.then(sIPromise, sIPromise, sIPromise) : IPromise ->r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->r10 : IPromise<{}> ->then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10.then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10 : IPromise +>then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1048,9 +1048,9 @@ var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok >r10c : IPromise >r10.then(nIPromise, nIPromise, nIPromise) : IPromise ->r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->r10 : IPromise<{}> ->then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10.then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10 : IPromise +>then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1058,9 +1058,9 @@ var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok >r10d : any >r10.then(testFunction, sIPromise, nIPromise) : any ->r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->r10 : IPromise<{}> ->then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10.then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10 : IPromise +>then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >testFunction : () => IPromise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1070,9 +1070,9 @@ var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromis >r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise) : IPromise >r10.then(testFunction, nIPromise, sIPromise).then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r10.then(testFunction, nIPromise, sIPromise) : IPromise ->r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->r10 : IPromise<{}> ->then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10.then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10 : IPromise +>then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >testFunction : () => IPromise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1082,39 +1082,39 @@ var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromis >sIPromise : (x: any) => IPromise var s10 = testFunction10P(x => x); ->s10 : Promise<{}> ->testFunction10P(x => x) : Promise<{}> +>s10 : Promise +>testFunction10P(x => x) : Promise >testFunction10P : (cb: (a: U) => U) => Promise >x => x : (x: U) => U >x : U >x : U var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok ->s10a : Promise> ->s10.then(testFunction10, testFunction10, testFunction10) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10a : Promise> +>s10.then(testFunction10, testFunction10, testFunction10) : Promise> +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok ->s10b : Promise<{}> ->s10.then(testFunction10P, testFunction10P, testFunction10P) : Promise<{}> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10b : Promise +>s10.then(testFunction10P, testFunction10P, testFunction10P) : Promise +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok ->s10c : Promise<{}> ->s10.then(testFunction10P, testFunction10, testFunction10) : Promise<{}> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10c : Promise +>s10.then(testFunction10P, testFunction10, testFunction10) : Promise +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1122,9 +1122,9 @@ var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok var s10d = s10.then(sPromise, sPromise, sPromise); // ok >s10d : Promise >s10.then(sPromise, sPromise, sPromise) : Promise ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise @@ -1132,9 +1132,9 @@ var s10d = s10.then(sPromise, sPromise, sPromise); // ok var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok >s10e : Promise> >s10.then(nIPromise, nPromise, nIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nPromise : (x: any) => Promise >nIPromise : (x: any) => IPromise @@ -1142,9 +1142,9 @@ var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error >s10f : any >s10.then(testFunctionP, sIPromise, nIPromise) : any ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1154,9 +1154,9 @@ var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromis >s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise) : Promise> >s10.then(testFunctionP, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10.then(testFunctionP, nIPromise, sIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1220,8 +1220,8 @@ var r12 = testFunction12(x => x); >x : any var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok ->r12a : IPromise<{}> ->r12.then(testFunction12, testFunction12, testFunction12) : IPromise<{}> +>r12a : IPromise +>r12.then(testFunction12, testFunction12, testFunction12) : IPromise >r12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r12 : IPromise<(x: any) => any> >then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1238,8 +1238,8 @@ var s12 = testFunction12(x => x); >x : any var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok ->s12a : IPromise<{}> ->s12.then(testFunction12, testFunction12, testFunction12) : IPromise<{}> +>s12a : IPromise +>s12.then(testFunction12, testFunction12, testFunction12) : IPromise >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >s12 : IPromise<(x: any) => any> >then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1248,8 +1248,8 @@ var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok >testFunction12 : { (x: T): IPromise; (x: T, y: T): IPromise; } var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok ->s12b : IPromise<{}> ->s12.then(testFunction12P, testFunction12P, testFunction12P) : IPromise<{}> +>s12b : IPromise +>s12.then(testFunction12P, testFunction12P, testFunction12P) : IPromise >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >s12 : IPromise<(x: any) => any> >then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1258,8 +1258,8 @@ var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok >testFunction12P : { (x: T): IPromise; (x: T, y: T): Promise; } var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok ->s12c : IPromise<{}> ->s12.then(testFunction12P, testFunction12, testFunction12) : IPromise<{}> +>s12c : IPromise +>s12.then(testFunction12P, testFunction12, testFunction12) : IPromise >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >s12 : IPromise<(x: any) => any> >then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } diff --git a/tests/baselines/reference/promisePermutations2.types b/tests/baselines/reference/promisePermutations2.types index 743565a600b81..957b548a284b8 100644 --- a/tests/baselines/reference/promisePermutations2.types +++ b/tests/baselines/reference/promisePermutations2.types @@ -993,19 +993,19 @@ var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, >sIPromise : (x: any) => IPromise var r10 = testFunction10(x => x); ->r10 : IPromise<{}> ->testFunction10(x => x) : IPromise<{}> +>r10 : IPromise +>testFunction10(x => x) : IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >x => x : (x: U) => U >x : U >x : U var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok ->r10a : IPromise<{}> ->r10.then(testFunction10, testFunction10, testFunction10) : IPromise<{}> ->r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->r10 : IPromise<{}> ->then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10a : IPromise +>r10.then(testFunction10, testFunction10, testFunction10) : IPromise +>r10.then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10 : IPromise +>then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1013,9 +1013,9 @@ var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok >r10b : IPromise >r10.then(sIPromise, sIPromise, sIPromise) : IPromise ->r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->r10 : IPromise<{}> ->then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10.then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10 : IPromise +>then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1023,9 +1023,9 @@ var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok >r10c : IPromise >r10.then(nIPromise, nIPromise, nIPromise) : IPromise ->r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->r10 : IPromise<{}> ->then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10.then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10 : IPromise +>then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1033,9 +1033,9 @@ var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // error >r10d : any >r10.then(testFunction, sIPromise, nIPromise) : any ->r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->r10 : IPromise<{}> ->then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10.then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10 : IPromise +>then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >testFunction : () => IPromise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1045,9 +1045,9 @@ var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromis >r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise) : IPromise >r10.then(testFunction, nIPromise, sIPromise).then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r10.then(testFunction, nIPromise, sIPromise) : IPromise ->r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->r10 : IPromise<{}> ->then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10.then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } +>r10 : IPromise +>then : { (success?: (value: unknown) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >testFunction : () => IPromise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1057,39 +1057,39 @@ var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromis >sIPromise : (x: any) => IPromise var s10 = testFunction10P(x => x); ->s10 : Promise<{}> ->testFunction10P(x => x) : Promise<{}> +>s10 : Promise +>testFunction10P(x => x) : Promise >testFunction10P : (cb: (a: U) => U) => Promise >x => x : (x: U) => U >x : U >x : U var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok ->s10a : Promise> ->s10.then(testFunction10, testFunction10, testFunction10) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10a : Promise> +>s10.then(testFunction10, testFunction10, testFunction10) : Promise> +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok ->s10b : Promise> ->s10.then(testFunction10P, testFunction10P, testFunction10P) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10b : Promise> +>s10.then(testFunction10P, testFunction10P, testFunction10P) : Promise> +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok ->s10c : Promise> ->s10.then(testFunction10P, testFunction10, testFunction10) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10c : Promise> +>s10.then(testFunction10P, testFunction10, testFunction10) : Promise> +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1097,9 +1097,9 @@ var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok var s10d = s10.then(sPromise, sPromise, sPromise); // ok >s10d : Promise> >s10.then(sPromise, sPromise, sPromise) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise @@ -1107,9 +1107,9 @@ var s10d = s10.then(sPromise, sPromise, sPromise); // ok var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok >s10e : Promise> >s10.then(nIPromise, nPromise, nIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nPromise : (x: any) => Promise >nIPromise : (x: any) => IPromise @@ -1117,9 +1117,9 @@ var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error >s10f : any >s10.then(testFunctionP, sIPromise, nIPromise) : any ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1129,9 +1129,9 @@ var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromis >s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise) : Promise> >s10.then(testFunctionP, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10.then(testFunctionP, nIPromise, sIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1195,8 +1195,8 @@ var r12 = testFunction12(x => x); >x : any var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok ->r12a : IPromise<{}> ->r12.then(testFunction12, testFunction12, testFunction12) : IPromise<{}> +>r12a : IPromise +>r12.then(testFunction12, testFunction12, testFunction12) : IPromise >r12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r12 : IPromise<(x: any) => any> >then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1213,8 +1213,8 @@ var s12 = testFunction12(x => x); >x : any var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok ->s12a : IPromise<{}> ->s12.then(testFunction12, testFunction12, testFunction12) : IPromise<{}> +>s12a : IPromise +>s12.then(testFunction12, testFunction12, testFunction12) : IPromise >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >s12 : IPromise<(x: any) => any> >then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1223,8 +1223,8 @@ var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok >testFunction12 : { (x: T): IPromise; (x: T, y: T): IPromise; } var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok ->s12b : IPromise<{}> ->s12.then(testFunction12P, testFunction12P, testFunction12P) : IPromise<{}> +>s12b : IPromise +>s12.then(testFunction12P, testFunction12P, testFunction12P) : IPromise >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >s12 : IPromise<(x: any) => any> >then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1233,8 +1233,8 @@ var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok >testFunction12P : { (x: T): IPromise; (x: T, y: T): Promise; } var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok ->s12c : IPromise<{}> ->s12.then(testFunction12P, testFunction12, testFunction12) : IPromise<{}> +>s12c : IPromise +>s12.then(testFunction12P, testFunction12, testFunction12) : IPromise >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >s12 : IPromise<(x: any) => any> >then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 7f12ee8609a64..83a161af960d4 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -65,8 +65,8 @@ tests/cases/compiler/promisePermutations3.ts(159,21): error TS2345: Argument of Types of parameters 'onfulfilled' and 'success' are incompatible. Types of parameters 'value' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<{}>'. - Property 'catch' is missing in type 'IPromise' but required in type 'Promise<{}>'. +tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. + Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. ==== tests/cases/compiler/promisePermutations3.ts (35 errors) ==== @@ -338,7 +338,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<{}>'. -!!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise<{}>'. +!!! error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. +!!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. !!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations3.types b/tests/baselines/reference/promisePermutations3.types index f8bf272e552d8..a643b89b23ba9 100644 --- a/tests/baselines/reference/promisePermutations3.types +++ b/tests/baselines/reference/promisePermutations3.types @@ -993,19 +993,19 @@ var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, >sIPromise : (x: any) => IPromise var r10 = testFunction10(x => x); ->r10 : IPromise<{}> ->testFunction10(x => x) : IPromise<{}> +>r10 : IPromise +>testFunction10(x => x) : IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >x => x : (x: U) => U >x : U >x : U var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok ->r10a : IPromise> ->r10.then(testFunction10, testFunction10, testFunction10) : IPromise> ->r10.then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise ->r10 : IPromise<{}> ->then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise +>r10a : IPromise> +>r10.then(testFunction10, testFunction10, testFunction10) : IPromise> +>r10.then : (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise +>r10 : IPromise +>then : (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1013,9 +1013,9 @@ var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok >r10b : IPromise> >r10.then(sIPromise, sIPromise, sIPromise) : IPromise> ->r10.then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise ->r10 : IPromise<{}> ->then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise +>r10.then : (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise +>r10 : IPromise +>then : (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1023,9 +1023,9 @@ var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok >r10c : IPromise> >r10.then(nIPromise, nIPromise, nIPromise) : IPromise> ->r10.then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise ->r10 : IPromise<{}> ->then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise +>r10.then : (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise +>r10 : IPromise +>then : (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1033,9 +1033,9 @@ var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // error >r10d : any >r10.then(testFunction, sIPromise, nIPromise) : any ->r10.then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise ->r10 : IPromise<{}> ->then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise +>r10.then : (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise +>r10 : IPromise +>then : (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >testFunction : () => IPromise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1045,9 +1045,9 @@ var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromis >r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise) : IPromise> >r10.then(testFunction, nIPromise, sIPromise).then : (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r10.then(testFunction, nIPromise, sIPromise) : IPromise> ->r10.then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise ->r10 : IPromise<{}> ->then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise +>r10.then : (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise +>r10 : IPromise +>then : (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >testFunction : () => IPromise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1057,39 +1057,39 @@ var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromis >sIPromise : (x: any) => IPromise var s10 = testFunction10P(x => x); ->s10 : Promise<{}> ->testFunction10P(x => x) : Promise<{}> +>s10 : Promise +>testFunction10P(x => x) : Promise >testFunction10P : (cb: (a: U) => U) => Promise >x => x : (x: U) => U >x : U >x : U var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok ->s10a : Promise> ->s10.then(testFunction10, testFunction10, testFunction10) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10a : Promise> +>s10.then(testFunction10, testFunction10, testFunction10) : Promise> +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok ->s10b : Promise<{}> ->s10.then(testFunction10P, testFunction10P, testFunction10P) : Promise<{}> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10b : Promise +>s10.then(testFunction10P, testFunction10P, testFunction10P) : Promise +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10P : (cb: (a: U) => U) => Promise var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok ->s10c : Promise<{}> ->s10.then(testFunction10P, testFunction10, testFunction10) : Promise<{}> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10c : Promise +>s10.then(testFunction10P, testFunction10, testFunction10) : Promise +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunction10P : (cb: (a: U) => U) => Promise >testFunction10 : (cb: (a: U) => U) => IPromise >testFunction10 : (cb: (a: U) => U) => IPromise @@ -1097,9 +1097,9 @@ var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok var s10d = s10.then(sPromise, sPromise, sPromise); // ok >s10d : Promise >s10.then(sPromise, sPromise, sPromise) : Promise ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise >sPromise : (x: any) => Promise @@ -1107,9 +1107,9 @@ var s10d = s10.then(sPromise, sPromise, sPromise); // ok var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok >s10e : Promise> >s10.then(nIPromise, nPromise, nIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >nIPromise : (x: any) => IPromise >nPromise : (x: any) => Promise >nIPromise : (x: any) => IPromise @@ -1117,9 +1117,9 @@ var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error >s10f : any >s10.then(testFunctionP, sIPromise, nIPromise) : any ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >sIPromise : (x: any) => IPromise >nIPromise : (x: any) => IPromise @@ -1129,9 +1129,9 @@ var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromis >s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise) : Promise> >s10.then(testFunctionP, nIPromise, sIPromise).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10.then(testFunctionP, nIPromise, sIPromise) : Promise> ->s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } ->s10 : Promise<{}> ->then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10.then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } +>s10 : Promise +>then : { (onfulfilled?: (value: unknown) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: unknown) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >testFunctionP : () => Promise >nIPromise : (x: any) => IPromise >sIPromise : (x: any) => IPromise @@ -1195,8 +1195,8 @@ var r12 = testFunction12(x => x); >x : any var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok ->r12a : IPromise> ->r12.then(testFunction12, testFunction12, testFunction12) : IPromise> +>r12a : IPromise> +>r12.then(testFunction12, testFunction12, testFunction12) : IPromise> >r12.then : (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r12 : IPromise<(x: any) => any> >then : (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -1213,8 +1213,8 @@ var s12 = testFunction12(x => x); >x : any var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok ->s12a : IPromise> ->s12.then(testFunction12, testFunction12, testFunction12) : IPromise> +>s12a : IPromise> +>s12.then(testFunction12, testFunction12, testFunction12) : IPromise> >s12.then : (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >s12 : IPromise<(x: any) => any> >then : (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -1233,8 +1233,8 @@ var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok >testFunction12P : { (x: T): IPromise; (x: T, y: T): Promise; } var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok ->s12c : IPromise> ->s12.then(testFunction12P, testFunction12, testFunction12) : IPromise> +>s12c : IPromise> +>s12.then(testFunction12P, testFunction12, testFunction12) : IPromise> >s12.then : (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >s12 : IPromise<(x: any) => any> >then : (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.errors.txt b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.errors.txt new file mode 100644 index 0000000000000..d2c1bb09ebd36 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.errors.txt @@ -0,0 +1,40 @@ +tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithoutConstraints.ts(21,18): error TS2571: Object is of type 'unknown'. +tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithoutConstraints.ts(22,19): error TS2571: Object is of type 'unknown'. + + +==== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithoutConstraints.ts (2 errors) ==== + class C { + f() { + var x: T; + var a = x['toString'](); // should be string + return a + x.toString(); + } + } + + var r = (new C()).f(); + + interface I { + foo: T; + } + var i: I; + var r2 = i.foo.toString(); + var r2b = i.foo['toString'](); + + var a: { + (): T; + } + var r3: string = a().toString(); + ~~~ +!!! error TS2571: Object is of type 'unknown'. + var r3b: string = a()['toString'](); + ~~~ +!!! error TS2571: Object is of type 'unknown'. + + var b = { + foo: (x: T) => { + var a = x['toString'](); // should be string + return a + x.toString(); + } + } + + var r4 = b.foo(1); \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.symbols b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.symbols index fbbfb557ef6f1..d8e8684e6fe59 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.symbols +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.symbols @@ -65,14 +65,11 @@ var a: { } var r3: string = a().toString(); >r3 : Symbol(r3, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 20, 3)) ->a().toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 17, 3)) ->toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --)) var r3b: string = a()['toString'](); >r3b : Symbol(r3b, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 21, 3)) >a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 17, 3)) ->'toString' : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --)) var b = { >b : Symbol(b, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 23, 3)) diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types index 89e10b506c666..f2806f69e07f0 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types @@ -66,17 +66,17 @@ var a: { } var r3: string = a().toString(); >r3 : string ->a().toString() : string ->a().toString : () => string ->a() : {} +>a().toString() : any +>a().toString : any +>a() : unknown >a : () => T ->toString : () => string +>toString : any var r3b: string = a()['toString'](); >r3b : string ->a()['toString']() : string ->a()['toString'] : () => string ->a() : {} +>a()['toString']() : any +>a()['toString'] : any +>a() : unknown >a : () => T >'toString' : "toString" diff --git a/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt b/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt new file mode 100644 index 0000000000000..1c7b94a04637c --- /dev/null +++ b/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt @@ -0,0 +1,225 @@ +tests/cases/compiler/reactReduxLikeDeferredInferenceAllowsAssignment.ts(76,50): error TS2344: Type 'GetProps' does not satisfy the constraint 'Shared>'. + Type 'unknown' is not assignable to type 'Shared>'. + Type 'Matching>' is not assignable to type 'Shared>'. + Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[P] | (TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + + +==== tests/cases/compiler/reactReduxLikeDeferredInferenceAllowsAssignment.ts (1 errors) ==== + declare class Component

{ + constructor(props: Readonly

); + constructor(props: P, context?: any); + readonly props: Readonly

& Readonly<{ children?: {} }>; + } + interface ComponentClass

{ + new (props: P, context?: any): Component

; + propTypes?: WeakValidationMap

; + defaultProps?: Partial

; + displayName?: string; + } + interface FunctionComponent

{ + (props: P & { children?: {} }, context?: any): {} | null; + propTypes?: WeakValidationMap

; + defaultProps?: Partial

; + displayName?: string; + } + + declare const nominalTypeHack: unique symbol; + interface Validator { + ( + props: object, + propName: string, + componentName: string, + location: string, + propFullName: string + ): Error | null; + [nominalTypeHack]?: T; + } + type WeakValidationMap = { + [K in keyof T]?: null extends T[K] + ? Validator + : undefined extends T[K] + ? Validator + : Validator + }; + type ComponentType

= ComponentClass

| FunctionComponent

; + + type Shared< + InjectedProps, + DecorationTargetProps extends Shared + > = { + [P in Extract< + keyof InjectedProps, + keyof DecorationTargetProps + >]?: InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : never + }; + + // Infers prop type from component C + type GetProps = C extends ComponentType ? P : never; + + type ConnectedComponentClass, P> = ComponentClass< + P + > & { + WrappedComponent: C; + }; + + type Matching = { + [P in keyof DecorationTargetProps]: P extends keyof InjectedProps + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P] + }; + + type Omit = Pick>; + + type InferableComponentEnhancerWithProps = < + C extends ComponentType>> + >( + component: C + ) => ConnectedComponentClass< + C, + Omit, keyof Shared>> & TNeedsProps + ~~~~~~~~~~~ +!!! error TS2344: Type 'GetProps' does not satisfy the constraint 'Shared>'. +!!! error TS2344: Type 'unknown' is not assignable to type 'Shared>'. +!!! error TS2344: Type 'Matching>' is not assignable to type 'Shared>'. +!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[P] | (TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[P]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>] | (TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type '(Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]) | (Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>])' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]) | GetProps[Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] | GetProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]) | GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] | GetProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]) | GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] | GetProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps[keyof TInjectedProps & string] ? GetProps[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'keyof GetProps & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps & string] extends GetProps[keyof TInjectedProps & keyof GetProps & string] ? GetProps[keyof TInjectedProps & keyof GetProps & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps & string] : GetProps[keyof GetProps & string]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract>] extends GetProps[keyof TInjectedProps & Extract>] ? GetProps[keyof TInjectedProps & Extract>] : TInjectedProps[keyof TInjectedProps & Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'Extract> extends keyof TInjectedProps ? TInjectedProps[Extract>] extends GetProps[Extract>] ? GetProps[Extract>] : TInjectedProps[Extract>] : GetProps[Extract>]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. +!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps[P] ? GetProps[P] : TInjectedProps[P] : GetProps[P]' is not assignable to type 'TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never'. + >; + + declare const connect: { + ( + mapStateToProps: null | undefined, + mapDispatchToProps: TDispatchProps + ): InferableComponentEnhancerWithProps< + ResolveThunks, + TOwnProps + >; + }; + + type InferThunkActionCreatorType< + TActionCreator extends (...args: any[]) => any + > = TActionCreator extends ( + ...args: infer TParams + ) => (...args: any[]) => infer TReturn + ? (...args: TParams) => TReturn + : TActionCreator; + + type HandleThunkActionCreator = TActionCreator extends ( + ...args: any[] + ) => any + ? InferThunkActionCreatorType + : TActionCreator; + + type ResolveThunks = TDispatchProps extends { + [key: string]: any; + } + ? { [C in keyof TDispatchProps]: HandleThunkActionCreator } + : TDispatchProps; + + interface Dispatch { + (action: T): T; + } + interface Action { + type: T; + } + interface AnyAction extends Action { + [extraProps: string]: any; + } + + const simpleAction = (payload: boolean) => ({ + type: "SIMPLE_ACTION", + payload + }); + const thunkAction = (param1: number, param2: string) => async ( + dispatch: Dispatch, + { foo }: OwnProps + ) => { + return foo; + }; + interface OwnProps { + foo: string; + } + interface TestComponentProps extends OwnProps { + simpleAction: typeof simpleAction; + thunkAction(param1: number, param2: string): Promise; + } + class TestComponent extends Component {} + const mapDispatchToProps = { simpleAction, thunkAction }; + + type Q = HandleThunkActionCreator; + + const Test1 = connect( + null, + mapDispatchToProps + )(TestComponent); + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck3.errors.txt b/tests/baselines/reference/recursiveBaseCheck3.errors.txt index 2c08a3c44d277..888a3ebd66cdf 100644 --- a/tests/baselines/reference/recursiveBaseCheck3.errors.txt +++ b/tests/baselines/reference/recursiveBaseCheck3.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/recursiveBaseCheck3.ts(1,7): error TS2506: 'A' is referenced directly or indirectly in its own base expression. tests/cases/compiler/recursiveBaseCheck3.ts(1,20): error TS2449: Class 'C' used before its declaration. tests/cases/compiler/recursiveBaseCheck3.ts(2,7): error TS2506: 'C' is referenced directly or indirectly in its own base expression. -tests/cases/compiler/recursiveBaseCheck3.ts(4,9): error TS2339: Property 'blah' does not exist on type 'C<{}>'. +tests/cases/compiler/recursiveBaseCheck3.ts(4,9): error TS2339: Property 'blah' does not exist on type 'C'. ==== tests/cases/compiler/recursiveBaseCheck3.ts (4 errors) ==== @@ -17,4 +17,4 @@ tests/cases/compiler/recursiveBaseCheck3.ts(4,9): error TS2339: Property 'blah' (new C).blah; ~~~~ -!!! error TS2339: Property 'blah' does not exist on type 'C<{}>'. \ No newline at end of file +!!! error TS2339: Property 'blah' does not exist on type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck3.types b/tests/baselines/reference/recursiveBaseCheck3.types index 762276cc1d2ba..d48206910177f 100644 --- a/tests/baselines/reference/recursiveBaseCheck3.types +++ b/tests/baselines/reference/recursiveBaseCheck3.types @@ -9,8 +9,8 @@ class C extends A { } (new C).blah; >(new C).blah : any ->(new C) : C<{}> ->new C : C<{}> +>(new C) : C +>new C : C >C : typeof C >blah : any diff --git a/tests/baselines/reference/recursiveBaseCheck4.errors.txt b/tests/baselines/reference/recursiveBaseCheck4.errors.txt index 5616523d14e06..09fee33ced26a 100644 --- a/tests/baselines/reference/recursiveBaseCheck4.errors.txt +++ b/tests/baselines/reference/recursiveBaseCheck4.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/recursiveBaseCheck4.ts(1,7): error TS2506: 'M' is referenced directly or indirectly in its own base expression. -tests/cases/compiler/recursiveBaseCheck4.ts(2,9): error TS2339: Property 'blah' does not exist on type 'M<{}>'. +tests/cases/compiler/recursiveBaseCheck4.ts(2,9): error TS2339: Property 'blah' does not exist on type 'M'. ==== tests/cases/compiler/recursiveBaseCheck4.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/recursiveBaseCheck4.ts(2,9): error TS2339: Property 'blah' !!! error TS2506: 'M' is referenced directly or indirectly in its own base expression. (new M).blah; ~~~~ -!!! error TS2339: Property 'blah' does not exist on type 'M<{}>'. \ No newline at end of file +!!! error TS2339: Property 'blah' does not exist on type 'M'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck4.types b/tests/baselines/reference/recursiveBaseCheck4.types index 4a826c0222be2..bd5e3d6c962b4 100644 --- a/tests/baselines/reference/recursiveBaseCheck4.types +++ b/tests/baselines/reference/recursiveBaseCheck4.types @@ -5,8 +5,8 @@ class M extends M { } (new M).blah; >(new M).blah : any ->(new M) : M<{}> ->new M : M<{}> +>(new M) : M +>new M : M >M : typeof M >blah : any diff --git a/tests/baselines/reference/recursiveBaseCheck5.errors.txt b/tests/baselines/reference/recursiveBaseCheck5.errors.txt index 91a6d5c845616..89c857b741fa9 100644 --- a/tests/baselines/reference/recursiveBaseCheck5.errors.txt +++ b/tests/baselines/reference/recursiveBaseCheck5.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/recursiveBaseCheck5.ts(1,11): error TS2310: Type 'I1' recursively references itself as a base type. -tests/cases/compiler/recursiveBaseCheck5.ts(4,9): error TS2339: Property 'blah' does not exist on type 'X<{}, {}>'. +tests/cases/compiler/recursiveBaseCheck5.ts(4,9): error TS2339: Property 'blah' does not exist on type 'X'. ==== tests/cases/compiler/recursiveBaseCheck5.ts (2 errors) ==== @@ -10,4 +10,4 @@ tests/cases/compiler/recursiveBaseCheck5.ts(4,9): error TS2339: Property 'blah' class X implements I2 { } (new X).blah; ~~~~ -!!! error TS2339: Property 'blah' does not exist on type 'X<{}, {}>'. \ No newline at end of file +!!! error TS2339: Property 'blah' does not exist on type 'X'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck5.types b/tests/baselines/reference/recursiveBaseCheck5.types index 0f0a96f3c8515..fad0205a5333f 100644 --- a/tests/baselines/reference/recursiveBaseCheck5.types +++ b/tests/baselines/reference/recursiveBaseCheck5.types @@ -6,8 +6,8 @@ class X implements I2 { } (new X).blah; >(new X).blah : any ->(new X) : X<{}, {}> ->new X : X<{}, {}> +>(new X) : X +>new X : X >X : typeof X >blah : any diff --git a/tests/baselines/reference/recursiveBaseCheck6.errors.txt b/tests/baselines/reference/recursiveBaseCheck6.errors.txt index 6d453da425fb1..3482167d15e88 100644 --- a/tests/baselines/reference/recursiveBaseCheck6.errors.txt +++ b/tests/baselines/reference/recursiveBaseCheck6.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/recursiveBaseCheck6.ts(1,7): error TS2506: 'S18' is referenced directly or indirectly in its own base expression. -tests/cases/compiler/recursiveBaseCheck6.ts(2,13): error TS2339: Property 'blah' does not exist on type 'S18<{}>'. +tests/cases/compiler/recursiveBaseCheck6.ts(2,13): error TS2339: Property 'blah' does not exist on type 'S18'. ==== tests/cases/compiler/recursiveBaseCheck6.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/recursiveBaseCheck6.ts(2,13): error TS2339: Property 'blah' !!! error TS2506: 'S18' is referenced directly or indirectly in its own base expression. (new S18()).blah; ~~~~ -!!! error TS2339: Property 'blah' does not exist on type 'S18<{}>'. \ No newline at end of file +!!! error TS2339: Property 'blah' does not exist on type 'S18'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck6.types b/tests/baselines/reference/recursiveBaseCheck6.types index ba22aac3d6008..7df0f83c9895f 100644 --- a/tests/baselines/reference/recursiveBaseCheck6.types +++ b/tests/baselines/reference/recursiveBaseCheck6.types @@ -6,8 +6,8 @@ class S18 extends S18<{ S19: A; }>{ } (new S18()).blah; >(new S18()).blah : any ->(new S18()) : S18<{}> ->new S18() : S18<{}> +>(new S18()) : S18 +>new S18() : S18 >S18 : typeof S18 >blah : any diff --git a/tests/baselines/reference/restTupleElements1.errors.txt b/tests/baselines/reference/restTupleElements1.errors.txt index 9782be35566b1..316ecc209aa73 100644 --- a/tests/baselines/reference/restTupleElements1.errors.txt +++ b/tests/baselines/reference/restTupleElements1.errors.txt @@ -22,8 +22,8 @@ tests/cases/conformance/types/tuple/restTupleElements1.ts(34,31): error TS2344: tests/cases/conformance/types/tuple/restTupleElements1.ts(35,31): error TS2344: Type '[number, number, number, string]' does not satisfy the constraint '[number, ...number[]]'. Property '3' is incompatible with rest element type. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/tuple/restTupleElements1.ts(59,4): error TS2345: Argument of type '[]' is not assignable to parameter of type '[{}, ...{}[]]'. - Property '0' is missing in type '[]' but required in type '[{}, ...{}[]]'. +tests/cases/conformance/types/tuple/restTupleElements1.ts(59,4): error TS2345: Argument of type '[]' is not assignable to parameter of type '[unknown, ...unknown[]]'. + Property '0' is missing in type '[]' but required in type '[unknown, ...unknown[]]'. ==== tests/cases/conformance/types/tuple/restTupleElements1.ts (14 errors) ==== @@ -124,8 +124,8 @@ tests/cases/conformance/types/tuple/restTupleElements1.ts(59,4): error TS2345: A f0([]); // Error ~~ -!!! error TS2345: Argument of type '[]' is not assignable to parameter of type '[{}, ...{}[]]'. -!!! error TS2345: Property '0' is missing in type '[]' but required in type '[{}, ...{}[]]'. +!!! error TS2345: Argument of type '[]' is not assignable to parameter of type '[unknown, ...unknown[]]'. +!!! error TS2345: Property '0' is missing in type '[]' but required in type '[unknown, ...unknown[]]'. f0([1]); f0([1, 2, 3]); f0([1, "hello", true]); diff --git a/tests/baselines/reference/returnTypeParameterWithModules.types b/tests/baselines/reference/returnTypeParameterWithModules.types index 0f62a2ea46ce3..d9546bda856d1 100644 --- a/tests/baselines/reference/returnTypeParameterWithModules.types +++ b/tests/baselines/reference/returnTypeParameterWithModules.types @@ -39,7 +39,7 @@ module M2 { >compose : () => void A.reduce(arguments, compose2); ->A.reduce(arguments, compose2) : {}[] +>A.reduce(arguments, compose2) : unknown[] >A.reduce : (ar: any, f: any, e?: any) => A[] >A : typeof A >reduce : (ar: any, f: any, e?: any) => A[] diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types index b08dc02df77a4..d538da4402cf1 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types @@ -177,29 +177,29 @@ someGenerics6 `${ n => n }${ n => n}${ n => n}`; >someGenerics6 `${ n => n }${ n => n}${ n => n}` : void >someGenerics6 : (strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) => void >`${ n => n }${ n => n}${ n => n}` : string ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics6 `${ n => n }${ n => n}${ n => n}`; >someGenerics6 `${ n => n }${ n => n}${ n => n}` : void >someGenerics6 : (strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) => void >`${ n => n }${ n => n}${ n => n}` : string ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; >someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }` : void @@ -230,29 +230,29 @@ someGenerics7 `${ n => n }${ n => n }${ n => n }`; >someGenerics7 `${ n => n }${ n => n }${ n => n }` : void >someGenerics7 : (strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void >`${ n => n }${ n => n }${ n => n }` : string ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics7 `${ n => n }${ n => n }${ n => n }`; >someGenerics7 `${ n => n }${ n => n }${ n => n }` : void >someGenerics7 : (strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void >`${ n => n }${ n => n }${ n => n }` : string ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; >someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}` : void diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types index 88657a6ac0f04..0cb787ec4c12d 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types @@ -177,29 +177,29 @@ someGenerics6 `${ n => n }${ n => n}${ n => n}`; >someGenerics6 `${ n => n }${ n => n}${ n => n}` : void >someGenerics6 : (strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) => void >`${ n => n }${ n => n}${ n => n}` : string ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics6 `${ n => n }${ n => n}${ n => n}`; >someGenerics6 `${ n => n }${ n => n}${ n => n}` : void >someGenerics6 : (strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) => void >`${ n => n }${ n => n}${ n => n}` : string ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; >someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }` : void @@ -230,29 +230,29 @@ someGenerics7 `${ n => n }${ n => n }${ n => n }`; >someGenerics7 `${ n => n }${ n => n }${ n => n }` : void >someGenerics7 : (strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void >`${ n => n }${ n => n }${ n => n }` : string ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics7 `${ n => n }${ n => n }${ n => n }`; >someGenerics7 `${ n => n }${ n => n }${ n => n }` : void >someGenerics7 : (strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void >`${ n => n }${ n => n }${ n => n }` : string ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; >someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}` : void diff --git a/tests/baselines/reference/tsxElementResolution12.errors.txt b/tests/baselines/reference/tsxElementResolution12.errors.txt index 8e9b150d69f8f..4bd82a9b21c5c 100644 --- a/tests/baselines/reference/tsxElementResolution12.errors.txt +++ b/tests/baselines/reference/tsxElementResolution12.errors.txt @@ -1,12 +1,10 @@ tests/cases/conformance/jsx/file.tsx(23,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property. -tests/cases/conformance/jsx/file.tsx(23,2): error TS2322: Type '{ x: number; }' is not assignable to type '{}'. - 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 'string' is not assignable to type 'number'. -==== tests/cases/conformance/jsx/file.tsx (5 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== declare module JSX { interface Element { } interface ElementAttributesProperty { pr: any; } @@ -32,9 +30,6 @@ tests/cases/conformance/jsx/file.tsx(33,7): error TS2322: Type 'string' is not a ; // Error ~~~~~~~~~~~~~~~ !!! error TS2607: JSX element class does not support attributes because it does not have a 'pr' property. - ~~~~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type '{}'. -!!! error TS2322: Property 'x' does not exist on type '{}'. var attributes: any; ; // Error ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt index 742957b66ad4b..7a6a6fbdcbacc 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt @@ -1,6 +1,6 @@ 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(13,15): error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes & { prop: unknown; "ignore-prop": string; }'. + Type 'T' is not assignable to type '{ prop: unknown; "ignore-prop": 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. @@ -25,8 +25,8 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) = function Baz(arg: T) { let a0 = ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes & { prop: {}; "ignore-prop": string; }'. -!!! error TS2322: Type 'T' is not assignable to type '{ prop: {}; "ignore-prop": string; }'. +!!! error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes & { prop: unknown; "ignore-prop": string; }'. +!!! error TS2322: Type 'T' is not assignable to type '{ prop: unknown; "ignore-prop": string; }'. } declare function Link(l: {func: (arg: U)=>void}): JSX.Element; diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index f8b3d08d3f495..38d4435a46d8c 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/jsx/file.tsx(9,15): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: {}; a: number; }'. -tests/cases/conformance/jsx/file.tsx(10,15): error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: {}; a: {}; }'. - Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: {}; a: {}; }'. +tests/cases/conformance/jsx/file.tsx(9,15): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. +tests/cases/conformance/jsx/file.tsx(10,15): error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. + Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -14,11 +14,11 @@ tests/cases/conformance/jsx/file.tsx(10,15): error TS2322: Type 'T & { ignore-pr function Baz(arg1: T, arg2: U) { let a0 = ~~~~~~~~~~~~~~~~~ -!!! error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: {}; a: number; }'. +!!! error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. !!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:49: 'b' is declared here. let a2 = // missing a ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: {}; a: {}; }'. -!!! error TS2322: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: {}; a: {}; }'. +!!! error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. +!!! error TS2322: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'. !!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:55: 'a' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/tsxTypeErrors.errors.txt b/tests/baselines/reference/tsxTypeErrors.errors.txt deleted file mode 100644 index 1539c7c2bb118..0000000000000 --- a/tests/baselines/reference/tsxTypeErrors.errors.txt +++ /dev/null @@ -1,46 +0,0 @@ -tests/cases/conformance/jsx/tsxTypeErrors.tsx(25,11): error TS2322: Type '{ reqd: boolean; }' is not assignable to type '{}'. - Property 'reqd' does not exist on type '{}'. -tests/cases/conformance/jsx/tsxTypeErrors.tsx(31,11): error TS2322: Type '{ pt: { x: number; y: string; }; }' is not assignable to type '{}'. - Property 'pt' does not exist on type '{}'. - - -==== tests/cases/conformance/jsx/tsxTypeErrors.tsx (2 errors) ==== - // A built-in element (OK) - var a1 =

; - - // A built-in element with a mistyped property (error) - var a2 = - - // A built-in element with a badly-typed attribute value (error) - var thing = { oops: 100 }; - var a3 =
- - // Mistyped html name (error) - var e1 = - - // A custom type - class MyClass { - props: { - pt?: { x: number; y: number; }; - name?: string; - reqd: boolean; - } - } - - // Let's use it - // TODO: Error on missing 'reqd' - var b1 = ; - ~~~~~~~ -!!! error TS2322: Type '{ reqd: boolean; }' is not assignable to type '{}'. -!!! error TS2322: Property 'reqd' does not exist on type '{}'. - - // Mistyped attribute member - // sample.tsx(23,22): error TS2322: Type '{ x: number; y: string; }' is not assignable to type '{ x: number; y: number; }'. - // Types of property 'y' are incompatible. - // Type 'string' is not assignable to type 'number'. - var b2 = ; - ~~~~~~~ -!!! error TS2322: Type '{ pt: { x: number; y: string; }; }' is not assignable to type '{}'. -!!! error TS2322: Property 'pt' does not exist on type '{}'. - - \ No newline at end of file diff --git a/tests/baselines/reference/tsxTypeErrors.types b/tests/baselines/reference/tsxTypeErrors.types index 91740cf88dea1..e90b0fdf8c380 100644 --- a/tests/baselines/reference/tsxTypeErrors.types +++ b/tests/baselines/reference/tsxTypeErrors.types @@ -1,15 +1,15 @@ === tests/cases/conformance/jsx/tsxTypeErrors.tsx === // A built-in element (OK) var a1 =
; ->a1 : any ->
: any +>a1 : error +>
: error >div : any >id : string // A built-in element with a mistyped property (error) var a2 = ->a2 : any -> : any +>a2 : error +> : error >img : any >srce : string @@ -21,16 +21,16 @@ var thing = { oops: 100 }; >100 : 100 var a3 =
->a3 : any ->
: any +>a3 : error +>
: error >div : any >id : { oops: number; } >thing : { oops: number; } // Mistyped html name (error) var e1 = ->e1 : any -> : any +>e1 : error +> : error >imag : any >src : string @@ -57,8 +57,8 @@ class MyClass { // Let's use it // TODO: Error on missing 'reqd' var b1 = ; ->b1 : any -> : any +>b1 : error +> : error >MyClass : typeof MyClass >reqd : boolean >true : true @@ -68,8 +68,8 @@ var b1 = ; // Types of property 'y' are incompatible. // Type 'string' is not assignable to type 'number'. var b2 = ; ->b2 : any -> : any +>b2 : error +> : error >MyClass : typeof MyClass >pt : { x: number; y: string; } >{x: 4, y: 'oops'} : { x: number; y: string; } diff --git a/tests/baselines/reference/tupleTypeInference2.types b/tests/baselines/reference/tupleTypeInference2.types index 3074f535742c3..9983ba993efbe 100644 --- a/tests/baselines/reference/tupleTypeInference2.types +++ b/tests/baselines/reference/tupleTypeInference2.types @@ -34,7 +34,7 @@ declare function g(f: B): U; >f : B g([[]] as [void[]]); // U: {} ->g([[]] as [void[]]) : {} +>g([[]] as [void[]]) : unknown >g : (f: B) => U >[[]] as [void[]] : [void[]] >[[]] : [never[]] @@ -48,7 +48,7 @@ declare function h(f: C): U; >f : C h([[]] as [void[]]); // U: {} ->h([[]] as [void[]]) : {} +>h([[]] as [void[]]) : unknown >h : (f: C) => U >[[]] as [void[]] : [void[]] >[[]] : [never[]] diff --git a/tests/baselines/reference/typeArgumentInference.types b/tests/baselines/reference/typeArgumentInference.types index 8e92373f74599..866e413403c61 100644 --- a/tests/baselines/reference/typeArgumentInference.types +++ b/tests/baselines/reference/typeArgumentInference.types @@ -210,15 +210,15 @@ function someGenerics6(a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } someGenerics6(n => n, n => n, n => n); >someGenerics6(n => n, n => n, n => n) : void >someGenerics6 : (a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) => void ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics6(n => n, n => n, n => n); >someGenerics6(n => n, n => n, n => n) : void @@ -259,15 +259,15 @@ function someGenerics7(a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) someGenerics7(n => n, n => n, n => n); >someGenerics7(n => n, n => n, n => n) : void >someGenerics7 : (a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics7(n => n, n => n, n => n); >someGenerics7(n => n, n => n, n => n) : void diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types index af5f3f0c445a8..00d32e52decea 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types @@ -259,15 +259,15 @@ var someGenerics6: someGenerics6; new someGenerics6(n => n, n => n, n => n); >new someGenerics6(n => n, n => n, n => n) : any >someGenerics6 : someGenerics6 ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown new someGenerics6(n => n, n => n, n => n); >new someGenerics6(n => n, n => n, n => n) : any @@ -324,15 +324,15 @@ var someGenerics7: someGenerics7; new someGenerics7(n => n, n => n, n => n); >new someGenerics7(n => n, n => n, n => n) : any >someGenerics7 : someGenerics7 ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown new someGenerics7(n => n, n => n, n => n); >new someGenerics7(n => n, n => n, n => n) : any diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt index 6a691c2045a8e..33e2f2e38c115 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts(6,5): error TS2345: Argument of type 'typeof (Anonymous class)' is not assignable to parameter of type 'typeof (Anonymous class)'. - Property 'prop' is missing in type '(Anonymous class)' but required in type 'foo<{}>.(Anonymous class)'. + Property 'prop' is missing in type '(Anonymous class)' but required in type 'foo.(Anonymous class)'. ==== tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts (1 errors) ==== @@ -11,5 +11,5 @@ tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpre foo(class { static prop = "hello" }).length; ~~~~~ !!! error TS2345: Argument of type 'typeof (Anonymous class)' is not assignable to parameter of type 'typeof (Anonymous class)'. -!!! error TS2345: Property 'prop' is missing in type '(Anonymous class)' but required in type 'foo<{}>.(Anonymous class)'. +!!! error TS2345: Property 'prop' is missing in type '(Anonymous class)' but required in type 'foo.(Anonymous class)'. !!! related TS2728 tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts:1:29: 'prop' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.types b/tests/baselines/reference/typeArgumentInferenceWithConstraints.types index d6d745e7bc4e4..e5d499398ff10 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.types +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.types @@ -300,15 +300,15 @@ function someGenerics7(a: (a: A) => A, b: (b: B) => B, c someGenerics7(n => n, n => n, n => n); // Valid, types of n are respectively >someGenerics7(n => n, n => n, n => n) : void >someGenerics7 : (a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown >n => n : (n: string) => string >n : string >n : string ->n => n : (n: {}) => {} ->n : {} ->n : {} +>n => n : (n: unknown) => unknown +>n : unknown +>n : unknown someGenerics7(n => n, n => n, n => n); >someGenerics7(n => n, n => n, n => n) : void diff --git a/tests/baselines/reference/typeInferenceFixEarly.types b/tests/baselines/reference/typeInferenceFixEarly.types index fa23dc7f1339c..062560586c6df 100644 --- a/tests/baselines/reference/typeInferenceFixEarly.types +++ b/tests/baselines/reference/typeInferenceFixEarly.types @@ -5,9 +5,9 @@ declare function f(p: (t: T) => T): T; >t : T f(n => 3); ->f(n => 3) : {} +>f(n => 3) : unknown >f : (p: (t: T) => T) => T ->n => 3 : (n: {}) => number ->n : {} +>n => 3 : (n: unknown) => number +>n : unknown >3 : 3 diff --git a/tests/baselines/reference/typeOfThisInStaticMembers.types b/tests/baselines/reference/typeOfThisInStaticMembers.types index dedceb364ddaf..8ca2201ae85f1 100644 --- a/tests/baselines/reference/typeOfThisInStaticMembers.types +++ b/tests/baselines/reference/typeOfThisInStaticMembers.types @@ -99,8 +99,8 @@ var r6 = t2.bar(); >bar : () => typeof C2 var r7 = new t2(''); ->r7 : C2<{}> ->new t2('') : C2<{}> +>r7 : C2 +>new t2('') : C2 >t2 : typeof C2 >'' : "" diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index ca8df7922314e..4b16cbd649bde 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,7): error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary<{}>'. - Index signature is missing in type '(string | number | boolean)[]'. +tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,31): error TS2345: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. + Type 'unknown' is not assignable to type 'boolean'. ==== tests/cases/compiler/underscoreTest1_underscoreTests.ts (1 errors) ==== @@ -29,9 +29,9 @@ tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,7): error TS2345: Arg var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); _.all([true, 1, null, 'yes'], _.identity); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary<{}>'. -!!! error TS2345: Index signature is missing in type '(string | number | boolean)[]'. + ~~~~~~~~~~ +!!! error TS2345: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. +!!! error TS2345: Type 'unknown' is not assignable to type 'boolean'. _.any([null, 0, 'yes', false]); diff --git a/tests/baselines/reference/underscoreTest1.types b/tests/baselines/reference/underscoreTest1.types index c247c40cd1d89..5a210c8b2140b 100644 --- a/tests/baselines/reference/underscoreTest1.types +++ b/tests/baselines/reference/underscoreTest1.types @@ -521,7 +521,7 @@ _.compact([0, 1, false, 2, '', 3]); >3 : 3 _.flatten([1, 2, 3, 4]); ->_.flatten([1, 2, 3, 4]) : {}[] +>_.flatten([1, 2, 3, 4]) : unknown[] >_.flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } @@ -532,7 +532,7 @@ _.flatten([1, 2, 3, 4]); >4 : 4 _.flatten([1, [2]]); ->_.flatten([1, [2]]) : {}[] +>_.flatten([1, [2]]) : unknown[] >_.flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } @@ -543,7 +543,7 @@ _.flatten([1, [2]]); // typescript doesn't like the elements being different _.flatten([1, [2], [3, [[4]]]]); ->_.flatten([1, [2], [3, [[4]]]]) : {}[] +>_.flatten([1, [2], [3, [[4]]]]) : unknown[] >_.flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } @@ -558,7 +558,7 @@ _.flatten([1, [2], [3, [[4]]]]); >4 : 4 _.flatten([1, [2], [3, [[4]]]], true); ->_.flatten([1, [2], [3, [[4]]]], true) : {}[] +>_.flatten([1, [2], [3, [[4]]]], true) : unknown[] >_.flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } diff --git a/tests/baselines/reference/useObjectValuesAndEntries1.types b/tests/baselines/reference/useObjectValuesAndEntries1.types index 2346a56895af7..00bf828702c06 100644 --- a/tests/baselines/reference/useObjectValuesAndEntries1.types +++ b/tests/baselines/reference/useObjectValuesAndEntries1.types @@ -77,16 +77,16 @@ var values2 = Object.values({ a: true, b: 2 }); // (number|boolean)[] >2 : 2 var entries3 = Object.entries({}); // [string, {}][] ->entries3 : [string, {}][] ->Object.entries({}) : [string, {}][] +>entries3 : [string, unknown][] +>Object.entries({}) : [string, unknown][] >Object.entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } >Object : ObjectConstructor >entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } >{} : {} var values3 = Object.values({}); // {}[] ->values3 : {}[] ->Object.values({}) : {}[] +>values3 : unknown[] +>Object.values({}) : unknown[] >Object.values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } >Object : ObjectConstructor >values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } @@ -121,16 +121,16 @@ enum E { A, B } >B : E.B var entries5 = Object.entries(E); // [string, any][] ->entries5 : [string, any][] ->Object.entries(E) : [string, any][] +>entries5 : [string, unknown][] +>Object.entries(E) : [string, unknown][] >Object.entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } >Object : ObjectConstructor >entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } >E : typeof E var values5 = Object.values(E); // any[] ->values5 : any[] ->Object.values(E) : any[] +>values5 : unknown[] +>Object.values(E) : unknown[] >Object.values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } >Object : ObjectConstructor >values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } @@ -142,16 +142,16 @@ var i: I = {}; >{} : {} var entries6 = Object.entries(i); // [string, any][] ->entries6 : [string, any][] ->Object.entries(i) : [string, any][] +>entries6 : [string, unknown][] +>Object.entries(i) : [string, unknown][] >Object.entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } >Object : ObjectConstructor >entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } >i : I var values6 = Object.values(i); // any[] ->values6 : any[] ->Object.values(i) : any[] +>values6 : unknown[] +>Object.values(i) : unknown[] >Object.values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } >Object : ObjectConstructor >values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } diff --git a/tests/baselines/reference/usePromiseFinally.types b/tests/baselines/reference/usePromiseFinally.types index 80534c756100b..b704e54231cfd 100644 --- a/tests/baselines/reference/usePromiseFinally.types +++ b/tests/baselines/reference/usePromiseFinally.types @@ -1,15 +1,15 @@ === tests/cases/conformance/es2018/usePromiseFinally.ts === let promise1 = new Promise(function(resolve, reject) {}) ->promise1 : Promise<{}> ->new Promise(function(resolve, reject) {}) .finally(function() {}) : Promise<{}> ->new Promise(function(resolve, reject) {}) .finally : (onfinally?: () => void) => Promise<{}> ->new Promise(function(resolve, reject) {}) : Promise<{}> +>promise1 : Promise +>new Promise(function(resolve, reject) {}) .finally(function() {}) : Promise +>new Promise(function(resolve, reject) {}) .finally : (onfinally?: () => void) => Promise +>new Promise(function(resolve, reject) {}) : Promise >Promise : PromiseConstructor ->function(resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function(resolve, reject) {} : (resolve: (value?: unknown) => void, reject: (reason?: any) => void) => void +>resolve : (value?: unknown) => void >reject : (reason?: any) => void .finally(function() {}); ->finally : (onfinally?: () => void) => Promise<{}> +>finally : (onfinally?: () => void) => Promise >function() {} : () => void diff --git a/tests/cases/fourslash/automaticConstructorToggling.ts b/tests/cases/fourslash/automaticConstructorToggling.ts index 62015a09eb9cf..6bf4f3bab5718 100644 --- a/tests/cases/fourslash/automaticConstructorToggling.ts +++ b/tests/cases/fourslash/automaticConstructorToggling.ts @@ -28,7 +28,7 @@ edit.deleteAtCaret('constructor(val: T) { }'.length); verify.quickInfos({ Asig: "constructor A(): A", Bsig: "constructor B(val: string): B", - Csig: "constructor C<{}>(): C<{}>", // Cannot resolve signature + Csig: "constructor C(): C", // Cannot resolve signature Dsig: "constructor D(val: string): D" // Cannot resolve signature }); @@ -37,6 +37,6 @@ edit.deleteAtCaret("val: T".length); verify.quickInfos({ Asig: "constructor A(): A", Bsig: "constructor B(val: string): B", - Csig: "constructor C<{}>(): C<{}>", // Cannot resolve signature + Csig: "constructor C(): C", // Cannot resolve signature Dsig: "constructor D(): D" }); diff --git a/tests/cases/fourslash/constructorQuickInfo.ts b/tests/cases/fourslash/constructorQuickInfo.ts index 489519641a44f..efb49eb58c4e5 100644 --- a/tests/cases/fourslash/constructorQuickInfo.ts +++ b/tests/cases/fourslash/constructorQuickInfo.ts @@ -8,6 +8,6 @@ verify.quickInfos({ 1: "var x1: SS", - 2: "var x2: SS<{}>", - 3: "var x3: SS<{}>" + 2: "var x2: SS", + 3: "var x3: SS" }); diff --git a/tests/cases/fourslash/genericCombinators2.ts b/tests/cases/fourslash/genericCombinators2.ts index aedadfa301e0a..bff7ec4ffe92d 100644 --- a/tests/cases/fourslash/genericCombinators2.ts +++ b/tests/cases/fourslash/genericCombinators2.ts @@ -75,8 +75,8 @@ verify.quickInfos({ 10: "var r1b: Collection", 11: "var r2a: Collection, number>", 12: "var r2b: Collection, number>", - 13: "var r3a: Collection", - 14: "var r3b: Collection", + 13: "var r3a: Collection", + 14: "var r3b: Collection", 15: "var r4a: Collection", 17: "var r5a: Collection", 18: "var r5b: Collection", diff --git a/tests/cases/fourslash/genericDerivedTypeAcrossModuleBoundary1.ts b/tests/cases/fourslash/genericDerivedTypeAcrossModuleBoundary1.ts index d81aa3b9b8737..d31883f434e77 100644 --- a/tests/cases/fourslash/genericDerivedTypeAcrossModuleBoundary1.ts +++ b/tests/cases/fourslash/genericDerivedTypeAcrossModuleBoundary1.ts @@ -18,5 +18,5 @@ verify.quickInfos({ 1: "var n2: N.D2", - 2: "var n3: N.D2<{}>" + 2: "var n3: N.D2" }); diff --git a/tests/cases/fourslash/genericFunctionSignatureHelp1.ts b/tests/cases/fourslash/genericFunctionSignatureHelp1.ts index 7409fa249dd86..818dea3ad55f2 100644 --- a/tests/cases/fourslash/genericFunctionSignatureHelp1.ts +++ b/tests/cases/fourslash/genericFunctionSignatureHelp1.ts @@ -3,4 +3,4 @@ ////function f(a: T): T { return null; } ////f(/**/ -verify.signatureHelp({ marker: "", text: "f(a: {}): {}" }); +verify.signatureHelp({ marker: "", text: "f(a: unknown): unknown" }); diff --git a/tests/cases/fourslash/genericFunctionSignatureHelp2.ts b/tests/cases/fourslash/genericFunctionSignatureHelp2.ts index a1999b10128a4..d7101267274bf 100644 --- a/tests/cases/fourslash/genericFunctionSignatureHelp2.ts +++ b/tests/cases/fourslash/genericFunctionSignatureHelp2.ts @@ -3,4 +3,4 @@ ////var f = (a: T) => a; ////f(/**/ -verify.signatureHelp({ marker: "", text: "f(a: {}): {}" }); +verify.signatureHelp({ marker: "", text: "f(a: unknown): unknown" }); diff --git a/tests/cases/fourslash/genericFunctionSignatureHelp3.ts b/tests/cases/fourslash/genericFunctionSignatureHelp3.ts index d2180219c2aa6..9980854385c59 100644 --- a/tests/cases/fourslash/genericFunctionSignatureHelp3.ts +++ b/tests/cases/fourslash/genericFunctionSignatureHelp3.ts @@ -17,15 +17,15 @@ ////foo7(1, (/*7*/ // signature help shows y as T verify.signatureHelp( - { marker: "1", text: "foo1(x: number, callback: (y1: {}) => number): void" }, - { marker: "2", text: "foo2(x: number, callback: (y2: {}) => number): void" }, - { marker: "3", text: "callback(y3: {}): number" }, + { marker: "1", text: "foo1(x: number, callback: (y1: unknown) => number): void" }, + { marker: "2", text: "foo2(x: number, callback: (y2: unknown) => number): void" }, + { marker: "3", text: "callback(y3: unknown): number" }, { marker: "4", text: "foo4(x: number, callback: (y4: string) => number): void" }, { marker: "5", text: "callback(y5: string): number" }, ); goTo.marker('6'); -verify.signatureHelp({ text: "foo6(x: number, callback: (y6: {}) => number): void" }); +verify.signatureHelp({ text: "foo6(x: number, callback: (y6: unknown) => number): void" }); edit.insert('string>(null,null);'); // need to make this line parse so we can get reasonable LS answers to later tests -verify.signatureHelp({ marker: "7", text: "foo7(x: number, callback: (y7: {}) => number): void" }); +verify.signatureHelp({ marker: "7", text: "foo7(x: number, callback: (y7: unknown) => number): void" }); diff --git a/tests/cases/fourslash/genericFunctionSignatureHelp3MultiFile.ts b/tests/cases/fourslash/genericFunctionSignatureHelp3MultiFile.ts index eeb27744917a3..0190db800f623 100644 --- a/tests/cases/fourslash/genericFunctionSignatureHelp3MultiFile.ts +++ b/tests/cases/fourslash/genericFunctionSignatureHelp3MultiFile.ts @@ -24,15 +24,15 @@ ////foo7(1, (/*7*/ // signature help shows y as T verify.signatureHelp( - { marker: "1", text: "foo1(x: number, callback: (y1: {}) => number): void" }, - { marker: "2", text: "foo2(x: number, callback: (y2: {}) => number): void" }, - { marker: "3", text: "callback(y3: {}): number" }, + { marker: "1", text: "foo1(x: number, callback: (y1: unknown) => number): void" }, + { marker: "2", text: "foo2(x: number, callback: (y2: unknown) => number): void" }, + { marker: "3", text: "callback(y3: unknown): number" }, { marker: "4", text: "foo4(x: number, callback: (y4: string) => number): void" }, { marker: "5", text: "callback(y5: string): number" }, ); goTo.marker('6'); -verify.signatureHelp({ text: "foo6(x: number, callback: (y6: {}) => number): void" }); +verify.signatureHelp({ text: "foo6(x: number, callback: (y6: unknown) => number): void" }); edit.insert('string>(null,null);'); // need to make this line parse so we can get reasonable LS answers to later tests -verify.signatureHelp({ marker: "7", text: "foo7(x: number, callback: (y7: {}) => number): void" }) +verify.signatureHelp({ marker: "7", text: "foo7(x: number, callback: (y7: unknown) => number): void" }) diff --git a/tests/cases/fourslash/jsxWithTypeParametershasInstantiatedSignatureHelp.tsx b/tests/cases/fourslash/jsxWithTypeParametershasInstantiatedSignatureHelp.tsx index 71859594cea04..d8d7b02a01b48 100644 --- a/tests/cases/fourslash/jsxWithTypeParametershasInstantiatedSignatureHelp.tsx +++ b/tests/cases/fourslash/jsxWithTypeParametershasInstantiatedSignatureHelp.tsx @@ -14,6 +14,6 @@ //// (/>); goTo.marker("1"); -verify.signatureHelp({ text: "SFC(_props: Record): string" }); +verify.signatureHelp({ text: "SFC(_props: Record): string" }); goTo.marker("2"); verify.signatureHelp({ text: "SFC(_props: Record): string" }); diff --git a/tests/cases/fourslash/quickInfo_errorSignatureFillsInTypeParameter.ts b/tests/cases/fourslash/quickInfo_errorSignatureFillsInTypeParameter.ts index 72a81a400f32f..540fba5846839 100644 --- a/tests/cases/fourslash/quickInfo_errorSignatureFillsInTypeParameter.ts +++ b/tests/cases/fourslash/quickInfo_errorSignatureFillsInTypeParameter.ts @@ -3,4 +3,4 @@ ////declare function f(x: number): T; ////const x/**/ = f(); -verify.quickInfoAt("", "const x: {}"); +verify.quickInfoAt("", "const x: unknown"); diff --git a/tests/cases/fourslash/shims-pp/getQuickInfoAtPosition.ts b/tests/cases/fourslash/shims-pp/getQuickInfoAtPosition.ts index 489519641a44f..efb49eb58c4e5 100644 --- a/tests/cases/fourslash/shims-pp/getQuickInfoAtPosition.ts +++ b/tests/cases/fourslash/shims-pp/getQuickInfoAtPosition.ts @@ -8,6 +8,6 @@ verify.quickInfos({ 1: "var x1: SS", - 2: "var x2: SS<{}>", - 3: "var x3: SS<{}>" + 2: "var x2: SS", + 3: "var x3: SS" }); diff --git a/tests/cases/fourslash/shims/getQuickInfoAtPosition.ts b/tests/cases/fourslash/shims/getQuickInfoAtPosition.ts index 489519641a44f..efb49eb58c4e5 100644 --- a/tests/cases/fourslash/shims/getQuickInfoAtPosition.ts +++ b/tests/cases/fourslash/shims/getQuickInfoAtPosition.ts @@ -8,6 +8,6 @@ verify.quickInfos({ 1: "var x1: SS", - 2: "var x2: SS<{}>", - 3: "var x3: SS<{}>" + 2: "var x2: SS", + 3: "var x3: SS" }); diff --git a/tests/cases/fourslash/signatureHelpExplicitTypeArguments.ts b/tests/cases/fourslash/signatureHelpExplicitTypeArguments.ts index b1af18469a888..b68c7640476bf 100644 --- a/tests/cases/fourslash/signatureHelpExplicitTypeArguments.ts +++ b/tests/cases/fourslash/signatureHelpExplicitTypeArguments.ts @@ -9,8 +9,8 @@ verify.signatureHelp( { marker: "1", text: "f(x: number, y: string): number" }, { marker: "2", text: "f(x: boolean, y: string): boolean" }, - // too few -- fill in rest with {} - { marker: "3", text: "f(x: number, y: {}): number" }, + // too few -- fill in rest with unknown + { marker: "3", text: "f(x: number, y: unknown): number" }, // too many -- ignore extra type arguments { marker: "4", text: "f(x: number, y: string): number" }, ); diff --git a/tests/cases/fourslash/signatureHelpInCompleteGenericsCall.ts b/tests/cases/fourslash/signatureHelpInCompleteGenericsCall.ts index a3ea10bd0dc19..3bd1e2c41f070 100644 --- a/tests/cases/fourslash/signatureHelpInCompleteGenericsCall.ts +++ b/tests/cases/fourslash/signatureHelpInCompleteGenericsCall.ts @@ -4,4 +4,4 @@ ////} ////foo(/*1*/ -verify.signatureHelp({ marker: "1", text: "foo(x: number, callback: (x: {}) => number): void" }); +verify.signatureHelp({ marker: "1", text: "foo(x: number, callback: (x: unknown) => number): void" }); diff --git a/tests/cases/fourslash/signatureHelpOnTypePredicates.ts b/tests/cases/fourslash/signatureHelpOnTypePredicates.ts index 1eb0a31c75711..04cc1efd5a002 100644 --- a/tests/cases/fourslash/signatureHelpOnTypePredicates.ts +++ b/tests/cases/fourslash/signatureHelpOnTypePredicates.ts @@ -9,6 +9,6 @@ verify.signatureHelp( { marker: "1", text: "f1(a: any): a is number" }, - { marker: "2", text: "f2(a: any): a is {}" }, + { marker: "2", text: "f2(a: any): a is unknown" }, { marker: "3", text: "f3(a: any, ...b: any[]): a is number", isVariadic: true }, ) diff --git a/tests/cases/fourslash/signatureHelpWithTriggers02.ts b/tests/cases/fourslash/signatureHelpWithTriggers02.ts index 7472ba62de88d..1f70487342733 100644 --- a/tests/cases/fourslash/signatureHelpWithTriggers02.ts +++ b/tests/cases/fourslash/signatureHelpWithTriggers02.ts @@ -9,7 +9,7 @@ goTo.marker("1"); edit.insert("("); verify.signatureHelp({ - text: "bar(x: {}, y: {}): {}", + text: "bar(x: unknown, y: unknown): unknown", triggerReason: { kind: "characterTyped", triggerCharacter: "(", diff --git a/tests/cases/fourslash/staticGenericOverloads1.ts b/tests/cases/fourslash/staticGenericOverloads1.ts index 7b15e6e2a3ed6..e1be87c3b7a61 100644 --- a/tests/cases/fourslash/staticGenericOverloads1.ts +++ b/tests/cases/fourslash/staticGenericOverloads1.ts @@ -15,6 +15,6 @@ verify.signatureHelp({ marker: "", overloadsCount: 2 }); edit.insert('a'); verify.signatureHelp({ overloadsCount: 2, text: "B(v: A): A" }); edit.insert('); A.B('); -verify.signatureHelp({ overloadsCount: 2, text: "B(v: A<{}>): A<{}>" }); +verify.signatureHelp({ overloadsCount: 2, text: "B(v: A): A" }); edit.insert('a'); verify.signatureHelp({ overloadsCount: 2, text: "B(v: A): A" }); From f907b50e7cc2fbcdfb1c460348d719c3431f3e16 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 29 Mar 2019 13:43:42 -0700 Subject: [PATCH 2/4] Relax unknown checking outside of strictNullChecks a bit --- src/compiler/checker.ts | 3 +- ...TypeParameterWithoutConstraints.errors.txt | 40 ------------------- ...sOnTypeParameterWithoutConstraints.symbols | 3 ++ ...essOnTypeParameterWithoutConstraints.types | 10 ++--- 4 files changed, 10 insertions(+), 46 deletions(-) delete mode 100644 tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index fac5e07905820..8026248ab6b65 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7783,6 +7783,7 @@ namespace ts { t.flags & TypeFlags.ESSymbolLike ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= ScriptTarget.ES2015) : t.flags & TypeFlags.NonPrimitive ? emptyObjectType : t.flags & TypeFlags.Index ? keyofConstraintType : + t.flags & TypeFlags.Unknown && !strictNullChecks ? emptyObjectType : t; } @@ -19501,7 +19502,7 @@ namespace ts { undefinedDiagnostic?: DiagnosticMessage, nullOrUndefinedDiagnostic?: DiagnosticMessage ): Type { - if (type.flags & TypeFlags.Unknown) { + if (strictNullChecks && type.flags & TypeFlags.Unknown) { error(node, Diagnostics.Object_is_of_type_unknown); return errorType; } diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.errors.txt b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.errors.txt deleted file mode 100644 index d2c1bb09ebd36..0000000000000 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.errors.txt +++ /dev/null @@ -1,40 +0,0 @@ -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithoutConstraints.ts(21,18): error TS2571: Object is of type 'unknown'. -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithoutConstraints.ts(22,19): error TS2571: Object is of type 'unknown'. - - -==== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithoutConstraints.ts (2 errors) ==== - class C { - f() { - var x: T; - var a = x['toString'](); // should be string - return a + x.toString(); - } - } - - var r = (new C()).f(); - - interface I { - foo: T; - } - var i: I; - var r2 = i.foo.toString(); - var r2b = i.foo['toString'](); - - var a: { - (): T; - } - var r3: string = a().toString(); - ~~~ -!!! error TS2571: Object is of type 'unknown'. - var r3b: string = a()['toString'](); - ~~~ -!!! error TS2571: Object is of type 'unknown'. - - var b = { - foo: (x: T) => { - var a = x['toString'](); // should be string - return a + x.toString(); - } - } - - var r4 = b.foo(1); \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.symbols b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.symbols index d8e8684e6fe59..fbbfb557ef6f1 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.symbols +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.symbols @@ -65,11 +65,14 @@ var a: { } var r3: string = a().toString(); >r3 : Symbol(r3, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 20, 3)) +>a().toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 17, 3)) +>toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --)) var r3b: string = a()['toString'](); >r3b : Symbol(r3b, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 21, 3)) >a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 17, 3)) +>'toString' : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --)) var b = { >b : Symbol(b, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 23, 3)) diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types index f2806f69e07f0..0d1f3a29fdda2 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types @@ -66,16 +66,16 @@ var a: { } var r3: string = a().toString(); >r3 : string ->a().toString() : any ->a().toString : any +>a().toString() : string +>a().toString : () => string >a() : unknown >a : () => T ->toString : any +>toString : () => string var r3b: string = a()['toString'](); >r3b : string ->a()['toString']() : any ->a()['toString'] : any +>a()['toString']() : string +>a()['toString'] : () => string >a() : unknown >a : () => T >'toString' : "toString" From 5dce9909b63ce34925699910f74ee9f0de1aead4 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 29 Mar 2019 14:18:49 -0700 Subject: [PATCH 3/4] Increase strictness on index signatures with type `unknown` so inference doesnt change surprisingly --- src/compiler/checker.ts | 2 +- ...nownStillRequiresIndexSignature.errors.txt | 18 +++++++++ ...fTypeUnknownStillRequiresIndexSignature.js | 19 ++++++++++ ...UnknownStillRequiresIndexSignature.symbols | 30 +++++++++++++++ ...peUnknownStillRequiresIndexSignature.types | 38 +++++++++++++++++++ .../indexSignatureTypeInference.errors.txt | 8 ++-- .../indexSignatureTypeInference.types | 2 +- .../reference/underscoreTest1.errors.txt | 10 ++--- .../reference/unknownType1.errors.txt | 11 ++++-- tests/baselines/reference/unknownType1.js | 8 ++-- .../baselines/reference/unknownType1.symbols | 4 +- tests/baselines/reference/unknownType1.types | 4 +- .../useObjectValuesAndEntries1.types | 16 ++++---- ...fTypeUnknownStillRequiresIndexSignature.ts | 9 +++++ .../conformance/types/unknown/unknownType1.ts | 4 +- 15 files changed, 152 insertions(+), 31 deletions(-) create mode 100644 tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.errors.txt create mode 100644 tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.js create mode 100644 tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.symbols create mode 100644 tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.types create mode 100644 tests/cases/compiler/indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8026248ab6b65..fae7d3e085768 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13350,7 +13350,7 @@ namespace ts { return indexTypesIdenticalTo(source, target, kind); } const targetInfo = getIndexInfoOfType(target, kind); - if (!targetInfo || targetInfo.type.flags & TypeFlags.AnyOrUnknown && !sourceIsPrimitive) { + if (!targetInfo || targetInfo.type.flags & TypeFlags.Any && !sourceIsPrimitive) { // Index signature of type any permits assignment from everything but primitives return Ternary.True; } diff --git a/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.errors.txt b/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.errors.txt new file mode 100644 index 0000000000000..bcc9d9a05b8b8 --- /dev/null +++ b/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts(9,3): error TS2345: Argument of type '{ name: string; age: number; }[]' is not assignable to parameter of type '{ [x: string]: unknown; }'. + Index signature is missing in type '{ name: string; age: number; }[]'. + + +==== tests/cases/compiler/indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts (1 errors) ==== + declare function f(x: { [x: string]: T }): T; + + var stooges = [ + { name: "moe", age: 40 }, + { name: "larry", age: 50 }, + { name: "curly", age: 60 } + ]; + + f(stooges); // Should throw + ~~~~~~~ +!!! error TS2345: Argument of type '{ name: string; age: number; }[]' is not assignable to parameter of type '{ [x: string]: unknown; }'. +!!! error TS2345: Index signature is missing in type '{ name: string; age: number; }[]'. + \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.js b/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.js new file mode 100644 index 0000000000000..395e4a9dc0ab5 --- /dev/null +++ b/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.js @@ -0,0 +1,19 @@ +//// [indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts] +declare function f(x: { [x: string]: T }): T; + +var stooges = [ + { name: "moe", age: 40 }, + { name: "larry", age: 50 }, + { name: "curly", age: 60 } +]; + +f(stooges); // Should throw + + +//// [indexSignatureOfTypeUnknownStillRequiresIndexSignature.js] +var stooges = [ + { name: "moe", age: 40 }, + { name: "larry", age: 50 }, + { name: "curly", age: 60 } +]; +f(stooges); // Should throw diff --git a/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.symbols b/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.symbols new file mode 100644 index 0000000000000..e14e364bb6e12 --- /dev/null +++ b/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts === +declare function f(x: { [x: string]: T }): T; +>f : Symbol(f, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 0, 0)) +>T : Symbol(T, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 0, 19)) +>x : Symbol(x, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 0, 48)) +>x : Symbol(x, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 0, 54)) +>T : Symbol(T, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 0, 19)) +>T : Symbol(T, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 0, 19)) + +var stooges = [ +>stooges : Symbol(stooges, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 2, 3)) + + { name: "moe", age: 40 }, +>name : Symbol(name, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 3, 3)) +>age : Symbol(age, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 3, 16)) + + { name: "larry", age: 50 }, +>name : Symbol(name, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 4, 3)) +>age : Symbol(age, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 4, 18)) + + { name: "curly", age: 60 } +>name : Symbol(name, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 5, 3)) +>age : Symbol(age, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 5, 18)) + +]; + +f(stooges); // Should throw +>f : Symbol(f, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 0, 0)) +>stooges : Symbol(stooges, Decl(indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts, 2, 3)) + diff --git a/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.types b/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.types new file mode 100644 index 0000000000000..95f3ddcaf548b --- /dev/null +++ b/tests/baselines/reference/indexSignatureOfTypeUnknownStillRequiresIndexSignature.types @@ -0,0 +1,38 @@ +=== tests/cases/compiler/indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts === +declare function f(x: { [x: string]: T }): T; +>f : (x: { [x: string]: T; }) => T +>x : { [x: string]: T; } +>x : string + +var stooges = [ +>stooges : { name: string; age: number; }[] +>[ { name: "moe", age: 40 }, { name: "larry", age: 50 }, { name: "curly", age: 60 }] : { name: string; age: number; }[] + + { name: "moe", age: 40 }, +>{ name: "moe", age: 40 } : { name: string; age: number; } +>name : string +>"moe" : "moe" +>age : number +>40 : 40 + + { name: "larry", age: 50 }, +>{ name: "larry", age: 50 } : { name: string; age: number; } +>name : string +>"larry" : "larry" +>age : number +>50 : 50 + + { name: "curly", age: 60 } +>{ name: "curly", age: 60 } : { name: string; age: number; } +>name : string +>"curly" : "curly" +>age : number +>60 : 60 + +]; + +f(stooges); // Should throw +>f(stooges) : any +>f : (x: { [x: string]: T; }) => T +>stooges : { name: string; age: number; }[] + diff --git a/tests/baselines/reference/indexSignatureTypeInference.errors.txt b/tests/baselines/reference/indexSignatureTypeInference.errors.txt index 3002c47127948..aa25f11db5937 100644 --- a/tests/baselines/reference/indexSignatureTypeInference.errors.txt +++ b/tests/baselines/reference/indexSignatureTypeInference.errors.txt @@ -1,4 +1,5 @@ -tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts(18,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v1' must be of type 'Function[]', but here has type 'unknown[]'. +tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts(18,27): error TS2345: Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap'. + Index signature is missing in type 'NumberMap'. ==== tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts (1 errors) ==== @@ -20,7 +21,8 @@ tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureType var v1 = numberMapToArray(numberMap); // Ok var v1 = numberMapToArray(stringMap); // Ok var v1 = stringMapToArray(numberMap); // Error expected here - ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v1' must be of type 'Function[]', but here has type 'unknown[]'. + ~~~~~~~~~ +!!! error TS2345: Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap'. +!!! error TS2345: Index signature is missing in type 'NumberMap'. var v1 = stringMapToArray(stringMap); // Ok \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureTypeInference.types b/tests/baselines/reference/indexSignatureTypeInference.types index 830af609193d6..b29a1d002dd1f 100644 --- a/tests/baselines/reference/indexSignatureTypeInference.types +++ b/tests/baselines/reference/indexSignatureTypeInference.types @@ -40,7 +40,7 @@ var v1 = numberMapToArray(stringMap); // Ok var v1 = stringMapToArray(numberMap); // Error expected here >v1 : Function[] ->stringMapToArray(numberMap) : unknown[] +>stringMapToArray(numberMap) : any >stringMapToArray : (object: StringMap) => T[] >numberMap : NumberMap diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index 4b16cbd649bde..66fc8961eef58 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,31): error TS2345: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. - Type 'unknown' is not assignable to type 'boolean'. +tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,7): error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. + Index signature is missing in type '(string | number | boolean)[]'. ==== tests/cases/compiler/underscoreTest1_underscoreTests.ts (1 errors) ==== @@ -29,9 +29,9 @@ tests/cases/compiler/underscoreTest1_underscoreTests.ts(26,31): error TS2345: Ar var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); _.all([true, 1, null, 'yes'], _.identity); - ~~~~~~~~~~ -!!! error TS2345: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. -!!! error TS2345: Type 'unknown' is not assignable to type 'boolean'. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. +!!! error TS2345: Index signature is missing in type '(string | number | boolean)[]'. _.any([null, 0, 'yes', false]); diff --git a/tests/baselines/reference/unknownType1.errors.txt b/tests/baselines/reference/unknownType1.errors.txt index 57fb611406943..93e2a8660f65e 100644 --- a/tests/baselines/reference/unknownType1.errors.txt +++ b/tests/baselines/reference/unknownType1.errors.txt @@ -18,6 +18,8 @@ tests/cases/conformance/types/unknown/unknownType1.ts(114,9): error TS2322: Type Type 'unknown' is not assignable to type '{}'. tests/cases/conformance/types/unknown/unknownType1.ts(120,9): error TS2322: Type 'T' is not assignable to type 'object'. Type 'unknown' is not assignable to type 'object'. +tests/cases/conformance/types/unknown/unknownType1.ts(128,5): error TS2322: Type 'number[]' is not assignable to type '{ [x: string]: unknown; }'. + Index signature is missing in type 'number[]'. tests/cases/conformance/types/unknown/unknownType1.ts(129,5): error TS2322: Type '123' is not assignable to type '{ [x: string]: unknown; }'. tests/cases/conformance/types/unknown/unknownType1.ts(149,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/types/unknown/unknownType1.ts(155,14): error TS2700: Rest types may only be created from object types. @@ -28,7 +30,7 @@ tests/cases/conformance/types/unknown/unknownType1.ts(180,5): error TS2322: Type Type 'unknown' is not assignable to type '{}'. -==== tests/cases/conformance/types/unknown/unknownType1.ts (24 errors) ==== +==== tests/cases/conformance/types/unknown/unknownType1.ts (25 errors) ==== // In an intersection everything absorbs unknown type T00 = unknown & null; // null @@ -189,12 +191,15 @@ tests/cases/conformance/types/unknown/unknownType1.ts(180,5): error TS2322: Type !!! error TS2322: Type 'unknown' is not assignable to type 'object'. } - // Anything but primitive assignable to { [x: string]: unknown } + // Anything fresh but primitive assignable to { [x: string]: unknown } function f24(x: { [x: string]: unknown }) { x = {}; x = { a: 5 }; - x = [1, 2, 3]; + x = [1, 2, 3]; // Error + ~ +!!! error TS2322: Type 'number[]' is not assignable to type '{ [x: string]: unknown; }'. +!!! error TS2322: Index signature is missing in type 'number[]'. x = 123; // Error ~ !!! error TS2322: Type '123' is not assignable to type '{ [x: string]: unknown; }'. diff --git a/tests/baselines/reference/unknownType1.js b/tests/baselines/reference/unknownType1.js index 9dd1568861f08..b7e40954359f2 100644 --- a/tests/baselines/reference/unknownType1.js +++ b/tests/baselines/reference/unknownType1.js @@ -121,12 +121,12 @@ function f23(x: T) { let y: object = x; // Error } -// Anything but primitive assignable to { [x: string]: unknown } +// Anything fresh but primitive assignable to { [x: string]: unknown } function f24(x: { [x: string]: unknown }) { x = {}; x = { a: 5 }; - x = [1, 2, 3]; + x = [1, 2, 3]; // Error x = 123; // Error } @@ -262,11 +262,11 @@ function f22(x) { function f23(x) { var y = x; // Error } -// Anything but primitive assignable to { [x: string]: unknown } +// Anything fresh but primitive assignable to { [x: string]: unknown } function f24(x) { x = {}; x = { a: 5 }; - x = [1, 2, 3]; + x = [1, 2, 3]; // Error x = 123; // Error } // Locals of type unknown always considered initialized diff --git a/tests/baselines/reference/unknownType1.symbols b/tests/baselines/reference/unknownType1.symbols index a91664fe0293c..d4bdffc0163c8 100644 --- a/tests/baselines/reference/unknownType1.symbols +++ b/tests/baselines/reference/unknownType1.symbols @@ -314,7 +314,7 @@ function f23(x: T) { >x : Symbol(x, Decl(unknownType1.ts, 118, 32)) } -// Anything but primitive assignable to { [x: string]: unknown } +// Anything fresh but primitive assignable to { [x: string]: unknown } function f24(x: { [x: string]: unknown }) { >f24 : Symbol(f24, Decl(unknownType1.ts, 120, 1)) @@ -328,7 +328,7 @@ function f24(x: { [x: string]: unknown }) { >x : Symbol(x, Decl(unknownType1.ts, 124, 13)) >a : Symbol(a, Decl(unknownType1.ts, 126, 9)) - x = [1, 2, 3]; + x = [1, 2, 3]; // Error >x : Symbol(x, Decl(unknownType1.ts, 124, 13)) x = 123; // Error diff --git a/tests/baselines/reference/unknownType1.types b/tests/baselines/reference/unknownType1.types index bd3408a914df8..a464864d0d19d 100644 --- a/tests/baselines/reference/unknownType1.types +++ b/tests/baselines/reference/unknownType1.types @@ -342,7 +342,7 @@ function f23(x: T) { >x : T } -// Anything but primitive assignable to { [x: string]: unknown } +// Anything fresh but primitive assignable to { [x: string]: unknown } function f24(x: { [x: string]: unknown }) { >f24 : (x: { [x: string]: unknown; }) => void @@ -361,7 +361,7 @@ function f24(x: { [x: string]: unknown }) { >a : number >5 : 5 - x = [1, 2, 3]; + x = [1, 2, 3]; // Error >x = [1, 2, 3] : number[] >x : { [x: string]: unknown; } >[1, 2, 3] : number[] diff --git a/tests/baselines/reference/useObjectValuesAndEntries1.types b/tests/baselines/reference/useObjectValuesAndEntries1.types index 00bf828702c06..94deebdfd8caa 100644 --- a/tests/baselines/reference/useObjectValuesAndEntries1.types +++ b/tests/baselines/reference/useObjectValuesAndEntries1.types @@ -121,16 +121,16 @@ enum E { A, B } >B : E.B var entries5 = Object.entries(E); // [string, any][] ->entries5 : [string, unknown][] ->Object.entries(E) : [string, unknown][] +>entries5 : [string, any][] +>Object.entries(E) : [string, any][] >Object.entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } >Object : ObjectConstructor >entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } >E : typeof E var values5 = Object.values(E); // any[] ->values5 : unknown[] ->Object.values(E) : unknown[] +>values5 : any[] +>Object.values(E) : any[] >Object.values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } >Object : ObjectConstructor >values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } @@ -142,16 +142,16 @@ var i: I = {}; >{} : {} var entries6 = Object.entries(i); // [string, any][] ->entries6 : [string, unknown][] ->Object.entries(i) : [string, unknown][] +>entries6 : [string, any][] +>Object.entries(i) : [string, any][] >Object.entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } >Object : ObjectConstructor >entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } >i : I var values6 = Object.values(i); // any[] ->values6 : unknown[] ->Object.values(i) : unknown[] +>values6 : any[] +>Object.values(i) : any[] >Object.values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } >Object : ObjectConstructor >values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } diff --git a/tests/cases/compiler/indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts b/tests/cases/compiler/indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts new file mode 100644 index 0000000000000..82520579dc920 --- /dev/null +++ b/tests/cases/compiler/indexSignatureOfTypeUnknownStillRequiresIndexSignature.ts @@ -0,0 +1,9 @@ +declare function f(x: { [x: string]: T }): T; + +var stooges = [ + { name: "moe", age: 40 }, + { name: "larry", age: 50 }, + { name: "curly", age: 60 } +]; + +f(stooges); // Should throw diff --git a/tests/cases/conformance/types/unknown/unknownType1.ts b/tests/cases/conformance/types/unknown/unknownType1.ts index d1f5ce1126160..633b1407f9686 100644 --- a/tests/cases/conformance/types/unknown/unknownType1.ts +++ b/tests/cases/conformance/types/unknown/unknownType1.ts @@ -122,12 +122,12 @@ function f23(x: T) { let y: object = x; // Error } -// Anything but primitive assignable to { [x: string]: unknown } +// Anything fresh but primitive assignable to { [x: string]: unknown } function f24(x: { [x: string]: unknown }) { x = {}; x = { a: 5 }; - x = [1, 2, 3]; + x = [1, 2, 3]; // Error x = 123; // Error } From d54a4b86a7a5d1dc6b5c3429d1a425d2bf578e17 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 4 Apr 2019 10:28:39 -0700 Subject: [PATCH 4/4] Remove redundant switch --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 230dbefff508d..e0602fa500ba2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7773,7 +7773,7 @@ namespace ts { * type itself. Note that the apparent type of a union type is the union type itself. */ function getApparentType(type: Type): Type { - const t = type.flags & TypeFlags.Instantiable ? getBaseConstraintOfType(type) || (strictNullChecks ? unknownType : emptyObjectType) : type; + const t = type.flags & TypeFlags.Instantiable ? getBaseConstraintOfType(type) || unknownType : type; return getObjectFlags(t) & ObjectFlags.Mapped ? getApparentTypeOfMappedType(t) : t.flags & TypeFlags.Intersection ? getApparentTypeOfIntersectionType(t) : t.flags & TypeFlags.StringLike ? globalStringType :