diff --git a/lib/tsserver.js b/lib/tsserver.js index 6489fac56ccd1..503e7fee6ea4f 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -33624,7 +33624,7 @@ var ts; return type; } // A reserved member name starts with two underscores, but the third character cannot be an underscore - // or the @ symbol. A third underscore indicates an escaped form of an identifer that started + // or the @ symbol. A third underscore indicates an escaped form of an identifier that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES // Symbol instance. function isReservedMemberName(name) { @@ -99911,9 +99911,9 @@ var ts; || ts.isKnownSymbol(symbol)) { return undefined; } - var validIdentiferResult = { name: name, needsConvertPropertyAccess: false }; + var validIdentifierResult = { name: name, needsConvertPropertyAccess: false }; if (ts.isIdentifierText(name, target)) - return validIdentiferResult; + return validIdentifierResult; switch (kind) { case 3 /* MemberLike */: return undefined; @@ -99926,7 +99926,7 @@ var ts; return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true }; case 5 /* None */: case 4 /* String */: - return validIdentiferResult; + return validIdentifierResult; default: ts.Debug.assertNever(kind); } diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 83354bf1d1d3e..aa4e3b1a9df67 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -33623,7 +33623,7 @@ var ts; return type; } // A reserved member name starts with two underscores, but the third character cannot be an underscore - // or the @ symbol. A third underscore indicates an escaped form of an identifer that started + // or the @ symbol. A third underscore indicates an escaped form of an identifier that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES // Symbol instance. function isReservedMemberName(name) { @@ -100250,9 +100250,9 @@ var ts; || ts.isKnownSymbol(symbol)) { return undefined; } - var validIdentiferResult = { name: name, needsConvertPropertyAccess: false }; + var validIdentifierResult = { name: name, needsConvertPropertyAccess: false }; if (ts.isIdentifierText(name, target)) - return validIdentiferResult; + return validIdentifierResult; switch (kind) { case 3 /* MemberLike */: return undefined; @@ -100265,7 +100265,7 @@ var ts; return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true }; case 5 /* None */: case 4 /* String */: - return validIdentiferResult; + return validIdentifierResult; default: ts.Debug.assertNever(kind); } diff --git a/lib/typescript.js b/lib/typescript.js index 1bf83511c5109..157d835bb16c8 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -33614,7 +33614,7 @@ var ts; return type; } // A reserved member name starts with two underscores, but the third character cannot be an underscore - // or the @ symbol. A third underscore indicates an escaped form of an identifer that started + // or the @ symbol. A third underscore indicates an escaped form of an identifier that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES // Symbol instance. function isReservedMemberName(name) { @@ -100241,9 +100241,9 @@ var ts; || ts.isKnownSymbol(symbol)) { return undefined; } - var validIdentiferResult = { name: name, needsConvertPropertyAccess: false }; + var validIdentifierResult = { name: name, needsConvertPropertyAccess: false }; if (ts.isIdentifierText(name, target)) - return validIdentiferResult; + return validIdentifierResult; switch (kind) { case 3 /* MemberLike */: return undefined; @@ -100256,7 +100256,7 @@ var ts; return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true }; case 5 /* None */: case 4 /* String */: - return validIdentiferResult; + return validIdentifierResult; default: ts.Debug.assertNever(kind); } diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 06c7e3c046f40..ce8b2938f03e4 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -33614,7 +33614,7 @@ var ts; return type; } // A reserved member name starts with two underscores, but the third character cannot be an underscore - // or the @ symbol. A third underscore indicates an escaped form of an identifer that started + // or the @ symbol. A third underscore indicates an escaped form of an identifier that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES // Symbol instance. function isReservedMemberName(name) { @@ -100241,9 +100241,9 @@ var ts; || ts.isKnownSymbol(symbol)) { return undefined; } - var validIdentiferResult = { name: name, needsConvertPropertyAccess: false }; + var validIdentifierResult = { name: name, needsConvertPropertyAccess: false }; if (ts.isIdentifierText(name, target)) - return validIdentiferResult; + return validIdentifierResult; switch (kind) { case 3 /* MemberLike */: return undefined; @@ -100256,7 +100256,7 @@ var ts; return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true }; case 5 /* None */: case 4 /* String */: - return validIdentiferResult; + return validIdentifierResult; default: ts.Debug.assertNever(kind); } diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 5951fd861998f..eaebe5e347f4e 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -33615,7 +33615,7 @@ var ts; return type; } // A reserved member name starts with two underscores, but the third character cannot be an underscore - // or the @ symbol. A third underscore indicates an escaped form of an identifer that started + // or the @ symbol. A third underscore indicates an escaped form of an identifier that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES // Symbol instance. function isReservedMemberName(name) { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 684cea2aa50d4..0c91e1ba06208 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -404,10 +404,10 @@ namespace ts { const wildcardType = createIntrinsicType(TypeFlags.Any, "any"); const errorType = createIntrinsicType(TypeFlags.Any, "error"); const unknownType = createIntrinsicType(TypeFlags.Unknown, "unknown"); - const undefinedType = createNullableType(TypeFlags.Undefined, "undefined", 0); - const undefinedWideningType = strictNullChecks ? undefinedType : createNullableType(TypeFlags.Undefined, "undefined", ObjectFlags.ContainsWideningType); - const nullType = createNullableType(TypeFlags.Null, "null", 0); - const nullWideningType = strictNullChecks ? nullType : createNullableType(TypeFlags.Null, "null", ObjectFlags.ContainsWideningType); + const undefinedType = createIntrinsicType(TypeFlags.Undefined, "undefined"); + const undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(TypeFlags.Undefined, "undefined", ObjectFlags.ContainsWideningType); + const nullType = createIntrinsicType(TypeFlags.Null, "null"); + const nullWideningType = strictNullChecks ? nullType : createIntrinsicType(TypeFlags.Null, "null", ObjectFlags.ContainsWideningType); const stringType = createIntrinsicType(TypeFlags.String, "string"); const numberType = createIntrinsicType(TypeFlags.Number, "number"); const bigintType = createIntrinsicType(TypeFlags.BigInt, "bigint"); @@ -433,6 +433,7 @@ namespace ts { const voidType = createIntrinsicType(TypeFlags.Void, "void"); const neverType = createIntrinsicType(TypeFlags.Never, "never"); const silentNeverType = createIntrinsicType(TypeFlags.Never, "never"); + const nonInferrableType = createIntrinsicType(TypeFlags.Never, "never", ObjectFlags.NonInferrableType); const implicitNeverType = createIntrinsicType(TypeFlags.Never, "never"); const nonPrimitiveType = createIntrinsicType(TypeFlags.NonPrimitive, "object"); const stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); @@ -453,7 +454,7 @@ namespace ts { const anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. - anyFunctionType.objectFlags |= ObjectFlags.ContainsAnyFunctionType; + anyFunctionType.objectFlags |= ObjectFlags.NonInferrableType; const noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); const circularConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -707,6 +708,13 @@ namespace ts { Signature = 1 << 0, // Obtaining contextual signature } + const enum AccessFlags { + None = 0, + NoIndexSignatures = 1 << 0, + Writing = 1 << 1, + CacheSymbol = 1 << 2, + } + const enum CallbackCheck { None, Bivariant, @@ -2797,14 +2805,9 @@ namespace ts { return result; } - function createIntrinsicType(kind: TypeFlags, intrinsicName: string): IntrinsicType { + function createIntrinsicType(kind: TypeFlags, intrinsicName: string, objectFlags: ObjectFlags = 0): IntrinsicType { const type = createType(kind); type.intrinsicName = intrinsicName; - return type; - } - - function createNullableType(kind: TypeFlags, intrinsicName: string, objectFlags: ObjectFlags): NullableType { - const type = createIntrinsicType(kind, intrinsicName); type.objectFlags = objectFlags; return type; } @@ -2840,7 +2843,7 @@ namespace ts { } // A reserved member name starts with two underscores, but the third character cannot be an underscore - // or the @ symbol. A third underscore indicates an escaped form of an identifer that started + // or the @ symbol. A third underscore indicates an escaped form of an identifier that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES // Symbol instance. function isReservedMemberName(name: __String) { @@ -7235,7 +7238,15 @@ namespace ts { return getIndexType(getApparentType((type).type)); } if (type.flags & TypeFlags.Conditional) { - return getLowerBoundOfConditionalType(type); + if ((type).root.isDistributive) { + const checkType = (type).checkType; + const constraint = getLowerBoundOfKeyType(checkType); + if (constraint !== checkType) { + const mapper = makeUnaryTypeMapper((type).root.checkType, constraint); + return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, (type).mapper)); + } + } + return type; } if (type.flags & TypeFlags.Union) { return getUnionType(sameMap((type).types, getLowerBoundOfKeyType)); @@ -7246,17 +7257,6 @@ namespace ts { return neverType; } - function getLowerBoundOfConditionalType(type: ConditionalType) { - if (type.root.isDistributive) { - const constraint = getLowerBoundOfKeyType(type.checkType); - if (constraint !== type.checkType) { - const mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); - } - } - return type; - } - /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type: MappedType) { const members: SymbolTable = createSymbolTable(); @@ -7544,15 +7544,18 @@ namespace ts { } function getConstraintFromIndexedAccess(type: IndexedAccessType) { - const objectType = getConstraintOfType(type.objectType) || type.objectType; - if (objectType !== type.objectType) { - const constraint = getIndexedAccessType(objectType, type.indexType, /*accessNode*/ undefined, errorType); - if (constraint && constraint !== errorType) { - return constraint; + const indexConstraint = getConstraintOfType(type.indexType); + if (indexConstraint && indexConstraint !== type.indexType) { + const indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint); + if (indexedAccess) { + return indexedAccess; } } - const baseConstraint = getBaseConstraintOfType(type); - return baseConstraint && baseConstraint !== type ? baseConstraint : undefined; + const objectConstraint = getConstraintOfType(type.objectType); + if (objectConstraint && objectConstraint !== type.objectType) { + return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType); + } + return undefined; } function getDefaultConstraintOfConditionalType(type: ConditionalType) { @@ -7581,7 +7584,7 @@ namespace ts { // a union - once negated types exist and are applied to the conditional false branch, this "constraint" // likely doesn't need to exist. if (type.root.isDistributive && type.restrictiveInstantiation !== type) { - const simplified = getSimplifiedType(type.checkType); + const simplified = getSimplifiedType(type.checkType, /*writing*/ false); const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; if (constraint && constraint !== type.checkType) { const mapper = makeUnaryTypeMapper(type.root.checkType, constraint); @@ -7614,11 +7617,6 @@ namespace ts { constraint = getConstraintOfType(constraint); } if (constraint) { - // A constraint that isn't a union type implies that the final type would be a non-union - // type as well. Since non-union constraints are of no interest, we can exit here. - if (!(constraint.flags & TypeFlags.Union)) { - return undefined; - } constraints = append(constraints, constraint); } } @@ -7688,7 +7686,7 @@ namespace ts { return t.immediateBaseConstraint = noConstraintType; } constraintDepth++; - let result = computeBaseConstraint(getSimplifiedType(t)); + let result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); constraintDepth--; if (!popTypeResolution()) { if (t.flags & TypeFlags.TypeParameter) { @@ -7741,8 +7739,8 @@ namespace ts { if (t.flags & TypeFlags.IndexedAccess) { const baseObjectType = getBaseConstraint((t).objectType); const baseIndexType = getBaseConstraint((t).indexType); - const baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType, /*accessNode*/ undefined, errorType) : undefined; - return baseIndexedAccess && baseIndexedAccess !== errorType ? getBaseConstraint(baseIndexedAccess) : undefined; + const baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType); + return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); } if (t.flags & TypeFlags.Conditional) { const constraint = getConstraintFromConditionalType(t); @@ -9862,16 +9860,17 @@ namespace ts { return numberIndexInfo !== enumNumberIndexInfo ? numberIndexInfo : undefined; } - function getIndexType(type: Type, stringsOnly = keyofStringsOnly): Type { - return type.flags & TypeFlags.Union ? getIntersectionType(map((type).types, t => getIndexType(t, stringsOnly))) : - type.flags & TypeFlags.Intersection ? getUnionType(map((type).types, t => getIndexType(t, stringsOnly))) : + function getIndexType(type: Type, stringsOnly = keyofStringsOnly, noIndexSignatures?: boolean): Type { + return type.flags & TypeFlags.Union ? getIntersectionType(map((type).types, t => getIndexType(t, stringsOnly, noIndexSignatures))) : + type.flags & TypeFlags.Intersection ? getUnionType(map((type).types, t => getIndexType(t, stringsOnly, noIndexSignatures))) : maybeTypeOfKind(type, TypeFlags.InstantiableNonPrimitive) ? getIndexTypeForGenericType(type, stringsOnly) : - getObjectFlags(type) & ObjectFlags.Mapped ? getConstraintTypeFromMappedType(type) : + getObjectFlags(type) & ObjectFlags.Mapped ? filterType(getConstraintTypeFromMappedType(type), t => !(noIndexSignatures && t.flags & (TypeFlags.Any | TypeFlags.String | TypeFlags.Number))) : type === wildcardType ? wildcardType : - type.flags & TypeFlags.Any ? keyofConstraintType : - stringsOnly ? getIndexInfoOfType(type, IndexKind.String) ? stringType : getLiteralTypeFromProperties(type, TypeFlags.StringLiteral) : - getIndexInfoOfType(type, IndexKind.String) ? getUnionType([stringType, numberType, getLiteralTypeFromProperties(type, TypeFlags.UniqueESSymbol)]) : - getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromProperties(type, TypeFlags.StringLiteral | TypeFlags.UniqueESSymbol)]) : + type.flags & TypeFlags.Unknown ? neverType : + type.flags & (TypeFlags.Any | TypeFlags.Never) ? keyofConstraintType : + stringsOnly ? !noIndexSignatures && getIndexInfoOfType(type, IndexKind.String) ? stringType : getLiteralTypeFromProperties(type, TypeFlags.StringLiteral) : + !noIndexSignatures && getIndexInfoOfType(type, IndexKind.String) ? getUnionType([stringType, numberType, getLiteralTypeFromProperties(type, TypeFlags.UniqueESSymbol)]) : + !noIndexSignatures && getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromProperties(type, TypeFlags.StringLiteral | TypeFlags.UniqueESSymbol)]) : getLiteralTypeFromProperties(type, TypeFlags.StringOrNumberLiteralOrUnique); } @@ -9943,7 +9942,7 @@ namespace ts { return false; } - function getPropertyTypeForIndexType(objectType: Type, indexType: Type, accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression | undefined, cacheSymbol: boolean, missingType: Type) { + function getPropertyTypeForIndexType(originalObjectType: Type, objectType: Type, indexType: Type, accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression | undefined, accessFlags: AccessFlags) { const accessExpression = accessNode && accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode : undefined; const propName = isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : @@ -9960,13 +9959,12 @@ namespace ts { markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === SyntaxKind.ThisKeyword); if (isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { error(accessExpression.argumentExpression, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); - return missingType; + return undefined; } - if (cacheSymbol) { + if (accessFlags & AccessFlags.CacheSymbol) { getNodeLinks(accessNode!).resolvedSymbol = prop; } } - const propType = getTypeOfSymbol(prop); return accessExpression && getAssignmentTargetKind(accessExpression) !== AssignmentKind.Definite ? getFlowTypeOfReference(accessExpression, propType) : @@ -9991,15 +9989,25 @@ namespace ts { return objectType; } const indexInfo = isTypeAssignableToKind(indexType, TypeFlags.NumberLike) && getIndexInfoOfType(objectType, IndexKind.Number) || - getIndexInfoOfType(objectType, IndexKind.String) || - undefined; + getIndexInfoOfType(objectType, IndexKind.String); if (indexInfo) { + if (accessFlags & AccessFlags.NoIndexSignatures) { + if (accessExpression) { + error(accessExpression, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(originalObjectType)); + } + return undefined; + } if (accessNode && !isTypeAssignableToKind(indexType, TypeFlags.String | TypeFlags.Number)) { const indexNode = getIndexNodeForAccessExpression(accessNode); error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); + return indexInfo.type; } - else if (accessExpression && indexInfo.isReadonly && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression))) { - error(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); + if (indexInfo.isReadonly && (accessFlags & AccessFlags.Writing || accessExpression && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression)))) { + if (accessExpression) { + error(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); + return indexInfo.type; + } + return undefined; } return indexInfo.type; } @@ -10032,7 +10040,7 @@ namespace ts { } } } - return missingType; + return undefined; } } if (isJSLiteralType(objectType)) { @@ -10053,7 +10061,7 @@ namespace ts { if (isTypeAny(indexType)) { return indexType; } - return missingType; + return undefined; } function getIndexNodeForAccessExpression(accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression) { @@ -10074,53 +10082,68 @@ namespace ts { return maybeTypeOfKind(type, TypeFlags.InstantiableNonPrimitive | TypeFlags.Index); } - function getSimplifiedType(type: Type): Type { - return type.flags & TypeFlags.IndexedAccess ? getSimplifiedIndexedAccessType(type) : type; + function getSimplifiedType(type: Type, writing: boolean): Type { + return type.flags & TypeFlags.IndexedAccess ? getSimplifiedIndexedAccessType(type, writing) : type; } - function distributeIndexOverObjectType(objectType: Type, indexType: Type) { - // (T | U)[K] -> T[K] | U[K] - if (objectType.flags & TypeFlags.Union) { - return mapType(objectType, t => getSimplifiedType(getIndexedAccessType(t, indexType))); - } + function distributeIndexOverObjectType(objectType: Type, indexType: Type, writing: boolean) { + // (T | U)[K] -> T[K] | U[K] (reading) + // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] - if (objectType.flags & TypeFlags.Intersection) { - return getIntersectionType(map((objectType as IntersectionType).types, t => getSimplifiedType(getIndexedAccessType(t, indexType)))); + if (objectType.flags & TypeFlags.UnionOrIntersection) { + const types = map((objectType as UnionOrIntersectionType).types, t => getSimplifiedType(getIndexedAccessType(t, indexType), writing)); + return objectType.flags & TypeFlags.Intersection || writing ? getIntersectionType(types) : getUnionType(types); } } - // Transform an indexed access to a simpler form, if possible. Return the simpler form, or return - // the type itself if no transformation is possible. - function getSimplifiedIndexedAccessType(type: IndexedAccessType): Type { - if (type.simplified) { - return type.simplified === circularConstraintType ? type : type.simplified; + function distributeObjectOverIndexType(objectType: Type, indexType: Type, writing: boolean) { + // T[A | B] -> T[A] | T[B] (reading) + // T[A | B] -> T[A] & T[B] (writing) + if (indexType.flags & TypeFlags.Union) { + const types = map((indexType as UnionType).types, t => getSimplifiedType(getIndexedAccessType(objectType, t), writing)); + return writing ? getIntersectionType(types) : getUnionType(types); } - type.simplified = circularConstraintType; + } + + // Transform an indexed access to a simpler form, if possible. Return the simpler form, or return + // the type itself if no transformation is possible. The writing flag indicates that the type is + // the target of an assignment. + function getSimplifiedIndexedAccessType(type: IndexedAccessType, writing: boolean): Type { + const cache = writing ? "simplifiedForWriting" : "simplifiedForReading"; + if (type[cache]) { + return type[cache] === circularConstraintType ? type : type[cache]!; + } + type[cache] = circularConstraintType; // We recursively simplify the object type as it may in turn be an indexed access type. For example, with // '{ [P in T]: { [Q in U]: number } }[T][U]' we want to first simplify the inner indexed access type. - const objectType = getSimplifiedType(type.objectType); - const indexType = getSimplifiedType(type.indexType); - // T[A | B] -> T[A] | T[B] - if (indexType.flags & TypeFlags.Union) { - return type.simplified = mapType(indexType, t => getSimplifiedType(getIndexedAccessType(objectType, t))); + const objectType = getSimplifiedType(type.objectType, writing); + const indexType = getSimplifiedType(type.indexType, writing); + // T[A | B] -> T[A] | T[B] (reading) + // T[A | B] -> T[A] & T[B] (writing) + const distributedOverIndex = distributeObjectOverIndexType(objectType, indexType, writing); + if (distributedOverIndex) { + return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again if (!(indexType.flags & TypeFlags.Instantiable)) { - const simplified = distributeIndexOverObjectType(objectType, indexType); - if (simplified) { - return type.simplified = simplified; + // (T | U)[K] -> T[K] | U[K] (reading) + // (T | U)[K] -> T[K] & U[K] (writing) + // (T & U)[K] -> T[K] & U[K] + const distributedOverObject = distributeIndexOverObjectType(objectType, indexType, writing); + if (distributedOverObject) { + return type[cache] = distributedOverObject; } } - // So ultimately: + // So ultimately (reading): // ((A & B) | C)[K1 | K2] -> ((A & B) | C)[K1] | ((A & B) | C)[K2] -> (A & B)[K1] | C[K1] | (A & B)[K2] | C[K2] -> (A[K1] & B[K1]) | C[K1] | (A[K2] & B[K2]) | C[K2] // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we // construct the type Box. if (isGenericMappedType(objectType)) { - return type.simplified = mapType(substituteIndexedMappedType(objectType, type.indexType), getSimplifiedType); + return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), t => getSimplifiedType(t, writing)); } - return type.simplified = type; + return type[cache] = type; } function substituteIndexedMappedType(objectType: MappedType, index: Type) { @@ -10129,10 +10152,19 @@ namespace ts { return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } - function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression, missingType = accessNode ? errorType : unknownType): Type { + function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression): Type { + return getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, AccessFlags.None) || (accessNode ? errorType : unknownType); + } + + function getIndexedAccessTypeOrUndefined(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression, accessFlags = AccessFlags.None): Type | undefined { if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; } + // If the object type has a string index signature and no other members we know that the result will + // always be the type of that index signature and we can simplify accordingly. + if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & TypeFlags.Nullable) && isTypeAssignableToKind(indexType, TypeFlags.String | TypeFlags.Number)) { + indexType = stringType; + } // If the index type is generic, or if the object type is generic and doesn't originate in an expression, // we are performing a higher-order index access where we cannot meaningfully access the properties of the // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in @@ -10158,25 +10190,25 @@ namespace ts { const propTypes: Type[] = []; let wasMissingProp = false; for (const t of (indexType).types) { - const propType = getPropertyTypeForIndexType(apparentObjectType, t, accessNode, /*cacheSymbol*/ false, missingType); - if (propType === missingType) { - if (!accessNode) { - // If there's no error node, we can immeditely stop, since error reporting is off - return missingType; - } - else { - // Otherwise we set a flag and return at the end of the loop so we still mark all errors - wasMissingProp = true; - } + const propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, accessNode, accessFlags); + if (propType) { + propTypes.push(propType); + } + else if (!accessNode) { + // If there's no error node, we can immeditely stop, since error reporting is off + return undefined; + } + else { + // Otherwise we set a flag and return at the end of the loop so we still mark all errors + wasMissingProp = true; } - propTypes.push(propType); } if (wasMissingProp) { - return missingType; + return undefined; } - return getUnionType(propTypes); + return accessFlags & AccessFlags.Writing ? getIntersectionType(propTypes) : getUnionType(propTypes); } - return getPropertyTypeForIndexType(apparentObjectType, indexType, accessNode, /*cacheSymbol*/ true, missingType); + return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, accessNode, accessFlags | AccessFlags.CacheSymbol); } function getTypeFromIndexedAccessTypeNode(node: IndexedAccessTypeNode) { @@ -10239,7 +10271,7 @@ namespace ts { function getConditionalTypeWorker(root: ConditionalRoot, mapper: TypeMapper | undefined, checkType: Type, extendsType: Type, trueType: Type, falseType: Type) { // Simplifications for types of the form `T extends U ? T : never` and `T extends U ? never : T`. - if (falseType.flags & TypeFlags.Never && isTypeIdenticalTo(getActualTypeVariable(trueType), getActualTypeVariable(checkType))) { + if (falseType.flags & TypeFlags.Never && getActualTypeVariable(trueType) === getActualTypeVariable(checkType)) { if (checkType.flags & TypeFlags.Any || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { // Always true return trueType; } @@ -10247,7 +10279,7 @@ namespace ts { return neverType; } } - else if (trueType.flags & TypeFlags.Never && isTypeIdenticalTo(getActualTypeVariable(falseType), getActualTypeVariable(checkType))) { + else if (trueType.flags & TypeFlags.Never && getActualTypeVariable(falseType) === getActualTypeVariable(checkType)) { if (!(checkType.flags & TypeFlags.Any) && isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { // Always true return neverType; } @@ -11565,10 +11597,10 @@ namespace ts { let reportedError = false; for (let status = iterator.next(); !status.done; status = iterator.next()) { const { errorNode: prop, innerExpression: next, nameType, errorMessage } = status.value; - const targetPropType = getIndexedAccessType(target, nameType, /*accessNode*/ undefined, errorType); - if (targetPropType === errorType || targetPropType.flags & TypeFlags.IndexedAccess) continue; // Don't elaborate on indexes on generic variables - const sourcePropType = getIndexedAccessType(source, nameType, /*accessNode*/ undefined, errorType); - if (sourcePropType !== errorType && targetPropType !== errorType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) { + const targetPropType = getIndexedAccessTypeOrUndefined(target, nameType); + if (!targetPropType || targetPropType.flags & TypeFlags.IndexedAccess) continue; // Don't elaborate on indexes on generic variables + const sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); + if (sourcePropType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) { const elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined); if (elaborated) { reportedError = true; @@ -12010,6 +12042,12 @@ namespace ts { return !!(getObjectFlags(type) & ObjectFlags.Anonymous) && isEmptyObjectType(type); } + function isStringIndexSignatureOnlyType(type: Type): boolean { + return type.flags & TypeFlags.Object && getPropertiesOfType(type).length === 0 && getIndexInfoOfType(type, IndexKind.String) && !getIndexInfoOfType(type, IndexKind.Number) || + type.flags & TypeFlags.UnionOrIntersection && every((type).types, isStringIndexSignatureOnlyType) || + false; + } + function isEnumTypeRelatedTo(sourceSymbol: Symbol, targetSymbol: Symbol, errorReporter?: ErrorReporter) { if (sourceSymbol === targetSymbol) { return true; @@ -12229,6 +12267,40 @@ namespace ts { } } + /** + * Try and elaborate array and tuple errors. Returns false + * if we have found an elaboration, or we should ignore + * any other elaborations when relating the `source` and + * `target` types. + * + * @param source + * @param target + * @param reportErrors + */ + function tryElaborateArrayLikeErrors(source: Type, target: Type, reportErrors: boolean): boolean { + if (isTupleLikeType(source)) { + const sourceTuple: TupleType | undefined = (source as TupleTypeReference).target; + if (sourceTuple && sourceTuple.readonly && isArrayOrTupleLikeType(target) && + (!isReadonlyArrayType(target) || isTupleType(target) && !target.target.readonly)) { + if (reportErrors) { + reportError(Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source), typeToString(target)); + } + return false; + } + return isArrayLikeType(target); + } + if (isTupleLikeType(target)) { + return isArrayLikeType(source); + } + if (isReadonlyArrayType(source) && isArrayType(target) && !isReadonlyArrayType(target)) { + if (reportErrors) { + reportError(Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source), typeToString(target)); + } + return false; + } + return true; + } + /** * Compare two types and return * * Ternary.True if they are related with no assumptions, @@ -12249,10 +12321,10 @@ namespace ts { target = (target).typeVariable; } if (source.flags & TypeFlags.IndexedAccess) { - source = getSimplifiedType(source); + source = getSimplifiedType(source, /*writing*/ false); } if (target.flags & TypeFlags.IndexedAccess) { - target = getSimplifiedType(target); + target = getSimplifiedType(target, /*writing*/ true); } // Try to see if we're relating something like `Foo` -> `Bar | null | undefined`. @@ -12389,6 +12461,9 @@ namespace ts { if (!result && reportErrors) { const maybeSuppress = suppressNextError; suppressNextError = false; + if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Object) { + tryElaborateArrayLikeErrors(source, target, reportErrors); + } if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Primitive) { tryElaborateErrorsForPrimitivesAndObjects(source, target); } @@ -12839,7 +12914,7 @@ namespace ts { } // A type S is assignable to keyof T if S is assignable to keyof C, where C is the // simplified form of T or, if T doesn't simplify, the constraint of T. - const simplified = getSimplifiedType((target).type); + const simplified = getSimplifiedType((target).type, /*writing*/ false); const constraint = simplified !== (target).type ? simplified : getConstraintOfType((target).type); if (constraint) { // We require Ternary.True here such that circular constraints don't cause @@ -12852,13 +12927,17 @@ namespace ts { } } else if (target.flags & TypeFlags.IndexedAccess) { - // A type S is related to a type T[K], where T and K aren't both type variables, if S is related to C, - // where C is the base constraint of T[K] - if (relation !== identityRelation && - !(isGenericObjectType((target).objectType) && isGenericIndexType((target).indexType))) { - const constraint = getBaseConstraintOfType(target); - if (constraint && constraint !== target) { - if (result = isRelatedTo(source, constraint, reportErrors)) { + // A type S is related to a type T[K] if S is related to C, where C is the base + // constraint of T[K] for writing. + if (relation !== identityRelation) { + const objectType = (target).objectType; + const indexType = (target).indexType; + const baseObjectType = getBaseConstraintOfType(objectType) || objectType; + const baseIndexType = getBaseConstraintOfType(indexType) || indexType; + if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { + const accessFlags = AccessFlags.Writing | (baseObjectType !== objectType ? AccessFlags.NoIndexSignatures : 0); + const constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, /*accessNode*/ undefined, accessFlags); + if (constraint && (result = isRelatedTo(source, constraint, reportErrors))) { return result; } } @@ -12875,7 +12954,7 @@ namespace ts { } if (!isGenericMappedType(source)) { const targetConstraint = getConstraintTypeFromMappedType(target); - const sourceKeys = getIndexType(source); + const sourceKeys = getIndexType(source, /*stringsOnly*/ undefined, /*noIndexSignatures*/ true); const hasOptionalUnionKeys = modifiers & MappedTypeModifiers.IncludeOptional && targetConstraint.flags & TypeFlags.Union; const filteredByApplicability = hasOptionalUnionKeys ? filterType(targetConstraint, t => !!isRelatedTo(t, sourceKeys)) : undefined; // A source type T is related to a target type { [P in Q]: X } if Q is related to keyof T and T[Q] is related to X. @@ -12907,23 +12986,25 @@ namespace ts { return result; } } - const constraint = getConstraintOfType(source); - if (!constraint || (source.flags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any)) { - // A type variable with no constraint is not related to the non-primitive object type. - if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive))) { + else { + const constraint = getConstraintOfType(source); + if (!constraint || (source.flags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any)) { + // A type variable with no constraint is not related to the non-primitive object type. + if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive))) { + errorInfo = saveErrorInfo; + return result; + } + } + // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed + else if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, isIntersectionConstituent)) { errorInfo = saveErrorInfo; return result; } - } - // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed - else if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, isIntersectionConstituent)) { + // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example + else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, /*headMessage*/ undefined, isIntersectionConstituent)) { errorInfo = saveErrorInfo; return result; - } - // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example - else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, /*headMessage*/ undefined, isIntersectionConstituent)) { - errorInfo = saveErrorInfo; - return result; + } } } else if (source.flags & TypeFlags.Index) { @@ -13113,11 +13194,13 @@ namespace ts { associateRelatedInfo(createDiagnosticForNode(unmatchedProperty.declarations[0], Diagnostics._0_is_declared_here, propName)); } } - else if (props.length > 5) { // arbitrary cutoff for too-long list form - reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source), typeToString(target), map(props.slice(0, 4), p => symbolToString(p)).join(", "), props.length - 4); - } - else { - reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source), typeToString(target), map(props, p => symbolToString(p)).join(", ")); + else if (tryElaborateArrayLikeErrors(source, target, /*reportErrors*/ false)) { + if (props.length > 5) { // arbitrary cutoff for too-long list form + reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source), typeToString(target), map(props.slice(0, 4), p => symbolToString(p)).join(", "), props.length - 4); + } + else { + reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source), typeToString(target), map(props, p => symbolToString(p)).join(", ")); + } } } return Ternary.False; @@ -14204,7 +14287,7 @@ namespace ts { const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly), numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly)); - result.objectFlags |= (getObjectFlags(type) & ObjectFlags.JSLiteral); // Retain js literal flag through widening + result.objectFlags |= (getObjectFlags(type) & (ObjectFlags.JSLiteral | ObjectFlags.NonInferrableType)); // Retain js literal flag through widening return result; } @@ -14522,16 +14605,10 @@ namespace ts { } function createReverseMappedType(source: Type, target: MappedType, constraint: IndexType) { - const properties = getPropertiesOfType(source); - if (properties.length === 0 && !getIndexInfoOfType(source, IndexKind.String)) { - return undefined; - } // If any property contains context sensitive functions that have been skipped, the source type // is incomplete and we can't infer a meaningful input type. - for (const prop of properties) { - if (getObjectFlags(getTypeOfSymbol(prop)) & ObjectFlags.ContainsAnyFunctionType) { - return undefined; - } + if (getObjectFlags(source) & ObjectFlags.NonInferrableType || getPropertiesOfType(source).length === 0 && !getIndexInfoOfType(source, IndexKind.String)) { + return undefined; } // For arrays and tuples we infer new arrays and tuples where the reverse mapping has been // applied to the element type(s). @@ -14686,7 +14763,7 @@ namespace ts { // not contain anyFunctionType when we come back to this argument for its second round // of inference. Also, we exclude inferences for silentNeverType (which is used as a wildcard // when constructing types from type parameters that had no inference candidates). - if (getObjectFlags(source) & ObjectFlags.ContainsAnyFunctionType || source === silentNeverType || (priority & InferencePriority.ReturnType && (source === autoType || source === autoArrayType))) { + if (getObjectFlags(source) & ObjectFlags.NonInferrableType || source === silentNeverType || (priority & InferencePriority.ReturnType && (source === autoType || source === autoArrayType))) { return; } const inference = getInferenceInfoForType(target); @@ -14722,16 +14799,16 @@ namespace ts { } else { // Infer to the simplified version of an indexed access, if possible, to (hopefully) expose more bare type parameters to the inference engine - const simplified = getSimplifiedType(target); + const simplified = getSimplifiedType(target, /*writing*/ false); if (simplified !== target) { inferFromTypesOnce(source, simplified); } else if (target.flags & TypeFlags.IndexedAccess) { - const indexType = getSimplifiedType((target as IndexedAccessType).indexType); + const indexType = getSimplifiedType((target as IndexedAccessType).indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. if (indexType.flags & TypeFlags.Instantiable) { - const simplified = distributeIndexOverObjectType(getSimplifiedType((target as IndexedAccessType).objectType), indexType); + const simplified = distributeIndexOverObjectType(getSimplifiedType((target as IndexedAccessType).objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified && simplified !== target) { inferFromTypesOnce(source, simplified); } @@ -14789,22 +14866,29 @@ namespace ts { // We infer from types that are not naked type variables first so that inferences we // make from nested naked type variables and given slightly higher priority by virtue // of being first in the candidates array. + let typeVariableCount = 0; for (const t of (target).types) { - if (!getInferenceInfoForType(t)) { + if (getInferenceInfoForType(t)) { + typeVariableCount++; + } + else { inferFromTypes(source, t); } } // Inferences directly to naked type variables are given lower priority as they are // less specific. For example, when inferring from Promise to T | Promise, - // we want to infer string for T, not Promise | string. - const savePriority = priority; - priority |= InferencePriority.NakedTypeVariable; - for (const t of (target).types) { - if (getInferenceInfoForType(t)) { - inferFromTypes(source, t); + // we want to infer string for T, not Promise | string. For intersection types + // we only infer to single naked type variables. + if (target.flags & TypeFlags.Union ? typeVariableCount !== 0 : typeVariableCount === 1) { + const savePriority = priority; + priority |= InferencePriority.NakedTypeVariable; + for (const t of (target).types) { + if (getInferenceInfoForType(t)) { + inferFromTypes(source, t); + } } + priority = savePriority; } - priority = savePriority; } else if (source.flags & TypeFlags.Union) { // Source is a union or intersection type, infer from each constituent type @@ -15007,7 +15091,7 @@ namespace ts { const sourceLen = sourceSignatures.length; const targetLen = targetSignatures.length; const len = sourceLen < targetLen ? sourceLen : targetLen; - const skipParameters = !!(getObjectFlags(source) & ObjectFlags.ContainsAnyFunctionType); + const skipParameters = !!(getObjectFlags(source) & ObjectFlags.NonInferrableType); for (let i = 0; i < len; i++) { inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getBaseSignature(targetSignatures[targetLen - len + i]), skipParameters); } @@ -15767,24 +15851,19 @@ namespace ts { if (!(type.flags & TypeFlags.Union)) { return mapper(type); } - const types = (type).types; - let mappedType: Type | undefined; let mappedTypes: Type[] | undefined; - for (const current of types) { - const t = mapper(current); - if (t) { - if (!mappedType) { - mappedType = t; - } - else if (!mappedTypes) { - mappedTypes = [mappedType, t]; + for (const t of (type).types) { + const mapped = mapper(t); + if (mapped) { + if (!mappedTypes) { + mappedTypes = [mapped]; } else { - mappedTypes.push(t); + mappedTypes.push(mapped); } } } - return mappedTypes ? getUnionType(mappedTypes, noReductions ? UnionReduction.None : UnionReduction.Literal) : mappedType; + return mappedTypes && getUnionType(mappedTypes, noReductions ? UnionReduction.None : UnionReduction.Literal); } function extractTypesOfKind(type: Type, kind: TypeFlags) { @@ -19621,7 +19700,7 @@ namespace ts { markAliasReferenced(parentSymbol, node); } if (!prop) { - const indexInfo = getIndexInfoOfType(apparentType, IndexKind.String); + const indexInfo = assignmentKind === AssignmentKind.None || !isGenericObjectType(leftType) ? getIndexInfoOfType(apparentType, IndexKind.String) : undefined; if (!(indexInfo && indexInfo.type)) { if (isJSLiteralType(leftType)) { return anyType; @@ -20026,7 +20105,12 @@ namespace ts { return errorType; } - return checkIndexedAccessIndexType(getIndexedAccessType(objectType, isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType, node), node); + const effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType; + const accessFlags = isAssignmentTarget(node) ? + AccessFlags.Writing | (isGenericObjectType(objectType) ? AccessFlags.NoIndexSignatures : 0) : + AccessFlags.None; + const indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType; + return checkIndexedAccessIndexType(indexedAccessType, node); } function checkThatExpressionIsProperSymbolReference(expression: Expression, expressionType: Type, reportError: boolean): boolean { @@ -21136,7 +21220,7 @@ namespace ts { // returns a function type, we choose to defer processing. This narrowly permits function composition // operators to flow inferences through return types, but otherwise processes calls right away. We // use the resolvingSignature singleton to indicate that we deferred processing. This result will be - // propagated out and eventually turned into silentNeverType (a type that is assignable to anything and + // propagated out and eventually turned into nonInferrableType (a type that is assignable to anything and // from which we never make inferences). if (checkMode & CheckMode.SkipGenericFunctions && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) { skippedGenericFunction(node, checkMode); @@ -21619,8 +21703,8 @@ namespace ts { const signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode); if (signature === resolvingSignature) { // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that - // returns a function type. We defer checking and return anyFunctionType. - return silentNeverType; + // returns a function type. We defer checking and return nonInferrableType. + return nonInferrableType; } if (node.expression.kind === SyntaxKind.SuperKeyword) { @@ -22427,7 +22511,7 @@ namespace ts { const returnType = getReturnTypeFromBody(node, checkMode); const returnOnlySignature = createSignature(undefined, undefined, undefined, emptyArray, returnType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, undefined, undefined); - returnOnlyType.objectFlags |= ObjectFlags.ContainsAnyFunctionType; + returnOnlyType.objectFlags |= ObjectFlags.NonInferrableType; return links.contextFreeType = returnOnlyType; } return anyFunctionType; @@ -24621,7 +24705,7 @@ namespace ts { return type; } error(accessNode, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); - return type; + return errorType; } function checkIndexedAccessType(node: IndexedAccessTypeNode) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 7717f51bd50fe..52fb34565f885 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2605,6 +2605,10 @@ "category": "Error", "code": 2753 }, + "'super' may not use type arguments.": { + "category": "Error", + "code": 2754 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", @@ -2943,7 +2947,11 @@ "category": "Error", "code": 4103 }, - + "The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'.": { + "category": "Error", + "code": 4104 + }, + "The current host does not support the '{0}' option.": { "category": "Error", "code": 5001 diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 8eaa005b62e3d..cb3305849219b 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4189,6 +4189,14 @@ namespace ts { function parseSuperExpression(): MemberExpression { const expression = parseTokenNode(); + if (token() === SyntaxKind.LessThanToken) { + const startPos = getNodePos(); + const typeArguments = tryParse(parseTypeArgumentsInExpression); + if (typeArguments !== undefined) { + parseErrorAt(startPos, getNodePos(), Diagnostics.super_may_not_use_type_arguments); + } + } + if (token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.DotToken || token() === SyntaxKind.OpenBracketToken) { return expression; } @@ -7797,7 +7805,7 @@ namespace ts { const referencedFiles = context.referencedFiles; const typeReferenceDirectives = context.typeReferenceDirectives; const libReferenceDirectives = context.libReferenceDirectives; - forEach(toArray(entryOrList), (arg: PragmaPseudoMap["reference"]) => { + forEach(toArray(entryOrList) as PragmaPseudoMap["reference"][], arg => { const { types, lib, path } = arg.arguments; if (arg.arguments["no-default-lib"]) { context.hasNoDefaultLib = true; @@ -7819,8 +7827,8 @@ namespace ts { } case "amd-dependency": { context.amdDependencies = map( - toArray(entryOrList), - (x: PragmaPseudoMap["amd-dependency"]) => ({ name: x.arguments.name, path: x.arguments.path })); + toArray(entryOrList) as PragmaPseudoMap["amd-dependency"][], + x => ({ name: x.arguments.name, path: x.arguments.path })); break; } case "amd-module": { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6327c61e74fa1..6fba5f149cf53 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3946,7 +3946,7 @@ namespace ts { Instantiable = InstantiableNonPrimitive | InstantiablePrimitive, StructuredOrInstantiable = StructuredType | Instantiable, /* @internal */ - ObjectFlagsType = Nullable | Object | Union | Intersection, + ObjectFlagsType = Nullable | Never | Object | Union | Intersection, // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BigIntLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive, @@ -4066,12 +4066,12 @@ namespace ts { /* @internal */ ContainsObjectLiteral = 1 << 18, // Type is or contains object literal type /* @internal */ - ContainsAnyFunctionType = 1 << 19, // Type is or contains the anyFunctionType + NonInferrableType = 1 << 19, // Type is or contains anyFunctionType or silentNeverType ClassOrInterface = Class | Interface, /* @internal */ RequiresWidening = ContainsWideningType | ContainsObjectLiteral, /* @internal */ - PropagatingFlags = ContainsWideningType | ContainsObjectLiteral | ContainsAnyFunctionType + PropagatingFlags = ContainsWideningType | ContainsObjectLiteral | NonInferrableType } /* @internal */ @@ -4283,7 +4283,8 @@ namespace ts { objectType: Type; indexType: Type; constraint?: Type; - simplified?: Type; + simplifiedForReading?: Type; + simplifiedForWriting?: Type; } export type TypeVariable = TypeParameter | IndexedAccessType; diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index 395ebff25c5c9..b1daca71fed54 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -151,7 +151,6 @@ interface ByteLengthChunk { } interface CacheQueryOptions { - cacheName?: string; ignoreMethod?: boolean; ignoreSearch?: boolean; ignoreVary?: boolean; @@ -236,7 +235,7 @@ interface ConstrainDoubleRange extends DoubleRange { ideal?: number; } -interface ConstrainLongRange extends LongRange { +interface ConstrainULongRange extends ULongRange { exact?: number; ideal?: number; } @@ -310,21 +309,27 @@ interface DelayOptions extends AudioNodeOptions { maxDelayTime?: number; } -interface DeviceAccelerationDict { +interface DeviceLightEventInit extends EventInit { + value?: number; +} + +interface DeviceMotionEventAccelerationInit { x?: number | null; y?: number | null; z?: number | null; } -interface DeviceLightEventInit extends EventInit { - value?: number; +interface DeviceMotionEventInit extends EventInit { + acceleration?: DeviceMotionEventAccelerationInit; + accelerationIncludingGravity?: DeviceMotionEventAccelerationInit; + interval?: number; + rotationRate?: DeviceMotionEventRotationRateInit; } -interface DeviceMotionEventInit extends EventInit { - acceleration?: DeviceAccelerationDict | null; - accelerationIncludingGravity?: DeviceAccelerationDict | null; - interval?: number | null; - rotationRate?: DeviceRotationRateDict | null; +interface DeviceMotionEventRotationRateInit { + alpha?: number | null; + beta?: number | null; + gamma?: number | null; } interface DeviceOrientationEventInit extends EventInit { @@ -339,12 +344,6 @@ interface DevicePermissionDescriptor extends PermissionDescriptor { name: "camera" | "microphone" | "speaker"; } -interface DeviceRotationRateDict { - alpha?: number | null; - beta?: number | null; - gamma?: number | null; -} - interface DocumentTimelineOptions { originTime?: number; } @@ -542,6 +541,11 @@ interface IIRFilterOptions extends AudioNodeOptions { feedforward: number[]; } +interface ImageEncodeOptions { + quality?: number; + type?: string; +} + interface IntersectionObserverEntryInit { boundingClientRect: DOMRectInit; intersectionRatio: number; @@ -606,11 +610,6 @@ interface KeyframeEffectOptions extends EffectTiming { iterationComposite?: IterationCompositeOperation; } -interface LongRange { - max?: number; - min?: number; -} - interface MediaElementAudioSourceOptions { mediaElement: HTMLMediaElement; } @@ -668,39 +667,45 @@ interface MediaStreamTrackAudioSourceOptions { } interface MediaStreamTrackEventInit extends EventInit { - track?: MediaStreamTrack | null; + track: MediaStreamTrack; } interface MediaTrackCapabilities { - aspectRatio?: number | DoubleRange; + aspectRatio?: DoubleRange; + autoGainControl?: boolean[]; + channelCount?: ULongRange; deviceId?: string; echoCancellation?: boolean[]; - facingMode?: string; - frameRate?: number | DoubleRange; + facingMode?: string[]; + frameRate?: DoubleRange; groupId?: string; - height?: number | LongRange; - sampleRate?: number | LongRange; - sampleSize?: number | LongRange; - volume?: number | DoubleRange; - width?: number | LongRange; + height?: ULongRange; + latency?: DoubleRange; + noiseSuppression?: boolean[]; + resizeMode?: string[]; + sampleRate?: ULongRange; + sampleSize?: ULongRange; + volume?: DoubleRange; + width?: ULongRange; } interface MediaTrackConstraintSet { - aspectRatio?: number | ConstrainDoubleRange; - channelCount?: number | ConstrainLongRange; - deviceId?: string | string[] | ConstrainDOMStringParameters; - displaySurface?: string | string[] | ConstrainDOMStringParameters; - echoCancellation?: boolean | ConstrainBooleanParameters; - facingMode?: string | string[] | ConstrainDOMStringParameters; - frameRate?: number | ConstrainDoubleRange; - groupId?: string | string[] | ConstrainDOMStringParameters; - height?: number | ConstrainLongRange; - latency?: number | ConstrainDoubleRange; - logicalSurface?: boolean | ConstrainBooleanParameters; - sampleRate?: number | ConstrainLongRange; - sampleSize?: number | ConstrainLongRange; - volume?: number | ConstrainDoubleRange; - width?: number | ConstrainLongRange; + aspectRatio?: ConstrainDouble; + autoGainControl?: ConstrainBoolean; + channelCount?: ConstrainULong; + deviceId?: ConstrainDOMString; + echoCancellation?: ConstrainBoolean; + facingMode?: ConstrainDOMString; + frameRate?: ConstrainDouble; + groupId?: ConstrainDOMString; + height?: ConstrainULong; + latency?: ConstrainDouble; + noiseSuppression?: ConstrainBoolean; + resizeMode?: ConstrainDOMString; + sampleRate?: ConstrainULong; + sampleSize?: ConstrainULong; + volume?: ConstrainDouble; + width?: ConstrainULong; } interface MediaTrackConstraints extends MediaTrackConstraintSet { @@ -709,12 +714,17 @@ interface MediaTrackConstraints extends MediaTrackConstraintSet { interface MediaTrackSettings { aspectRatio?: number; + autoGainControl?: boolean; + channelCount?: number; deviceId?: string; echoCancellation?: boolean; facingMode?: string; frameRate?: number; groupId?: string; height?: number; + latency?: number; + noiseSuppression?: boolean; + resizeMode?: string; sampleRate?: number; sampleSize?: number; volume?: number; @@ -723,12 +733,17 @@ interface MediaTrackSettings { interface MediaTrackSupportedConstraints { aspectRatio?: boolean; + autoGainControl?: boolean; + channelCount?: boolean; deviceId?: boolean; echoCancellation?: boolean; facingMode?: boolean; frameRate?: boolean; groupId?: boolean; height?: boolean; + latency?: boolean; + noiseSuppression?: boolean; + resizeMode?: boolean; sampleRate?: boolean; sampleSize?: boolean; volume?: boolean; @@ -760,6 +775,10 @@ interface MouseEventInit extends EventModifierInit { screenY?: number; } +interface MultiCacheQueryOptions extends CacheQueryOptions { + cacheName?: string; +} + interface MutationObserverInit { attributeFilter?: string[]; attributeOldValue?: boolean; @@ -909,7 +928,8 @@ interface Pbkdf2Params extends Algorithm { interface PerformanceObserverInit { buffered?: boolean; - entryTypes: string[]; + entryTypes?: string[]; + type?: string; } interface PeriodicWaveConstraints { @@ -955,6 +975,10 @@ interface PositionOptions { timeout?: number; } +interface PostMessageOptions { + transfer?: any[]; +} + interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; @@ -1576,6 +1600,11 @@ interface UIEventInit extends EventInit { view?: Window | null; } +interface ULongRange { + max?: number; + min?: number; +} + interface UnderlyingByteSource { autoAllocateChunkSize?: number; cancel?: ReadableStreamErrorCallback; @@ -1965,6 +1994,7 @@ interface AudioContext extends BaseAudioContext { createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack): MediaStreamTrackAudioSourceNode; getOutputTimestamp(): AudioTimestamp; + resume(): Promise; suspend(): Promise; addEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -2202,7 +2232,6 @@ interface BaseAudioContext extends EventTarget { createStereoPanner(): StereoPannerNode; createWaveShaper(): WaveShaperNode; decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise; - resume(): Promise; addEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -4075,30 +4104,40 @@ declare var DeviceLightEvent: { /** The DeviceMotionEvent provides web developers with information about the speed of changes for the device's position and orientation. */ interface DeviceMotionEvent extends Event { - readonly acceleration: DeviceAcceleration | null; - readonly accelerationIncludingGravity: DeviceAcceleration | null; - readonly interval: number | null; - readonly rotationRate: DeviceRotationRate | null; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void; + readonly acceleration: DeviceMotionEventAcceleration | null; + readonly accelerationIncludingGravity: DeviceMotionEventAcceleration | null; + readonly interval: number; + readonly rotationRate: DeviceMotionEventRotationRate | null; } declare var DeviceMotionEvent: { prototype: DeviceMotionEvent; - new(typeArg: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; + new(type: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; }; +interface DeviceMotionEventAcceleration { + readonly x: number | null; + readonly y: number | null; + readonly z: number | null; +} + +interface DeviceMotionEventRotationRate { + readonly alpha: number | null; + readonly beta: number | null; + readonly gamma: number | null; +} + /** The DeviceOrientationEvent provides web developers with information from the physical orientation of the device running the web page. */ interface DeviceOrientationEvent extends Event { readonly absolute: boolean; readonly alpha: number | null; readonly beta: number | null; readonly gamma: number | null; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void; } declare var DeviceOrientationEvent: { prototype: DeviceOrientationEvent; - new(typeArg: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; + new(type: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; }; /** Provides information about the rate at which the device is rotating around all three axes. */ @@ -4179,7 +4218,7 @@ interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, Par /** * Specifies the beginning and end of the document body. */ - body: HTMLBodyElement | HTMLFrameSetElement; + body: HTMLElement; /** * Returns document's encoding. */ @@ -5410,7 +5449,7 @@ interface GlobalEventHandlersEventMap { "animationend": AnimationEvent; "animationiteration": AnimationEvent; "animationstart": AnimationEvent; - "auxclick": Event; + "auxclick": MouseEvent; "blur": FocusEvent; "cancel": Event; "canplay": Event; @@ -5503,7 +5542,7 @@ interface GlobalEventHandlers { onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; - onauxclick: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; /** * Fires when the object loses the input focus. * @param ev The focus event. @@ -6148,6 +6187,7 @@ interface HTMLCanvasElement extends HTMLElement { * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. */ toDataURL(type?: string, quality?: any): string; + transferControlToOffscreen(): OffscreenCanvas; addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7161,6 +7201,8 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle { * Sets or retrieves the language code of the object. */ hreflang: string; + imageSizes: string; + imageSrcset: string; integrity: string; /** * Sets or retrieves the media type. @@ -9421,6 +9463,15 @@ interface InnerHTML { innerHTML: string; } +interface InputDeviceInfo extends MediaDeviceInfo { + getCapabilities(): MediaTrackCapabilities; +} + +declare var InputDeviceInfo: { + prototype: InputDeviceInfo; + new(): InputDeviceInfo; +}; + /** provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport. */ interface IntersectionObserver { readonly root: Element | null; @@ -9853,6 +9904,7 @@ interface MediaDeviceInfo { readonly groupId: string; readonly kind: MediaDeviceKind; readonly label: string; + toJSON(): any; } declare var MediaDeviceInfo: { @@ -9869,7 +9921,7 @@ interface MediaDevices extends EventTarget { ondevicechange: ((this: MediaDevices, ev: Event) => any) | null; enumerateDevices(): Promise; getSupportedConstraints(): MediaTrackSupportedConstraints; - getUserMedia(constraints: MediaStreamConstraints): Promise; + getUserMedia(constraints?: MediaStreamConstraints): Promise; addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -10081,9 +10133,7 @@ declare var MediaSource: { }; interface MediaStreamEventMap { - "active": Event; "addtrack": MediaStreamTrackEvent; - "inactive": Event; "removetrack": MediaStreamTrackEvent; } @@ -10091,9 +10141,7 @@ interface MediaStreamEventMap { interface MediaStream extends EventTarget { readonly active: boolean; readonly id: string; - onactive: ((this: MediaStream, ev: Event) => any) | null; onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null; - oninactive: ((this: MediaStream, ev: Event) => any) | null; onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null; addTrack(track: MediaStreamTrack): void; clone(): MediaStream; @@ -10102,7 +10150,6 @@ interface MediaStream extends EventTarget { getTracks(): MediaStreamTrack[]; getVideoTracks(): MediaStreamTrack[]; removeTrack(track: MediaStreamTrack): void; - stop(): void; addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -10166,7 +10213,7 @@ declare var MediaStreamEvent: { }; interface MediaStreamTrackEventMap { - "ended": MediaStreamErrorEvent; + "ended": Event; "isolationchange": Event; "mute": Event; "overconstrained": MediaStreamErrorEvent; @@ -10181,15 +10228,13 @@ interface MediaStreamTrack extends EventTarget { readonly kind: string; readonly label: string; readonly muted: boolean; - onended: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null; + onended: ((this: MediaStreamTrack, ev: Event) => any) | null; onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null; onmute: ((this: MediaStreamTrack, ev: Event) => any) | null; onoverconstrained: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null; onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null; - readonly readonly: boolean; readonly readyState: MediaStreamTrackState; - readonly remote: boolean; - applyConstraints(constraints: MediaTrackConstraints): Promise; + applyConstraints(constraints?: MediaTrackConstraints): Promise; clone(): MediaStreamTrack; getCapabilities(): MediaTrackCapabilities; getConstraints(): MediaTrackConstraints; @@ -10221,7 +10266,7 @@ interface MediaStreamTrackEvent extends Event { declare var MediaStreamTrackEvent: { prototype: MediaStreamTrackEvent; - new(typeArg: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent; + new(type: string, eventInitDict: MediaStreamTrackEventInit): MediaStreamTrackEvent; }; /** An interface of the Channel Messaging API allows us to create a new message channel and send data through it via its two MessagePort properties. */ @@ -10282,14 +10327,8 @@ interface MessagePort extends EventTarget { * Disconnects the port, so that it is no longer active. */ close(): void; - /** - * Posts a message through the channel. Objects listed in transfer are - * transferred, not just cloned, meaning that they are no longer usable on the sending side. - * Throws a "DataCloneError" DOMException if - * transfer contains duplicate objects or port, or if message - * could not be cloned. - */ - postMessage(message: any, transfer?: Transferable[]): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: PostMessageOptions): void; /** * Begins dispatching messages received on the port. */ @@ -10521,6 +10560,7 @@ interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, gamepadInputEmulation: GamepadInputEmulationType; readonly geolocation: Geolocation; readonly maxTouchPoints: number; + readonly mediaDevices: MediaDevices; readonly mimeTypes: MimeTypeArray; readonly msManipulationViewsEnabled: boolean; readonly msMaxTouchPoints: number; @@ -10531,6 +10571,7 @@ interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, readonly serviceWorker: ServiceWorkerContainer; readonly webdriver: boolean; getGamepads(): (Gamepad | null)[]; + getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void; getVRDisplays(): Promise; javaEnabled(): boolean; msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; @@ -10931,6 +10972,7 @@ interface OfflineAudioContextEventMap extends BaseAudioContextEventMap { interface OfflineAudioContext extends BaseAudioContext { readonly length: number; oncomplete: ((this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any) | null; + resume(): Promise; startRendering(): Promise; suspend(suspendTime: number): Promise; addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -10945,6 +10987,62 @@ declare var OfflineAudioContext: { new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; }; +interface OffscreenCanvas extends EventTarget { + /** + * These attributes return the dimensions of the OffscreenCanvas object's bitmap. + * They can be set, to replace the bitmap with a + * new, transparent black bitmap of the specified dimensions (effectively resizing + * it). + */ + height: number; + width: number; + /** + * Returns a promise that will fulfill with a new Blob object representing a file + * containing the image in the OffscreenCanvas object. + * The argument, if provided, is a dictionary that controls the encoding options of the image + * file to be created. The type + * field specifies the file format and has a default value of "image/png"; that type + * is also used if the requested type isn't supported. If the image format supports variable + * quality (such as "image/jpeg"), then the quality field is a number in the range 0.0 + * to 1.0 inclusive indicating the desired quality level for the resulting image. + */ + convertToBlob(options?: ImageEncodeOptions): Promise; + /** + * Returns an object that exposes an API for drawing on the OffscreenCanvas + * object. contextId specifies the desired API: "2d" or "webgl". options is handled by that + * API. + * This specification defines the "2d" context below, + * which is similar but distinct from the "2d" + * context that is created from a canvas element. There is also a specification that + * defines a "webgl" context. [WEBGL] + * Returns null if the canvas has already been initialized with another context type (e.g., + * trying to get a "2d" context after getting a + * "webgl" context). + */ + getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null; + /** + * Returns a newly created ImageBitmap object with the image in the + * OffscreenCanvas object. The image in the OffscreenCanvas object is + * replaced with a new blank image. + */ + transferToImageBitmap(): ImageBitmap; +} + +declare var OffscreenCanvas: { + prototype: OffscreenCanvas; + new(width: number, height: number): OffscreenCanvas; +}; + +interface OffscreenCanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { + readonly canvas: OffscreenCanvas; + commit(): void; +} + +declare var OffscreenCanvasRenderingContext2D: { + prototype: OffscreenCanvasRenderingContext2D; + new(): OffscreenCanvasRenderingContext2D; +}; + /** The OscillatorNode interface represents a periodic waveform, such as a sine wave. It is an AudioScheduledSourceNode audio-processing module that causes a specified frequency of a given wave to be created—in effect, a constant tone. */ interface OscillatorNode extends AudioScheduledSourceNode { readonly detune: AudioParam; @@ -10962,6 +11060,15 @@ declare var OscillatorNode: { new(context: BaseAudioContext, options?: OscillatorOptions): OscillatorNode; }; +interface OverconstrainedError extends Error { + constraint: string; +} + +declare var OverconstrainedError: { + prototype: OverconstrainedError; + new(): OverconstrainedError; +}; + interface OverflowEvent extends UIEvent { readonly horizontalOverflow: boolean; readonly orient: number; @@ -11284,13 +11391,14 @@ declare var PerformanceNavigationTiming: { interface PerformanceObserver { disconnect(): void; - observe(options: PerformanceObserverInit): void; + observe(options?: PerformanceObserverInit): void; takeRecords(): PerformanceEntryList; } declare var PerformanceObserver: { prototype: PerformanceObserver; new(callback: PerformanceObserverCallback): PerformanceObserver; + readonly supportedEntryTypes: ReadonlyArray; }; interface PerformanceObserverEntryList { @@ -12568,7 +12676,7 @@ declare var SVGAnimationElement: { }; /** An interface for the element. The circle element is defined by the cx and cy attributes that denote the coordinates of the centre of the circle. */ -interface SVGCircleElement extends SVGGraphicsElement { +interface SVGCircleElement extends SVGGeometryElement { readonly cx: SVGAnimatedLength; readonly cy: SVGAnimatedLength; readonly r: SVGAnimatedLength; @@ -12712,7 +12820,7 @@ declare var SVGElementInstanceList: { }; /** Provides access to the properties of elements. */ -interface SVGEllipseElement extends SVGGraphicsElement { +interface SVGEllipseElement extends SVGGeometryElement { readonly cx: SVGAnimatedLength; readonly cy: SVGAnimatedLength; readonly rx: SVGAnimatedLength; @@ -13428,7 +13536,7 @@ declare var SVGLengthList: { }; /** Provides access to the properties of elements, as well as methods to manipulate them. */ -interface SVGLineElement extends SVGGraphicsElement { +interface SVGLineElement extends SVGGeometryElement { readonly x1: SVGAnimatedLength; readonly x2: SVGAnimatedLength; readonly y1: SVGAnimatedLength; @@ -13909,14 +14017,16 @@ declare var SVGPatternElement: { }; interface SVGPointList { + readonly length: number; readonly numberOfItems: number; - appendItem(newItem: SVGPoint): SVGPoint; + appendItem(newItem: DOMPoint): DOMPoint; clear(): void; - getItem(index: number): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; - removeItem(index: number): SVGPoint; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; + getItem(index: number): DOMPoint; + initialize(newItem: DOMPoint): DOMPoint; + insertItemBefore(newItem: DOMPoint, index: number): DOMPoint; + removeItem(index: number): DOMPoint; + replaceItem(newItem: DOMPoint, index: number): DOMPoint; + [index: number]: DOMPoint; } declare var SVGPointList: { @@ -13925,7 +14035,7 @@ declare var SVGPointList: { }; /** Provides access to the properties of elements, as well as methods to manipulate them. */ -interface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints { +interface SVGPolygonElement extends SVGGeometryElement, SVGAnimatedPoints { addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -13938,7 +14048,7 @@ declare var SVGPolygonElement: { }; /** Provides access to the properties of elements, as well as methods to manipulate them. */ -interface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints { +interface SVGPolylineElement extends SVGGeometryElement, SVGAnimatedPoints { addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -14008,7 +14118,7 @@ declare var SVGRadialGradientElement: { }; /** Provides access to the properties of elements, as well as methods to manipulate them. */ -interface SVGRectElement extends SVGGraphicsElement { +interface SVGRectElement extends SVGGeometryElement { readonly height: SVGAnimatedLength; readonly rx: SVGAnimatedLength; readonly ry: SVGAnimatedLength; @@ -14055,6 +14165,7 @@ interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewB readonly width: SVGAnimatedLength; readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; + animationsPaused(): boolean; checkEnclosure(element: SVGElement, rect: SVGRect): boolean; checkIntersection(element: SVGElement, rect: SVGRect): boolean; createSVGAngle(): SVGAngle; @@ -14069,18 +14180,14 @@ interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewB /** @deprecated */ forceRedraw(): void; getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration; - /** @deprecated */ getCurrentTime(): number; getElementById(elementId: string): Element; getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf; - /** @deprecated */ pauseAnimations(): void; - /** @deprecated */ setCurrentTime(seconds: number): void; /** @deprecated */ suspendRedraw(maxWaitMilliseconds: number): number; - /** @deprecated */ unpauseAnimations(): void; /** @deprecated */ unsuspendRedraw(suspendHandleID: number): void; @@ -14583,7 +14690,8 @@ interface ServiceWorker extends EventTarget, AbstractWorker { onstatechange: ((this: ServiceWorker, ev: Event) => any) | null; readonly scriptURL: string; readonly state: ServiceWorkerState; - postMessage(message: any, transfer?: Transferable[]): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: PostMessageOptions): void; addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -16907,6 +17015,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler "devicelight": DeviceLightEvent; "devicemotion": DeviceMotionEvent; "deviceorientation": DeviceOrientationEvent; + "deviceorientationabsolute": DeviceOrientationEvent; "drag": DragEvent; "dragend": DragEvent; "dragenter": DragEvent; @@ -17029,6 +17138,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null; ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null; ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null; + ondeviceorientationabsolute: ((this: Window, ev: DeviceOrientationEvent) => any) | null; onmousewheel: ((this: Window, ev: Event) => any) | null; onmsgesturechange: ((this: Window, ev: Event) => any) | null; onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null; @@ -18024,6 +18134,7 @@ declare var oncompassneedscalibration: ((this: Window, ev: Event) => any) | null declare var ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null; declare var ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null; declare var ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null; +declare var ondeviceorientationabsolute: ((this: Window, ev: DeviceOrientationEvent) => any) | null; declare var onmousewheel: ((this: Window, ev: Event) => any) | null; declare var onmsgesturechange: ((this: Window, ev: Event) => any) | null; declare var onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null; @@ -18132,7 +18243,7 @@ declare var onanimationcancel: ((this: Window, ev: AnimationEvent) => any) | nul declare var onanimationend: ((this: Window, ev: AnimationEvent) => any) | null; declare var onanimationiteration: ((this: Window, ev: AnimationEvent) => any) | null; declare var onanimationstart: ((this: Window, ev: AnimationEvent) => any) | null; -declare var onauxclick: ((this: Window, ev: Event) => any) | null; +declare var onauxclick: ((this: Window, ev: MouseEvent) => any) | null; /** * Fires when the object loses the input focus. * @param ev The focus event. @@ -18437,13 +18548,18 @@ type RequestInfo = Request | string; type DOMHighResTimeStamp = number; type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext; type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement; -type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap; +type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | WebGLRenderingContext; type MessageEventSource = WindowProxy | MessagePort | ServiceWorker; type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement; type ImageBitmapSource = CanvasImageSource | Blob | ImageData; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null; type TimerHandler = string | Function; +type ConstrainULong = number | ConstrainULongRange; +type ConstrainDouble = number | ConstrainDoubleRange; +type ConstrainBoolean = boolean | ConstrainBooleanParameters; +type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; type PerformanceEntryList = PerformanceEntry[]; type VibratePattern = number | number[]; type AlgorithmIdentifier = string | Algorithm; @@ -18470,10 +18586,6 @@ type FormDataEntryValue = File | string; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type IDBValidKey = number | string | Date | BufferSource | IDBArrayKey; type MutationRecordType = "attributes" | "characterData" | "childList"; -type ConstrainBoolean = boolean | ConstrainBooleanParameters; -type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; -type ConstrainDouble = number | ConstrainDoubleRange; -type ConstrainLong = number | ConstrainLongRange; type IDBKeyPath = string; type Transferable = ArrayBuffer | MessagePort | ImageBitmap; type RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete; @@ -18538,6 +18650,7 @@ type NavigationReason = "up" | "down" | "left" | "right"; type NavigationType = "navigate" | "reload" | "back_forward" | "prerender"; type NotificationDirection = "auto" | "ltr" | "rtl"; type NotificationPermission = "default" | "denied" | "granted"; +type OffscreenRenderingContextId = "2d" | "webgl"; type OrientationLockType = "any" | "natural" | "landscape" | "portrait" | "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"; type OrientationType = "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"; type OscillatorType = "sine" | "square" | "sawtooth" | "triangle" | "custom"; diff --git a/src/lib/dom.iterable.generated.d.ts b/src/lib/dom.iterable.generated.d.ts index a00d331b9ded7..37803965d0b92 100644 --- a/src/lib/dom.iterable.generated.d.ts +++ b/src/lib/dom.iterable.generated.d.ts @@ -166,6 +166,10 @@ interface SVGNumberList { [Symbol.iterator](): IterableIterator; } +interface SVGPointList { + [Symbol.iterator](): IterableIterator; +} + interface SVGStringList { [Symbol.iterator](): IterableIterator; } diff --git a/src/lib/webworker.generated.d.ts b/src/lib/webworker.generated.d.ts index f06118ce9f3bb..cc35615d12914 100644 --- a/src/lib/webworker.generated.d.ts +++ b/src/lib/webworker.generated.d.ts @@ -44,7 +44,6 @@ interface BlobPropertyBag { } interface CacheQueryOptions { - cacheName?: string; ignoreMethod?: boolean; ignoreSearch?: boolean; ignoreVary?: boolean; @@ -177,9 +176,9 @@ interface ExtendableMessageEventInit extends ExtendableEventInit { interface FetchEventInit extends ExtendableEventInit { clientId?: string; preloadResponse?: Promise; + replacesClientId?: string; request: Request; resultingClientId?: string; - targetClientId?: string; } interface FilePropertyBag extends BlobPropertyBag { @@ -215,6 +214,11 @@ interface IDBVersionChangeEventInit extends EventInit { oldVersion?: number; } +interface ImageEncodeOptions { + quality?: number; + type?: string; +} + interface JsonWebKey { alg?: string; crv?: string; @@ -253,6 +257,10 @@ interface MidiPermissionDescriptor extends PermissionDescriptor { sysex?: boolean; } +interface MultiCacheQueryOptions extends CacheQueryOptions { + cacheName?: string; +} + interface NavigationPreloadState { enabled?: boolean; headerValue?: string; @@ -294,7 +302,8 @@ interface Pbkdf2Params extends Algorithm { interface PerformanceObserverInit { buffered?: boolean; - entryTypes: string[]; + entryTypes?: string[]; + type?: string; } interface PermissionDescriptor { @@ -308,6 +317,10 @@ interface PipeOptions { signal?: AbortSignal; } +interface PostMessageOptions { + transfer?: any[]; +} + interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; @@ -647,6 +660,43 @@ declare var CacheStorage: { new(): CacheStorage; }; +interface CanvasCompositing { + globalAlpha: number; + globalCompositeOperation: string; +} + +interface CanvasDrawImage { + drawImage(image: CanvasImageSource, dx: number, dy: number): void; + drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void; + drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void; +} + +interface CanvasDrawPath { + beginPath(): void; + clip(fillRule?: CanvasFillRule): void; + clip(path: Path2D, fillRule?: CanvasFillRule): void; + fill(fillRule?: CanvasFillRule): void; + fill(path: Path2D, fillRule?: CanvasFillRule): void; + isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; + isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean; + isPointInStroke(x: number, y: number): boolean; + isPointInStroke(path: Path2D, x: number, y: number): boolean; + stroke(): void; + stroke(path: Path2D): void; +} + +interface CanvasFillStrokeStyles { + fillStyle: string | CanvasGradient | CanvasPattern; + strokeStyle: string | CanvasGradient | CanvasPattern; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: CanvasImageSource, repetition: string): CanvasPattern | null; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; +} + +interface CanvasFilters { + filter: string; +} + /** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */ interface CanvasGradient { /** @@ -664,6 +714,19 @@ declare var CanvasGradient: { new(): CanvasGradient; }; +interface CanvasImageData { + createImageData(sw: number, sh: number): ImageData; + createImageData(imagedata: ImageData): ImageData; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + putImageData(imagedata: ImageData, dx: number, dy: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void; +} + +interface CanvasImageSmoothing { + imageSmoothingEnabled: boolean; + imageSmoothingQuality: ImageSmoothingQuality; +} + interface CanvasPath { arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; @@ -676,6 +739,16 @@ interface CanvasPath { rect(x: number, y: number, w: number, h: number): void; } +interface CanvasPathDrawingStyles { + lineCap: CanvasLineCap; + lineDashOffset: number; + lineJoin: CanvasLineJoin; + lineWidth: number; + miterLimit: number; + getLineDash(): number[]; + setLineDash(segments: number[]): void; +} + /** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */ interface CanvasPattern { /** @@ -690,8 +763,51 @@ declare var CanvasPattern: { new(): CanvasPattern; }; +interface CanvasRect { + clearRect(x: number, y: number, w: number, h: number): void; + fillRect(x: number, y: number, w: number, h: number): void; + strokeRect(x: number, y: number, w: number, h: number): void; +} + +interface CanvasShadowStyles { + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; +} + +interface CanvasState { + restore(): void; + save(): void; +} + +interface CanvasText { + fillText(text: string, x: number, y: number, maxWidth?: number): void; + measureText(text: string): TextMetrics; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; +} + +interface CanvasTextDrawingStyles { + direction: CanvasDirection; + font: string; + textAlign: CanvasTextAlign; + textBaseline: CanvasTextBaseline; +} + +interface CanvasTransform { + getTransform(): DOMMatrix; + resetTransform(): void; + rotate(angle: number): void; + scale(x: number, y: number): void; + setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; + setTransform(transform?: DOMMatrix2DInit): void; + transform(a: number, b: number, c: number, d: number, e: number, f: number): void; + translate(x: number, y: number): void; +} + /** The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient. You can get Client/WindowClient objects from methods such as Clients.matchAll() and Clients.get(). */ interface Client { + readonly frameType: FrameType; readonly id: string; readonly type: ClientTypes; readonly url: string; @@ -1087,7 +1203,8 @@ interface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap { interface DedicatedWorkerGlobalScope extends WorkerGlobalScope { onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null; close(): void; - postMessage(message: any, transfer?: Transferable[]): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: PostMessageOptions): void; addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -1331,9 +1448,9 @@ declare var ExtendableMessageEvent: { interface FetchEvent extends ExtendableEvent { readonly clientId: string; readonly preloadResponse: Promise; + readonly replacesClientId: string; readonly request: Request; readonly resultingClientId: string; - readonly targetClientId: string; respondWith(r: Response | Promise): void; } @@ -2081,14 +2198,8 @@ interface MessagePort extends EventTarget { * Disconnects the port, so that it is no longer active. */ close(): void; - /** - * Posts a message through the channel. Objects listed in transfer are - * transferred, not just cloned, meaning that they are no longer usable on the sending side. - * Throws a "DataCloneError" DOMException if - * transfer contains duplicate objects or port, or if message - * could not be cloned. - */ - postMessage(message: any, transfer?: Transferable[]): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: PostMessageOptions): void; /** * Begins dispatching messages received on the port. */ @@ -2231,6 +2342,62 @@ interface OES_vertex_array_object { readonly VERTEX_ARRAY_BINDING_OES: GLenum; } +interface OffscreenCanvas extends EventTarget { + /** + * These attributes return the dimensions of the OffscreenCanvas object's bitmap. + * They can be set, to replace the bitmap with a + * new, transparent black bitmap of the specified dimensions (effectively resizing + * it). + */ + height: number; + width: number; + /** + * Returns a promise that will fulfill with a new Blob object representing a file + * containing the image in the OffscreenCanvas object. + * The argument, if provided, is a dictionary that controls the encoding options of the image + * file to be created. The type + * field specifies the file format and has a default value of "image/png"; that type + * is also used if the requested type isn't supported. If the image format supports variable + * quality (such as "image/jpeg"), then the quality field is a number in the range 0.0 + * to 1.0 inclusive indicating the desired quality level for the resulting image. + */ + convertToBlob(options?: ImageEncodeOptions): Promise; + /** + * Returns an object that exposes an API for drawing on the OffscreenCanvas + * object. contextId specifies the desired API: "2d" or "webgl". options is handled by that + * API. + * This specification defines the "2d" context below, + * which is similar but distinct from the "2d" + * context that is created from a canvas element. There is also a specification that + * defines a "webgl" context. [WEBGL] + * Returns null if the canvas has already been initialized with another context type (e.g., + * trying to get a "2d" context after getting a + * "webgl" context). + */ + getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null; + /** + * Returns a newly created ImageBitmap object with the image in the + * OffscreenCanvas object. The image in the OffscreenCanvas object is + * replaced with a new blank image. + */ + transferToImageBitmap(): ImageBitmap; +} + +declare var OffscreenCanvas: { + prototype: OffscreenCanvas; + new(width: number, height: number): OffscreenCanvas; +}; + +interface OffscreenCanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { + readonly canvas: OffscreenCanvas; + commit(): void; +} + +declare var OffscreenCanvasRenderingContext2D: { + prototype: OffscreenCanvasRenderingContext2D; + new(): OffscreenCanvasRenderingContext2D; +}; + /** Of the Canvas 2D API is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired. */ interface Path2D extends CanvasPath { addPath(path: Path2D, transform?: DOMMatrix2DInit): void; @@ -2305,13 +2472,14 @@ declare var PerformanceMeasure: { interface PerformanceObserver { disconnect(): void; - observe(options: PerformanceObserverInit): void; + observe(options?: PerformanceObserverInit): void; takeRecords(): PerformanceEntryList; } declare var PerformanceObserver: { prototype: PerformanceObserver; new(callback: PerformanceObserverCallback): PerformanceObserver; + readonly supportedEntryTypes: ReadonlyArray; }; interface PerformanceObserverEntryList { @@ -2655,7 +2823,8 @@ interface ServiceWorker extends EventTarget, AbstractWorker { onstatechange: ((this: ServiceWorker, ev: Event) => any) | null; readonly scriptURL: string; readonly state: ServiceWorkerState; - postMessage(message: any, transfer?: Transferable[]): void; + postMessage(message: any, transfer: Transferable[]): void; + postMessage(message: any, options?: PostMessageOptions): void; addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -4462,7 +4631,8 @@ interface WritableStreamErrorCallback { declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null; declare function close(): void; -declare function postMessage(message: any, transfer?: Transferable[]): void; +declare function postMessage(message: any, transfer: Transferable[]): void; +declare function postMessage(message: any, options?: PostMessageOptions): void; /** * Dispatches a synthetic event event to target and returns true * if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. @@ -4512,7 +4682,8 @@ type HeadersInit = Headers | string[][] | Record; type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string; type RequestInfo = Request | string; type DOMHighResTimeStamp = number; -type CanvasImageSource = ImageBitmap; +type CanvasImageSource = ImageBitmap | OffscreenCanvas; +type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | WebGLRenderingContext; type MessageEventSource = MessagePort | ServiceWorker; type ImageBitmapSource = CanvasImageSource | Blob | ImageData; type TimerHandler = string | Function; @@ -4542,16 +4713,25 @@ type FormDataEntryValue = File | string; type IDBValidKey = number | string | Date | BufferSource | IDBArrayKey; type Transferable = ArrayBuffer | MessagePort | ImageBitmap; type BinaryType = "blob" | "arraybuffer"; +type CanvasDirection = "ltr" | "rtl" | "inherit"; +type CanvasFillRule = "nonzero" | "evenodd"; +type CanvasLineCap = "butt" | "round" | "square"; +type CanvasLineJoin = "round" | "bevel" | "miter"; +type CanvasTextAlign = "start" | "end" | "left" | "right" | "center"; +type CanvasTextBaseline = "top" | "hanging" | "middle" | "alphabetic" | "ideographic" | "bottom"; type ClientTypes = "window" | "worker" | "sharedworker" | "all"; type EndingType = "transparent" | "native"; +type FrameType = "auxiliary" | "top-level" | "nested" | "none"; type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique"; type IDBRequestReadyState = "pending" | "done"; type IDBTransactionMode = "readonly" | "readwrite" | "versionchange"; +type ImageSmoothingQuality = "low" | "medium" | "high"; type KeyFormat = "raw" | "spki" | "pkcs8" | "jwk"; type KeyType = "public" | "private" | "secret"; type KeyUsage = "encrypt" | "decrypt" | "sign" | "verify" | "deriveKey" | "deriveBits" | "wrapKey" | "unwrapKey"; type NotificationDirection = "auto" | "ltr" | "rtl"; type NotificationPermission = "default" | "denied" | "granted"; +type OffscreenRenderingContextId = "2d" | "webgl"; type PermissionName = "geolocation" | "notifications" | "push" | "midi" | "camera" | "microphone" | "speaker" | "device-info" | "background-sync" | "bluetooth" | "persistent-storage" | "ambient-light-sensor" | "accelerometer" | "gyroscope" | "magnetometer" | "clipboard"; type PermissionState = "granted" | "denied" | "prompt"; type PushEncryptionKeyName = "p256dh" | "auth"; diff --git a/src/services/completions.ts b/src/services/completions.ts index 01324c9dc8439..9d569fbedde4f 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1912,8 +1912,8 @@ namespace ts.Completions { return undefined; } - const validIdentiferResult: CompletionEntryDisplayNameForSymbol = { name, needsConvertPropertyAccess: false }; - if (isIdentifierText(name, target)) return validIdentiferResult; + const validIdentifierResult: CompletionEntryDisplayNameForSymbol = { name, needsConvertPropertyAccess: false }; + if (isIdentifierText(name, target)) return validIdentifierResult; switch (kind) { case CompletionKind.MemberLike: return undefined; @@ -1926,7 +1926,7 @@ namespace ts.Completions { return name.charCodeAt(0) === CharacterCodes.space ? undefined : { name, needsConvertPropertyAccess: true }; case CompletionKind.None: case CompletionKind.String: - return validIdentiferResult; + return validIdentifierResult; default: Debug.assertNever(kind); } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 46cd79bf77dfc..e055f5b802db5 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2359,7 +2359,8 @@ declare namespace ts { objectType: Type; indexType: Type; constraint?: Type; - simplified?: Type; + simplifiedForReading?: Type; + simplifiedForWriting?: Type; } type TypeVariable = TypeParameter | IndexedAccessType; interface IndexType extends InstantiableType { diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 51c10fdf1956e..d2fd98185b91b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2359,7 +2359,8 @@ declare namespace ts { objectType: Type; indexType: Type; constraint?: Type; - simplified?: Type; + simplifiedForReading?: Type; + simplifiedForWriting?: Type; } type TypeVariable = TypeParameter | IndexedAccessType; interface IndexType extends InstantiableType { diff --git a/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt b/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt index 69ea8e1afd245..04a88a4b1e5ce 100644 --- a/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt +++ b/tests/baselines/reference/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.errors.txt @@ -11,31 +11,22 @@ tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfin 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'. + Type 'GetProps[Extract>] | (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 '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 '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 'GetProps[keyof GetProps & string] | (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 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[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 'GetProps[string] | (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 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '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'. + 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) ==== @@ -116,29 +107,20 @@ tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfin !!! 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'. +!!! error TS2344: Type 'GetProps[Extract>] | (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 '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 '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 'GetProps[keyof GetProps & string] | (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 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[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 'GetProps[string] | (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 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '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'. +!!! 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/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.errors.txt b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.errors.txt new file mode 100644 index 0000000000000..97cd312b2637a --- /dev/null +++ b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.errors.txt @@ -0,0 +1,85 @@ +tests/cases/compiler/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts(33,5): error TS2322: Type '{ type: T; localChannelId: string; }' is not assignable to type 'NewChannel | ChannelOfType>'. + Type '{ type: T; localChannelId: string; }' is not assignable to type 'Pick | ChannelOfType, "type">'. + Types of property 'type' are incompatible. + Type 'T' is not assignable to type 'ChannelOfType["type"] & ChannelOfType["type"]'. + Type '"text" | "email"' is not assignable to type 'ChannelOfType["type"] & ChannelOfType["type"]'. + Type '"text"' is not assignable to type 'ChannelOfType["type"] & ChannelOfType["type"]'. + Type '"text"' is not assignable to type 'ChannelOfType["type"]'. + Type 'T' is not assignable to type 'ChannelOfType["type"]'. + Type '"text" | "email"' is not assignable to type 'ChannelOfType["type"]'. + Type '"text"' is not assignable to type 'ChannelOfType["type"]'. + Type '"text"' is not assignable to type 'T & "text"'. + Type '"text"' is not assignable to type 'T'. + Type 'T' is not assignable to type 'T & "text"'. + Type '"text" | "email"' is not assignable to type 'T & "text"'. + Type '"text"' is not assignable to type 'T & "text"'. + Type '"text"' is not assignable to type 'T'. + Type 'T' is not assignable to type '"text"'. + Type '"text" | "email"' is not assignable to type '"text"'. + Type '"email"' is not assignable to type '"text"'. + + +==== tests/cases/compiler/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts (1 errors) ==== + interface TextChannel { + id: string; + type: 'text'; + phoneNumber: string; + } + + interface EmailChannel { + id: string; + type: 'email'; + addres: string; + } + + type Channel = TextChannel | EmailChannel; + + export type ChannelType = Channel extends { type: infer R } ? R : never; + + type Omit = Pick< + T, + ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never })[keyof T] + >; + + type ChannelOfType = A extends { type: T } + ? A + : never; + + + export type NewChannel = Pick & + Partial> & { localChannelId: string }; + + + export function makeNewChannel(type: T): NewChannel> { + const localChannelId = `blahblahblah`; + return { type, localChannelId }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '{ type: T; localChannelId: string; }' is not assignable to type 'NewChannel | ChannelOfType>'. +!!! error TS2322: Type '{ type: T; localChannelId: string; }' is not assignable to type 'Pick | ChannelOfType, "type">'. +!!! error TS2322: Types of property 'type' are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'ChannelOfType["type"] & ChannelOfType["type"]'. +!!! error TS2322: Type '"text" | "email"' is not assignable to type 'ChannelOfType["type"] & ChannelOfType["type"]'. +!!! error TS2322: Type '"text"' is not assignable to type 'ChannelOfType["type"] & ChannelOfType["type"]'. +!!! error TS2322: Type '"text"' is not assignable to type 'ChannelOfType["type"]'. +!!! error TS2322: Type 'T' is not assignable to type 'ChannelOfType["type"]'. +!!! error TS2322: Type '"text" | "email"' is not assignable to type 'ChannelOfType["type"]'. +!!! error TS2322: Type '"text"' is not assignable to type 'ChannelOfType["type"]'. +!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'. +!!! error TS2322: Type '"text"' is not assignable to type 'T'. +!!! error TS2322: Type 'T' is not assignable to type 'T & "text"'. +!!! error TS2322: Type '"text" | "email"' is not assignable to type 'T & "text"'. +!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'. +!!! error TS2322: Type '"text"' is not assignable to type 'T'. +!!! error TS2322: Type 'T' is not assignable to type '"text"'. +!!! error TS2322: Type '"text" | "email"' is not assignable to type '"text"'. +!!! error TS2322: Type '"email"' is not assignable to type '"text"'. + } + + const newTextChannel = makeNewChannel('text'); + // This should work + newTextChannel.phoneNumber = '613-555-1234'; + + const newTextChannel2 : NewChannel = makeNewChannel('text'); + // Compare with this, which ofc works. + newTextChannel2.phoneNumber = '613-555-1234'; + \ No newline at end of file diff --git a/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.js b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.js new file mode 100644 index 0000000000000..737d48245a9f3 --- /dev/null +++ b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.js @@ -0,0 +1,59 @@ +//// [complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts] +interface TextChannel { + id: string; + type: 'text'; + phoneNumber: string; +} + +interface EmailChannel { + id: string; + type: 'email'; + addres: string; +} + +type Channel = TextChannel | EmailChannel; + +export type ChannelType = Channel extends { type: infer R } ? R : never; + +type Omit = Pick< + T, + ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never })[keyof T] +>; + +type ChannelOfType = A extends { type: T } + ? A + : never; + + +export type NewChannel = Pick & + Partial> & { localChannelId: string }; + + +export function makeNewChannel(type: T): NewChannel> { + const localChannelId = `blahblahblah`; + return { type, localChannelId }; +} + +const newTextChannel = makeNewChannel('text'); +// This should work +newTextChannel.phoneNumber = '613-555-1234'; + +const newTextChannel2 : NewChannel = makeNewChannel('text'); +// Compare with this, which ofc works. +newTextChannel2.phoneNumber = '613-555-1234'; + + +//// [complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.js] +"use strict"; +exports.__esModule = true; +function makeNewChannel(type) { + var localChannelId = "blahblahblah"; + return { type: type, localChannelId: localChannelId }; +} +exports.makeNewChannel = makeNewChannel; +var newTextChannel = makeNewChannel('text'); +// This should work +newTextChannel.phoneNumber = '613-555-1234'; +var newTextChannel2 = makeNewChannel('text'); +// Compare with this, which ofc works. +newTextChannel2.phoneNumber = '613-555-1234'; diff --git a/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.symbols b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.symbols new file mode 100644 index 0000000000000..5e1a8671422ec --- /dev/null +++ b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.symbols @@ -0,0 +1,130 @@ +=== tests/cases/compiler/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts === +interface TextChannel { +>TextChannel : Symbol(TextChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 0, 0)) + + id: string; +>id : Symbol(TextChannel.id, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 0, 23)) + + type: 'text'; +>type : Symbol(TextChannel.type, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 1, 15)) + + phoneNumber: string; +>phoneNumber : Symbol(TextChannel.phoneNumber, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 2, 17)) +} + +interface EmailChannel { +>EmailChannel : Symbol(EmailChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 4, 1)) + + id: string; +>id : Symbol(EmailChannel.id, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 6, 24)) + + type: 'email'; +>type : Symbol(EmailChannel.type, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 7, 15)) + + addres: string; +>addres : Symbol(EmailChannel.addres, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 8, 18)) +} + +type Channel = TextChannel | EmailChannel; +>Channel : Symbol(Channel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 10, 1)) +>TextChannel : Symbol(TextChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 0, 0)) +>EmailChannel : Symbol(EmailChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 4, 1)) + +export type ChannelType = Channel extends { type: infer R } ? R : never; +>ChannelType : Symbol(ChannelType, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 12, 42)) +>Channel : Symbol(Channel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 10, 1)) +>type : Symbol(type, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 14, 43)) +>R : Symbol(R, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 14, 55)) +>R : Symbol(R, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 14, 55)) + +type Omit = Pick< +>Omit : Symbol(Omit, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 14, 72)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 16, 10)) +>K : Symbol(K, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 16, 12)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 16, 10)) +>Pick : Symbol(Pick, Decl(lib.es5.d.ts, --, --)) + + T, +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 16, 10)) + + ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never })[keyof T] +>P : Symbol(P, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 18, 8)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 16, 10)) +>P : Symbol(P, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 18, 8)) +>P : Symbol(P, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 18, 32)) +>K : Symbol(K, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 16, 12)) +>x : Symbol(x, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 18, 54)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 16, 10)) + +>; + +type ChannelOfType = A extends { type: T } +>ChannelOfType : Symbol(ChannelOfType, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 19, 2)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 21, 19)) +>ChannelType : Symbol(ChannelType, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 12, 42)) +>A : Symbol(A, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 21, 41)) +>Channel : Symbol(Channel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 10, 1)) +>A : Symbol(A, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 21, 41)) +>type : Symbol(type, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 21, 68)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 21, 19)) + + ? A +>A : Symbol(A, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 21, 41)) + + : never; + + +export type NewChannel = Pick & +>NewChannel : Symbol(NewChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 23, 12)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 26, 23)) +>Channel : Symbol(Channel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 10, 1)) +>Pick : Symbol(Pick, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 26, 23)) + + Partial> & { localChannelId: string }; +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Omit : Symbol(Omit, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 14, 72)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 26, 23)) +>localChannelId : Symbol(localChannelId, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 27, 39)) + + +export function makeNewChannel(type: T): NewChannel> { +>makeNewChannel : Symbol(makeNewChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 27, 65)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 30, 31)) +>ChannelType : Symbol(ChannelType, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 12, 42)) +>type : Symbol(type, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 30, 54)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 30, 31)) +>NewChannel : Symbol(NewChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 23, 12)) +>ChannelOfType : Symbol(ChannelOfType, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 19, 2)) +>T : Symbol(T, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 30, 31)) + + const localChannelId = `blahblahblah`; +>localChannelId : Symbol(localChannelId, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 31, 9)) + + return { type, localChannelId }; +>type : Symbol(type, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 32, 12)) +>localChannelId : Symbol(localChannelId, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 32, 18)) +} + +const newTextChannel = makeNewChannel('text'); +>newTextChannel : Symbol(newTextChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 35, 5)) +>makeNewChannel : Symbol(makeNewChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 27, 65)) + +// This should work +newTextChannel.phoneNumber = '613-555-1234'; +>newTextChannel.phoneNumber : Symbol(phoneNumber, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 2, 17)) +>newTextChannel : Symbol(newTextChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 35, 5)) +>phoneNumber : Symbol(phoneNumber, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 2, 17)) + +const newTextChannel2 : NewChannel = makeNewChannel('text'); +>newTextChannel2 : Symbol(newTextChannel2, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 39, 5)) +>NewChannel : Symbol(NewChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 23, 12)) +>TextChannel : Symbol(TextChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 0, 0)) +>makeNewChannel : Symbol(makeNewChannel, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 27, 65)) + +// Compare with this, which ofc works. +newTextChannel2.phoneNumber = '613-555-1234'; +>newTextChannel2.phoneNumber : Symbol(phoneNumber, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 2, 17)) +>newTextChannel2 : Symbol(newTextChannel2, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 39, 5)) +>phoneNumber : Symbol(phoneNumber, Decl(complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts, 2, 17)) + diff --git a/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.types b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.types new file mode 100644 index 0000000000000..9447ce3d53195 --- /dev/null +++ b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.types @@ -0,0 +1,96 @@ +=== tests/cases/compiler/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts === +interface TextChannel { + id: string; +>id : string + + type: 'text'; +>type : "text" + + phoneNumber: string; +>phoneNumber : string +} + +interface EmailChannel { + id: string; +>id : string + + type: 'email'; +>type : "email" + + addres: string; +>addres : string +} + +type Channel = TextChannel | EmailChannel; +>Channel : Channel + +export type ChannelType = Channel extends { type: infer R } ? R : never; +>ChannelType : "text" | "email" +>type : R + +type Omit = Pick< +>Omit : Pick + + T, + ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never })[keyof T] +>x : string + +>; + +type ChannelOfType = A extends { type: T } +>ChannelOfType : ChannelOfType +>type : T + + ? A + : never; + + +export type NewChannel = Pick & +>NewChannel : NewChannel + + Partial> & { localChannelId: string }; +>localChannelId : string + + +export function makeNewChannel(type: T): NewChannel> { +>makeNewChannel : (type: T) => NewChannel | ChannelOfType> +>type : T + + const localChannelId = `blahblahblah`; +>localChannelId : "blahblahblah" +>`blahblahblah` : "blahblahblah" + + return { type, localChannelId }; +>{ type, localChannelId } : { type: T; localChannelId: string; } +>type : T +>localChannelId : string +} + +const newTextChannel = makeNewChannel('text'); +>newTextChannel : NewChannel +>makeNewChannel('text') : NewChannel +>makeNewChannel : (type: T) => NewChannel | ChannelOfType> +>'text' : "text" + +// This should work +newTextChannel.phoneNumber = '613-555-1234'; +>newTextChannel.phoneNumber = '613-555-1234' : "613-555-1234" +>newTextChannel.phoneNumber : string +>newTextChannel : NewChannel +>phoneNumber : string +>'613-555-1234' : "613-555-1234" + +const newTextChannel2 : NewChannel = makeNewChannel('text'); +>newTextChannel2 : NewChannel +>makeNewChannel('text') : NewChannel +>makeNewChannel : (type: T) => NewChannel | ChannelOfType> +>'text' : "text" + +// Compare with this, which ofc works. +newTextChannel2.phoneNumber = '613-555-1234'; +>newTextChannel2.phoneNumber = '613-555-1234' : "613-555-1234" +>newTextChannel2.phoneNumber : string +>newTextChannel2 : NewChannel +>phoneNumber : string +>'613-555-1234' : "613-555-1234" + diff --git a/tests/baselines/reference/conditionalTypeDoesntSpinForever.types b/tests/baselines/reference/conditionalTypeDoesntSpinForever.types index 1f4b4a62cd293..d4fe4bf48261b 100644 --- a/tests/baselines/reference/conditionalTypeDoesntSpinForever.types +++ b/tests/baselines/reference/conditionalTypeDoesntSpinForever.types @@ -120,9 +120,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) as >buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; } +>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; } >Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor >assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } @@ -144,9 +144,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) as >buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; } +>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; } >Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor >assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } @@ -337,16 +337,16 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) as BuildPubSubRecordType, >buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0}) : SO_FAR & { maxMsToWaitBeforePublishing: 0; } +>Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0}) : SO_FAR & { maxMsToWaitBeforePublishing: number; } >Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor >assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR ->{maxMsToWaitBeforePublishing: 0} : { maxMsToWaitBeforePublishing: 0; } ->maxMsToWaitBeforePublishing : 0 +>{maxMsToWaitBeforePublishing: 0} : { maxMsToWaitBeforePublishing: number; } +>maxMsToWaitBeforePublishing : number >0 : 0 >maxMsToWaitBeforePublishing : 0 } diff --git a/tests/baselines/reference/conditionalTypeSimplification.js b/tests/baselines/reference/conditionalTypeSimplification.js new file mode 100644 index 0000000000000..ad691981658ce --- /dev/null +++ b/tests/baselines/reference/conditionalTypeSimplification.js @@ -0,0 +1,15 @@ +//// [conditionalTypeSimplification.ts] +// Repro from #30794 + +interface AbstractSchema { + m1 (v: T): SchemaType>; + m2 (v: T): SchemaType; +} + +type SchemaType = S extends object ? AnySchema : never; +interface AnySchema extends AnySchemaType, V> { } +interface AnySchemaType, V> extends AbstractSchema { } + + +//// [conditionalTypeSimplification.js] +// Repro from #30794 diff --git a/tests/baselines/reference/conditionalTypeSimplification.symbols b/tests/baselines/reference/conditionalTypeSimplification.symbols new file mode 100644 index 0000000000000..06c00dc28277b --- /dev/null +++ b/tests/baselines/reference/conditionalTypeSimplification.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/conditionalTypeSimplification.ts === +// Repro from #30794 + +interface AbstractSchema { +>AbstractSchema : Symbol(AbstractSchema, Decl(conditionalTypeSimplification.ts, 0, 0)) +>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 2, 25)) +>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 2, 27)) + + m1 (v: T): SchemaType>; +>m1 : Symbol(AbstractSchema.m1, Decl(conditionalTypeSimplification.ts, 2, 32)) +>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 3, 5)) +>v : Symbol(v, Decl(conditionalTypeSimplification.ts, 3, 9)) +>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 3, 5)) +>SchemaType : Symbol(SchemaType, Decl(conditionalTypeSimplification.ts, 5, 1)) +>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 2, 25)) +>Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --)) +>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 2, 27)) +>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 3, 5)) + + m2 (v: T): SchemaType; +>m2 : Symbol(AbstractSchema.m2, Decl(conditionalTypeSimplification.ts, 3, 45)) +>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 4, 5)) +>v : Symbol(v, Decl(conditionalTypeSimplification.ts, 4, 9)) +>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 4, 5)) +>SchemaType : Symbol(SchemaType, Decl(conditionalTypeSimplification.ts, 5, 1)) +>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 2, 25)) +>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 4, 5)) +} + +type SchemaType = S extends object ? AnySchema : never; +>SchemaType : Symbol(SchemaType, Decl(conditionalTypeSimplification.ts, 5, 1)) +>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 7, 16)) +>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 7, 18)) +>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 7, 16)) +>AnySchema : Symbol(AnySchema, Decl(conditionalTypeSimplification.ts, 7, 64)) +>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 7, 18)) + +interface AnySchema extends AnySchemaType, V> { } +>AnySchema : Symbol(AnySchema, Decl(conditionalTypeSimplification.ts, 7, 64)) +>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 8, 20)) +>AnySchemaType : Symbol(AnySchemaType, Decl(conditionalTypeSimplification.ts, 8, 73)) +>AnySchema : Symbol(AnySchema, Decl(conditionalTypeSimplification.ts, 7, 64)) +>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 8, 20)) + +interface AnySchemaType, V> extends AbstractSchema { } +>AnySchemaType : Symbol(AnySchemaType, Decl(conditionalTypeSimplification.ts, 8, 73)) +>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 9, 24)) +>AbstractSchema : Symbol(AbstractSchema, Decl(conditionalTypeSimplification.ts, 0, 0)) +>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 9, 59)) +>AbstractSchema : Symbol(AbstractSchema, Decl(conditionalTypeSimplification.ts, 0, 0)) +>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 9, 24)) +>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 9, 59)) + diff --git a/tests/baselines/reference/conditionalTypeSimplification.types b/tests/baselines/reference/conditionalTypeSimplification.types new file mode 100644 index 0000000000000..d81e593a9cfbe --- /dev/null +++ b/tests/baselines/reference/conditionalTypeSimplification.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/conditionalTypeSimplification.ts === +// Repro from #30794 + +interface AbstractSchema { + m1 (v: T): SchemaType>; +>m1 : (v: T) => SchemaType> +>v : T + + m2 (v: T): SchemaType; +>m2 : (v: T) => SchemaType +>v : T +} + +type SchemaType = S extends object ? AnySchema : never; +>SchemaType : SchemaType + +interface AnySchema extends AnySchemaType, V> { } +interface AnySchemaType, V> extends AbstractSchema { } + diff --git a/tests/baselines/reference/errorSuperCalls.errors.txt b/tests/baselines/reference/errorSuperCalls.errors.txt index 036367fd44b52..5d53d6719e08b 100644 --- a/tests/baselines/reference/errorSuperCalls.errors.txt +++ b/tests/baselines/reference/errorSuperCalls.errors.txt @@ -7,15 +7,14 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(26,9): error T tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(30,16): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(34,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(38,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. -tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. -tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,14): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,14): error TS2754: 'super' may not use type arguments. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(58,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(62,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(67,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(71,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. -==== tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts (15 errors) ==== +==== tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts (14 errors) ==== //super call in class constructor with no base type class NoBase { constructor() { @@ -80,10 +79,8 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(71,9): error T //super call with type arguments constructor() { super(); - ~~~~~ -!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. - ~ -!!! error TS1034: 'super' must be followed by an argument list or member access. + ~~~~~~~~ +!!! error TS2754: 'super' may not use type arguments. super(); } } diff --git a/tests/baselines/reference/errorSuperCalls.js b/tests/baselines/reference/errorSuperCalls.js index 8048ed34aa63a..11cda4b76f7cb 100644 --- a/tests/baselines/reference/errorSuperCalls.js +++ b/tests/baselines/reference/errorSuperCalls.js @@ -140,8 +140,7 @@ var Derived = /** @class */ (function (_super) { __extends(Derived, _super); //super call with type arguments function Derived() { - var _this = this; - _super.prototype..call(_this); + var _this = _super.call(this) || this; _this = _super.call(this) || this; return _this; } diff --git a/tests/baselines/reference/errorSuperCalls.types b/tests/baselines/reference/errorSuperCalls.types index 3265475a13e27..31de16c40778c 100644 --- a/tests/baselines/reference/errorSuperCalls.types +++ b/tests/baselines/reference/errorSuperCalls.types @@ -91,10 +91,8 @@ class Derived extends Base { //super call with type arguments constructor() { super(); ->super() : any ->super : any ->super : Base -> : any +>super() : void +>super : typeof Base super(); >super() : void diff --git a/tests/baselines/reference/genericClassesRedeclaration.errors.txt b/tests/baselines/reference/genericClassesRedeclaration.errors.txt index abdea2b052bc6..197701c862470 100644 --- a/tests/baselines/reference/genericClassesRedeclaration.errors.txt +++ b/tests/baselines/reference/genericClassesRedeclaration.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/genericClassesRedeclaration.ts(16,11): error TS2300: Duplicate identifier 'StringHashTable'. -tests/cases/compiler/genericClassesRedeclaration.ts(29,11): error TS2300: Duplicate identifier 'IdentiferNameHashTable'. +tests/cases/compiler/genericClassesRedeclaration.ts(29,11): error TS2300: Duplicate identifier 'IdentifierNameHashTable'. tests/cases/compiler/genericClassesRedeclaration.ts(42,9): error TS2374: Duplicate string index signature. tests/cases/compiler/genericClassesRedeclaration.ts(55,11): error TS2300: Duplicate identifier 'StringHashTable'. -tests/cases/compiler/genericClassesRedeclaration.ts(68,11): error TS2300: Duplicate identifier 'IdentiferNameHashTable'. +tests/cases/compiler/genericClassesRedeclaration.ts(68,11): error TS2300: Duplicate identifier 'IdentifierNameHashTable'. ==== tests/cases/compiler/genericClassesRedeclaration.ts (5 errors) ==== @@ -36,9 +36,9 @@ tests/cases/compiler/genericClassesRedeclaration.ts(68,11): error TS2300: Duplic public lookup(key: string): T; public remove(key: string): void; } - class IdentiferNameHashTable extends StringHashTable { - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2300: Duplicate identifier 'IdentiferNameHashTable'. + class IdentifierNameHashTable extends StringHashTable { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'IdentifierNameHashTable'. public getAllKeys(): string[]; public add(key: string, data: T): boolean; public addOrUpdate(key: string, data: T): boolean; @@ -81,9 +81,9 @@ tests/cases/compiler/genericClassesRedeclaration.ts(68,11): error TS2300: Duplic public lookup(key: string): T; public remove(key: string): void; } - class IdentiferNameHashTable extends StringHashTable { - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2300: Duplicate identifier 'IdentiferNameHashTable'. + class IdentifierNameHashTable extends StringHashTable { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'IdentifierNameHashTable'. public getAllKeys(): string[]; public add(key: string, data: T): boolean; public addOrUpdate(key: string, data: T): boolean; diff --git a/tests/baselines/reference/genericClassesRedeclaration.js b/tests/baselines/reference/genericClassesRedeclaration.js index 0d1b2661836ff..85d8b67ae5555 100644 --- a/tests/baselines/reference/genericClassesRedeclaration.js +++ b/tests/baselines/reference/genericClassesRedeclaration.js @@ -27,7 +27,7 @@ declare module TypeScript { public lookup(key: string): T; public remove(key: string): void; } - class IdentiferNameHashTable extends StringHashTable { + class IdentifierNameHashTable extends StringHashTable { public getAllKeys(): string[]; public add(key: string, data: T): boolean; public addOrUpdate(key: string, data: T): boolean; @@ -66,7 +66,7 @@ declare module TypeScript { public lookup(key: string): T; public remove(key: string): void; } - class IdentiferNameHashTable extends StringHashTable { + class IdentifierNameHashTable extends StringHashTable { public getAllKeys(): string[]; public add(key: string, data: T): boolean; public addOrUpdate(key: string, data: T): boolean; diff --git a/tests/baselines/reference/genericClassesRedeclaration.symbols b/tests/baselines/reference/genericClassesRedeclaration.symbols index d2b8c15b1408a..7ab2a87663fc0 100644 --- a/tests/baselines/reference/genericClassesRedeclaration.symbols +++ b/tests/baselines/reference/genericClassesRedeclaration.symbols @@ -136,47 +136,47 @@ declare module TypeScript { >remove : Symbol(StringHashTable.remove, Decl(genericClassesRedeclaration.ts, 25, 38)) >key : Symbol(key, Decl(genericClassesRedeclaration.ts, 26, 22)) } - class IdentiferNameHashTable extends StringHashTable { ->IdentiferNameHashTable : Symbol(IdentiferNameHashTable, Decl(genericClassesRedeclaration.ts, 27, 5)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 33)) + class IdentifierNameHashTable extends StringHashTable { +>IdentifierNameHashTable : Symbol(IdentifierNameHashTable, Decl(genericClassesRedeclaration.ts, 27, 5)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 34)) >StringHashTable : Symbol(StringHashTable, Decl(genericClassesRedeclaration.ts, 14, 5)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 34)) public getAllKeys(): string[]; ->getAllKeys : Symbol(IdentiferNameHashTable.getAllKeys, Decl(genericClassesRedeclaration.ts, 28, 64)) +>getAllKeys : Symbol(IdentifierNameHashTable.getAllKeys, Decl(genericClassesRedeclaration.ts, 28, 65)) public add(key: string, data: T): boolean; ->add : Symbol(IdentiferNameHashTable.add, Decl(genericClassesRedeclaration.ts, 29, 38)) +>add : Symbol(IdentifierNameHashTable.add, Decl(genericClassesRedeclaration.ts, 29, 38)) >key : Symbol(key, Decl(genericClassesRedeclaration.ts, 30, 19)) >data : Symbol(data, Decl(genericClassesRedeclaration.ts, 30, 31)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 34)) public addOrUpdate(key: string, data: T): boolean; ->addOrUpdate : Symbol(IdentiferNameHashTable.addOrUpdate, Decl(genericClassesRedeclaration.ts, 30, 50)) +>addOrUpdate : Symbol(IdentifierNameHashTable.addOrUpdate, Decl(genericClassesRedeclaration.ts, 30, 50)) >key : Symbol(key, Decl(genericClassesRedeclaration.ts, 31, 27)) >data : Symbol(data, Decl(genericClassesRedeclaration.ts, 31, 39)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 34)) public map(fn: (k: string, value: T, context: any) => void, context: any): void; ->map : Symbol(IdentiferNameHashTable.map, Decl(genericClassesRedeclaration.ts, 31, 58)) +>map : Symbol(IdentifierNameHashTable.map, Decl(genericClassesRedeclaration.ts, 31, 58)) >fn : Symbol(fn, Decl(genericClassesRedeclaration.ts, 32, 19)) >k : Symbol(k, Decl(genericClassesRedeclaration.ts, 32, 24)) >value : Symbol(value, Decl(genericClassesRedeclaration.ts, 32, 34)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 34)) >context : Symbol(context, Decl(genericClassesRedeclaration.ts, 32, 44)) >context : Symbol(context, Decl(genericClassesRedeclaration.ts, 32, 67)) public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; ->every : Symbol(IdentiferNameHashTable.every, Decl(genericClassesRedeclaration.ts, 32, 88)) +>every : Symbol(IdentifierNameHashTable.every, Decl(genericClassesRedeclaration.ts, 32, 88)) >fn : Symbol(fn, Decl(genericClassesRedeclaration.ts, 33, 21)) >k : Symbol(k, Decl(genericClassesRedeclaration.ts, 33, 26)) >value : Symbol(value, Decl(genericClassesRedeclaration.ts, 33, 36)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 34)) >context : Symbol(context, Decl(genericClassesRedeclaration.ts, 33, 46)) >context : Symbol(context, Decl(genericClassesRedeclaration.ts, 33, 69)) public some(fn: (k: string, value: any, context: any) => void, context: any): boolean; ->some : Symbol(IdentiferNameHashTable.some, Decl(genericClassesRedeclaration.ts, 33, 93)) +>some : Symbol(IdentifierNameHashTable.some, Decl(genericClassesRedeclaration.ts, 33, 93)) >fn : Symbol(fn, Decl(genericClassesRedeclaration.ts, 34, 20)) >k : Symbol(k, Decl(genericClassesRedeclaration.ts, 34, 25)) >value : Symbol(value, Decl(genericClassesRedeclaration.ts, 34, 35)) @@ -184,9 +184,9 @@ declare module TypeScript { >context : Symbol(context, Decl(genericClassesRedeclaration.ts, 34, 70)) public lookup(key: string): T; ->lookup : Symbol(IdentiferNameHashTable.lookup, Decl(genericClassesRedeclaration.ts, 34, 94)) +>lookup : Symbol(IdentifierNameHashTable.lookup, Decl(genericClassesRedeclaration.ts, 34, 94)) >key : Symbol(key, Decl(genericClassesRedeclaration.ts, 35, 22)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 28, 34)) } } @@ -327,47 +327,47 @@ declare module TypeScript { >remove : Symbol(StringHashTable.remove, Decl(genericClassesRedeclaration.ts, 64, 38)) >key : Symbol(key, Decl(genericClassesRedeclaration.ts, 65, 22)) } - class IdentiferNameHashTable extends StringHashTable { ->IdentiferNameHashTable : Symbol(IdentiferNameHashTable, Decl(genericClassesRedeclaration.ts, 66, 5)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 33)) + class IdentifierNameHashTable extends StringHashTable { +>IdentifierNameHashTable : Symbol(IdentifierNameHashTable, Decl(genericClassesRedeclaration.ts, 66, 5)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 34)) >StringHashTable : Symbol(StringHashTable, Decl(genericClassesRedeclaration.ts, 14, 5)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 34)) public getAllKeys(): string[]; ->getAllKeys : Symbol(IdentiferNameHashTable.getAllKeys, Decl(genericClassesRedeclaration.ts, 67, 64)) +>getAllKeys : Symbol(IdentifierNameHashTable.getAllKeys, Decl(genericClassesRedeclaration.ts, 67, 65)) public add(key: string, data: T): boolean; ->add : Symbol(IdentiferNameHashTable.add, Decl(genericClassesRedeclaration.ts, 68, 38)) +>add : Symbol(IdentifierNameHashTable.add, Decl(genericClassesRedeclaration.ts, 68, 38)) >key : Symbol(key, Decl(genericClassesRedeclaration.ts, 69, 19)) >data : Symbol(data, Decl(genericClassesRedeclaration.ts, 69, 31)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 34)) public addOrUpdate(key: string, data: T): boolean; ->addOrUpdate : Symbol(IdentiferNameHashTable.addOrUpdate, Decl(genericClassesRedeclaration.ts, 69, 50)) +>addOrUpdate : Symbol(IdentifierNameHashTable.addOrUpdate, Decl(genericClassesRedeclaration.ts, 69, 50)) >key : Symbol(key, Decl(genericClassesRedeclaration.ts, 70, 27)) >data : Symbol(data, Decl(genericClassesRedeclaration.ts, 70, 39)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 34)) public map(fn: (k: string, value: T, context: any) => void, context: any): void; ->map : Symbol(IdentiferNameHashTable.map, Decl(genericClassesRedeclaration.ts, 70, 58)) +>map : Symbol(IdentifierNameHashTable.map, Decl(genericClassesRedeclaration.ts, 70, 58)) >fn : Symbol(fn, Decl(genericClassesRedeclaration.ts, 71, 19)) >k : Symbol(k, Decl(genericClassesRedeclaration.ts, 71, 24)) >value : Symbol(value, Decl(genericClassesRedeclaration.ts, 71, 34)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 34)) >context : Symbol(context, Decl(genericClassesRedeclaration.ts, 71, 44)) >context : Symbol(context, Decl(genericClassesRedeclaration.ts, 71, 67)) public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; ->every : Symbol(IdentiferNameHashTable.every, Decl(genericClassesRedeclaration.ts, 71, 88)) +>every : Symbol(IdentifierNameHashTable.every, Decl(genericClassesRedeclaration.ts, 71, 88)) >fn : Symbol(fn, Decl(genericClassesRedeclaration.ts, 72, 21)) >k : Symbol(k, Decl(genericClassesRedeclaration.ts, 72, 26)) >value : Symbol(value, Decl(genericClassesRedeclaration.ts, 72, 36)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 34)) >context : Symbol(context, Decl(genericClassesRedeclaration.ts, 72, 46)) >context : Symbol(context, Decl(genericClassesRedeclaration.ts, 72, 69)) public some(fn: (k: string, value: any, context: any) => void, context: any): boolean; ->some : Symbol(IdentiferNameHashTable.some, Decl(genericClassesRedeclaration.ts, 72, 93)) +>some : Symbol(IdentifierNameHashTable.some, Decl(genericClassesRedeclaration.ts, 72, 93)) >fn : Symbol(fn, Decl(genericClassesRedeclaration.ts, 73, 20)) >k : Symbol(k, Decl(genericClassesRedeclaration.ts, 73, 25)) >value : Symbol(value, Decl(genericClassesRedeclaration.ts, 73, 35)) @@ -375,8 +375,8 @@ declare module TypeScript { >context : Symbol(context, Decl(genericClassesRedeclaration.ts, 73, 70)) public lookup(key: string): T; ->lookup : Symbol(IdentiferNameHashTable.lookup, Decl(genericClassesRedeclaration.ts, 73, 94)) +>lookup : Symbol(IdentifierNameHashTable.lookup, Decl(genericClassesRedeclaration.ts, 73, 94)) >key : Symbol(key, Decl(genericClassesRedeclaration.ts, 74, 22)) ->T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 33)) +>T : Symbol(T, Decl(genericClassesRedeclaration.ts, 67, 34)) } } diff --git a/tests/baselines/reference/genericClassesRedeclaration.types b/tests/baselines/reference/genericClassesRedeclaration.types index c154d16837041..1d3756448570c 100644 --- a/tests/baselines/reference/genericClassesRedeclaration.types +++ b/tests/baselines/reference/genericClassesRedeclaration.types @@ -111,8 +111,8 @@ declare module TypeScript { >remove : (key: string) => void >key : string } - class IdentiferNameHashTable extends StringHashTable { ->IdentiferNameHashTable : IdentiferNameHashTable + class IdentifierNameHashTable extends StringHashTable { +>IdentifierNameHashTable : IdentifierNameHashTable >StringHashTable : StringHashTable public getAllKeys(): string[]; @@ -270,8 +270,8 @@ declare module TypeScript { >remove : (key: string) => void >key : string } - class IdentiferNameHashTable extends StringHashTable { ->IdentiferNameHashTable : TypeScript.IdentiferNameHashTable + class IdentifierNameHashTable extends StringHashTable { +>IdentifierNameHashTable : TypeScript.IdentifierNameHashTable >StringHashTable : TypeScript.StringHashTable public getAllKeys(): string[]; diff --git a/tests/baselines/reference/genericFunctionInference2.js b/tests/baselines/reference/genericFunctionInference2.js new file mode 100644 index 0000000000000..e8967ed8b8a57 --- /dev/null +++ b/tests/baselines/reference/genericFunctionInference2.js @@ -0,0 +1,46 @@ +//// [genericFunctionInference2.ts] +// Repro from #30685 + +type Reducer = (state: S) => S; +declare function combineReducers(reducers: { [K in keyof S]: Reducer }): Reducer; + +type MyState = { combined: { foo: number } }; +declare const foo: Reducer; + +const myReducer1: Reducer = combineReducers({ + combined: combineReducers({ foo }), +}); + +const myReducer2 = combineReducers({ + combined: combineReducers({ foo }), +}); + +// Repro from #30942 + +declare function withH(handlerCreators: HandleCreatorsFactory): U; + +type Props = { out: number } + +type HandleCreatorsFactory = (initialProps: T) => { [P in keyof U]: (props: T) => U[P] }; + +const enhancer4 = withH((props: Props) => ({ + onChange: (props) => (e: any) => {}, + onSubmit: (props) => (e: any) => {}, +})); + +enhancer4.onChange(null); + + +//// [genericFunctionInference2.js] +// Repro from #30685 +var myReducer1 = combineReducers({ + combined: combineReducers({ foo: foo }) +}); +var myReducer2 = combineReducers({ + combined: combineReducers({ foo: foo }) +}); +var enhancer4 = withH(function (props) { return ({ + onChange: function (props) { return function (e) { }; }, + onSubmit: function (props) { return function (e) { }; } +}); }); +enhancer4.onChange(null); diff --git a/tests/baselines/reference/genericFunctionInference2.symbols b/tests/baselines/reference/genericFunctionInference2.symbols new file mode 100644 index 0000000000000..ca099b062eb43 --- /dev/null +++ b/tests/baselines/reference/genericFunctionInference2.symbols @@ -0,0 +1,108 @@ +=== tests/cases/compiler/genericFunctionInference2.ts === +// Repro from #30685 + +type Reducer = (state: S) => S; +>Reducer : Symbol(Reducer, Decl(genericFunctionInference2.ts, 0, 0)) +>S : Symbol(S, Decl(genericFunctionInference2.ts, 2, 13)) +>state : Symbol(state, Decl(genericFunctionInference2.ts, 2, 19)) +>S : Symbol(S, Decl(genericFunctionInference2.ts, 2, 13)) +>S : Symbol(S, Decl(genericFunctionInference2.ts, 2, 13)) + +declare function combineReducers(reducers: { [K in keyof S]: Reducer }): Reducer; +>combineReducers : Symbol(combineReducers, Decl(genericFunctionInference2.ts, 2, 34)) +>S : Symbol(S, Decl(genericFunctionInference2.ts, 3, 33)) +>reducers : Symbol(reducers, Decl(genericFunctionInference2.ts, 3, 36)) +>K : Symbol(K, Decl(genericFunctionInference2.ts, 3, 49)) +>S : Symbol(S, Decl(genericFunctionInference2.ts, 3, 33)) +>Reducer : Symbol(Reducer, Decl(genericFunctionInference2.ts, 0, 0)) +>S : Symbol(S, Decl(genericFunctionInference2.ts, 3, 33)) +>K : Symbol(K, Decl(genericFunctionInference2.ts, 3, 49)) +>Reducer : Symbol(Reducer, Decl(genericFunctionInference2.ts, 0, 0)) +>S : Symbol(S, Decl(genericFunctionInference2.ts, 3, 33)) + +type MyState = { combined: { foo: number } }; +>MyState : Symbol(MyState, Decl(genericFunctionInference2.ts, 3, 93)) +>combined : Symbol(combined, Decl(genericFunctionInference2.ts, 5, 16)) +>foo : Symbol(foo, Decl(genericFunctionInference2.ts, 5, 28)) + +declare const foo: Reducer; +>foo : Symbol(foo, Decl(genericFunctionInference2.ts, 6, 13)) +>Reducer : Symbol(Reducer, Decl(genericFunctionInference2.ts, 0, 0)) +>MyState : Symbol(MyState, Decl(genericFunctionInference2.ts, 3, 93)) + +const myReducer1: Reducer = combineReducers({ +>myReducer1 : Symbol(myReducer1, Decl(genericFunctionInference2.ts, 8, 5)) +>Reducer : Symbol(Reducer, Decl(genericFunctionInference2.ts, 0, 0)) +>MyState : Symbol(MyState, Decl(genericFunctionInference2.ts, 3, 93)) +>combineReducers : Symbol(combineReducers, Decl(genericFunctionInference2.ts, 2, 34)) + + combined: combineReducers({ foo }), +>combined : Symbol(combined, Decl(genericFunctionInference2.ts, 8, 54)) +>combineReducers : Symbol(combineReducers, Decl(genericFunctionInference2.ts, 2, 34)) +>foo : Symbol(foo, Decl(genericFunctionInference2.ts, 9, 31)) + +}); + +const myReducer2 = combineReducers({ +>myReducer2 : Symbol(myReducer2, Decl(genericFunctionInference2.ts, 12, 5)) +>combineReducers : Symbol(combineReducers, Decl(genericFunctionInference2.ts, 2, 34)) + + combined: combineReducers({ foo }), +>combined : Symbol(combined, Decl(genericFunctionInference2.ts, 12, 36)) +>combineReducers : Symbol(combineReducers, Decl(genericFunctionInference2.ts, 2, 34)) +>foo : Symbol(foo, Decl(genericFunctionInference2.ts, 13, 31)) + +}); + +// Repro from #30942 + +declare function withH(handlerCreators: HandleCreatorsFactory): U; +>withH : Symbol(withH, Decl(genericFunctionInference2.ts, 14, 3)) +>T : Symbol(T, Decl(genericFunctionInference2.ts, 18, 23)) +>U : Symbol(U, Decl(genericFunctionInference2.ts, 18, 25)) +>handlerCreators : Symbol(handlerCreators, Decl(genericFunctionInference2.ts, 18, 29)) +>HandleCreatorsFactory : Symbol(HandleCreatorsFactory, Decl(genericFunctionInference2.ts, 20, 28)) +>T : Symbol(T, Decl(genericFunctionInference2.ts, 18, 23)) +>U : Symbol(U, Decl(genericFunctionInference2.ts, 18, 25)) +>U : Symbol(U, Decl(genericFunctionInference2.ts, 18, 25)) + +type Props = { out: number } +>Props : Symbol(Props, Decl(genericFunctionInference2.ts, 18, 78)) +>out : Symbol(out, Decl(genericFunctionInference2.ts, 20, 14)) + +type HandleCreatorsFactory = (initialProps: T) => { [P in keyof U]: (props: T) => U[P] }; +>HandleCreatorsFactory : Symbol(HandleCreatorsFactory, Decl(genericFunctionInference2.ts, 20, 28)) +>T : Symbol(T, Decl(genericFunctionInference2.ts, 22, 27)) +>U : Symbol(U, Decl(genericFunctionInference2.ts, 22, 29)) +>initialProps : Symbol(initialProps, Decl(genericFunctionInference2.ts, 22, 36)) +>T : Symbol(T, Decl(genericFunctionInference2.ts, 22, 27)) +>P : Symbol(P, Decl(genericFunctionInference2.ts, 22, 59)) +>U : Symbol(U, Decl(genericFunctionInference2.ts, 22, 29)) +>props : Symbol(props, Decl(genericFunctionInference2.ts, 22, 75)) +>T : Symbol(T, Decl(genericFunctionInference2.ts, 22, 27)) +>U : Symbol(U, Decl(genericFunctionInference2.ts, 22, 29)) +>P : Symbol(P, Decl(genericFunctionInference2.ts, 22, 59)) + +const enhancer4 = withH((props: Props) => ({ +>enhancer4 : Symbol(enhancer4, Decl(genericFunctionInference2.ts, 24, 5)) +>withH : Symbol(withH, Decl(genericFunctionInference2.ts, 14, 3)) +>props : Symbol(props, Decl(genericFunctionInference2.ts, 24, 25)) +>Props : Symbol(Props, Decl(genericFunctionInference2.ts, 18, 78)) + + onChange: (props) => (e: any) => {}, +>onChange : Symbol(onChange, Decl(genericFunctionInference2.ts, 24, 44)) +>props : Symbol(props, Decl(genericFunctionInference2.ts, 25, 15)) +>e : Symbol(e, Decl(genericFunctionInference2.ts, 25, 26)) + + onSubmit: (props) => (e: any) => {}, +>onSubmit : Symbol(onSubmit, Decl(genericFunctionInference2.ts, 25, 40)) +>props : Symbol(props, Decl(genericFunctionInference2.ts, 26, 15)) +>e : Symbol(e, Decl(genericFunctionInference2.ts, 26, 26)) + +})); + +enhancer4.onChange(null); +>enhancer4.onChange : Symbol(onChange, Decl(genericFunctionInference2.ts, 24, 44)) +>enhancer4 : Symbol(enhancer4, Decl(genericFunctionInference2.ts, 24, 5)) +>onChange : Symbol(onChange, Decl(genericFunctionInference2.ts, 24, 44)) + diff --git a/tests/baselines/reference/genericFunctionInference2.types b/tests/baselines/reference/genericFunctionInference2.types new file mode 100644 index 0000000000000..75e116d169dd9 --- /dev/null +++ b/tests/baselines/reference/genericFunctionInference2.types @@ -0,0 +1,96 @@ +=== tests/cases/compiler/genericFunctionInference2.ts === +// Repro from #30685 + +type Reducer = (state: S) => S; +>Reducer : Reducer +>state : S + +declare function combineReducers(reducers: { [K in keyof S]: Reducer }): Reducer; +>combineReducers : (reducers: { [K in keyof S]: Reducer; }) => Reducer +>reducers : { [K in keyof S]: Reducer; } + +type MyState = { combined: { foo: number } }; +>MyState : MyState +>combined : { foo: number; } +>foo : number + +declare const foo: Reducer; +>foo : Reducer + +const myReducer1: Reducer = combineReducers({ +>myReducer1 : Reducer +>combineReducers({ combined: combineReducers({ foo }),}) : Reducer<{ combined: { foo: any; }; }> +>combineReducers : (reducers: { [K in keyof S]: Reducer; }) => Reducer +>{ combined: combineReducers({ foo }),} : { combined: Reducer<{ foo: number; }>; } + + combined: combineReducers({ foo }), +>combined : Reducer<{ foo: number; }> +>combineReducers({ foo }) : Reducer<{ foo: number; }> +>combineReducers : (reducers: { [K in keyof S]: Reducer; }) => Reducer +>{ foo } : { foo: Reducer; } +>foo : Reducer + +}); + +const myReducer2 = combineReducers({ +>myReducer2 : Reducer<{ combined: { foo: any; }; }> +>combineReducers({ combined: combineReducers({ foo }),}) : Reducer<{ combined: { foo: any; }; }> +>combineReducers : (reducers: { [K in keyof S]: Reducer; }) => Reducer +>{ combined: combineReducers({ foo }),} : { combined: Reducer<{ foo: number; }>; } + + combined: combineReducers({ foo }), +>combined : Reducer<{ foo: number; }> +>combineReducers({ foo }) : Reducer<{ foo: number; }> +>combineReducers : (reducers: { [K in keyof S]: Reducer; }) => Reducer +>{ foo } : { foo: Reducer; } +>foo : Reducer + +}); + +// Repro from #30942 + +declare function withH(handlerCreators: HandleCreatorsFactory): U; +>withH : (handlerCreators: HandleCreatorsFactory) => U +>handlerCreators : HandleCreatorsFactory + +type Props = { out: number } +>Props : Props +>out : number + +type HandleCreatorsFactory = (initialProps: T) => { [P in keyof U]: (props: T) => U[P] }; +>HandleCreatorsFactory : HandleCreatorsFactory +>initialProps : T +>props : T + +const enhancer4 = withH((props: Props) => ({ +>enhancer4 : { onChange: (e: any) => void; onSubmit: (e: any) => void; } +>withH((props: Props) => ({ onChange: (props) => (e: any) => {}, onSubmit: (props) => (e: any) => {},})) : { onChange: (e: any) => void; onSubmit: (e: any) => void; } +>withH : (handlerCreators: HandleCreatorsFactory) => U +>(props: Props) => ({ onChange: (props) => (e: any) => {}, onSubmit: (props) => (e: any) => {},}) : (props: Props) => { onChange: (props: Props) => (e: any) => void; onSubmit: (props: Props) => (e: any) => void; } +>props : Props +>({ onChange: (props) => (e: any) => {}, onSubmit: (props) => (e: any) => {},}) : { onChange: (props: Props) => (e: any) => void; onSubmit: (props: Props) => (e: any) => void; } +>{ onChange: (props) => (e: any) => {}, onSubmit: (props) => (e: any) => {},} : { onChange: (props: Props) => (e: any) => void; onSubmit: (props: Props) => (e: any) => void; } + + onChange: (props) => (e: any) => {}, +>onChange : (props: Props) => (e: any) => void +>(props) => (e: any) => {} : (props: Props) => (e: any) => void +>props : Props +>(e: any) => {} : (e: any) => void +>e : any + + onSubmit: (props) => (e: any) => {}, +>onSubmit : (props: Props) => (e: any) => void +>(props) => (e: any) => {} : (props: Props) => (e: any) => void +>props : Props +>(e: any) => {} : (e: any) => void +>e : any + +})); + +enhancer4.onChange(null); +>enhancer4.onChange(null) : void +>enhancer4.onChange : (e: any) => void +>enhancer4 : { onChange: (e: any) => void; onSubmit: (e: any) => void; } +>onChange : (e: any) => void +>null : null + diff --git a/tests/baselines/reference/globalThisBlockscopedProperties.types b/tests/baselines/reference/globalThisBlockscopedProperties.types index e772e9ed3dc94..865fa210a85c4 100644 --- a/tests/baselines/reference/globalThisBlockscopedProperties.types +++ b/tests/baselines/reference/globalThisBlockscopedProperties.types @@ -64,6 +64,6 @@ declare let test3: (typeof globalThis)['z'] // error >globalThis : typeof globalThis declare let themAll: keyof typeof globalThis ->themAll : "undefined" | "x" | "globalThis" | "eval" | "parseInt" | "parseFloat" | "isNaN" | "isFinite" | "decodeURI" | "decodeURIComponent" | "encodeURI" | "encodeURIComponent" | "escape" | "unescape" | "NaN" | "Infinity" | "Object" | "Function" | "String" | "Boolean" | "Number" | "Math" | "Date" | "RegExp" | "Error" | "EvalError" | "RangeError" | "ReferenceError" | "SyntaxError" | "TypeError" | "URIError" | "JSON" | "Array" | "ArrayBuffer" | "DataView" | "Int8Array" | "Uint8Array" | "Uint8ClampedArray" | "Int16Array" | "Uint16Array" | "Int32Array" | "Uint32Array" | "Float32Array" | "Float64Array" | "Intl" | "alert" | "blur" | "cancelAnimationFrame" | "captureEvents" | "close" | "confirm" | "departFocus" | "focus" | "getComputedStyle" | "getMatchedCSSRules" | "getSelection" | "matchMedia" | "moveBy" | "moveTo" | "msWriteProfilerMark" | "open" | "postMessage" | "print" | "prompt" | "releaseEvents" | "requestAnimationFrame" | "resizeBy" | "resizeTo" | "scroll" | "scrollBy" | "scrollTo" | "stop" | "webkitCancelAnimationFrame" | "webkitConvertPointFromNodeToPage" | "webkitConvertPointFromPageToNode" | "webkitRequestAnimationFrame" | "toString" | "dispatchEvent" | "atob" | "btoa" | "fetch" | "clearInterval" | "clearTimeout" | "createImageBitmap" | "queueMicrotask" | "setInterval" | "setTimeout" | "addEventListener" | "removeEventListener" | "RTCStatsReport" | "AbortController" | "AbortSignal" | "AbstractRange" | "AnalyserNode" | "Animation" | "AnimationEffect" | "AnimationEvent" | "AnimationPlaybackEvent" | "AnimationTimeline" | "ApplicationCache" | "Attr" | "AudioBuffer" | "AudioBufferSourceNode" | "AudioContext" | "AudioDestinationNode" | "AudioListener" | "AudioNode" | "AudioParam" | "AudioParamMap" | "AudioProcessingEvent" | "AudioScheduledSourceNode" | "AudioTrack" | "AudioTrackList" | "AudioWorklet" | "AudioWorkletNode" | "BarProp" | "BaseAudioContext" | "BeforeUnloadEvent" | "BhxBrowser" | "BiquadFilterNode" | "Blob" | "BroadcastChannel" | "ByteLengthQueuingStrategy" | "CDATASection" | "CSS" | "CSSConditionRule" | "CSSFontFaceRule" | "CSSGroupingRule" | "CSSImportRule" | "CSSKeyframeRule" | "CSSKeyframesRule" | "CSSMediaRule" | "CSSNamespaceRule" | "CSSPageRule" | "CSSRule" | "CSSRuleList" | "CSSStyleDeclaration" | "CSSStyleRule" | "CSSStyleSheet" | "CSSSupportsRule" | "Cache" | "CacheStorage" | "CanvasGradient" | "CanvasPattern" | "CanvasRenderingContext2D" | "CaretPosition" | "ChannelMergerNode" | "ChannelSplitterNode" | "CharacterData" | "ClientRect" | "ClientRectList" | "Clipboard" | "ClipboardEvent" | "CloseEvent" | "Comment" | "CompositionEvent" | "Console" | "ConstantSourceNode" | "ConvolverNode" | "CountQueuingStrategy" | "Crypto" | "CryptoKey" | "CryptoKeyPair" | "CustomElementRegistry" | "CustomEvent" | "DOMError" | "DOMException" | "DOMImplementation" | "DOMMatrix" | "SVGMatrix" | "WebKitCSSMatrix" | "DOMMatrixReadOnly" | "DOMParser" | "DOMPoint" | "SVGPoint" | "DOMPointReadOnly" | "DOMQuad" | "DOMRect" | "SVGRect" | "DOMRectList" | "DOMRectReadOnly" | "DOMSettableTokenList" | "DOMStringList" | "DOMStringMap" | "DOMTokenList" | "DataCue" | "DataTransfer" | "DataTransferItem" | "DataTransferItemList" | "DeferredPermissionRequest" | "DelayNode" | "DeviceAcceleration" | "DeviceLightEvent" | "DeviceMotionEvent" | "DeviceOrientationEvent" | "DeviceRotationRate" | "Document" | "DocumentFragment" | "DocumentTimeline" | "DocumentType" | "DragEvent" | "DynamicsCompressorNode" | "Element" | "ErrorEvent" | "Event" | "EventSource" | "EventTarget" | "ExtensionScriptApis" | "File" | "FileList" | "FileReader" | "FocusEvent" | "FocusNavigationEvent" | "FormData" | "GainNode" | "Gamepad" | "GamepadButton" | "GamepadEvent" | "GamepadHapticActuator" | "GamepadPose" | "HTMLAllCollection" | "HTMLAnchorElement" | "HTMLAppletElement" | "HTMLAreaElement" | "HTMLAudioElement" | "HTMLBRElement" | "HTMLBaseElement" | "HTMLBaseFontElement" | "HTMLBodyElement" | "HTMLButtonElement" | "HTMLCanvasElement" | "HTMLCollection" | "HTMLDListElement" | "HTMLDataElement" | "HTMLDataListElement" | "HTMLDetailsElement" | "HTMLDialogElement" | "HTMLDirectoryElement" | "HTMLDivElement" | "HTMLDocument" | "HTMLElement" | "HTMLEmbedElement" | "HTMLFieldSetElement" | "HTMLFontElement" | "HTMLFormControlsCollection" | "HTMLFormElement" | "HTMLFrameElement" | "HTMLFrameSetElement" | "HTMLHRElement" | "HTMLHeadElement" | "HTMLHeadingElement" | "HTMLHtmlElement" | "HTMLIFrameElement" | "HTMLImageElement" | "HTMLInputElement" | "HTMLLIElement" | "HTMLLabelElement" | "HTMLLegendElement" | "HTMLLinkElement" | "HTMLMapElement" | "HTMLMarqueeElement" | "HTMLMediaElement" | "HTMLMenuElement" | "HTMLMetaElement" | "HTMLMeterElement" | "HTMLModElement" | "HTMLOListElement" | "HTMLObjectElement" | "HTMLOptGroupElement" | "HTMLOptionElement" | "HTMLOptionsCollection" | "HTMLOutputElement" | "HTMLParagraphElement" | "HTMLParamElement" | "HTMLPictureElement" | "HTMLPreElement" | "HTMLProgressElement" | "HTMLQuoteElement" | "HTMLScriptElement" | "HTMLSelectElement" | "HTMLSlotElement" | "HTMLSourceElement" | "HTMLSpanElement" | "HTMLStyleElement" | "HTMLTableCaptionElement" | "HTMLTableCellElement" | "HTMLTableColElement" | "HTMLTableDataCellElement" | "HTMLTableElement" | "HTMLTableHeaderCellElement" | "HTMLTableRowElement" | "HTMLTableSectionElement" | "HTMLTemplateElement" | "HTMLTextAreaElement" | "HTMLTimeElement" | "HTMLTitleElement" | "HTMLTrackElement" | "HTMLUListElement" | "HTMLUnknownElement" | "HTMLVideoElement" | "HashChangeEvent" | "Headers" | "History" | "IDBCursor" | "IDBCursorWithValue" | "IDBDatabase" | "IDBFactory" | "IDBIndex" | "IDBKeyRange" | "IDBObjectStore" | "IDBOpenDBRequest" | "IDBRequest" | "IDBTransaction" | "IDBVersionChangeEvent" | "IIRFilterNode" | "ImageBitmap" | "ImageBitmapRenderingContext" | "ImageData" | "IntersectionObserver" | "IntersectionObserverEntry" | "KeyboardEvent" | "KeyframeEffect" | "ListeningStateChangedEvent" | "Location" | "MSAssertion" | "MSBlobBuilder" | "MSFIDOCredentialAssertion" | "MSFIDOSignature" | "MSFIDOSignatureAssertion" | "MSGesture" | "MSGestureEvent" | "MSGraphicsTrust" | "MSInputMethodContext" | "MSMediaKeyError" | "MSMediaKeyMessageEvent" | "MSMediaKeyNeededEvent" | "MSMediaKeySession" | "MSMediaKeys" | "MSPointerEvent" | "MSStream" | "MediaDeviceInfo" | "MediaDevices" | "MediaElementAudioSourceNode" | "MediaEncryptedEvent" | "MediaError" | "MediaKeyMessageEvent" | "MediaKeySession" | "MediaKeyStatusMap" | "MediaKeySystemAccess" | "MediaKeys" | "MediaList" | "MediaQueryList" | "MediaQueryListEvent" | "MediaSource" | "MediaStream" | "MediaStreamAudioDestinationNode" | "MediaStreamAudioSourceNode" | "MediaStreamError" | "MediaStreamErrorEvent" | "MediaStreamEvent" | "MediaStreamTrack" | "MediaStreamTrackAudioSourceNode" | "MediaStreamTrackEvent" | "MessageChannel" | "MessageEvent" | "MessagePort" | "MimeType" | "MimeTypeArray" | "MouseEvent" | "MutationEvent" | "MutationObserver" | "MutationRecord" | "NamedNodeMap" | "NavigationPreloadManager" | "Navigator" | "Node" | "NodeFilter" | "NodeIterator" | "NodeList" | "Notification" | "OfflineAudioCompletionEvent" | "OfflineAudioContext" | "OscillatorNode" | "OverflowEvent" | "PageTransitionEvent" | "PannerNode" | "Path2D" | "PaymentAddress" | "PaymentRequest" | "PaymentRequestUpdateEvent" | "PaymentResponse" | "PerfWidgetExternal" | "Performance" | "PerformanceEntry" | "PerformanceMark" | "PerformanceMeasure" | "PerformanceNavigation" | "PerformanceNavigationTiming" | "PerformanceObserver" | "PerformanceObserverEntryList" | "PerformanceResourceTiming" | "PerformanceTiming" | "PeriodicWave" | "PermissionRequest" | "PermissionRequestedEvent" | "PermissionStatus" | "Permissions" | "Plugin" | "PluginArray" | "PointerEvent" | "PopStateEvent" | "ProcessingInstruction" | "ProgressEvent" | "PromiseRejectionEvent" | "PushManager" | "PushSubscription" | "PushSubscriptionOptions" | "RTCCertificate" | "RTCDTMFSender" | "RTCDTMFToneChangeEvent" | "RTCDataChannel" | "RTCDataChannelEvent" | "RTCDtlsTransport" | "RTCDtlsTransportStateChangedEvent" | "RTCDtmfSender" | "RTCError" | "RTCErrorEvent" | "RTCIceCandidate" | "RTCIceCandidatePairChangedEvent" | "RTCIceGatherer" | "RTCIceGathererEvent" | "RTCIceTransport" | "RTCIceTransportStateChangedEvent" | "RTCIdentityAssertion" | "RTCPeerConnection" | "RTCPeerConnectionIceErrorEvent" | "RTCPeerConnectionIceEvent" | "RTCRtpReceiver" | "RTCRtpSender" | "RTCRtpTransceiver" | "RTCSctpTransport" | "RTCSessionDescription" | "RTCSrtpSdesTransport" | "RTCSsrcConflictEvent" | "RTCStatsEvent" | "RTCStatsProvider" | "RTCTrackEvent" | "RadioNodeList" | "RandomSource" | "Range" | "ReadableStream" | "ReadableStreamReader" | "Request" | "Response" | "SVGAElement" | "SVGAngle" | "SVGAnimateElement" | "SVGAnimateMotionElement" | "SVGAnimateTransformElement" | "SVGAnimatedAngle" | "SVGAnimatedBoolean" | "SVGAnimatedEnumeration" | "SVGAnimatedInteger" | "SVGAnimatedLength" | "SVGAnimatedLengthList" | "SVGAnimatedNumber" | "SVGAnimatedNumberList" | "SVGAnimatedPreserveAspectRatio" | "SVGAnimatedRect" | "SVGAnimatedString" | "SVGAnimatedTransformList" | "SVGAnimationElement" | "SVGCircleElement" | "SVGClipPathElement" | "SVGComponentTransferFunctionElement" | "SVGCursorElement" | "SVGDefsElement" | "SVGDescElement" | "SVGElement" | "SVGElementInstance" | "SVGElementInstanceList" | "SVGEllipseElement" | "SVGFEBlendElement" | "SVGFEColorMatrixElement" | "SVGFEComponentTransferElement" | "SVGFECompositeElement" | "SVGFEConvolveMatrixElement" | "SVGFEDiffuseLightingElement" | "SVGFEDisplacementMapElement" | "SVGFEDistantLightElement" | "SVGFEDropShadowElement" | "SVGFEFloodElement" | "SVGFEFuncAElement" | "SVGFEFuncBElement" | "SVGFEFuncGElement" | "SVGFEFuncRElement" | "SVGFEGaussianBlurElement" | "SVGFEImageElement" | "SVGFEMergeElement" | "SVGFEMergeNodeElement" | "SVGFEMorphologyElement" | "SVGFEOffsetElement" | "SVGFEPointLightElement" | "SVGFESpecularLightingElement" | "SVGFESpotLightElement" | "SVGFETileElement" | "SVGFETurbulenceElement" | "SVGFilterElement" | "SVGForeignObjectElement" | "SVGGElement" | "SVGGeometryElement" | "SVGGradientElement" | "SVGGraphicsElement" | "SVGImageElement" | "SVGLength" | "SVGLengthList" | "SVGLineElement" | "SVGLinearGradientElement" | "SVGMarkerElement" | "SVGMaskElement" | "SVGMetadataElement" | "SVGNumber" | "SVGNumberList" | "SVGPathElement" | "SVGPathSeg" | "SVGPathSegArcAbs" | "SVGPathSegArcRel" | "SVGPathSegClosePath" | "SVGPathSegCurvetoCubicAbs" | "SVGPathSegCurvetoCubicRel" | "SVGPathSegCurvetoCubicSmoothAbs" | "SVGPathSegCurvetoCubicSmoothRel" | "SVGPathSegCurvetoQuadraticAbs" | "SVGPathSegCurvetoQuadraticRel" | "SVGPathSegCurvetoQuadraticSmoothAbs" | "SVGPathSegCurvetoQuadraticSmoothRel" | "SVGPathSegLinetoAbs" | "SVGPathSegLinetoHorizontalAbs" | "SVGPathSegLinetoHorizontalRel" | "SVGPathSegLinetoRel" | "SVGPathSegLinetoVerticalAbs" | "SVGPathSegLinetoVerticalRel" | "SVGPathSegList" | "SVGPathSegMovetoAbs" | "SVGPathSegMovetoRel" | "SVGPatternElement" | "SVGPointList" | "SVGPolygonElement" | "SVGPolylineElement" | "SVGPreserveAspectRatio" | "SVGRadialGradientElement" | "SVGRectElement" | "SVGSVGElement" | "SVGScriptElement" | "SVGStopElement" | "SVGStringList" | "SVGStyleElement" | "SVGSwitchElement" | "SVGSymbolElement" | "SVGTSpanElement" | "SVGTextContentElement" | "SVGTextElement" | "SVGTextPathElement" | "SVGTextPositioningElement" | "SVGTitleElement" | "SVGTransform" | "SVGTransformList" | "SVGUnitTypes" | "SVGUseElement" | "SVGViewElement" | "SVGZoomAndPan" | "SVGZoomEvent" | "ScopedCredential" | "ScopedCredentialInfo" | "Screen" | "ScreenOrientation" | "ScriptProcessorNode" | "SecurityPolicyViolationEvent" | "Selection" | "ServiceUIFrameContext" | "ServiceWorker" | "ServiceWorkerContainer" | "ServiceWorkerMessageEvent" | "ServiceWorkerRegistration" | "ShadowRoot" | "SourceBuffer" | "SourceBufferList" | "SpeechGrammar" | "SpeechGrammarList" | "SpeechRecognition" | "SpeechRecognitionAlternative" | "SpeechRecognitionError" | "SpeechRecognitionEvent" | "SpeechRecognitionResult" | "SpeechRecognitionResultList" | "SpeechSynthesis" | "SpeechSynthesisErrorEvent" | "SpeechSynthesisEvent" | "SpeechSynthesisUtterance" | "SpeechSynthesisVoice" | "StaticRange" | "StereoPannerNode" | "Storage" | "StorageEvent" | "StorageManager" | "StyleMedia" | "StyleSheet" | "StyleSheetList" | "SubtleCrypto" | "SyncManager" | "Text" | "TextDecoder" | "TextDecoderStream" | "TextEncoder" | "TextEncoderStream" | "TextEvent" | "TextMetrics" | "TextTrack" | "TextTrackCue" | "TextTrackCueList" | "TextTrackList" | "TimeRanges" | "Touch" | "TouchEvent" | "TouchList" | "TrackEvent" | "TransformStream" | "TransitionEvent" | "TreeWalker" | "UIEvent" | "URL" | "webkitURL" | "URLSearchParams" | "VRDisplay" | "VRDisplayCapabilities" | "VRDisplayEvent" | "VREyeParameters" | "VRFieldOfView" | "VRFrameData" | "VRPose" | "VTTCue" | "VTTRegion" | "ValidityState" | "VideoPlaybackQuality" | "VideoTrack" | "VideoTrackList" | "WaveShaperNode" | "WebAuthentication" | "WebAuthnAssertion" | "WebGLActiveInfo" | "WebGLBuffer" | "WebGLContextEvent" | "WebGLFramebuffer" | "WebGLObject" | "WebGLProgram" | "WebGLRenderbuffer" | "WebGLRenderingContext" | "WebGLShader" | "WebGLShaderPrecisionFormat" | "WebGLTexture" | "WebGLUniformLocation" | "WebKitPoint" | "WebSocket" | "WheelEvent" | "Window" | "Worker" | "Worklet" | "WritableStream" | "XMLDocument" | "XMLHttpRequest" | "XMLHttpRequestEventTarget" | "XMLHttpRequestUpload" | "XMLSerializer" | "XPathEvaluator" | "XPathExpression" | "XPathResult" | "XSLTProcessor" | "webkitRTCPeerConnection" | "WebAssembly" | "Audio" | "Image" | "Option" | "applicationCache" | "caches" | "clientInformation" | "closed" | "crypto" | "customElements" | "defaultStatus" | "devicePixelRatio" | "doNotTrack" | "document" | "event" | "external" | "frameElement" | "frames" | "history" | "innerHeight" | "innerWidth" | "isSecureContext" | "length" | "location" | "locationbar" | "menubar" | "msContentScript" | "navigator" | "offscreenBuffering" | "oncompassneedscalibration" | "ondevicelight" | "ondevicemotion" | "ondeviceorientation" | "onmousewheel" | "onmsgesturechange" | "onmsgesturedoubletap" | "onmsgestureend" | "onmsgesturehold" | "onmsgesturestart" | "onmsgesturetap" | "onmsinertiastart" | "onmspointercancel" | "onmspointerdown" | "onmspointerenter" | "onmspointerleave" | "onmspointermove" | "onmspointerout" | "onmspointerover" | "onmspointerup" | "onorientationchange" | "onreadystatechange" | "onvrdisplayactivate" | "onvrdisplayblur" | "onvrdisplayconnect" | "onvrdisplaydeactivate" | "onvrdisplaydisconnect" | "onvrdisplayfocus" | "onvrdisplaypointerrestricted" | "onvrdisplaypointerunrestricted" | "onvrdisplaypresentchange" | "opener" | "orientation" | "outerHeight" | "outerWidth" | "pageXOffset" | "pageYOffset" | "parent" | "performance" | "personalbar" | "screen" | "screenLeft" | "screenTop" | "screenX" | "screenY" | "scrollX" | "scrollY" | "scrollbars" | "self" | "speechSynthesis" | "status" | "statusbar" | "styleMedia" | "toolbar" | "top" | "window" | "sessionStorage" | "localStorage" | "console" | "onabort" | "onanimationcancel" | "onanimationend" | "onanimationiteration" | "onanimationstart" | "onauxclick" | "onblur" | "oncancel" | "oncanplay" | "oncanplaythrough" | "onchange" | "onclick" | "onclose" | "oncontextmenu" | "oncuechange" | "ondblclick" | "ondrag" | "ondragend" | "ondragenter" | "ondragexit" | "ondragleave" | "ondragover" | "ondragstart" | "ondrop" | "ondurationchange" | "onemptied" | "onended" | "onerror" | "onfocus" | "ongotpointercapture" | "oninput" | "oninvalid" | "onkeydown" | "onkeypress" | "onkeyup" | "onload" | "onloadeddata" | "onloadedmetadata" | "onloadend" | "onloadstart" | "onlostpointercapture" | "onmousedown" | "onmouseenter" | "onmouseleave" | "onmousemove" | "onmouseout" | "onmouseover" | "onmouseup" | "onpause" | "onplay" | "onplaying" | "onpointercancel" | "onpointerdown" | "onpointerenter" | "onpointerleave" | "onpointermove" | "onpointerout" | "onpointerover" | "onpointerup" | "onprogress" | "onratechange" | "onreset" | "onresize" | "onscroll" | "onsecuritypolicyviolation" | "onseeked" | "onseeking" | "onselect" | "onselectionchange" | "onselectstart" | "onstalled" | "onsubmit" | "onsuspend" | "ontimeupdate" | "ontoggle" | "ontouchcancel" | "ontouchend" | "ontouchmove" | "ontouchstart" | "ontransitioncancel" | "ontransitionend" | "ontransitionrun" | "ontransitionstart" | "onvolumechange" | "onwaiting" | "onwheel" | "indexedDB" | "origin" | "onafterprint" | "onbeforeprint" | "onbeforeunload" | "onhashchange" | "onlanguagechange" | "onmessage" | "onmessageerror" | "onoffline" | "ononline" | "onpagehide" | "onpageshow" | "onpopstate" | "onrejectionhandled" | "onstorage" | "onunhandledrejection" | "onunload" | "importScripts" | "ActiveXObject" | "WScript" | "WSH" | "Enumerator" | "VBArray" +>themAll : "undefined" | "x" | "globalThis" | "eval" | "parseInt" | "parseFloat" | "isNaN" | "isFinite" | "decodeURI" | "decodeURIComponent" | "encodeURI" | "encodeURIComponent" | "escape" | "unescape" | "NaN" | "Infinity" | "Object" | "Function" | "String" | "Boolean" | "Number" | "Math" | "Date" | "RegExp" | "Error" | "EvalError" | "RangeError" | "ReferenceError" | "SyntaxError" | "TypeError" | "URIError" | "JSON" | "Array" | "ArrayBuffer" | "DataView" | "Int8Array" | "Uint8Array" | "Uint8ClampedArray" | "Int16Array" | "Uint16Array" | "Int32Array" | "Uint32Array" | "Float32Array" | "Float64Array" | "Intl" | "alert" | "blur" | "cancelAnimationFrame" | "captureEvents" | "close" | "confirm" | "departFocus" | "focus" | "getComputedStyle" | "getMatchedCSSRules" | "getSelection" | "matchMedia" | "moveBy" | "moveTo" | "msWriteProfilerMark" | "open" | "postMessage" | "print" | "prompt" | "releaseEvents" | "requestAnimationFrame" | "resizeBy" | "resizeTo" | "scroll" | "scrollBy" | "scrollTo" | "stop" | "webkitCancelAnimationFrame" | "webkitConvertPointFromNodeToPage" | "webkitConvertPointFromPageToNode" | "webkitRequestAnimationFrame" | "toString" | "dispatchEvent" | "atob" | "btoa" | "fetch" | "clearInterval" | "clearTimeout" | "createImageBitmap" | "queueMicrotask" | "setInterval" | "setTimeout" | "addEventListener" | "removeEventListener" | "RTCStatsReport" | "AbortController" | "AbortSignal" | "AbstractRange" | "AnalyserNode" | "Animation" | "AnimationEffect" | "AnimationEvent" | "AnimationPlaybackEvent" | "AnimationTimeline" | "ApplicationCache" | "Attr" | "AudioBuffer" | "AudioBufferSourceNode" | "AudioContext" | "AudioDestinationNode" | "AudioListener" | "AudioNode" | "AudioParam" | "AudioParamMap" | "AudioProcessingEvent" | "AudioScheduledSourceNode" | "AudioTrack" | "AudioTrackList" | "AudioWorklet" | "AudioWorkletNode" | "BarProp" | "BaseAudioContext" | "BeforeUnloadEvent" | "BhxBrowser" | "BiquadFilterNode" | "Blob" | "BroadcastChannel" | "ByteLengthQueuingStrategy" | "CDATASection" | "CSS" | "CSSConditionRule" | "CSSFontFaceRule" | "CSSGroupingRule" | "CSSImportRule" | "CSSKeyframeRule" | "CSSKeyframesRule" | "CSSMediaRule" | "CSSNamespaceRule" | "CSSPageRule" | "CSSRule" | "CSSRuleList" | "CSSStyleDeclaration" | "CSSStyleRule" | "CSSStyleSheet" | "CSSSupportsRule" | "Cache" | "CacheStorage" | "CanvasGradient" | "CanvasPattern" | "CanvasRenderingContext2D" | "CaretPosition" | "ChannelMergerNode" | "ChannelSplitterNode" | "CharacterData" | "ClientRect" | "ClientRectList" | "Clipboard" | "ClipboardEvent" | "CloseEvent" | "Comment" | "CompositionEvent" | "Console" | "ConstantSourceNode" | "ConvolverNode" | "CountQueuingStrategy" | "Crypto" | "CryptoKey" | "CryptoKeyPair" | "CustomElementRegistry" | "CustomEvent" | "DOMError" | "DOMException" | "DOMImplementation" | "DOMMatrix" | "SVGMatrix" | "WebKitCSSMatrix" | "DOMMatrixReadOnly" | "DOMParser" | "DOMPoint" | "SVGPoint" | "DOMPointReadOnly" | "DOMQuad" | "DOMRect" | "SVGRect" | "DOMRectList" | "DOMRectReadOnly" | "DOMSettableTokenList" | "DOMStringList" | "DOMStringMap" | "DOMTokenList" | "DataCue" | "DataTransfer" | "DataTransferItem" | "DataTransferItemList" | "DeferredPermissionRequest" | "DelayNode" | "DeviceAcceleration" | "DeviceLightEvent" | "DeviceMotionEvent" | "DeviceOrientationEvent" | "DeviceRotationRate" | "Document" | "DocumentFragment" | "DocumentTimeline" | "DocumentType" | "DragEvent" | "DynamicsCompressorNode" | "Element" | "ErrorEvent" | "Event" | "EventSource" | "EventTarget" | "ExtensionScriptApis" | "File" | "FileList" | "FileReader" | "FocusEvent" | "FocusNavigationEvent" | "FormData" | "GainNode" | "Gamepad" | "GamepadButton" | "GamepadEvent" | "GamepadHapticActuator" | "GamepadPose" | "HTMLAllCollection" | "HTMLAnchorElement" | "HTMLAppletElement" | "HTMLAreaElement" | "HTMLAudioElement" | "HTMLBRElement" | "HTMLBaseElement" | "HTMLBaseFontElement" | "HTMLBodyElement" | "HTMLButtonElement" | "HTMLCanvasElement" | "HTMLCollection" | "HTMLDListElement" | "HTMLDataElement" | "HTMLDataListElement" | "HTMLDetailsElement" | "HTMLDialogElement" | "HTMLDirectoryElement" | "HTMLDivElement" | "HTMLDocument" | "HTMLElement" | "HTMLEmbedElement" | "HTMLFieldSetElement" | "HTMLFontElement" | "HTMLFormControlsCollection" | "HTMLFormElement" | "HTMLFrameElement" | "HTMLFrameSetElement" | "HTMLHRElement" | "HTMLHeadElement" | "HTMLHeadingElement" | "HTMLHtmlElement" | "HTMLIFrameElement" | "HTMLImageElement" | "HTMLInputElement" | "HTMLLIElement" | "HTMLLabelElement" | "HTMLLegendElement" | "HTMLLinkElement" | "HTMLMapElement" | "HTMLMarqueeElement" | "HTMLMediaElement" | "HTMLMenuElement" | "HTMLMetaElement" | "HTMLMeterElement" | "HTMLModElement" | "HTMLOListElement" | "HTMLObjectElement" | "HTMLOptGroupElement" | "HTMLOptionElement" | "HTMLOptionsCollection" | "HTMLOutputElement" | "HTMLParagraphElement" | "HTMLParamElement" | "HTMLPictureElement" | "HTMLPreElement" | "HTMLProgressElement" | "HTMLQuoteElement" | "HTMLScriptElement" | "HTMLSelectElement" | "HTMLSlotElement" | "HTMLSourceElement" | "HTMLSpanElement" | "HTMLStyleElement" | "HTMLTableCaptionElement" | "HTMLTableCellElement" | "HTMLTableColElement" | "HTMLTableDataCellElement" | "HTMLTableElement" | "HTMLTableHeaderCellElement" | "HTMLTableRowElement" | "HTMLTableSectionElement" | "HTMLTemplateElement" | "HTMLTextAreaElement" | "HTMLTimeElement" | "HTMLTitleElement" | "HTMLTrackElement" | "HTMLUListElement" | "HTMLUnknownElement" | "HTMLVideoElement" | "HashChangeEvent" | "Headers" | "History" | "IDBCursor" | "IDBCursorWithValue" | "IDBDatabase" | "IDBFactory" | "IDBIndex" | "IDBKeyRange" | "IDBObjectStore" | "IDBOpenDBRequest" | "IDBRequest" | "IDBTransaction" | "IDBVersionChangeEvent" | "IIRFilterNode" | "ImageBitmap" | "ImageBitmapRenderingContext" | "ImageData" | "InputDeviceInfo" | "IntersectionObserver" | "IntersectionObserverEntry" | "KeyboardEvent" | "KeyframeEffect" | "ListeningStateChangedEvent" | "Location" | "MSAssertion" | "MSBlobBuilder" | "MSFIDOCredentialAssertion" | "MSFIDOSignature" | "MSFIDOSignatureAssertion" | "MSGesture" | "MSGestureEvent" | "MSGraphicsTrust" | "MSInputMethodContext" | "MSMediaKeyError" | "MSMediaKeyMessageEvent" | "MSMediaKeyNeededEvent" | "MSMediaKeySession" | "MSMediaKeys" | "MSPointerEvent" | "MSStream" | "MediaDeviceInfo" | "MediaDevices" | "MediaElementAudioSourceNode" | "MediaEncryptedEvent" | "MediaError" | "MediaKeyMessageEvent" | "MediaKeySession" | "MediaKeyStatusMap" | "MediaKeySystemAccess" | "MediaKeys" | "MediaList" | "MediaQueryList" | "MediaQueryListEvent" | "MediaSource" | "MediaStream" | "MediaStreamAudioDestinationNode" | "MediaStreamAudioSourceNode" | "MediaStreamError" | "MediaStreamErrorEvent" | "MediaStreamEvent" | "MediaStreamTrack" | "MediaStreamTrackAudioSourceNode" | "MediaStreamTrackEvent" | "MessageChannel" | "MessageEvent" | "MessagePort" | "MimeType" | "MimeTypeArray" | "MouseEvent" | "MutationEvent" | "MutationObserver" | "MutationRecord" | "NamedNodeMap" | "NavigationPreloadManager" | "Navigator" | "Node" | "NodeFilter" | "NodeIterator" | "NodeList" | "Notification" | "OfflineAudioCompletionEvent" | "OfflineAudioContext" | "OffscreenCanvas" | "OffscreenCanvasRenderingContext2D" | "OscillatorNode" | "OverconstrainedError" | "OverflowEvent" | "PageTransitionEvent" | "PannerNode" | "Path2D" | "PaymentAddress" | "PaymentRequest" | "PaymentRequestUpdateEvent" | "PaymentResponse" | "PerfWidgetExternal" | "Performance" | "PerformanceEntry" | "PerformanceMark" | "PerformanceMeasure" | "PerformanceNavigation" | "PerformanceNavigationTiming" | "PerformanceObserver" | "PerformanceObserverEntryList" | "PerformanceResourceTiming" | "PerformanceTiming" | "PeriodicWave" | "PermissionRequest" | "PermissionRequestedEvent" | "PermissionStatus" | "Permissions" | "Plugin" | "PluginArray" | "PointerEvent" | "PopStateEvent" | "ProcessingInstruction" | "ProgressEvent" | "PromiseRejectionEvent" | "PushManager" | "PushSubscription" | "PushSubscriptionOptions" | "RTCCertificate" | "RTCDTMFSender" | "RTCDTMFToneChangeEvent" | "RTCDataChannel" | "RTCDataChannelEvent" | "RTCDtlsTransport" | "RTCDtlsTransportStateChangedEvent" | "RTCDtmfSender" | "RTCError" | "RTCErrorEvent" | "RTCIceCandidate" | "RTCIceCandidatePairChangedEvent" | "RTCIceGatherer" | "RTCIceGathererEvent" | "RTCIceTransport" | "RTCIceTransportStateChangedEvent" | "RTCIdentityAssertion" | "RTCPeerConnection" | "RTCPeerConnectionIceErrorEvent" | "RTCPeerConnectionIceEvent" | "RTCRtpReceiver" | "RTCRtpSender" | "RTCRtpTransceiver" | "RTCSctpTransport" | "RTCSessionDescription" | "RTCSrtpSdesTransport" | "RTCSsrcConflictEvent" | "RTCStatsEvent" | "RTCStatsProvider" | "RTCTrackEvent" | "RadioNodeList" | "RandomSource" | "Range" | "ReadableStream" | "ReadableStreamReader" | "Request" | "Response" | "SVGAElement" | "SVGAngle" | "SVGAnimateElement" | "SVGAnimateMotionElement" | "SVGAnimateTransformElement" | "SVGAnimatedAngle" | "SVGAnimatedBoolean" | "SVGAnimatedEnumeration" | "SVGAnimatedInteger" | "SVGAnimatedLength" | "SVGAnimatedLengthList" | "SVGAnimatedNumber" | "SVGAnimatedNumberList" | "SVGAnimatedPreserveAspectRatio" | "SVGAnimatedRect" | "SVGAnimatedString" | "SVGAnimatedTransformList" | "SVGAnimationElement" | "SVGCircleElement" | "SVGClipPathElement" | "SVGComponentTransferFunctionElement" | "SVGCursorElement" | "SVGDefsElement" | "SVGDescElement" | "SVGElement" | "SVGElementInstance" | "SVGElementInstanceList" | "SVGEllipseElement" | "SVGFEBlendElement" | "SVGFEColorMatrixElement" | "SVGFEComponentTransferElement" | "SVGFECompositeElement" | "SVGFEConvolveMatrixElement" | "SVGFEDiffuseLightingElement" | "SVGFEDisplacementMapElement" | "SVGFEDistantLightElement" | "SVGFEDropShadowElement" | "SVGFEFloodElement" | "SVGFEFuncAElement" | "SVGFEFuncBElement" | "SVGFEFuncGElement" | "SVGFEFuncRElement" | "SVGFEGaussianBlurElement" | "SVGFEImageElement" | "SVGFEMergeElement" | "SVGFEMergeNodeElement" | "SVGFEMorphologyElement" | "SVGFEOffsetElement" | "SVGFEPointLightElement" | "SVGFESpecularLightingElement" | "SVGFESpotLightElement" | "SVGFETileElement" | "SVGFETurbulenceElement" | "SVGFilterElement" | "SVGForeignObjectElement" | "SVGGElement" | "SVGGeometryElement" | "SVGGradientElement" | "SVGGraphicsElement" | "SVGImageElement" | "SVGLength" | "SVGLengthList" | "SVGLineElement" | "SVGLinearGradientElement" | "SVGMarkerElement" | "SVGMaskElement" | "SVGMetadataElement" | "SVGNumber" | "SVGNumberList" | "SVGPathElement" | "SVGPathSeg" | "SVGPathSegArcAbs" | "SVGPathSegArcRel" | "SVGPathSegClosePath" | "SVGPathSegCurvetoCubicAbs" | "SVGPathSegCurvetoCubicRel" | "SVGPathSegCurvetoCubicSmoothAbs" | "SVGPathSegCurvetoCubicSmoothRel" | "SVGPathSegCurvetoQuadraticAbs" | "SVGPathSegCurvetoQuadraticRel" | "SVGPathSegCurvetoQuadraticSmoothAbs" | "SVGPathSegCurvetoQuadraticSmoothRel" | "SVGPathSegLinetoAbs" | "SVGPathSegLinetoHorizontalAbs" | "SVGPathSegLinetoHorizontalRel" | "SVGPathSegLinetoRel" | "SVGPathSegLinetoVerticalAbs" | "SVGPathSegLinetoVerticalRel" | "SVGPathSegList" | "SVGPathSegMovetoAbs" | "SVGPathSegMovetoRel" | "SVGPatternElement" | "SVGPointList" | "SVGPolygonElement" | "SVGPolylineElement" | "SVGPreserveAspectRatio" | "SVGRadialGradientElement" | "SVGRectElement" | "SVGSVGElement" | "SVGScriptElement" | "SVGStopElement" | "SVGStringList" | "SVGStyleElement" | "SVGSwitchElement" | "SVGSymbolElement" | "SVGTSpanElement" | "SVGTextContentElement" | "SVGTextElement" | "SVGTextPathElement" | "SVGTextPositioningElement" | "SVGTitleElement" | "SVGTransform" | "SVGTransformList" | "SVGUnitTypes" | "SVGUseElement" | "SVGViewElement" | "SVGZoomAndPan" | "SVGZoomEvent" | "ScopedCredential" | "ScopedCredentialInfo" | "Screen" | "ScreenOrientation" | "ScriptProcessorNode" | "SecurityPolicyViolationEvent" | "Selection" | "ServiceUIFrameContext" | "ServiceWorker" | "ServiceWorkerContainer" | "ServiceWorkerMessageEvent" | "ServiceWorkerRegistration" | "ShadowRoot" | "SourceBuffer" | "SourceBufferList" | "SpeechGrammar" | "SpeechGrammarList" | "SpeechRecognition" | "SpeechRecognitionAlternative" | "SpeechRecognitionError" | "SpeechRecognitionEvent" | "SpeechRecognitionResult" | "SpeechRecognitionResultList" | "SpeechSynthesis" | "SpeechSynthesisErrorEvent" | "SpeechSynthesisEvent" | "SpeechSynthesisUtterance" | "SpeechSynthesisVoice" | "StaticRange" | "StereoPannerNode" | "Storage" | "StorageEvent" | "StorageManager" | "StyleMedia" | "StyleSheet" | "StyleSheetList" | "SubtleCrypto" | "SyncManager" | "Text" | "TextDecoder" | "TextDecoderStream" | "TextEncoder" | "TextEncoderStream" | "TextEvent" | "TextMetrics" | "TextTrack" | "TextTrackCue" | "TextTrackCueList" | "TextTrackList" | "TimeRanges" | "Touch" | "TouchEvent" | "TouchList" | "TrackEvent" | "TransformStream" | "TransitionEvent" | "TreeWalker" | "UIEvent" | "URL" | "webkitURL" | "URLSearchParams" | "VRDisplay" | "VRDisplayCapabilities" | "VRDisplayEvent" | "VREyeParameters" | "VRFieldOfView" | "VRFrameData" | "VRPose" | "VTTCue" | "VTTRegion" | "ValidityState" | "VideoPlaybackQuality" | "VideoTrack" | "VideoTrackList" | "WaveShaperNode" | "WebAuthentication" | "WebAuthnAssertion" | "WebGLActiveInfo" | "WebGLBuffer" | "WebGLContextEvent" | "WebGLFramebuffer" | "WebGLObject" | "WebGLProgram" | "WebGLRenderbuffer" | "WebGLRenderingContext" | "WebGLShader" | "WebGLShaderPrecisionFormat" | "WebGLTexture" | "WebGLUniformLocation" | "WebKitPoint" | "WebSocket" | "WheelEvent" | "Window" | "Worker" | "Worklet" | "WritableStream" | "XMLDocument" | "XMLHttpRequest" | "XMLHttpRequestEventTarget" | "XMLHttpRequestUpload" | "XMLSerializer" | "XPathEvaluator" | "XPathExpression" | "XPathResult" | "XSLTProcessor" | "webkitRTCPeerConnection" | "WebAssembly" | "Audio" | "Image" | "Option" | "applicationCache" | "caches" | "clientInformation" | "closed" | "crypto" | "customElements" | "defaultStatus" | "devicePixelRatio" | "doNotTrack" | "document" | "event" | "external" | "frameElement" | "frames" | "history" | "innerHeight" | "innerWidth" | "isSecureContext" | "length" | "location" | "locationbar" | "menubar" | "msContentScript" | "navigator" | "offscreenBuffering" | "oncompassneedscalibration" | "ondevicelight" | "ondevicemotion" | "ondeviceorientation" | "ondeviceorientationabsolute" | "onmousewheel" | "onmsgesturechange" | "onmsgesturedoubletap" | "onmsgestureend" | "onmsgesturehold" | "onmsgesturestart" | "onmsgesturetap" | "onmsinertiastart" | "onmspointercancel" | "onmspointerdown" | "onmspointerenter" | "onmspointerleave" | "onmspointermove" | "onmspointerout" | "onmspointerover" | "onmspointerup" | "onorientationchange" | "onreadystatechange" | "onvrdisplayactivate" | "onvrdisplayblur" | "onvrdisplayconnect" | "onvrdisplaydeactivate" | "onvrdisplaydisconnect" | "onvrdisplayfocus" | "onvrdisplaypointerrestricted" | "onvrdisplaypointerunrestricted" | "onvrdisplaypresentchange" | "opener" | "orientation" | "outerHeight" | "outerWidth" | "pageXOffset" | "pageYOffset" | "parent" | "performance" | "personalbar" | "screen" | "screenLeft" | "screenTop" | "screenX" | "screenY" | "scrollX" | "scrollY" | "scrollbars" | "self" | "speechSynthesis" | "status" | "statusbar" | "styleMedia" | "toolbar" | "top" | "window" | "sessionStorage" | "localStorage" | "console" | "onabort" | "onanimationcancel" | "onanimationend" | "onanimationiteration" | "onanimationstart" | "onauxclick" | "onblur" | "oncancel" | "oncanplay" | "oncanplaythrough" | "onchange" | "onclick" | "onclose" | "oncontextmenu" | "oncuechange" | "ondblclick" | "ondrag" | "ondragend" | "ondragenter" | "ondragexit" | "ondragleave" | "ondragover" | "ondragstart" | "ondrop" | "ondurationchange" | "onemptied" | "onended" | "onerror" | "onfocus" | "ongotpointercapture" | "oninput" | "oninvalid" | "onkeydown" | "onkeypress" | "onkeyup" | "onload" | "onloadeddata" | "onloadedmetadata" | "onloadend" | "onloadstart" | "onlostpointercapture" | "onmousedown" | "onmouseenter" | "onmouseleave" | "onmousemove" | "onmouseout" | "onmouseover" | "onmouseup" | "onpause" | "onplay" | "onplaying" | "onpointercancel" | "onpointerdown" | "onpointerenter" | "onpointerleave" | "onpointermove" | "onpointerout" | "onpointerover" | "onpointerup" | "onprogress" | "onratechange" | "onreset" | "onresize" | "onscroll" | "onsecuritypolicyviolation" | "onseeked" | "onseeking" | "onselect" | "onselectionchange" | "onselectstart" | "onstalled" | "onsubmit" | "onsuspend" | "ontimeupdate" | "ontoggle" | "ontouchcancel" | "ontouchend" | "ontouchmove" | "ontouchstart" | "ontransitioncancel" | "ontransitionend" | "ontransitionrun" | "ontransitionstart" | "onvolumechange" | "onwaiting" | "onwheel" | "indexedDB" | "origin" | "onafterprint" | "onbeforeprint" | "onbeforeunload" | "onhashchange" | "onlanguagechange" | "onmessage" | "onmessageerror" | "onoffline" | "ononline" | "onpagehide" | "onpageshow" | "onpopstate" | "onrejectionhandled" | "onstorage" | "onunhandledrejection" | "onunload" | "importScripts" | "ActiveXObject" | "WScript" | "WSH" | "Enumerator" | "VBArray" >globalThis : typeof globalThis diff --git a/tests/baselines/reference/importMeta.types b/tests/baselines/reference/importMeta.types index ae49a3b54107e..ad2200dd59a95 100644 --- a/tests/baselines/reference/importMeta.types +++ b/tests/baselines/reference/importMeta.types @@ -72,9 +72,9 @@ document.body.appendChild(image); >document.body.appendChild(image) : HTMLImageElement >document.body.appendChild : (newChild: T) => T ->document.body : HTMLBodyElement | HTMLFrameSetElement +>document.body : HTMLElement >document : Document ->body : HTMLBodyElement | HTMLFrameSetElement +>body : HTMLElement >appendChild : (newChild: T) => T >image : HTMLImageElement diff --git a/tests/baselines/reference/importMetaES5.types b/tests/baselines/reference/importMetaES5.types index ae49a3b54107e..ad2200dd59a95 100644 --- a/tests/baselines/reference/importMetaES5.types +++ b/tests/baselines/reference/importMetaES5.types @@ -72,9 +72,9 @@ document.body.appendChild(image); >document.body.appendChild(image) : HTMLImageElement >document.body.appendChild : (newChild: T) => T ->document.body : HTMLBodyElement | HTMLFrameSetElement +>document.body : HTMLElement >document : Document ->body : HTMLBodyElement | HTMLFrameSetElement +>body : HTMLElement >appendChild : (newChild: T) => T >image : HTMLImageElement diff --git a/tests/baselines/reference/infiniteConstraints.errors.txt b/tests/baselines/reference/infiniteConstraints.errors.txt index 414fa8f9213a4..685b18932c119 100644 --- a/tests/baselines/reference/infiniteConstraints.errors.txt +++ b/tests/baselines/reference/infiniteConstraints.errors.txt @@ -1,18 +1,13 @@ -tests/cases/compiler/infiniteConstraints.ts(3,37): error TS2589: Type instantiation is excessively deep and possibly infinite. tests/cases/compiler/infiniteConstraints.ts(4,37): error TS2536: Type '"val"' cannot be used to index type 'B[Exclude]'. -tests/cases/compiler/infiniteConstraints.ts(21,21): error TS2536: Type '"val"' cannot be used to index type 'Extract>'. -tests/cases/compiler/infiniteConstraints.ts(21,57): error TS2536: Type '"val"' cannot be used to index type 'Extract], Record<"val", string>>'. tests/cases/compiler/infiniteConstraints.ts(31,43): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'. tests/cases/compiler/infiniteConstraints.ts(31,63): error TS2322: Type 'Record<"val", "dup">' is not assignable to type 'never'. tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' cannot be used to index type 'T[keyof T]'. -==== tests/cases/compiler/infiniteConstraints.ts (7 errors) ==== +==== tests/cases/compiler/infiniteConstraints.ts (4 errors) ==== // Both of the following types trigger the recursion limiter in getImmediateBaseConstraint type T1], { val: string }>["val"] }> = B; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2589: Type instantiation is excessively deep and possibly infinite. type T2]["val"] }> = B; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2536: Type '"val"' cannot be used to index type 'B[Exclude]'. @@ -33,10 +28,6 @@ tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' c declare function ensureNoDuplicates< T extends { [K in keyof T]: Extract["val"] extends Extract], Value>["val"] - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2536: Type '"val"' cannot be used to index type 'Extract>'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2536: Type '"val"' cannot be used to index type 'Extract], Record<"val", string>>'. ? never : any } diff --git a/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt b/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt index 9bdfc6f30f9ad..97ed1cf489588 100644 --- a/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt +++ b/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt @@ -80,4 +80,9 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(12 type UnexpectedError = T type NoErrorHere = T + + // Repro from #30331 + + type a = T extends Array ? U : never; + type b = { [K in a & keyof T ]: 42 }; \ No newline at end of file diff --git a/tests/baselines/reference/intersectionWithUnionConstraint.js b/tests/baselines/reference/intersectionWithUnionConstraint.js index fc3e50309c6f5..00330d23f6d99 100644 --- a/tests/baselines/reference/intersectionWithUnionConstraint.js +++ b/tests/baselines/reference/intersectionWithUnionConstraint.js @@ -33,6 +33,11 @@ type Example = { [K in keyof T]: K extends keyof U ? UnexpectedError : type UnexpectedError = T type NoErrorHere = T + +// Repro from #30331 + +type a = T extends Array ? U : never; +type b = { [K in a & keyof T ]: 42 }; //// [intersectionWithUnionConstraint.js] diff --git a/tests/baselines/reference/intersectionWithUnionConstraint.symbols b/tests/baselines/reference/intersectionWithUnionConstraint.symbols index f481a5c518531..1ef1f8435d904 100644 --- a/tests/baselines/reference/intersectionWithUnionConstraint.symbols +++ b/tests/baselines/reference/intersectionWithUnionConstraint.symbols @@ -112,3 +112,21 @@ type NoErrorHere = T >PropertyKey : Symbol(PropertyKey, Decl(lib.es5.d.ts, --, --)) >T : Symbol(T, Decl(intersectionWithUnionConstraint.ts, 33, 17)) +// Repro from #30331 + +type a = T extends Array ? U : never; +>a : Symbol(a, Decl(intersectionWithUnionConstraint.ts, 33, 43)) +>T : Symbol(T, Decl(intersectionWithUnionConstraint.ts, 37, 7)) +>T : Symbol(T, Decl(intersectionWithUnionConstraint.ts, 37, 7)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>U : Symbol(U, Decl(intersectionWithUnionConstraint.ts, 37, 33)) +>U : Symbol(U, Decl(intersectionWithUnionConstraint.ts, 37, 33)) + +type b = { [K in a & keyof T ]: 42 }; +>b : Symbol(b, Decl(intersectionWithUnionConstraint.ts, 37, 49)) +>T : Symbol(T, Decl(intersectionWithUnionConstraint.ts, 38, 7)) +>K : Symbol(K, Decl(intersectionWithUnionConstraint.ts, 38, 15)) +>a : Symbol(a, Decl(intersectionWithUnionConstraint.ts, 33, 43)) +>T : Symbol(T, Decl(intersectionWithUnionConstraint.ts, 38, 7)) +>T : Symbol(T, Decl(intersectionWithUnionConstraint.ts, 38, 7)) + diff --git a/tests/baselines/reference/intersectionWithUnionConstraint.types b/tests/baselines/reference/intersectionWithUnionConstraint.types index 126154a49681d..0f9e9974bed8d 100644 --- a/tests/baselines/reference/intersectionWithUnionConstraint.types +++ b/tests/baselines/reference/intersectionWithUnionConstraint.types @@ -84,3 +84,11 @@ type UnexpectedError = T type NoErrorHere = T >NoErrorHere : T +// Repro from #30331 + +type a = T extends Array ? U : never; +>a : a + +type b = { [K in a & keyof T ]: 42 }; +>b : b + diff --git a/tests/baselines/reference/intersectionsOfLargeUnions2.errors.txt b/tests/baselines/reference/intersectionsOfLargeUnions2.errors.txt index 207bc10d596d0..a8d4f797fea9d 100644 --- a/tests/baselines/reference/intersectionsOfLargeUnions2.errors.txt +++ b/tests/baselines/reference/intersectionsOfLargeUnions2.errors.txt @@ -10,7 +10,7 @@ tests/cases/compiler/intersectionsOfLargeUnions2.ts(31,15): error TS2536: Type ' interface ElementTagNameMap { ~~~~~~~~~~~~~~~~~ !!! error TS2300: Duplicate identifier 'ElementTagNameMap'. -!!! related TS6203 /.ts/lib.dom.d.ts:17999:6: 'ElementTagNameMap' was also declared here. +!!! related TS6203 /.ts/lib.dom.d.ts:18109:6: 'ElementTagNameMap' was also declared here. [index: number]: HTMLElement } diff --git a/tests/baselines/reference/iterableArrayPattern10.errors.txt b/tests/baselines/reference/iterableArrayPattern10.errors.txt index 9ec39f0ef955c..59b2079975da3 100644 --- a/tests/baselines/reference/iterableArrayPattern10.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern10.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts(17,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'. - Type 'FooIterator' is missing the following properties from type '[any, any]': 0, 1, length, pop, and 26 more. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts (1 errors) ==== @@ -21,5 +20,4 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts(17,5): error function fun([a, b]) { } fun(new FooIterator); ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'. -!!! error TS2345: Type 'FooIterator' is missing the following properties from type '[any, any]': 0, 1, length, pop, and 26 more. \ No newline at end of file +!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern13.errors.txt b/tests/baselines/reference/iterableArrayPattern13.errors.txt index 780efa0de7fd4..af5452de5fa82 100644 --- a/tests/baselines/reference/iterableArrayPattern13.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern13.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts(17,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, ...any[]]'. - Type 'FooIterator' is missing the following properties from type '[any, ...any[]]': 0, length, pop, push, and 25 more. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts (1 errors) ==== @@ -21,5 +20,4 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts(17,5): error function fun([a, ...b]) { } fun(new FooIterator); ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, ...any[]]'. -!!! error TS2345: Type 'FooIterator' is missing the following properties from type '[any, ...any[]]': 0, length, pop, push, and 25 more. \ No newline at end of file +!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, ...any[]]'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern16.errors.txt b/tests/baselines/reference/iterableArrayPattern16.errors.txt index 13b3981a94d90..9d01131954a10 100644 --- a/tests/baselines/reference/iterableArrayPattern16.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern16.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. - Type 'FooIterator' is missing the following properties from type '[Bar, Bar]': 0, 1, length, pop, and 26 more. tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,12): error TS2449: Class 'FooIteratorIterator' used before its declaration. @@ -8,7 +7,6 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,12): error fun(...new FooIteratorIterator); ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. -!!! error TS2345: Type 'FooIterator' is missing the following properties from type '[Bar, Bar]': 0, 1, length, pop, and 26 more. ~~~~~~~~~~~~~~~~~~~ !!! error TS2449: Class 'FooIteratorIterator' used before its declaration. !!! related TS2728 tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts:18:7: 'FooIteratorIterator' is declared here. diff --git a/tests/baselines/reference/iterableArrayPattern26.errors.txt b/tests/baselines/reference/iterableArrayPattern26.errors.txt index f56f56e4504c5..820e5ead3a4d9 100644 --- a/tests/baselines/reference/iterableArrayPattern26.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern26.errors.txt @@ -1,10 +1,8 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts(2,21): error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. - Type 'Map' is missing the following properties from type '[string, number]': 0, 1, length, pop, and 22 more. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. -!!! error TS2345: Type 'Map' is missing the following properties from type '[string, number]': 0, 1, length, pop, and 22 more. \ No newline at end of file +!!! error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. \ No newline at end of file diff --git a/tests/baselines/reference/keyofAndIndexedAccess.js b/tests/baselines/reference/keyofAndIndexedAccess.js index 7328bfe3feed9..c79ae58ae41ff 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.js +++ b/tests/baselines/reference/keyofAndIndexedAccess.js @@ -31,7 +31,8 @@ type K03 = keyof boolean; // "valueOf" type K04 = keyof void; // never type K05 = keyof undefined; // never type K06 = keyof null; // never -type K07 = keyof never; // never +type K07 = keyof never; // string | number | symbol +type K08 = keyof unknown; // never type K10 = keyof Shape; // "name" | "width" | "height" | "visible" type K11 = keyof Shape[]; // "length" | "toString" | ... @@ -1124,6 +1125,7 @@ declare type K04 = keyof void; declare type K05 = keyof undefined; declare type K06 = keyof null; declare type K07 = keyof never; +declare type K08 = keyof unknown; declare type K10 = keyof Shape; declare type K11 = keyof Shape[]; declare type K12 = keyof Dictionary; diff --git a/tests/baselines/reference/keyofAndIndexedAccess.symbols b/tests/baselines/reference/keyofAndIndexedAccess.symbols index 1d26f6dbec3a7..c3bebb6c7d042 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.symbols +++ b/tests/baselines/reference/keyofAndIndexedAccess.symbols @@ -79,2263 +79,2266 @@ type K05 = keyof undefined; // never type K06 = keyof null; // never >K06 : Symbol(K06, Decl(keyofAndIndexedAccess.ts, 30, 27)) -type K07 = keyof never; // never +type K07 = keyof never; // string | number | symbol >K07 : Symbol(K07, Decl(keyofAndIndexedAccess.ts, 31, 22)) +type K08 = keyof unknown; // never +>K08 : Symbol(K08, Decl(keyofAndIndexedAccess.ts, 32, 23)) + type K10 = keyof Shape; // "name" | "width" | "height" | "visible" ->K10 : Symbol(K10, Decl(keyofAndIndexedAccess.ts, 32, 23)) +>K10 : Symbol(K10, Decl(keyofAndIndexedAccess.ts, 33, 25)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type K11 = keyof Shape[]; // "length" | "toString" | ... ->K11 : Symbol(K11, Decl(keyofAndIndexedAccess.ts, 34, 23)) +>K11 : Symbol(K11, Decl(keyofAndIndexedAccess.ts, 35, 23)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type K12 = keyof Dictionary; // string ->K12 : Symbol(K12, Decl(keyofAndIndexedAccess.ts, 35, 25)) +>K12 : Symbol(K12, Decl(keyofAndIndexedAccess.ts, 36, 25)) >Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 18, 1)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type K13 = keyof {}; // never ->K13 : Symbol(K13, Decl(keyofAndIndexedAccess.ts, 36, 35)) +>K13 : Symbol(K13, Decl(keyofAndIndexedAccess.ts, 37, 35)) type K14 = keyof Object; // "constructor" | "toString" | ... ->K14 : Symbol(K14, Decl(keyofAndIndexedAccess.ts, 37, 20)) +>K14 : Symbol(K14, Decl(keyofAndIndexedAccess.ts, 38, 20)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) type K15 = keyof E; // "toString" | "toFixed" | "toExponential" | ... ->K15 : Symbol(K15, Decl(keyofAndIndexedAccess.ts, 38, 24)) +>K15 : Symbol(K15, Decl(keyofAndIndexedAccess.ts, 39, 24)) >E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 48)) type K16 = keyof [string, number]; // "0" | "1" | "length" | "toString" | ... ->K16 : Symbol(K16, Decl(keyofAndIndexedAccess.ts, 39, 19)) +>K16 : Symbol(K16, Decl(keyofAndIndexedAccess.ts, 40, 19)) type K17 = keyof (Shape | Item); // "name" ->K17 : Symbol(K17, Decl(keyofAndIndexedAccess.ts, 40, 34)) +>K17 : Symbol(K17, Decl(keyofAndIndexedAccess.ts, 41, 34)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) >Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 9, 1)) type K18 = keyof (Shape & Item); // "name" | "width" | "height" | "visible" | "price" ->K18 : Symbol(K18, Decl(keyofAndIndexedAccess.ts, 41, 32)) +>K18 : Symbol(K18, Decl(keyofAndIndexedAccess.ts, 42, 32)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) >Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 9, 1)) type K19 = keyof NumericallyIndexed // never ->K19 : Symbol(K19, Decl(keyofAndIndexedAccess.ts, 42, 32)) +>K19 : Symbol(K19, Decl(keyofAndIndexedAccess.ts, 43, 32)) >NumericallyIndexed : Symbol(NumericallyIndexed, Decl(keyofAndIndexedAccess.ts, 20, 40)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type KeyOf = keyof T; ->KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 43, 42)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 45, 11)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 45, 11)) +>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 44, 42)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 46, 11)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 46, 11)) type K20 = KeyOf; // "name" | "width" | "height" | "visible" ->K20 : Symbol(K20, Decl(keyofAndIndexedAccess.ts, 45, 24)) ->KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 43, 42)) +>K20 : Symbol(K20, Decl(keyofAndIndexedAccess.ts, 46, 24)) +>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 44, 42)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type K21 = KeyOf>; // string ->K21 : Symbol(K21, Decl(keyofAndIndexedAccess.ts, 47, 24)) ->KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 43, 42)) +>K21 : Symbol(K21, Decl(keyofAndIndexedAccess.ts, 48, 24)) +>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 44, 42)) >Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 18, 1)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type NAME = "name"; ->NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 48, 36)) +>NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 49, 36)) type WIDTH_OR_HEIGHT = "width" | "height"; ->WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 50, 19)) +>WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 51, 19)) type Q10 = Shape["name"]; // string ->Q10 : Symbol(Q10, Decl(keyofAndIndexedAccess.ts, 51, 42)) +>Q10 : Symbol(Q10, Decl(keyofAndIndexedAccess.ts, 52, 42)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type Q11 = Shape["width" | "height"]; // number ->Q11 : Symbol(Q11, Decl(keyofAndIndexedAccess.ts, 53, 25)) +>Q11 : Symbol(Q11, Decl(keyofAndIndexedAccess.ts, 54, 25)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type Q12 = Shape["name" | "visible"]; // string | boolean ->Q12 : Symbol(Q12, Decl(keyofAndIndexedAccess.ts, 54, 37)) +>Q12 : Symbol(Q12, Decl(keyofAndIndexedAccess.ts, 55, 37)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type Q20 = Shape[NAME]; // string ->Q20 : Symbol(Q20, Decl(keyofAndIndexedAccess.ts, 55, 37)) +>Q20 : Symbol(Q20, Decl(keyofAndIndexedAccess.ts, 56, 37)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) ->NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 48, 36)) +>NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 49, 36)) type Q21 = Shape[WIDTH_OR_HEIGHT]; // number ->Q21 : Symbol(Q21, Decl(keyofAndIndexedAccess.ts, 57, 23)) +>Q21 : Symbol(Q21, Decl(keyofAndIndexedAccess.ts, 58, 23)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) ->WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 50, 19)) +>WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 51, 19)) type Q30 = [string, number][0]; // string ->Q30 : Symbol(Q30, Decl(keyofAndIndexedAccess.ts, 58, 34)) +>Q30 : Symbol(Q30, Decl(keyofAndIndexedAccess.ts, 59, 34)) type Q31 = [string, number][1]; // number ->Q31 : Symbol(Q31, Decl(keyofAndIndexedAccess.ts, 60, 31)) +>Q31 : Symbol(Q31, Decl(keyofAndIndexedAccess.ts, 61, 31)) type Q32 = [string, number][number]; // string | number ->Q32 : Symbol(Q32, Decl(keyofAndIndexedAccess.ts, 61, 31)) +>Q32 : Symbol(Q32, Decl(keyofAndIndexedAccess.ts, 62, 31)) type Q33 = [string, number][E.A]; // string ->Q33 : Symbol(Q33, Decl(keyofAndIndexedAccess.ts, 62, 36)) +>Q33 : Symbol(Q33, Decl(keyofAndIndexedAccess.ts, 63, 36)) >E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 48)) >A : Symbol(E.A, Decl(keyofAndIndexedAccess.ts, 23, 14)) type Q34 = [string, number][E.B]; // number ->Q34 : Symbol(Q34, Decl(keyofAndIndexedAccess.ts, 63, 33)) +>Q34 : Symbol(Q34, Decl(keyofAndIndexedAccess.ts, 64, 33)) >E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 48)) >B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 23, 17)) type Q35 = [string, number]["0"]; // string ->Q35 : Symbol(Q35, Decl(keyofAndIndexedAccess.ts, 64, 33)) +>Q35 : Symbol(Q35, Decl(keyofAndIndexedAccess.ts, 65, 33)) type Q36 = [string, number]["1"]; // string ->Q36 : Symbol(Q36, Decl(keyofAndIndexedAccess.ts, 65, 33)) +>Q36 : Symbol(Q36, Decl(keyofAndIndexedAccess.ts, 66, 33)) type Q40 = (Shape | Options)["visible"]; // boolean | "yes" | "no" ->Q40 : Symbol(Q40, Decl(keyofAndIndexedAccess.ts, 66, 33)) +>Q40 : Symbol(Q40, Decl(keyofAndIndexedAccess.ts, 67, 33)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) >Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 14, 1)) type Q41 = (Shape & Options)["visible"]; // true & "yes" | true & "no" | false & "yes" | false & "no" ->Q41 : Symbol(Q41, Decl(keyofAndIndexedAccess.ts, 68, 40)) +>Q41 : Symbol(Q41, Decl(keyofAndIndexedAccess.ts, 69, 40)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) >Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 14, 1)) type Q50 = Dictionary["howdy"]; // Shape ->Q50 : Symbol(Q50, Decl(keyofAndIndexedAccess.ts, 69, 40)) +>Q50 : Symbol(Q50, Decl(keyofAndIndexedAccess.ts, 70, 40)) >Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 18, 1)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type Q51 = Dictionary[123]; // Shape ->Q51 : Symbol(Q51, Decl(keyofAndIndexedAccess.ts, 71, 38)) +>Q51 : Symbol(Q51, Decl(keyofAndIndexedAccess.ts, 72, 38)) >Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 18, 1)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) type Q52 = Dictionary[E.B]; // Shape ->Q52 : Symbol(Q52, Decl(keyofAndIndexedAccess.ts, 72, 34)) +>Q52 : Symbol(Q52, Decl(keyofAndIndexedAccess.ts, 73, 34)) >Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 18, 1)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) >E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 48)) >B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 23, 17)) declare let cond: boolean; ->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11)) +>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 76, 11)) function getProperty(obj: T, key: K) { ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 77, 23)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 77, 43)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 77, 50)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 77, 23)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 78, 21)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 78, 23)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 78, 21)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 78, 43)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 78, 21)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 78, 50)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 78, 23)) return obj[key]; ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 77, 43)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 77, 50)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 78, 43)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 78, 50)) } function setProperty(obj: T, key: K, value: T[K]) { ->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 81, 23)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 81, 43)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 81, 50)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 81, 23)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 81, 58)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 81, 23)) +>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 80, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 82, 21)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 82, 23)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 82, 21)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 82, 43)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 82, 21)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 82, 50)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 82, 23)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 82, 58)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 82, 21)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 82, 23)) obj[key] = value; ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 81, 43)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 81, 50)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 81, 58)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 82, 43)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 82, 50)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 82, 58)) } function f10(shape: Shape) { ->f10 : Symbol(f10, Decl(keyofAndIndexedAccess.ts, 83, 1)) ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13)) +>f10 : Symbol(f10, Decl(keyofAndIndexedAccess.ts, 84, 1)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 86, 13)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) let name = getProperty(shape, "name"); // string ->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 86, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13)) +>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 87, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 86, 13)) let widthOrHeight = getProperty(shape, cond ? "width" : "height"); // number ->widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 87, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13)) ->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11)) +>widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 88, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 86, 13)) +>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 76, 11)) let nameOrVisible = getProperty(shape, cond ? "name" : "visible"); // string | boolean ->nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 88, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13)) ->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11)) +>nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 89, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 86, 13)) +>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 76, 11)) setProperty(shape, "name", "rectangle"); ->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1)) ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13)) +>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 80, 1)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 86, 13)) setProperty(shape, cond ? "width" : "height", 10); ->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1)) ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13)) ->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11)) +>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 80, 1)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 86, 13)) +>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 76, 11)) setProperty(shape, cond ? "name" : "visible", true); // Technically not safe ->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1)) ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13)) ->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11)) +>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 80, 1)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 86, 13)) +>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 76, 11)) } function f11(a: Shape[]) { ->f11 : Symbol(f11, Decl(keyofAndIndexedAccess.ts, 92, 1)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13)) +>f11 : Symbol(f11, Decl(keyofAndIndexedAccess.ts, 93, 1)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 95, 13)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) let len = getProperty(a, "length"); // number ->len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 95, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13)) +>len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 96, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 95, 13)) setProperty(a, "length", len); ->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13)) ->len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 95, 7)) +>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 80, 1)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 95, 13)) +>len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 96, 7)) } function f12(t: [Shape, boolean]) { ->f12 : Symbol(f12, Decl(keyofAndIndexedAccess.ts, 97, 1)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 99, 13)) +>f12 : Symbol(f12, Decl(keyofAndIndexedAccess.ts, 98, 1)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) let len = getProperty(t, "length"); ->len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 100, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 99, 13)) +>len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 101, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13)) let s2 = getProperty(t, "0"); // Shape ->s2 : Symbol(s2, Decl(keyofAndIndexedAccess.ts, 101, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 99, 13)) +>s2 : Symbol(s2, Decl(keyofAndIndexedAccess.ts, 102, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13)) let b2 = getProperty(t, "1"); // boolean ->b2 : Symbol(b2, Decl(keyofAndIndexedAccess.ts, 102, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 99, 13)) +>b2 : Symbol(b2, Decl(keyofAndIndexedAccess.ts, 103, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13)) } function f13(foo: any, bar: any) { ->f13 : Symbol(f13, Decl(keyofAndIndexedAccess.ts, 103, 1)) ->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13)) ->bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 105, 22)) +>f13 : Symbol(f13, Decl(keyofAndIndexedAccess.ts, 104, 1)) +>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 106, 13)) +>bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 106, 22)) let x = getProperty(foo, "x"); // any ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 106, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 107, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 106, 13)) let y = getProperty(foo, "100"); // any ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 107, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 108, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 106, 13)) let z = getProperty(foo, bar); // any ->z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 108, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13)) ->bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 105, 22)) +>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 109, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 106, 13)) +>bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 106, 22)) } class Component { ->Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1)) ->PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16)) +>Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 110, 1)) +>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 112, 16)) props: PropType; ->props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27)) ->PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16)) +>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 112, 27)) +>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 112, 16)) getProperty(key: K) { ->getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 113, 16)) ->PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 113, 42)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 113, 16)) +>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 113, 20)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 114, 16)) +>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 112, 16)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 114, 42)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 114, 16)) return this.props[key]; ->this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27)) ->this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1)) ->props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 113, 42)) +>this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 112, 27)) +>this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 110, 1)) +>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 112, 27)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 114, 42)) } setProperty(key: K, value: PropType[K]) { ->setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 116, 16)) ->PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 116, 42)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 116, 16)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 116, 49)) ->PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 116, 16)) +>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 116, 5)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 117, 16)) +>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 112, 16)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 117, 42)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 117, 16)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 117, 49)) +>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 112, 16)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 117, 16)) this.props[key] = value; ->this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27)) ->this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1)) ->props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 116, 42)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 116, 49)) +>this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 112, 27)) +>this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 110, 1)) +>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 112, 27)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 117, 42)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 117, 49)) } } function f20(component: Component) { ->f20 : Symbol(f20, Decl(keyofAndIndexedAccess.ts, 119, 1)) ->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13)) ->Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1)) +>f20 : Symbol(f20, Decl(keyofAndIndexedAccess.ts, 120, 1)) +>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 122, 13)) +>Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 110, 1)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) let name = component.getProperty("name"); // string ->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 122, 7)) ->component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20)) ->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13)) ->getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20)) +>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 123, 7)) +>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 113, 20)) +>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 122, 13)) +>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 113, 20)) let widthOrHeight = component.getProperty(cond ? "width" : "height"); // number ->widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 123, 7)) ->component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20)) ->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13)) ->getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20)) ->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11)) +>widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 124, 7)) +>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 113, 20)) +>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 122, 13)) +>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 113, 20)) +>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 76, 11)) let nameOrVisible = component.getProperty(cond ? "name" : "visible"); // string | boolean ->nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 124, 7)) ->component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20)) ->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13)) ->getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20)) ->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11)) +>nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 125, 7)) +>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 113, 20)) +>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 122, 13)) +>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 113, 20)) +>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 76, 11)) component.setProperty("name", "rectangle"); ->component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5)) ->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13)) ->setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5)) +>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 116, 5)) +>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 122, 13)) +>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 116, 5)) component.setProperty(cond ? "width" : "height", 10) ->component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5)) ->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13)) ->setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5)) ->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11)) +>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 116, 5)) +>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 122, 13)) +>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 116, 5)) +>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 76, 11)) component.setProperty(cond ? "name" : "visible", true); // Technically not safe ->component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5)) ->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13)) ->setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5)) ->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11)) +>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 116, 5)) +>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 122, 13)) +>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 116, 5)) +>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 76, 11)) } function pluck(array: T[], key: K) { ->pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 130, 15)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 130, 17)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 130, 15)) ->array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 130, 37)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 130, 15)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 130, 48)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 130, 17)) +>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 129, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 131, 15)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 131, 17)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 131, 15)) +>array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 131, 37)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 131, 15)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 131, 48)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 131, 17)) return array.map(x => x[key]); >array.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 130, 37)) +>array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 131, 37)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 131, 21)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 131, 21)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 130, 48)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 132, 21)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 132, 21)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 131, 48)) } function f30(shapes: Shape[]) { ->f30 : Symbol(f30, Decl(keyofAndIndexedAccess.ts, 132, 1)) ->shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13)) +>f30 : Symbol(f30, Decl(keyofAndIndexedAccess.ts, 133, 1)) +>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 135, 13)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) let names = pluck(shapes, "name"); // string[] ->names : Symbol(names, Decl(keyofAndIndexedAccess.ts, 135, 7)) ->pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1)) ->shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13)) +>names : Symbol(names, Decl(keyofAndIndexedAccess.ts, 136, 7)) +>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 129, 1)) +>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 135, 13)) let widths = pluck(shapes, "width"); // number[] ->widths : Symbol(widths, Decl(keyofAndIndexedAccess.ts, 136, 7)) ->pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1)) ->shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13)) +>widths : Symbol(widths, Decl(keyofAndIndexedAccess.ts, 137, 7)) +>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 129, 1)) +>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 135, 13)) let nameOrVisibles = pluck(shapes, cond ? "name" : "visible"); // (string | boolean)[] ->nameOrVisibles : Symbol(nameOrVisibles, Decl(keyofAndIndexedAccess.ts, 137, 7)) ->pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1)) ->shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13)) ->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11)) +>nameOrVisibles : Symbol(nameOrVisibles, Decl(keyofAndIndexedAccess.ts, 138, 7)) +>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 129, 1)) +>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 135, 13)) +>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 76, 11)) } function f31(key: K) { ->f31 : Symbol(f31, Decl(keyofAndIndexedAccess.ts, 138, 1)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 140, 13)) +>f31 : Symbol(f31, Decl(keyofAndIndexedAccess.ts, 139, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 141, 13)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 140, 36)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 140, 13)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 141, 36)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 141, 13)) const shape: Shape = { name: "foo", width: 5, height: 10, visible: true }; ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 141, 9)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 142, 9)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) ->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 141, 26)) ->width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 141, 39)) ->height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 141, 49)) ->visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 141, 61)) +>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 142, 26)) +>width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 142, 39)) +>height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 142, 49)) +>visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 142, 61)) return shape[key]; // Shape[K] ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 141, 9)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 140, 36)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 142, 9)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 141, 36)) } function f32(key: K) { ->f32 : Symbol(f32, Decl(keyofAndIndexedAccess.ts, 143, 1)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 145, 13)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 145, 43)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 145, 13)) +>f32 : Symbol(f32, Decl(keyofAndIndexedAccess.ts, 144, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 146, 13)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 146, 43)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 146, 13)) const shape: Shape = { name: "foo", width: 5, height: 10, visible: true }; ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 146, 9)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 147, 9)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) ->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 146, 26)) ->width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 146, 39)) ->height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 146, 49)) ->visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 146, 61)) +>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 147, 26)) +>width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 147, 39)) +>height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 147, 49)) +>visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 147, 61)) return shape[key]; // Shape[K] ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 146, 9)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 145, 43)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 147, 9)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 146, 43)) } function f33(shape: S, key: K) { ->f33 : Symbol(f33, Decl(keyofAndIndexedAccess.ts, 148, 1)) ->S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 150, 13)) +>f33 : Symbol(f33, Decl(keyofAndIndexedAccess.ts, 149, 1)) +>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 151, 13)) >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 150, 29)) ->S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 150, 13)) ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 150, 49)) ->S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 150, 13)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 150, 58)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 150, 29)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 151, 29)) +>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 151, 13)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 151, 49)) +>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 151, 13)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 151, 58)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 151, 29)) let name = getProperty(shape, "name"); ->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 151, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 150, 49)) +>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 152, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 151, 49)) let prop = getProperty(shape, key); ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 152, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 150, 49)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 150, 58)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 153, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 151, 49)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 151, 58)) return prop; ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 152, 7)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 153, 7)) } function f34(ts: TaggedShape) { ->f34 : Symbol(f34, Decl(keyofAndIndexedAccess.ts, 154, 1)) ->ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 156, 13)) +>f34 : Symbol(f34, Decl(keyofAndIndexedAccess.ts, 155, 1)) +>ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 157, 13)) >TaggedShape : Symbol(TaggedShape, Decl(keyofAndIndexedAccess.ts, 5, 1)) let tag1 = f33(ts, "tag"); ->tag1 : Symbol(tag1, Decl(keyofAndIndexedAccess.ts, 157, 7)) ->f33 : Symbol(f33, Decl(keyofAndIndexedAccess.ts, 148, 1)) ->ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 156, 13)) +>tag1 : Symbol(tag1, Decl(keyofAndIndexedAccess.ts, 158, 7)) +>f33 : Symbol(f33, Decl(keyofAndIndexedAccess.ts, 149, 1)) +>ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 157, 13)) let tag2 = getProperty(ts, "tag"); ->tag2 : Symbol(tag2, Decl(keyofAndIndexedAccess.ts, 158, 7)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 156, 13)) +>tag2 : Symbol(tag2, Decl(keyofAndIndexedAccess.ts, 159, 7)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 157, 13)) } class C { ->C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 159, 1)) +>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 160, 1)) public x: string; ->x : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 161, 9)) +>x : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 162, 9)) protected y: string; ->y : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 162, 21)) +>y : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 163, 21)) private z: string; ->z : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 163, 24)) +>z : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 164, 24)) } // Indexed access expressions have always permitted access to private and protected members. // For consistency we also permit such access in indexed access types. function f40(c: C) { ->f40 : Symbol(f40, Decl(keyofAndIndexedAccess.ts, 165, 1)) ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 169, 13)) ->C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 159, 1)) +>f40 : Symbol(f40, Decl(keyofAndIndexedAccess.ts, 166, 1)) +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 170, 13)) +>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 160, 1)) type X = C["x"]; ->X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 169, 20)) ->C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 159, 1)) +>X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 170, 20)) +>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 160, 1)) type Y = C["y"]; ->Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 170, 20)) ->C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 159, 1)) +>Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 171, 20)) +>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 160, 1)) type Z = C["z"]; ->Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 171, 20)) ->C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 159, 1)) +>Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 172, 20)) +>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 160, 1)) let x: X = c["x"]; ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 173, 7)) ->X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 169, 20)) ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 169, 13)) ->"x" : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 161, 9)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 174, 7)) +>X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 170, 20)) +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 170, 13)) +>"x" : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 162, 9)) let y: Y = c["y"]; ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 174, 7)) ->Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 170, 20)) ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 169, 13)) ->"y" : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 162, 21)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 175, 7)) +>Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 171, 20)) +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 170, 13)) +>"y" : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 163, 21)) let z: Z = c["z"]; ->z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 175, 7)) ->Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 171, 20)) ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 169, 13)) ->"z" : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 163, 24)) +>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 176, 7)) +>Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 172, 20)) +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 170, 13)) +>"z" : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 164, 24)) } function f50(k: keyof T, s: string) { ->f50 : Symbol(f50, Decl(keyofAndIndexedAccess.ts, 176, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 178, 13)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 178, 16)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 178, 13)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 178, 27)) +>f50 : Symbol(f50, Decl(keyofAndIndexedAccess.ts, 177, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 179, 13)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 179, 16)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 179, 13)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 179, 27)) const x1 = s as keyof T; ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 179, 9)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 178, 27)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 178, 13)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 180, 9)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 179, 27)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 179, 13)) const x2 = k as string; ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 180, 9)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 178, 16)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 181, 9)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 179, 16)) } function f51(k: K, s: string) { ->f51 : Symbol(f51, Decl(keyofAndIndexedAccess.ts, 181, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 183, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 183, 15)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 183, 13)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 183, 35)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 183, 15)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 183, 40)) +>f51 : Symbol(f51, Decl(keyofAndIndexedAccess.ts, 182, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 184, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 184, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 184, 13)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 184, 35)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 184, 15)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 184, 40)) const x1 = s as keyof T; ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 184, 9)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 183, 40)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 183, 13)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 185, 9)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 184, 40)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 184, 13)) const x2 = k as string; ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 185, 9)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 183, 35)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 186, 9)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 184, 35)) } function f52(obj: { [x: string]: boolean }, k: Exclude, s: string, n: number) { ->f52 : Symbol(f52, Decl(keyofAndIndexedAccess.ts, 186, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 188, 13)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 188, 16)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 188, 24)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 188, 46)) +>f52 : Symbol(f52, Decl(keyofAndIndexedAccess.ts, 187, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 189, 13)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 189, 16)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 189, 24)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 189, 46)) >Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 188, 13)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 188, 75)) ->n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 188, 86)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 189, 13)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 189, 75)) +>n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 189, 86)) const x1 = obj[s]; ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 189, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 188, 16)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 188, 75)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 190, 9)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 189, 16)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 189, 75)) const x2 = obj[n]; ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 190, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 188, 16)) ->n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 188, 86)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 191, 9)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 189, 16)) +>n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 189, 86)) const x3 = obj[k]; ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 191, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 188, 16)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 188, 46)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 192, 9)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 189, 16)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 189, 46)) } function f53>(obj: { [x: string]: boolean }, k: K, s: string, n: number) { ->f53 : Symbol(f53, Decl(keyofAndIndexedAccess.ts, 192, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 194, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 194, 15)) +>f53 : Symbol(f53, Decl(keyofAndIndexedAccess.ts, 193, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 195, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 195, 15)) >Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 194, 13)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 194, 52)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 194, 60)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 194, 82)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 194, 15)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 194, 88)) ->n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 194, 99)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 195, 13)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 52)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 195, 60)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 195, 82)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 195, 15)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 195, 88)) +>n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 195, 99)) const x1 = obj[s]; ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 195, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 194, 52)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 194, 88)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 196, 9)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 52)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 195, 88)) const x2 = obj[n]; ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 196, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 194, 52)) ->n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 194, 99)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 197, 9)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 52)) +>n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 195, 99)) const x3 = obj[k]; ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 197, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 194, 52)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 194, 82)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 198, 9)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 52)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 195, 82)) } function f54(obj: T, key: keyof T) { ->f54 : Symbol(f54, Decl(keyofAndIndexedAccess.ts, 198, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 200, 13)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 200, 16)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 200, 13)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 200, 23)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 200, 13)) +>f54 : Symbol(f54, Decl(keyofAndIndexedAccess.ts, 199, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 201, 13)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 201, 16)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 201, 13)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 201, 23)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 201, 13)) for (let s in obj[key]) { ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 201, 12)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 200, 16)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 200, 23)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 202, 12)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 201, 16)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 201, 23)) } const b = "foo" in obj[key]; ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 203, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 200, 16)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 200, 23)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 204, 9)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 201, 16)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 201, 23)) } function f55(obj: T, key: K) { ->f55 : Symbol(f55, Decl(keyofAndIndexedAccess.ts, 204, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 206, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 206, 15)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 206, 13)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 206, 35)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 206, 13)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 206, 42)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 206, 15)) +>f55 : Symbol(f55, Decl(keyofAndIndexedAccess.ts, 205, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 207, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 207, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 207, 13)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 207, 35)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 207, 13)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 207, 42)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 207, 15)) for (let s in obj[key]) { ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 207, 12)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 206, 35)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 206, 42)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 208, 12)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 207, 35)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 207, 42)) } const b = "foo" in obj[key]; ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 209, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 206, 35)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 206, 42)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 210, 9)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 207, 35)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 207, 42)) } function f60(source: T, target: T) { ->f60 : Symbol(f60, Decl(keyofAndIndexedAccess.ts, 210, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 212, 13)) ->source : Symbol(source, Decl(keyofAndIndexedAccess.ts, 212, 16)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 212, 13)) ->target : Symbol(target, Decl(keyofAndIndexedAccess.ts, 212, 26)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 212, 13)) +>f60 : Symbol(f60, Decl(keyofAndIndexedAccess.ts, 211, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 213, 13)) +>source : Symbol(source, Decl(keyofAndIndexedAccess.ts, 213, 16)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 213, 13)) +>target : Symbol(target, Decl(keyofAndIndexedAccess.ts, 213, 26)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 213, 13)) for (let k in source) { ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 213, 12)) ->source : Symbol(source, Decl(keyofAndIndexedAccess.ts, 212, 16)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 214, 12)) +>source : Symbol(source, Decl(keyofAndIndexedAccess.ts, 213, 16)) target[k] = source[k]; ->target : Symbol(target, Decl(keyofAndIndexedAccess.ts, 212, 26)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 213, 12)) ->source : Symbol(source, Decl(keyofAndIndexedAccess.ts, 212, 16)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 213, 12)) +>target : Symbol(target, Decl(keyofAndIndexedAccess.ts, 213, 26)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 214, 12)) +>source : Symbol(source, Decl(keyofAndIndexedAccess.ts, 213, 16)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 214, 12)) } } function f70(func: (k1: keyof (T | U), k2: keyof (T & U)) => void) { ->f70 : Symbol(f70, Decl(keyofAndIndexedAccess.ts, 216, 1)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 218, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 218, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 218, 22)) ->k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 218, 26)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 218, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 218, 22)) ->k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 218, 44)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 218, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 218, 22)) +>f70 : Symbol(f70, Decl(keyofAndIndexedAccess.ts, 217, 1)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 219, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 219, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 219, 22)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 219, 26)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 219, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 219, 22)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 219, 44)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 219, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 219, 22)) func<{ a: any, b: any }, { a: any, c: any }>('a', 'a'); ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 218, 13)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 219, 10)) ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 219, 18)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 219, 30)) ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 219, 38)) - - func<{ a: any, b: any }, { a: any, c: any }>('a', 'b'); ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 218, 13)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 219, 13)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 220, 10)) >b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 220, 18)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 220, 30)) >c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 220, 38)) - func<{ a: any, b: any }, { a: any, c: any }>('a', 'c'); ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 218, 13)) + func<{ a: any, b: any }, { a: any, c: any }>('a', 'b'); +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 219, 13)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 221, 10)) >b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 221, 18)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 221, 30)) >c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 221, 38)) + + func<{ a: any, b: any }, { a: any, c: any }>('a', 'c'); +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 219, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 222, 10)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 222, 18)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 222, 30)) +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 222, 38)) } function f71(func: (x: T, y: U) => Partial) { ->f71 : Symbol(f71, Decl(keyofAndIndexedAccess.ts, 222, 1)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 224, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 224, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 224, 22)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 224, 26)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 224, 20)) ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 224, 31)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 224, 22)) +>f71 : Symbol(f71, Decl(keyofAndIndexedAccess.ts, 223, 1)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 225, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 225, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 225, 22)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 225, 26)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 225, 20)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 225, 31)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 225, 22)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 224, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 224, 22)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 225, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 225, 22)) let x = func({ a: 1, b: "hello" }, { c: true }); ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 225, 7)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 224, 13)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 225, 18)) ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 225, 24)) ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 225, 40)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 226, 7)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 225, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 226, 18)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 226, 24)) +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 226, 40)) x.a; // number | undefined ->x.a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 225, 18)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 225, 7)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 225, 18)) +>x.a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 226, 18)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 226, 7)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 226, 18)) x.b; // string | undefined ->x.b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 225, 24)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 225, 7)) ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 225, 24)) +>x.b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 226, 24)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 226, 7)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 226, 24)) x.c; // boolean | undefined ->x.c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 225, 40)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 225, 7)) ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 225, 40)) +>x.c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 226, 40)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 226, 7)) +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 226, 40)) } function f72(func: (x: T, y: U, k: K) => (T & U)[K]) { ->f72 : Symbol(f72, Decl(keyofAndIndexedAccess.ts, 229, 1)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 231, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 231, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 231, 22)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 231, 25)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 231, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 231, 22)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 231, 55)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 231, 20)) ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 231, 60)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 231, 22)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 231, 66)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 231, 25)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 231, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 231, 22)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 231, 25)) +>f72 : Symbol(f72, Decl(keyofAndIndexedAccess.ts, 230, 1)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 232, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 232, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 232, 22)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 232, 25)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 232, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 232, 22)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 232, 55)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 232, 20)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 232, 60)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 232, 22)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 232, 66)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 232, 25)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 232, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 232, 22)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 232, 25)) let a = func({ a: 1, b: "hello" }, { c: true }, 'a'); // number ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 232, 7)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 231, 13)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 232, 18)) ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 232, 24)) ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 232, 40)) - - let b = func({ a: 1, b: "hello" }, { c: true }, 'b'); // string ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 233, 7)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 231, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 233, 7)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 232, 13)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 233, 18)) >b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 233, 24)) >c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 233, 40)) - let c = func({ a: 1, b: "hello" }, { c: true }, 'c'); // boolean ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 234, 7)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 231, 13)) + let b = func({ a: 1, b: "hello" }, { c: true }, 'b'); // string +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 234, 7)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 232, 13)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 234, 18)) >b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 234, 24)) >c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 234, 40)) + + let c = func({ a: 1, b: "hello" }, { c: true }, 'c'); // boolean +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 235, 7)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 232, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 235, 18)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 235, 24)) +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 235, 40)) } function f73(func: (x: T, y: U, k: K) => (T & U)[K]) { ->f73 : Symbol(f73, Decl(keyofAndIndexedAccess.ts, 235, 1)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 237, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 237, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 237, 22)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 237, 25)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 237, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 237, 22)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 237, 51)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 237, 20)) ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 237, 56)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 237, 22)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 237, 62)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 237, 25)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 237, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 237, 22)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 237, 25)) +>f73 : Symbol(f73, Decl(keyofAndIndexedAccess.ts, 236, 1)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 238, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 238, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 238, 22)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 238, 25)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 238, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 238, 22)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 238, 51)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 238, 20)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 238, 56)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 238, 22)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 238, 62)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 238, 25)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 238, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 238, 22)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 238, 25)) let a = func({ a: 1, b: "hello" }, { c: true }, 'a'); // number ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 238, 7)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 237, 13)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 238, 18)) ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 238, 24)) ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 238, 40)) - - let b = func({ a: 1, b: "hello" }, { c: true }, 'b'); // string ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 239, 7)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 237, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 239, 7)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 238, 13)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 239, 18)) >b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 239, 24)) >c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 239, 40)) - let c = func({ a: 1, b: "hello" }, { c: true }, 'c'); // boolean ->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 240, 7)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 237, 13)) + let b = func({ a: 1, b: "hello" }, { c: true }, 'b'); // string +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 240, 7)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 238, 13)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 240, 18)) >b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 240, 24)) >c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 240, 40)) + + let c = func({ a: 1, b: "hello" }, { c: true }, 'c'); // boolean +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 241, 7)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 238, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 241, 18)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 241, 24)) +>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 241, 40)) } function f74(func: (x: T, y: U, k: K) => (T | U)[K]) { ->f74 : Symbol(f74, Decl(keyofAndIndexedAccess.ts, 241, 1)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 243, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 243, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 243, 22)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 243, 25)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 243, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 243, 22)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 243, 51)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 243, 20)) ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 243, 56)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 243, 22)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 243, 62)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 243, 25)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 243, 20)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 243, 22)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 243, 25)) +>f74 : Symbol(f74, Decl(keyofAndIndexedAccess.ts, 242, 1)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 244, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 244, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 244, 22)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 244, 25)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 244, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 244, 22)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 244, 51)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 244, 20)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 244, 56)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 244, 22)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 244, 62)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 244, 25)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 244, 20)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 244, 22)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 244, 25)) let a = func({ a: 1, b: "hello" }, { a: 2, b: true }, 'a'); // number ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 244, 7)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 243, 13)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 244, 18)) ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 244, 24)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 244, 40)) ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 244, 46)) - - let b = func({ a: 1, b: "hello" }, { a: 2, b: true }, 'b'); // string | boolean ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 245, 7)) ->func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 243, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 245, 7)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 244, 13)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 245, 18)) >b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 245, 24)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 245, 40)) >b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 245, 46)) + + let b = func({ a: 1, b: "hello" }, { a: 2, b: true }, 'b'); // string | boolean +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 246, 7)) +>func : Symbol(func, Decl(keyofAndIndexedAccess.ts, 244, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 246, 18)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 246, 24)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 246, 40)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 246, 46)) } function f80(obj: T) { ->f80 : Symbol(f80, Decl(keyofAndIndexedAccess.ts, 246, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 248, 13)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 248, 24)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 248, 29)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 248, 42)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 248, 13)) +>f80 : Symbol(f80, Decl(keyofAndIndexedAccess.ts, 247, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 249, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 249, 24)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 249, 29)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 249, 42)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 249, 13)) let a1 = obj.a; // { x: any } ->a1 : Symbol(a1, Decl(keyofAndIndexedAccess.ts, 249, 7)) ->obj.a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 248, 24)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 248, 42)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 248, 24)) +>a1 : Symbol(a1, Decl(keyofAndIndexedAccess.ts, 250, 7)) +>obj.a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 249, 24)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 249, 42)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 249, 24)) let a2 = obj['a']; // { x: any } ->a2 : Symbol(a2, Decl(keyofAndIndexedAccess.ts, 250, 7)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 248, 42)) ->'a' : Symbol(a, Decl(keyofAndIndexedAccess.ts, 248, 24)) +>a2 : Symbol(a2, Decl(keyofAndIndexedAccess.ts, 251, 7)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 249, 42)) +>'a' : Symbol(a, Decl(keyofAndIndexedAccess.ts, 249, 24)) let a3 = obj['a'] as T['a']; // T["a"] ->a3 : Symbol(a3, Decl(keyofAndIndexedAccess.ts, 251, 7)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 248, 42)) ->'a' : Symbol(a, Decl(keyofAndIndexedAccess.ts, 248, 24)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 248, 13)) +>a3 : Symbol(a3, Decl(keyofAndIndexedAccess.ts, 252, 7)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 249, 42)) +>'a' : Symbol(a, Decl(keyofAndIndexedAccess.ts, 249, 24)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 249, 13)) let x1 = obj.a.x; // any ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 252, 7)) ->obj.a.x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 248, 29)) ->obj.a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 248, 24)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 248, 42)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 248, 24)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 248, 29)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 253, 7)) +>obj.a.x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 249, 29)) +>obj.a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 249, 24)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 249, 42)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 249, 24)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 249, 29)) let x2 = obj['a']['x']; // any ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 253, 7)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 248, 42)) ->'a' : Symbol(a, Decl(keyofAndIndexedAccess.ts, 248, 24)) ->'x' : Symbol(x, Decl(keyofAndIndexedAccess.ts, 248, 29)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 254, 7)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 249, 42)) +>'a' : Symbol(a, Decl(keyofAndIndexedAccess.ts, 249, 24)) +>'x' : Symbol(x, Decl(keyofAndIndexedAccess.ts, 249, 29)) let x3 = obj['a']['x'] as T['a']['x']; // T["a"]["x"] ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 254, 7)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 248, 42)) ->'a' : Symbol(a, Decl(keyofAndIndexedAccess.ts, 248, 24)) ->'x' : Symbol(x, Decl(keyofAndIndexedAccess.ts, 248, 29)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 248, 13)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 255, 7)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 249, 42)) +>'a' : Symbol(a, Decl(keyofAndIndexedAccess.ts, 249, 24)) +>'x' : Symbol(x, Decl(keyofAndIndexedAccess.ts, 249, 29)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 249, 13)) } function f81(obj: T) { ->f81 : Symbol(f81, Decl(keyofAndIndexedAccess.ts, 255, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 257, 13)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 257, 24)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 257, 29)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 257, 42)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 257, 13)) +>f81 : Symbol(f81, Decl(keyofAndIndexedAccess.ts, 256, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 258, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 258, 24)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 258, 29)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 258, 42)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 258, 13)) return obj['a']['x'] as T['a']['x']; ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 257, 42)) ->'a' : Symbol(a, Decl(keyofAndIndexedAccess.ts, 257, 24)) ->'x' : Symbol(x, Decl(keyofAndIndexedAccess.ts, 257, 29)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 257, 13)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 258, 42)) +>'a' : Symbol(a, Decl(keyofAndIndexedAccess.ts, 258, 24)) +>'x' : Symbol(x, Decl(keyofAndIndexedAccess.ts, 258, 29)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 258, 13)) } function f82() { ->f82 : Symbol(f82, Decl(keyofAndIndexedAccess.ts, 259, 1)) +>f82 : Symbol(f82, Decl(keyofAndIndexedAccess.ts, 260, 1)) let x1 = f81({ a: { x: "hello" } }); // string ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 262, 7)) ->f81 : Symbol(f81, Decl(keyofAndIndexedAccess.ts, 255, 1)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 262, 18)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 262, 23)) - - let x2 = f81({ a: { x: 42 } }); // number ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 263, 7)) ->f81 : Symbol(f81, Decl(keyofAndIndexedAccess.ts, 255, 1)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 263, 7)) +>f81 : Symbol(f81, Decl(keyofAndIndexedAccess.ts, 256, 1)) >a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 263, 18)) >x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 263, 23)) + + let x2 = f81({ a: { x: 42 } }); // number +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 264, 7)) +>f81 : Symbol(f81, Decl(keyofAndIndexedAccess.ts, 256, 1)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 264, 18)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 264, 23)) } function f83(obj: T, key: K) { ->f83 : Symbol(f83, Decl(keyofAndIndexedAccess.ts, 264, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 266, 13)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 266, 26)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 266, 39)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 266, 51)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 266, 13)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 266, 71)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 266, 13)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 266, 78)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 266, 51)) +>f83 : Symbol(f83, Decl(keyofAndIndexedAccess.ts, 265, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 267, 13)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 267, 26)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 267, 39)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 267, 51)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 267, 13)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 267, 71)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 267, 13)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 267, 78)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 267, 51)) return obj[key]['x'] as T[K]['x']; ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 266, 71)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 266, 78)) ->'x' : Symbol(x, Decl(keyofAndIndexedAccess.ts, 266, 39)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 266, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 266, 51)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 267, 71)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 267, 78)) +>'x' : Symbol(x, Decl(keyofAndIndexedAccess.ts, 267, 39)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 267, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 267, 51)) } function f84() { ->f84 : Symbol(f84, Decl(keyofAndIndexedAccess.ts, 268, 1)) +>f84 : Symbol(f84, Decl(keyofAndIndexedAccess.ts, 269, 1)) let x1 = f83({ foo: { x: "hello" } }, "foo"); // string ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 271, 7)) ->f83 : Symbol(f83, Decl(keyofAndIndexedAccess.ts, 264, 1)) ->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 271, 18)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 271, 25)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 272, 7)) +>f83 : Symbol(f83, Decl(keyofAndIndexedAccess.ts, 265, 1)) +>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 272, 18)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 272, 25)) let x2 = f83({ bar: { x: 42 } }, "bar"); // number ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 272, 7)) ->f83 : Symbol(f83, Decl(keyofAndIndexedAccess.ts, 264, 1)) ->bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 272, 18)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 272, 25)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 273, 7)) +>f83 : Symbol(f83, Decl(keyofAndIndexedAccess.ts, 265, 1)) +>bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 273, 18)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 273, 25)) } class C1 { ->C1 : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) +>C1 : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) x: number; ->x : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 275, 10)) +>x : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 276, 10)) get(key: K) { ->get : Symbol(C1.get, Decl(keyofAndIndexedAccess.ts, 276, 14)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 277, 8)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 277, 30)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 277, 8)) +>get : Symbol(C1.get, Decl(keyofAndIndexedAccess.ts, 277, 14)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 278, 8)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 278, 30)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 278, 8)) return this[key]; ->this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 277, 30)) +>this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 278, 30)) } set(key: K, value: this[K]) { ->set : Symbol(C1.set, Decl(keyofAndIndexedAccess.ts, 279, 5)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 280, 8)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 280, 30)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 280, 8)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 280, 37)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 280, 8)) +>set : Symbol(C1.set, Decl(keyofAndIndexedAccess.ts, 280, 5)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 281, 8)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 281, 30)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 281, 8)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 281, 37)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 281, 8)) this[key] = value; ->this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 280, 30)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 280, 37)) +>this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 281, 30)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 281, 37)) } foo() { ->foo : Symbol(C1.foo, Decl(keyofAndIndexedAccess.ts, 282, 5)) +>foo : Symbol(C1.foo, Decl(keyofAndIndexedAccess.ts, 283, 5)) let x1 = this.x; // number ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 284, 11)) ->this.x : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 275, 10)) ->this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) ->x : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 275, 10)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 285, 11)) +>this.x : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 276, 10)) +>this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) +>x : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 276, 10)) let x2 = this["x"]; // number ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 285, 11)) ->this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) ->"x" : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 275, 10)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 286, 11)) +>this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) +>"x" : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 276, 10)) let x3 = this.get("x"); // this["x"] ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 286, 11)) ->this.get : Symbol(C1.get, Decl(keyofAndIndexedAccess.ts, 276, 14)) ->this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) ->get : Symbol(C1.get, Decl(keyofAndIndexedAccess.ts, 276, 14)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 287, 11)) +>this.get : Symbol(C1.get, Decl(keyofAndIndexedAccess.ts, 277, 14)) +>this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) +>get : Symbol(C1.get, Decl(keyofAndIndexedAccess.ts, 277, 14)) let x4 = getProperty(this, "x"); // this["x"] ->x4 : Symbol(x4, Decl(keyofAndIndexedAccess.ts, 287, 11)) ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) +>x4 : Symbol(x4, Decl(keyofAndIndexedAccess.ts, 288, 11)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) this.x = 42; ->this.x : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 275, 10)) ->this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) ->x : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 275, 10)) +>this.x : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 276, 10)) +>this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) +>x : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 276, 10)) this["x"] = 42; ->this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) ->"x" : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 275, 10)) +>this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) +>"x" : Symbol(C1.x, Decl(keyofAndIndexedAccess.ts, 276, 10)) this.set("x", 42); ->this.set : Symbol(C1.set, Decl(keyofAndIndexedAccess.ts, 279, 5)) ->this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) ->set : Symbol(C1.set, Decl(keyofAndIndexedAccess.ts, 279, 5)) +>this.set : Symbol(C1.set, Decl(keyofAndIndexedAccess.ts, 280, 5)) +>this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) +>set : Symbol(C1.set, Decl(keyofAndIndexedAccess.ts, 280, 5)) setProperty(this, "x", 42); ->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1)) ->this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 273, 1)) +>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 80, 1)) +>this : Symbol(C1, Decl(keyofAndIndexedAccess.ts, 274, 1)) } } type S2 = { ->S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 293, 1)) +>S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 294, 1)) a: string; ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 295, 11)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 296, 11)) b: string; ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 296, 14)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 297, 14)) }; function f90(x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) { ->f90 : Symbol(f90, Decl(keyofAndIndexedAccess.ts, 298, 2)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 300, 13)) ->S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 293, 1)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 300, 26)) ->S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 293, 1)) ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 300, 47)) ->S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 293, 1)) ->S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 293, 1)) ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 300, 64)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 300, 13)) ->S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 293, 1)) ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 300, 81)) ->S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 293, 1)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 300, 26)) +>f90 : Symbol(f90, Decl(keyofAndIndexedAccess.ts, 299, 2)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 301, 13)) +>S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 294, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 301, 26)) +>S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 294, 1)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 301, 47)) +>S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 294, 1)) +>S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 294, 1)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 301, 64)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 301, 13)) +>S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 294, 1)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 301, 81)) +>S2 : Symbol(S2, Decl(keyofAndIndexedAccess.ts, 294, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 301, 26)) x1 = x2; ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 300, 47)) ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 300, 64)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 301, 47)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 301, 64)) x1 = x3; ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 300, 47)) ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 300, 81)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 301, 47)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 301, 81)) x2 = x1; ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 300, 64)) ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 300, 47)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 301, 64)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 301, 47)) x2 = x3; ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 300, 64)) ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 300, 81)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 301, 64)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 301, 81)) x3 = x1; ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 300, 81)) ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 300, 47)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 301, 81)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 301, 47)) x3 = x2; ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 300, 81)) ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 300, 64)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 301, 81)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 301, 64)) x1.length; >x1.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 300, 47)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 301, 47)) >length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) x2.length; >x2.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 300, 64)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 301, 64)) >length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) x3.length; >x3.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 300, 81)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 301, 81)) >length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) } function f91(x: T, y: T[keyof T], z: T[K]) { ->f91 : Symbol(f91, Decl(keyofAndIndexedAccess.ts, 310, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 312, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 312, 15)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 312, 13)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 312, 35)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 312, 13)) ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 312, 40)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 312, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 312, 13)) ->z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 312, 55)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 312, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 312, 15)) +>f91 : Symbol(f91, Decl(keyofAndIndexedAccess.ts, 311, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 313, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 313, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 313, 13)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 313, 35)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 313, 13)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 313, 40)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 313, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 313, 13)) +>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 313, 55)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 313, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 313, 15)) let a: {}; ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 313, 7)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 314, 7)) a = x; ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 313, 7)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 312, 35)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 314, 7)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 313, 35)) a = y; ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 313, 7)) ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 312, 40)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 314, 7)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 313, 40)) a = z; ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 313, 7)) ->z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 312, 55)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 314, 7)) +>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 313, 55)) } function f92(x: T, y: T[keyof T], z: T[K]) { ->f92 : Symbol(f92, Decl(keyofAndIndexedAccess.ts, 317, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 319, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 319, 15)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 319, 13)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 319, 35)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 319, 13)) ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 319, 40)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 319, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 319, 13)) ->z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 319, 55)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 319, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 319, 15)) +>f92 : Symbol(f92, Decl(keyofAndIndexedAccess.ts, 318, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 320, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 320, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 320, 13)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 320, 35)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 320, 13)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 320, 40)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 320, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 320, 13)) +>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 320, 55)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 320, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 320, 15)) let a: {} | null | undefined; ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 320, 7)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 321, 7)) a = x; ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 320, 7)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 319, 35)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 321, 7)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 320, 35)) a = y; ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 320, 7)) ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 319, 40)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 321, 7)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 320, 40)) a = z; ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 320, 7)) ->z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 319, 55)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 321, 7)) +>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 320, 55)) } // Repros from #12011 class Base { ->Base : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 324, 1)) +>Base : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 325, 1)) get(prop: K) { ->get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 328, 12)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 329, 8)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 329, 30)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 329, 8)) +>get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 329, 12)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 330, 8)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 330, 30)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 330, 8)) return this[prop]; ->this : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 324, 1)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 329, 30)) +>this : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 325, 1)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 330, 30)) } set(prop: K, value: this[K]) { ->set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 331, 5)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 332, 8)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 332, 30)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 332, 8)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 332, 38)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 332, 8)) +>set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 332, 5)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 333, 8)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 333, 30)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 333, 8)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 333, 38)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 333, 8)) this[prop] = value; ->this : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 324, 1)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 332, 30)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 332, 38)) +>this : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 325, 1)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 333, 30)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 333, 38)) } } class Person extends Base { ->Person : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 335, 1)) ->Base : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 324, 1)) +>Person : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 336, 1)) +>Base : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 325, 1)) parts: number; ->parts : Symbol(Person.parts, Decl(keyofAndIndexedAccess.ts, 337, 27)) +>parts : Symbol(Person.parts, Decl(keyofAndIndexedAccess.ts, 338, 27)) constructor(parts: number) { ->parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 339, 16)) +>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 340, 16)) super(); ->super : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 324, 1)) +>super : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 325, 1)) this.set("parts", parts); ->this.set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 331, 5)) ->this : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 335, 1)) ->set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 331, 5)) ->parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 339, 16)) +>this.set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 332, 5)) +>this : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 336, 1)) +>set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 332, 5)) +>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 340, 16)) } getParts() { ->getParts : Symbol(Person.getParts, Decl(keyofAndIndexedAccess.ts, 342, 5)) +>getParts : Symbol(Person.getParts, Decl(keyofAndIndexedAccess.ts, 343, 5)) return this.get("parts") ->this.get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 328, 12)) ->this : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 335, 1)) ->get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 328, 12)) +>this.get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 329, 12)) +>this : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 336, 1)) +>get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 329, 12)) } } class OtherPerson { ->OtherPerson : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 346, 1)) +>OtherPerson : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 347, 1)) parts: number; ->parts : Symbol(OtherPerson.parts, Decl(keyofAndIndexedAccess.ts, 348, 19)) +>parts : Symbol(OtherPerson.parts, Decl(keyofAndIndexedAccess.ts, 349, 19)) constructor(parts: number) { ->parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 350, 16)) +>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 351, 16)) setProperty(this, "parts", parts); ->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1)) ->this : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 346, 1)) ->parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 350, 16)) +>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 80, 1)) +>this : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 347, 1)) +>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 351, 16)) } getParts() { ->getParts : Symbol(OtherPerson.getParts, Decl(keyofAndIndexedAccess.ts, 352, 5)) +>getParts : Symbol(OtherPerson.getParts, Decl(keyofAndIndexedAccess.ts, 353, 5)) return getProperty(this, "parts") ->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26)) ->this : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 346, 1)) +>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 76, 26)) +>this : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 347, 1)) } } // Modified repro from #12544 function path(obj: T, key1: K1): T[K1]; ->path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 356, 1), Decl(keyofAndIndexedAccess.ts, 360, 62), Decl(keyofAndIndexedAccess.ts, 361, 100), Decl(keyofAndIndexedAccess.ts, 362, 142), Decl(keyofAndIndexedAccess.ts, 363, 59)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 360, 14)) ->K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 360, 16)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 360, 14)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 360, 37)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 360, 14)) ->key1 : Symbol(key1, Decl(keyofAndIndexedAccess.ts, 360, 44)) ->K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 360, 16)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 360, 14)) ->K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 360, 16)) - -function path(obj: T, key1: K1, key2: K2): T[K1][K2]; ->path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 356, 1), Decl(keyofAndIndexedAccess.ts, 360, 62), Decl(keyofAndIndexedAccess.ts, 361, 100), Decl(keyofAndIndexedAccess.ts, 362, 142), Decl(keyofAndIndexedAccess.ts, 363, 59)) +>path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 357, 1), Decl(keyofAndIndexedAccess.ts, 361, 62), Decl(keyofAndIndexedAccess.ts, 362, 100), Decl(keyofAndIndexedAccess.ts, 363, 142), Decl(keyofAndIndexedAccess.ts, 364, 59)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 361, 14)) >K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 361, 16)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 361, 14)) ->K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 361, 36)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 361, 14)) ->K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 361, 16)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 361, 61)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 361, 37)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 361, 14)) ->key1 : Symbol(key1, Decl(keyofAndIndexedAccess.ts, 361, 68)) +>key1 : Symbol(key1, Decl(keyofAndIndexedAccess.ts, 361, 44)) >K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 361, 16)) ->key2 : Symbol(key2, Decl(keyofAndIndexedAccess.ts, 361, 78)) ->K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 361, 36)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 361, 14)) >K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 361, 16)) ->K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 361, 36)) -function path(obj: T, key1: K1, key2: K2, key3: K3): T[K1][K2][K3]; ->path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 356, 1), Decl(keyofAndIndexedAccess.ts, 360, 62), Decl(keyofAndIndexedAccess.ts, 361, 100), Decl(keyofAndIndexedAccess.ts, 362, 142), Decl(keyofAndIndexedAccess.ts, 363, 59)) +function path(obj: T, key1: K1, key2: K2): T[K1][K2]; +>path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 357, 1), Decl(keyofAndIndexedAccess.ts, 361, 62), Decl(keyofAndIndexedAccess.ts, 362, 100), Decl(keyofAndIndexedAccess.ts, 363, 142), Decl(keyofAndIndexedAccess.ts, 364, 59)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 362, 14)) >K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 362, 16)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 362, 14)) >K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 362, 36)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 362, 14)) >K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 362, 16)) ->K3 : Symbol(K3, Decl(keyofAndIndexedAccess.ts, 362, 60)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 362, 14)) ->K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 362, 16)) ->K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 362, 36)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 362, 89)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 362, 61)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 362, 14)) ->key1 : Symbol(key1, Decl(keyofAndIndexedAccess.ts, 362, 96)) +>key1 : Symbol(key1, Decl(keyofAndIndexedAccess.ts, 362, 68)) >K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 362, 16)) ->key2 : Symbol(key2, Decl(keyofAndIndexedAccess.ts, 362, 106)) +>key2 : Symbol(key2, Decl(keyofAndIndexedAccess.ts, 362, 78)) >K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 362, 36)) ->key3 : Symbol(key3, Decl(keyofAndIndexedAccess.ts, 362, 116)) ->K3 : Symbol(K3, Decl(keyofAndIndexedAccess.ts, 362, 60)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 362, 14)) >K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 362, 16)) >K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 362, 36)) ->K3 : Symbol(K3, Decl(keyofAndIndexedAccess.ts, 362, 60)) -function path(obj: any, ...keys: (string | number)[]): any; ->path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 356, 1), Decl(keyofAndIndexedAccess.ts, 360, 62), Decl(keyofAndIndexedAccess.ts, 361, 100), Decl(keyofAndIndexedAccess.ts, 362, 142), Decl(keyofAndIndexedAccess.ts, 363, 59)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 363, 14)) ->keys : Symbol(keys, Decl(keyofAndIndexedAccess.ts, 363, 23)) +function path(obj: T, key1: K1, key2: K2, key3: K3): T[K1][K2][K3]; +>path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 357, 1), Decl(keyofAndIndexedAccess.ts, 361, 62), Decl(keyofAndIndexedAccess.ts, 362, 100), Decl(keyofAndIndexedAccess.ts, 363, 142), Decl(keyofAndIndexedAccess.ts, 364, 59)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 363, 14)) +>K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 363, 16)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 363, 14)) +>K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 363, 36)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 363, 14)) +>K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 363, 16)) +>K3 : Symbol(K3, Decl(keyofAndIndexedAccess.ts, 363, 60)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 363, 14)) +>K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 363, 16)) +>K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 363, 36)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 363, 89)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 363, 14)) +>key1 : Symbol(key1, Decl(keyofAndIndexedAccess.ts, 363, 96)) +>K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 363, 16)) +>key2 : Symbol(key2, Decl(keyofAndIndexedAccess.ts, 363, 106)) +>K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 363, 36)) +>key3 : Symbol(key3, Decl(keyofAndIndexedAccess.ts, 363, 116)) +>K3 : Symbol(K3, Decl(keyofAndIndexedAccess.ts, 363, 60)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 363, 14)) +>K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 363, 16)) +>K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 363, 36)) +>K3 : Symbol(K3, Decl(keyofAndIndexedAccess.ts, 363, 60)) -function path(obj: any, ...keys: (string | number)[]): any { ->path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 356, 1), Decl(keyofAndIndexedAccess.ts, 360, 62), Decl(keyofAndIndexedAccess.ts, 361, 100), Decl(keyofAndIndexedAccess.ts, 362, 142), Decl(keyofAndIndexedAccess.ts, 363, 59)) +function path(obj: any, ...keys: (string | number)[]): any; +>path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 357, 1), Decl(keyofAndIndexedAccess.ts, 361, 62), Decl(keyofAndIndexedAccess.ts, 362, 100), Decl(keyofAndIndexedAccess.ts, 363, 142), Decl(keyofAndIndexedAccess.ts, 364, 59)) >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 364, 14)) >keys : Symbol(keys, Decl(keyofAndIndexedAccess.ts, 364, 23)) +function path(obj: any, ...keys: (string | number)[]): any { +>path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 357, 1), Decl(keyofAndIndexedAccess.ts, 361, 62), Decl(keyofAndIndexedAccess.ts, 362, 100), Decl(keyofAndIndexedAccess.ts, 363, 142), Decl(keyofAndIndexedAccess.ts, 364, 59)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 365, 14)) +>keys : Symbol(keys, Decl(keyofAndIndexedAccess.ts, 365, 23)) + let result = obj; ->result : Symbol(result, Decl(keyofAndIndexedAccess.ts, 365, 7)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 364, 14)) +>result : Symbol(result, Decl(keyofAndIndexedAccess.ts, 366, 7)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 365, 14)) for (let k of keys) { ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 366, 12)) ->keys : Symbol(keys, Decl(keyofAndIndexedAccess.ts, 364, 23)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 367, 12)) +>keys : Symbol(keys, Decl(keyofAndIndexedAccess.ts, 365, 23)) result = result[k]; ->result : Symbol(result, Decl(keyofAndIndexedAccess.ts, 365, 7)) ->result : Symbol(result, Decl(keyofAndIndexedAccess.ts, 365, 7)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 366, 12)) +>result : Symbol(result, Decl(keyofAndIndexedAccess.ts, 366, 7)) +>result : Symbol(result, Decl(keyofAndIndexedAccess.ts, 366, 7)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 367, 12)) } return result; ->result : Symbol(result, Decl(keyofAndIndexedAccess.ts, 365, 7)) +>result : Symbol(result, Decl(keyofAndIndexedAccess.ts, 366, 7)) } type Thing = { ->Thing : Symbol(Thing, Decl(keyofAndIndexedAccess.ts, 370, 1)) +>Thing : Symbol(Thing, Decl(keyofAndIndexedAccess.ts, 371, 1)) a: { x: number, y: string }, ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 372, 14)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 373, 8)) ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 373, 19)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 373, 14)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 374, 8)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 374, 19)) b: boolean ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 373, 32)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 374, 32)) }; function f1(thing: Thing) { ->f1 : Symbol(f1, Decl(keyofAndIndexedAccess.ts, 375, 2)) ->thing : Symbol(thing, Decl(keyofAndIndexedAccess.ts, 378, 12)) ->Thing : Symbol(Thing, Decl(keyofAndIndexedAccess.ts, 370, 1)) +>f1 : Symbol(f1, Decl(keyofAndIndexedAccess.ts, 376, 2)) +>thing : Symbol(thing, Decl(keyofAndIndexedAccess.ts, 379, 12)) +>Thing : Symbol(Thing, Decl(keyofAndIndexedAccess.ts, 371, 1)) let x1 = path(thing, 'a'); // { x: number, y: string } ->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 379, 7)) ->path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 356, 1), Decl(keyofAndIndexedAccess.ts, 360, 62), Decl(keyofAndIndexedAccess.ts, 361, 100), Decl(keyofAndIndexedAccess.ts, 362, 142), Decl(keyofAndIndexedAccess.ts, 363, 59)) ->thing : Symbol(thing, Decl(keyofAndIndexedAccess.ts, 378, 12)) +>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 380, 7)) +>path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 357, 1), Decl(keyofAndIndexedAccess.ts, 361, 62), Decl(keyofAndIndexedAccess.ts, 362, 100), Decl(keyofAndIndexedAccess.ts, 363, 142), Decl(keyofAndIndexedAccess.ts, 364, 59)) +>thing : Symbol(thing, Decl(keyofAndIndexedAccess.ts, 379, 12)) let x2 = path(thing, 'a', 'y'); // string ->x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 380, 7)) ->path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 356, 1), Decl(keyofAndIndexedAccess.ts, 360, 62), Decl(keyofAndIndexedAccess.ts, 361, 100), Decl(keyofAndIndexedAccess.ts, 362, 142), Decl(keyofAndIndexedAccess.ts, 363, 59)) ->thing : Symbol(thing, Decl(keyofAndIndexedAccess.ts, 378, 12)) +>x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 381, 7)) +>path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 357, 1), Decl(keyofAndIndexedAccess.ts, 361, 62), Decl(keyofAndIndexedAccess.ts, 362, 100), Decl(keyofAndIndexedAccess.ts, 363, 142), Decl(keyofAndIndexedAccess.ts, 364, 59)) +>thing : Symbol(thing, Decl(keyofAndIndexedAccess.ts, 379, 12)) let x3 = path(thing, 'b'); // boolean ->x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 381, 7)) ->path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 356, 1), Decl(keyofAndIndexedAccess.ts, 360, 62), Decl(keyofAndIndexedAccess.ts, 361, 100), Decl(keyofAndIndexedAccess.ts, 362, 142), Decl(keyofAndIndexedAccess.ts, 363, 59)) ->thing : Symbol(thing, Decl(keyofAndIndexedAccess.ts, 378, 12)) +>x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 382, 7)) +>path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 357, 1), Decl(keyofAndIndexedAccess.ts, 361, 62), Decl(keyofAndIndexedAccess.ts, 362, 100), Decl(keyofAndIndexedAccess.ts, 363, 142), Decl(keyofAndIndexedAccess.ts, 364, 59)) +>thing : Symbol(thing, Decl(keyofAndIndexedAccess.ts, 379, 12)) let x4 = path(thing, ...['a', 'x']); // any ->x4 : Symbol(x4, Decl(keyofAndIndexedAccess.ts, 382, 7)) ->path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 356, 1), Decl(keyofAndIndexedAccess.ts, 360, 62), Decl(keyofAndIndexedAccess.ts, 361, 100), Decl(keyofAndIndexedAccess.ts, 362, 142), Decl(keyofAndIndexedAccess.ts, 363, 59)) ->thing : Symbol(thing, Decl(keyofAndIndexedAccess.ts, 378, 12)) +>x4 : Symbol(x4, Decl(keyofAndIndexedAccess.ts, 383, 7)) +>path : Symbol(path, Decl(keyofAndIndexedAccess.ts, 357, 1), Decl(keyofAndIndexedAccess.ts, 361, 62), Decl(keyofAndIndexedAccess.ts, 362, 100), Decl(keyofAndIndexedAccess.ts, 363, 142), Decl(keyofAndIndexedAccess.ts, 364, 59)) +>thing : Symbol(thing, Decl(keyofAndIndexedAccess.ts, 379, 12)) } // Repro from comment in #12114 const assignTo2 = (object: T, key1: K1, key2: K2) => ->assignTo2 : Symbol(assignTo2, Decl(keyofAndIndexedAccess.ts, 387, 5)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 387, 19)) ->K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 387, 21)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 387, 19)) ->K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 387, 41)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 387, 19)) ->K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 387, 21)) ->object : Symbol(object, Decl(keyofAndIndexedAccess.ts, 387, 66)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 387, 19)) ->key1 : Symbol(key1, Decl(keyofAndIndexedAccess.ts, 387, 76)) ->K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 387, 21)) ->key2 : Symbol(key2, Decl(keyofAndIndexedAccess.ts, 387, 86)) ->K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 387, 41)) +>assignTo2 : Symbol(assignTo2, Decl(keyofAndIndexedAccess.ts, 388, 5)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 388, 19)) +>K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 388, 21)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 388, 19)) +>K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 388, 41)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 388, 19)) +>K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 388, 21)) +>object : Symbol(object, Decl(keyofAndIndexedAccess.ts, 388, 66)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 388, 19)) +>key1 : Symbol(key1, Decl(keyofAndIndexedAccess.ts, 388, 76)) +>K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 388, 21)) +>key2 : Symbol(key2, Decl(keyofAndIndexedAccess.ts, 388, 86)) +>K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 388, 41)) (value: T[K1][K2]) => object[key1][key2] = value; ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 388, 5)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 387, 19)) ->K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 387, 21)) ->K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 387, 41)) ->object : Symbol(object, Decl(keyofAndIndexedAccess.ts, 387, 66)) ->key1 : Symbol(key1, Decl(keyofAndIndexedAccess.ts, 387, 76)) ->key2 : Symbol(key2, Decl(keyofAndIndexedAccess.ts, 387, 86)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 388, 5)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 389, 5)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 388, 19)) +>K1 : Symbol(K1, Decl(keyofAndIndexedAccess.ts, 388, 21)) +>K2 : Symbol(K2, Decl(keyofAndIndexedAccess.ts, 388, 41)) +>object : Symbol(object, Decl(keyofAndIndexedAccess.ts, 388, 66)) +>key1 : Symbol(key1, Decl(keyofAndIndexedAccess.ts, 388, 76)) +>key2 : Symbol(key2, Decl(keyofAndIndexedAccess.ts, 388, 86)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 389, 5)) // Modified repro from #12573 declare function one(handler: (t: T) => void): T ->one : Symbol(one, Decl(keyofAndIndexedAccess.ts, 388, 53)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 392, 21)) ->handler : Symbol(handler, Decl(keyofAndIndexedAccess.ts, 392, 24)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 392, 34)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 392, 21)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 392, 21)) +>one : Symbol(one, Decl(keyofAndIndexedAccess.ts, 389, 53)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 393, 21)) +>handler : Symbol(handler, Decl(keyofAndIndexedAccess.ts, 393, 24)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 393, 34)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 393, 21)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 393, 21)) var empty = one(() => {}) // inferred as {}, expected ->empty : Symbol(empty, Decl(keyofAndIndexedAccess.ts, 393, 3)) ->one : Symbol(one, Decl(keyofAndIndexedAccess.ts, 388, 53)) +>empty : Symbol(empty, Decl(keyofAndIndexedAccess.ts, 394, 3)) +>one : Symbol(one, Decl(keyofAndIndexedAccess.ts, 389, 53)) type Handlers = { [K in keyof T]: (t: T[K]) => void } ->Handlers : Symbol(Handlers, Decl(keyofAndIndexedAccess.ts, 393, 25)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 395, 14)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 395, 22)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 395, 14)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 395, 38)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 395, 14)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 395, 22)) +>Handlers : Symbol(Handlers, Decl(keyofAndIndexedAccess.ts, 394, 25)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 396, 14)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 396, 22)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 396, 14)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 396, 38)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 396, 14)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 396, 22)) declare function on(handlerHash: Handlers): T ->on : Symbol(on, Decl(keyofAndIndexedAccess.ts, 395, 56)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 396, 20)) ->handlerHash : Symbol(handlerHash, Decl(keyofAndIndexedAccess.ts, 396, 23)) ->Handlers : Symbol(Handlers, Decl(keyofAndIndexedAccess.ts, 393, 25)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 396, 20)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 396, 20)) +>on : Symbol(on, Decl(keyofAndIndexedAccess.ts, 396, 56)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 397, 20)) +>handlerHash : Symbol(handlerHash, Decl(keyofAndIndexedAccess.ts, 397, 23)) +>Handlers : Symbol(Handlers, Decl(keyofAndIndexedAccess.ts, 394, 25)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 397, 20)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 397, 20)) var hashOfEmpty1 = on({ test: () => {} }); // {} ->hashOfEmpty1 : Symbol(hashOfEmpty1, Decl(keyofAndIndexedAccess.ts, 397, 3)) ->on : Symbol(on, Decl(keyofAndIndexedAccess.ts, 395, 56)) ->test : Symbol(test, Decl(keyofAndIndexedAccess.ts, 397, 23)) +>hashOfEmpty1 : Symbol(hashOfEmpty1, Decl(keyofAndIndexedAccess.ts, 398, 3)) +>on : Symbol(on, Decl(keyofAndIndexedAccess.ts, 396, 56)) +>test : Symbol(test, Decl(keyofAndIndexedAccess.ts, 398, 23)) var hashOfEmpty2 = on({ test: (x: boolean) => {} }); // { test: boolean } ->hashOfEmpty2 : Symbol(hashOfEmpty2, Decl(keyofAndIndexedAccess.ts, 398, 3)) ->on : Symbol(on, Decl(keyofAndIndexedAccess.ts, 395, 56)) ->test : Symbol(test, Decl(keyofAndIndexedAccess.ts, 398, 23)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 398, 31)) +>hashOfEmpty2 : Symbol(hashOfEmpty2, Decl(keyofAndIndexedAccess.ts, 399, 3)) +>on : Symbol(on, Decl(keyofAndIndexedAccess.ts, 396, 56)) +>test : Symbol(test, Decl(keyofAndIndexedAccess.ts, 399, 23)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 399, 31)) // Repro from #12624 interface Options1 { ->Options1 : Symbol(Options1, Decl(keyofAndIndexedAccess.ts, 398, 52)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 402, 19)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 402, 24)) +>Options1 : Symbol(Options1, Decl(keyofAndIndexedAccess.ts, 399, 52)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 403, 19)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 403, 24)) data?: Data ->data : Symbol(Options1.data, Decl(keyofAndIndexedAccess.ts, 402, 36)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 402, 19)) +>data : Symbol(Options1.data, Decl(keyofAndIndexedAccess.ts, 403, 36)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 403, 19)) computed?: Computed; ->computed : Symbol(Options1.computed, Decl(keyofAndIndexedAccess.ts, 403, 15)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 402, 24)) +>computed : Symbol(Options1.computed, Decl(keyofAndIndexedAccess.ts, 404, 15)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 403, 24)) } declare class Component1 { ->Component1 : Symbol(Component1, Decl(keyofAndIndexedAccess.ts, 405, 1)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 407, 25)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 407, 30)) +>Component1 : Symbol(Component1, Decl(keyofAndIndexedAccess.ts, 406, 1)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 408, 25)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 408, 30)) constructor(options: Options1); ->options : Symbol(options, Decl(keyofAndIndexedAccess.ts, 408, 16)) ->Options1 : Symbol(Options1, Decl(keyofAndIndexedAccess.ts, 398, 52)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 407, 25)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 407, 30)) +>options : Symbol(options, Decl(keyofAndIndexedAccess.ts, 409, 16)) +>Options1 : Symbol(Options1, Decl(keyofAndIndexedAccess.ts, 399, 52)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 408, 25)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 408, 30)) get(key: K): (Data & Computed)[K]; ->get : Symbol(Component1.get, Decl(keyofAndIndexedAccess.ts, 408, 51)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 409, 8)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 407, 25)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 407, 30)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 409, 43)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 409, 8)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 407, 25)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 407, 30)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 409, 8)) +>get : Symbol(Component1.get, Decl(keyofAndIndexedAccess.ts, 409, 51)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 410, 8)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 408, 25)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 408, 30)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 410, 43)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 410, 8)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 408, 25)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 408, 30)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 410, 8)) } let c1 = new Component1({ ->c1 : Symbol(c1, Decl(keyofAndIndexedAccess.ts, 412, 3)) ->Component1 : Symbol(Component1, Decl(keyofAndIndexedAccess.ts, 405, 1)) +>c1 : Symbol(c1, Decl(keyofAndIndexedAccess.ts, 413, 3)) +>Component1 : Symbol(Component1, Decl(keyofAndIndexedAccess.ts, 406, 1)) data: { ->data : Symbol(data, Decl(keyofAndIndexedAccess.ts, 412, 25)) +>data : Symbol(data, Decl(keyofAndIndexedAccess.ts, 413, 25)) hello: "" ->hello : Symbol(hello, Decl(keyofAndIndexedAccess.ts, 413, 11)) +>hello : Symbol(hello, Decl(keyofAndIndexedAccess.ts, 414, 11)) } }); c1.get("hello"); ->c1.get : Symbol(Component1.get, Decl(keyofAndIndexedAccess.ts, 408, 51)) ->c1 : Symbol(c1, Decl(keyofAndIndexedAccess.ts, 412, 3)) ->get : Symbol(Component1.get, Decl(keyofAndIndexedAccess.ts, 408, 51)) +>c1.get : Symbol(Component1.get, Decl(keyofAndIndexedAccess.ts, 409, 51)) +>c1 : Symbol(c1, Decl(keyofAndIndexedAccess.ts, 413, 3)) +>get : Symbol(Component1.get, Decl(keyofAndIndexedAccess.ts, 409, 51)) // Repro from #12625 interface Options2 { ->Options2 : Symbol(Options2, Decl(keyofAndIndexedAccess.ts, 418, 16)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 422, 19)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 422, 24)) +>Options2 : Symbol(Options2, Decl(keyofAndIndexedAccess.ts, 419, 16)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 423, 19)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 423, 24)) data?: Data ->data : Symbol(Options2.data, Decl(keyofAndIndexedAccess.ts, 422, 36)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 422, 19)) +>data : Symbol(Options2.data, Decl(keyofAndIndexedAccess.ts, 423, 36)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 423, 19)) computed?: Computed; ->computed : Symbol(Options2.computed, Decl(keyofAndIndexedAccess.ts, 423, 15)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 422, 24)) +>computed : Symbol(Options2.computed, Decl(keyofAndIndexedAccess.ts, 424, 15)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 423, 24)) } declare class Component2 { ->Component2 : Symbol(Component2, Decl(keyofAndIndexedAccess.ts, 425, 1)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 427, 25)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 427, 30)) +>Component2 : Symbol(Component2, Decl(keyofAndIndexedAccess.ts, 426, 1)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 428, 25)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 428, 30)) constructor(options: Options2); ->options : Symbol(options, Decl(keyofAndIndexedAccess.ts, 428, 16)) ->Options2 : Symbol(Options2, Decl(keyofAndIndexedAccess.ts, 418, 16)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 427, 25)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 427, 30)) +>options : Symbol(options, Decl(keyofAndIndexedAccess.ts, 429, 16)) +>Options2 : Symbol(Options2, Decl(keyofAndIndexedAccess.ts, 419, 16)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 428, 25)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 428, 30)) get(key: K): (Data & Computed)[K]; ->get : Symbol(Component2.get, Decl(keyofAndIndexedAccess.ts, 428, 51)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 429, 8)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 427, 25)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 427, 30)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 429, 47)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 429, 8)) ->Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 427, 25)) ->Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 427, 30)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 429, 8)) +>get : Symbol(Component2.get, Decl(keyofAndIndexedAccess.ts, 429, 51)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 430, 8)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 428, 25)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 428, 30)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 430, 47)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 430, 8)) +>Data : Symbol(Data, Decl(keyofAndIndexedAccess.ts, 428, 25)) +>Computed : Symbol(Computed, Decl(keyofAndIndexedAccess.ts, 428, 30)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 430, 8)) } // Repro from #12641 interface R { ->R : Symbol(R, Decl(keyofAndIndexedAccess.ts, 430, 1)) +>R : Symbol(R, Decl(keyofAndIndexedAccess.ts, 431, 1)) p: number; ->p : Symbol(R.p, Decl(keyofAndIndexedAccess.ts, 434, 13)) +>p : Symbol(R.p, Decl(keyofAndIndexedAccess.ts, 435, 13)) } function f(p: K) { ->f : Symbol(f, Decl(keyofAndIndexedAccess.ts, 436, 1)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 438, 11)) ->R : Symbol(R, Decl(keyofAndIndexedAccess.ts, 430, 1)) ->p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 438, 30)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 438, 11)) +>f : Symbol(f, Decl(keyofAndIndexedAccess.ts, 437, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 439, 11)) +>R : Symbol(R, Decl(keyofAndIndexedAccess.ts, 431, 1)) +>p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 439, 30)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 439, 11)) let a: any; ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 439, 7)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 440, 7)) a[p].add; // any ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 439, 7)) ->p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 438, 30)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 440, 7)) +>p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 439, 30)) } // Repro from #12651 type MethodDescriptor = { ->MethodDescriptor : Symbol(MethodDescriptor, Decl(keyofAndIndexedAccess.ts, 441, 1)) +>MethodDescriptor : Symbol(MethodDescriptor, Decl(keyofAndIndexedAccess.ts, 442, 1)) name: string; ->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 445, 25)) +>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 446, 25)) args: any[]; ->args : Symbol(args, Decl(keyofAndIndexedAccess.ts, 446, 14)) +>args : Symbol(args, Decl(keyofAndIndexedAccess.ts, 447, 14)) returnValue: any; ->returnValue : Symbol(returnValue, Decl(keyofAndIndexedAccess.ts, 447, 13)) +>returnValue : Symbol(returnValue, Decl(keyofAndIndexedAccess.ts, 448, 13)) } declare function dispatchMethod(name: M['name'], args: M['args']): M['returnValue']; ->dispatchMethod : Symbol(dispatchMethod, Decl(keyofAndIndexedAccess.ts, 449, 1)) ->M : Symbol(M, Decl(keyofAndIndexedAccess.ts, 451, 32)) ->MethodDescriptor : Symbol(MethodDescriptor, Decl(keyofAndIndexedAccess.ts, 441, 1)) ->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 451, 60)) ->M : Symbol(M, Decl(keyofAndIndexedAccess.ts, 451, 32)) ->args : Symbol(args, Decl(keyofAndIndexedAccess.ts, 451, 76)) ->M : Symbol(M, Decl(keyofAndIndexedAccess.ts, 451, 32)) ->M : Symbol(M, Decl(keyofAndIndexedAccess.ts, 451, 32)) +>dispatchMethod : Symbol(dispatchMethod, Decl(keyofAndIndexedAccess.ts, 450, 1)) +>M : Symbol(M, Decl(keyofAndIndexedAccess.ts, 452, 32)) +>MethodDescriptor : Symbol(MethodDescriptor, Decl(keyofAndIndexedAccess.ts, 442, 1)) +>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 452, 60)) +>M : Symbol(M, Decl(keyofAndIndexedAccess.ts, 452, 32)) +>args : Symbol(args, Decl(keyofAndIndexedAccess.ts, 452, 76)) +>M : Symbol(M, Decl(keyofAndIndexedAccess.ts, 452, 32)) +>M : Symbol(M, Decl(keyofAndIndexedAccess.ts, 452, 32)) type SomeMethodDescriptor = { ->SomeMethodDescriptor : Symbol(SomeMethodDescriptor, Decl(keyofAndIndexedAccess.ts, 451, 112)) +>SomeMethodDescriptor : Symbol(SomeMethodDescriptor, Decl(keyofAndIndexedAccess.ts, 452, 112)) name: "someMethod"; ->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 453, 29)) +>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 454, 29)) args: [string, number]; ->args : Symbol(args, Decl(keyofAndIndexedAccess.ts, 454, 20)) +>args : Symbol(args, Decl(keyofAndIndexedAccess.ts, 455, 20)) returnValue: string[]; ->returnValue : Symbol(returnValue, Decl(keyofAndIndexedAccess.ts, 455, 24)) +>returnValue : Symbol(returnValue, Decl(keyofAndIndexedAccess.ts, 456, 24)) } let result = dispatchMethod("someMethod", ["hello", 35]); ->result : Symbol(result, Decl(keyofAndIndexedAccess.ts, 459, 3)) ->dispatchMethod : Symbol(dispatchMethod, Decl(keyofAndIndexedAccess.ts, 449, 1)) ->SomeMethodDescriptor : Symbol(SomeMethodDescriptor, Decl(keyofAndIndexedAccess.ts, 451, 112)) +>result : Symbol(result, Decl(keyofAndIndexedAccess.ts, 460, 3)) +>dispatchMethod : Symbol(dispatchMethod, Decl(keyofAndIndexedAccess.ts, 450, 1)) +>SomeMethodDescriptor : Symbol(SomeMethodDescriptor, Decl(keyofAndIndexedAccess.ts, 452, 112)) // Repro from #13073 type KeyTypes = "a" | "b" ->KeyTypes : Symbol(KeyTypes, Decl(keyofAndIndexedAccess.ts, 459, 79)) +>KeyTypes : Symbol(KeyTypes, Decl(keyofAndIndexedAccess.ts, 460, 79)) let MyThingy: { [key in KeyTypes]: string[] }; ->MyThingy : Symbol(MyThingy, Decl(keyofAndIndexedAccess.ts, 464, 3)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 464, 17)) ->KeyTypes : Symbol(KeyTypes, Decl(keyofAndIndexedAccess.ts, 459, 79)) +>MyThingy : Symbol(MyThingy, Decl(keyofAndIndexedAccess.ts, 465, 3)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 465, 17)) +>KeyTypes : Symbol(KeyTypes, Decl(keyofAndIndexedAccess.ts, 460, 79)) function addToMyThingy(key: S) { ->addToMyThingy : Symbol(addToMyThingy, Decl(keyofAndIndexedAccess.ts, 464, 46)) ->S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 466, 23)) ->KeyTypes : Symbol(KeyTypes, Decl(keyofAndIndexedAccess.ts, 459, 79)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 466, 43)) ->S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 466, 23)) +>addToMyThingy : Symbol(addToMyThingy, Decl(keyofAndIndexedAccess.ts, 465, 46)) +>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 467, 23)) +>KeyTypes : Symbol(KeyTypes, Decl(keyofAndIndexedAccess.ts, 460, 79)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 467, 43)) +>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 467, 23)) MyThingy[key].push("a"); >MyThingy[key].push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) ->MyThingy : Symbol(MyThingy, Decl(keyofAndIndexedAccess.ts, 464, 3)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 466, 43)) +>MyThingy : Symbol(MyThingy, Decl(keyofAndIndexedAccess.ts, 465, 3)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 467, 43)) >push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) } // Repro from #13102 type Handler = { ->Handler : Symbol(Handler, Decl(keyofAndIndexedAccess.ts, 468, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 472, 13)) +>Handler : Symbol(Handler, Decl(keyofAndIndexedAccess.ts, 469, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 473, 13)) onChange: (name: keyof T) => void; ->onChange : Symbol(onChange, Decl(keyofAndIndexedAccess.ts, 472, 19)) ->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 473, 15)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 472, 13)) +>onChange : Symbol(onChange, Decl(keyofAndIndexedAccess.ts, 473, 19)) +>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 474, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 473, 13)) }; function onChangeGenericFunction(handler: Handler) { ->onChangeGenericFunction : Symbol(onChangeGenericFunction, Decl(keyofAndIndexedAccess.ts, 474, 2)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 476, 33)) ->handler : Symbol(handler, Decl(keyofAndIndexedAccess.ts, 476, 36)) ->Handler : Symbol(Handler, Decl(keyofAndIndexedAccess.ts, 468, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 476, 33)) ->preset : Symbol(preset, Decl(keyofAndIndexedAccess.ts, 476, 58)) +>onChangeGenericFunction : Symbol(onChangeGenericFunction, Decl(keyofAndIndexedAccess.ts, 475, 2)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 477, 33)) +>handler : Symbol(handler, Decl(keyofAndIndexedAccess.ts, 477, 36)) +>Handler : Symbol(Handler, Decl(keyofAndIndexedAccess.ts, 469, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 477, 33)) +>preset : Symbol(preset, Decl(keyofAndIndexedAccess.ts, 477, 58)) handler.onChange('preset') ->handler.onChange : Symbol(onChange, Decl(keyofAndIndexedAccess.ts, 472, 19)) ->handler : Symbol(handler, Decl(keyofAndIndexedAccess.ts, 476, 36)) ->onChange : Symbol(onChange, Decl(keyofAndIndexedAccess.ts, 472, 19)) +>handler.onChange : Symbol(onChange, Decl(keyofAndIndexedAccess.ts, 473, 19)) +>handler : Symbol(handler, Decl(keyofAndIndexedAccess.ts, 477, 36)) +>onChange : Symbol(onChange, Decl(keyofAndIndexedAccess.ts, 473, 19)) } // Repro from #13285 function updateIds, K extends string>( ->updateIds : Symbol(updateIds, Decl(keyofAndIndexedAccess.ts, 478, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 482, 19)) +>updateIds : Symbol(updateIds, Decl(keyofAndIndexedAccess.ts, 479, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 483, 19)) >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 483, 47)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 483, 47)) obj: T, ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 482, 66)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 482, 19)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 483, 66)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 483, 19)) idFields: K[], ->idFields : Symbol(idFields, Decl(keyofAndIndexedAccess.ts, 483, 11)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) +>idFields : Symbol(idFields, Decl(keyofAndIndexedAccess.ts, 484, 11)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 483, 47)) idMapping: Partial> ->idMapping : Symbol(idMapping, Decl(keyofAndIndexedAccess.ts, 484, 18)) +>idMapping : Symbol(idMapping, Decl(keyofAndIndexedAccess.ts, 485, 18)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 482, 19)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 482, 19)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 483, 19)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 483, 47)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 483, 19)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 483, 47)) ): Record { >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 483, 47)) for (const idField of idFields) { ->idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 487, 14)) ->idFields : Symbol(idFields, Decl(keyofAndIndexedAccess.ts, 483, 11)) +>idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 488, 14)) +>idFields : Symbol(idFields, Decl(keyofAndIndexedAccess.ts, 484, 11)) const newId: T[K] | undefined = idMapping[obj[idField]]; ->newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 488, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 482, 19)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) ->idMapping : Symbol(idMapping, Decl(keyofAndIndexedAccess.ts, 484, 18)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 482, 66)) ->idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 487, 14)) +>newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 489, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 483, 19)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 483, 47)) +>idMapping : Symbol(idMapping, Decl(keyofAndIndexedAccess.ts, 485, 18)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 483, 66)) +>idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 488, 14)) if (newId) { ->newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 488, 13)) +>newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 489, 13)) obj[idField] = newId; ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 482, 66)) ->idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 487, 14)) ->newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 488, 13)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 483, 66)) +>idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 488, 14)) +>newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 489, 13)) } } return obj; ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 482, 66)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 483, 66)) } // Repro from #13285 function updateIds2( ->updateIds2 : Symbol(updateIds2, Decl(keyofAndIndexedAccess.ts, 494, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 498, 20)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 498, 33)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 498, 54)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 498, 20)) +>updateIds2 : Symbol(updateIds2, Decl(keyofAndIndexedAccess.ts, 495, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 499, 20)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 499, 33)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 499, 54)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 499, 20)) obj: T, ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 498, 74)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 498, 20)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 499, 74)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 499, 20)) key: K, ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 499, 11)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 498, 54)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 500, 11)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 499, 54)) stringMap: { [oldId: string]: string } ->stringMap : Symbol(stringMap, Decl(keyofAndIndexedAccess.ts, 500, 11)) ->oldId : Symbol(oldId, Decl(keyofAndIndexedAccess.ts, 501, 18)) +>stringMap : Symbol(stringMap, Decl(keyofAndIndexedAccess.ts, 501, 11)) +>oldId : Symbol(oldId, Decl(keyofAndIndexedAccess.ts, 502, 18)) ) { var x = obj[key]; ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 503, 7)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 498, 74)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 499, 11)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 504, 7)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 499, 74)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 500, 11)) stringMap[x]; // Should be OK. ->stringMap : Symbol(stringMap, Decl(keyofAndIndexedAccess.ts, 500, 11)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 503, 7)) +>stringMap : Symbol(stringMap, Decl(keyofAndIndexedAccess.ts, 501, 11)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 504, 7)) } // Repro from #13514 declare function head>(list: T): T[0]; ->head : Symbol(head, Decl(keyofAndIndexedAccess.ts, 505, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 509, 22)) +>head : Symbol(head, Decl(keyofAndIndexedAccess.ts, 506, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 510, 22)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->list : Symbol(list, Decl(keyofAndIndexedAccess.ts, 509, 44)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 509, 22)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 509, 22)) +>list : Symbol(list, Decl(keyofAndIndexedAccess.ts, 510, 44)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 510, 22)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 510, 22)) // Repro from #13604 class A { ->A : Symbol(A, Decl(keyofAndIndexedAccess.ts, 509, 59)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 513, 8)) +>A : Symbol(A, Decl(keyofAndIndexedAccess.ts, 510, 59)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 514, 8)) props: T & { foo: string }; ->props : Symbol(A.props, Decl(keyofAndIndexedAccess.ts, 513, 12)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 513, 8)) ->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 514, 13)) +>props : Symbol(A.props, Decl(keyofAndIndexedAccess.ts, 514, 12)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 514, 8)) +>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 515, 13)) } class B extends A<{ x: number}> { ->B : Symbol(B, Decl(keyofAndIndexedAccess.ts, 515, 1)) ->A : Symbol(A, Decl(keyofAndIndexedAccess.ts, 509, 59)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 517, 19)) +>B : Symbol(B, Decl(keyofAndIndexedAccess.ts, 516, 1)) +>A : Symbol(A, Decl(keyofAndIndexedAccess.ts, 510, 59)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 518, 19)) f(p: this["props"]) { ->f : Symbol(B.f, Decl(keyofAndIndexedAccess.ts, 517, 33)) ->p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 518, 3)) +>f : Symbol(B.f, Decl(keyofAndIndexedAccess.ts, 518, 33)) +>p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 519, 3)) p.x; ->p.x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 517, 19)) ->p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 518, 3)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 517, 19)) +>p.x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 518, 19)) +>p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 519, 3)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 518, 19)) } } // Repro from #13749 class Form { ->Form : Symbol(Form, Decl(keyofAndIndexedAccess.ts, 521, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 525, 11)) +>Form : Symbol(Form, Decl(keyofAndIndexedAccess.ts, 522, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 526, 11)) private childFormFactories: {[K in keyof T]: (v: T[K]) => Form} ->childFormFactories : Symbol(Form.childFormFactories, Decl(keyofAndIndexedAccess.ts, 525, 15)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 526, 34)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 525, 11)) ->v : Symbol(v, Decl(keyofAndIndexedAccess.ts, 526, 50)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 525, 11)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 526, 34)) ->Form : Symbol(Form, Decl(keyofAndIndexedAccess.ts, 521, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 525, 11)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 526, 34)) +>childFormFactories : Symbol(Form.childFormFactories, Decl(keyofAndIndexedAccess.ts, 526, 15)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 527, 34)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 526, 11)) +>v : Symbol(v, Decl(keyofAndIndexedAccess.ts, 527, 50)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 526, 11)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 527, 34)) +>Form : Symbol(Form, Decl(keyofAndIndexedAccess.ts, 522, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 526, 11)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 527, 34)) public set(prop: K, value: T[K]) { ->set : Symbol(Form.set, Decl(keyofAndIndexedAccess.ts, 526, 73)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 528, 15)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 525, 11)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 528, 34)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 528, 15)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 528, 42)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 525, 11)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 528, 15)) +>set : Symbol(Form.set, Decl(keyofAndIndexedAccess.ts, 527, 73)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 529, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 526, 11)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 529, 34)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 529, 15)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 529, 42)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 526, 11)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 529, 15)) this.childFormFactories[prop](value) ->this.childFormFactories : Symbol(Form.childFormFactories, Decl(keyofAndIndexedAccess.ts, 525, 15)) ->this : Symbol(Form, Decl(keyofAndIndexedAccess.ts, 521, 1)) ->childFormFactories : Symbol(Form.childFormFactories, Decl(keyofAndIndexedAccess.ts, 525, 15)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 528, 34)) ->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 528, 42)) +>this.childFormFactories : Symbol(Form.childFormFactories, Decl(keyofAndIndexedAccess.ts, 526, 15)) +>this : Symbol(Form, Decl(keyofAndIndexedAccess.ts, 522, 1)) +>childFormFactories : Symbol(Form.childFormFactories, Decl(keyofAndIndexedAccess.ts, 526, 15)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 529, 34)) +>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 529, 42)) } } // Repro from #13787 class SampleClass

{ ->SampleClass : Symbol(SampleClass, Decl(keyofAndIndexedAccess.ts, 531, 1)) ->P : Symbol(P, Decl(keyofAndIndexedAccess.ts, 535, 18)) +>SampleClass : Symbol(SampleClass, Decl(keyofAndIndexedAccess.ts, 532, 1)) +>P : Symbol(P, Decl(keyofAndIndexedAccess.ts, 536, 18)) public props: Readonly

; ->props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 535, 22)) +>props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 536, 22)) >Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) ->P : Symbol(P, Decl(keyofAndIndexedAccess.ts, 535, 18)) +>P : Symbol(P, Decl(keyofAndIndexedAccess.ts, 536, 18)) constructor(props: P) { ->props : Symbol(props, Decl(keyofAndIndexedAccess.ts, 537, 16)) ->P : Symbol(P, Decl(keyofAndIndexedAccess.ts, 535, 18)) +>props : Symbol(props, Decl(keyofAndIndexedAccess.ts, 538, 16)) +>P : Symbol(P, Decl(keyofAndIndexedAccess.ts, 536, 18)) this.props = Object.freeze(props); ->this.props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 535, 22)) ->this : Symbol(SampleClass, Decl(keyofAndIndexedAccess.ts, 531, 1)) ->props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 535, 22)) +>this.props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 536, 22)) +>this : Symbol(SampleClass, Decl(keyofAndIndexedAccess.ts, 532, 1)) +>props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 536, 22)) >Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->props : Symbol(props, Decl(keyofAndIndexedAccess.ts, 537, 16)) +>props : Symbol(props, Decl(keyofAndIndexedAccess.ts, 538, 16)) } } interface Foo { ->Foo : Symbol(Foo, Decl(keyofAndIndexedAccess.ts, 540, 1)) +>Foo : Symbol(Foo, Decl(keyofAndIndexedAccess.ts, 541, 1)) foo: string; ->foo : Symbol(Foo.foo, Decl(keyofAndIndexedAccess.ts, 542, 15)) +>foo : Symbol(Foo.foo, Decl(keyofAndIndexedAccess.ts, 543, 15)) } declare function merge(obj1: T, obj2: U): T & U; ->merge : Symbol(merge, Decl(keyofAndIndexedAccess.ts, 544, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 546, 23)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 546, 25)) ->obj1 : Symbol(obj1, Decl(keyofAndIndexedAccess.ts, 546, 29)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 546, 23)) ->obj2 : Symbol(obj2, Decl(keyofAndIndexedAccess.ts, 546, 37)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 546, 25)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 546, 23)) ->U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 546, 25)) +>merge : Symbol(merge, Decl(keyofAndIndexedAccess.ts, 545, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 547, 23)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 547, 25)) +>obj1 : Symbol(obj1, Decl(keyofAndIndexedAccess.ts, 547, 29)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 547, 23)) +>obj2 : Symbol(obj2, Decl(keyofAndIndexedAccess.ts, 547, 37)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 547, 25)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 547, 23)) +>U : Symbol(U, Decl(keyofAndIndexedAccess.ts, 547, 25)) class AnotherSampleClass extends SampleClass { ->AnotherSampleClass : Symbol(AnotherSampleClass, Decl(keyofAndIndexedAccess.ts, 546, 54)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 548, 25)) ->SampleClass : Symbol(SampleClass, Decl(keyofAndIndexedAccess.ts, 531, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 548, 25)) ->Foo : Symbol(Foo, Decl(keyofAndIndexedAccess.ts, 540, 1)) +>AnotherSampleClass : Symbol(AnotherSampleClass, Decl(keyofAndIndexedAccess.ts, 547, 54)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 549, 25)) +>SampleClass : Symbol(SampleClass, Decl(keyofAndIndexedAccess.ts, 532, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 549, 25)) +>Foo : Symbol(Foo, Decl(keyofAndIndexedAccess.ts, 541, 1)) constructor(props: T) { ->props : Symbol(props, Decl(keyofAndIndexedAccess.ts, 549, 16)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 548, 25)) +>props : Symbol(props, Decl(keyofAndIndexedAccess.ts, 550, 16)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 549, 25)) const foo: Foo = { foo: "bar" }; ->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 550, 13)) ->Foo : Symbol(Foo, Decl(keyofAndIndexedAccess.ts, 540, 1)) ->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 550, 26)) +>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 551, 13)) +>Foo : Symbol(Foo, Decl(keyofAndIndexedAccess.ts, 541, 1)) +>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 551, 26)) super(merge(props, foo)); ->super : Symbol(SampleClass, Decl(keyofAndIndexedAccess.ts, 531, 1)) ->merge : Symbol(merge, Decl(keyofAndIndexedAccess.ts, 544, 1)) ->props : Symbol(props, Decl(keyofAndIndexedAccess.ts, 549, 16)) ->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 550, 13)) +>super : Symbol(SampleClass, Decl(keyofAndIndexedAccess.ts, 532, 1)) +>merge : Symbol(merge, Decl(keyofAndIndexedAccess.ts, 545, 1)) +>props : Symbol(props, Decl(keyofAndIndexedAccess.ts, 550, 16)) +>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 551, 13)) } public brokenMethod() { ->brokenMethod : Symbol(AnotherSampleClass.brokenMethod, Decl(keyofAndIndexedAccess.ts, 552, 5)) +>brokenMethod : Symbol(AnotherSampleClass.brokenMethod, Decl(keyofAndIndexedAccess.ts, 553, 5)) this.props.foo.concat; >this.props.foo.concat : Symbol(String.concat, Decl(lib.es5.d.ts, --, --)) ->this.props.foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 542, 15)) ->this.props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 535, 22)) ->this : Symbol(AnotherSampleClass, Decl(keyofAndIndexedAccess.ts, 546, 54)) ->props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 535, 22)) ->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 542, 15)) +>this.props.foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 543, 15)) +>this.props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 536, 22)) +>this : Symbol(AnotherSampleClass, Decl(keyofAndIndexedAccess.ts, 547, 54)) +>props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 536, 22)) +>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 543, 15)) >concat : Symbol(String.concat, Decl(lib.es5.d.ts, --, --)) } } new AnotherSampleClass({}); ->AnotherSampleClass : Symbol(AnotherSampleClass, Decl(keyofAndIndexedAccess.ts, 546, 54)) +>AnotherSampleClass : Symbol(AnotherSampleClass, Decl(keyofAndIndexedAccess.ts, 547, 54)) // Positive repro from #17166 function f3>(t: T, k: K, tk: T[K]): void { ->f3 : Symbol(f3, Decl(keyofAndIndexedAccess.ts, 558, 27)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 561, 12)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 561, 14)) +>f3 : Symbol(f3, Decl(keyofAndIndexedAccess.ts, 559, 27)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 562, 12)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 562, 14)) >Extract : Symbol(Extract, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 561, 12)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 561, 51)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 561, 12)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 561, 56)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 561, 14)) ->tk : Symbol(tk, Decl(keyofAndIndexedAccess.ts, 561, 62)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 561, 12)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 561, 14)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 562, 12)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 562, 51)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 562, 12)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 562, 56)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 562, 14)) +>tk : Symbol(tk, Decl(keyofAndIndexedAccess.ts, 562, 62)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 562, 12)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 562, 14)) for (let key in t) { ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 562, 12)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 561, 51)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 563, 12)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 562, 51)) key = k // ok, K ==> keyof T ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 562, 12)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 561, 56)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 563, 12)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 562, 56)) t[key] = tk; // ok, T[K] ==> T[keyof T] ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 561, 51)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 562, 12)) ->tk : Symbol(tk, Decl(keyofAndIndexedAccess.ts, 561, 62)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 562, 51)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 563, 12)) +>tk : Symbol(tk, Decl(keyofAndIndexedAccess.ts, 562, 62)) } } // # 21185 type Predicates = { ->Predicates : Symbol(Predicates, Decl(keyofAndIndexedAccess.ts, 566, 1)) ->TaggedRecord : Symbol(TaggedRecord, Decl(keyofAndIndexedAccess.ts, 569, 16)) +>Predicates : Symbol(Predicates, Decl(keyofAndIndexedAccess.ts, 567, 1)) +>TaggedRecord : Symbol(TaggedRecord, Decl(keyofAndIndexedAccess.ts, 570, 16)) [T in keyof TaggedRecord]: (variant: TaggedRecord[keyof TaggedRecord]) => variant is TaggedRecord[T] ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 570, 3)) ->TaggedRecord : Symbol(TaggedRecord, Decl(keyofAndIndexedAccess.ts, 569, 16)) ->variant : Symbol(variant, Decl(keyofAndIndexedAccess.ts, 570, 30)) ->TaggedRecord : Symbol(TaggedRecord, Decl(keyofAndIndexedAccess.ts, 569, 16)) ->TaggedRecord : Symbol(TaggedRecord, Decl(keyofAndIndexedAccess.ts, 569, 16)) ->variant : Symbol(variant, Decl(keyofAndIndexedAccess.ts, 570, 30)) ->TaggedRecord : Symbol(TaggedRecord, Decl(keyofAndIndexedAccess.ts, 569, 16)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 570, 3)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 571, 3)) +>TaggedRecord : Symbol(TaggedRecord, Decl(keyofAndIndexedAccess.ts, 570, 16)) +>variant : Symbol(variant, Decl(keyofAndIndexedAccess.ts, 571, 30)) +>TaggedRecord : Symbol(TaggedRecord, Decl(keyofAndIndexedAccess.ts, 570, 16)) +>TaggedRecord : Symbol(TaggedRecord, Decl(keyofAndIndexedAccess.ts, 570, 16)) +>variant : Symbol(variant, Decl(keyofAndIndexedAccess.ts, 571, 30)) +>TaggedRecord : Symbol(TaggedRecord, Decl(keyofAndIndexedAccess.ts, 570, 16)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 571, 3)) } // Repros from #23592 type Example = { [K in keyof T]: T[K]["prop"] }; ->Example : Symbol(Example, Decl(keyofAndIndexedAccess.ts, 571, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 575, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 575, 26)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 575, 13)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 575, 42)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 575, 63)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 575, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 575, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 575, 63)) +>Example : Symbol(Example, Decl(keyofAndIndexedAccess.ts, 572, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 576, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 576, 26)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 576, 13)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 576, 42)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 576, 63)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 576, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 576, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 576, 63)) type Result = Example<{ a: { prop: string }; b: { prop: number } }>; ->Result : Symbol(Result, Decl(keyofAndIndexedAccess.ts, 575, 93)) ->Example : Symbol(Example, Decl(keyofAndIndexedAccess.ts, 571, 1)) ->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 576, 23)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 576, 28)) ->b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 576, 44)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 576, 49)) +>Result : Symbol(Result, Decl(keyofAndIndexedAccess.ts, 576, 93)) +>Example : Symbol(Example, Decl(keyofAndIndexedAccess.ts, 572, 1)) +>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 577, 23)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 577, 28)) +>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 577, 44)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 577, 49)) type Helper2 = { [K in keyof T]: Extract }; ->Helper2 : Symbol(Helper2, Decl(keyofAndIndexedAccess.ts, 576, 68)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 578, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 578, 21)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 578, 13)) +>Helper2 : Symbol(Helper2, Decl(keyofAndIndexedAccess.ts, 577, 68)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 579, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 579, 21)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 579, 13)) >Extract : Symbol(Extract, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 578, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 578, 21)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 578, 51)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 579, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 579, 21)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 579, 51)) type Example2 = { [K in keyof Helper2]: Helper2[K]["prop"] }; ->Example2 : Symbol(Example2, Decl(keyofAndIndexedAccess.ts, 578, 67)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 579, 14)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 579, 22)) ->Helper2 : Symbol(Helper2, Decl(keyofAndIndexedAccess.ts, 576, 68)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 579, 14)) ->Helper2 : Symbol(Helper2, Decl(keyofAndIndexedAccess.ts, 576, 68)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 579, 14)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 579, 22)) +>Example2 : Symbol(Example2, Decl(keyofAndIndexedAccess.ts, 579, 67)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 580, 14)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 580, 22)) +>Helper2 : Symbol(Helper2, Decl(keyofAndIndexedAccess.ts, 577, 68)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 580, 14)) +>Helper2 : Symbol(Helper2, Decl(keyofAndIndexedAccess.ts, 577, 68)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 580, 14)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 580, 22)) type Result2 = Example2<{ 1: { prop: string }; 2: { prop: number } }>; ->Result2 : Symbol(Result2, Decl(keyofAndIndexedAccess.ts, 579, 70)) ->Example2 : Symbol(Example2, Decl(keyofAndIndexedAccess.ts, 578, 67)) ->1 : Symbol(1, Decl(keyofAndIndexedAccess.ts, 580, 25)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 580, 30)) ->2 : Symbol(2, Decl(keyofAndIndexedAccess.ts, 580, 46)) ->prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 580, 51)) +>Result2 : Symbol(Result2, Decl(keyofAndIndexedAccess.ts, 580, 70)) +>Example2 : Symbol(Example2, Decl(keyofAndIndexedAccess.ts, 579, 67)) +>1 : Symbol(1, Decl(keyofAndIndexedAccess.ts, 581, 25)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 581, 30)) +>2 : Symbol(2, Decl(keyofAndIndexedAccess.ts, 581, 46)) +>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 581, 51)) // Repro from #23618 type DBBoolTable = { [k in K]: 0 | 1 } ->DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 580, 70)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 584, 17)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 584, 40)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 584, 17)) +>DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 581, 70)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 585, 17)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 585, 40)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 585, 17)) enum Flag { ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 584, 56)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 585, 56)) FLAG_1 = "flag_1", ->FLAG_1 : Symbol(Flag.FLAG_1, Decl(keyofAndIndexedAccess.ts, 585, 11)) +>FLAG_1 : Symbol(Flag.FLAG_1, Decl(keyofAndIndexedAccess.ts, 586, 11)) FLAG_2 = "flag_2" ->FLAG_2 : Symbol(Flag.FLAG_2, Decl(keyofAndIndexedAccess.ts, 586, 22)) +>FLAG_2 : Symbol(Flag.FLAG_2, Decl(keyofAndIndexedAccess.ts, 587, 22)) } type SimpleDBRecord = { staticField: number } & DBBoolTable ->SimpleDBRecord : Symbol(SimpleDBRecord, Decl(keyofAndIndexedAccess.ts, 588, 1)) ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 590, 20)) ->staticField : Symbol(staticField, Decl(keyofAndIndexedAccess.ts, 590, 44)) ->DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 580, 70)) ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 590, 20)) +>SimpleDBRecord : Symbol(SimpleDBRecord, Decl(keyofAndIndexedAccess.ts, 589, 1)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 591, 20)) +>staticField : Symbol(staticField, Decl(keyofAndIndexedAccess.ts, 591, 44)) +>DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 581, 70)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 591, 20)) function getFlagsFromSimpleRecord(record: SimpleDBRecord, flags: Flag[]) { ->getFlagsFromSimpleRecord : Symbol(getFlagsFromSimpleRecord, Decl(keyofAndIndexedAccess.ts, 590, 86)) ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 591, 34)) ->record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 591, 55)) ->SimpleDBRecord : Symbol(SimpleDBRecord, Decl(keyofAndIndexedAccess.ts, 588, 1)) ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 591, 34)) ->flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 591, 84)) ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 591, 34)) +>getFlagsFromSimpleRecord : Symbol(getFlagsFromSimpleRecord, Decl(keyofAndIndexedAccess.ts, 591, 86)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 592, 34)) +>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 592, 55)) +>SimpleDBRecord : Symbol(SimpleDBRecord, Decl(keyofAndIndexedAccess.ts, 589, 1)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 592, 34)) +>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 592, 84)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 592, 34)) return record[flags[0]]; ->record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 591, 55)) ->flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 591, 84)) +>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 592, 55)) +>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 592, 84)) } type DynamicDBRecord = ({ dynamicField: number } | { dynamicField: string }) & DBBoolTable ->DynamicDBRecord : Symbol(DynamicDBRecord, Decl(keyofAndIndexedAccess.ts, 593, 1)) ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 595, 21)) ->dynamicField : Symbol(dynamicField, Decl(keyofAndIndexedAccess.ts, 595, 46)) ->dynamicField : Symbol(dynamicField, Decl(keyofAndIndexedAccess.ts, 595, 73)) ->DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 580, 70)) ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 595, 21)) +>DynamicDBRecord : Symbol(DynamicDBRecord, Decl(keyofAndIndexedAccess.ts, 594, 1)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 596, 21)) +>dynamicField : Symbol(dynamicField, Decl(keyofAndIndexedAccess.ts, 596, 46)) +>dynamicField : Symbol(dynamicField, Decl(keyofAndIndexedAccess.ts, 596, 73)) +>DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 581, 70)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 596, 21)) function getFlagsFromDynamicRecord(record: DynamicDBRecord, flags: Flag[]) { ->getFlagsFromDynamicRecord : Symbol(getFlagsFromDynamicRecord, Decl(keyofAndIndexedAccess.ts, 595, 117)) ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 596, 35)) ->record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 596, 56)) ->DynamicDBRecord : Symbol(DynamicDBRecord, Decl(keyofAndIndexedAccess.ts, 593, 1)) ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 596, 35)) ->flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 596, 86)) ->Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 596, 35)) +>getFlagsFromDynamicRecord : Symbol(getFlagsFromDynamicRecord, Decl(keyofAndIndexedAccess.ts, 596, 117)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 597, 35)) +>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 597, 56)) +>DynamicDBRecord : Symbol(DynamicDBRecord, Decl(keyofAndIndexedAccess.ts, 594, 1)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 597, 35)) +>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 597, 86)) +>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 597, 35)) return record[flags[0]]; ->record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 596, 56)) ->flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 596, 86)) +>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 597, 56)) +>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 597, 86)) } // Repro from #21368 interface I { ->I : Symbol(I, Decl(keyofAndIndexedAccess.ts, 598, 1)) +>I : Symbol(I, Decl(keyofAndIndexedAccess.ts, 599, 1)) foo: string; ->foo : Symbol(I.foo, Decl(keyofAndIndexedAccess.ts, 602, 13)) +>foo : Symbol(I.foo, Decl(keyofAndIndexedAccess.ts, 603, 13)) } declare function take(p: T): void; ->take : Symbol(take, Decl(keyofAndIndexedAccess.ts, 604, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 606, 22)) ->p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 606, 25)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 606, 22)) +>take : Symbol(take, Decl(keyofAndIndexedAccess.ts, 605, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 607, 22)) +>p : Symbol(p, Decl(keyofAndIndexedAccess.ts, 607, 25)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 607, 22)) function fn(o: T, k: K) { ->fn : Symbol(fn, Decl(keyofAndIndexedAccess.ts, 606, 37)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 608, 12)) ->I : Symbol(I, Decl(keyofAndIndexedAccess.ts, 598, 1)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 608, 24)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 608, 12)) ->o : Symbol(o, Decl(keyofAndIndexedAccess.ts, 608, 44)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 608, 12)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 608, 49)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 608, 24)) +>fn : Symbol(fn, Decl(keyofAndIndexedAccess.ts, 607, 37)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 609, 12)) +>I : Symbol(I, Decl(keyofAndIndexedAccess.ts, 599, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 609, 24)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 609, 12)) +>o : Symbol(o, Decl(keyofAndIndexedAccess.ts, 609, 44)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 609, 12)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 609, 49)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 609, 24)) take<{} | null | undefined>(o[k]); ->take : Symbol(take, Decl(keyofAndIndexedAccess.ts, 604, 1)) ->o : Symbol(o, Decl(keyofAndIndexedAccess.ts, 608, 44)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 608, 49)) +>take : Symbol(take, Decl(keyofAndIndexedAccess.ts, 605, 1)) +>o : Symbol(o, Decl(keyofAndIndexedAccess.ts, 609, 44)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 609, 49)) take(o[k]); ->take : Symbol(take, Decl(keyofAndIndexedAccess.ts, 604, 1)) ->o : Symbol(o, Decl(keyofAndIndexedAccess.ts, 608, 44)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 608, 49)) +>take : Symbol(take, Decl(keyofAndIndexedAccess.ts, 605, 1)) +>o : Symbol(o, Decl(keyofAndIndexedAccess.ts, 609, 44)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 609, 49)) } // Repro from #23133 class Unbounded { ->Unbounded : Symbol(Unbounded, Decl(keyofAndIndexedAccess.ts, 611, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 615, 16)) +>Unbounded : Symbol(Unbounded, Decl(keyofAndIndexedAccess.ts, 612, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 616, 16)) foo(x: T[keyof T]) { ->foo : Symbol(Unbounded.foo, Decl(keyofAndIndexedAccess.ts, 615, 20)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 616, 8)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 615, 16)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 615, 16)) +>foo : Symbol(Unbounded.foo, Decl(keyofAndIndexedAccess.ts, 616, 20)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 617, 8)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 616, 16)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 616, 16)) let y: {} | undefined | null = x; ->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 617, 11)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 616, 8)) +>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 618, 11)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 617, 8)) } } // Repro from #23940 interface I7 { ->I7 : Symbol(I7, Decl(keyofAndIndexedAccess.ts, 619, 1)) +>I7 : Symbol(I7, Decl(keyofAndIndexedAccess.ts, 620, 1)) x: any; ->x : Symbol(I7.x, Decl(keyofAndIndexedAccess.ts, 623, 14)) +>x : Symbol(I7.x, Decl(keyofAndIndexedAccess.ts, 624, 14)) } type Foo7 = T; ->Foo7 : Symbol(Foo7, Decl(keyofAndIndexedAccess.ts, 625, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 626, 10)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 626, 10)) +>Foo7 : Symbol(Foo7, Decl(keyofAndIndexedAccess.ts, 626, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 627, 10)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 627, 10)) declare function f7(type: K): Foo7; ->f7 : Symbol(f7, Decl(keyofAndIndexedAccess.ts, 626, 32)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 627, 20)) ->I7 : Symbol(I7, Decl(keyofAndIndexedAccess.ts, 619, 1)) ->type : Symbol(type, Decl(keyofAndIndexedAccess.ts, 627, 40)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 627, 20)) ->Foo7 : Symbol(Foo7, Decl(keyofAndIndexedAccess.ts, 625, 1)) ->I7 : Symbol(I7, Decl(keyofAndIndexedAccess.ts, 619, 1)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 627, 20)) +>f7 : Symbol(f7, Decl(keyofAndIndexedAccess.ts, 627, 32)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 628, 20)) +>I7 : Symbol(I7, Decl(keyofAndIndexedAccess.ts, 620, 1)) +>type : Symbol(type, Decl(keyofAndIndexedAccess.ts, 628, 40)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 628, 20)) +>Foo7 : Symbol(Foo7, Decl(keyofAndIndexedAccess.ts, 626, 1)) +>I7 : Symbol(I7, Decl(keyofAndIndexedAccess.ts, 620, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 628, 20)) // Repro from #21770 type Dict = { [key in T]: number }; ->Dict : Symbol(Dict, Decl(keyofAndIndexedAccess.ts, 627, 62)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 631, 10)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 631, 33)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 631, 10)) +>Dict : Symbol(Dict, Decl(keyofAndIndexedAccess.ts, 628, 62)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 632, 10)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 632, 33)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 632, 10)) type DictDict = { [key in V]: Dict }; ->DictDict : Symbol(DictDict, Decl(keyofAndIndexedAccess.ts, 631, 53)) ->V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 632, 14)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 632, 31)) ->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 632, 55)) ->V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 632, 14)) ->Dict : Symbol(Dict, Decl(keyofAndIndexedAccess.ts, 627, 62)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 632, 31)) +>DictDict : Symbol(DictDict, Decl(keyofAndIndexedAccess.ts, 632, 53)) +>V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 633, 14)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 633, 31)) +>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 633, 55)) +>V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 633, 14)) +>Dict : Symbol(Dict, Decl(keyofAndIndexedAccess.ts, 628, 62)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 633, 31)) function ff1(dd: DictDict, k1: V, k2: T): number { ->ff1 : Symbol(ff1, Decl(keyofAndIndexedAccess.ts, 632, 76)) ->V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 634, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 634, 30)) ->dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 634, 49)) ->DictDict : Symbol(DictDict, Decl(keyofAndIndexedAccess.ts, 631, 53)) ->V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 634, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 634, 30)) ->k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 634, 68)) ->V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 634, 13)) ->k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 634, 75)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 634, 30)) +>ff1 : Symbol(ff1, Decl(keyofAndIndexedAccess.ts, 633, 76)) +>V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 635, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 635, 30)) +>dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 635, 49)) +>DictDict : Symbol(DictDict, Decl(keyofAndIndexedAccess.ts, 632, 53)) +>V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 635, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 635, 30)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 635, 68)) +>V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 635, 13)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 635, 75)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 635, 30)) return dd[k1][k2]; ->dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 634, 49)) ->k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 634, 68)) ->k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 634, 75)) +>dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 635, 49)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 635, 68)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 635, 75)) } function ff2(dd: DictDict, k1: V, k2: T): number { ->ff2 : Symbol(ff2, Decl(keyofAndIndexedAccess.ts, 636, 1)) ->V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 638, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 638, 30)) ->dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 638, 49)) ->DictDict : Symbol(DictDict, Decl(keyofAndIndexedAccess.ts, 631, 53)) ->V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 638, 13)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 638, 30)) ->k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 638, 68)) ->V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 638, 13)) ->k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 638, 75)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 638, 30)) +>ff2 : Symbol(ff2, Decl(keyofAndIndexedAccess.ts, 637, 1)) +>V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 639, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 639, 30)) +>dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 639, 49)) +>DictDict : Symbol(DictDict, Decl(keyofAndIndexedAccess.ts, 632, 53)) +>V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 639, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 639, 30)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 639, 68)) +>V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 639, 13)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 639, 75)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 639, 30)) const d: Dict = dd[k1]; ->d : Symbol(d, Decl(keyofAndIndexedAccess.ts, 639, 9)) ->Dict : Symbol(Dict, Decl(keyofAndIndexedAccess.ts, 627, 62)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 638, 30)) ->dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 638, 49)) ->k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 638, 68)) +>d : Symbol(d, Decl(keyofAndIndexedAccess.ts, 640, 9)) +>Dict : Symbol(Dict, Decl(keyofAndIndexedAccess.ts, 628, 62)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 639, 30)) +>dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 639, 49)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 639, 68)) return d[k2]; ->d : Symbol(d, Decl(keyofAndIndexedAccess.ts, 639, 9)) ->k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 638, 75)) +>d : Symbol(d, Decl(keyofAndIndexedAccess.ts, 640, 9)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 639, 75)) } // Repro from #26409 const cf1 = (t: T, k: K) => ->cf1 : Symbol(cf1, Decl(keyofAndIndexedAccess.ts, 645, 5)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 645, 13)) ->P : Symbol(P, Decl(keyofAndIndexedAccess.ts, 645, 26)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 645, 65)) ->cool : Symbol(cool, Decl(keyofAndIndexedAccess.ts, 645, 48)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 645, 65)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 645, 13)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 645, 85)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 645, 13)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 645, 90)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 645, 65)) +>cf1 : Symbol(cf1, Decl(keyofAndIndexedAccess.ts, 646, 5)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 646, 13)) +>P : Symbol(P, Decl(keyofAndIndexedAccess.ts, 646, 26)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 646, 65)) +>cool : Symbol(cool, Decl(keyofAndIndexedAccess.ts, 646, 48)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 646, 65)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 646, 13)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 646, 85)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 646, 13)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 646, 90)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 646, 65)) { const s: string = t[k]; ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 647, 9)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 645, 85)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 645, 90)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 648, 9)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 646, 85)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 646, 90)) t.cool; ->t.cool : Symbol(cool, Decl(keyofAndIndexedAccess.ts, 645, 48)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 645, 85)) ->cool : Symbol(cool, Decl(keyofAndIndexedAccess.ts, 645, 48)) +>t.cool : Symbol(cool, Decl(keyofAndIndexedAccess.ts, 646, 48)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 646, 85)) +>cool : Symbol(cool, Decl(keyofAndIndexedAccess.ts, 646, 48)) }; const cf2 = (t: T, k: K) => ->cf2 : Symbol(cf2, Decl(keyofAndIndexedAccess.ts, 651, 5)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 651, 13)) ->P : Symbol(P, Decl(keyofAndIndexedAccess.ts, 651, 26)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 651, 54)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 651, 54)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 651, 13)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 651, 74)) ->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 651, 13)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 651, 79)) ->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 651, 54)) +>cf2 : Symbol(cf2, Decl(keyofAndIndexedAccess.ts, 652, 5)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 652, 13)) +>P : Symbol(P, Decl(keyofAndIndexedAccess.ts, 652, 26)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 652, 54)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 652, 54)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 652, 13)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 652, 74)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 652, 13)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 652, 79)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 652, 54)) { const s: string = t[k]; ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 653, 9)) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 651, 74)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 651, 79)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 654, 9)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 652, 74)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 652, 79)) t.cool; >t.cool : Symbol(cool) ->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 651, 74)) +>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 652, 74)) >cool : Symbol(cool) }; diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index e30aa81a79092..f39ca3c63d194 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -76,8 +76,11 @@ type K06 = keyof null; // never >K06 : never >null : null -type K07 = keyof never; // never ->K07 : never +type K07 = keyof never; // string | number | symbol +>K07 : string | number | symbol + +type K08 = keyof unknown; // never +>K08 : never type K10 = keyof Shape; // "name" | "width" | "height" | "visible" >K10 : "name" | "width" | "height" | "visible" @@ -1794,7 +1797,7 @@ function updateIds2( >key : K stringMap[x]; // Should be OK. ->stringMap[x] : { [oldId: string]: string; }[T[K]] +>stringMap[x] : string >stringMap : { [oldId: string]: string; } >x : T[K] } diff --git a/tests/baselines/reference/keyofAndIndexedAccess2.errors.txt b/tests/baselines/reference/keyofAndIndexedAccess2.errors.txt new file mode 100644 index 0000000000000..6e1b87a72e38d --- /dev/null +++ b/tests/baselines/reference/keyofAndIndexedAccess2.errors.txt @@ -0,0 +1,190 @@ +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(4,5): error TS2322: Type '"x"' is not assignable to type 'number'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(6,5): error TS2322: Type '2' is not assignable to type '0 | 1'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(7,5): error TS2322: Type '"x"' is not assignable to type '0 | 1'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(8,5): error TS2322: Type '1' is not assignable to type 'never'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(9,5): error TS2322: Type '2' is not assignable to type 'never'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(10,5): error TS2322: Type '"x"' is not assignable to type 'never'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(14,5): error TS2739: Type '{ [key: string]: number; }' is missing the following properties from type '{ x: number; y: number; }': x, y +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(15,5): error TS2322: Type 'T' is not assignable to type '{ x: number; y: number; }'. + Type '{ [key: string]: number; }' is missing the following properties from type '{ x: number; y: number; }': x, y +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(18,5): error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'T'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(19,5): error TS2322: Type '{ [key: string]: number; }' is not assignable to type 'T'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(26,7): error TS2339: Property 'x' does not exist on type 'T'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(27,5): error TS2322: Type '1' is not assignable to type 'T[keyof T]'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(31,5): error TS2322: Type '{ [key: string]: number; }' is not assignable to type '{ [P in K]: number; }'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(38,5): error TS2322: Type '{ [x: string]: number; }' is not assignable to type '{ [P in K]: number; }'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(50,3): error TS7017: Element implicitly has an 'any' type because type 'Item' has no index signature. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(51,3): error TS2322: Type '123' is not assignable to type 'string & number'. + Type '123' is not assignable to type 'string'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(52,3): error TS2322: Type '123' is not assignable to type 'T[keyof T]'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(53,3): error TS2322: Type '123' is not assignable to type 'T[K]'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(65,7): error TS2339: Property 'foo' does not exist on type 'T'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(66,3): error TS2536: Type 'string' cannot be used to index type 'T'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(67,3): error TS2322: Type '123' is not assignable to type 'T[keyof T]'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(68,3): error TS2322: Type '123' is not assignable to type 'T[K]'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(108,5): error TS2322: Type '123' is not assignable to type 'Type[K]'. + Type '123' is not assignable to type '123 & "some string"'. + Type '123' is not assignable to type '"some string"'. + + +==== tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts (23 errors) ==== + function f1(obj: { a: number, b: 0 | 1, c: string }, k0: 'a', k1: 'a' | 'b', k2: 'a' | 'b' | 'c') { + obj[k0] = 1; + obj[k0] = 2; + obj[k0] = 'x'; // Error + ~~~~~~~ +!!! error TS2322: Type '"x"' is not assignable to type 'number'. + obj[k1] = 1; + obj[k1] = 2; // Error + ~~~~~~~ +!!! error TS2322: Type '2' is not assignable to type '0 | 1'. + obj[k1] = 'x'; // Error + ~~~~~~~ +!!! error TS2322: Type '"x"' is not assignable to type '0 | 1'. + obj[k2] = 1; // Error + ~~~~~~~ +!!! error TS2322: Type '1' is not assignable to type 'never'. + obj[k2] = 2; // Error + ~~~~~~~ +!!! error TS2322: Type '2' is not assignable to type 'never'. + obj[k2] = 'x'; // Error + ~~~~~~~ +!!! error TS2322: Type '"x"' is not assignable to type 'never'. + } + + function f2(a: { x: number, y: number }, b: { [key: string]: number }, c: T, k: keyof T) { + a = b; // Error, index signature in source doesn't imply properties are present + ~ +!!! error TS2739: Type '{ [key: string]: number; }' is missing the following properties from type '{ x: number; y: number; }': x, y + a = c; // Error, index signature in source doesn't imply properties are present + ~ +!!! error TS2322: Type 'T' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2322: Type '{ [key: string]: number; }' is missing the following properties from type '{ x: number; y: number; }': x, y + b = a; + b = c; + c = a; // Error, constraint on target doesn't imply any properties or signatures + ~ +!!! error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'T'. + c = b; // Error, constraint on target doesn't imply any properties or signatures + ~ +!!! error TS2322: Type '{ [key: string]: number; }' is not assignable to type 'T'. + a.x; + b.x; + c.x; + c[k]; + a.x = 1; + b.x = 1; + c.x = 1; // Error, cannot write to index signature through constraint + ~ +!!! error TS2339: Property 'x' does not exist on type 'T'. + c[k] = 1; // Error, cannot write to index signature through constraint + ~~~~ +!!! error TS2322: Type '1' is not assignable to type 'T[keyof T]'. + } + + function f3(a: { [P in K]: number }, b: { [key: string]: number }, k: K) { + a = b; // Error, index signature doesn't imply properties are present + ~ +!!! error TS2322: Type '{ [key: string]: number; }' is not assignable to type '{ [P in K]: number; }'. + b = a; + a[k]; + a[k] = 1; + } + + function f3b(a: { [P in K]: number }, b: { [P in string]: number }, k: K) { + a = b; // Error, index signature doesn't imply properties are present + ~ +!!! error TS2322: Type '{ [x: string]: number; }' is not assignable to type '{ [P in K]: number; }'. + b = a; + } + + function f4(a: { [key: string]: number }[K], b: number) { + a = b; + b = a; + } + + type Item = { a: string, b: number }; + + function f10(obj: T, k1: string, k2: keyof Item, k3: keyof T, k4: K) { + obj[k1] = 123; // Error + ~~~~~~~ +!!! error TS7017: Element implicitly has an 'any' type because type 'Item' has no index signature. + obj[k2] = 123; // Error + ~~~~~~~ +!!! error TS2322: Type '123' is not assignable to type 'string & number'. +!!! error TS2322: Type '123' is not assignable to type 'string'. + obj[k3] = 123; // Error + ~~~~~~~ +!!! error TS2322: Type '123' is not assignable to type 'T[keyof T]'. + obj[k4] = 123; // Error + ~~~~~~~ +!!! error TS2322: Type '123' is not assignable to type 'T[K]'. + } + + type Dict = Record; + + function f11(obj: Dict, k1: keyof Dict, k2: K) { + obj.foo = 123; + obj[k1] = 123; + obj[k2] = 123; + } + + function f12, K extends keyof T>(obj: T, k1: keyof Dict, k2: keyof T, k3: K) { + obj.foo = 123; // Error + ~~~ +!!! error TS2339: Property 'foo' does not exist on type 'T'. + obj[k1] = 123; // Error + ~~~~~~~ +!!! error TS2536: Type 'string' cannot be used to index type 'T'. + obj[k2] = 123; // Error + ~~~~~~~ +!!! error TS2322: Type '123' is not assignable to type 'T[keyof T]'. + obj[k3] = 123; // Error + ~~~~~~~ +!!! error TS2322: Type '123' is not assignable to type 'T[K]'. + } + + // Repro from #27895 + + export interface Entity { + id: number | string; + } + + export type IdOf = E['id']; + + export interface EntityState { + ids: IdOf[]; + entities: { [key: string]: E, [key: number]: E }; + } + + + export function getAllEntities(state: EntityState): E[] { + const { ids, entities } = state; + return ids.map(id => entities[id]); + } + + export function getEntity(id: IdOf, state: EntityState): E | undefined { + const { ids, entities } = state; + + if (!ids.includes(id)) { + return undefined; + } + + return entities[id]; + } + + // Repro from #30603 + + interface Type { + a: 123; + b: "some string"; + } + + function get123(): Type[K] { + return 123; // Error + ~~~~~~~~~~~ +!!! error TS2322: Type '123' is not assignable to type 'Type[K]'. +!!! error TS2322: Type '123' is not assignable to type '123 & "some string"'. +!!! error TS2322: Type '123' is not assignable to type '"some string"'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/keyofAndIndexedAccess2.js b/tests/baselines/reference/keyofAndIndexedAccess2.js new file mode 100644 index 0000000000000..8dad708c2988c --- /dev/null +++ b/tests/baselines/reference/keyofAndIndexedAccess2.js @@ -0,0 +1,185 @@ +//// [keyofAndIndexedAccess2.ts] +function f1(obj: { a: number, b: 0 | 1, c: string }, k0: 'a', k1: 'a' | 'b', k2: 'a' | 'b' | 'c') { + obj[k0] = 1; + obj[k0] = 2; + obj[k0] = 'x'; // Error + obj[k1] = 1; + obj[k1] = 2; // Error + obj[k1] = 'x'; // Error + obj[k2] = 1; // Error + obj[k2] = 2; // Error + obj[k2] = 'x'; // Error +} + +function f2(a: { x: number, y: number }, b: { [key: string]: number }, c: T, k: keyof T) { + a = b; // Error, index signature in source doesn't imply properties are present + a = c; // Error, index signature in source doesn't imply properties are present + b = a; + b = c; + c = a; // Error, constraint on target doesn't imply any properties or signatures + c = b; // Error, constraint on target doesn't imply any properties or signatures + a.x; + b.x; + c.x; + c[k]; + a.x = 1; + b.x = 1; + c.x = 1; // Error, cannot write to index signature through constraint + c[k] = 1; // Error, cannot write to index signature through constraint +} + +function f3(a: { [P in K]: number }, b: { [key: string]: number }, k: K) { + a = b; // Error, index signature doesn't imply properties are present + b = a; + a[k]; + a[k] = 1; +} + +function f3b(a: { [P in K]: number }, b: { [P in string]: number }, k: K) { + a = b; // Error, index signature doesn't imply properties are present + b = a; +} + +function f4(a: { [key: string]: number }[K], b: number) { + a = b; + b = a; +} + +type Item = { a: string, b: number }; + +function f10(obj: T, k1: string, k2: keyof Item, k3: keyof T, k4: K) { + obj[k1] = 123; // Error + obj[k2] = 123; // Error + obj[k3] = 123; // Error + obj[k4] = 123; // Error +} + +type Dict = Record; + +function f11(obj: Dict, k1: keyof Dict, k2: K) { + obj.foo = 123; + obj[k1] = 123; + obj[k2] = 123; +} + +function f12, K extends keyof T>(obj: T, k1: keyof Dict, k2: keyof T, k3: K) { + obj.foo = 123; // Error + obj[k1] = 123; // Error + obj[k2] = 123; // Error + obj[k3] = 123; // Error +} + +// Repro from #27895 + +export interface Entity { + id: number | string; +} + +export type IdOf = E['id']; + +export interface EntityState { + ids: IdOf[]; + entities: { [key: string]: E, [key: number]: E }; +} + + +export function getAllEntities(state: EntityState): E[] { + const { ids, entities } = state; + return ids.map(id => entities[id]); +} + +export function getEntity(id: IdOf, state: EntityState): E | undefined { + const { ids, entities } = state; + + if (!ids.includes(id)) { + return undefined; + } + + return entities[id]; +} + +// Repro from #30603 + +interface Type { + a: 123; + b: "some string"; +} + +function get123(): Type[K] { + return 123; // Error +} + + +//// [keyofAndIndexedAccess2.js] +function f1(obj, k0, k1, k2) { + obj[k0] = 1; + obj[k0] = 2; + obj[k0] = 'x'; // Error + obj[k1] = 1; + obj[k1] = 2; // Error + obj[k1] = 'x'; // Error + obj[k2] = 1; // Error + obj[k2] = 2; // Error + obj[k2] = 'x'; // Error +} +function f2(a, b, c, k) { + a = b; // Error, index signature in source doesn't imply properties are present + a = c; // Error, index signature in source doesn't imply properties are present + b = a; + b = c; + c = a; // Error, constraint on target doesn't imply any properties or signatures + c = b; // Error, constraint on target doesn't imply any properties or signatures + a.x; + b.x; + c.x; + c[k]; + a.x = 1; + b.x = 1; + c.x = 1; // Error, cannot write to index signature through constraint + c[k] = 1; // Error, cannot write to index signature through constraint +} +function f3(a, b, k) { + a = b; // Error, index signature doesn't imply properties are present + b = a; + a[k]; + a[k] = 1; +} +function f3b(a, b, k) { + a = b; // Error, index signature doesn't imply properties are present + b = a; +} +function f4(a, b) { + a = b; + b = a; +} +function f10(obj, k1, k2, k3, k4) { + obj[k1] = 123; // Error + obj[k2] = 123; // Error + obj[k3] = 123; // Error + obj[k4] = 123; // Error +} +function f11(obj, k1, k2) { + obj.foo = 123; + obj[k1] = 123; + obj[k2] = 123; +} +function f12(obj, k1, k2, k3) { + obj.foo = 123; // Error + obj[k1] = 123; // Error + obj[k2] = 123; // Error + obj[k3] = 123; // Error +} +export function getAllEntities(state) { + const { ids, entities } = state; + return ids.map(id => entities[id]); +} +export function getEntity(id, state) { + const { ids, entities } = state; + if (!ids.includes(id)) { + return undefined; + } + return entities[id]; +} +function get123() { + return 123; // Error +} diff --git a/tests/baselines/reference/keyofAndIndexedAccess2.symbols b/tests/baselines/reference/keyofAndIndexedAccess2.symbols new file mode 100644 index 0000000000000..803700efa372a --- /dev/null +++ b/tests/baselines/reference/keyofAndIndexedAccess2.symbols @@ -0,0 +1,390 @@ +=== tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts === +function f1(obj: { a: number, b: 0 | 1, c: string }, k0: 'a', k1: 'a' | 'b', k2: 'a' | 'b' | 'c') { +>f1 : Symbol(f1, Decl(keyofAndIndexedAccess2.ts, 0, 0)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 0, 12)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 0, 18)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 0, 29)) +>c : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 0, 39)) +>k0 : Symbol(k0, Decl(keyofAndIndexedAccess2.ts, 0, 52)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess2.ts, 0, 61)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess2.ts, 0, 76)) + + obj[k0] = 1; +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 0, 12)) +>k0 : Symbol(k0, Decl(keyofAndIndexedAccess2.ts, 0, 52)) + + obj[k0] = 2; +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 0, 12)) +>k0 : Symbol(k0, Decl(keyofAndIndexedAccess2.ts, 0, 52)) + + obj[k0] = 'x'; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 0, 12)) +>k0 : Symbol(k0, Decl(keyofAndIndexedAccess2.ts, 0, 52)) + + obj[k1] = 1; +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 0, 12)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess2.ts, 0, 61)) + + obj[k1] = 2; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 0, 12)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess2.ts, 0, 61)) + + obj[k1] = 'x'; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 0, 12)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess2.ts, 0, 61)) + + obj[k2] = 1; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 0, 12)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess2.ts, 0, 76)) + + obj[k2] = 2; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 0, 12)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess2.ts, 0, 76)) + + obj[k2] = 'x'; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 0, 12)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess2.ts, 0, 76)) +} + +function f2(a: { x: number, y: number }, b: { [key: string]: number }, c: T, k: keyof T) { +>f2 : Symbol(f2, Decl(keyofAndIndexedAccess2.ts, 10, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 12, 12)) +>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 12, 25)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 12, 49)) +>x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 12, 53)) +>y : Symbol(y, Decl(keyofAndIndexedAccess2.ts, 12, 64)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 12, 77)) +>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 12, 84)) +>c : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 12, 107)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 12, 12)) +>k : Symbol(k, Decl(keyofAndIndexedAccess2.ts, 12, 113)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 12, 12)) + + a = b; // Error, index signature in source doesn't imply properties are present +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 12, 49)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 12, 77)) + + a = c; // Error, index signature in source doesn't imply properties are present +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 12, 49)) +>c : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 12, 107)) + + b = a; +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 12, 77)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 12, 49)) + + b = c; +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 12, 77)) +>c : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 12, 107)) + + c = a; // Error, constraint on target doesn't imply any properties or signatures +>c : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 12, 107)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 12, 49)) + + c = b; // Error, constraint on target doesn't imply any properties or signatures +>c : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 12, 107)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 12, 77)) + + a.x; +>a.x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 12, 53)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 12, 49)) +>x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 12, 53)) + + b.x; +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 12, 77)) + + c.x; +>c : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 12, 107)) + + c[k]; +>c : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 12, 107)) +>k : Symbol(k, Decl(keyofAndIndexedAccess2.ts, 12, 113)) + + a.x = 1; +>a.x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 12, 53)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 12, 49)) +>x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 12, 53)) + + b.x = 1; +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 12, 77)) + + c.x = 1; // Error, cannot write to index signature through constraint +>c : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 12, 107)) + + c[k] = 1; // Error, cannot write to index signature through constraint +>c : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 12, 107)) +>k : Symbol(k, Decl(keyofAndIndexedAccess2.ts, 12, 113)) +} + +function f3(a: { [P in K]: number }, b: { [key: string]: number }, k: K) { +>f3 : Symbol(f3, Decl(keyofAndIndexedAccess2.ts, 27, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 29, 12)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 29, 30)) +>P : Symbol(P, Decl(keyofAndIndexedAccess2.ts, 29, 36)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 29, 12)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 29, 54)) +>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 29, 61)) +>k : Symbol(k, Decl(keyofAndIndexedAccess2.ts, 29, 84)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 29, 12)) + + a = b; // Error, index signature doesn't imply properties are present +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 29, 30)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 29, 54)) + + b = a; +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 29, 54)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 29, 30)) + + a[k]; +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 29, 30)) +>k : Symbol(k, Decl(keyofAndIndexedAccess2.ts, 29, 84)) + + a[k] = 1; +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 29, 30)) +>k : Symbol(k, Decl(keyofAndIndexedAccess2.ts, 29, 84)) +} + +function f3b(a: { [P in K]: number }, b: { [P in string]: number }, k: K) { +>f3b : Symbol(f3b, Decl(keyofAndIndexedAccess2.ts, 34, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 36, 13)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 36, 31)) +>P : Symbol(P, Decl(keyofAndIndexedAccess2.ts, 36, 37)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 36, 13)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 36, 55)) +>P : Symbol(P, Decl(keyofAndIndexedAccess2.ts, 36, 62)) +>k : Symbol(k, Decl(keyofAndIndexedAccess2.ts, 36, 85)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 36, 13)) + + a = b; // Error, index signature doesn't imply properties are present +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 36, 31)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 36, 55)) + + b = a; +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 36, 55)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 36, 31)) +} + +function f4(a: { [key: string]: number }[K], b: number) { +>f4 : Symbol(f4, Decl(keyofAndIndexedAccess2.ts, 39, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 41, 12)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 41, 30)) +>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 41, 36)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 41, 12)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 41, 62)) + + a = b; +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 41, 30)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 41, 62)) + + b = a; +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 41, 62)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 41, 30)) +} + +type Item = { a: string, b: number }; +>Item : Symbol(Item, Decl(keyofAndIndexedAccess2.ts, 44, 1)) +>a : Symbol(a, Decl(keyofAndIndexedAccess2.ts, 46, 13)) +>b : Symbol(b, Decl(keyofAndIndexedAccess2.ts, 46, 24)) + +function f10(obj: T, k1: string, k2: keyof Item, k3: keyof T, k4: K) { +>f10 : Symbol(f10, Decl(keyofAndIndexedAccess2.ts, 46, 37)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 48, 13)) +>Item : Symbol(Item, Decl(keyofAndIndexedAccess2.ts, 44, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 48, 28)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 48, 13)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 48, 48)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 48, 13)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess2.ts, 48, 55)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess2.ts, 48, 67)) +>Item : Symbol(Item, Decl(keyofAndIndexedAccess2.ts, 44, 1)) +>k3 : Symbol(k3, Decl(keyofAndIndexedAccess2.ts, 48, 83)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 48, 13)) +>k4 : Symbol(k4, Decl(keyofAndIndexedAccess2.ts, 48, 96)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 48, 28)) + + obj[k1] = 123; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 48, 48)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess2.ts, 48, 55)) + + obj[k2] = 123; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 48, 48)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess2.ts, 48, 67)) + + obj[k3] = 123; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 48, 48)) +>k3 : Symbol(k3, Decl(keyofAndIndexedAccess2.ts, 48, 83)) + + obj[k4] = 123; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 48, 48)) +>k4 : Symbol(k4, Decl(keyofAndIndexedAccess2.ts, 48, 96)) +} + +type Dict = Record; +>Dict : Symbol(Dict, Decl(keyofAndIndexedAccess2.ts, 53, 1)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) + +function f11(obj: Dict, k1: keyof Dict, k2: K) { +>f11 : Symbol(f11, Decl(keyofAndIndexedAccess2.ts, 55, 35)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 57, 13)) +>Dict : Symbol(Dict, Decl(keyofAndIndexedAccess2.ts, 53, 1)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 57, 35)) +>Dict : Symbol(Dict, Decl(keyofAndIndexedAccess2.ts, 53, 1)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess2.ts, 57, 45)) +>Dict : Symbol(Dict, Decl(keyofAndIndexedAccess2.ts, 53, 1)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess2.ts, 57, 61)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 57, 13)) + + obj.foo = 123; +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 57, 35)) + + obj[k1] = 123; +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 57, 35)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess2.ts, 57, 45)) + + obj[k2] = 123; +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 57, 35)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess2.ts, 57, 61)) +} + +function f12, K extends keyof T>(obj: T, k1: keyof Dict, k2: keyof T, k3: K) { +>f12 : Symbol(f12, Decl(keyofAndIndexedAccess2.ts, 61, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 63, 13)) +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) +>Dict : Symbol(Dict, Decl(keyofAndIndexedAccess2.ts, 53, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 63, 38)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 63, 13)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 63, 58)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 63, 13)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess2.ts, 63, 65)) +>Dict : Symbol(Dict, Decl(keyofAndIndexedAccess2.ts, 53, 1)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess2.ts, 63, 81)) +>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 63, 13)) +>k3 : Symbol(k3, Decl(keyofAndIndexedAccess2.ts, 63, 94)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 63, 38)) + + obj.foo = 123; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 63, 58)) + + obj[k1] = 123; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 63, 58)) +>k1 : Symbol(k1, Decl(keyofAndIndexedAccess2.ts, 63, 65)) + + obj[k2] = 123; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 63, 58)) +>k2 : Symbol(k2, Decl(keyofAndIndexedAccess2.ts, 63, 81)) + + obj[k3] = 123; // Error +>obj : Symbol(obj, Decl(keyofAndIndexedAccess2.ts, 63, 58)) +>k3 : Symbol(k3, Decl(keyofAndIndexedAccess2.ts, 63, 94)) +} + +// Repro from #27895 + +export interface Entity { +>Entity : Symbol(Entity, Decl(keyofAndIndexedAccess2.ts, 68, 1)) + + id: number | string; +>id : Symbol(Entity.id, Decl(keyofAndIndexedAccess2.ts, 72, 25)) +} + +export type IdOf = E['id']; +>IdOf : Symbol(IdOf, Decl(keyofAndIndexedAccess2.ts, 74, 1)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 76, 17)) +>Entity : Symbol(Entity, Decl(keyofAndIndexedAccess2.ts, 68, 1)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 76, 17)) + +export interface EntityState { +>EntityState : Symbol(EntityState, Decl(keyofAndIndexedAccess2.ts, 76, 45)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 78, 29)) +>Entity : Symbol(Entity, Decl(keyofAndIndexedAccess2.ts, 68, 1)) + + ids: IdOf[]; +>ids : Symbol(EntityState.ids, Decl(keyofAndIndexedAccess2.ts, 78, 48)) +>IdOf : Symbol(IdOf, Decl(keyofAndIndexedAccess2.ts, 74, 1)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 78, 29)) + + entities: { [key: string]: E, [key: number]: E }; +>entities : Symbol(EntityState.entities, Decl(keyofAndIndexedAccess2.ts, 79, 19)) +>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 80, 17)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 78, 29)) +>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 80, 35)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 78, 29)) +} + + +export function getAllEntities(state: EntityState): E[] { +>getAllEntities : Symbol(getAllEntities, Decl(keyofAndIndexedAccess2.ts, 81, 1)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 84, 31)) +>Entity : Symbol(Entity, Decl(keyofAndIndexedAccess2.ts, 68, 1)) +>state : Symbol(state, Decl(keyofAndIndexedAccess2.ts, 84, 49)) +>EntityState : Symbol(EntityState, Decl(keyofAndIndexedAccess2.ts, 76, 45)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 84, 31)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 84, 31)) + + const { ids, entities } = state; +>ids : Symbol(ids, Decl(keyofAndIndexedAccess2.ts, 85, 11)) +>entities : Symbol(entities, Decl(keyofAndIndexedAccess2.ts, 85, 16)) +>state : Symbol(state, Decl(keyofAndIndexedAccess2.ts, 84, 49)) + + return ids.map(id => entities[id]); +>ids.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>ids : Symbol(ids, Decl(keyofAndIndexedAccess2.ts, 85, 11)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>id : Symbol(id, Decl(keyofAndIndexedAccess2.ts, 86, 19)) +>entities : Symbol(entities, Decl(keyofAndIndexedAccess2.ts, 85, 16)) +>id : Symbol(id, Decl(keyofAndIndexedAccess2.ts, 86, 19)) +} + +export function getEntity(id: IdOf, state: EntityState): E | undefined { +>getEntity : Symbol(getEntity, Decl(keyofAndIndexedAccess2.ts, 87, 1)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 89, 26)) +>Entity : Symbol(Entity, Decl(keyofAndIndexedAccess2.ts, 68, 1)) +>id : Symbol(id, Decl(keyofAndIndexedAccess2.ts, 89, 44)) +>IdOf : Symbol(IdOf, Decl(keyofAndIndexedAccess2.ts, 74, 1)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 89, 26)) +>state : Symbol(state, Decl(keyofAndIndexedAccess2.ts, 89, 56)) +>EntityState : Symbol(EntityState, Decl(keyofAndIndexedAccess2.ts, 76, 45)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 89, 26)) +>E : Symbol(E, Decl(keyofAndIndexedAccess2.ts, 89, 26)) + + const { ids, entities } = state; +>ids : Symbol(ids, Decl(keyofAndIndexedAccess2.ts, 90, 11)) +>entities : Symbol(entities, Decl(keyofAndIndexedAccess2.ts, 90, 16)) +>state : Symbol(state, Decl(keyofAndIndexedAccess2.ts, 89, 56)) + + if (!ids.includes(id)) { +>ids.includes : Symbol(Array.includes, Decl(lib.es2016.array.include.d.ts, --, --)) +>ids : Symbol(ids, Decl(keyofAndIndexedAccess2.ts, 90, 11)) +>includes : Symbol(Array.includes, Decl(lib.es2016.array.include.d.ts, --, --)) +>id : Symbol(id, Decl(keyofAndIndexedAccess2.ts, 89, 44)) + + return undefined; +>undefined : Symbol(undefined) + } + + return entities[id]; +>entities : Symbol(entities, Decl(keyofAndIndexedAccess2.ts, 90, 16)) +>id : Symbol(id, Decl(keyofAndIndexedAccess2.ts, 89, 44)) +} + +// Repro from #30603 + +interface Type { +>Type : Symbol(Type, Decl(keyofAndIndexedAccess2.ts, 97, 1)) + + a: 123; +>a : Symbol(Type.a, Decl(keyofAndIndexedAccess2.ts, 101, 16)) + + b: "some string"; +>b : Symbol(Type.b, Decl(keyofAndIndexedAccess2.ts, 102, 11)) +} + +function get123(): Type[K] { +>get123 : Symbol(get123, Decl(keyofAndIndexedAccess2.ts, 104, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 106, 16)) +>Type : Symbol(Type, Decl(keyofAndIndexedAccess2.ts, 97, 1)) +>Type : Symbol(Type, Decl(keyofAndIndexedAccess2.ts, 97, 1)) +>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 106, 16)) + + return 123; // Error +} + diff --git a/tests/baselines/reference/keyofAndIndexedAccess2.types b/tests/baselines/reference/keyofAndIndexedAccess2.types new file mode 100644 index 0000000000000..5f5b80a481911 --- /dev/null +++ b/tests/baselines/reference/keyofAndIndexedAccess2.types @@ -0,0 +1,425 @@ +=== tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts === +function f1(obj: { a: number, b: 0 | 1, c: string }, k0: 'a', k1: 'a' | 'b', k2: 'a' | 'b' | 'c') { +>f1 : (obj: { a: number; b: 0 | 1; c: string; }, k0: "a", k1: "a" | "b", k2: "a" | "b" | "c") => void +>obj : { a: number; b: 0 | 1; c: string; } +>a : number +>b : 0 | 1 +>c : string +>k0 : "a" +>k1 : "a" | "b" +>k2 : "a" | "b" | "c" + + obj[k0] = 1; +>obj[k0] = 1 : 1 +>obj[k0] : number +>obj : { a: number; b: 0 | 1; c: string; } +>k0 : "a" +>1 : 1 + + obj[k0] = 2; +>obj[k0] = 2 : 2 +>obj[k0] : number +>obj : { a: number; b: 0 | 1; c: string; } +>k0 : "a" +>2 : 2 + + obj[k0] = 'x'; // Error +>obj[k0] = 'x' : "x" +>obj[k0] : number +>obj : { a: number; b: 0 | 1; c: string; } +>k0 : "a" +>'x' : "x" + + obj[k1] = 1; +>obj[k1] = 1 : 1 +>obj[k1] : 0 | 1 +>obj : { a: number; b: 0 | 1; c: string; } +>k1 : "a" | "b" +>1 : 1 + + obj[k1] = 2; // Error +>obj[k1] = 2 : 2 +>obj[k1] : 0 | 1 +>obj : { a: number; b: 0 | 1; c: string; } +>k1 : "a" | "b" +>2 : 2 + + obj[k1] = 'x'; // Error +>obj[k1] = 'x' : "x" +>obj[k1] : 0 | 1 +>obj : { a: number; b: 0 | 1; c: string; } +>k1 : "a" | "b" +>'x' : "x" + + obj[k2] = 1; // Error +>obj[k2] = 1 : 1 +>obj[k2] : never +>obj : { a: number; b: 0 | 1; c: string; } +>k2 : "a" | "b" | "c" +>1 : 1 + + obj[k2] = 2; // Error +>obj[k2] = 2 : 2 +>obj[k2] : never +>obj : { a: number; b: 0 | 1; c: string; } +>k2 : "a" | "b" | "c" +>2 : 2 + + obj[k2] = 'x'; // Error +>obj[k2] = 'x' : "x" +>obj[k2] : never +>obj : { a: number; b: 0 | 1; c: string; } +>k2 : "a" | "b" | "c" +>'x' : "x" +} + +function f2(a: { x: number, y: number }, b: { [key: string]: number }, c: T, k: keyof T) { +>f2 : (a: { x: number; y: number; }, b: { [key: string]: number; }, c: T, k: keyof T) => void +>key : string +>a : { x: number; y: number; } +>x : number +>y : number +>b : { [key: string]: number; } +>key : string +>c : T +>k : keyof T + + a = b; // Error, index signature in source doesn't imply properties are present +>a = b : { [key: string]: number; } +>a : { x: number; y: number; } +>b : { [key: string]: number; } + + a = c; // Error, index signature in source doesn't imply properties are present +>a = c : T +>a : { x: number; y: number; } +>c : T + + b = a; +>b = a : { x: number; y: number; } +>b : { [key: string]: number; } +>a : { x: number; y: number; } + + b = c; +>b = c : T +>b : { [key: string]: number; } +>c : T + + c = a; // Error, constraint on target doesn't imply any properties or signatures +>c = a : { x: number; y: number; } +>c : T +>a : { x: number; y: number; } + + c = b; // Error, constraint on target doesn't imply any properties or signatures +>c = b : { [key: string]: number; } +>c : T +>b : { [key: string]: number; } + + a.x; +>a.x : number +>a : { x: number; y: number; } +>x : number + + b.x; +>b.x : number +>b : { [key: string]: number; } +>x : number + + c.x; +>c.x : number +>c : T +>x : number + + c[k]; +>c[k] : T[keyof T] +>c : T +>k : keyof T + + a.x = 1; +>a.x = 1 : 1 +>a.x : number +>a : { x: number; y: number; } +>x : number +>1 : 1 + + b.x = 1; +>b.x = 1 : 1 +>b.x : number +>b : { [key: string]: number; } +>x : number +>1 : 1 + + c.x = 1; // Error, cannot write to index signature through constraint +>c.x = 1 : 1 +>c.x : any +>c : T +>x : any +>1 : 1 + + c[k] = 1; // Error, cannot write to index signature through constraint +>c[k] = 1 : 1 +>c[k] : T[keyof T] +>c : T +>k : keyof T +>1 : 1 +} + +function f3(a: { [P in K]: number }, b: { [key: string]: number }, k: K) { +>f3 : (a: { [P in K]: number; }, b: { [key: string]: number; }, k: K) => void +>a : { [P in K]: number; } +>b : { [key: string]: number; } +>key : string +>k : K + + a = b; // Error, index signature doesn't imply properties are present +>a = b : { [key: string]: number; } +>a : { [P in K]: number; } +>b : { [key: string]: number; } + + b = a; +>b = a : { [P in K]: number; } +>b : { [key: string]: number; } +>a : { [P in K]: number; } + + a[k]; +>a[k] : { [P in K]: number; }[K] +>a : { [P in K]: number; } +>k : K + + a[k] = 1; +>a[k] = 1 : 1 +>a[k] : { [P in K]: number; }[K] +>a : { [P in K]: number; } +>k : K +>1 : 1 +} + +function f3b(a: { [P in K]: number }, b: { [P in string]: number }, k: K) { +>f3b : (a: { [P in K]: number; }, b: { [x: string]: number; }, k: K) => void +>a : { [P in K]: number; } +>b : { [x: string]: number; } +>k : K + + a = b; // Error, index signature doesn't imply properties are present +>a = b : { [x: string]: number; } +>a : { [P in K]: number; } +>b : { [x: string]: number; } + + b = a; +>b = a : { [P in K]: number; } +>b : { [x: string]: number; } +>a : { [P in K]: number; } +} + +function f4(a: { [key: string]: number }[K], b: number) { +>f4 : (a: number, b: number) => void +>a : number +>key : string +>b : number + + a = b; +>a = b : number +>a : number +>b : number + + b = a; +>b = a : number +>b : number +>a : number +} + +type Item = { a: string, b: number }; +>Item : Item +>a : string +>b : number + +function f10(obj: T, k1: string, k2: keyof Item, k3: keyof T, k4: K) { +>f10 : (obj: T, k1: string, k2: "a" | "b", k3: keyof T, k4: K) => void +>obj : T +>k1 : string +>k2 : "a" | "b" +>k3 : keyof T +>k4 : K + + obj[k1] = 123; // Error +>obj[k1] = 123 : 123 +>obj[k1] : any +>obj : T +>k1 : string +>123 : 123 + + obj[k2] = 123; // Error +>obj[k2] = 123 : 123 +>obj[k2] : string & number +>obj : T +>k2 : "a" | "b" +>123 : 123 + + obj[k3] = 123; // Error +>obj[k3] = 123 : 123 +>obj[k3] : T[keyof T] +>obj : T +>k3 : keyof T +>123 : 123 + + obj[k4] = 123; // Error +>obj[k4] = 123 : 123 +>obj[k4] : T[K] +>obj : T +>k4 : K +>123 : 123 +} + +type Dict = Record; +>Dict : Record + +function f11(obj: Dict, k1: keyof Dict, k2: K) { +>f11 : (obj: Record, k1: string, k2: K) => void +>obj : Record +>k1 : string +>k2 : K + + obj.foo = 123; +>obj.foo = 123 : 123 +>obj.foo : number +>obj : Record +>foo : number +>123 : 123 + + obj[k1] = 123; +>obj[k1] = 123 : 123 +>obj[k1] : number +>obj : Record +>k1 : string +>123 : 123 + + obj[k2] = 123; +>obj[k2] = 123 : 123 +>obj[k2] : number +>obj : Record +>k2 : K +>123 : 123 +} + +function f12, K extends keyof T>(obj: T, k1: keyof Dict, k2: keyof T, k3: K) { +>f12 : >, K extends keyof T>(obj: T, k1: string, k2: keyof T, k3: K) => void +>obj : T +>k1 : string +>k2 : keyof T +>k3 : K + + obj.foo = 123; // Error +>obj.foo = 123 : 123 +>obj.foo : any +>obj : T +>foo : any +>123 : 123 + + obj[k1] = 123; // Error +>obj[k1] = 123 : 123 +>obj[k1] : any +>obj : T +>k1 : string +>123 : 123 + + obj[k2] = 123; // Error +>obj[k2] = 123 : 123 +>obj[k2] : T[keyof T] +>obj : T +>k2 : keyof T +>123 : 123 + + obj[k3] = 123; // Error +>obj[k3] = 123 : 123 +>obj[k3] : T[K] +>obj : T +>k3 : K +>123 : 123 +} + +// Repro from #27895 + +export interface Entity { + id: number | string; +>id : string | number +} + +export type IdOf = E['id']; +>IdOf : E["id"] + +export interface EntityState { + ids: IdOf[]; +>ids : E["id"][] + + entities: { [key: string]: E, [key: number]: E }; +>entities : { [key: string]: E; [key: number]: E; } +>key : string +>key : number +} + + +export function getAllEntities(state: EntityState): E[] { +>getAllEntities : (state: EntityState) => E[] +>state : EntityState + + const { ids, entities } = state; +>ids : E["id"][] +>entities : { [key: string]: E; [key: number]: E; } +>state : EntityState + + return ids.map(id => entities[id]); +>ids.map(id => entities[id]) : { [key: string]: E; [key: number]: E; }[E["id"]][] +>ids.map : (callbackfn: (value: E["id"], index: number, array: E["id"][]) => U, thisArg?: any) => U[] +>ids : E["id"][] +>map : (callbackfn: (value: E["id"], index: number, array: E["id"][]) => U, thisArg?: any) => U[] +>id => entities[id] : (id: E["id"]) => { [key: string]: E; [key: number]: E; }[E["id"]] +>id : E["id"] +>entities[id] : { [key: string]: E; [key: number]: E; }[E["id"]] +>entities : { [key: string]: E; [key: number]: E; } +>id : E["id"] +} + +export function getEntity(id: IdOf, state: EntityState): E | undefined { +>getEntity : (id: E["id"], state: EntityState) => E | undefined +>id : E["id"] +>state : EntityState + + const { ids, entities } = state; +>ids : E["id"][] +>entities : { [key: string]: E; [key: number]: E; } +>state : EntityState + + if (!ids.includes(id)) { +>!ids.includes(id) : boolean +>ids.includes(id) : boolean +>ids.includes : (searchElement: E["id"], fromIndex?: number | undefined) => boolean +>ids : E["id"][] +>includes : (searchElement: E["id"], fromIndex?: number | undefined) => boolean +>id : E["id"] + + return undefined; +>undefined : undefined + } + + return entities[id]; +>entities[id] : { [key: string]: E; [key: number]: E; }[E["id"]] +>entities : { [key: string]: E; [key: number]: E; } +>id : E["id"] +} + +// Repro from #30603 + +interface Type { + a: 123; +>a : 123 + + b: "some string"; +>b : "some string" +} + +function get123(): Type[K] { +>get123 : () => Type[K] + + return 123; // Error +>123 : 123 +} + diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.types b/tests/baselines/reference/keyofAndIndexedAccessErrors.types index 90df0e687a057..780138d6c6bcd 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.types +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.types @@ -223,12 +223,12 @@ function f20(x: T | U, y: T & U, k1: keyof (T | U), k2: keyof T & keyof U, >k2 : keyof T & keyof U x[k3]; // Error ->x[k3] : (T | U)[keyof T | keyof U] +>x[k3] : any >x : T | U >k3 : keyof T | keyof U x[k4]; // Error ->x[k4] : (T | U)[keyof T | keyof U] +>x[k4] : any >x : T | U >k4 : keyof T | keyof U diff --git a/tests/baselines/reference/mappedTypeRelationships.errors.txt b/tests/baselines/reference/mappedTypeRelationships.errors.txt index 60a06e000c255..d66312c0f178e 100644 --- a/tests/baselines/reference/mappedTypeRelationships.errors.txt +++ b/tests/baselines/reference/mappedTypeRelationships.errors.txt @@ -3,12 +3,8 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(11,5): error TS2 tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(16,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K]'. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(20,5): error TS2536: Type 'keyof U' cannot be used to index type 'T'. -tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(21,5): error TS2322: Type 'T[keyof U]' is not assignable to type 'U[keyof U]'. - Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(21,12): error TS2536: Type 'keyof U' cannot be used to index type 'T'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(25,5): error TS2536: Type 'K' cannot be used to index type 'T'. -tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(26,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K]'. - Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(26,12): error TS2536: Type 'K' cannot be used to index type 'T'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(30,5): error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'T[keyof T]'. Type 'undefined' is not assignable to type 'T[keyof T]'. @@ -17,13 +13,24 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(35,5): error TS2 tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(40,5): error TS2322: Type 'U[keyof T] | undefined' is not assignable to type 'T[keyof T]'. Type 'undefined' is not assignable to type 'T[keyof T]'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(41,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T] | undefined'. - Type 'T[keyof T]' is not assignable to type 'U[keyof T]'. - Type 'T' is not assignable to type 'U'. + Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'U[keyof T] | undefined'. + Type 'T[string]' is not assignable to type 'U[keyof T] | undefined'. + Type 'T[string]' is not assignable to type 'U[keyof T]'. + Type 'T' is not assignable to type 'U'. + Type 'T[keyof T]' is not assignable to type 'U[keyof T]'. + Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(45,5): error TS2322: Type 'U[K] | undefined' is not assignable to type 'T[K]'. Type 'undefined' is not assignable to type 'T[K]'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(46,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K] | undefined'. - Type 'T[K]' is not assignable to type 'U[K]'. - Type 'T' is not assignable to type 'U'. + Type 'T[keyof T]' is not assignable to type 'U[K] | undefined'. + Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'U[K] | undefined'. + Type 'T[string]' is not assignable to type 'U[K] | undefined'. + Type 'T[string]' is not assignable to type 'U[K]'. + Type 'T' is not assignable to type 'U'. + Type 'T[keyof T]' is not assignable to type 'U[K]'. + Type 'T' is not assignable to type 'U'. + Type 'T[K]' is not assignable to type 'U[K]'. + Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(51,5): error TS2542: Index signature in type 'Readonly' only permits reading. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(56,5): error TS2542: Index signature in type 'Readonly' only permits reading. tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'. @@ -60,7 +67,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS Type 'T' is not assignable to type 'U'. -==== tests/cases/conformance/types/mapped/mappedTypeRelationships.ts (30 errors) ==== +==== tests/cases/conformance/types/mapped/mappedTypeRelationships.ts (28 errors) ==== function f1(x: T, k: keyof T) { return x[k]; } @@ -90,9 +97,6 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS ~~~~ !!! error TS2536: Type 'keyof U' cannot be used to index type 'T'. y[k] = x[k]; // Error - ~~~~ -!!! error TS2322: Type 'T[keyof U]' is not assignable to type 'U[keyof U]'. -!!! error TS2322: Type 'T' is not assignable to type 'U'. ~~~~ !!! error TS2536: Type 'keyof U' cannot be used to index type 'T'. } @@ -102,9 +106,6 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS ~~~~ !!! error TS2536: Type 'K' cannot be used to index type 'T'. y[k] = x[k]; // Error - ~~~~ -!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'. -!!! error TS2322: Type 'T' is not assignable to type 'U'. ~~~~ !!! error TS2536: Type 'K' cannot be used to index type 'T'. } @@ -133,8 +134,12 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS y[k] = x[k]; // Error ~~~~ !!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T] | undefined'. -!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'. -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'U[keyof T] | undefined'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T] | undefined'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } function f13(x: T, y: Partial, k: K) { @@ -145,8 +150,15 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS y[k] = x[k]; // Error ~~~~ !!! error TS2322: Type 'T[K]' is not assignable to type 'U[K] | undefined'. -!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'. -!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[K] | undefined'. +!!! error TS2322: Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'U[K] | undefined'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K] | undefined'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[K]'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } function f20(x: T, y: Readonly, k: keyof T) { diff --git a/tests/baselines/reference/mappedTypeRelationships.types b/tests/baselines/reference/mappedTypeRelationships.types index 582d777149c56..0922ee18340bc 100644 --- a/tests/baselines/reference/mappedTypeRelationships.types +++ b/tests/baselines/reference/mappedTypeRelationships.types @@ -79,7 +79,7 @@ function f5(x: T, y: U, k: keyof U) { x[k] = y[k]; // Error >x[k] = y[k] : U[keyof U] ->x[k] : T[keyof U] +>x[k] : any >x : T >k : keyof U >y[k] : U[keyof U] @@ -87,11 +87,11 @@ function f5(x: T, y: U, k: keyof U) { >k : keyof U y[k] = x[k]; // Error ->y[k] = x[k] : T[keyof U] +>y[k] = x[k] : any >y[k] : U[keyof U] >y : U >k : keyof U ->x[k] : T[keyof U] +>x[k] : any >x : T >k : keyof U } @@ -104,7 +104,7 @@ function f6(x: T, y: U, k: K) { x[k] = y[k]; // Error >x[k] = y[k] : U[K] ->x[k] : T[K] +>x[k] : any >x : T >k : K >y[k] : U[K] @@ -112,11 +112,11 @@ function f6(x: T, y: U, k: K) { >k : K y[k] = x[k]; // Error ->y[k] = x[k] : T[K] +>y[k] = x[k] : any >y[k] : U[K] >y : U >k : K ->x[k] : T[K] +>x[k] : any >x : T >k : K } diff --git a/tests/baselines/reference/mappedTypes6.errors.txt b/tests/baselines/reference/mappedTypes6.errors.txt index cbe4c58d27e3c..3c5c8eac2ed4e 100644 --- a/tests/baselines/reference/mappedTypes6.errors.txt +++ b/tests/baselines/reference/mappedTypes6.errors.txt @@ -3,6 +3,9 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(24,5): error TS2322: Type ' tests/cases/conformance/types/mapped/mappedTypes6.ts(27,5): error TS2322: Type 'Partial' is not assignable to type 'T'. tests/cases/conformance/types/mapped/mappedTypes6.ts(37,5): error TS2322: Type 'Required' is not assignable to type 'Denullified'. Type 'T[P]' is not assignable to type 'NonNullable'. + Type 'T[keyof T]' is not assignable to type 'NonNullable'. + Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'NonNullable'. + Type 'T[string]' is not assignable to type 'NonNullable'. tests/cases/conformance/types/mapped/mappedTypes6.ts(38,5): error TS2322: Type 'T' is not assignable to type 'Denullified'. tests/cases/conformance/types/mapped/mappedTypes6.ts(39,5): error TS2322: Type 'Partial' is not assignable to type 'Denullified'. tests/cases/conformance/types/mapped/mappedTypes6.ts(42,5): error TS2322: Type 'T' is not assignable to type 'Required'. @@ -67,6 +70,9 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Canno ~ !!! error TS2322: Type 'Required' is not assignable to type 'Denullified'. !!! error TS2322: Type 'T[P]' is not assignable to type 'NonNullable'. +!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'NonNullable'. +!!! error TS2322: Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'NonNullable'. +!!! error TS2322: Type 'T[string]' is not assignable to type 'NonNullable'. w = y; // Error ~ !!! error TS2322: Type 'T' is not assignable to type 'Denullified'. diff --git a/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt b/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt index e63f360e24197..14c97cb148c1a 100644 --- a/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt +++ b/tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt @@ -3,6 +3,7 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessTy tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(9,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(12,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(15,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. + Type 'string' is not assignable to type 'never'. tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(18,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(24,5): error TS2322: Type 'string' is not assignable to type 'T[P]'. @@ -36,6 +37,7 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessTy tp = s; ~~ !!! error TS2322: Type 'string' is not assignable to type 'T[P]'. +!!! error TS2322: Type 'string' is not assignable to type 'never'. } function k(s: string, tp: T[P]): void { tp = s; diff --git a/tests/baselines/reference/objectSpread.types b/tests/baselines/reference/objectSpread.types index e095a4e03bb1c..0ffd5dd20b718 100644 --- a/tests/baselines/reference/objectSpread.types +++ b/tests/baselines/reference/objectSpread.types @@ -602,7 +602,7 @@ let exclusive: { id: string, a: number, b: string, c: string, d: boolean } = >d : boolean f({ a: 1, b: 'yes' }, { c: 'no', d: false }) ->f({ a: 1, b: 'yes' }, { c: 'no', d: false }) : { a: number; b: string; } & { c: string; d: false; } & { id: string; } +>f({ a: 1, b: 'yes' }, { c: 'no', d: false }) : { a: number; b: string; } & { c: string; d: boolean; } & { id: string; } >f : (t: T, u: U) => T & U & { id: string; } >{ a: 1, b: 'yes' } : { a: number; b: string; } >a : number diff --git a/tests/baselines/reference/parserSuperExpression2.errors.txt b/tests/baselines/reference/parserSuperExpression2.errors.txt index cf3f7052d60a1..7363b284ebdbf 100644 --- a/tests/baselines/reference/parserSuperExpression2.errors.txt +++ b/tests/baselines/reference/parserSuperExpression2.errors.txt @@ -1,17 +1,14 @@ -tests/cases/conformance/parser/ecmascript5/SuperExpressions/parserSuperExpression2.ts(3,5): error TS2335: 'super' can only be referenced in a derived class. -tests/cases/conformance/parser/ecmascript5/SuperExpressions/parserSuperExpression2.ts(3,10): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/parser/ecmascript5/SuperExpressions/parserSuperExpression2.ts(3,11): error TS2304: Cannot find name 'T'. +tests/cases/conformance/parser/ecmascript5/SuperExpressions/parserSuperExpression2.ts(3,5): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. +tests/cases/conformance/parser/ecmascript5/SuperExpressions/parserSuperExpression2.ts(3,10): error TS2754: 'super' may not use type arguments. -==== tests/cases/conformance/parser/ecmascript5/SuperExpressions/parserSuperExpression2.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/SuperExpressions/parserSuperExpression2.ts (2 errors) ==== class C { M() { super(0); ~~~~~ -!!! error TS2335: 'super' can only be referenced in a derived class. - ~ -!!! error TS1034: 'super' must be followed by an argument list or member access. - ~ -!!! error TS2304: Cannot find name 'T'. +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors. + ~~~ +!!! error TS2754: 'super' may not use type arguments. } } \ No newline at end of file diff --git a/tests/baselines/reference/parserSuperExpression2.js b/tests/baselines/reference/parserSuperExpression2.js index 2a1a8e3a13c80..cbb8b74933d30 100644 --- a/tests/baselines/reference/parserSuperExpression2.js +++ b/tests/baselines/reference/parserSuperExpression2.js @@ -10,7 +10,7 @@ var C = /** @class */ (function () { function C() { } C.prototype.M = function () { - _super.prototype..call(this, 0); + _this = _super.call(this, 0) || this; }; return C; }()); diff --git a/tests/baselines/reference/parserSuperExpression2.types b/tests/baselines/reference/parserSuperExpression2.types index 163c42edce47f..78de3390ee11d 100644 --- a/tests/baselines/reference/parserSuperExpression2.types +++ b/tests/baselines/reference/parserSuperExpression2.types @@ -6,10 +6,8 @@ class C { >M : () => void super(0); ->super(0) : any +>super(0) : void >super : any ->super : any -> : any >0 : 0 } } diff --git a/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt b/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt index 9fda31a7cbcf1..a480d4f3e4e50 100644 --- a/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt +++ b/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.errors.txt @@ -11,31 +11,22 @@ tests/cases/compiler/reactReduxLikeDeferredInferenceAllowsAssignment.ts(76,50): 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'. + Type 'GetProps[Extract>] | (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 '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 '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 'GetProps[keyof GetProps & string] | (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 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type 'GetProps[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 'GetProps[string] | (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 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. + Type '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'. + 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) ==== @@ -129,31 +120,22 @@ tests/cases/compiler/reactReduxLikeDeferredInferenceAllowsAssignment.ts(76,50): !!! 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'. +!!! error TS2344: Type 'GetProps[Extract>] | (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 '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 '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 'GetProps[keyof GetProps & string] | (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 'GetProps[keyof GetProps & string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type 'GetProps[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 'GetProps[string] | (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 'GetProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps[P] ? GetProps[P] : never) | undefined'. +!!! error TS2344: Type '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'. +!!! 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: { diff --git a/tests/baselines/reference/readonlyArraysAndTuples.errors.txt b/tests/baselines/reference/readonlyArraysAndTuples.errors.txt index d2f051b6d815b..3680b78bb1ba2 100644 --- a/tests/baselines/reference/readonlyArraysAndTuples.errors.txt +++ b/tests/baselines/reference/readonlyArraysAndTuples.errors.txt @@ -2,11 +2,11 @@ tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(9,12): error TS13 tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(10,15): error TS1354: 'readonly' type modifier is only permitted on array and tuple literal types. tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(11,12): error TS1354: 'readonly' type modifier is only permitted on array and tuple literal types. tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(12,12): error TS1354: 'readonly' type modifier is only permitted on array and tuple literal types. -tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(15,5): error TS2740: Type 'readonly string[]' is missing the following properties from type 'string[]': pop, push, reverse, shift, and 3 more. -tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(17,5): error TS2740: Type 'readonly [string, string]' is missing the following properties from type 'string[]': pop, push, reverse, shift, and 3 more. +tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(15,5): error TS4104: The type 'readonly string[]' is 'readonly' and cannot be assigned to the mutable type 'string[]'. +tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(17,5): error TS4104: The type 'readonly [string, string]' is 'readonly' and cannot be assigned to the mutable type 'string[]'. tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(21,5): error TS2739: Type 'string[]' is missing the following properties from type '[string, string]': 0, 1 tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(22,5): error TS2740: Type 'readonly string[]' is missing the following properties from type '[string, string]': 0, 1, pop, push, and 5 more. -tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(23,5): error TS2740: Type 'readonly [string, string]' is missing the following properties from type '[string, string]': pop, push, reverse, shift, and 3 more. +tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(23,5): error TS4104: The type 'readonly [string, string]' is 'readonly' and cannot be assigned to the mutable type '[string, string]'. tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(24,5): error TS2739: Type 'string[]' is missing the following properties from type 'readonly [string, string]': 0, 1 tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(25,5): error TS2739: Type 'readonly string[]' is missing the following properties from type 'readonly [string, string]': 0, 1 @@ -36,11 +36,11 @@ tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(25,5): error TS27 function f1(ma: string[], ra: readonly string[], mt: [string, string], rt: readonly [string, string]) { ma = ra; // Error ~~ -!!! error TS2740: Type 'readonly string[]' is missing the following properties from type 'string[]': pop, push, reverse, shift, and 3 more. +!!! error TS4104: The type 'readonly string[]' is 'readonly' and cannot be assigned to the mutable type 'string[]'. ma = mt; ma = rt; // Error ~~ -!!! error TS2740: Type 'readonly [string, string]' is missing the following properties from type 'string[]': pop, push, reverse, shift, and 3 more. +!!! error TS4104: The type 'readonly [string, string]' is 'readonly' and cannot be assigned to the mutable type 'string[]'. ra = ma; ra = mt; ra = rt; @@ -52,7 +52,7 @@ tests/cases/conformance/types/tuple/readonlyArraysAndTuples.ts(25,5): error TS27 !!! error TS2740: Type 'readonly string[]' is missing the following properties from type '[string, string]': 0, 1, pop, push, and 5 more. mt = rt; // Error ~~ -!!! error TS2740: Type 'readonly [string, string]' is missing the following properties from type '[string, string]': pop, push, reverse, shift, and 3 more. +!!! error TS4104: The type 'readonly [string, string]' is 'readonly' and cannot be assigned to the mutable type '[string, string]'. rt = ma; // Error ~~ !!! error TS2739: Type 'string[]' is missing the following properties from type 'readonly [string, string]': 0, 1 diff --git a/tests/baselines/reference/readonlyTupleAndArrayElaboration.errors.txt b/tests/baselines/reference/readonlyTupleAndArrayElaboration.errors.txt new file mode 100644 index 0000000000000..5f343e2dfda6a --- /dev/null +++ b/tests/baselines/reference/readonlyTupleAndArrayElaboration.errors.txt @@ -0,0 +1,58 @@ +tests/cases/compiler/readonlyTupleAndArrayElaboration.ts(10,20): error TS2345: Argument of type 'readonly [3, 4]' is not assignable to parameter of type '[number, number]'. + The type 'readonly [3, 4]' is 'readonly' and cannot be assigned to the mutable type '[number, number]'. +tests/cases/compiler/readonlyTupleAndArrayElaboration.ts(13,8): error TS2345: Argument of type 'readonly [3, 4]' is not assignable to parameter of type 'number[]'. + The type 'readonly [3, 4]' is 'readonly' and cannot be assigned to the mutable type 'number[]'. +tests/cases/compiler/readonlyTupleAndArrayElaboration.ts(16,9): error TS2345: Argument of type 'readonly [3, 4]' is not assignable to parameter of type 'number[]'. + The type 'readonly [3, 4]' is 'readonly' and cannot be assigned to the mutable type 'number[]'. +tests/cases/compiler/readonlyTupleAndArrayElaboration.ts(22,9): error TS2345: Argument of type 'readonly number[]' is not assignable to parameter of type 'number[]'. + The type 'readonly number[]' is 'readonly' and cannot be assigned to the mutable type 'number[]'. +tests/cases/compiler/readonlyTupleAndArrayElaboration.ts(23,9): error TS2345: Argument of type 'readonly number[]' is not assignable to parameter of type 'number[]'. + The type 'readonly number[]' is 'readonly' and cannot be assigned to the mutable type 'number[]'. +tests/cases/compiler/readonlyTupleAndArrayElaboration.ts(24,9): error TS2345: Argument of type 'readonly number[]' is not assignable to parameter of type 'number[]'. + The type 'readonly number[]' is 'readonly' and cannot be assigned to the mutable type 'number[]'. + + +==== tests/cases/compiler/readonlyTupleAndArrayElaboration.ts (6 errors) ==== + // @strict + // #Repro from #30839 + + let point = [3, 4] as const; + + function distanceFromOrigin([x, y]: [number, number]) { + return Math.sqrt(x ** 2 + y ** 2); + } + + distanceFromOrigin(point); + ~~~~~ +!!! error TS2345: Argument of type 'readonly [3, 4]' is not assignable to parameter of type '[number, number]'. +!!! error TS2345: The type 'readonly [3, 4]' is 'readonly' and cannot be assigned to the mutable type '[number, number]'. + + declare function arryFn(x: number[]): void; + arryFn(point); + ~~~~~ +!!! error TS2345: Argument of type 'readonly [3, 4]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: The type 'readonly [3, 4]' is 'readonly' and cannot be assigned to the mutable type 'number[]'. + + declare function arryFn2(x: Array): void; + arryFn2(point); + ~~~~~ +!!! error TS2345: Argument of type 'readonly [3, 4]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: The type 'readonly [3, 4]' is 'readonly' and cannot be assigned to the mutable type 'number[]'. + + declare const a: readonly number[]; + declare const b: Readonly; + declare const c: ReadonlyArray; + + arryFn2(a); + ~ +!!! error TS2345: Argument of type 'readonly number[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: The type 'readonly number[]' is 'readonly' and cannot be assigned to the mutable type 'number[]'. + arryFn2(b); + ~ +!!! error TS2345: Argument of type 'readonly number[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: The type 'readonly number[]' is 'readonly' and cannot be assigned to the mutable type 'number[]'. + arryFn2(c); + ~ +!!! error TS2345: Argument of type 'readonly number[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: The type 'readonly number[]' is 'readonly' and cannot be assigned to the mutable type 'number[]'. + \ No newline at end of file diff --git a/tests/baselines/reference/readonlyTupleAndArrayElaboration.js b/tests/baselines/reference/readonlyTupleAndArrayElaboration.js new file mode 100644 index 0000000000000..7687dc176fd2f --- /dev/null +++ b/tests/baselines/reference/readonlyTupleAndArrayElaboration.js @@ -0,0 +1,41 @@ +//// [readonlyTupleAndArrayElaboration.ts] +// @strict +// #Repro from #30839 + +let point = [3, 4] as const; + +function distanceFromOrigin([x, y]: [number, number]) { + return Math.sqrt(x ** 2 + y ** 2); +} + +distanceFromOrigin(point); + +declare function arryFn(x: number[]): void; +arryFn(point); + +declare function arryFn2(x: Array): void; +arryFn2(point); + +declare const a: readonly number[]; +declare const b: Readonly; +declare const c: ReadonlyArray; + +arryFn2(a); +arryFn2(b); +arryFn2(c); + + +//// [readonlyTupleAndArrayElaboration.js] +// @strict +// #Repro from #30839 +var point = [3, 4]; +function distanceFromOrigin(_a) { + var x = _a[0], y = _a[1]; + return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); +} +distanceFromOrigin(point); +arryFn(point); +arryFn2(point); +arryFn2(a); +arryFn2(b); +arryFn2(c); diff --git a/tests/baselines/reference/readonlyTupleAndArrayElaboration.symbols b/tests/baselines/reference/readonlyTupleAndArrayElaboration.symbols new file mode 100644 index 0000000000000..bbda544f3c729 --- /dev/null +++ b/tests/baselines/reference/readonlyTupleAndArrayElaboration.symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/readonlyTupleAndArrayElaboration.ts === +// @strict +// #Repro from #30839 + +let point = [3, 4] as const; +>point : Symbol(point, Decl(readonlyTupleAndArrayElaboration.ts, 3, 3)) + +function distanceFromOrigin([x, y]: [number, number]) { +>distanceFromOrigin : Symbol(distanceFromOrigin, Decl(readonlyTupleAndArrayElaboration.ts, 3, 28)) +>x : Symbol(x, Decl(readonlyTupleAndArrayElaboration.ts, 5, 29)) +>y : Symbol(y, Decl(readonlyTupleAndArrayElaboration.ts, 5, 31)) + + return Math.sqrt(x ** 2 + y ** 2); +>Math.sqrt : Symbol(Math.sqrt, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>sqrt : Symbol(Math.sqrt, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(readonlyTupleAndArrayElaboration.ts, 5, 29)) +>y : Symbol(y, Decl(readonlyTupleAndArrayElaboration.ts, 5, 31)) +} + +distanceFromOrigin(point); +>distanceFromOrigin : Symbol(distanceFromOrigin, Decl(readonlyTupleAndArrayElaboration.ts, 3, 28)) +>point : Symbol(point, Decl(readonlyTupleAndArrayElaboration.ts, 3, 3)) + +declare function arryFn(x: number[]): void; +>arryFn : Symbol(arryFn, Decl(readonlyTupleAndArrayElaboration.ts, 9, 26)) +>x : Symbol(x, Decl(readonlyTupleAndArrayElaboration.ts, 11, 24)) + +arryFn(point); +>arryFn : Symbol(arryFn, Decl(readonlyTupleAndArrayElaboration.ts, 9, 26)) +>point : Symbol(point, Decl(readonlyTupleAndArrayElaboration.ts, 3, 3)) + +declare function arryFn2(x: Array): void; +>arryFn2 : Symbol(arryFn2, Decl(readonlyTupleAndArrayElaboration.ts, 12, 14)) +>x : Symbol(x, Decl(readonlyTupleAndArrayElaboration.ts, 14, 25)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +arryFn2(point); +>arryFn2 : Symbol(arryFn2, Decl(readonlyTupleAndArrayElaboration.ts, 12, 14)) +>point : Symbol(point, Decl(readonlyTupleAndArrayElaboration.ts, 3, 3)) + +declare const a: readonly number[]; +>a : Symbol(a, Decl(readonlyTupleAndArrayElaboration.ts, 17, 13)) + +declare const b: Readonly; +>b : Symbol(b, Decl(readonlyTupleAndArrayElaboration.ts, 18, 13)) +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) + +declare const c: ReadonlyArray; +>c : Symbol(c, Decl(readonlyTupleAndArrayElaboration.ts, 19, 13)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --)) + +arryFn2(a); +>arryFn2 : Symbol(arryFn2, Decl(readonlyTupleAndArrayElaboration.ts, 12, 14)) +>a : Symbol(a, Decl(readonlyTupleAndArrayElaboration.ts, 17, 13)) + +arryFn2(b); +>arryFn2 : Symbol(arryFn2, Decl(readonlyTupleAndArrayElaboration.ts, 12, 14)) +>b : Symbol(b, Decl(readonlyTupleAndArrayElaboration.ts, 18, 13)) + +arryFn2(c); +>arryFn2 : Symbol(arryFn2, Decl(readonlyTupleAndArrayElaboration.ts, 12, 14)) +>c : Symbol(c, Decl(readonlyTupleAndArrayElaboration.ts, 19, 13)) + diff --git a/tests/baselines/reference/readonlyTupleAndArrayElaboration.types b/tests/baselines/reference/readonlyTupleAndArrayElaboration.types new file mode 100644 index 0000000000000..8634cbc7229e2 --- /dev/null +++ b/tests/baselines/reference/readonlyTupleAndArrayElaboration.types @@ -0,0 +1,77 @@ +=== tests/cases/compiler/readonlyTupleAndArrayElaboration.ts === +// @strict +// #Repro from #30839 + +let point = [3, 4] as const; +>point : readonly [3, 4] +>[3, 4] as const : readonly [3, 4] +>[3, 4] : readonly [3, 4] +>3 : 3 +>4 : 4 + +function distanceFromOrigin([x, y]: [number, number]) { +>distanceFromOrigin : ([x, y]: [number, number]) => number +>x : number +>y : number + + return Math.sqrt(x ** 2 + y ** 2); +>Math.sqrt(x ** 2 + y ** 2) : number +>Math.sqrt : (x: number) => number +>Math : Math +>sqrt : (x: number) => number +>x ** 2 + y ** 2 : number +>x ** 2 : number +>x : number +>2 : 2 +>y ** 2 : number +>y : number +>2 : 2 +} + +distanceFromOrigin(point); +>distanceFromOrigin(point) : number +>distanceFromOrigin : ([x, y]: [number, number]) => number +>point : readonly [3, 4] + +declare function arryFn(x: number[]): void; +>arryFn : (x: number[]) => void +>x : number[] + +arryFn(point); +>arryFn(point) : void +>arryFn : (x: number[]) => void +>point : readonly [3, 4] + +declare function arryFn2(x: Array): void; +>arryFn2 : (x: number[]) => void +>x : number[] + +arryFn2(point); +>arryFn2(point) : void +>arryFn2 : (x: number[]) => void +>point : readonly [3, 4] + +declare const a: readonly number[]; +>a : readonly number[] + +declare const b: Readonly; +>b : readonly number[] + +declare const c: ReadonlyArray; +>c : readonly number[] + +arryFn2(a); +>arryFn2(a) : void +>arryFn2 : (x: number[]) => void +>a : readonly number[] + +arryFn2(b); +>arryFn2(b) : void +>arryFn2 : (x: number[]) => void +>b : readonly number[] + +arryFn2(c); +>arryFn2(c) : void +>arryFn2 : (x: number[]) => void +>c : readonly number[] + diff --git a/tests/baselines/reference/superWithTypeArgument.errors.txt b/tests/baselines/reference/superWithTypeArgument.errors.txt index 5860cb466d93f..3ea27e403f468 100644 --- a/tests/baselines/reference/superWithTypeArgument.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument.errors.txt @@ -1,23 +1,15 @@ -tests/cases/compiler/superWithTypeArgument.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call. -tests/cases/compiler/superWithTypeArgument.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. -tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS2754: 'super' may not use type arguments. -==== tests/cases/compiler/superWithTypeArgument.ts (3 errors) ==== +==== tests/cases/compiler/superWithTypeArgument.ts (1 errors) ==== class C { } class D extends C { constructor() { - ~~~~~~~~~~~~~~~ super(); - ~~~~~~~~~~~~~~~~~~~ - ~~~~~ -!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. - ~ -!!! error TS1034: 'super' must be followed by an argument list or member access. + ~~~ +!!! error TS2754: 'super' may not use type arguments. } - ~~~~~ -!!! error TS2377: Constructors for derived classes must contain a 'super' call. } \ No newline at end of file diff --git a/tests/baselines/reference/superWithTypeArgument.js b/tests/baselines/reference/superWithTypeArgument.js index d53b906546c3b..aa2e41751e0df 100644 --- a/tests/baselines/reference/superWithTypeArgument.js +++ b/tests/baselines/reference/superWithTypeArgument.js @@ -31,9 +31,7 @@ var C = /** @class */ (function () { var D = /** @class */ (function (_super) { __extends(D, _super); function D() { - var _this = this; - _super.prototype..call(_this); - return _this; + return _super.call(this) || this; } return D; }(C)); diff --git a/tests/baselines/reference/superWithTypeArgument.symbols b/tests/baselines/reference/superWithTypeArgument.symbols index eeb5919958f84..50990b4817e68 100644 --- a/tests/baselines/reference/superWithTypeArgument.symbols +++ b/tests/baselines/reference/superWithTypeArgument.symbols @@ -12,6 +12,5 @@ class D extends C { constructor() { super(); >super : Symbol(C, Decl(superWithTypeArgument.ts, 0, 0)) ->T : Symbol(T, Decl(superWithTypeArgument.ts, 4, 8)) } } diff --git a/tests/baselines/reference/superWithTypeArgument.types b/tests/baselines/reference/superWithTypeArgument.types index eabf0dc713b07..b843f65583371 100644 --- a/tests/baselines/reference/superWithTypeArgument.types +++ b/tests/baselines/reference/superWithTypeArgument.types @@ -10,9 +10,7 @@ class D extends C { constructor() { super(); ->super() : any ->super : any ->super : C -> : any +>super() : void +>super : typeof C } } diff --git a/tests/baselines/reference/superWithTypeArgument2.errors.txt b/tests/baselines/reference/superWithTypeArgument2.errors.txt index 473e7f3b7ad70..01cb6d31e3223 100644 --- a/tests/baselines/reference/superWithTypeArgument2.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument2.errors.txt @@ -1,23 +1,18 @@ -tests/cases/compiler/superWithTypeArgument2.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call. -tests/cases/compiler/superWithTypeArgument2.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. -tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS2754: 'super' may not use type arguments. +tests/cases/compiler/superWithTypeArgument2.ts(7,18): error TS2554: Expected 0 arguments, but got 1. -==== tests/cases/compiler/superWithTypeArgument2.ts (3 errors) ==== +==== tests/cases/compiler/superWithTypeArgument2.ts (2 errors) ==== class C { foo: T; } class D extends C { constructor(x) { - ~~~~~~~~~~~~~~~~ super(x); - ~~~~~~~~~~~~~~~~~~~~ - ~~~~~ -!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. - ~ -!!! error TS1034: 'super' must be followed by an argument list or member access. + ~~~ +!!! error TS2754: 'super' may not use type arguments. + ~ +!!! error TS2554: Expected 0 arguments, but got 1. } - ~~~~~ -!!! error TS2377: Constructors for derived classes must contain a 'super' call. } \ No newline at end of file diff --git a/tests/baselines/reference/superWithTypeArgument2.js b/tests/baselines/reference/superWithTypeArgument2.js index 1bbb5226f6e0c..33d6ef13532e4 100644 --- a/tests/baselines/reference/superWithTypeArgument2.js +++ b/tests/baselines/reference/superWithTypeArgument2.js @@ -31,9 +31,7 @@ var C = /** @class */ (function () { var D = /** @class */ (function (_super) { __extends(D, _super); function D(x) { - var _this = this; - _super.prototype..call(_this, x); - return _this; + return _super.call(this, x) || this; } return D; }(C)); diff --git a/tests/baselines/reference/superWithTypeArgument2.symbols b/tests/baselines/reference/superWithTypeArgument2.symbols index c42450e872384..35a371cde104b 100644 --- a/tests/baselines/reference/superWithTypeArgument2.symbols +++ b/tests/baselines/reference/superWithTypeArgument2.symbols @@ -19,7 +19,6 @@ class D extends C { super(x); >super : Symbol(C, Decl(superWithTypeArgument2.ts, 0, 0)) ->T : Symbol(T, Decl(superWithTypeArgument2.ts, 4, 8)) >x : Symbol(x, Decl(superWithTypeArgument2.ts, 5, 16)) } } diff --git a/tests/baselines/reference/superWithTypeArgument2.types b/tests/baselines/reference/superWithTypeArgument2.types index d1aed13f237c9..4f3547cfe71e5 100644 --- a/tests/baselines/reference/superWithTypeArgument2.types +++ b/tests/baselines/reference/superWithTypeArgument2.types @@ -14,10 +14,8 @@ class D extends C { >x : any super(x); ->super(x) : any ->super : any ->super : C -> : any +>super(x) : void +>super : typeof C >x : any } } diff --git a/tests/baselines/reference/superWithTypeArgument3.errors.txt b/tests/baselines/reference/superWithTypeArgument3.errors.txt index 37e6681d7701c..fc6d10fd80c7c 100644 --- a/tests/baselines/reference/superWithTypeArgument3.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument3.errors.txt @@ -1,9 +1,7 @@ -tests/cases/compiler/superWithTypeArgument3.ts(7,5): error TS2377: Constructors for derived classes must contain a 'super' call. -tests/cases/compiler/superWithTypeArgument3.ts(8,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. -tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS2754: 'super' may not use type arguments. -==== tests/cases/compiler/superWithTypeArgument3.ts (3 errors) ==== +==== tests/cases/compiler/superWithTypeArgument3.ts (1 errors) ==== class C { foo: T; bar(x: U) { } @@ -11,16 +9,10 @@ tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must class D extends C { constructor() { - ~~~~~~~~~~~~~~~ super(); - ~~~~~~~~~~~~~~~~~~~ - ~~~~~ -!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. - ~ -!!! error TS1034: 'super' must be followed by an argument list or member access. + ~~~ +!!! error TS2754: 'super' may not use type arguments. } - ~~~~~ -!!! error TS2377: Constructors for derived classes must contain a 'super' call. bar() { super.bar(null); } diff --git a/tests/baselines/reference/superWithTypeArgument3.js b/tests/baselines/reference/superWithTypeArgument3.js index 236f69b7a71ad..940dda49cb75c 100644 --- a/tests/baselines/reference/superWithTypeArgument3.js +++ b/tests/baselines/reference/superWithTypeArgument3.js @@ -36,9 +36,7 @@ var C = /** @class */ (function () { var D = /** @class */ (function (_super) { __extends(D, _super); function D() { - var _this = this; - _super.prototype..call(_this); - return _this; + return _super.call(this) || this; } D.prototype.bar = function () { _super.prototype.bar.call(this, null); diff --git a/tests/baselines/reference/superWithTypeArgument3.symbols b/tests/baselines/reference/superWithTypeArgument3.symbols index 9a6ff93596195..a596264aa7d85 100644 --- a/tests/baselines/reference/superWithTypeArgument3.symbols +++ b/tests/baselines/reference/superWithTypeArgument3.symbols @@ -23,7 +23,6 @@ class D extends C { constructor() { super(); >super : Symbol(C, Decl(superWithTypeArgument3.ts, 0, 0)) ->T : Symbol(T, Decl(superWithTypeArgument3.ts, 5, 8)) } bar() { >bar : Symbol(D.bar, Decl(superWithTypeArgument3.ts, 8, 5)) diff --git a/tests/baselines/reference/superWithTypeArgument3.types b/tests/baselines/reference/superWithTypeArgument3.types index f4e43d15a970e..d7b857471beec 100644 --- a/tests/baselines/reference/superWithTypeArgument3.types +++ b/tests/baselines/reference/superWithTypeArgument3.types @@ -16,10 +16,8 @@ class D extends C { constructor() { super(); ->super() : any ->super : any ->super : C -> : any +>super() : void +>super : typeof C } bar() { >bar : () => void diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.errors.txt b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.errors.txt index 4460743303153..3e451b0b3d7cb 100644 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.errors.txt @@ -3,10 +3,11 @@ tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(15,11 tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(17,30): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(35,5): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,14): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,14): error TS2754: 'super' may not use type arguments. +tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,34): error TS1034: 'super' must be followed by an argument list or member access. -==== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts (6 errors) ==== +==== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts (7 errors) ==== export interface SomethingTaggable { (t: TemplateStringsArray, ...args: T[]): SomethingNewable; } @@ -53,7 +54,9 @@ tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,14 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ !!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. - ~ + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2754: 'super' may not use type arguments. + ~~~~~~~~~~~~~ !!! error TS1034: 'super' must be followed by an argument list or member access. } ~~~~~ diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.symbols b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.symbols index 631770a30ddc7..4196d6860fd60 100644 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.symbols +++ b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.symbols @@ -78,6 +78,5 @@ class SomeDerived extends SomeBase { constructor() { super `hello world`; >super : Symbol(SomeBase, Decl(taggedTemplatesWithTypeArguments2.ts, 27, 10)) ->T : Symbol(T, Decl(taggedTemplatesWithTypeArguments2.ts, 33, 18)) } } diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types index ee7661d84eb7d..bcb1a3c1e269c 100644 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types +++ b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types @@ -92,7 +92,7 @@ class SomeDerived extends SomeBase { constructor() { super `hello world`; >super `hello world` : any ->super : any +>super : any >super : SomeBase > : any >`hello world` : "hello world" diff --git a/tests/baselines/reference/unionAndIntersectionInference1.js b/tests/baselines/reference/unionAndIntersectionInference1.js index ca9e527d99ed2..fe4d76781d0f4 100644 --- a/tests/baselines/reference/unionAndIntersectionInference1.js +++ b/tests/baselines/reference/unionAndIntersectionInference1.js @@ -85,10 +85,16 @@ const createTest = (): ITest => { } declare function f1(x: T | U): T | U; -declare function f2(x: T & U): T & U; +declare function f2(x: T, y: U): T | U; let x1: string = f1('a'); -let x2: string = f2('a'); +let x2: string = f2('a', 'b'); + +// Repro from #30442 + +const func = () => {}; +const assign = (a: T, b: U) => Object.assign(a, b); +const res: (() => void) & { func: any } = assign(() => {}, { func }); //// [unionAndIntersectionInference1.js] @@ -134,4 +140,8 @@ const createTest = () => { return { name: 'test' }; }; let x1 = f1('a'); -let x2 = f2('a'); +let x2 = f2('a', 'b'); +// Repro from #30442 +const func = () => { }; +const assign = (a, b) => Object.assign(a, b); +const res = assign(() => { }, { func }); diff --git a/tests/baselines/reference/unionAndIntersectionInference1.symbols b/tests/baselines/reference/unionAndIntersectionInference1.symbols index e866f19daa423..9b4e7244cfd98 100644 --- a/tests/baselines/reference/unionAndIntersectionInference1.symbols +++ b/tests/baselines/reference/unionAndIntersectionInference1.symbols @@ -239,12 +239,13 @@ declare function f1(x: T | U): T | U; >T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 85, 20)) >U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 85, 22)) -declare function f2(x: T & U): T & U; +declare function f2(x: T, y: U): T | U; >f2 : Symbol(f2, Decl(unionAndIntersectionInference1.ts, 85, 43)) >T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 86, 20)) >U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 86, 22)) >x : Symbol(x, Decl(unionAndIntersectionInference1.ts, 86, 26)) >T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 86, 20)) +>y : Symbol(y, Decl(unionAndIntersectionInference1.ts, 86, 31)) >U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 86, 22)) >T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 86, 20)) >U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 86, 22)) @@ -253,7 +254,33 @@ let x1: string = f1('a'); >x1 : Symbol(x1, Decl(unionAndIntersectionInference1.ts, 88, 3)) >f1 : Symbol(f1, Decl(unionAndIntersectionInference1.ts, 83, 1)) -let x2: string = f2('a'); +let x2: string = f2('a', 'b'); >x2 : Symbol(x2, Decl(unionAndIntersectionInference1.ts, 89, 3)) >f2 : Symbol(f2, Decl(unionAndIntersectionInference1.ts, 85, 43)) +// Repro from #30442 + +const func = () => {}; +>func : Symbol(func, Decl(unionAndIntersectionInference1.ts, 93, 5)) +>T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 93, 14)) + +const assign = (a: T, b: U) => Object.assign(a, b); +>assign : Symbol(assign, Decl(unionAndIntersectionInference1.ts, 94, 5)) +>T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 94, 16)) +>U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 94, 18)) +>a : Symbol(a, Decl(unionAndIntersectionInference1.ts, 94, 22)) +>T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 94, 16)) +>b : Symbol(b, Decl(unionAndIntersectionInference1.ts, 94, 27)) +>U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 94, 18)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>a : Symbol(a, Decl(unionAndIntersectionInference1.ts, 94, 22)) +>b : Symbol(b, Decl(unionAndIntersectionInference1.ts, 94, 27)) + +const res: (() => void) & { func: any } = assign(() => {}, { func }); +>res : Symbol(res, Decl(unionAndIntersectionInference1.ts, 95, 5)) +>func : Symbol(func, Decl(unionAndIntersectionInference1.ts, 95, 27)) +>assign : Symbol(assign, Decl(unionAndIntersectionInference1.ts, 94, 5)) +>func : Symbol(func, Decl(unionAndIntersectionInference1.ts, 95, 60)) + diff --git a/tests/baselines/reference/unionAndIntersectionInference1.types b/tests/baselines/reference/unionAndIntersectionInference1.types index 4dddcb8bd0f32..72d60545e6a51 100644 --- a/tests/baselines/reference/unionAndIntersectionInference1.types +++ b/tests/baselines/reference/unionAndIntersectionInference1.types @@ -216,9 +216,10 @@ declare function f1(x: T | U): T | U; >f1 : (x: T | U) => T | U >x : T | U -declare function f2(x: T & U): T & U; ->f2 : (x: T & U) => T & U ->x : T & U +declare function f2(x: T, y: U): T | U; +>f2 : (x: T, y: U) => T | U +>x : T +>y : U let x1: string = f1('a'); >x1 : string @@ -226,9 +227,37 @@ let x1: string = f1('a'); >f1 : (x: T | U) => T | U >'a' : "a" -let x2: string = f2('a'); +let x2: string = f2('a', 'b'); >x2 : string ->f2('a') : "a" ->f2 : (x: T & U) => T & U +>f2('a', 'b') : "a" | "b" +>f2 : (x: T, y: U) => T | U >'a' : "a" +>'b' : "b" + +// Repro from #30442 + +const func = () => {}; +>func : () => void +>() => {} : () => void + +const assign = (a: T, b: U) => Object.assign(a, b); +>assign : (a: T, b: U) => T & U +>(a: T, b: U) => Object.assign(a, b) : (a: T, b: U) => T & U +>a : T +>b : U +>Object.assign(a, b) : T & U +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object : ObjectConstructor +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>a : T +>b : U + +const res: (() => void) & { func: any } = assign(() => {}, { func }); +>res : (() => void) & { func: any; } +>func : any +>assign(() => {}, { func }) : (() => void) & { func: () => void; } +>assign : (a: T, b: U) => T & U +>() => {} : () => void +>{ func } : { func: () => void; } +>func : () => void diff --git a/tests/baselines/reference/user/TypeScript-Node-Starter.log b/tests/baselines/reference/user/TypeScript-Node-Starter.log index 8d05a00604883..ef0a49b99405e 100644 --- a/tests/baselines/reference/user/TypeScript-Node-Starter.log +++ b/tests/baselines/reference/user/TypeScript-Node-Starter.log @@ -1,6 +1,5 @@ Exit Code: 1 Standard output: -node_modules/@types/passport-facebook/index.d.ts(50,31): error TS2689: Cannot extend an interface 'passport.Strategy'. Did you mean 'implements'? src/controllers/user.ts(95,5): error TS2345: Argument of type '{ email: any; password: any; }' is not assignable to parameter of type 'Partial'. Object literal may only specify known properties, and 'email' does not exist in type 'Partial'. src/controllers/user.ts(105,16): error TS7006: Parameter 'err' implicitly has an 'any' type. diff --git a/tests/baselines/reference/user/adonis-framework.log b/tests/baselines/reference/user/adonis-framework.log index 6e8082d87e4f3..3256c950ccecc 100644 --- a/tests/baselines/reference/user/adonis-framework.log +++ b/tests/baselines/reference/user/adonis-framework.log @@ -46,7 +46,6 @@ node_modules/adonis-framework/src/Event/index.js(256,52): error TS2345: Argument Type 'Function' provides no match for the signature '(...values: any[]): void'. node_modules/adonis-framework/src/Event/index.js(264,28): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'Listener'. node_modules/adonis-framework/src/Event/index.js(271,25): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[string, any, TimerHandler]'. - Type 'IArguments' is missing the following properties from type '[string, any, TimerHandler]': 0, 1, 2, pop, and 29 more. node_modules/adonis-framework/src/Event/index.js(278,25): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[string, any, TimerHandler]'. node_modules/adonis-framework/src/Event/index.js(294,30): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'Listener'. node_modules/adonis-framework/src/Exceptions/index.js(13,14): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -154,7 +153,6 @@ node_modules/adonis-framework/src/Route/resource.js(209,45): error TS2345: Argum node_modules/adonis-framework/src/Route/resource.js(233,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Route/resource.js(261,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Route/resource.js(290,40): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any, ...any[]]'. - Type 'IArguments' is missing the following properties from type '[any, ...any[]]': 0, pop, push, concat, and 27 more. node_modules/adonis-framework/src/Route/resource.js(296,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Route/resource.js(314,62): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. node_modules/adonis-framework/src/Server/helpers.js(17,29): error TS8024: JSDoc '@param' tag has name 'appNamespace', but there is no parameter with that name. diff --git a/tests/baselines/reference/user/bluebird.log b/tests/baselines/reference/user/bluebird.log index 8c3d09784e0d3..5c1689ff49b83 100644 --- a/tests/baselines/reference/user/bluebird.log +++ b/tests/baselines/reference/user/bluebird.log @@ -43,7 +43,6 @@ node_modules/bluebird/js/release/debuggability.js(182,18): error TS2339: Propert node_modules/bluebird/js/release/debuggability.js(187,30): error TS2339: Property 'global' does not exist on type 'typeof ret'. node_modules/bluebird/js/release/debuggability.js(197,14): error TS2339: Property 'isNode' does not exist on type 'typeof ret'. node_modules/bluebird/js/release/debuggability.js(199,48): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '["multipleResolves", MultipleResolveListener]'. - Type 'IArguments' is missing the following properties from type '["multipleResolves", MultipleResolveListener]': 0, 1, pop, push, and 28 more. node_modules/bluebird/js/release/debuggability.js(202,19): error TS2339: Property 'global' does not exist on type 'typeof ret'. node_modules/bluebird/js/release/debuggability.js(209,31): error TS2339: Property 'global' does not exist on type 'typeof ret'. node_modules/bluebird/js/release/debuggability.js(211,31): error TS2339: Property 'global' does not exist on type 'typeof ret'. diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 4720626ee4325..45afc61657ed1 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -1,16 +1,16 @@ Exit Code: 1 Standard output: -../../../../built/local/lib.dom.d.ts(2466,11): error TS2300: Duplicate identifier 'CSSRule'. -../../../../built/local/lib.dom.d.ts(2485,13): error TS2300: Duplicate identifier 'CSSRule'. -../../../../built/local/lib.dom.d.ts(3370,11): error TS2300: Duplicate identifier 'Comment'. -../../../../built/local/lib.dom.d.ts(3373,13): error TS2300: Duplicate identifier 'Comment'. -../../../../built/local/lib.dom.d.ts(5054,11): error TS2300: Duplicate identifier 'Event'. -../../../../built/local/lib.dom.d.ts(5114,13): error TS2300: Duplicate identifier 'Event'. -../../../../built/local/lib.dom.d.ts(11501,11): error TS2300: Duplicate identifier 'Position'. -../../../../built/local/lib.dom.d.ts(12257,11): error TS2300: Duplicate identifier 'Request'. -../../../../built/local/lib.dom.d.ts(12337,13): error TS2300: Duplicate identifier 'Request'. -../../../../built/local/lib.dom.d.ts(17014,11): error TS2300: Duplicate identifier 'Window'. -../../../../built/local/lib.dom.d.ts(17149,13): error TS2300: Duplicate identifier 'Window'. +../../../../built/local/lib.dom.d.ts(2495,11): error TS2300: Duplicate identifier 'CSSRule'. +../../../../built/local/lib.dom.d.ts(2514,13): error TS2300: Duplicate identifier 'CSSRule'. +../../../../built/local/lib.dom.d.ts(3399,11): error TS2300: Duplicate identifier 'Comment'. +../../../../built/local/lib.dom.d.ts(3402,13): error TS2300: Duplicate identifier 'Comment'. +../../../../built/local/lib.dom.d.ts(5093,11): error TS2300: Duplicate identifier 'Event'. +../../../../built/local/lib.dom.d.ts(5153,13): error TS2300: Duplicate identifier 'Event'. +../../../../built/local/lib.dom.d.ts(11609,11): error TS2300: Duplicate identifier 'Position'. +../../../../built/local/lib.dom.d.ts(12365,11): error TS2300: Duplicate identifier 'Request'. +../../../../built/local/lib.dom.d.ts(12445,13): error TS2300: Duplicate identifier 'Request'. +../../../../built/local/lib.dom.d.ts(17123,11): error TS2300: Duplicate identifier 'Window'. +../../../../built/local/lib.dom.d.ts(17259,13): error TS2300: Duplicate identifier 'Window'. ../../../../built/local/lib.es5.d.ts(1416,11): error TS2300: Duplicate identifier 'ArrayLike'. ../../../../built/local/lib.es5.d.ts(1452,6): error TS2300: Duplicate identifier 'Record'. ../../../../node_modules/@types/node/index.d.ts(150,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type '{}', but here has type 'NodeModule'. @@ -35,7 +35,7 @@ node_modules/chrome-devtools-frontend/front_end/Runtime.js(705,5): error TS2322: node_modules/chrome-devtools-frontend/front_end/Runtime.js(715,7): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(729,7): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(746,5): error TS2322: Type 'Window | {}' is not assignable to type 'Window'. - Type '{}' is missing the following properties from type 'Window': Blob, TextDecoder, TextEncoder, URL, and 233 more. + Type '{}' is missing the following properties from type 'Window': Blob, TextDecoder, TextEncoder, URL, and 234 more. node_modules/chrome-devtools-frontend/front_end/Runtime.js(854,36): error TS2339: Property 'eval' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(1083,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/Runtime.js(1088,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. @@ -3356,8 +3356,7 @@ node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(26,46): error T node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(44,23): error TS2322: Type 'number' is not assignable to type 'RegExpMatchArray'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(45,23): error TS2365: Operator '>=' cannot be applied to types 'RegExpMatchArray' and 'number'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(47,76): error TS2365: Operator '<' cannot be applied to types 'RegExpMatchArray' and 'number'. -node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(94,25): error TS2339: Property 'createTextRange' does not exist on type 'HTMLBodyElement | HTMLFrameSetElement'. - Property 'createTextRange' does not exist on type 'HTMLBodyElement'. +node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(94,25): error TS2339: Property 'createTextRange' does not exist on type 'HTMLElement'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(683,31): error TS2339: Property 'length' does not exist on type 'never'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(684,33): error TS2339: Property 'find' does not exist on type 'never'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(689,28): error TS2339: Property 'inclusiveLeft' does not exist on type 'never'. @@ -4471,7 +4470,9 @@ node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(175,64 node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(190,48): error TS2694: Namespace 'Coverage' has no exported member 'RangeUseCount'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(191,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'entry' must be of type '[CSSStyleSheetHeader, any[]]', but here has type 'CoverageInfo'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(197,5): error TS2322: Type '[CSSStyleSheetHeader, any[]][]' is not assignable to type 'CoverageInfo[]'. - Type '[CSSStyleSheetHeader, any[]]' is missing the following properties from type 'CoverageInfo': _contentProvider, _size, _usedSize, _coverageType, and 7 more. + Types of property 'pop' are incompatible. + Type '() => [CSSStyleSheetHeader, any[]]' is not assignable to type '() => CoverageInfo'. + Type '[CSSStyleSheetHeader, any[]]' is not assignable to type 'CoverageInfo'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(201,31): error TS2694: Namespace 'Coverage' has no exported member 'RangeUseCount'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(202,32): error TS2694: Namespace 'Coverage' has no exported member 'CoverageSegment'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(210,23): error TS2339: Property 'peekLast' does not exist on type 'any[]'. @@ -6136,8 +6137,7 @@ node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(12 node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(136,5): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(161,5): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(219,43): error TS2694: Namespace 'Protocol' has no exported member 'Network'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(244,54): error TS2339: Property 'traverseNextNode' does not exist on type 'HTMLBodyElement | HTMLFrameSetElement'. - Property 'traverseNextNode' does not exist on type 'HTMLBodyElement'. +node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(244,54): error TS2339: Property 'traverseNextNode' does not exist on type 'HTMLElement'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(463,53): error TS2345: Argument of type '{ url: string; type: string; }' is not assignable to parameter of type '{ contentURL(): string; contentType(): ResourceType; contentEncoded(): Promise; requestContent(): Promise; searchInContent(query: string, caseSensitive: boolean, isRegex: boolean): Promise<...>; }'. Type '{ url: string; type: string; }' is missing the following properties from type '{ contentURL(): string; contentType(): ResourceType; contentEncoded(): Promise; requestContent(): Promise; searchInContent(query: string, caseSensitive: boolean, isRegex: boolean): Promise<...>; }': contentURL, contentType, contentEncoded, requestContent, searchInContent node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(471,22): error TS2339: Property 'valuesArray' does not exist on type 'Map; requestContent(): Promise; searchInContent(query: string, caseSensitive: boolean, isRegex: boolean): Promise<...>; }>'. @@ -11989,7 +11989,7 @@ node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataP node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(654,37): error TS2339: Property 'naturalHeight' does not exist on type 'new (width?: number, height?: number) => HTMLImageElement'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(655,39): error TS2339: Property 'naturalWidth' does not exist on type 'new (width?: number, height?: number) => HTMLImageElement'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(660,23): error TS2345: Argument of type 'new (width?: number, height?: number) => HTMLImageElement' is not assignable to parameter of type 'CanvasImageSource'. - Type 'new (width?: number, height?: number) => HTMLImageElement' is missing the following properties from type 'ImageBitmap': height, width, close + Type 'new (width?: number, height?: number) => HTMLImageElement' is missing the following properties from type 'OffscreenCanvas': height, width, convertToBlob, getContext, and 4 more. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(788,33): error TS2694: Namespace 'PerfUI.FlameChart' has no exported member 'GroupStyle'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(862,44): error TS2339: Property 'id' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(865,63): error TS2339: Property 'id' does not exist on type 'Event'. @@ -13255,8 +13255,7 @@ node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(855,15): error TS7 node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(861,40): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(1053,38): error TS2339: Property 'checkboxElement' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(1055,20): error TS2339: Property 'title' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/Tooltip.js(12,29): error TS2339: Property 'createChild' does not exist on type 'HTMLBodyElement | HTMLFrameSetElement'. - Property 'createChild' does not exist on type 'HTMLBodyElement'. +node_modules/chrome-devtools-frontend/front_end/ui/Tooltip.js(12,29): error TS2339: Property 'createChild' does not exist on type 'HTMLElement'. node_modules/chrome-devtools-frontend/front_end/ui/Tooltip.js(15,45): error TS2339: Property 'createChild' does not exist on type 'DocumentFragment'. node_modules/chrome-devtools-frontend/front_end/ui/Tooltip.js(57,27): error TS2339: Property 'path' does not exist on type 'MouseEvent'. node_modules/chrome-devtools-frontend/front_end/ui/Tooltip.js(85,31): error TS2339: Property 'isSelfOrDescendant' does not exist on type 'Element'. diff --git a/tests/baselines/reference/user/debug.log b/tests/baselines/reference/user/debug.log index 6047cfab7a9ca..530d7a0994e02 100644 --- a/tests/baselines/reference/user/debug.log +++ b/tests/baselines/reference/user/debug.log @@ -42,7 +42,6 @@ node_modules/debug/dist/debug.js(733,112): error TS2339: Property 'process' does node_modules/debug/dist/debug.js(744,146): error TS2551: Property 'WebkitAppearance' does not exist on type 'CSSStyleDeclaration'. Did you mean 'webkitAppearance'? node_modules/debug/dist/debug.js(745,78): error TS2339: Property 'firebug' does not exist on type 'Console'. node_modules/debug/dist/debug.js(799,156): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. - Type 'IArguments' is missing the following properties from type '[any?, ...any[]]': pop, push, concat, join, and 26 more. node_modules/debug/dist/debug.js(851,21): error TS2304: Cannot find name 'LocalStorage'. node_modules/debug/src/browser.js(3,100): error TS2539: Cannot assign to '_typeof' because it is not a variable. node_modules/debug/src/browser.js(3,165): error TS2539: Cannot assign to '_typeof' because it is not a variable. @@ -83,7 +82,6 @@ node_modules/debug/src/node.js(58,5): error TS2322: Type 'null' is not assignabl node_modules/debug/src/node.js(60,5): error TS2322: Type 'number' is not assignable to type 'string | undefined'. node_modules/debug/src/node.js(71,108): error TS2339: Property 'fd' does not exist on type 'WriteStream'. node_modules/debug/src/node.js(108,55): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any, ...any[]]'. - Type 'IArguments' is missing the following properties from type '[any, ...any[]]': 0, pop, push, concat, and 27 more. node_modules/debug/src/node.js(136,3): error TS2322: Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'. diff --git a/tests/baselines/reference/user/graceful-fs.log b/tests/baselines/reference/user/graceful-fs.log index 826f2e5f5bc44..72b23e684147b 100644 --- a/tests/baselines/reference/user/graceful-fs.log +++ b/tests/baselines/reference/user/graceful-fs.log @@ -6,16 +6,13 @@ node_modules/graceful-fs/clone.js(15,38): error TS2345: Argument of type 'Proper Type 'undefined' is not assignable to type 'PropertyDescriptor'. node_modules/graceful-fs/graceful-fs.js(14,3): error TS2322: Type '(msg: string, ...param: any[]) => void' is not assignable to type '() => void'. node_modules/graceful-fs/graceful-fs.js(17,37): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any, ...any[]]'. - Type 'IArguments' is missing the following properties from type '[any, ...any[]]': 0, pop, push, concat, and 27 more. node_modules/graceful-fs/graceful-fs.js(24,11): error TS2554: Expected 0 arguments, but got 1. node_modules/graceful-fs/graceful-fs.js(30,54): error TS2339: Property '__patched' does not exist on type 'typeof import("fs")'. node_modules/graceful-fs/graceful-fs.js(32,8): error TS2339: Property '__patched' does not exist on type 'typeof import("fs")'. node_modules/graceful-fs/graceful-fs.js(52,37): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[number]'. - Type 'IArguments' is missing the following properties from type '[number]': 0, pop, push, concat, and 27 more. node_modules/graceful-fs/graceful-fs.js(174,5): error TS2539: Cannot assign to 'ReadStream' because it is not a variable. node_modules/graceful-fs/graceful-fs.js(175,5): error TS2539: Cannot assign to 'WriteStream' because it is not a variable. node_modules/graceful-fs/graceful-fs.js(197,68): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, ...any[]]'. - Type 'IArguments' is missing the following properties from type '[any?, any?, ...any[]]': pop, push, concat, join, and 26 more. node_modules/graceful-fs/graceful-fs.js(220,70): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, ...any[]]'. node_modules/graceful-fs/graceful-fs.js(269,9): error TS2554: Expected 0 arguments, but got 3. node_modules/graceful-fs/graceful-fs.js(276,11): error TS2554: Expected 0 arguments, but got 3. diff --git a/tests/baselines/reference/user/npm.log b/tests/baselines/reference/user/npm.log index 8b6ed8461435c..d00bf5aac173e 100644 --- a/tests/baselines/reference/user/npm.log +++ b/tests/baselines/reference/user/npm.log @@ -30,7 +30,6 @@ node_modules/npm/bin/npm-cli.js(132,17): error TS2339: Property 'config' does no node_modules/npm/bin/npm-cli.js(134,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/bin/npm-cli.js(136,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/bin/npm-cli.js(140,32): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?]'. - Type 'IArguments' is missing the following properties from type '[any?]': pop, push, concat, join, and 26 more. node_modules/npm/html/static/toc.js(3,40): error TS2531: Object is possibly 'null'. node_modules/npm/lib/access.js(58,46): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/access.js(65,18): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. @@ -61,7 +60,6 @@ node_modules/npm/lib/auth/legacy.js(35,16): error TS2339: Property 'config' does node_modules/npm/lib/auth/legacy.js(69,33): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/oauth.js(5,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/oauth.js(6,29): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, any?, any?]'. - Type 'IArguments' is missing the following properties from type '[any?, any?, any?, any?]': pop, push, concat, join, and 26 more. node_modules/npm/lib/auth/saml.js(5,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/saml.js(6,29): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, any?, any?]'. node_modules/npm/lib/auth/sso.js(7,21): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -840,7 +838,6 @@ node_modules/npm/lib/utils/metrics.js(62,7): error TS2339: Property 'load' does node_modules/npm/lib/utils/metrics.js(64,9): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/metrics.js(65,9): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/output.js(6,30): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. - Type 'IArguments' is missing the following properties from type '[any?, ...any[]]': pop, push, concat, join, and 26 more. node_modules/npm/lib/utils/perf.js(9,12): error TS2345: Argument of type '"time"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/utils/perf.js(10,12): error TS2345: Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/utils/read-local-package.js(7,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. diff --git a/tests/baselines/reference/user/puppeteer.log b/tests/baselines/reference/user/puppeteer.log index 42bbfb9f46fc6..6aa8c77000a17 100644 --- a/tests/baselines/reference/user/puppeteer.log +++ b/tests/baselines/reference/user/puppeteer.log @@ -1,6 +1,16 @@ Exit Code: 1 Standard output: lib/Accessibility.js(118,15): error TS2503: Cannot find namespace 'Protocol'. +lib/Accessibility.js(310,7): error TS2322: Type 'string | number | boolean' is not assignable to type 'never'. + Type 'string' is not assignable to type 'never'. +lib/Accessibility.js(333,7): error TS2322: Type 'string | number | true' is not assignable to type 'never'. + Type 'string' is not assignable to type 'never'. +lib/Accessibility.js(345,7): error TS2322: Type 'boolean | "mixed"' is not assignable to type 'never'. + Type 'false' is not assignable to type 'never'. +lib/Accessibility.js(356,7): error TS2322: Type 'string | number | boolean' is not assignable to type 'never'. + Type 'string' is not assignable to type 'never'. +lib/Accessibility.js(369,7): error TS2322: Type 'string | number | true' is not assignable to type 'never'. + Type 'string' is not assignable to type 'never'. lib/Accessibility.js(375,22): error TS2503: Cannot find namespace 'Protocol'. lib/Browser.js(109,15): error TS2503: Cannot find namespace 'Protocol'. lib/Browser.js(116,58): error TS2322: Type 'Promise' is not assignable to type 'Promise'. @@ -47,7 +57,7 @@ lib/Page.js(112,33): error TS2345: Argument of type 'CDPSession' is not assignab lib/Page.js(189,15): error TS2503: Cannot find namespace 'Protocol'. lib/Page.js(284,15): error TS2503: Cannot find namespace 'Protocol'. lib/Page.js(369,20): error TS2503: Cannot find namespace 'Protocol'. -lib/Page.js(432,7): error TS2740: Type '(...args: any[]) => Promise' is missing the following properties from type 'Window': Blob, TextDecoder, TextEncoder, URL, and 231 more. +lib/Page.js(432,7): error TS2740: Type '(...args: any[]) => Promise' is missing the following properties from type 'Window': Blob, TextDecoder, TextEncoder, URL, and 232 more. lib/Page.js(442,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Window' has no compatible call signatures. lib/Page.js(478,15): error TS2503: Cannot find namespace 'Protocol'. lib/Page.js(488,22): error TS2503: Cannot find namespace 'Protocol'. diff --git a/tests/baselines/reference/user/util.log b/tests/baselines/reference/user/util.log index aa4722ad37eb6..0236e8e452b19 100644 --- a/tests/baselines/reference/user/util.log +++ b/tests/baselines/reference/user/util.log @@ -10,7 +10,6 @@ node_modules/util/util.js(80,19): error TS2339: Property 'throwDeprecation' does node_modules/util/util.js(82,26): error TS2339: Property 'traceDeprecation' does not exist on type 'Process'. node_modules/util/util.js(106,49): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. node_modules/util/util.js(553,69): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. - Type 'IArguments' is missing the following properties from type '[any?, ...any[]]': pop, push, concat, join, and 26 more. diff --git a/tests/baselines/reference/user/webpack.log b/tests/baselines/reference/user/webpack.log index 75b9655a9d054..03a6b924f8865 100644 --- a/tests/baselines/reference/user/webpack.log +++ b/tests/baselines/reference/user/webpack.log @@ -1,6 +1,6 @@ Exit Code: 1 Standard output: -../../../../../built/local/lib.dom.d.ts(17566,19): error TS2451: Cannot redeclare block-scoped variable 'WebAssembly'. +../../../../../built/local/lib.dom.d.ts(17676,19): error TS2451: Cannot redeclare block-scoped variable 'WebAssembly'. declarations.d.ts(258,15): error TS2451: Cannot redeclare block-scoped variable 'WebAssembly'. diff --git a/tests/cases/compiler/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts b/tests/cases/compiler/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts new file mode 100644 index 0000000000000..ee583c523f0ae --- /dev/null +++ b/tests/cases/compiler/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts @@ -0,0 +1,42 @@ +interface TextChannel { + id: string; + type: 'text'; + phoneNumber: string; +} + +interface EmailChannel { + id: string; + type: 'email'; + addres: string; +} + +type Channel = TextChannel | EmailChannel; + +export type ChannelType = Channel extends { type: infer R } ? R : never; + +type Omit = Pick< + T, + ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never })[keyof T] +>; + +type ChannelOfType = A extends { type: T } + ? A + : never; + + +export type NewChannel = Pick & + Partial> & { localChannelId: string }; + + +export function makeNewChannel(type: T): NewChannel> { + const localChannelId = `blahblahblah`; + return { type, localChannelId }; +} + +const newTextChannel = makeNewChannel('text'); +// This should work +newTextChannel.phoneNumber = '613-555-1234'; + +const newTextChannel2 : NewChannel = makeNewChannel('text'); +// Compare with this, which ofc works. +newTextChannel2.phoneNumber = '613-555-1234'; diff --git a/tests/cases/compiler/conditionalTypeSimplification.ts b/tests/cases/compiler/conditionalTypeSimplification.ts new file mode 100644 index 0000000000000..74c4d95045115 --- /dev/null +++ b/tests/cases/compiler/conditionalTypeSimplification.ts @@ -0,0 +1,10 @@ +// Repro from #30794 + +interface AbstractSchema { + m1 (v: T): SchemaType>; + m2 (v: T): SchemaType; +} + +type SchemaType = S extends object ? AnySchema : never; +interface AnySchema extends AnySchemaType, V> { } +interface AnySchemaType, V> extends AbstractSchema { } diff --git a/tests/cases/compiler/genericClassesRedeclaration.ts b/tests/cases/compiler/genericClassesRedeclaration.ts index b2a5f934acbe4..59c8bf3e0c22c 100644 --- a/tests/cases/compiler/genericClassesRedeclaration.ts +++ b/tests/cases/compiler/genericClassesRedeclaration.ts @@ -26,7 +26,7 @@ declare module TypeScript { public lookup(key: string): T; public remove(key: string): void; } - class IdentiferNameHashTable extends StringHashTable { + class IdentifierNameHashTable extends StringHashTable { public getAllKeys(): string[]; public add(key: string, data: T): boolean; public addOrUpdate(key: string, data: T): boolean; @@ -65,7 +65,7 @@ declare module TypeScript { public lookup(key: string): T; public remove(key: string): void; } - class IdentiferNameHashTable extends StringHashTable { + class IdentifierNameHashTable extends StringHashTable { public getAllKeys(): string[]; public add(key: string, data: T): boolean; public addOrUpdate(key: string, data: T): boolean; diff --git a/tests/cases/compiler/genericFunctionInference2.ts b/tests/cases/compiler/genericFunctionInference2.ts new file mode 100644 index 0000000000000..b83247a7781a3 --- /dev/null +++ b/tests/cases/compiler/genericFunctionInference2.ts @@ -0,0 +1,30 @@ +// Repro from #30685 + +type Reducer = (state: S) => S; +declare function combineReducers(reducers: { [K in keyof S]: Reducer }): Reducer; + +type MyState = { combined: { foo: number } }; +declare const foo: Reducer; + +const myReducer1: Reducer = combineReducers({ + combined: combineReducers({ foo }), +}); + +const myReducer2 = combineReducers({ + combined: combineReducers({ foo }), +}); + +// Repro from #30942 + +declare function withH(handlerCreators: HandleCreatorsFactory): U; + +type Props = { out: number } + +type HandleCreatorsFactory = (initialProps: T) => { [P in keyof U]: (props: T) => U[P] }; + +const enhancer4 = withH((props: Props) => ({ + onChange: (props) => (e: any) => {}, + onSubmit: (props) => (e: any) => {}, +})); + +enhancer4.onChange(null); diff --git a/tests/cases/compiler/readonlyTupleAndArrayElaboration.ts b/tests/cases/compiler/readonlyTupleAndArrayElaboration.ts new file mode 100644 index 0000000000000..9f52d8832ae07 --- /dev/null +++ b/tests/cases/compiler/readonlyTupleAndArrayElaboration.ts @@ -0,0 +1,24 @@ +// @strict +// #Repro from #30839 + +let point = [3, 4] as const; + +function distanceFromOrigin([x, y]: [number, number]) { + return Math.sqrt(x ** 2 + y ** 2); +} + +distanceFromOrigin(point); + +declare function arryFn(x: number[]): void; +arryFn(point); + +declare function arryFn2(x: Array): void; +arryFn2(point); + +declare const a: readonly number[]; +declare const b: Readonly; +declare const c: ReadonlyArray; + +arryFn2(a); +arryFn2(b); +arryFn2(c); diff --git a/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts b/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts index 278d72595cd65..2a756788f6fef 100644 --- a/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts +++ b/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts @@ -34,3 +34,8 @@ type Example = { [K in keyof T]: K extends keyof U ? UnexpectedError : type UnexpectedError = T type NoErrorHere = T + +// Repro from #30331 + +type a = T extends Array ? U : never; +type b = { [K in a & keyof T ]: 42 }; diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts index b498310f13be5..56ff157a67fd0 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts @@ -33,7 +33,8 @@ type K03 = keyof boolean; // "valueOf" type K04 = keyof void; // never type K05 = keyof undefined; // never type K06 = keyof null; // never -type K07 = keyof never; // never +type K07 = keyof never; // string | number | symbol +type K08 = keyof unknown; // never type K10 = keyof Shape; // "name" | "width" | "height" | "visible" type K11 = keyof Shape[]; // "length" | "toString" | ... diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts new file mode 100644 index 0000000000000..2d96e20f12a9d --- /dev/null +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts @@ -0,0 +1,112 @@ +// @strict: true +// @target: esnext + +function f1(obj: { a: number, b: 0 | 1, c: string }, k0: 'a', k1: 'a' | 'b', k2: 'a' | 'b' | 'c') { + obj[k0] = 1; + obj[k0] = 2; + obj[k0] = 'x'; // Error + obj[k1] = 1; + obj[k1] = 2; // Error + obj[k1] = 'x'; // Error + obj[k2] = 1; // Error + obj[k2] = 2; // Error + obj[k2] = 'x'; // Error +} + +function f2(a: { x: number, y: number }, b: { [key: string]: number }, c: T, k: keyof T) { + a = b; // Error, index signature in source doesn't imply properties are present + a = c; // Error, index signature in source doesn't imply properties are present + b = a; + b = c; + c = a; // Error, constraint on target doesn't imply any properties or signatures + c = b; // Error, constraint on target doesn't imply any properties or signatures + a.x; + b.x; + c.x; + c[k]; + a.x = 1; + b.x = 1; + c.x = 1; // Error, cannot write to index signature through constraint + c[k] = 1; // Error, cannot write to index signature through constraint +} + +function f3(a: { [P in K]: number }, b: { [key: string]: number }, k: K) { + a = b; // Error, index signature doesn't imply properties are present + b = a; + a[k]; + a[k] = 1; +} + +function f3b(a: { [P in K]: number }, b: { [P in string]: number }, k: K) { + a = b; // Error, index signature doesn't imply properties are present + b = a; +} + +function f4(a: { [key: string]: number }[K], b: number) { + a = b; + b = a; +} + +type Item = { a: string, b: number }; + +function f10(obj: T, k1: string, k2: keyof Item, k3: keyof T, k4: K) { + obj[k1] = 123; // Error + obj[k2] = 123; // Error + obj[k3] = 123; // Error + obj[k4] = 123; // Error +} + +type Dict = Record; + +function f11(obj: Dict, k1: keyof Dict, k2: K) { + obj.foo = 123; + obj[k1] = 123; + obj[k2] = 123; +} + +function f12, K extends keyof T>(obj: T, k1: keyof Dict, k2: keyof T, k3: K) { + obj.foo = 123; // Error + obj[k1] = 123; // Error + obj[k2] = 123; // Error + obj[k3] = 123; // Error +} + +// Repro from #27895 + +export interface Entity { + id: number | string; +} + +export type IdOf = E['id']; + +export interface EntityState { + ids: IdOf[]; + entities: { [key: string]: E, [key: number]: E }; +} + + +export function getAllEntities(state: EntityState): E[] { + const { ids, entities } = state; + return ids.map(id => entities[id]); +} + +export function getEntity(id: IdOf, state: EntityState): E | undefined { + const { ids, entities } = state; + + if (!ids.includes(id)) { + return undefined; + } + + return entities[id]; +} + +// Repro from #30603 + +interface Type { + a: 123; + b: "some string"; +} + +function get123(): Type[K] { + return 123; // Error +} diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference1.ts b/tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference1.ts index d4c7d25615e46..18de9c60f2c2f 100644 --- a/tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference1.ts +++ b/tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference1.ts @@ -86,7 +86,13 @@ const createTest = (): ITest => { } declare function f1(x: T | U): T | U; -declare function f2(x: T & U): T & U; +declare function f2(x: T, y: U): T | U; let x1: string = f1('a'); -let x2: string = f2('a'); +let x2: string = f2('a', 'b'); + +// Repro from #30442 + +const func = () => {}; +const assign = (a: T, b: U) => Object.assign(a, b); +const res: (() => void) & { func: any } = assign(() => {}, { func }); diff --git a/tests/cases/fourslash/completionListInvalidMemberNames.ts b/tests/cases/fourslash/completionListInvalidMemberNames.ts index 2f124758d69bf..6cfddbdfa2844 100644 --- a/tests/cases/fourslash/completionListInvalidMemberNames.ts +++ b/tests/cases/fourslash/completionListInvalidMemberNames.ts @@ -7,8 +7,8 @@ //// "any": "valid identifier name (matches a typescript keyword)", //// "#": "invalid identifier name", //// "$": "valid identifier name", -//// "\u0062": "valid unicode identifer name (b)", -//// "\u0031\u0062": "invalid unicode identifer name (1b)" +//// "\u0062": "valid unicode identifier name (b)", +//// "\u0031\u0062": "invalid unicode identifier name (1b)" ////}; //// ////x[|./*a*/|];