diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 637249acfe23c..6a145b09e2497 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3753,6 +3753,10 @@ namespace ts { return result; } + function createOriginType(flags: TypeFlags): Type { + return new Type(checker, flags); + } + function createIntrinsicType(kind: TypeFlags, intrinsicName: string, objectFlags: ObjectFlags = 0): IntrinsicType { const type = createType(kind); type.intrinsicName = intrinsicName; @@ -4580,6 +4584,9 @@ namespace ts { ? symbolToTypeNode(type.symbol, context, SymbolFlags.Type) : factory.createTypeReferenceNode(factory.createIdentifier("?"), /*typeArguments*/ undefined); } + if (type.flags & TypeFlags.Union && (type).origin) { + type = (type).origin!; + } if (type.flags & (TypeFlags.Union | TypeFlags.Intersection)) { const types = type.flags & TypeFlags.Union ? formatUnionTypes((type).types) : (type).types; if (length(types) === 1) { @@ -4587,8 +4594,7 @@ namespace ts { } const typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - const unionOrIntersectionTypeNode = type.flags & TypeFlags.Union ? factory.createUnionTypeNode(typeNodes) : factory.createIntersectionTypeNode(typeNodes); - return unionOrIntersectionTypeNode; + return type.flags & TypeFlags.Union ? factory.createUnionTypeNode(typeNodes) : factory.createIntersectionTypeNode(typeNodes); } else { if (!context.encounteredError && !(context.flags & NodeBuilderFlags.AllowEmptyUnionOrIntersection)) { @@ -10081,7 +10087,8 @@ namespace ts { } } else if (type.flags & TypeFlags.Intersection) { - return getIntersectionType(map((type).types, t => getTypeWithThisArgument(t, thisArgument, needApparentType))); + const types = sameMap((type).types, t => getTypeWithThisArgument(t, thisArgument, needApparentType)); + return types !== (type).types ? getIntersectionType(types) : type; } return needApparentType ? getApparentType(type) : type; } @@ -10686,7 +10693,7 @@ namespace ts { return type; } if (type.flags & TypeFlags.Union) { - return getUnionType(sameMap((type).types, getLowerBoundOfKeyType)); + return mapType(type, getLowerBoundOfKeyType); } if (type.flags & TypeFlags.Intersection) { return getIntersectionType(sameMap((type).types, getLowerBoundOfKeyType)); @@ -13211,7 +13218,7 @@ namespace ts { function addTypeToUnion(typeSet: Type[], includes: TypeFlags, type: Type) { const flags = type.flags; if (flags & TypeFlags.Union) { - return addTypesToUnion(typeSet, includes, (type).types); + return addTypesToUnion(typeSet, includes | (isNamedUnionType(type) ? TypeFlags.Union : 0), (type).types); } // We ignore 'never' types in unions if (!(flags & TypeFlags.Never)) { @@ -13327,6 +13334,30 @@ namespace ts { } } + function isNamedUnionType(type: Type) { + return !!(type.flags & TypeFlags.Union && (type.aliasSymbol || (type).origin)); + } + + function addNamedUnions(namedUnions: Type[], types: readonly Type[]) { + for (const t of types) { + if (t.flags & TypeFlags.Union) { + const origin = (t).origin; + if (t.aliasSymbol || origin && !(origin.flags & TypeFlags.Union)) { + namedUnions.push(t); + } + else if (origin && origin.flags & TypeFlags.Union) { + addNamedUnions(namedUnions, (origin).types); + } + } + } + } + + function createOriginUnionOrIntersectionType(flags: TypeFlags, types: Type[]) { + const result = createOriginType(flags); + result.types = types; + return result; + } + // We sort and deduplicate the constituent types based on object identity. If the subtypeReduction // flag is specified we also reduce the constituent type set to only include types that aren't subtypes // of other types. Subtype reduction is expensive for large union types and is possible only when union @@ -13334,7 +13365,7 @@ namespace ts { // expression constructs such as array literals and the || and ?: operators). Named types can // circularly reference themselves and therefore cannot be subtype reduced during their declaration. // For example, "type Item = string | (() => Item" is a named type that circularly references itself. - function getUnionType(types: readonly Type[], unionReduction: UnionReduction = UnionReduction.Literal, aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[]): Type { + function getUnionType(types: readonly Type[], unionReduction: UnionReduction = UnionReduction.Literal, aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[], origin?: Type): Type { if (types.length === 0) { return neverType; } @@ -13368,9 +13399,31 @@ namespace ts { neverType; } } + if (!origin && includes & TypeFlags.Union) { + const namedUnions: Type[] = []; + addNamedUnions(namedUnions, types); + const reducedTypes: Type[] = []; + for (const t of typeSet) { + if (!some(namedUnions, union => containsType((union).types, t))) { + reducedTypes.push(t); + } + } + if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) { + return namedUnions[0]; + } + // We create a denormalized origin type only when the union was created from one or more named unions + // (unions with alias symbols or origins) and when there is no overlap between those named unions. + const namedTypesCount = reduceLeft(namedUnions, (sum, union) => sum + (union).types.length, 0); + if (namedTypesCount + reducedTypes.length === typeSet.length) { + for (const t of namedUnions) { + insertType(reducedTypes, t); + } + origin = createOriginUnionOrIntersectionType(TypeFlags.Union, reducedTypes); + } + } const objectFlags = (includes & TypeFlags.NotPrimitiveUnion ? 0 : ObjectFlags.PrimitiveUnion) | (includes & TypeFlags.Intersection ? ObjectFlags.ContainsIntersections : 0); - return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); + return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin); } function getUnionTypePredicate(signatures: readonly Signature[]): TypePredicate | undefined { @@ -13405,29 +13458,34 @@ namespace ts { return a.kind === b.kind && a.parameterIndex === b.parameterIndex; } + function createUnionType(types: Type[], aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[], origin?: Type) { + const result = createType(TypeFlags.Union); + result.objectFlags = getPropagatingFlagsOfTypes(types, /*excludeKinds*/ TypeFlags.Nullable); + result.types = types; + result.origin = origin; + result.aliasSymbol = aliasSymbol; + result.aliasTypeArguments = aliasTypeArguments; + return result; + } + // This function assumes the constituent type list is sorted and deduplicated. - function getUnionTypeFromSortedList(types: Type[], objectFlags: ObjectFlags, aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[]): Type { + function getUnionTypeFromSortedList(types: Type[], objectFlags: ObjectFlags, aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[], origin?: Type): Type { if (types.length === 0) { return neverType; } if (types.length === 1) { return types[0]; } - const id = getTypeListId(types); + const typeKey = !origin ? getTypeListId(types) : + origin.flags & TypeFlags.Union ? `|${getTypeListId((origin).types)}` : + origin.flags & TypeFlags.Intersection ? `&${getTypeListId((origin).types)}` : + `#${(origin).type.id}`; + const id = typeKey + (aliasSymbol ? `@${getSymbolId(aliasSymbol)}` : ""); let type = unionTypes.get(id); if (!type) { - type = createType(TypeFlags.Union); + type = createUnionType(types, aliasSymbol, aliasTypeArguments, origin); + type.objectFlags |= objectFlags; unionTypes.set(id, type); - type.objectFlags = objectFlags | getPropagatingFlagsOfTypes(types, /*excludeKinds*/ TypeFlags.Nullable); - type.types = types; - /* - Note: This is the alias symbol (or lack thereof) that we see when we first encounter this union type. - For aliases of identical unions, eg `type T = A | B; type U = A | B`, the symbol of the first alias encountered is the aliasSymbol. - (In the language service, the order may depend on the order in which a user takes actions, such as hovering over symbols.) - It's important that we create equivalent union types only once, so that's an unfortunate side effect. - */ - type.aliasSymbol = aliasSymbol; - type.aliasTypeArguments = aliasTypeArguments; } return type; } @@ -13659,7 +13717,7 @@ namespace ts { if (typeSet.length === 1) { return typeSet[0]; } - const id = getTypeListId(typeSet); + const id = getTypeListId(typeSet) + (aliasSymbol ? `@${getSymbolId(aliasSymbol)}` : ""); let result = intersectionTypes.get(id); if (!result) { if (includes & TypeFlags.Union) { @@ -13676,16 +13734,17 @@ namespace ts { result = getUnionType([getIntersectionType(typeSet), nullType], UnionReduction.Literal, aliasSymbol, aliasTypeArguments); } else { - // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of - // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. - // If the estimated size of the resulting union type exceeds 100000 constituents, report an error. + // We are attempting to construct a type of the form X & (A | B) & (C | D). Transform this into a type of + // the form X & A & C | X & A & D | X & B & C | X & B & D. If the estimated size of the resulting union type + // exceeds 100000 constituents, report an error. if (!checkCrossProductUnion(typeSet)) { return errorType; } - const unionIndex = findIndex(typeSet, t => (t.flags & TypeFlags.Union) !== 0); - const unionType = typeSet[unionIndex]; - result = getUnionType(map(unionType.types, t => getIntersectionType(replaceElement(typeSet, unionIndex, t))), - UnionReduction.Literal, aliasSymbol, aliasTypeArguments); + const constituents = getCrossProductIntersections(typeSet); + // We attach a denormalized origin type when at least one constituent of the cross-product union is an + // intersection (i.e. when the intersection didn't just reduce one or more unions to smaller unions). + const origin = some(constituents, t => !!(t.flags & TypeFlags.Intersection)) ? createOriginUnionOrIntersectionType(TypeFlags.Intersection, typeSet) : undefined; + result = getUnionType(constituents, UnionReduction.Literal, aliasSymbol, aliasTypeArguments, origin); } } else { @@ -13696,8 +13755,12 @@ namespace ts { return result; } + function getCrossProductUnionSize(types: readonly Type[]) { + return reduceLeft(types, (n, t) => t.flags & TypeFlags.Union ? n * (t).types.length : t.flags & TypeFlags.Never ? 0 : n, 1); + } + function checkCrossProductUnion(types: readonly Type[]) { - const size = reduceLeft(types, (n, t) => n * (t.flags & TypeFlags.Union ? (t).types.length : t.flags & TypeFlags.Never ? 0 : 1), 1); + const size = getCrossProductUnionSize(types); if (size >= 100000) { tracing.instant(tracing.Phase.CheckTypes, "checkCrossProductUnion_DepthLimit", { typeIds: types.map(t => t.id), size }); error(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); @@ -13706,6 +13769,26 @@ namespace ts { return true; } + function getCrossProductIntersections(types: readonly Type[]) { + const count = getCrossProductUnionSize(types); + const intersections: Type[] = []; + for (let i = 0; i < count; i++) { + const constituents = types.slice(); + let n = i; + for (let j = types.length - 1; j >= 0; j--) { + if (types[j].flags & TypeFlags.Union) { + const sourceTypes = (types[j]).types; + const length = sourceTypes.length; + constituents[j] = sourceTypes[n % length]; + n = Math.floor(n / length); + } + } + const t = getIntersectionType(constituents); + if (!(t.flags & TypeFlags.Never)) intersections.push(t); + } + return intersections; + } + function getTypeFromIntersectionTypeNode(node: IntersectionTypeNode): Type { const links = getNodeLinks(node); if (!links.resolvedType) { @@ -13723,6 +13806,12 @@ namespace ts { return result; } + function createOriginIndexType(type: InstantiableType | UnionOrIntersectionType) { + const result = createOriginType(TypeFlags.Index); + result.type = type; + return result; + } + function getIndexTypeForGenericType(type: InstantiableType | UnionOrIntersectionType, stringsOnly: boolean) { return stringsOnly ? type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, /*stringsOnly*/ true)) : @@ -13784,8 +13873,10 @@ namespace ts { return neverType; } - function getLiteralTypeFromProperties(type: Type, include: TypeFlags) { - return getUnionType(map(getPropertiesOfType(type), p => getLiteralTypeFromProperty(p, include))); + function getLiteralTypeFromProperties(type: Type, include: TypeFlags, includeOrigin: boolean) { + const origin = includeOrigin && (getObjectFlags(type) & (ObjectFlags.ClassOrInterface | ObjectFlags.Reference) || type.aliasSymbol) ? createOriginIndexType(type) : undefined; + return getUnionType(map(getPropertiesOfType(type), p => getLiteralTypeFromProperty(p, include)), UnionReduction.Literal, + /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, origin); } function getNonEnumNumberIndexInfo(type: Type) { @@ -13794,6 +13885,7 @@ namespace ts { } function getIndexType(type: Type, stringsOnly = keyofStringsOnly, noIndexSignatures?: boolean): Type { + const includeOrigin = stringsOnly === keyofStringsOnly && !noIndexSignatures; type = getReducedType(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))) : @@ -13802,10 +13894,10 @@ namespace ts { type === wildcardType ? wildcardType : 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)]) : - getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromProperties(type, TypeFlags.StringLiteral | TypeFlags.UniqueESSymbol)]) : - getLiteralTypeFromProperties(type, TypeFlags.StringOrNumberLiteralOrUnique); + stringsOnly ? !noIndexSignatures && getIndexInfoOfType(type, IndexKind.String) ? stringType : getLiteralTypeFromProperties(type, TypeFlags.StringLiteral, includeOrigin) : + !noIndexSignatures && getIndexInfoOfType(type, IndexKind.String) ? getUnionType([stringType, numberType, getLiteralTypeFromProperties(type, TypeFlags.UniqueESSymbol, includeOrigin)]) : + getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromProperties(type, TypeFlags.StringLiteral | TypeFlags.UniqueESSymbol, includeOrigin)]) : + getLiteralTypeFromProperties(type, TypeFlags.StringOrNumberLiteralOrUnique, includeOrigin); } function getExtractStringType(type: Type) { @@ -14387,7 +14479,7 @@ namespace ts { return objectType; } // Defer the operation by creating an indexed access type. - const id = objectType.id + "," + indexType.id + (shouldIncludeUndefined ? "?" : ""); + const id = objectType.id + "," + indexType.id + (shouldIncludeUndefined ? "?" : "") + (aliasSymbol ? `@${getSymbolId(aliasSymbol)}` : ""); let type = indexedAccessTypes.get(id); if (!type) { indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined)); @@ -14934,7 +15026,7 @@ namespace ts { function getRegularTypeOfLiteralType(type: Type): Type { return type.flags & TypeFlags.FreshableLiteral ? (type).regularType : - type.flags & TypeFlags.Union ? ((type).regularType || ((type).regularType = getUnionType(sameMap((type).types, getRegularTypeOfLiteralType)) as UnionType)) : + type.flags & TypeFlags.Union ? ((type).regularType || ((type).regularType = mapType(type, getRegularTypeOfLiteralType) as UnionType)) : type; } @@ -15605,10 +15697,11 @@ namespace ts { return type; } if (flags & TypeFlags.UnionOrIntersection) { - const types = (type).types; + const origin = type.flags & TypeFlags.Union ? (type).origin : undefined; + const types = origin && origin.flags & TypeFlags.UnionOrIntersection ? (origin).types : (type).types; const newTypes = instantiateTypes(types, mapper); return newTypes === types ? type : - flags & TypeFlags.Intersection ? + flags & TypeFlags.Intersection || origin && origin.flags & TypeFlags.Intersection ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : getUnionType(newTypes, UnionReduction.Literal, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); } @@ -17044,7 +17137,7 @@ namespace ts { if (isPerformingExcessPropertyChecks) { if (hasExcessProperties(source, target, reportErrors)) { if (reportErrors) { - reportRelationError(headMessage, source, target); + reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target); } return Ternary.False; } @@ -17056,14 +17149,16 @@ namespace ts { (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source)); if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) { if (reportErrors) { + const sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source); + const targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target); const calls = getSignaturesOfType(source, SignatureKind.Call); const constructs = getSignaturesOfType(source, SignatureKind.Construct); if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, /*reportErrors*/ false) || constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, /*reportErrors*/ false)) { - reportError(Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, typeToString(source), typeToString(target)); + reportError(Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString); } else { - reportError(Diagnostics.Type_0_has_no_properties_in_common_with_type_1, typeToString(source), typeToString(target)); + reportError(Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString); } } return Ternary.False; @@ -19347,7 +19442,7 @@ namespace ts { type.flags & TypeFlags.NumberLiteral ? numberType : type.flags & TypeFlags.BigIntLiteral ? bigintType : type.flags & TypeFlags.BooleanLiteral ? booleanType : - type.flags & TypeFlags.Union ? getUnionType(sameMap((type).types, getBaseTypeOfLiteralType)) : + type.flags & TypeFlags.Union ? mapType(type, getBaseTypeOfLiteralType) : type; } @@ -19357,13 +19452,13 @@ namespace ts { type.flags & TypeFlags.NumberLiteral && isFreshLiteralType(type) ? numberType : type.flags & TypeFlags.BigIntLiteral && isFreshLiteralType(type) ? bigintType : type.flags & TypeFlags.BooleanLiteral && isFreshLiteralType(type) ? booleanType : - type.flags & TypeFlags.Union ? getUnionType(sameMap((type).types, getWidenedLiteralType)) : + type.flags & TypeFlags.Union ? mapType(type, getWidenedLiteralType) : type; } function getWidenedUniqueESSymbolType(type: Type): Type { return type.flags & TypeFlags.UniqueESSymbol ? esSymbolType : - type.flags & TypeFlags.Union ? getUnionType(sameMap((type).types, getWidenedUniqueESSymbolType)) : + type.flags & TypeFlags.Union ? mapType(type, getWidenedUniqueESSymbolType) : type; } @@ -21575,9 +21670,13 @@ namespace ts { if (!(type.flags & TypeFlags.Union)) { return mapper(type); } + const origin = (type).origin; + const types = origin && origin.flags & TypeFlags.Union ? (origin).types : (type).types; let mappedTypes: Type[] | undefined; - for (const t of (type).types) { - const mapped = mapper(t); + let changed = false; + for (const t of types) { + const mapped = t.flags & TypeFlags.Union ? mapType(t, mapper, noReductions) : mapper(t); + changed ||= t !== mapped; if (mapped) { if (!mappedTypes) { mappedTypes = [mapped]; @@ -21587,7 +21686,7 @@ namespace ts { } } } - return mappedTypes && getUnionType(mappedTypes, noReductions ? UnionReduction.None : UnionReduction.Literal); + return changed ? mappedTypes && getUnionType(mappedTypes, noReductions ? UnionReduction.None : UnionReduction.Literal) : type; } function getConstituentCount(type: Type) { @@ -21681,15 +21780,6 @@ namespace ts { return hasEvolvingArrayType; } - // At flow control branch or loop junctions, if the type along every antecedent code path - // is an evolving array type, we construct a combined evolving array type. Otherwise we - // finalize all evolving array types. - function getUnionOrEvolvingArrayType(types: Type[], subtypeReduction: UnionReduction) { - return isEvolvingArrayTypeList(types) ? - getEvolvingArrayType(getUnionType(map(types, getElementTypeOfEvolvingArrayType))) : - getUnionType(sameMap(types, finalizeEvolvingArrayType), subtypeReduction); - } - // Return true if the given node is 'x' in an 'x.length', x.push(value)', 'x.unshift(value)' or // 'x[n] = value' operation, where 'n' is an expression of type any, undefined, or a number-like type. function isEvolvingArrayOperationTarget(node: Node) { @@ -22388,6 +22478,20 @@ namespace ts { return result; } + // At flow control branch or loop junctions, if the type along every antecedent code path + // is an evolving array type, we construct a combined evolving array type. Otherwise we + // finalize all evolving array types. + function getUnionOrEvolvingArrayType(types: Type[], subtypeReduction: UnionReduction) { + if (isEvolvingArrayTypeList(types)) { + return getEvolvingArrayType(getUnionType(map(types, getElementTypeOfEvolvingArrayType))); + } + const result = getUnionType(sameMap(types, finalizeEvolvingArrayType), subtypeReduction); + if (result !== declaredType && result.flags & declaredType.flags & TypeFlags.Union && arraysEqual((result).types, (declaredType).types)) { + return declaredType; + } + return result; + } + function isMatchingReferenceDiscriminant(expr: Expression, computedType: Type) { const type = declaredType.flags & TypeFlags.Union ? declaredType : computedType; if (!(type.flags & TypeFlags.Union) || !isAccessExpression(expr)) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 3adbac3ad991c..b7d97f23c7ea3 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5008,7 +5008,7 @@ namespace ts { // This *should* be every type other than null, undefined, void, and never Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BigIntLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive, /* @internal */ - NotPrimitiveUnion = Any | Unknown | Enum | Void | Never | StructuredOrInstantiable, + NotPrimitiveUnion = Any | Unknown | Enum | Void | Never | Object | Intersection | Instantiable, // The following flags are aggregated during union and intersection type construction /* @internal */ IncludesMask = Any | Unknown | Primitive | Never | Object | Union | Intersection | NonPrimitive | TemplateLiteral, @@ -5296,9 +5296,11 @@ namespace ts { export interface UnionType extends UnionOrIntersectionType { /* @internal */ - resolvedReducedType: Type; + resolvedReducedType?: Type; /* @internal */ - regularType: UnionType; + regularType?: UnionType; + /* @internal */ + origin?: Type; // Denormalized union, intersection, or index type in which union originates } export interface IntersectionType extends UnionOrIntersectionType { diff --git a/tests/baselines/reference/assertionFunctionsCanNarrowByDiscriminant.types b/tests/baselines/reference/assertionFunctionsCanNarrowByDiscriminant.types index 9de2392fe058c..aa4b32692b10d 100644 --- a/tests/baselines/reference/assertionFunctionsCanNarrowByDiscriminant.types +++ b/tests/baselines/reference/assertionFunctionsCanNarrowByDiscriminant.types @@ -49,8 +49,8 @@ animal.canMeow; // since is cat, should not be an error >canMeow : true const animalOrUndef = { type: 'cat', canMeow: true } as Animal | undefined; ->animalOrUndef : Cat | Dog | undefined ->{ type: 'cat', canMeow: true } as Animal | undefined : Cat | Dog | undefined +>animalOrUndef : Animal | undefined +>{ type: 'cat', canMeow: true } as Animal | undefined : Animal | undefined >{ type: 'cat', canMeow: true } : { type: "cat"; canMeow: true; } >type : "cat" >'cat' : "cat" @@ -61,7 +61,7 @@ assertEqual(animalOrUndef?.type, 'cat' as const); >assertEqual(animalOrUndef?.type, 'cat' as const) : void >assertEqual : (value: any, type: T) => asserts value is T >animalOrUndef?.type : "cat" | "dog" | undefined ->animalOrUndef : Cat | Dog | undefined +>animalOrUndef : Animal | undefined >type : "cat" | "dog" | undefined >'cat' as const : "cat" >'cat' : "cat" diff --git a/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.errors.txt b/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.errors.txt index ab5ed2fba8b9c..1479d824429a1 100644 --- a/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.errors.txt @@ -6,9 +6,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithDiscriminatedUnion.ts(58,5): error TS2322: Type 'S' is not assignable to type 'T'. Property 'c' is missing in type 'S' but required in type '{ a: 2; b: 4 | 3; c: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithDiscriminatedUnion.ts(82,5): error TS2322: Type 'S' is not assignable to type 'T'. - Type 'S' is not assignable to type '{ a: 0 | 2 | 1; b: 0 | 2 | 1; c: 2; }'. + Type 'S' is not assignable to type '{ a: N; b: N; c: 2; }'. Types of property 'c' are incompatible. - Type '0 | 2 | 1' is not assignable to type '2'. + Type 'N' is not assignable to type '2'. Type '0' is not assignable to type '2'. @@ -107,9 +107,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme t = s; ~ !!! error TS2322: Type 'S' is not assignable to type 'T'. -!!! error TS2322: Type 'S' is not assignable to type '{ a: 0 | 2 | 1; b: 0 | 2 | 1; c: 2; }'. +!!! error TS2322: Type 'S' is not assignable to type '{ a: N; b: N; c: 2; }'. !!! error TS2322: Types of property 'c' are incompatible. -!!! error TS2322: Type '0 | 2 | 1' is not assignable to type '2'. +!!! error TS2322: Type 'N' is not assignable to type '2'. !!! error TS2322: Type '0' is not assignable to type '2'. } diff --git a/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.types b/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.types index 4677ed878058b..cc88ed30c0738 100644 --- a/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.types +++ b/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.types @@ -155,58 +155,58 @@ namespace Example5 { // 3 discriminant properties with 3 types a piece // is 27 possible combinations. type N = 0 | 1 | 2; ->N : 0 | 2 | 1 +>N : N type S = { a: N, b: N, c: N }; >S : S ->a : 0 | 2 | 1 ->b : 0 | 2 | 1 ->c : 0 | 2 | 1 +>a : N +>b : N +>c : N type T = { a: 0, b: N, c: N } >T : T >a : 0 ->b : 0 | 2 | 1 ->c : 0 | 2 | 1 +>b : N +>c : N | { a: 1, b: N, c: N } >a : 1 ->b : 0 | 2 | 1 ->c : 0 | 2 | 1 +>b : N +>c : N | { a: 2, b: N, c: N } >a : 2 ->b : 0 | 2 | 1 ->c : 0 | 2 | 1 +>b : N +>c : N | { a: N, b: 0, c: N } ->a : 0 | 2 | 1 +>a : N >b : 0 ->c : 0 | 2 | 1 +>c : N | { a: N, b: 1, c: N } ->a : 0 | 2 | 1 +>a : N >b : 1 ->c : 0 | 2 | 1 +>c : N | { a: N, b: 2, c: N } ->a : 0 | 2 | 1 +>a : N >b : 2 ->c : 0 | 2 | 1 +>c : N | { a: N, b: N, c: 0 } ->a : 0 | 2 | 1 ->b : 0 | 2 | 1 +>a : N +>b : N >c : 0 | { a: N, b: N, c: 1 } ->a : 0 | 2 | 1 ->b : 0 | 2 | 1 +>a : N +>b : N >c : 1 | { a: N, b: N, c: 2 }; ->a : 0 | 2 | 1 ->b : 0 | 2 | 1 +>a : N +>b : N >c : 2 declare let s: S; @@ -359,9 +359,9 @@ namespace GH12052 { good.type = getAxisType(); >good.type = getAxisType() : IAxisType ->good.type : IAxisType +>good.type : "linear" | "categorical" >good : IAxis ->type : IAxisType +>type : "linear" | "categorical" >getAxisType() : IAxisType >getAxisType : () => IAxisType } @@ -473,17 +473,17 @@ namespace GH39357 { >A : A type B = "a" | "b" | "c"; ->B : "a" | "b" | "c" +>B : B declare const b: B; ->b : "a" | "b" | "c" +>b : B const a: A = b === "a" || b === "b" ? [b, 1] : ["c", ""]; >a : A >b === "a" || b === "b" ? [b, 1] : ["c", ""] : ["a" | "b", number] | ["c", string] >b === "a" || b === "b" : boolean >b === "a" : boolean ->b : "a" | "b" | "c" +>b : B >"a" : "a" >b === "b" : boolean >b : "b" | "c" diff --git a/tests/baselines/reference/booleanLiteralTypes1.types b/tests/baselines/reference/booleanLiteralTypes1.types index ec78a92a97ab0..f40f964eacc0b 100644 --- a/tests/baselines/reference/booleanLiteralTypes1.types +++ b/tests/baselines/reference/booleanLiteralTypes1.types @@ -1,11 +1,11 @@ === tests/cases/conformance/types/literal/booleanLiteralTypes1.ts === type A1 = true | false; ->A1 : boolean +>A1 : A1 >true : true >false : false type A2 = false | true; ->A2 : boolean +>A2 : A2 >false : false >true : true @@ -13,18 +13,18 @@ function f1() { >f1 : () => void var a: A1; ->a : boolean +>a : A1 var a: A2; ->a : boolean +>a : A1 var a: true | false; ->a : boolean +>a : A1 >true : true >false : false var a: false | true; ->a : boolean +>a : A1 >false : false >true : true } diff --git a/tests/baselines/reference/booleanLiteralTypes2.types b/tests/baselines/reference/booleanLiteralTypes2.types index 0d07325061978..16323492d7a72 100644 --- a/tests/baselines/reference/booleanLiteralTypes2.types +++ b/tests/baselines/reference/booleanLiteralTypes2.types @@ -1,11 +1,11 @@ === tests/cases/conformance/types/literal/booleanLiteralTypes2.ts === type A1 = true | false; ->A1 : boolean +>A1 : A1 >true : true >false : false type A2 = false | true; ->A2 : boolean +>A2 : A2 >false : false >true : true @@ -13,18 +13,18 @@ function f1() { >f1 : () => void var a: A1; ->a : boolean +>a : A1 var a: A2; ->a : boolean +>a : A1 var a: true | false; ->a : boolean +>a : A1 >true : true >false : false var a: false | true; ->a : boolean +>a : A1 >false : false >true : true } diff --git a/tests/baselines/reference/callsOnComplexSignatures.types b/tests/baselines/reference/callsOnComplexSignatures.types index cd07db256bcfe..1fa6c1f44e29a 100644 --- a/tests/baselines/reference/callsOnComplexSignatures.types +++ b/tests/baselines/reference/callsOnComplexSignatures.types @@ -30,8 +30,8 @@ function test1() { >t : Temp1 | Temp2 const z = t.getValue("bar"); // Should be fine ->z : React.ReactText ->t.getValue("bar") : React.ReactText +>z : string | number +>t.getValue("bar") : string | number >t.getValue : ((name: "foo" | "bar") => number) | ((name: "bar" | "baz") => string) >t : Temp1 | Temp2 >getValue : ((name: "foo" | "bar") => number) | ((name: "bar" | "baz") => string) @@ -399,7 +399,7 @@ function test5() { } var C: React.ComponentType | React.ComponentType = null as any; ->C : React.ComponentClass | React.StatelessComponent | React.ComponentClass | React.StatelessComponent +>C : React.ComponentType | React.ComponentType >React : any >React : any >null as any : any @@ -408,7 +408,7 @@ function test5() { const a = ; >a : JSX.Element > : JSX.Element ->C : React.ComponentClass | React.StatelessComponent | React.ComponentClass | React.StatelessComponent +>C : React.ComponentType | React.ComponentType >p : true >true : true } diff --git a/tests/baselines/reference/checkExportsObjectAssignProperty.types b/tests/baselines/reference/checkExportsObjectAssignProperty.types index f5519ddfac339..78bbbc8f3559f 100644 --- a/tests/baselines/reference/checkExportsObjectAssignProperty.types +++ b/tests/baselines/reference/checkExportsObjectAssignProperty.types @@ -176,9 +176,9 @@ m2.setonlyAccessor = 0; === tests/cases/conformance/jsdoc/mod1.js === Object.defineProperty(exports, "thing", { value: 42, writable: true }); >Object.defineProperty(exports, "thing", { value: 42, writable: true }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"thing" : "thing" >{ value: 42, writable: true } : { value: number; writable: true; } @@ -189,9 +189,9 @@ Object.defineProperty(exports, "thing", { value: 42, writable: true }); Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); >Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"readonlyProp" : "readonlyProp" >{ value: "Smith", writable: false } : { value: string; writable: false; } @@ -202,9 +202,9 @@ Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"rwAccessors" : "rwAccessors" >{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } @@ -215,9 +215,9 @@ Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); >Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"readonlyAccessor" : "readonlyAccessor" >{ get() { return 21.75 } } : { get(): number; } @@ -226,9 +226,9 @@ Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); Object.defineProperty(exports, "setonlyAccessor", { >Object.defineProperty(exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"setonlyAccessor" : "setonlyAccessor" >{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set(str: string): void; } @@ -252,9 +252,9 @@ Object.defineProperty(exports, "setonlyAccessor", { === tests/cases/conformance/jsdoc/mod2.js === Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); >Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/mod2") >module : { "\"tests/cases/conformance/jsdoc/mod2\"": typeof import("tests/cases/conformance/jsdoc/mod2"); } >exports : typeof import("tests/cases/conformance/jsdoc/mod2") @@ -267,9 +267,9 @@ Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); >Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/mod2") >module : { "\"tests/cases/conformance/jsdoc/mod2\"": typeof import("tests/cases/conformance/jsdoc/mod2"); } >exports : typeof import("tests/cases/conformance/jsdoc/mod2") @@ -282,9 +282,9 @@ Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/mod2") >module : { "\"tests/cases/conformance/jsdoc/mod2\"": typeof import("tests/cases/conformance/jsdoc/mod2"); } >exports : typeof import("tests/cases/conformance/jsdoc/mod2") @@ -297,9 +297,9 @@ Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, s Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); >Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/mod2") >module : { "\"tests/cases/conformance/jsdoc/mod2\"": typeof import("tests/cases/conformance/jsdoc/mod2"); } >exports : typeof import("tests/cases/conformance/jsdoc/mod2") @@ -310,9 +310,9 @@ Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 Object.defineProperty(module.exports, "setonlyAccessor", { >Object.defineProperty(module.exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/mod2") >module : { "\"tests/cases/conformance/jsdoc/mod2\"": typeof import("tests/cases/conformance/jsdoc/mod2"); } >exports : typeof import("tests/cases/conformance/jsdoc/mod2") diff --git a/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types b/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types index 6634a1a45ed3d..77875ad8c6374 100644 --- a/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types +++ b/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types @@ -129,9 +129,9 @@ Person.prototype.describe = function () { }; Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); >Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Person.prototype : any >Person : typeof Person >prototype : any @@ -144,9 +144,9 @@ Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }); >Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Person.prototype : any >Person : typeof Person >prototype : any @@ -159,9 +159,9 @@ Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writab Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Person.prototype : any >Person : typeof Person >prototype : any @@ -174,9 +174,9 @@ Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }); >Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Person.prototype : any >Person : typeof Person >prototype : any @@ -187,9 +187,9 @@ Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21. Object.defineProperty(Person.prototype, "setonlyAccessor", { >Object.defineProperty(Person.prototype, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Person.prototype : any >Person : typeof Person >prototype : any diff --git a/tests/baselines/reference/checkJsxChildrenProperty13.types b/tests/baselines/reference/checkJsxChildrenProperty13.types index 0e9542845fe2d..38cc2660c0869 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty13.types +++ b/tests/baselines/reference/checkJsxChildrenProperty13.types @@ -27,9 +27,9 @@ class Button extends React.Component { >(
Hello World
) : JSX.Element >
Hello World
: JSX.Element >InnerButton : typeof InnerButton ->this.props : ButtonProp & { children?: string | number | boolean | {} | React.ReactElement | (string | number | boolean | any[] | React.ReactElement)[] | undefined; } +>this.props : ButtonProp & { children?: React.ReactNode | undefined; } >this : this ->props : ButtonProp & { children?: string | number | boolean | {} | React.ReactElement | (string | number | boolean | any[] | React.ReactElement)[] | undefined; } +>props : ButtonProp & { children?: React.ReactNode | undefined; } >children : string
Hello World
diff --git a/tests/baselines/reference/checkJsxChildrenProperty3.types b/tests/baselines/reference/checkJsxChildrenProperty3.types index f2ed3dc8fd00a..ceb2a1cf09f4c 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty3.types +++ b/tests/baselines/reference/checkJsxChildrenProperty3.types @@ -31,11 +31,11 @@ class FetchUser extends React.Component { ? this.props.children(this.state.result) >this.props.children(this.state.result) : JSX.Element ->this.props.children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) +>this.props.children : ((user: IUser) => JSX.Element) & React.ReactNode >this.props : IFetchUserProps & { children?: React.ReactNode; } >this : this >props : IFetchUserProps & { children?: React.ReactNode; } ->children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) +>children : ((user: IUser) => JSX.Element) & React.ReactNode >this.state.result : any >this.state : any >this : this diff --git a/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt index 34bd218996483..98afca173245f 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/jsx/file.tsx(24,28): error TS2551: Property 'NAme' does not exist on type 'IUser'. Did you mean 'Name'? -tests/cases/conformance/jsx/file.tsx(36,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement'. +tests/cases/conformance/jsx/file.tsx(36,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement': type, props -tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement'. +tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement': type, props @@ -50,7 +50,7 @@ tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) } ~~~~~~~~~~~~~ -!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement'. +!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. !!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement': type, props !!! related TS6212 tests/cases/conformance/jsx/file.tsx:36:15: Did you mean to call this expression? { user => ( @@ -59,7 +59,7 @@ tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) } ~~~~~~~~~~~~~ -!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement'. +!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. !!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement': type, props !!! related TS6212 tests/cases/conformance/jsx/file.tsx:39:15: Did you mean to call this expression? diff --git a/tests/baselines/reference/checkJsxChildrenProperty4.types b/tests/baselines/reference/checkJsxChildrenProperty4.types index 067e8f2611af6..a8828ed552099 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty4.types +++ b/tests/baselines/reference/checkJsxChildrenProperty4.types @@ -31,11 +31,11 @@ class FetchUser extends React.Component { ? this.props.children(this.state.result) >this.props.children(this.state.result) : JSX.Element ->this.props.children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) +>this.props.children : ((user: IUser) => JSX.Element) & React.ReactNode >this.props : IFetchUserProps & { children?: React.ReactNode; } >this : this >props : IFetchUserProps & { children?: React.ReactNode; } ->children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) +>children : ((user: IUser) => JSX.Element) & React.ReactNode >this.state.result : any >this.state : any >this : this diff --git a/tests/baselines/reference/checkObjectDefineProperty.types b/tests/baselines/reference/checkObjectDefineProperty.types index e129624a5810e..05359b68bb183 100644 --- a/tests/baselines/reference/checkObjectDefineProperty.types +++ b/tests/baselines/reference/checkObjectDefineProperty.types @@ -89,9 +89,9 @@ const x = {}; Object.defineProperty(x, "name", { value: "Charles", writable: true }); >Object.defineProperty(x, "name", { value: "Charles", writable: true }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >x : typeof x >"name" : "name" >{ value: "Charles", writable: true } : { value: string; writable: true; } @@ -102,9 +102,9 @@ Object.defineProperty(x, "name", { value: "Charles", writable: true }); Object.defineProperty(x, "middleInit", { value: "H" }); >Object.defineProperty(x, "middleInit", { value: "H" }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >x : typeof x >"middleInit" : "middleInit" >{ value: "H" } : { value: string; } @@ -113,9 +113,9 @@ Object.defineProperty(x, "middleInit", { value: "H" }); Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); >Object.defineProperty(x, "lastName", { value: "Smith", writable: false }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >x : typeof x >"lastName" : "lastName" >{ value: "Smith", writable: false } : { value: string; writable: false; } @@ -126,9 +126,9 @@ Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >x : typeof x >"zip" : "zip" >{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } @@ -139,9 +139,9 @@ Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); >Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >x : typeof x >"houseNumber" : "houseNumber" >{ get() { return 21.75 } } : { get(): number; } @@ -150,9 +150,9 @@ Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); Object.defineProperty(x, "zipStr", { >Object.defineProperty(x, "zipStr", { /** @param {string} str */ set(str) { this.zip = Number(str) }}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >x : typeof x >"zipStr" : "zipStr" >{ /** @param {string} str */ set(str) { this.zip = Number(str) }} : { set(str: string): void; } diff --git a/tests/baselines/reference/checkOtherObjectAssignProperty.types b/tests/baselines/reference/checkOtherObjectAssignProperty.types index 950e1266154e2..83204a02ffe64 100644 --- a/tests/baselines/reference/checkOtherObjectAssignProperty.types +++ b/tests/baselines/reference/checkOtherObjectAssignProperty.types @@ -89,9 +89,9 @@ const obj = { value: 42, writable: true }; Object.defineProperty(exports, "thing", obj); >Object.defineProperty(exports, "thing", obj) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"thing" : "thing" >obj : { value: number; writable: boolean; } @@ -106,9 +106,9 @@ let str = /** @type {string} */("other"); Object.defineProperty(exports, str, { value: 42, writable: true }); >Object.defineProperty(exports, str, { value: 42, writable: true }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >str : string >{ value: 42, writable: true } : { value: number; writable: true; } @@ -123,9 +123,9 @@ const propName = "prop" Object.defineProperty(exports, propName, { value: 42, writable: true }); >Object.defineProperty(exports, propName, { value: 42, writable: true }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >propName : "prop" >{ value: 42, writable: true } : { value: number; writable: true; } @@ -137,18 +137,18 @@ Object.defineProperty(exports, propName, { value: 42, writable: true }); Object.defineProperty(exports, "bad1", { }); >Object.defineProperty(exports, "bad1", { }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"bad1" : "bad1" >{ } : {} Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); >Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"bad2" : "bad2" >{ get() { return 12 }, value: "no" } : { get(): number; value: string; } @@ -159,9 +159,9 @@ Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); Object.defineProperty(exports, "bad3", { writable: true }); >Object.defineProperty(exports, "bad3", { writable: true }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"bad3" : "bad3" >{ writable: true } : { writable: true; } diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.types b/tests/baselines/reference/classAppearsToHaveMembersOfObject.types index 883d1e101073b..484521f4c39c7 100644 --- a/tests/baselines/reference/classAppearsToHaveMembersOfObject.types +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.types @@ -16,9 +16,9 @@ var r = c.toString(); var r2 = c.hasOwnProperty(''); >r2 : boolean >c.hasOwnProperty('') : boolean ->c.hasOwnProperty : (v: string | number | symbol) => boolean +>c.hasOwnProperty : (v: PropertyKey) => boolean >c : C ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >'' : "" var o: Object = c; diff --git a/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.types b/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.types index 2df682290f52c..20a281417631d 100644 --- a/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.types +++ b/tests/baselines/reference/conditionalTypeRelaxingConstraintAssignability.types @@ -49,9 +49,9 @@ new Elem('' as ElChildren.Text); >ElChildren : any new Elem('' as ElChildren.Void | ElChildren.Text); // error ->new Elem('' as ElChildren.Void | ElChildren.Text) : Elem +>new Elem('' as ElChildren.Void | ElChildren.Text) : Elem >Elem : typeof Elem ->'' as ElChildren.Void | ElChildren.Text : ElChildren +>'' as ElChildren.Void | ElChildren.Text : string | undefined >'' : "" >ElChildren : any >ElChildren : any diff --git a/tests/baselines/reference/conditionalTypes1.types b/tests/baselines/reference/conditionalTypes1.types index e26eb61034633..5d208fa5d18c7 100644 --- a/tests/baselines/reference/conditionalTypes1.types +++ b/tests/baselines/reference/conditionalTypes1.types @@ -963,10 +963,10 @@ interface B2 extends A { >c : NewDiff } type c1 = B1['c']; // 'c' | 'b' ->c1 : OldDiff<"a" | "b" | "c", "a"> +>c1 : OldDiff type c2 = B2['c']; // 'c' | 'b' ->c2 : OldDiff<"a" | "b" | "c", "a"> +>c2 : "b" | "c" // Repro from #21929 @@ -983,7 +983,7 @@ type Test1 = NonFooKeys1<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" >baz : 3 type Test2 = NonFooKeys2<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" ->Test2 : OldDiff<"foo" | "bar" | "baz", "foo"> +>Test2 : "bar" | "baz" >foo : 1 >bar : 2 >baz : 3 diff --git a/tests/baselines/reference/constAssertions.types b/tests/baselines/reference/constAssertions.types index 15206af8c0e59..476c197cfb9bc 100644 --- a/tests/baselines/reference/constAssertions.types +++ b/tests/baselines/reference/constAssertions.types @@ -468,14 +468,14 @@ function ff4(verify: boolean, contentMatches: boolean) { const action : Action = verify ? `verify` : `write`; >action : Action ->verify ? `verify` : `write` : Action +>verify ? `verify` : `write` : "verify" | "write" >verify : boolean >`verify` : "verify" >`write` : "write" const contentMatch: ContentMatch = contentMatches ? `match` : `nonMatch`; >contentMatch : ContentMatch ->contentMatches ? `match` : `nonMatch` : ContentMatch +>contentMatches ? `match` : `nonMatch` : "match" | "nonMatch" >contentMatches : boolean >`match` : "match" >`nonMatch` : "nonMatch" @@ -498,14 +498,14 @@ function ff5(verify: boolean, contentMatches: boolean) { const action = verify ? `verify` : `write`; >action : "verify" | "write" ->verify ? `verify` : `write` : Action +>verify ? `verify` : `write` : "verify" | "write" >verify : boolean >`verify` : "verify" >`write` : "write" const contentMatch = contentMatches ? `match` : `nonMatch`; >contentMatch : "match" | "nonMatch" ->contentMatches ? `match` : `nonMatch` : ContentMatch +>contentMatches ? `match` : `nonMatch` : "match" | "nonMatch" >contentMatches : boolean >`match` : "match" >`nonMatch` : "nonMatch" @@ -514,8 +514,8 @@ function ff5(verify: boolean, contentMatches: boolean) { >outcome : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" >`${action}_${contentMatch}` as const : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" >`${action}_${contentMatch}` : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" ->action : Action ->contentMatch : ContentMatch +>action : "verify" | "write" +>contentMatch : "match" | "nonMatch" return outcome; >outcome : "verify_match" | "verify_nonMatch" | "write_match" | "write_nonMatch" diff --git a/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.types b/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.types index 5eb1f82c008bc..c72f7b139912a 100644 --- a/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.types +++ b/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.types @@ -29,7 +29,7 @@ f("a", { }); function g< ->g : (x: ({ a: string;} & { b: string;})[K], y: string) => void +>g : (x: ({ a: string;} & { b: string;})[K], y: string) => void K extends "a" | "b">(x: ({ a: string } & { b: string })[K], y: string) { >x : ({ a: string; } & { b: string; })[K] diff --git a/tests/baselines/reference/contextualTypingOfOptionalMembers.types b/tests/baselines/reference/contextualTypingOfOptionalMembers.types index b1d4190cb3469..8f2d051149a40 100644 --- a/tests/baselines/reference/contextualTypingOfOptionalMembers.types +++ b/tests/baselines/reference/contextualTypingOfOptionalMembers.types @@ -173,14 +173,14 @@ interface ActionsObjectOr { declare function App4>(props: Options["actions"] & { state: State }): JSX.Element; >App4 : >(props: Options["actions"] & { state: State;}) => JSX.Element ->props : (string & { state: State; }) | (Actions & { state: State; }) +>props : (string | Actions) & { state: State; } >state : State >JSX : any const a = s} />; // TODO: should be number => number, but JSX resolution is missing an inferential pass >a : JSX.Element > s} /> : JSX.Element ->App4 : >(props: (string & { state: State; }) | (Actions & { state: State; })) => JSX.Element +>App4 : >(props: (string | Actions) & { state: State; }) => JSX.Element >state : number >100 : 100 >foo : (s: number) => number diff --git a/tests/baselines/reference/controlFlowOptionalChain.types b/tests/baselines/reference/controlFlowOptionalChain.types index b48f943eba2d5..9b22d5149d96c 100644 --- a/tests/baselines/reference/controlFlowOptionalChain.types +++ b/tests/baselines/reference/controlFlowOptionalChain.types @@ -1882,12 +1882,12 @@ type Shape = >radius : number function getArea(shape?: Shape) { ->getArea : (shape?: { type: "rectangle"; width: number; height: number; } | { type: "circle"; radius: number; } | undefined) => number ->shape : { type: "rectangle"; width: number; height: number; } | { type: "circle"; radius: number; } | undefined +>getArea : (shape?: Shape | undefined) => number +>shape : Shape | undefined switch (shape?.type) { >shape?.type : "rectangle" | "circle" | undefined ->shape : { type: "rectangle"; width: number; height: number; } | { type: "circle"; radius: number; } | undefined +>shape : Shape | undefined >type : "rectangle" | "circle" | undefined case 'circle': diff --git a/tests/baselines/reference/controlFlowPropertyDeclarations.types b/tests/baselines/reference/controlFlowPropertyDeclarations.types index 1cbe996961089..d1b74c8feb7bf 100644 --- a/tests/baselines/reference/controlFlowPropertyDeclarations.types +++ b/tests/baselines/reference/controlFlowPropertyDeclarations.types @@ -371,11 +371,11 @@ export class StyleParser { if (!this.styles.hasOwnProperty(key)) { >!this.styles.hasOwnProperty(key) : boolean >this.styles.hasOwnProperty(key) : boolean ->this.styles.hasOwnProperty : (v: string | number | symbol) => boolean +>this.styles.hasOwnProperty : (v: PropertyKey) => boolean >this.styles : {} >this : this >styles : {} ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >key : string } } diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.types b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.types index 55385050d5666..e1f08d5893836 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.types +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.types @@ -25,7 +25,7 @@ module M1 { >M1 : typeof M1 export type W = Window | string; ->W : string | Window +>W : W export module N { >N : typeof N @@ -34,7 +34,7 @@ module M1 { >Window : Window export var p: W; // No error ->p : string | globalThis.Window +>p : W } } diff --git a/tests/baselines/reference/declarationEmitInferredTypeAlias5.js b/tests/baselines/reference/declarationEmitInferredTypeAlias5.js index 2fc6313c000e4..835b0e9572684 100644 --- a/tests/baselines/reference/declarationEmitInferredTypeAlias5.js +++ b/tests/baselines/reference/declarationEmitInferredTypeAlias5.js @@ -26,6 +26,5 @@ exports.v = v; //// [0.d.ts] export declare type Data = string | boolean; //// [1.d.ts] -import * as Z from "./0"; -declare let v: Z.Data; +declare let v: string | boolean; export { v }; diff --git a/tests/baselines/reference/declarationEmitInferredTypeAlias5.types b/tests/baselines/reference/declarationEmitInferredTypeAlias5.types index c613c5fe182c7..63d2cec4b9a99 100644 --- a/tests/baselines/reference/declarationEmitInferredTypeAlias5.types +++ b/tests/baselines/reference/declarationEmitInferredTypeAlias5.types @@ -12,11 +12,11 @@ import * as Z from "./0" //let v2: Z.Data; let v = "str" || true; ->v : Z.Data +>v : string | boolean >"str" || true : true | "str" >"str" : "str" >true : true export { v } ->v : Z.Data +>v : string | boolean diff --git a/tests/baselines/reference/declarationEmitInferredTypeAlias7.js b/tests/baselines/reference/declarationEmitInferredTypeAlias7.js index b38cf8a5f0dc1..2eb3756bab8ef 100644 --- a/tests/baselines/reference/declarationEmitInferredTypeAlias7.js +++ b/tests/baselines/reference/declarationEmitInferredTypeAlias7.js @@ -23,5 +23,5 @@ exports.v = v; //// [0.d.ts] export declare type Data = string | boolean; //// [1.d.ts] -declare let v: import("./0").Data; +declare let v: string | boolean; export { v }; diff --git a/tests/baselines/reference/declarationEmitInferredTypeAlias7.types b/tests/baselines/reference/declarationEmitInferredTypeAlias7.types index bd604555e663c..a035da8453fcc 100644 --- a/tests/baselines/reference/declarationEmitInferredTypeAlias7.types +++ b/tests/baselines/reference/declarationEmitInferredTypeAlias7.types @@ -8,11 +8,11 @@ let obj: Data = true; === tests/cases/compiler/1.ts === let v = "str" || true; ->v : import("tests/cases/compiler/0").Data +>v : string | boolean >"str" || true : true | "str" >"str" : "str" >true : true export { v } ->v : import("tests/cases/compiler/0").Data +>v : string | boolean diff --git a/tests/baselines/reference/decoratorsOnComputedProperties.types b/tests/baselines/reference/decoratorsOnComputedProperties.types index 9ceea659e9a3e..aa1571a516e1d 100644 --- a/tests/baselines/reference/decoratorsOnComputedProperties.types +++ b/tests/baselines/reference/decoratorsOnComputedProperties.types @@ -2,7 +2,7 @@ function x(o: object, k: PropertyKey) { } >x : (o: object, k: PropertyKey) => void >o : object ->k : string | number | symbol +>k : PropertyKey let i = 0; >i : number @@ -31,25 +31,25 @@ class A { >A : A @x ["property"]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor @@ -84,13 +84,13 @@ class A { >foo : () => string @x [foo()]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @@ -101,12 +101,12 @@ class A { >fieldNameA : string @x [fieldNameB]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameC] : any >fieldNameC : string >null : null @@ -118,25 +118,25 @@ void class B { >B : typeof B @x ["property"]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor @@ -171,13 +171,13 @@ void class B { >foo : () => string @x [foo()]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @@ -188,12 +188,12 @@ void class B { >fieldNameA : string @x [fieldNameB]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameC] : any >fieldNameC : string >null : null @@ -204,25 +204,25 @@ class C { >C : C @x ["property"]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor @@ -257,13 +257,13 @@ class C { >foo : () => string @x [foo()]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @@ -274,12 +274,12 @@ class C { >fieldNameA : string @x [fieldNameB]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameC] : any >fieldNameC : string >null : null @@ -297,25 +297,25 @@ void class D { >D : typeof D @x ["property"]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor @@ -350,13 +350,13 @@ void class D { >foo : () => string @x [foo()]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @@ -367,12 +367,12 @@ void class D { >fieldNameA : string @x [fieldNameB]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameC] : any >fieldNameC : string >null : null @@ -389,25 +389,25 @@ class E { >E : E @x ["property"]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor @@ -442,13 +442,13 @@ class E { >foo : () => string @x [foo()]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @@ -465,12 +465,12 @@ class E { >fieldNameA : string @x [fieldNameB]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameC] : any >fieldNameC : string >null : null @@ -482,25 +482,25 @@ void class F { >F : typeof F @x ["property"]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor @@ -535,13 +535,13 @@ void class F { >foo : () => string @x [foo()]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @@ -558,12 +558,12 @@ void class F { >fieldNameA : string @x [fieldNameB]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameC] : any >fieldNameC : string >null : null @@ -574,25 +574,25 @@ class G { >G : G @x ["property"]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor @@ -627,13 +627,13 @@ class G { >foo : () => string @x [foo()]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @@ -650,7 +650,7 @@ class G { >fieldNameA : string @x [fieldNameB]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameB] : any >fieldNameB : string @@ -661,7 +661,7 @@ class G { >"method2" : "method2" @x [fieldNameC]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameC] : any >fieldNameC : string >null : null @@ -673,25 +673,25 @@ void class H { >H : typeof H @x ["property"]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor @@ -726,13 +726,13 @@ void class H { >foo : () => string @x [foo()]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @@ -749,7 +749,7 @@ void class H { >fieldNameA : string @x [fieldNameB]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameB] : any >fieldNameB : string @@ -760,7 +760,7 @@ void class H { >"method2" : "method2" @x [fieldNameC]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameC] : any >fieldNameC : string >null : null @@ -771,25 +771,25 @@ class I { >I : I @x ["property"]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor @@ -824,20 +824,20 @@ class I { >foo : () => string @x [foo()]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string >null : null @x ["some" + "method"]() {} ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["some" + "method"] : () => void >"some" + "method" : string >"some" : "some" @@ -848,7 +848,7 @@ class I { >fieldNameA : string @x [fieldNameB]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameB] : any >fieldNameB : string @@ -859,7 +859,7 @@ class I { >"method2" : "method2" @x [fieldNameC]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameC] : any >fieldNameC : string >null : null @@ -871,25 +871,25 @@ void class J { >J : typeof J @x ["property"]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor @@ -924,20 +924,20 @@ void class J { >foo : () => string @x [foo()]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[foo()] : any >foo() : string >foo : () => string >null : null @x ["some" + "method"]() {} ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >["some" + "method"] : () => void >"some" + "method" : string >"some" : "some" @@ -948,7 +948,7 @@ void class J { >fieldNameA : string @x [fieldNameB]: any; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameB] : any >fieldNameB : string @@ -959,7 +959,7 @@ void class J { >"method2" : "method2" @x [fieldNameC]: any = null; ->x : (o: object, k: string | number | symbol) => void +>x : (o: object, k: PropertyKey) => void >[fieldNameC] : any >fieldNameC : string >null : null diff --git a/tests/baselines/reference/deepExcessPropertyCheckingWhenTargetIsIntersection.types b/tests/baselines/reference/deepExcessPropertyCheckingWhenTargetIsIntersection.types index e00f87383c6b6..b8471ffedbaf3 100644 --- a/tests/baselines/reference/deepExcessPropertyCheckingWhenTargetIsIntersection.types +++ b/tests/baselines/reference/deepExcessPropertyCheckingWhenTargetIsIntersection.types @@ -48,8 +48,8 @@ const TestComponent2: StatelessComponent = (p >TestComponent2 : StatelessComponent >props2 : { x: number; } >x : number ->(props) => { return null;} : (props: (TestProps & { children?: number; }) | ({ props2: { x: number;}; } & { children?: number; })) => any ->props : (TestProps & { children?: number; }) | ({ props2: { x: number; }; } & { children?: number; }) +>(props) => { return null;} : (props: (TestProps | { props2: { x: number;}; }) & { children?: number; }) => any +>props : (TestProps | { props2: { x: number; }; }) & { children?: number; } return null; >null : null diff --git a/tests/baselines/reference/discriminantPropertyCheck.types b/tests/baselines/reference/discriminantPropertyCheck.types index da884470e6f14..37866db5142e5 100644 --- a/tests/baselines/reference/discriminantPropertyCheck.types +++ b/tests/baselines/reference/discriminantPropertyCheck.types @@ -404,9 +404,9 @@ export function foo(obj: Obj) { >obj : Obj switch (obj.key) { ->obj.key : "+" | "-" | "*" | "/" +>obj.key : Additive | Multiplicative >obj : Obj ->key : "+" | "-" | "*" | "/" +>key : Additive | Multiplicative case '+': { >'+' : "+" @@ -640,7 +640,7 @@ const doTestingStuff = (mapOfTests: MapOfAllTests, ids: string[]) => { } switch (test.type) { >test.type : "testA" | "testB" ->test : AllTests +>test : TestA | TestB >type : "testA" | "testB" case 'testA': { diff --git a/tests/baselines/reference/doubleUnderscoreMappedTypes.types b/tests/baselines/reference/doubleUnderscoreMappedTypes.types index c364369e01721..68abbf4892e59 100644 --- a/tests/baselines/reference/doubleUnderscoreMappedTypes.types +++ b/tests/baselines/reference/doubleUnderscoreMappedTypes.types @@ -24,10 +24,10 @@ const ok: Properties = { // As expected, "__property2" is indeed a key of the type type Keys = keyof Properties; ->Keys : "property1" | "__property2" +>Keys : keyof Properties const k: Keys = "__property2"; // ok ->k : "property1" | "__property2" +>k : keyof Properties >"__property2" : "__property2" // This should be valid diff --git a/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types b/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types index cb026f00735df..f9bd4704f288c 100644 --- a/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types +++ b/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types @@ -14,9 +14,9 @@ module.exports = 12; Object.defineProperty(module, "exports", { value: "oh no" }); >Object.defineProperty(module, "exports", { value: "oh no" }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module : typeof module >"exports" : "exports" >{ value: "oh no" } : { value: string; } @@ -59,9 +59,9 @@ B.NS = require("./namespacey"); Object.defineProperty(B, "NS", { value: "why though", writable: true }); >Object.defineProperty(B, "NS", { value: "why though", writable: true }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >B : typeof B >"NS" : "NS" >{ value: "why though", writable: true } : { value: string; writable: true; } diff --git a/tests/baselines/reference/enumLiteralTypes1.types b/tests/baselines/reference/enumLiteralTypes1.types index a73067eeaf27a..b3541381043ad 100644 --- a/tests/baselines/reference/enumLiteralTypes1.types +++ b/tests/baselines/reference/enumLiteralTypes1.types @@ -11,12 +11,12 @@ type YesNo = Choice.Yes | Choice.No; >Choice : any type NoYes = Choice.No | Choice.Yes; ->NoYes : YesNo +>NoYes : NoYes >Choice : any >Choice : any type UnknownYesNo = Choice.Unknown | Choice.Yes | Choice.No; ->UnknownYesNo : Choice +>UnknownYesNo : UnknownYesNo >Choice : any >Choice : any >Choice : any @@ -44,12 +44,12 @@ function f1() { function f2(a: YesNo, b: UnknownYesNo, c: Choice) { >f2 : (a: YesNo, b: UnknownYesNo, c: Choice) => void >a : YesNo ->b : Choice +>b : UnknownYesNo >c : Choice b = a; >b = a : YesNo ->b : Choice +>b : UnknownYesNo >a : YesNo c = a; @@ -58,9 +58,9 @@ function f2(a: YesNo, b: UnknownYesNo, c: Choice) { >a : YesNo c = b; ->c = b : YesNo +>c = b : Choice.Yes | Choice.No >c : Choice ->b : YesNo +>b : Choice.Yes | Choice.No } function f3(a: Choice.Yes, b: YesNo) { @@ -213,7 +213,7 @@ declare function g(x: Choice): number; function f5(a: YesNo, b: UnknownYesNo, c: Choice) { >f5 : (a: YesNo, b: UnknownYesNo, c: Choice) => void >a : YesNo ->b : Choice +>b : UnknownYesNo >c : Choice var z1 = g(Choice.Yes); @@ -242,7 +242,7 @@ function f5(a: YesNo, b: UnknownYesNo, c: Choice) { >z4 : number >g(b) : number >g : { (x: Choice.Yes): string; (x: Choice.No): boolean; (x: Choice): number; } ->b : Choice +>b : UnknownYesNo var z5 = g(c); >z5 : number @@ -309,27 +309,27 @@ function f11(x: YesNo) { function f12(x: UnknownYesNo) { >f12 : (x: UnknownYesNo) => void ->x : Choice +>x : UnknownYesNo if (x) { ->x : Choice +>x : UnknownYesNo x; ->x : YesNo +>x : Choice.Yes | Choice.No } else { x; ->x : Choice +>x : UnknownYesNo } } function f13(x: UnknownYesNo) { >f13 : (x: UnknownYesNo) => void ->x : Choice +>x : UnknownYesNo if (x === Choice.Yes) { >x === Choice.Yes : boolean ->x : Choice +>x : UnknownYesNo >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes @@ -361,9 +361,9 @@ function f20(x: Item) { >x : Item switch (x.kind) { ->x.kind : YesNo +>x.kind : Choice.Yes | Choice.No >x : Item ->kind : YesNo +>kind : Choice.Yes | Choice.No case Choice.Yes: return x.a; >Choice.Yes : Choice.Yes @@ -388,9 +388,9 @@ function f21(x: Item) { >x : Item switch (x.kind) { ->x.kind : YesNo +>x.kind : Choice.Yes | Choice.No >x : Item ->kind : YesNo +>kind : Choice.Yes | Choice.No case Choice.Yes: return x.a; >Choice.Yes : Choice.Yes diff --git a/tests/baselines/reference/enumLiteralTypes2.types b/tests/baselines/reference/enumLiteralTypes2.types index 168c0284cabcb..d724072fc1b5e 100644 --- a/tests/baselines/reference/enumLiteralTypes2.types +++ b/tests/baselines/reference/enumLiteralTypes2.types @@ -11,12 +11,12 @@ type YesNo = Choice.Yes | Choice.No; >Choice : any type NoYes = Choice.No | Choice.Yes; ->NoYes : YesNo +>NoYes : NoYes >Choice : any >Choice : any type UnknownYesNo = Choice.Unknown | Choice.Yes | Choice.No; ->UnknownYesNo : Choice +>UnknownYesNo : UnknownYesNo >Choice : any >Choice : any >Choice : any @@ -44,12 +44,12 @@ function f1() { function f2(a: YesNo, b: UnknownYesNo, c: Choice) { >f2 : (a: YesNo, b: UnknownYesNo, c: Choice) => void >a : YesNo ->b : Choice +>b : UnknownYesNo >c : Choice b = a; >b = a : YesNo ->b : Choice +>b : UnknownYesNo >a : YesNo c = a; @@ -58,134 +58,134 @@ function f2(a: YesNo, b: UnknownYesNo, c: Choice) { >a : YesNo c = b; ->c = b : YesNo +>c = b : Choice.Yes | Choice.No >c : Choice ->b : YesNo +>b : Choice.Yes | Choice.No } function f3(a: Choice.Yes, b: UnknownYesNo) { >f3 : (a: Choice.Yes, b: UnknownYesNo) => void >a : Choice.Yes >Choice : any ->b : Choice +>b : UnknownYesNo var x = a + b; >x : number >a + b : number >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var x = a - b; >x : number >a - b : number >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var x = a * b; >x : number >a * b : number >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var x = a / b; >x : number >a / b : number >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var x = a % b; >x : number >a % b : number >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var x = a | b; >x : number >a | b : number >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var x = a & b; >x : number >a & b : number >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var x = a ^ b; >x : number >a ^ b : number >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var x = -b; >x : number >-b : number ->b : Choice +>b : UnknownYesNo var x = ~b; >x : number >~b : number ->b : Choice +>b : UnknownYesNo var y = a == b; >y : boolean >a == b : boolean >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var y = a != b; >y : boolean >a != b : boolean >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var y = a === b; >y : boolean >a === b : boolean >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var y = a !== b; >y : boolean >a !== b : boolean >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var y = a > b; >y : boolean >a > b : boolean >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var y = a < b; >y : boolean >a < b : boolean >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var y = a >= b; >y : boolean >a >= b : boolean >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var y = a <= b; >y : boolean >a <= b : boolean >a : Choice.Yes ->b : Choice +>b : UnknownYesNo var y = !b; >y : boolean >!b : boolean ->b : Choice +>b : UnknownYesNo } function f4(a: Choice.Yes, b: UnknownYesNo) { >f4 : (a: Choice.Yes, b: UnknownYesNo) => void >a : Choice.Yes >Choice : any ->b : Choice +>b : UnknownYesNo a++; >a++ : number @@ -213,7 +213,7 @@ declare function g(x: Choice): number; function f5(a: YesNo, b: UnknownYesNo, c: Choice) { >f5 : (a: YesNo, b: UnknownYesNo, c: Choice) => void >a : YesNo ->b : Choice +>b : UnknownYesNo >c : Choice var z1 = g(Choice.Yes); @@ -242,7 +242,7 @@ function f5(a: YesNo, b: UnknownYesNo, c: Choice) { >z4 : number >g(b) : number >g : { (x: Choice.Yes): string; (x: Choice.No): boolean; (x: Choice): number; } ->b : Choice +>b : UnknownYesNo var z5 = g(c); >z5 : number @@ -309,13 +309,13 @@ function f11(x: YesNo) { function f12(x: UnknownYesNo) { >f12 : (x: UnknownYesNo) => void ->x : Choice +>x : UnknownYesNo if (x) { ->x : Choice +>x : UnknownYesNo x; ->x : YesNo +>x : Choice.Yes | Choice.No } else { x; @@ -325,11 +325,11 @@ function f12(x: UnknownYesNo) { function f13(x: UnknownYesNo) { >f13 : (x: UnknownYesNo) => void ->x : Choice +>x : UnknownYesNo if (x === Choice.Yes) { >x === Choice.Yes : boolean ->x : Choice +>x : UnknownYesNo >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes @@ -361,9 +361,9 @@ function f20(x: Item) { >x : Item switch (x.kind) { ->x.kind : YesNo +>x.kind : Choice.Yes | Choice.No >x : Item ->kind : YesNo +>kind : Choice.Yes | Choice.No case Choice.Yes: return x.a; >Choice.Yes : Choice.Yes @@ -388,9 +388,9 @@ function f21(x: Item) { >x : Item switch (x.kind) { ->x.kind : YesNo +>x.kind : Choice.Yes | Choice.No >x : Item ->kind : YesNo +>kind : Choice.Yes | Choice.No case Choice.Yes: return x.a; >Choice.Yes : Choice.Yes diff --git a/tests/baselines/reference/enumLiteralTypes3.errors.txt b/tests/baselines/reference/enumLiteralTypes3.errors.txt index 8d4007530a8dc..1ba3e3fd79847 100644 --- a/tests/baselines/reference/enumLiteralTypes3.errors.txt +++ b/tests/baselines/reference/enumLiteralTypes3.errors.txt @@ -1,8 +1,10 @@ tests/cases/conformance/types/literal/enumLiteralTypes3.ts(10,5): error TS2322: Type 'YesNo' is not assignable to type 'Choice.Yes'. Type 'Choice.No' is not assignable to type 'Choice.Yes'. -tests/cases/conformance/types/literal/enumLiteralTypes3.ts(11,5): error TS2322: Type 'Choice' is not assignable to type 'Choice.Yes'. +tests/cases/conformance/types/literal/enumLiteralTypes3.ts(11,5): error TS2322: Type 'UnknownYesNo' is not assignable to type 'Choice.Yes'. + Type 'Choice.Unknown' is not assignable to type 'Choice.Yes'. tests/cases/conformance/types/literal/enumLiteralTypes3.ts(12,5): error TS2322: Type 'Choice' is not assignable to type 'Choice.Yes'. -tests/cases/conformance/types/literal/enumLiteralTypes3.ts(18,5): error TS2322: Type 'Choice' is not assignable to type 'YesNo'. +tests/cases/conformance/types/literal/enumLiteralTypes3.ts(18,5): error TS2322: Type 'UnknownYesNo' is not assignable to type 'YesNo'. + Type 'Choice.Unknown' is not assignable to type 'YesNo'. tests/cases/conformance/types/literal/enumLiteralTypes3.ts(19,5): error TS2322: Type 'Choice' is not assignable to type 'YesNo'. tests/cases/conformance/types/literal/enumLiteralTypes3.ts(37,5): error TS2322: Type 'Choice.Unknown' is not assignable to type 'Choice.Yes'. tests/cases/conformance/types/literal/enumLiteralTypes3.ts(39,5): error TS2322: Type 'Choice.No' is not assignable to type 'Choice.Yes'. @@ -31,7 +33,8 @@ tests/cases/conformance/types/literal/enumLiteralTypes3.ts(96,14): error TS2678: !!! error TS2322: Type 'Choice.No' is not assignable to type 'Choice.Yes'. a = c; ~ -!!! error TS2322: Type 'Choice' is not assignable to type 'Choice.Yes'. +!!! error TS2322: Type 'UnknownYesNo' is not assignable to type 'Choice.Yes'. +!!! error TS2322: Type 'Choice.Unknown' is not assignable to type 'Choice.Yes'. a = d; ~ !!! error TS2322: Type 'Choice' is not assignable to type 'Choice.Yes'. @@ -42,7 +45,8 @@ tests/cases/conformance/types/literal/enumLiteralTypes3.ts(96,14): error TS2678: b = b; b = c; ~ -!!! error TS2322: Type 'Choice' is not assignable to type 'YesNo'. +!!! error TS2322: Type 'UnknownYesNo' is not assignable to type 'YesNo'. +!!! error TS2322: Type 'Choice.Unknown' is not assignable to type 'YesNo'. b = d; ~ !!! error TS2322: Type 'Choice' is not assignable to type 'YesNo'. diff --git a/tests/baselines/reference/enumLiteralTypes3.types b/tests/baselines/reference/enumLiteralTypes3.types index 4a5421bb77853..04b5ceb0697cf 100644 --- a/tests/baselines/reference/enumLiteralTypes3.types +++ b/tests/baselines/reference/enumLiteralTypes3.types @@ -15,12 +15,12 @@ type YesNo = Choice.Yes | Choice.No; >Choice : any type NoYes = Choice.No | Choice.Yes; ->NoYes : YesNo +>NoYes : NoYes >Choice : any >Choice : any type UnknownYesNo = Choice.Unknown | Choice.Yes | Choice.No; ->UnknownYesNo : Choice +>UnknownYesNo : UnknownYesNo >Choice : any >Choice : any >Choice : any @@ -29,7 +29,7 @@ function f1(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f1 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice a = a; @@ -43,9 +43,9 @@ function f1(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >b : YesNo a = c; ->a = c : Choice +>a = c : UnknownYesNo >a : Choice.Yes ->c : Choice +>c : UnknownYesNo a = d; >a = d : Choice @@ -57,7 +57,7 @@ function f2(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f2 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice b = a; @@ -71,9 +71,9 @@ function f2(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >b : Choice.Yes b = c; ->b = c : Choice +>b = c : UnknownYesNo >b : YesNo ->c : Choice +>c : UnknownYesNo b = d; >b = d : Choice @@ -85,27 +85,27 @@ function f3(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f3 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice c = a; >c = a : Choice.Yes ->c : Choice +>c : UnknownYesNo >a : Choice.Yes c = b; >c = b : YesNo ->c : Choice +>c : UnknownYesNo >b : YesNo c = c; ->c = c : YesNo ->c : Choice ->c : YesNo +>c = c : Choice.Yes | Choice.No +>c : UnknownYesNo +>c : Choice.Yes | Choice.No c = d; >c = d : Choice ->c : Choice +>c : UnknownYesNo >d : Choice } @@ -113,7 +113,7 @@ function f4(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f4 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice d = a; @@ -127,9 +127,9 @@ function f4(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >b : YesNo d = c; ->d = c : Choice +>d = c : UnknownYesNo >d : Choice ->c : Choice +>c : UnknownYesNo d = d; >d = d : Choice @@ -141,7 +141,7 @@ function f5(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f5 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice a = Choice.Unknown; @@ -188,21 +188,21 @@ function f5(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { c = Choice.Unknown; >c = Choice.Unknown : Choice.Unknown ->c : Choice +>c : UnknownYesNo >Choice.Unknown : Choice.Unknown >Choice : typeof Choice >Unknown : Choice.Unknown c = Choice.Yes; >c = Choice.Yes : Choice.Yes ->c : Choice +>c : UnknownYesNo >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes c = Choice.No; >c = Choice.No : Choice.No ->c : Choice +>c : UnknownYesNo >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No @@ -233,7 +233,7 @@ function f6(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f6 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice a === Choice.Unknown; @@ -280,21 +280,21 @@ function f6(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { c === Choice.Unknown; >c === Choice.Unknown : boolean ->c : Choice +>c : UnknownYesNo >Choice.Unknown : Choice.Unknown >Choice : typeof Choice >Unknown : Choice.Unknown c === Choice.Yes; >c === Choice.Yes : boolean ->c : Choice +>c : UnknownYesNo >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes c === Choice.No; >c === Choice.No : boolean ->c : Choice +>c : UnknownYesNo >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No @@ -325,7 +325,7 @@ function f7(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f7 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice a === a; @@ -341,7 +341,7 @@ function f7(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { a === c; >a === c : boolean >a : Choice.Yes ->c : Choice +>c : UnknownYesNo a === d; >a === d : boolean @@ -361,7 +361,7 @@ function f7(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { b === c; >b === c : boolean >b : YesNo ->c : Choice +>c : UnknownYesNo b === d; >b === d : boolean @@ -370,22 +370,22 @@ function f7(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { c === a; >c === a : boolean ->c : Choice +>c : UnknownYesNo >a : Choice.Yes c === b; >c === b : boolean ->c : Choice +>c : UnknownYesNo >b : YesNo c === c; >c === c : boolean ->c : Choice ->c : Choice +>c : UnknownYesNo +>c : UnknownYesNo c === d; >c === d : boolean ->c : Choice +>c : UnknownYesNo >d : Choice d === a; @@ -401,7 +401,7 @@ function f7(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { d === c; >d === c : boolean >d : Choice ->c : Choice +>c : UnknownYesNo d === d; >d === d : boolean @@ -469,10 +469,10 @@ function f11(x: YesNo): YesNo { function f12(x: UnknownYesNo): UnknownYesNo { >f12 : (x: UnknownYesNo) => UnknownYesNo ->x : Choice +>x : UnknownYesNo switch (x) { ->x : Choice +>x : UnknownYesNo case Choice.Unknown: return x; >Choice.Unknown : Choice.Unknown diff --git a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types index 9f3535423d90a..3893ea1999e27 100644 --- a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types +++ b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types @@ -4,9 +4,9 @@ // Excess property error expected here Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }); >Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >window : Window & typeof globalThis >"prop" : "prop" >{ value: "v1.0.0", readonly: false } : { value: string; readonly: boolean; } diff --git a/tests/baselines/reference/expressionTypeNodeShouldError.types b/tests/baselines/reference/expressionTypeNodeShouldError.types index 8da4edff59826..dacaae1f19e96 100644 --- a/tests/baselines/reference/expressionTypeNodeShouldError.types +++ b/tests/baselines/reference/expressionTypeNodeShouldError.types @@ -31,9 +31,9 @@ class C { const nodes = document.getElementsByTagName("li"); >nodes : HTMLCollectionOf >document.getElementsByTagName("li") : HTMLCollectionOf ->document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >document : Document ->getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >"li" : "li" type ItemType = "".typeof(nodes.item(0)); @@ -72,9 +72,9 @@ class C2 { const nodes2 = document.getElementsByTagName("li"); >nodes2 : HTMLCollectionOf >document.getElementsByTagName("li") : HTMLCollectionOf ->document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >document : Document ->getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >"li" : "li" type ItemType2 = 4..typeof(nodes.item(0)); @@ -114,9 +114,9 @@ class C3 { const nodes3 = document.getElementsByTagName("li"); >nodes3 : HTMLCollectionOf >document.getElementsByTagName("li") : HTMLCollectionOf ->document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >document : Document ->getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >"li" : "li" type ItemType3 = true.typeof(nodes.item(0)); diff --git a/tests/baselines/reference/fixSignatureCaching.types b/tests/baselines/reference/fixSignatureCaching.types index cf367966c0260..0a0d657a64d10 100644 --- a/tests/baselines/reference/fixSignatureCaching.types +++ b/tests/baselines/reference/fixSignatureCaching.types @@ -1068,12 +1068,12 @@ define(function () { }; var hasOwnProp = Object.prototype.hasOwnProperty, ->hasOwnProp : (v: string | number | symbol) => boolean ->Object.prototype.hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProp : (v: PropertyKey) => boolean +>Object.prototype.hasOwnProperty : (v: PropertyKey) => boolean >Object.prototype : Object >Object : ObjectConstructor >prototype : Object ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean isArray; >isArray : any @@ -1249,7 +1249,7 @@ define(function () { if (hasOwnProp.call(object, key)) { >hasOwnProp.call(object, key) : any >hasOwnProp.call : (this: Function, thisArg: any, ...argArray: any[]) => any ->hasOwnProp : (v: string | number | symbol) => boolean +>hasOwnProp : (v: PropertyKey) => boolean >call : (this: Function, thisArg: any, ...argArray: any[]) => any >object : any >key : string @@ -1296,7 +1296,7 @@ define(function () { if (hasOwnProp.call(mobileDetectRules.props, key)) { >hasOwnProp.call(mobileDetectRules.props, key) : any >hasOwnProp.call : (this: Function, thisArg: any, ...argArray: any[]) => any ->hasOwnProp : (v: string | number | symbol) => boolean +>hasOwnProp : (v: PropertyKey) => boolean >call : (this: Function, thisArg: any, ...argArray: any[]) => any >mobileDetectRules.props : any >mobileDetectRules : any @@ -1487,7 +1487,7 @@ define(function () { if (hasOwnProp.call(rules, key)) { >hasOwnProp.call(rules, key) : any >hasOwnProp.call : (this: Function, thisArg: any, ...argArray: any[]) => any ->hasOwnProp : (v: string | number | symbol) => boolean +>hasOwnProp : (v: PropertyKey) => boolean >call : (this: Function, thisArg: any, ...argArray: any[]) => any >rules : any >key : string @@ -1538,7 +1538,7 @@ define(function () { if (hasOwnProp.call(rules, key)) { >hasOwnProp.call(rules, key) : any >hasOwnProp.call : (this: Function, thisArg: any, ...argArray: any[]) => any ->hasOwnProp : (v: string | number | symbol) => boolean +>hasOwnProp : (v: PropertyKey) => boolean >call : (this: Function, thisArg: any, ...argArray: any[]) => any >rules : any >key : string @@ -1598,7 +1598,7 @@ define(function () { if (hasOwnProp.call(props, propertyName)) { >hasOwnProp.call(props, propertyName) : any >hasOwnProp.call : (this: Function, thisArg: any, ...argArray: any[]) => any ->hasOwnProp : (v: string | number | symbol) => boolean +>hasOwnProp : (v: PropertyKey) => boolean >call : (this: Function, thisArg: any, ...argArray: any[]) => any >props : any >propertyName : any diff --git a/tests/baselines/reference/genericObjectRest.types b/tests/baselines/reference/genericObjectRest.types index c2fcaad7cb87c..57440d3eff159 100644 --- a/tests/baselines/reference/genericObjectRest.types +++ b/tests/baselines/reference/genericObjectRest.types @@ -94,7 +94,7 @@ type Item = { a: string, b: number, c: boolean }; >c : boolean function f4(obj: Item, k1: K1, k2: K2) { ->f4 : (obj: Item, k1: K1, k2: K2) => void +>f4 : (obj: Item, k1: K1, k2: K2) => void >obj : Item >k1 : K1 >k2 : K2 diff --git a/tests/baselines/reference/genericRestParameters1.types b/tests/baselines/reference/genericRestParameters1.types index 89352e1fab239..1e45a3c86621e 100644 --- a/tests/baselines/reference/genericRestParameters1.types +++ b/tests/baselines/reference/genericRestParameters1.types @@ -733,35 +733,35 @@ declare var events: EventType; events.emit('move', 10, 'left'); >events.emit('move', 10, 'left') : void ->events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >events : EventType ->emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >'move' : "move" >10 : 10 >'left' : "left" events.emit('jump', 20, 'up'); >events.emit('jump', 20, 'up') : void ->events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >events : EventType ->emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >'jump' : "jump" >20 : 20 >'up' : "up" events.emit('stop', 'Bye!'); >events.emit('stop', 'Bye!') : void ->events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >events : EventType ->emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >'stop' : "stop" >'Bye!' : "Bye!" events.emit('done'); >events.emit('done') : void ->events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >events : EventType ->emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >'done' : "done" // Repro from #25871 diff --git a/tests/baselines/reference/getterSetterNonAccessor.types b/tests/baselines/reference/getterSetterNonAccessor.types index 67d186b21e8cb..1d9484f9bc9a6 100644 --- a/tests/baselines/reference/getterSetterNonAccessor.types +++ b/tests/baselines/reference/getterSetterNonAccessor.types @@ -9,9 +9,9 @@ function setFunc(v){} Object.defineProperty({}, "0", ({ >Object.defineProperty({}, "0", ({ get: getFunc, set: setFunc, configurable: true })) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >{} : {} >"0" : "0" >({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor diff --git a/tests/baselines/reference/importAliasModuleExports.types b/tests/baselines/reference/importAliasModuleExports.types index 1a850c7c6f02d..eff243dee47db 100644 --- a/tests/baselines/reference/importAliasModuleExports.types +++ b/tests/baselines/reference/importAliasModuleExports.types @@ -42,9 +42,9 @@ A.prototype.func = function() { this._func = 0; } Object.defineProperty(A.prototype, "def", { value: 0 }); >Object.defineProperty(A.prototype, "def", { value: 0 }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >A.prototype : A >A : typeof A >prototype : A diff --git a/tests/baselines/reference/indexerConstraints2.types b/tests/baselines/reference/indexerConstraints2.types index 1f5423b594878..9c9222816379e 100644 --- a/tests/baselines/reference/indexerConstraints2.types +++ b/tests/baselines/reference/indexerConstraints2.types @@ -116,7 +116,7 @@ interface R { interface S { [u: "foo" | "bar"]: A; ->u : IndexableUnion +>u : "foo" | "bar" } type Key = string; diff --git a/tests/baselines/reference/indexingTypesWithNever.types b/tests/baselines/reference/indexingTypesWithNever.types index de66f51bdc825..a4d97cf55780a 100644 --- a/tests/baselines/reference/indexingTypesWithNever.types +++ b/tests/baselines/reference/indexingTypesWithNever.types @@ -214,7 +214,7 @@ type O0 = {}; >O0 : O0 type O3Names = OptionalPropNames; // expect 'a' | 'b' ->O3Names : RequiredPropNames +>O3Names : OptionalPropNames type O2Names = OptionalPropNames; // expect 'a' >O2Names : "a" diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.types b/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.types index deb0288d52567..5ccfc66940c45 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.types +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes3.types @@ -176,7 +176,7 @@ export type DiagnosticSeverity = 1 | 2 | 3 | 4; export interface Diagnostic { severity?: DiagnosticSeverity; ->severity : 1 | 2 | 3 | 4 | undefined +>severity : DiagnosticSeverity | undefined code?: number | string; >code : string | number | undefined @@ -312,10 +312,10 @@ let zz: Box = box({ type: 'draw' }); >'draw' : "draw" type WinType = 'win' | 'draw'; ->WinType : "win" | "draw" +>WinType : WinType let yy: Box = box('draw'); ->yy : Box<"win" | "draw"> +>yy : Box >box('draw') : Box<"draw"> >box : (value: T) => Box >'draw' : "draw" diff --git a/tests/baselines/reference/inlinedAliasAssignableToConstraintSameAsAlias.types b/tests/baselines/reference/inlinedAliasAssignableToConstraintSameAsAlias.types index d337fbc718abb..0963420af3ac4 100644 --- a/tests/baselines/reference/inlinedAliasAssignableToConstraintSameAsAlias.types +++ b/tests/baselines/reference/inlinedAliasAssignableToConstraintSameAsAlias.types @@ -10,7 +10,7 @@ interface RelationFields { >z : A[] } type Name = keyof RelationFields; ->Name : "x" | "y" | "z" +>Name : keyof RelationFields type ShouldA = RF[N] extends A[] >ShouldA : ShouldA @@ -31,7 +31,7 @@ class A { >z : A[] whereRelated< // Works // Type is same as A1, but is not assignable to type A ->whereRelated : >() => number +>whereRelated : >() => number RF extends RelationFields = RelationFields, N extends Name = Name, diff --git a/tests/baselines/reference/instanceOfAssignability.types b/tests/baselines/reference/instanceOfAssignability.types index a927b3bc7d87c..9c29abbe89491 100644 --- a/tests/baselines/reference/instanceOfAssignability.types +++ b/tests/baselines/reference/instanceOfAssignability.types @@ -104,8 +104,8 @@ function fn4(x: Base|Derived2) { // 1.5: y: {} // Want: Derived1 let y = x; ->y : (Base & Derived1) | (Derived2 & Derived1) ->x : (Base & Derived1) | (Derived2 & Derived1) +>y : (Base | Derived2) & Derived1 +>x : (Base | Derived2) & Derived1 } } diff --git a/tests/baselines/reference/instantiateContextualTypes.types b/tests/baselines/reference/instantiateContextualTypes.types index 175d1cdb959d0..ff6154c78589c 100644 --- a/tests/baselines/reference/instantiateContextualTypes.types +++ b/tests/baselines/reference/instantiateContextualTypes.types @@ -185,7 +185,7 @@ type O = { >O : O on

(x: P, callback: R[P]): void; ->on :

(x: P, callback: R[P]) => void +>on :

(x: P, callback: R[P]) => void >x : P >callback : R[P] @@ -196,9 +196,9 @@ declare var x: O; x.on('a', a => {}); >x.on('a', a => {}) : void ->x.on :

(x: P, callback: R[P]) => void +>x.on :

(x: P, callback: R[P]) => void >x : O ->on :

(x: P, callback: R[P]) => void +>on :

(x: P, callback: R[P]) => void >'a' : "a" >a => {} : (a: number) => void >a : number @@ -339,7 +339,7 @@ class Interesting { >() : Promise => { return Promise.resolve().then(() => { if (1 < 2) { return 'SOMETHING'; } return 'ELSE'; }); } : () => Promise return Promise.resolve().then(() => { ->Promise.resolve().then(() => { if (1 < 2) { return 'SOMETHING'; } return 'ELSE'; }) : Promise +>Promise.resolve().then(() => { if (1 < 2) { return 'SOMETHING'; } return 'ELSE'; }) : Promise<"SOMETHING" | "ELSE"> >Promise.resolve().then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >Promise.resolve() : Promise >Promise.resolve : { (): Promise; (value: T | PromiseLike): Promise; } @@ -366,7 +366,7 @@ class Interesting { >() : Promise => { return Promise.resolve().then(() => { return 'ELSE'; }); } : () => Promise return Promise.resolve().then(() => { ->Promise.resolve().then(() => { return 'ELSE'; }) : Promise +>Promise.resolve().then(() => { return 'ELSE'; }) : Promise<"SOMETHING" | "ELSE"> >Promise.resolve().then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >Promise.resolve() : Promise >Promise.resolve : { (): Promise; (value: T | PromiseLike): Promise; } @@ -385,7 +385,7 @@ class Interesting { >() : Promise => { return Promise.resolve().then(() => { if (1 < 2) { return 'SOMETHING'; } return 'SOMETHING'; }); } : () => Promise return Promise.resolve().then(() => { ->Promise.resolve().then(() => { if (1 < 2) { return 'SOMETHING'; } return 'SOMETHING'; }) : Promise +>Promise.resolve().then(() => { if (1 < 2) { return 'SOMETHING'; } return 'SOMETHING'; }) : Promise<"SOMETHING" | "ELSE"> >Promise.resolve().then : (onfulfilled?: ((value: void) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise >Promise.resolve() : Promise >Promise.resolve : { (): Promise; (value: T | PromiseLike): Promise; } diff --git a/tests/baselines/reference/intersectionAndUnionTypes.errors.txt b/tests/baselines/reference/intersectionAndUnionTypes.errors.txt index 7de8735f6406c..e700e7c472109 100644 --- a/tests/baselines/reference/intersectionAndUnionTypes.errors.txt +++ b/tests/baselines/reference/intersectionAndUnionTypes.errors.txt @@ -22,24 +22,24 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(28,1): e tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(29,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C | D'. Type 'A & B' is not assignable to type 'C | D'. Property 'd' is missing in type 'A & B' but required in type 'D'. -tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(31,1): error TS2322: Type 'A & B' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. +tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(31,1): error TS2322: Type 'A & B' is not assignable to type '(A | B) & (C | D)'. Type 'A & B' is not assignable to type 'B & D'. Property 'd' is missing in type 'A & B' but required in type 'D'. -tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(32,1): error TS2322: Type 'A | B' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. - Type 'A' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. +tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(32,1): error TS2322: Type 'A | B' is not assignable to type '(A | B) & (C | D)'. + Type 'A' is not assignable to type '(A | B) & (C | D)'. Type 'A' is not assignable to type 'A & D'. Property 'd' is missing in type 'A' but required in type 'D'. -tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(33,1): error TS2322: Type 'C & D' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. +tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(33,1): error TS2322: Type 'C & D' is not assignable to type '(A | B) & (C | D)'. Type 'C & D' is not assignable to type 'B & D'. Property 'b' is missing in type 'C & D' but required in type 'B'. -tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(34,1): error TS2322: Type 'C | D' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. - Type 'C' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. +tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(34,1): error TS2322: Type 'C | D' is not assignable to type '(A | B) & (C | D)'. + Type 'C' is not assignable to type '(A | B) & (C | D)'. Type 'C' is not assignable to type 'B & C'. Property 'b' is missing in type 'C' but required in type 'B'. -tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(35,1): error TS2322: Type '(A & C) | (A & D) | (B & C) | (B & D)' is not assignable to type 'A & B'. +tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(35,1): error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'A & B'. Type 'A & C' is not assignable to type 'A & B'. Property 'b' is missing in type 'A & C' but required in type 'B'. -tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): error TS2322: Type '(A & C) | (A & D) | (B & C) | (B & D)' is not assignable to type 'C & D'. +tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'C & D'. Type 'A & C' is not assignable to type 'C & D'. Property 'd' is missing in type 'A & C' but required in type 'D'. @@ -116,40 +116,40 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e y = anb; ~ -!!! error TS2322: Type 'A & B' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. +!!! error TS2322: Type 'A & B' is not assignable to type '(A | B) & (C | D)'. !!! error TS2322: Type 'A & B' is not assignable to type 'B & D'. !!! error TS2322: Property 'd' is missing in type 'A & B' but required in type 'D'. !!! related TS2728 tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts:4:15: 'd' is declared here. y = aob; ~ -!!! error TS2322: Type 'A | B' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. -!!! error TS2322: Type 'A' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. +!!! error TS2322: Type 'A | B' is not assignable to type '(A | B) & (C | D)'. +!!! error TS2322: Type 'A' is not assignable to type '(A | B) & (C | D)'. !!! error TS2322: Type 'A' is not assignable to type 'A & D'. !!! error TS2322: Property 'd' is missing in type 'A' but required in type 'D'. !!! related TS2728 tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts:4:15: 'd' is declared here. y = cnd; ~ -!!! error TS2322: Type 'C & D' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. +!!! error TS2322: Type 'C & D' is not assignable to type '(A | B) & (C | D)'. !!! error TS2322: Type 'C & D' is not assignable to type 'B & D'. !!! error TS2322: Property 'b' is missing in type 'C & D' but required in type 'B'. !!! related TS2728 tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts:2:15: 'b' is declared here. y = cod; ~ -!!! error TS2322: Type 'C | D' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. -!!! error TS2322: Type 'C' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. +!!! error TS2322: Type 'C | D' is not assignable to type '(A | B) & (C | D)'. +!!! error TS2322: Type 'C' is not assignable to type '(A | B) & (C | D)'. !!! error TS2322: Type 'C' is not assignable to type 'B & C'. !!! error TS2322: Property 'b' is missing in type 'C' but required in type 'B'. !!! related TS2728 tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts:2:15: 'b' is declared here. anb = y; ~~~ -!!! error TS2322: Type '(A & C) | (A & D) | (B & C) | (B & D)' is not assignable to type 'A & B'. +!!! error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'A & B'. !!! error TS2322: Type 'A & C' is not assignable to type 'A & B'. !!! error TS2322: Property 'b' is missing in type 'A & C' but required in type 'B'. !!! related TS2728 tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts:2:15: 'b' is declared here. aob = y; // Ok cnd = y; ~~~ -!!! error TS2322: Type '(A & C) | (A & D) | (B & C) | (B & D)' is not assignable to type 'C & D'. +!!! error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'C & D'. !!! error TS2322: Type 'A & C' is not assignable to type 'C & D'. !!! error TS2322: Property 'd' is missing in type 'A & C' but required in type 'D'. !!! related TS2728 tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts:4:15: 'd' is declared here. diff --git a/tests/baselines/reference/intersectionAndUnionTypes.types b/tests/baselines/reference/intersectionAndUnionTypes.types index bde88bd1c7b76..0109cd1f7892e 100644 --- a/tests/baselines/reference/intersectionAndUnionTypes.types +++ b/tests/baselines/reference/intersectionAndUnionTypes.types @@ -39,7 +39,7 @@ var x: A & B | C & D; >x : (A & B) | (C & D) var y: (A | B) & (C | D); ->y : (A & C) | (A & D) | (B & C) | (B & D) +>y : (A | B) & (C | D) a = anb; // Ok >a = anb : A & B @@ -103,41 +103,41 @@ cod = x; y = anb; >y = anb : A & B ->y : (A & C) | (A & D) | (B & C) | (B & D) +>y : (A | B) & (C | D) >anb : A & B y = aob; >y = aob : A | B ->y : (A & C) | (A & D) | (B & C) | (B & D) +>y : (A | B) & (C | D) >aob : A | B y = cnd; >y = cnd : C & D ->y : (A & C) | (A & D) | (B & C) | (B & D) +>y : (A | B) & (C | D) >cnd : C & D y = cod; >y = cod : C | D ->y : (A & C) | (A & D) | (B & C) | (B & D) +>y : (A | B) & (C | D) >cod : C | D anb = y; ->anb = y : (A & C) | (A & D) | (B & C) | (B & D) +>anb = y : (A | B) & (C | D) >anb : A & B ->y : (A & C) | (A & D) | (B & C) | (B & D) +>y : (A | B) & (C | D) aob = y; // Ok ->aob = y : (A & C) | (A & D) | (B & C) | (B & D) +>aob = y : (A | B) & (C | D) >aob : A | B ->y : (A & C) | (A & D) | (B & C) | (B & D) +>y : (A | B) & (C | D) cnd = y; ->cnd = y : (A & C) | (A & D) | (B & C) | (B & D) +>cnd = y : (A | B) & (C | D) >cnd : C & D ->y : (A & C) | (A & D) | (B & C) | (B & D) +>y : (A | B) & (C | D) cod = y; // Ok ->cod = y : (A & C) | (A & D) | (B & C) | (B & D) +>cod = y : (A | B) & (C | D) >cod : C | D ->y : (A & C) | (A & D) | (B & C) | (B & D) +>y : (A | B) & (C | D) diff --git a/tests/baselines/reference/intersectionReduction.types b/tests/baselines/reference/intersectionReduction.types index c1ae0685836b6..83073fd6fc2f4 100644 --- a/tests/baselines/reference/intersectionReduction.types +++ b/tests/baselines/reference/intersectionReduction.types @@ -31,7 +31,7 @@ type T7 = string & 'a' & number & 10 & symbol & typeof sym1; // never >sym1 : unique symbol type T10 = string & ('a' | 'b'); // 'a' | 'b' ->T10 : "a" | "b" +>T10 : T10 type T11 = (string | number) & ('a' | 10); // 'a' | 10 >T11 : "a" | 10 @@ -143,7 +143,7 @@ type K1 = keyof (A & B); // string | number | symbol >K1 : string | number | symbol type K2 = keyof A | keyof B; // 'kind' | 'foo' ->K2 : "kind" | "foo" +>K2 : K2 type Merge1 = { [P in keyof (T & U)]: P extends keyof T ? T[P] : U[P & keyof U] } >Merge1 : Merge1 diff --git a/tests/baselines/reference/intersectionReductionStrict.types b/tests/baselines/reference/intersectionReductionStrict.types index 4c7b5b0b4c378..db7de631231e5 100644 --- a/tests/baselines/reference/intersectionReductionStrict.types +++ b/tests/baselines/reference/intersectionReductionStrict.types @@ -31,7 +31,7 @@ type T7 = string & 'a' & number & 10 & symbol & typeof sym1; // never >sym1 : unique symbol type T10 = string & ('a' | 'b'); // 'a' | 'b' ->T10 : "a" | "b" +>T10 : T10 type T11 = (string | number) & ('a' | 10); // 'a' | 10 >T11 : "a" | 10 @@ -143,7 +143,7 @@ type K1 = keyof (A & B); // string | number | symbol >K1 : string | number | symbol type K2 = keyof A | keyof B; // 'kind' | 'foo' ->K2 : "kind" | "foo" +>K2 : K2 type Merge1 = { [P in keyof (T & U)]: P extends keyof T ? T[P] : U[P & keyof U] } >Merge1 : Merge1 diff --git a/tests/baselines/reference/intersectionTypeNormalization.types b/tests/baselines/reference/intersectionTypeNormalization.types index 2db326f8ba8d6..c6e5f6dbaf561 100644 --- a/tests/baselines/reference/intersectionTypeNormalization.types +++ b/tests/baselines/reference/intersectionTypeNormalization.types @@ -16,10 +16,10 @@ type X1 = (A | B) & (C | D); >X1 : X1 type X2 = A & (C | D) | B & (C | D) ->X2 : X1 +>X2 : X2 type X3 = A & C | A & D | B & C | B & D; ->X3 : X1 +>X3 : X3 var x: X1; >x : X1 @@ -41,10 +41,10 @@ type Y1 = (A | X & Y) & (C | D); >Y1 : Y1 type Y2 = A & (C | D) | X & Y & (C | D) ->Y2 : Y1 +>Y2 : Y2 type Y3 = A & C | A & D | X & Y & C | X & Y & D; ->Y3 : Y1 +>Y3 : Y3 var y: Y1; >y : Y1 @@ -66,13 +66,13 @@ type Z1 = (A | X & (M | N)) & (C | D); >Z1 : Z1 type Z2 = A & (C | D) | X & (M | N) & (C | D) ->Z2 : Z1 +>Z2 : Z2 type Z3 = A & C | A & D | X & (M | N) & C | X & (M | N) & D; ->Z3 : Z1 +>Z3 : Z3 type Z4 = A & C | A & D | X & M & C | X & N & C | X & M & D | X & N & D; ->Z4 : Z1 +>Z4 : Z4 var z: Z1; >z : Z1 diff --git a/tests/baselines/reference/intersectionWithUnionConstraint.types b/tests/baselines/reference/intersectionWithUnionConstraint.types index b209913e75bda..ba079e2bf81aa 100644 --- a/tests/baselines/reference/intersectionWithUnionConstraint.types +++ b/tests/baselines/reference/intersectionWithUnionConstraint.types @@ -48,20 +48,20 @@ type T1 = (string | number | undefined) & (string | null | undefined); // strin function f3(x: T & (number | object | undefined)) { >f3 : (x: T & (number | object | undefined)) => void ->x : (T & undefined) | (T & number) | (T & object) +>x : T & (number | object | undefined) const y: number | undefined = x; >y : number | undefined ->x : (T & undefined) | (T & number) | (T & object) +>x : T & (number | object | undefined) } function f4(x: T & (number | object)) { >f4 : (x: T & (number | object)) => void ->x : (T & number) | (T & object) +>x : T & (number | object) const y: number = x; >y : number ->x : (T & number) | (T & object) +>x : T & (number | object) } function f5(x: keyof T & U) { diff --git a/tests/baselines/reference/intersectionsOfLargeUnions.types b/tests/baselines/reference/intersectionsOfLargeUnions.types index d42586516ea8f..98c98f03f177e 100644 --- a/tests/baselines/reference/intersectionsOfLargeUnions.types +++ b/tests/baselines/reference/intersectionsOfLargeUnions.types @@ -24,7 +24,7 @@ export function assertIsElement(node: Node | null): node is Element { } export function assertNodeTagName< ->assertNodeTagName : (node: Node | null, tagName: T) => node is U +>assertNodeTagName : (node: Node | null, tagName: T) => node is U T extends keyof ElementTagNameMap, U extends ElementTagNameMap[T]>(node: Node | null, tagName: T): node is U { @@ -56,7 +56,7 @@ export function assertNodeTagName< } export function assertNodeProperty< ->assertNodeProperty : (node: Node | null, tagName: T, prop: P, value: V) => void +>assertNodeProperty : (node: Node | null, tagName: T, prop: P, value: V) => void T extends keyof ElementTagNameMap, P extends keyof ElementTagNameMap[T], @@ -69,7 +69,7 @@ export function assertNodeProperty< if (assertNodeTagName(node, tagName)) { >assertNodeTagName(node, tagName) : boolean ->assertNodeTagName : (node: Node | null, tagName: T) => node is U +>assertNodeTagName : (node: Node | null, tagName: T) => node is U >node : Node | null >tagName : T diff --git a/tests/baselines/reference/intersectionsOfLargeUnions2.types b/tests/baselines/reference/intersectionsOfLargeUnions2.types index 312be060cbeb1..20423283010c0 100644 --- a/tests/baselines/reference/intersectionsOfLargeUnions2.types +++ b/tests/baselines/reference/intersectionsOfLargeUnions2.types @@ -38,7 +38,7 @@ export function assertIsElement(node: Node | null): node is Element { } export function assertNodeTagName< ->assertNodeTagName : (node: Node | null, tagName: T) => node is U +>assertNodeTagName : (node: Node | null, tagName: T) => node is U T extends keyof ElementTagNameMap, U extends ElementTagNameMap[T]>(node: Node | null, tagName: T): node is U { @@ -70,7 +70,7 @@ export function assertNodeTagName< } export function assertNodeProperty< ->assertNodeProperty : (node: Node | null, tagName: T, prop: P, value: V) => void +>assertNodeProperty : (node: Node | null, tagName: T, prop: P, value: V) => void T extends keyof ElementTagNameMap, P extends keyof ElementTagNameMap[T], @@ -83,7 +83,7 @@ export function assertNodeProperty< if (assertNodeTagName(node, tagName)) { >assertNodeTagName(node, tagName) : boolean ->assertNodeTagName : (node: Node | null, tagName: T) => node is U +>assertNodeTagName : (node: Node | null, tagName: T) => node is U >node : Node | null >tagName : T diff --git a/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types b/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types index 9c873b65d0897..b08c924117a3b 100644 --- a/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types +++ b/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types @@ -5,9 +5,9 @@ function Graphic() { Object.defineProperty(Graphic.prototype, "instance", { >Object.defineProperty(Graphic.prototype, "instance", { get: function() { return this; }}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Graphic.prototype : any >Graphic : typeof Graphic >prototype : any diff --git a/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types b/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types index 5b771cb514228..626a1aec6216b 100644 --- a/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types +++ b/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types @@ -6,9 +6,9 @@ class C { // Neither of the following should be recognized as declarations yet Object.defineProperty(this, "_prop", { value: {} }); >Object.defineProperty(this, "_prop", { value: {} }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >this : this >"_prop" : "_prop" >{ value: {} } : { value: {}; } @@ -17,9 +17,9 @@ class C { Object.defineProperty(this._prop, "num", { value: 12 }); >Object.defineProperty(this._prop, "num", { value: 12 }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >this._prop : any >this : this >_prop : any diff --git a/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types b/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types index 310e11820ed6f..9328ad0feec6e 100644 --- a/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types +++ b/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types @@ -1,9 +1,9 @@ === tests/cases/conformance/jsdoc/declarations/index.js === Object.defineProperty(module.exports, "a", { value: function a() {} }); >Object.defineProperty(module.exports, "a", { value: function a() {} }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") @@ -15,9 +15,9 @@ Object.defineProperty(module.exports, "a", { value: function a() {} }); Object.defineProperty(module.exports, "b", { value: function b() {} }); >Object.defineProperty(module.exports, "b", { value: function b() {} }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") @@ -29,9 +29,9 @@ Object.defineProperty(module.exports, "b", { value: function b() {} }); Object.defineProperty(module.exports.b, "cat", { value: "cat" }); >Object.defineProperty(module.exports.b, "cat", { value: "cat" }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports.b : () => void >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } @@ -56,9 +56,9 @@ function d(a, b) { return /** @type {*} */(null); } Object.defineProperty(module.exports, "d", { value: d }); >Object.defineProperty(module.exports, "d", { value: d }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") @@ -83,9 +83,9 @@ function e(a, b) { return /** @type {*} */(null); } Object.defineProperty(module.exports, "e", { value: e }); >Object.defineProperty(module.exports, "e", { value: e }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") @@ -107,9 +107,9 @@ function f(a) { } Object.defineProperty(module.exports, "f", { value: f }); >Object.defineProperty(module.exports, "f", { value: f }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") @@ -120,9 +120,9 @@ Object.defineProperty(module.exports, "f", { value: f }); Object.defineProperty(module.exports.f, "self", { value: module.exports.f }); >Object.defineProperty(module.exports.f, "self", { value: module.exports.f }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports.f : (a: T) => T >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } @@ -158,9 +158,9 @@ function g(a, b) { } Object.defineProperty(module.exports, "g", { value: g }); >Object.defineProperty(module.exports, "g", { value: g }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") @@ -191,9 +191,9 @@ function hh(a, b) { } Object.defineProperty(module.exports, "h", { value: hh }); >Object.defineProperty(module.exports, "h", { value: hh }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") @@ -204,9 +204,9 @@ Object.defineProperty(module.exports, "h", { value: hh }); Object.defineProperty(module.exports, "i", { value: function i(){} }); >Object.defineProperty(module.exports, "i", { value: function i(){} }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") @@ -218,9 +218,9 @@ Object.defineProperty(module.exports, "i", { value: function i(){} }); Object.defineProperty(module.exports, "ii", { value: module.exports.i }); >Object.defineProperty(module.exports, "ii", { value: module.exports.i }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") @@ -236,9 +236,9 @@ Object.defineProperty(module.exports, "ii", { value: module.exports.i }); // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings Object.defineProperty(module.exports, "jj", { value: module.exports.j }); >Object.defineProperty(module.exports, "jj", { value: module.exports.j }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") @@ -253,9 +253,9 @@ Object.defineProperty(module.exports, "jj", { value: module.exports.j }); Object.defineProperty(module.exports, "j", { value: function j() {} }); >Object.defineProperty(module.exports, "j", { value: function j() {} }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") >module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); } >exports : typeof import("tests/cases/conformance/jsdoc/declarations/index") diff --git a/tests/baselines/reference/jsDeclarationsGetterSetter.types b/tests/baselines/reference/jsDeclarationsGetterSetter.types index c426e822b125c..42c3e08e13611 100644 --- a/tests/baselines/reference/jsDeclarationsGetterSetter.types +++ b/tests/baselines/reference/jsDeclarationsGetterSetter.types @@ -42,9 +42,9 @@ export class D {} Object.defineProperty(D.prototype, "x", { >Object.defineProperty(D.prototype, "x", { get() { return 12; }}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >D.prototype : D >D : typeof D >prototype : D @@ -64,9 +64,9 @@ export class E {} Object.defineProperty(E.prototype, "x", { >Object.defineProperty(E.prototype, "x", { /** * @param {number} _arg */ set(_arg) {}}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >E.prototype : E >E : typeof E >prototype : E @@ -87,9 +87,9 @@ export class F {} Object.defineProperty(F.prototype, "x", { >Object.defineProperty(F.prototype, "x", { get() { return 12; }, /** * @param {number} _arg */ set(_arg) {}}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >F.prototype : F >F : typeof F >prototype : F diff --git a/tests/baselines/reference/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types b/tests/baselines/reference/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types index a8837c569b4ab..df5d014acfdcd 100644 --- a/tests/baselines/reference/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types +++ b/tests/baselines/reference/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types @@ -27,12 +27,12 @@ const testFnTypes = { */ function testFn(input) { >testFn : (input: testFnTypes.input) => number | null ->input : boolean | Function | myTypes.typeB +>input : boolean | myTypes.typeC if (typeof input === 'number') { >typeof input === 'number' : boolean >typeof input : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" ->input : boolean | Function | myTypes.typeB +>input : boolean | myTypes.typeC >'number' : "number" return 2 * input; diff --git a/tests/baselines/reference/jsExpandoObjectDefineProperty.types b/tests/baselines/reference/jsExpandoObjectDefineProperty.types index 3eb9a456220b8..4192b27425e4d 100644 --- a/tests/baselines/reference/jsExpandoObjectDefineProperty.types +++ b/tests/baselines/reference/jsExpandoObjectDefineProperty.types @@ -5,9 +5,9 @@ var chrome = {} Object.defineProperty(chrome, 'devtools', { value: {}, enumerable: true }) >Object.defineProperty(chrome, 'devtools', { value: {}, enumerable: true }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >chrome : typeof chrome >'devtools' : "devtools" >{ value: {}, enumerable: true } : { value: {}; enumerable: true; } diff --git a/tests/baselines/reference/jsFileESModuleWithEnumTag.types b/tests/baselines/reference/jsFileESModuleWithEnumTag.types index c3165a75f2ffc..bc66add7f507b 100644 --- a/tests/baselines/reference/jsFileESModuleWithEnumTag.types +++ b/tests/baselines/reference/jsFileESModuleWithEnumTag.types @@ -34,9 +34,9 @@ ChangeDetectionStrategy[ChangeDetectionStrategy.Default] = 'Default'; Object.defineProperty(ChangeDetectionStrategy, "aField", {value: 42}); >Object.defineProperty(ChangeDetectionStrategy, "aField", {value: 42}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >ChangeDetectionStrategy : { OnPush: number; Default: number; } >"aField" : "aField" >{value: 42} : { value: number; } diff --git a/tests/baselines/reference/jsxComplexSignatureHasApplicabilityError.types b/tests/baselines/reference/jsxComplexSignatureHasApplicabilityError.types index 7b856e56eca24..a469dc672cea7 100644 --- a/tests/baselines/reference/jsxComplexSignatureHasApplicabilityError.types +++ b/tests/baselines/reference/jsxComplexSignatureHasApplicabilityError.types @@ -39,8 +39,8 @@ export function createReactSingleSelect< >React : any return (props) => { ->(props) => { return ( > {...props} multi={false} autosize={false} value={props.value} onChange={(value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); } }} /> ); } : (props: Omit, (keyof Omit & "value") | (keyof Omit & "onChange")> & Props> & { children?: React.ReactNode; }) => JSX.Element ->props : Omit, (keyof Omit & "value") | (keyof Omit & "onChange")> & Props> & { children?: React.ReactNode; } +>(props) => { return ( > {...props} multi={false} autosize={false} value={props.value} onChange={(value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); } }} /> ); } : (props: Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; }) => JSX.Element +>props : Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; } return ( >( > {...props} multi={false} autosize={false} value={props.value} onChange={(value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); } }} /> ) : JSX.Element @@ -50,7 +50,7 @@ export function createReactSingleSelect< >ReactSelectClass : typeof ReactSelectClass {...props} ->props : Omit, (keyof Omit & "value") | (keyof Omit & "onChange")> & Props> & { children?: React.ReactNode; } +>props : Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; } multi={false} >multi : false @@ -63,7 +63,7 @@ export function createReactSingleSelect< value={props.value} >value : ExtractValueType | Option> | undefined >props.value : ExtractValueType | Option> | undefined ->props : Omit, (keyof Omit & "value") | (keyof Omit & "onChange")> & Props> & { children?: React.ReactNode; } +>props : Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; } >value : ExtractValueType | Option> | undefined onChange={(value) => { @@ -73,13 +73,13 @@ export function createReactSingleSelect< if (props.onChange) { >props.onChange : ((value: Option> | undefined) => void) | undefined ->props : Omit, (keyof Omit & "value") | (keyof Omit & "onChange")> & Props> & { children?: React.ReactNode; } +>props : Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; } >onChange : ((value: Option> | undefined) => void) | undefined props.onChange(value === null ? undefined : value); >props.onChange(value === null ? undefined : value) : void >props.onChange : (value: Option> | undefined) => void ->props : Omit, (keyof Omit & "value") | (keyof Omit & "onChange")> & Props> & { children?: React.ReactNode; } +>props : Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; } >onChange : (value: Option> | undefined) => void >value === null ? undefined : value : Option> | Options> | undefined >value === null : boolean @@ -859,7 +859,7 @@ export interface ReactSelectProps extends React.Props; ->optionComponent : React.ComponentClass, any> | React.StatelessComponent> | undefined +>optionComponent : React.ComponentType> | undefined /** * function which returns a custom way to render the options in the menu @@ -973,7 +973,7 @@ export interface ReactSelectProps extends React.Props; ->valueComponent : React.ComponentClass, any> | React.StatelessComponent> | undefined +>valueComponent : React.ComponentType> | undefined /** * optional style to apply to the component wrapper diff --git a/tests/baselines/reference/jsxFragmentFactoryNoUnusedLocals.types b/tests/baselines/reference/jsxFragmentFactoryNoUnusedLocals.types index 75a9122b486ee..a83aca50051ea 100644 --- a/tests/baselines/reference/jsxFragmentFactoryNoUnusedLocals.types +++ b/tests/baselines/reference/jsxFragmentFactoryNoUnusedLocals.types @@ -2,7 +2,7 @@ /// import { Fragment, createElement } from "react" >Fragment : import("react").ComponentType<{}> ->createElement : { (type: "input", props?: import("react").InputHTMLAttributes & import("react").ClassAttributes, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement, HTMLInputElement>;

, T extends HTMLElement>(type: "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview", props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement;

, T extends SVGElement>(type: "symbol" | "text" | "animate" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "textPath" | "tspan" | "use" | "view", props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").ReactSVGElement;

, T extends Element>(type: string, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").DOMElement;

(type: import("react").SFC

, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").SFCElement

;

(type: import("react").ClassType, import("react").ClassicComponentClass

>, props?: import("react").ClassAttributes> & P, ...children: import("react").ReactNode[]): import("react").CElement>; , C extends import("react").ComponentClass>(type: import("react").ClassType, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").CElement;

(type: string | import("react").SFC

| import("react").ComponentClass, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").ReactElement

; } +>createElement : { (type: "input", props?: import("react").InputHTMLAttributes & import("react").ClassAttributes, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement, HTMLInputElement>;

, T extends HTMLElement>(type: keyof import("react").ReactHTML, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement;

, T extends SVGElement>(type: keyof import("react").ReactSVG, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").ReactSVGElement;

, T extends Element>(type: string, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").DOMElement;

(type: import("react").SFC

, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").SFCElement

;

(type: import("react").ClassType, import("react").ClassicComponentClass

>, props?: import("react").ClassAttributes> & P, ...children: import("react").ReactNode[]): import("react").CElement>; , C extends import("react").ComponentClass>(type: import("react").ClassType, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").CElement;

(type: string | import("react").SFC

| import("react").ComponentClass, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").ReactElement

; } type CounterProps = { >CounterProps : CounterProps diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index e0b3e13ed60b4..f2dda4a889774 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -83,10 +83,10 @@ type K08 = keyof unknown; // never >K08 : never type K10 = keyof Shape; // "name" | "width" | "height" | "visible" ->K10 : "name" | "width" | "height" | "visible" +>K10 : keyof Shape type K11 = keyof Shape[]; // "length" | "toString" | ... ->K11 : number | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" +>K11 : number | keyof Shape[] type K12 = keyof Dictionary; // string >K12 : string | number @@ -95,13 +95,13 @@ type K13 = keyof {}; // never >K13 : never type K14 = keyof Object; // "constructor" | "toString" | ... ->K14 : "toString" | "toLocaleString" | "valueOf" | "constructor" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable" +>K14 : keyof Object type K15 = keyof E; // "toString" | "toFixed" | "toExponential" | ... >K15 : "toString" | "toLocaleString" | "valueOf" | "toFixed" | "toExponential" | "toPrecision" type K16 = keyof [string, number]; // "0" | "1" | "length" | "toString" | ... ->K16 : number | "0" | "1" | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" +>K16 : number | keyof [string, number] type K17 = keyof (Shape | Item); // "name" >K17 : "name" @@ -116,7 +116,7 @@ type KeyOf = keyof T; >KeyOf : keyof T type K20 = KeyOf; // "name" | "width" | "height" | "visible" ->K20 : "name" | "width" | "height" | "visible" +>K20 : keyof Shape type K21 = KeyOf>; // string >K21 : string | number @@ -225,14 +225,14 @@ function f10(shape: Shape) { >getProperty(shape, cond ? "width" : "height") : number >getProperty : (obj: T, key: K) => T[K] >shape : Shape ->cond ? "width" : "height" : WIDTH_OR_HEIGHT +>cond ? "width" : "height" : "width" | "height" >cond : boolean >"width" : "width" >"height" : "height" let nameOrVisible = getProperty(shape, cond ? "name" : "visible"); // string | boolean ->nameOrVisible : Q12 ->getProperty(shape, cond ? "name" : "visible") : Q12 +>nameOrVisible : string | boolean +>getProperty(shape, cond ? "name" : "visible") : string | boolean >getProperty : (obj: T, key: K) => T[K] >shape : Shape >cond ? "name" : "visible" : "name" | "visible" @@ -251,7 +251,7 @@ function f10(shape: Shape) { >setProperty(shape, cond ? "width" : "height", 10) : void >setProperty : (obj: T, key: K, value: T[K]) => void >shape : Shape ->cond ? "width" : "height" : WIDTH_OR_HEIGHT +>cond ? "width" : "height" : "width" | "height" >cond : boolean >"width" : "width" >"height" : "height" @@ -380,28 +380,28 @@ function f20(component: Component) { let name = component.getProperty("name"); // string >name : string >component.getProperty("name") : string ->component.getProperty : (key: K) => Shape[K] +>component.getProperty : (key: K) => Shape[K] >component : Component ->getProperty : (key: K) => Shape[K] +>getProperty : (key: K) => Shape[K] >"name" : "name" let widthOrHeight = component.getProperty(cond ? "width" : "height"); // number >widthOrHeight : number >component.getProperty(cond ? "width" : "height") : number ->component.getProperty : (key: K) => Shape[K] +>component.getProperty : (key: K) => Shape[K] >component : Component ->getProperty : (key: K) => Shape[K] ->cond ? "width" : "height" : WIDTH_OR_HEIGHT +>getProperty : (key: K) => Shape[K] +>cond ? "width" : "height" : "width" | "height" >cond : boolean >"width" : "width" >"height" : "height" let nameOrVisible = component.getProperty(cond ? "name" : "visible"); // string | boolean ->nameOrVisible : Q12 ->component.getProperty(cond ? "name" : "visible") : Q12 ->component.getProperty : (key: K) => Shape[K] +>nameOrVisible : string | boolean +>component.getProperty(cond ? "name" : "visible") : string | boolean +>component.getProperty : (key: K) => Shape[K] >component : Component ->getProperty : (key: K) => Shape[K] +>getProperty : (key: K) => Shape[K] >cond ? "name" : "visible" : "name" | "visible" >cond : boolean >"name" : "name" @@ -409,18 +409,18 @@ function f20(component: Component) { component.setProperty("name", "rectangle"); >component.setProperty("name", "rectangle") : void ->component.setProperty : (key: K, value: Shape[K]) => void +>component.setProperty : (key: K, value: Shape[K]) => void >component : Component ->setProperty : (key: K, value: Shape[K]) => void +>setProperty : (key: K, value: Shape[K]) => void >"name" : "name" >"rectangle" : "rectangle" component.setProperty(cond ? "width" : "height", 10) >component.setProperty(cond ? "width" : "height", 10) : void ->component.setProperty : (key: K, value: Shape[K]) => void +>component.setProperty : (key: K, value: Shape[K]) => void >component : Component ->setProperty : (key: K, value: Shape[K]) => void ->cond ? "width" : "height" : WIDTH_OR_HEIGHT +>setProperty : (key: K, value: Shape[K]) => void +>cond ? "width" : "height" : "width" | "height" >cond : boolean >"width" : "width" >"height" : "height" @@ -428,9 +428,9 @@ function f20(component: Component) { component.setProperty(cond ? "name" : "visible", true); // Technically not safe >component.setProperty(cond ? "name" : "visible", true) : void ->component.setProperty : (key: K, value: Shape[K]) => void +>component.setProperty : (key: K, value: Shape[K]) => void >component : Component ->setProperty : (key: K, value: Shape[K]) => void +>setProperty : (key: K, value: Shape[K]) => void >cond ? "name" : "visible" : "name" | "visible" >cond : boolean >"name" : "name" @@ -474,8 +474,8 @@ function f30(shapes: Shape[]) { >"width" : "width" let nameOrVisibles = pluck(shapes, cond ? "name" : "visible"); // (string | boolean)[] ->nameOrVisibles : Q12[] ->pluck(shapes, cond ? "name" : "visible") : Q12[] +>nameOrVisibles : (string | boolean)[] +>pluck(shapes, cond ? "name" : "visible") : (string | boolean)[] >pluck : (array: T[], key: K) => T[K][] >shapes : Shape[] >cond ? "name" : "visible" : "name" | "visible" @@ -485,7 +485,7 @@ function f30(shapes: Shape[]) { } function f31(key: K) { ->f31 : (key: K) => Shape[K] +>f31 : (key: K) => Shape[K] >key : K const shape: Shape = { name: "foo", width: 5, height: 10, visible: true }; @@ -507,7 +507,7 @@ function f31(key: K) { } function f32(key: K) { ->f32 : (key: K) => Shape[K] +>f32 : (key: K) => Shape[K] >key : K const shape: Shape = { name: "foo", width: 5, height: 10, visible: true }; @@ -959,8 +959,8 @@ function f74(func: (x: T, y: U, k: K) => (T | U)[ >'a' : "a" let b = func({ a: 1, b: "hello" }, { a: 2, b: true }, 'b'); // string | boolean ->b : Q12 ->func({ a: 1, b: "hello" }, { a: 2, b: true }, 'b') : Q12 +>b : string | boolean +>func({ a: 1, b: "hello" }, { a: 2, b: true }, 'b') : string | boolean >func : (x: T, y: U, k: K) => (T | U)[K] >{ a: 1, b: "hello" } : { a: number; b: string; } >a : number @@ -1207,15 +1207,15 @@ type S2 = { }; function f90(x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) { ->f90 : (x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) => void +>f90 : (x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) => void >x1 : string ->x2 : T["a" | "b"] +>x2 : T[keyof S2] >x3 : S2[K] x1 = x2; ->x1 = x2 : T["a" | "b"] +>x1 = x2 : T[keyof S2] >x1 : string ->x2 : T["a" | "b"] +>x2 : T[keyof S2] x1 = x3; >x1 = x3 : S2[K] @@ -1224,12 +1224,12 @@ function f90(x1: S2[keyof S2], x2: T[keyof S2] x2 = x1; >x2 = x1 : string ->x2 : T["a" | "b"] +>x2 : T[keyof S2] >x1 : string x2 = x3; >x2 = x3 : S2[K] ->x2 : T["a" | "b"] +>x2 : T[keyof S2] >x3 : S2[K] x3 = x1; @@ -1238,9 +1238,9 @@ function f90(x1: S2[keyof S2], x2: T[keyof S2] >x1 : string x3 = x2; ->x3 = x2 : T["a" | "b"] +>x3 = x2 : T[keyof S2] >x3 : S2[K] ->x2 : T["a" | "b"] +>x2 : T[keyof S2] x1.length; >x1.length : number @@ -1249,7 +1249,7 @@ function f90(x1: S2[keyof S2], x2: T[keyof S2] x2.length; >x2.length : number ->x2 : T["a" | "b"] +>x2 : T[keyof S2] >length : number x3.length; @@ -1688,13 +1688,13 @@ let result = dispatchMethod("someMethod", ["hello", 35]); // Repro from #13073 type KeyTypes = "a" | "b" ->KeyTypes : "a" | "b" +>KeyTypes : KeyTypes let MyThingy: { [key in KeyTypes]: string[] }; >MyThingy : { a: string[]; b: string[]; } function addToMyThingy(key: S) { ->addToMyThingy : (key: S) => void +>addToMyThingy : (key: S) => void >key : S MyThingy[key].push("a"); diff --git a/tests/baselines/reference/keyofAndIndexedAccess2.types b/tests/baselines/reference/keyofAndIndexedAccess2.types index bde0ec562cba4..b4e2743b51a66 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess2.types +++ b/tests/baselines/reference/keyofAndIndexedAccess2.types @@ -236,7 +236,7 @@ function f10(obj: T, k1: string, k2: keyof It >f10 : (obj: T, k1: string, k2: keyof Item, k3: keyof T, k4: K) => void >obj : T >k1 : string ->k2 : "a" | "b" +>k2 : keyof Item >k3 : keyof T >k4 : K @@ -251,7 +251,7 @@ function f10(obj: T, k1: string, k2: keyof It >obj[k2] = 123 : 123 >obj[k2] : never >obj : T ->k2 : "a" | "b" +>k2 : keyof Item >123 : 123 obj[k3] = 123; // Error @@ -417,7 +417,7 @@ interface Type { } function get123(): Type[K] { ->get123 : () => Type[K] +>get123 : () => Type[K] return 123; // Error >123 : 123 diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt b/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt index dbd76dc2a38a0..c845f44d7de49 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt @@ -17,11 +17,11 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(35,21): error tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(36,21): error TS2538: Type 'boolean' cannot be used as an index type. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(41,31): error TS2538: Type 'boolean' cannot be used as an index type. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(46,16): error TS2538: Type 'boolean' cannot be used as an index type. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(63,33): error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(64,33): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. - Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(66,24): error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(67,24): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(63,33): error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(64,33): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'. + Type '"size"' is not assignable to type 'keyof Shape'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(66,24): error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(67,24): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(73,5): error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(74,5): error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(82,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'. @@ -172,18 +172,18 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(142,5): error let x1 = getProperty(shape, "name"); let x2 = getProperty(shape, "size"); // Error ~~~~~~ -!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. +!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'. let x3 = getProperty(shape, cond ? "name" : "size"); // Error ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. -!!! error TS2345: Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'. +!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'. +!!! error TS2345: Type '"size"' is not assignable to type 'keyof Shape'. setProperty(shape, "name", "rectangle"); setProperty(shape, "size", 10); // Error ~~~~~~ -!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. +!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'. setProperty(shape, cond ? "name" : "size", 10); // Error ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. +!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'. } function f20(x: T | U, y: T & U, k1: keyof (T | U), k2: keyof T & keyof U, k3: keyof (T & U), k4: keyof T | keyof U) { diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.types b/tests/baselines/reference/keyofAndIndexedAccessErrors.types index 80ffabefaf2bb..27f0642094e45 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.types +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.types @@ -23,7 +23,7 @@ type T00 = keyof K0; // Error >T00 : string | number | symbol type T01 = keyof Object; ->T01 : "toString" | "valueOf" | "toLocaleString" | "constructor" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable" +>T01 : keyof Object type T02 = keyof keyof Object; >T02 : number | "length" | "toString" | "valueOf" | "charAt" | "charCodeAt" | "concat" | "indexOf" | "lastIndexOf" | "localeCompare" | "match" | "replace" | "search" | "slice" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" diff --git a/tests/baselines/reference/keyofDoesntContainSymbols.types b/tests/baselines/reference/keyofDoesntContainSymbols.types index 5971064fa36c5..cf46d70d1eee3 100644 --- a/tests/baselines/reference/keyofDoesntContainSymbols.types +++ b/tests/baselines/reference/keyofDoesntContainSymbols.types @@ -85,6 +85,6 @@ type Values = T[keyof T]; >Values : Values type ValuesOfObj = Values; ->ValuesOfObj : string | number +>ValuesOfObj : Values<{ num: number; str: string; 0: 0; [sym]: symbol; }> >obj : { num: number; str: string; 0: 0; [sym]: symbol; } diff --git a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types index 511f2e6153e9f..8fc76045c486c 100644 --- a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types +++ b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types @@ -32,9 +32,9 @@ const _str = "my-fake-sym"; Object.defineProperty(module.exports, _sym, { value: "ok" }); >Object.defineProperty(module.exports, _sym, { value: "ok" }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport3") >module : { "\"tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport3\"": typeof import("tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport3"); } >exports : typeof import("tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport3") @@ -45,9 +45,9 @@ Object.defineProperty(module.exports, _sym, { value: "ok" }); Object.defineProperty(module.exports, _str, { value: "ok" }); >Object.defineProperty(module.exports, _str, { value: "ok" }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >module.exports : typeof import("tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport3") >module : { "\"tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport3\"": typeof import("tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport3"); } >exports : typeof import("tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport3") diff --git a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types index e25880167c6a9..8de2b0c0555da 100644 --- a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types +++ b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types @@ -51,9 +51,9 @@ F.prototype.defsAClass = true; Object.defineProperty(F.prototype, _str, {value: "ok"}); >Object.defineProperty(F.prototype, _str, {value: "ok"}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >F.prototype : any >F : typeof F >prototype : any @@ -64,9 +64,9 @@ Object.defineProperty(F.prototype, _str, {value: "ok"}); Object.defineProperty(F.prototype, _sym, {value: "ok"}); >Object.defineProperty(F.prototype, _sym, {value: "ok"}) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >F.prototype : any >F : typeof F >prototype : any diff --git a/tests/baselines/reference/library_ObjectPrototypeProperties.types b/tests/baselines/reference/library_ObjectPrototypeProperties.types index 093b787a0ceed..0761554026019 100644 --- a/tests/baselines/reference/library_ObjectPrototypeProperties.types +++ b/tests/baselines/reference/library_ObjectPrototypeProperties.types @@ -34,11 +34,11 @@ Object.prototype.valueOf(); Object.prototype.hasOwnProperty("string"); >Object.prototype.hasOwnProperty("string") : boolean ->Object.prototype.hasOwnProperty : (v: string | number | symbol) => boolean +>Object.prototype.hasOwnProperty : (v: PropertyKey) => boolean >Object.prototype : Object >Object : ObjectConstructor >prototype : Object ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >"string" : "string" Object.prototype.isPrototypeOf(Object); @@ -52,10 +52,10 @@ Object.prototype.isPrototypeOf(Object); Object.prototype.propertyIsEnumerable("string"); >Object.prototype.propertyIsEnumerable("string") : boolean ->Object.prototype.propertyIsEnumerable : (v: string | number | symbol) => boolean +>Object.prototype.propertyIsEnumerable : (v: PropertyKey) => boolean >Object.prototype : Object >Object : ObjectConstructor >prototype : Object ->propertyIsEnumerable : (v: string | number | symbol) => boolean +>propertyIsEnumerable : (v: PropertyKey) => boolean >"string" : "string" diff --git a/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types index 8fb03bc413f30..fd3858baebc68 100644 --- a/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types +++ b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types @@ -31,7 +31,7 @@ function f2() { >false : false type ElementOrArray = Element | Element[]; ->ElementOrArray : string | false | (string | false)[] +>ElementOrArray : (string | false) | (string | false)[] let el: Element = null as any; >el : string | false @@ -44,32 +44,32 @@ function f2() { >null : null let elOrA: ElementOrArray = null as any; ->elOrA : string | false | (string | false)[] +>elOrA : (string | false) | (string | false)[] >null as any : any >null : null // Desired/actual: All OK let a1: ElementOrArray = el; ->a1 : string | false | (string | false)[] +>a1 : (string | false) | (string | false)[] >el : string | false let a2: ElementOrArray = arr; ->a2 : string | false | (string | false)[] +>a2 : (string | false) | (string | false)[] >arr : (string | false)[] let a3: ElementOrArray = [el]; ->a3 : string | false | (string | false)[] +>a3 : (string | false) | (string | false)[] >[el] : (string | false)[] >el : string | false let a4: ElementOrArray = Array.isArray(elOrA) ? elOrA : [elOrA]; ->a4 : string | false | (string | false)[] +>a4 : (string | false) | (string | false)[] >Array.isArray(elOrA) ? elOrA : [elOrA] : (string | false)[] >Array.isArray(elOrA) : boolean >Array.isArray : (arg: any) => arg is any[] >Array : ArrayConstructor >isArray : (arg: any) => arg is any[] ->elOrA : string | false | (string | false)[] +>elOrA : (string | false) | (string | false)[] >elOrA : (string | false)[] >[elOrA] : (string | false)[] >elOrA : string | false @@ -78,7 +78,7 @@ function f2() { // 3.0: Error // 3.1: OK let a5: ElementOrArray = [...Array.isArray(elOrA) ? elOrA : [elOrA]]; ->a5 : string | false | (string | false)[] +>a5 : (string | false) | (string | false)[] >[...Array.isArray(elOrA) ? elOrA : [elOrA]] : (string | false)[] >...Array.isArray(elOrA) ? elOrA : [elOrA] : string | false >Array.isArray(elOrA) ? elOrA : [elOrA] : (string | false)[] @@ -86,7 +86,7 @@ function f2() { >Array.isArray : (arg: any) => arg is any[] >Array : ArrayConstructor >isArray : (arg: any) => arg is any[] ->elOrA : string | false | (string | false)[] +>elOrA : (string | false) | (string | false)[] >elOrA : (string | false)[] >[elOrA] : (string | false)[] >elOrA : string | false diff --git a/tests/baselines/reference/literalTypes2.types b/tests/baselines/reference/literalTypes2.types index fb66b15d3203f..09d4cc3d2189e 100644 --- a/tests/baselines/reference/literalTypes2.types +++ b/tests/baselines/reference/literalTypes2.types @@ -756,19 +756,19 @@ function append(a: T[], x: T): T[] { } type Bit = 0 | 1; ->Bit : 0 | 1 +>Bit : Bit let aa = makeArray(0); ->aa : (0 | 1)[] ->makeArray(0) : (0 | 1)[] +>aa : Bit[] +>makeArray(0) : Bit[] >makeArray : (x: T) => T[] >0 : 0 aa = append(aa, 1); ->aa = append(aa, 1) : (0 | 1)[] ->aa : (0 | 1)[] ->append(aa, 1) : (0 | 1)[] +>aa = append(aa, 1) : Bit[] +>aa : Bit[] +>append(aa, 1) : Bit[] >append : (a: T[], x: T) => T[] ->aa : (0 | 1)[] +>aa : Bit[] >1 : 1 diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index 0dc68732e81a2..b2c59fce02c00 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -3,17 +3,17 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(21,20): error TS2322: T Type 'Date' is not assignable to type 'number'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(22,19): error TS2344: Type 'Date' does not satisfy the constraint 'string | number | symbol'. Type 'Date' is not assignable to type 'number'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(25,24): error TS2344: Type '"foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(26,24): error TS2344: Type '"name" | "foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. - Type '"foo"' is not assignable to type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(28,24): error TS2344: Type '"x" | "y"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. - Type '"x"' is not assignable to type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(30,24): error TS2344: Type 'undefined' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(33,24): error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(25,24): error TS2344: Type '"foo"' does not satisfy the constraint 'keyof Shape'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(26,24): error TS2344: Type '"name" | "foo"' does not satisfy the constraint 'keyof Shape'. + Type '"foo"' is not assignable to type 'keyof Shape'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(28,24): error TS2344: Type 'keyof Point' does not satisfy the constraint 'keyof Shape'. + Type '"x"' is not assignable to type 'keyof Shape'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(30,24): error TS2344: Type 'undefined' does not satisfy the constraint 'keyof Shape'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(33,24): error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'. Type 'T' is not assignable to type '"visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(37,24): error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. - Type 'string | number' is not assignable to type '"name" | "width" | "height" | "visible"'. - Type 'string' is not assignable to type '"name" | "width" | "height" | "visible"'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(37,24): error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'. + Type 'string | number' is not assignable to type 'keyof Shape'. + Type 'string' is not assignable to type 'keyof Shape'. Type 'T' is not assignable to type '"visible"'. Type 'string | number' is not assignable to type '"visible"'. Type 'string' is not assignable to type '"visible"'. @@ -28,11 +28,11 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(77,59): error TS2345: A tests/cases/conformance/types/mapped/mappedTypeErrors.ts(83,58): error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Partial<{ x: number; y: number; }>'. Object literal may only specify known properties, and 'z' does not exist in type 'Partial<{ x: number; y: number; }>'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(105,17): error TS2322: Type 'undefined' is not assignable to type 'string'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(106,17): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. - Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(106,17): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. + Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(123,14): error TS2322: Type 'undefined' is not assignable to type 'string'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(124,14): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. - Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(124,14): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. + Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number | undefined'. @@ -78,34 +78,34 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: type T10 = Pick; type T11 = Pick; // Error ~~~~~ -!!! error TS2344: Type '"foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type '"foo"' does not satisfy the constraint 'keyof Shape'. type T12 = Pick; // Error ~~~~~~~~~~~~~~ -!!! error TS2344: Type '"name" | "foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. -!!! error TS2344: Type '"foo"' is not assignable to type '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type '"name" | "foo"' does not satisfy the constraint 'keyof Shape'. +!!! error TS2344: Type '"foo"' is not assignable to type 'keyof Shape'. type T13 = Pick; type T14 = Pick; // Error ~~~~~~~~~~~ -!!! error TS2344: Type '"x" | "y"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. -!!! error TS2344: Type '"x"' is not assignable to type '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type 'keyof Point' does not satisfy the constraint 'keyof Shape'. +!!! error TS2344: Type '"x"' is not assignable to type 'keyof Shape'. type T15 = Pick; type T16 = Pick; // Error ~~~~~~~~~ -!!! error TS2344: Type 'undefined' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type 'undefined' does not satisfy the constraint 'keyof Shape'. function f1(x: T) { let y: Pick; // Error ~ -!!! error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'. !!! error TS2344: Type 'T' is not assignable to type '"visible"'. } function f2(x: T) { let y: Pick; // Error ~ -!!! error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. -!!! error TS2344: Type 'string | number' is not assignable to type '"name" | "width" | "height" | "visible"'. -!!! error TS2344: Type 'string' is not assignable to type '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'. +!!! error TS2344: Type 'string | number' is not assignable to type 'keyof Shape'. +!!! error TS2344: Type 'string' is not assignable to type 'keyof Shape'. !!! error TS2344: Type 'T' is not assignable to type '"visible"'. !!! error TS2344: Type 'string | number' is not assignable to type '"visible"'. !!! error TS2344: Type 'string' is not assignable to type '"visible"'. @@ -204,8 +204,8 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: !!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:89:5: The expected type comes from property 'a' which is declared here on type 'Pick' setState(foo, { c: true }); // Error ~~~~~~~ -!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. -!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. +!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. class C { state: T; @@ -228,8 +228,8 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: !!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:89:5: The expected type comes from property 'a' which is declared here on type 'Pick' c.setState({ c: true }); // Error ~~~~~~~ -!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. -!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. +!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. type T2 = { a?: number, [key: string]: any }; diff --git a/tests/baselines/reference/mappedTypeErrors.types b/tests/baselines/reference/mappedTypeErrors.types index f8468ca0aad69..7a5c1c28dd1f7 100644 --- a/tests/baselines/reference/mappedTypeErrors.types +++ b/tests/baselines/reference/mappedTypeErrors.types @@ -53,7 +53,7 @@ type T13 = Pick; >T13 : Pick type T14 = Pick; // Error ->T14 : Pick +>T14 : Pick type T15 = Pick; >T15 : Pick @@ -78,7 +78,7 @@ function f2(x: T) { } function f3(x: T) { ->f3 : (x: T) => void +>f3 : (x: T) => void >x : T let y: Pick; @@ -374,9 +374,9 @@ let c = new C(); c.setState({ a: "test", b: 43 }); >c.setState({ a: "test", b: 43 }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ a: "test", b: 43 } : { a: string; b: number; } >a : string >"test" : "test" @@ -385,50 +385,50 @@ c.setState({ a: "test", b: 43 }); c.setState({ a: "hi" }); >c.setState({ a: "hi" }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ a: "hi" } : { a: string; } >a : string >"hi" : "hi" c.setState({ b: undefined }); >c.setState({ b: undefined }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ b: undefined } : { b: undefined; } >b : undefined >undefined : undefined c.setState({ }); >c.setState({ }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ } : {} c.setState(foo); >c.setState(foo) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >foo : Foo c.setState({ a: undefined }); // Error >c.setState({ a: undefined }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ a: undefined } : { a: undefined; } >a : undefined >undefined : undefined c.setState({ c: true }); // Error >c.setState({ c: true }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ c: true } : { c: boolean; } >c : boolean >true : true diff --git a/tests/baselines/reference/mappedTypeIndexedAccess.errors.txt b/tests/baselines/reference/mappedTypeIndexedAccess.errors.txt index ab2c45156790b..4af90d529122b 100644 --- a/tests/baselines/reference/mappedTypeIndexedAccess.errors.txt +++ b/tests/baselines/reference/mappedTypeIndexedAccess.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/mappedTypeIndexedAccess.ts(18,5): error TS2322: Type '{ key: "foo"; value: number; }' is not assignable to type 'Pair'. Types of property 'value' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/mappedTypeIndexedAccess.ts(24,5): error TS2322: Type '{ key: "foo"; value: number; }' is not assignable to type 'Pair'. +tests/cases/compiler/mappedTypeIndexedAccess.ts(24,5): error TS2322: Type '{ key: "foo"; value: number; }' is not assignable to type '{ key: "foo"; value: string; } | { key: "bar"; value: number; }'. Types of property 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -36,7 +36,7 @@ tests/cases/compiler/mappedTypeIndexedAccess.ts(24,5): error TS2322: Type '{ key // Error expected here let pair2: Pairs[keyof FooBar] = { ~~~~~ -!!! error TS2322: Type '{ key: "foo"; value: number; }' is not assignable to type 'Pair'. +!!! error TS2322: Type '{ key: "foo"; value: number; }' is not assignable to type '{ key: "foo"; value: string; } | { key: "bar"; value: number; }'. !!! error TS2322: Types of property 'value' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. key: "foo", diff --git a/tests/baselines/reference/mappedTypeIndexedAccess.types b/tests/baselines/reference/mappedTypeIndexedAccess.types index 0074c09a5eec4..c145f925bde48 100644 --- a/tests/baselines/reference/mappedTypeIndexedAccess.types +++ b/tests/baselines/reference/mappedTypeIndexedAccess.types @@ -45,7 +45,7 @@ let pair1: Pair = { // Error expected here let pair2: Pairs[keyof FooBar] = { ->pair2 : Pair +>pair2 : { key: "foo"; value: string; } | { key: "bar"; value: number; } >{ key: "foo", value: 3} : { key: "foo"; value: number; } key: "foo", diff --git a/tests/baselines/reference/modularizeLibrary_Dom.iterable.types b/tests/baselines/reference/modularizeLibrary_Dom.iterable.types index 154c397810878..6aacbf961db63 100644 --- a/tests/baselines/reference/modularizeLibrary_Dom.iterable.types +++ b/tests/baselines/reference/modularizeLibrary_Dom.iterable.types @@ -2,9 +2,9 @@ for (const element of document.getElementsByTagName("a")) { >element : HTMLAnchorElement >document.getElementsByTagName("a") : HTMLCollectionOf ->document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >document : Document ->getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >"a" : "a" element.href; diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.types b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.types index 6081b16c835d6..7d4c7acc1deaf 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.types +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.types @@ -80,9 +80,9 @@ var o = { }; o.hasOwnProperty(Symbol.hasInstance); >o.hasOwnProperty(Symbol.hasInstance) : boolean ->o.hasOwnProperty : (v: string | number | symbol) => boolean +>o.hasOwnProperty : (v: PropertyKey) => boolean >o : { a: number; [Symbol.hasInstance](value: any): boolean; } ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >Symbol.hasInstance : any >Symbol : any >hasInstance : any diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index 7847fa8d6b90a..f885083eac0b0 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -124,9 +124,9 @@ var o = { }; o.hasOwnProperty(Symbol.hasInstance); >o.hasOwnProperty(Symbol.hasInstance) : boolean ->o.hasOwnProperty : (v: string | number | symbol) => boolean +>o.hasOwnProperty : (v: PropertyKey) => boolean >o : { a: number; [Symbol.hasInstance](value: any): boolean; } ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index fbaeabadf6fef..22ed7e3b636db 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -124,9 +124,9 @@ var o = { }; o.hasOwnProperty(Symbol.hasInstance); >o.hasOwnProperty(Symbol.hasInstance) : boolean ->o.hasOwnProperty : (v: string | number | symbol) => boolean +>o.hasOwnProperty : (v: PropertyKey) => boolean >o : { a: number; [Symbol.hasInstance](value: any): boolean; } ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index e11ad3030a58a..610df69522a2c 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -124,9 +124,9 @@ var o = { }; o.hasOwnProperty(Symbol.hasInstance); >o.hasOwnProperty(Symbol.hasInstance) : boolean ->o.hasOwnProperty : (v: string | number | symbol) => boolean +>o.hasOwnProperty : (v: PropertyKey) => boolean >o : { a: number; [Symbol.hasInstance](value: any): boolean; } ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types index f4eaba5875235..e59666753d531 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types @@ -79,9 +79,9 @@ var o = { }; o.hasOwnProperty(Symbol.hasInstance); >o.hasOwnProperty(Symbol.hasInstance) : boolean ->o.hasOwnProperty : (v: string | number | symbol) => boolean +>o.hasOwnProperty : (v: PropertyKey) => boolean >o : { a: number; [Symbol.hasInstance](value: any): boolean; } ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/narrowingByTypeofInSwitch.types b/tests/baselines/reference/narrowingByTypeofInSwitch.types index 570f77e7a872f..42078591ba1a9 100644 --- a/tests/baselines/reference/narrowingByTypeofInSwitch.types +++ b/tests/baselines/reference/narrowingByTypeofInSwitch.types @@ -173,7 +173,7 @@ function testExtendsUnion(x: T) { >'boolean' : "boolean" >assertBoolean(x) : boolean >assertBoolean : (x: boolean) => boolean ->x : (T & false) | (T & true) +>x : T & boolean case 'function': assertAll(x); return; >'function' : "function" @@ -370,7 +370,7 @@ function testExtendsExplicitDefault(x: T) { >'boolean' : "boolean" >assertBoolean(x) : boolean >assertBoolean : (x: boolean) => boolean ->x : (T & false) | (T & true) +>x : T & boolean case 'function': assertAll(x); return; >'function' : "function" @@ -393,7 +393,7 @@ function testExtendsExplicitDefault(x: T) { } function testExtendsImplicitDefault(x: T) { ->testExtendsImplicitDefault : (x: T) => string | number | boolean | symbol | object | undefined +>testExtendsImplicitDefault : (x: T) => Basic >x : T switch (typeof x) { @@ -410,7 +410,7 @@ function testExtendsImplicitDefault(x: T) { >'boolean' : "boolean" >assertBoolean(x) : boolean >assertBoolean : (x: boolean) => boolean ->x : (T & false) | (T & true) +>x : T & boolean case 'function': assertAll(x); return; >'function' : "function" diff --git a/tests/baselines/reference/narrowingTruthyObject.types b/tests/baselines/reference/narrowingTruthyObject.types index 1f1a4a86f5e01..c562f3da2d3ed 100644 --- a/tests/baselines/reference/narrowingTruthyObject.types +++ b/tests/baselines/reference/narrowingTruthyObject.types @@ -133,9 +133,9 @@ function f1(x: unknown): any { >x : unknown >'object' : "object" >x.hasOwnProperty('x') : boolean ->x.hasOwnProperty : (v: string | number | symbol) => boolean +>x.hasOwnProperty : (v: PropertyKey) => boolean >x : object ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >'x' : "x" } diff --git a/tests/baselines/reference/normalizedIntersectionTooComplex.types b/tests/baselines/reference/normalizedIntersectionTooComplex.types index a5069b6af28f0..e7a49a5058317 100644 --- a/tests/baselines/reference/normalizedIntersectionTooComplex.types +++ b/tests/baselines/reference/normalizedIntersectionTooComplex.types @@ -128,17 +128,17 @@ interface Big { >ref : Obj<{ common?: string | undefined; "17"?: number | undefined; ref?: Obj | Func | undefined; }> | Func<{ common?: string | undefined; "17"?: number | undefined; ref?: Obj | Func | undefined; }> | undefined } declare function getCtor(comp: T): CtorOf ->getCtor : (comp: T) => CtorOf +>getCtor : (comp: T) => CtorOf >comp : T declare var all: keyof Big; ->all : "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" +>all : keyof Big const ctor = getCtor(all); >ctor : CtorOf<{ common?: string | undefined; "0"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "1"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "2"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "3"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "4"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "5"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "6"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "7"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "8"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "9"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "10"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "11"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "12"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "13"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "14"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "15"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "16"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "17"?: number | undefined; ref?: Obj | Func | undefined; }> >getCtor(all) : CtorOf<{ common?: string | undefined; "0"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "1"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "2"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "3"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "4"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "5"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "6"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "7"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "8"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "9"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "10"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "11"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "12"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "13"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "14"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "15"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "16"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "17"?: number | undefined; ref?: Obj | Func | undefined; }> ->getCtor : (comp: T) => CtorOf ->all : "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" +>getCtor : (comp: T) => CtorOf +>all : keyof Big const comp = ctor({ common: "ok", ref: x => console.log(x) }); >comp : { common?: string | undefined; "0"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "1"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "2"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "3"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "4"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "5"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "6"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "7"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "8"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "9"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "10"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "11"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "12"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "13"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "14"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "15"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "16"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "17"?: number | undefined; ref?: Obj | Func | undefined; } diff --git a/tests/baselines/reference/numberPropertyAccess.types b/tests/baselines/reference/numberPropertyAccess.types index b2baf38873c69..713a3950dee12 100644 --- a/tests/baselines/reference/numberPropertyAccess.types +++ b/tests/baselines/reference/numberPropertyAccess.types @@ -13,9 +13,9 @@ var a = x.toExponential(); var b = x.hasOwnProperty('toFixed'); >b : boolean >x.hasOwnProperty('toFixed') : boolean ->x.hasOwnProperty : (v: string | number | symbol) => boolean +>x.hasOwnProperty : (v: PropertyKey) => boolean >x : number ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >'toFixed' : "toFixed" var c = x['toExponential'](); @@ -28,7 +28,7 @@ var c = x['toExponential'](); var d = x['hasOwnProperty']('toFixed'); >d : boolean >x['hasOwnProperty']('toFixed') : boolean ->x['hasOwnProperty'] : (v: string | number | symbol) => boolean +>x['hasOwnProperty'] : (v: PropertyKey) => boolean >x : number >'hasOwnProperty' : "hasOwnProperty" >'toFixed' : "toFixed" diff --git a/tests/baselines/reference/numericLiteralTypes1.types b/tests/baselines/reference/numericLiteralTypes1.types index 1ef5854173ae5..721265816bce7 100644 --- a/tests/baselines/reference/numericLiteralTypes1.types +++ b/tests/baselines/reference/numericLiteralTypes1.types @@ -44,12 +44,12 @@ type B1 = -1 | 0 | 1; >1 : 1 type B2 = 1 | 0 | -1; ->B2 : B1 +>B2 : B2 >-1 : -1 >1 : 1 type B3 = 0 | -1 | 1; ->B3 : B1 +>B3 : B3 >-1 : -1 >1 : 1 @@ -260,14 +260,14 @@ function assertNever(x: never): never { } type Tag = 0 | 1 | 2; ->Tag : 0 | 1 | 2 +>Tag : Tag function f10(x: Tag) { >f10 : (x: Tag) => "a" | "b" | "c" ->x : 0 | 1 | 2 +>x : Tag switch (x) { ->x : 0 | 1 | 2 +>x : Tag case 0: return "a"; >0 : 0 @@ -285,10 +285,10 @@ function f10(x: Tag) { function f11(x: Tag) { >f11 : (x: Tag) => "a" | "b" | "c" ->x : 0 | 1 | 2 +>x : Tag switch (x) { ->x : 0 | 1 | 2 +>x : Tag case 0: return "a"; >0 : 0 @@ -310,28 +310,28 @@ function f11(x: Tag) { function f12(x: Tag) { >f12 : (x: Tag) => void ->x : 0 | 1 | 2 +>x : Tag if (x) { ->x : 0 | 1 | 2 +>x : Tag x; >x : 1 | 2 } else { x; ->x : 0 | 1 | 2 +>x : Tag } } function f13(x: Tag) { >f13 : (x: Tag) => void ->x : 0 | 1 | 2 +>x : Tag if (x === 0 || x === 2) { >x === 0 || x === 2 : boolean >x === 0 : boolean ->x : 0 | 1 | 2 +>x : Tag >0 : 0 >x === 2 : boolean >x : 1 | 2 diff --git a/tests/baselines/reference/numericLiteralTypes2.types b/tests/baselines/reference/numericLiteralTypes2.types index 815cd80f42a89..331fe0d43de6e 100644 --- a/tests/baselines/reference/numericLiteralTypes2.types +++ b/tests/baselines/reference/numericLiteralTypes2.types @@ -44,12 +44,12 @@ type B1 = -1 | 0 | 1; >1 : 1 type B2 = 1 | 0 | -1; ->B2 : B1 +>B2 : B2 >-1 : -1 >1 : 1 type B3 = 0 | -1 | 1; ->B3 : B1 +>B3 : B3 >-1 : -1 >1 : 1 @@ -260,14 +260,14 @@ function assertNever(x: never): never { } type Tag = 0 | 1 | 2; ->Tag : 0 | 1 | 2 +>Tag : Tag function f10(x: Tag) { >f10 : (x: Tag) => "a" | "b" | "c" ->x : 0 | 1 | 2 +>x : Tag switch (x) { ->x : 0 | 1 | 2 +>x : Tag case 0: return "a"; >0 : 0 @@ -285,10 +285,10 @@ function f10(x: Tag) { function f11(x: Tag) { >f11 : (x: Tag) => "a" | "b" | "c" ->x : 0 | 1 | 2 +>x : Tag switch (x) { ->x : 0 | 1 | 2 +>x : Tag case 0: return "a"; >0 : 0 @@ -310,10 +310,10 @@ function f11(x: Tag) { function f12(x: Tag) { >f12 : (x: Tag) => void ->x : 0 | 1 | 2 +>x : Tag if (x) { ->x : 0 | 1 | 2 +>x : Tag x; >x : 1 | 2 @@ -326,12 +326,12 @@ function f12(x: Tag) { function f13(x: Tag) { >f13 : (x: Tag) => void ->x : 0 | 1 | 2 +>x : Tag if (x === 0 || x === 2) { >x === 0 || x === 2 : boolean >x === 0 : boolean ->x : 0 | 1 | 2 +>x : Tag >0 : 0 >x === 2 : boolean >x : 1 | 2 diff --git a/tests/baselines/reference/numericLiteralTypes3.types b/tests/baselines/reference/numericLiteralTypes3.types index ea70129ac50aa..cf545192a27b9 100644 --- a/tests/baselines/reference/numericLiteralTypes3.types +++ b/tests/baselines/reference/numericLiteralTypes3.types @@ -85,9 +85,9 @@ function f3(a: A, b: B, c: C, d: D) { >b : B c = c; ->c = c : B +>c = c : 2 | 3 >c : C ->c : B +>c : 2 | 3 c = d; >c = d : D diff --git a/tests/baselines/reference/objectFromEntries.types b/tests/baselines/reference/objectFromEntries.types index 4d5c71447705a..9cfee4f310dd5 100644 --- a/tests/baselines/reference/objectFromEntries.types +++ b/tests/baselines/reference/objectFromEntries.types @@ -2,9 +2,9 @@ const o = Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]); >o : { [k: string]: number; } >Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]) : { [k: string]: number; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >[['a', 1], ['b', 2], ['c', 3]] : [string, number][] >['a', 1] : [string, number] >'a' : "a" @@ -19,18 +19,18 @@ const o = Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]); const o2 = Object.fromEntries(new URLSearchParams()); >o2 : { [k: string]: string; } >Object.fromEntries(new URLSearchParams()) : { [k: string]: string; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >new URLSearchParams() : URLSearchParams >URLSearchParams : { new (init?: string | URLSearchParams | string[][] | Record): URLSearchParams; prototype: URLSearchParams; toString(): string; } const o3 = Object.fromEntries(new Map([[Symbol("key"), "value"]])); >o3 : { [k: string]: string; } >Object.fromEntries(new Map([[Symbol("key"), "value"]])) : { [k: string]: string; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >new Map([[Symbol("key"), "value"]]) : Map >Map : MapConstructor >[[Symbol("key"), "value"]] : [symbol, string][] @@ -60,9 +60,9 @@ const frozenArray = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); const o4 = Object.fromEntries(frozenArray); >o4 : any >Object.fromEntries(frozenArray) : any ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >frozenArray : readonly (string | number)[][] const frozenArray2: readonly [string, number][] = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); @@ -85,8 +85,8 @@ const frozenArray2: readonly [string, number][] = Object.freeze([['a', 1], ['b', const o5 = Object.fromEntries(frozenArray2); >o5 : { [k: string]: number; } >Object.fromEntries(frozenArray2) : { [k: string]: number; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >frozenArray2 : readonly [string, number][] diff --git a/tests/baselines/reference/objectLitGetterSetter.types b/tests/baselines/reference/objectLitGetterSetter.types index 9c7bb2e1b45a7..8484a6d26dc89 100644 --- a/tests/baselines/reference/objectLitGetterSetter.types +++ b/tests/baselines/reference/objectLitGetterSetter.types @@ -5,9 +5,9 @@ Object.defineProperty(obj, "accProperty", ({ >Object.defineProperty(obj, "accProperty", ({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } })) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >obj : {} >"accProperty" : "accProperty" >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt index 4f27c62e67df2..94810f6d0028f 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'data' of type 'A' is not assignable to string index type 'Object'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'hasOwnProperty' of type '(v: string | number | symbol) => boolean' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'hasOwnProperty' of type '(v: PropertyKey) => boolean' is not assignable to string index type 'Object'. tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'propertyIsEnumerable' of type '(v: string | number | symbol) => boolean' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'propertyIsEnumerable' of type '(v: PropertyKey) => boolean' is not assignable to string index type 'Object'. tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'toString' of type '() => string' is not assignable to string index type 'Object'. tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'valueOf' of type '() => Object' is not assignable to string index type 'Object'. @@ -25,11 +25,11 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts ~~~~~~~~~~~~~~~~~~~~ !!! error TS2411: Property 'data' of type 'A' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2411: Property 'hasOwnProperty' of type '(v: string | number | symbol) => boolean' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'hasOwnProperty' of type '(v: PropertyKey) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ !!! error TS2411: Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2411: Property 'propertyIsEnumerable' of type '(v: string | number | symbol) => boolean' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'propertyIsEnumerable' of type '(v: PropertyKey) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ !!! error TS2411: Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt index 2fadffd195dda..d85cc3ddfdb11 100644 --- a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt +++ b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. -tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'hasOwnProperty' of type '(v: string | number | symbol) => boolean' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'hasOwnProperty' of type '(v: PropertyKey) => boolean' is not assignable to string index type 'Object'. tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. -tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'propertyIsEnumerable' of type '(v: string | number | symbol) => boolean' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'propertyIsEnumerable' of type '(v: PropertyKey) => boolean' is not assignable to string index type 'Object'. tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'toString' of type '() => string' is not assignable to string index type 'Object'. tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'valueOf' of type '() => Object' is not assignable to string index type 'Object'. @@ -16,11 +16,11 @@ tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectInd ~~~~~~~~~~~~~~~~~~~~ !!! error TS2411: Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2411: Property 'hasOwnProperty' of type '(v: string | number | symbol) => boolean' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'hasOwnProperty' of type '(v: PropertyKey) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ !!! error TS2411: Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2411: Property 'propertyIsEnumerable' of type '(v: string | number | symbol) => boolean' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'propertyIsEnumerable' of type '(v: PropertyKey) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ !!! error TS2411: Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/observableInferenceCanBeMade.types b/tests/baselines/reference/observableInferenceCanBeMade.types index 4efbf360b991f..e2c0a68f81f32 100644 --- a/tests/baselines/reference/observableInferenceCanBeMade.types +++ b/tests/baselines/reference/observableInferenceCanBeMade.types @@ -39,19 +39,19 @@ declare class Observable implements Subscribable { function asObservable(input: string | ObservableInput): Observable { >asObservable : (input: string | ObservableInput) => Observable ->input : string | Subscribable | Subscribable +>input : string | ObservableInput return typeof input === 'string' ? of(input) : from(input) >typeof input === 'string' ? of(input) : from(input) : Observable >typeof input === 'string' : boolean >typeof input : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" ->input : string | Subscribable | Subscribable +>input : string | ObservableInput >'string' : "string" >of(input) : Observable >of : (a: T) => Observable >input : string >from(input) : Observable >from : >(input: O) => Observable> ->input : ObservableInput +>input : Subscribable | Subscribable } diff --git a/tests/baselines/reference/optionalParameterRetainsNull.types b/tests/baselines/reference/optionalParameterRetainsNull.types index b2ca132d42b45..94bf71a6f3d42 100644 --- a/tests/baselines/reference/optionalParameterRetainsNull.types +++ b/tests/baselines/reference/optionalParameterRetainsNull.types @@ -5,11 +5,11 @@ interface Bar { bar: number; foo: object | null; } >null : null let a = { ->a : { test(a: K, b?: Bar[K] | null | undefined): void; } ->{ test (a: K, b?: Bar[K] | null) { }} : { test(a: K, b?: Bar[K] | null | undefined): void; } +>a : { test(a: K, b?: Bar[K] | null | undefined): void; } +>{ test (a: K, b?: Bar[K] | null) { }} : { test(a: K, b?: Bar[K] | null | undefined): void; } test (a: K, b?: Bar[K] | null) { } ->test : (a: K, b?: Bar[K] | null | undefined) => void +>test : (a: K, b?: Bar[K] | null | undefined) => void >a : K >b : Bar[K] | null | undefined >null : null @@ -17,9 +17,9 @@ let a = { }; a.test("bar", null); // ok, null is assignable to number | null | undefined >a.test("bar", null) : void ->a.test : (a: K, b?: Bar[K] | null | undefined) => void ->a : { test(a: K, b?: Bar[K] | null | undefined): void; } ->test : (a: K, b?: Bar[K] | null | undefined) => void +>a.test : (a: K, b?: Bar[K] | null | undefined) => void +>a : { test(a: K, b?: Bar[K] | null | undefined): void; } +>test : (a: K, b?: Bar[K] | null | undefined) => void >"bar" : "bar" >null : null diff --git a/tests/baselines/reference/parserOverloadOnConstants1.types b/tests/baselines/reference/parserOverloadOnConstants1.types index 6a786c50eb59e..15625372f260e 100644 --- a/tests/baselines/reference/parserOverloadOnConstants1.types +++ b/tests/baselines/reference/parserOverloadOnConstants1.types @@ -1,18 +1,18 @@ === tests/cases/conformance/parser/ecmascript5/parserOverloadOnConstants1.ts === interface Document { createElement(tagName: string): HTMLElement; ->createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } +>createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } >tagName : string createElement(tagName: 'canvas'): HTMLCanvasElement; ->createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: 'canvas'): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } +>createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: 'canvas'): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } >tagName : "canvas" createElement(tagName: 'div'): HTMLDivElement; ->createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: 'div'): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } +>createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: 'div'): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } >tagName : "div" createElement(tagName: 'span'): HTMLSpanElement; ->createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: 'span'): HTMLSpanElement; } +>createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: 'span'): HTMLSpanElement; } >tagName : "span" } diff --git a/tests/baselines/reference/parserUsingConstructorAsIdentifier.types b/tests/baselines/reference/parserUsingConstructorAsIdentifier.types index d0cd25f887d38..2a330b89a9026 100644 --- a/tests/baselines/reference/parserUsingConstructorAsIdentifier.types +++ b/tests/baselines/reference/parserUsingConstructorAsIdentifier.types @@ -90,9 +90,9 @@ Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, configurable: true, enumerable: true }); >Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, configurable: true, enumerable: true }) : any ->Object.defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor ->defineProperty : (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any +>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => any >constructor.prototype : any >constructor : any >prototype : any diff --git a/tests/baselines/reference/parserharness.types b/tests/baselines/reference/parserharness.types index 4c047e08d9115..747a041f87bc3 100644 --- a/tests/baselines/reference/parserharness.types +++ b/tests/baselines/reference/parserharness.types @@ -2743,11 +2743,11 @@ module Harness { if (this.fileCollection.hasOwnProperty(p)) { >this.fileCollection.hasOwnProperty(p) : boolean ->this.fileCollection.hasOwnProperty : (v: string | number | symbol) => boolean +>this.fileCollection.hasOwnProperty : (v: PropertyKey) => boolean >this.fileCollection : {} >this : this >fileCollection : {} ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >p : string var current = this.fileCollection[p]; diff --git a/tests/baselines/reference/partialOfLargeAPIIsAbleToBeWorkedWith.types b/tests/baselines/reference/partialOfLargeAPIIsAbleToBeWorkedWith.types index f3b7406a3dd11..fbd46f7fdce2e 100644 --- a/tests/baselines/reference/partialOfLargeAPIIsAbleToBeWorkedWith.types +++ b/tests/baselines/reference/partialOfLargeAPIIsAbleToBeWorkedWith.types @@ -214,17 +214,17 @@ const obj: Partial = {}; >{} : {} declare var keys: (keyof MyAPI)[]; ->keys : (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51)[] +>keys : (keyof MyAPI)[] for (const k of keys) { ->k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 ->keys : (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51)[] +>k : keyof MyAPI +>keys : (keyof MyAPI)[] obj[k] = () => "12"; // shouldn't cause a complexity error >obj[k] = () => "12" : () => string >obj[k] : (((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string)) | undefined >obj : Partial ->k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 +>k : keyof MyAPI >() => "12" : () => string >"12" : "12" } @@ -238,14 +238,14 @@ const obj2: PartialNull = {}; >{} : {} for (const k of keys) { ->k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 ->keys : (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51)[] +>k : keyof MyAPI +>keys : (keyof MyAPI)[] obj2[k] = () => "12"; // shouldn't cause a complexity error >obj2[k] = () => "12" : () => string >obj2[k] : (((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string)) | null | undefined >obj2 : PartialNull ->k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 +>k : keyof MyAPI >() => "12" : () => string >"12" : "12" } diff --git a/tests/baselines/reference/partiallyDiscriminantedUnions.types b/tests/baselines/reference/partiallyDiscriminantedUnions.types index f1d44249c0eb2..ecfbefb65bf72 100644 --- a/tests/baselines/reference/partiallyDiscriminantedUnions.types +++ b/tests/baselines/reference/partiallyDiscriminantedUnions.types @@ -95,7 +95,7 @@ function fail(s: Shapes) { if (s.kind === "circle") { >s.kind === "circle" : boolean >s.kind : "square" | "circle" ->s : Shape +>s : Square | Circle >kind : "square" | "circle" >"circle" : "circle" diff --git a/tests/baselines/reference/privateNamesAndkeyof.types b/tests/baselines/reference/privateNamesAndkeyof.types index 23625ad025cfc..3c063097dd464 100644 --- a/tests/baselines/reference/privateNamesAndkeyof.types +++ b/tests/baselines/reference/privateNamesAndkeyof.types @@ -16,5 +16,5 @@ class A { } type T = keyof A // should not include '#foo' ->T : "bar" | "baz" +>T : keyof A diff --git a/tests/baselines/reference/propertyAccess.types b/tests/baselines/reference/propertyAccess.types index 20e8d77070b1d..b81767eb8c066 100644 --- a/tests/baselines/reference/propertyAccess.types +++ b/tests/baselines/reference/propertyAccess.types @@ -136,10 +136,10 @@ var aa = obj.x; // Dotted property access of property that exists on value's apparent type var bb = obj.hasOwnProperty; ->bb : (v: string | number | symbol) => boolean ->obj.hasOwnProperty : (v: string | number | symbol) => boolean +>bb : (v: PropertyKey) => boolean +>obj.hasOwnProperty : (v: PropertyKey) => boolean >obj : { 10: string; x: string; y: number; z: { n: string; m: number; o: () => boolean; }; 'literal property': number; } ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean // Dotted property access of property that doesn't exist on value's apparent type var cc = obj.qqq; // error diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index 9e213b3a60a50..335f0febc862f 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -82,8 +82,8 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: !!! error TS2769: Type 'void' is not assignable to type 'boolean'. !!! error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. !!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' -!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, keyof Props>> & Partial>' +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, keyof Props>> & Partial>' interface MyPropsProps extends Props { when: (value: string) => boolean; diff --git a/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM.types b/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM.types index f31716a55e4c1..badbee67f736e 100644 --- a/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM.types +++ b/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM.types @@ -5,7 +5,7 @@ import * as React from "react"; >React : typeof React declare const Tag: keyof React.ReactHTML; ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML >React : any const classes = ""; @@ -22,7 +22,7 @@ const children: any[] = []; >{children} : JSX.Element ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML >className : string >classes : "" >rest : {} @@ -31,5 +31,5 @@ const children: any[] = []; >children : any[] ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML diff --git a/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM2.types b/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM2.types index fac8a844e0323..5d82838481b82 100644 --- a/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM2.types +++ b/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM2.types @@ -5,7 +5,7 @@ import * as React from "react"; >React : typeof React declare const Tag: keyof React.ReactHTML; ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML >React : any const classes = ""; @@ -23,7 +23,7 @@ const children: any[] = []; >{children} : JSX.Element ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML >className : string >classes : "" >rest : React.HTMLAttributes @@ -32,5 +32,5 @@ const children: any[] = []; >children : any[] ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML diff --git a/tests/baselines/reference/recursiveConditionalTypes.types b/tests/baselines/reference/recursiveConditionalTypes.types index 21f5f758d0ec5..c46104f4d420d 100644 --- a/tests/baselines/reference/recursiveConditionalTypes.types +++ b/tests/baselines/reference/recursiveConditionalTypes.types @@ -230,7 +230,7 @@ unbox({ value: { value: { get value() { return this; } }}}); // { readonly valu >value : { readonly value: { readonly value: any; }; } >{ get value() { return this; } } : { readonly value: { readonly value: any; }; } >value : { readonly value: any; } ->this : { readonly value: any; } | { readonly value: { readonly value: any; }; } | Box> +>this : { readonly value: any; } | RecBox<{ readonly value: { readonly value: any; }; }> // Inference from nested instantiations of same generic types diff --git a/tests/baselines/reference/recursiveReverseMappedType.types b/tests/baselines/reference/recursiveReverseMappedType.types index a39e242d90be8..3ca5a916afd76 100644 --- a/tests/baselines/reference/recursiveReverseMappedType.types +++ b/tests/baselines/reference/recursiveReverseMappedType.types @@ -23,7 +23,7 @@ function a(l: Recur[]): void { >l : Recur[] const x: Recur | undefined = join(l); ->x : (T extends unknown[] ? {} : { [K in keyof T]?: (T[K] extends unknown[] ? {} : { [K in keyof T[K]]?: (T[K][K] extends unknown[] ? {} : { [K in keyof T[K][K]]?: (T[K][K][K] extends unknown[] ? {} : { [K in keyof T[K][K][K]]?: (T[K][K][K][K] extends unknown[] ? {} : { [K in keyof T[K][K][K][K]]?: (T[K][K][K][K][K] extends unknown[] ? {} : { [K in keyof T[K][K][K][K][K]]?: (T[K][K][K][K][K][K] extends unknown[] ? {} : { [K in keyof T[K][K][K][K][K][K]]?: (T[K][K][K][K][K][K][K] extends unknown[] ? {} : { [K in keyof T[K][K][K][K][K][K][K]]?: (T[K][K][K][K][K][K][K][K] extends unknown[] ? {} : { [K in keyof T[K][K][K][K][K][K][K][K]]?: (T[K][K][K][K][K][K][K][K][K] extends unknown[] ? {} : { [K in keyof T[K][K][K][K][K][K][K][K][K]]?: (T[K][K][K][K][K][K][K][K][K][K] extends unknown[] ? {} : { [K in keyof T[K][K][K][K][K][K][K][K][K][K]]?: (T[K][K][K][K][K][K][K][K][K][K][K] extends unknown[] ? {} : any) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined; }) | ["marker", ...Recur[]] | undefined +>x : Recur | undefined >join(l) : Recur >join : (l: Recur[]) => Recur >l : Recur[] diff --git a/tests/baselines/reference/restTupleElements1.types b/tests/baselines/reference/restTupleElements1.types index c283de08148d9..b74d0c20df841 100644 --- a/tests/baselines/reference/restTupleElements1.types +++ b/tests/baselines/reference/restTupleElements1.types @@ -107,19 +107,19 @@ type T21 = T20[0]; >T21 : number type T22 = T20[0 | 1]; ->T22 : string | number +>T22 : T22 type T23 = T20[0 | 1 | 2]; ->T23 : string | number | boolean +>T23 : T23 type T24 = T20[0 | 1 | 2 | 3]; ->T24 : string | number | boolean +>T24 : T24 type T25 = T20[1 | 2 | 3]; >T25 : T25 type T26 = T20[2 | 3]; ->T26 : boolean +>T26 : T26 type T27 = T20[3]; >T27 : boolean @@ -187,7 +187,7 @@ f0([1, 2, 3]); >3 : 3 f0([1, "hello", true]); ->f0([1, "hello", true]) : [number, T25] +>f0([1, "hello", true]) : [number, string | boolean] >f0 : (x: [T, ...U[]]) => [T, U] >[1, "hello", true] : [number, string, true] >1 : 1 diff --git a/tests/baselines/reference/spreadBooleanRespectsFreshness.types b/tests/baselines/reference/spreadBooleanRespectsFreshness.types index cd20dc31944b6..5263d6c3261a7 100644 --- a/tests/baselines/reference/spreadBooleanRespectsFreshness.types +++ b/tests/baselines/reference/spreadBooleanRespectsFreshness.types @@ -27,6 +27,6 @@ foo1 = [...Array.isArray(foo2) ? foo2 : [foo2]]; >isArray : (arg: any) => arg is any[] >foo2 : Foo >foo2 : FooArray ->[foo2] : FooBase[] ->foo2 : FooBase +>[foo2] : (string | false)[] +>foo2 : string | false diff --git a/tests/baselines/reference/staticInstanceResolution2.types b/tests/baselines/reference/staticInstanceResolution2.types index e44f99d212f18..577b98e58c73a 100644 --- a/tests/baselines/reference/staticInstanceResolution2.types +++ b/tests/baselines/reference/staticInstanceResolution2.types @@ -4,9 +4,9 @@ class A { } A.hasOwnProperty('foo'); >A.hasOwnProperty('foo') : boolean ->A.hasOwnProperty : (v: string | number | symbol) => boolean +>A.hasOwnProperty : (v: PropertyKey) => boolean >A : typeof A ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >'foo' : "foo" class B { @@ -16,9 +16,9 @@ class B { } B.hasOwnProperty('foo'); >B.hasOwnProperty('foo') : boolean ->B.hasOwnProperty : (v: string | number | symbol) => boolean +>B.hasOwnProperty : (v: PropertyKey) => boolean >B : typeof B ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >'foo' : "foo" diff --git a/tests/baselines/reference/stringEnumLiteralTypes1.types b/tests/baselines/reference/stringEnumLiteralTypes1.types index bf7ab159be75b..0c09694228e2a 100644 --- a/tests/baselines/reference/stringEnumLiteralTypes1.types +++ b/tests/baselines/reference/stringEnumLiteralTypes1.types @@ -14,12 +14,12 @@ type YesNo = Choice.Yes | Choice.No; >Choice : any type NoYes = Choice.No | Choice.Yes; ->NoYes : YesNo +>NoYes : NoYes >Choice : any >Choice : any type UnknownYesNo = Choice.Unknown | Choice.Yes | Choice.No; ->UnknownYesNo : Choice +>UnknownYesNo : UnknownYesNo >Choice : any >Choice : any >Choice : any @@ -47,12 +47,12 @@ function f1() { function f2(a: YesNo, b: UnknownYesNo, c: Choice) { >f2 : (a: YesNo, b: UnknownYesNo, c: Choice) => void >a : YesNo ->b : Choice +>b : UnknownYesNo >c : Choice b = a; >b = a : YesNo ->b : Choice +>b : UnknownYesNo >a : YesNo c = a; @@ -61,9 +61,9 @@ function f2(a: YesNo, b: UnknownYesNo, c: Choice) { >a : YesNo c = b; ->c = b : YesNo +>c = b : Choice.Yes | Choice.No >c : Choice ->b : YesNo +>b : Choice.Yes | Choice.No } function f3(a: Choice.Yes, b: YesNo) { @@ -149,7 +149,7 @@ declare function g(x: Choice): number; function f5(a: YesNo, b: UnknownYesNo, c: Choice) { >f5 : (a: YesNo, b: UnknownYesNo, c: Choice) => void >a : YesNo ->b : Choice +>b : UnknownYesNo >c : Choice var z1 = g(Choice.Yes); @@ -178,7 +178,7 @@ function f5(a: YesNo, b: UnknownYesNo, c: Choice) { >z4 : number >g(b) : number >g : { (x: Choice.Yes): string; (x: Choice.No): boolean; (x: Choice): number; } ->b : Choice +>b : UnknownYesNo var z5 = g(c); >z5 : number @@ -245,27 +245,27 @@ function f11(x: YesNo) { function f12(x: UnknownYesNo) { >f12 : (x: UnknownYesNo) => void ->x : Choice +>x : UnknownYesNo if (x) { ->x : Choice +>x : UnknownYesNo x; ->x : YesNo +>x : Choice.Yes | Choice.No } else { x; ->x : Choice +>x : UnknownYesNo } } function f13(x: UnknownYesNo) { >f13 : (x: UnknownYesNo) => void ->x : Choice +>x : UnknownYesNo if (x === Choice.Yes) { >x === Choice.Yes : boolean ->x : Choice +>x : UnknownYesNo >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes @@ -297,9 +297,9 @@ function f20(x: Item) { >x : Item switch (x.kind) { ->x.kind : YesNo +>x.kind : Choice.Yes | Choice.No >x : Item ->kind : YesNo +>kind : Choice.Yes | Choice.No case Choice.Yes: return x.a; >Choice.Yes : Choice.Yes @@ -324,9 +324,9 @@ function f21(x: Item) { >x : Item switch (x.kind) { ->x.kind : YesNo +>x.kind : Choice.Yes | Choice.No >x : Item ->kind : YesNo +>kind : Choice.Yes | Choice.No case Choice.Yes: return x.a; >Choice.Yes : Choice.Yes diff --git a/tests/baselines/reference/stringEnumLiteralTypes2.types b/tests/baselines/reference/stringEnumLiteralTypes2.types index 82e35193f03e9..f4dd211517ade 100644 --- a/tests/baselines/reference/stringEnumLiteralTypes2.types +++ b/tests/baselines/reference/stringEnumLiteralTypes2.types @@ -14,12 +14,12 @@ type YesNo = Choice.Yes | Choice.No; >Choice : any type NoYes = Choice.No | Choice.Yes; ->NoYes : YesNo +>NoYes : NoYes >Choice : any >Choice : any type UnknownYesNo = Choice.Unknown | Choice.Yes | Choice.No; ->UnknownYesNo : Choice +>UnknownYesNo : UnknownYesNo >Choice : any >Choice : any >Choice : any @@ -47,12 +47,12 @@ function f1() { function f2(a: YesNo, b: UnknownYesNo, c: Choice) { >f2 : (a: YesNo, b: UnknownYesNo, c: Choice) => void >a : YesNo ->b : Choice +>b : UnknownYesNo >c : Choice b = a; >b = a : YesNo ->b : Choice +>b : UnknownYesNo >a : YesNo c = a; @@ -61,9 +61,9 @@ function f2(a: YesNo, b: UnknownYesNo, c: Choice) { >a : YesNo c = b; ->c = b : YesNo +>c = b : Choice.Yes | Choice.No >c : Choice ->b : YesNo +>b : Choice.Yes | Choice.No } function f3(a: Choice.Yes, b: YesNo) { @@ -149,7 +149,7 @@ declare function g(x: Choice): number; function f5(a: YesNo, b: UnknownYesNo, c: Choice) { >f5 : (a: YesNo, b: UnknownYesNo, c: Choice) => void >a : YesNo ->b : Choice +>b : UnknownYesNo >c : Choice var z1 = g(Choice.Yes); @@ -178,7 +178,7 @@ function f5(a: YesNo, b: UnknownYesNo, c: Choice) { >z4 : number >g(b) : number >g : { (x: Choice.Yes): string; (x: Choice.No): boolean; (x: Choice): number; } ->b : Choice +>b : UnknownYesNo var z5 = g(c); >z5 : number @@ -245,13 +245,13 @@ function f11(x: YesNo) { function f12(x: UnknownYesNo) { >f12 : (x: UnknownYesNo) => void ->x : Choice +>x : UnknownYesNo if (x) { ->x : Choice +>x : UnknownYesNo x; ->x : YesNo +>x : Choice.Yes | Choice.No } else { x; @@ -261,11 +261,11 @@ function f12(x: UnknownYesNo) { function f13(x: UnknownYesNo) { >f13 : (x: UnknownYesNo) => void ->x : Choice +>x : UnknownYesNo if (x === Choice.Yes) { >x === Choice.Yes : boolean ->x : Choice +>x : UnknownYesNo >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes @@ -297,9 +297,9 @@ function f20(x: Item) { >x : Item switch (x.kind) { ->x.kind : YesNo +>x.kind : Choice.Yes | Choice.No >x : Item ->kind : YesNo +>kind : Choice.Yes | Choice.No case Choice.Yes: return x.a; >Choice.Yes : Choice.Yes @@ -324,9 +324,9 @@ function f21(x: Item) { >x : Item switch (x.kind) { ->x.kind : YesNo +>x.kind : Choice.Yes | Choice.No >x : Item ->kind : YesNo +>kind : Choice.Yes | Choice.No case Choice.Yes: return x.a; >Choice.Yes : Choice.Yes diff --git a/tests/baselines/reference/stringEnumLiteralTypes3.errors.txt b/tests/baselines/reference/stringEnumLiteralTypes3.errors.txt index 5c4fb98067678..bdb775ae5e6ca 100644 --- a/tests/baselines/reference/stringEnumLiteralTypes3.errors.txt +++ b/tests/baselines/reference/stringEnumLiteralTypes3.errors.txt @@ -1,8 +1,10 @@ tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(10,5): error TS2322: Type 'YesNo' is not assignable to type 'Choice.Yes'. Type 'Choice.No' is not assignable to type 'Choice.Yes'. -tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(11,5): error TS2322: Type 'Choice' is not assignable to type 'Choice.Yes'. +tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(11,5): error TS2322: Type 'UnknownYesNo' is not assignable to type 'Choice.Yes'. + Type 'Choice.Unknown' is not assignable to type 'Choice.Yes'. tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(12,5): error TS2322: Type 'Choice' is not assignable to type 'Choice.Yes'. -tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(18,5): error TS2322: Type 'Choice' is not assignable to type 'YesNo'. +tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(18,5): error TS2322: Type 'UnknownYesNo' is not assignable to type 'YesNo'. + Type 'Choice.Unknown' is not assignable to type 'YesNo'. tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(19,5): error TS2322: Type 'Choice' is not assignable to type 'YesNo'. tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(37,5): error TS2322: Type 'Choice.Unknown' is not assignable to type 'Choice.Yes'. tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(39,5): error TS2322: Type 'Choice.No' is not assignable to type 'Choice.Yes'. @@ -31,7 +33,8 @@ tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(96,14): error T !!! error TS2322: Type 'Choice.No' is not assignable to type 'Choice.Yes'. a = c; ~ -!!! error TS2322: Type 'Choice' is not assignable to type 'Choice.Yes'. +!!! error TS2322: Type 'UnknownYesNo' is not assignable to type 'Choice.Yes'. +!!! error TS2322: Type 'Choice.Unknown' is not assignable to type 'Choice.Yes'. a = d; ~ !!! error TS2322: Type 'Choice' is not assignable to type 'Choice.Yes'. @@ -42,7 +45,8 @@ tests/cases/conformance/types/literal/stringEnumLiteralTypes3.ts(96,14): error T b = b; b = c; ~ -!!! error TS2322: Type 'Choice' is not assignable to type 'YesNo'. +!!! error TS2322: Type 'UnknownYesNo' is not assignable to type 'YesNo'. +!!! error TS2322: Type 'Choice.Unknown' is not assignable to type 'YesNo'. b = d; ~ !!! error TS2322: Type 'Choice' is not assignable to type 'YesNo'. diff --git a/tests/baselines/reference/stringEnumLiteralTypes3.types b/tests/baselines/reference/stringEnumLiteralTypes3.types index 27fe0b2fb76b9..c3c1fb30e2a07 100644 --- a/tests/baselines/reference/stringEnumLiteralTypes3.types +++ b/tests/baselines/reference/stringEnumLiteralTypes3.types @@ -18,12 +18,12 @@ type YesNo = Choice.Yes | Choice.No; >Choice : any type NoYes = Choice.No | Choice.Yes; ->NoYes : YesNo +>NoYes : NoYes >Choice : any >Choice : any type UnknownYesNo = Choice.Unknown | Choice.Yes | Choice.No; ->UnknownYesNo : Choice +>UnknownYesNo : UnknownYesNo >Choice : any >Choice : any >Choice : any @@ -32,7 +32,7 @@ function f1(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f1 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice a = a; @@ -46,9 +46,9 @@ function f1(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >b : YesNo a = c; ->a = c : Choice +>a = c : UnknownYesNo >a : Choice.Yes ->c : Choice +>c : UnknownYesNo a = d; >a = d : Choice @@ -60,7 +60,7 @@ function f2(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f2 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice b = a; @@ -74,9 +74,9 @@ function f2(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >b : Choice.Yes b = c; ->b = c : Choice +>b = c : UnknownYesNo >b : YesNo ->c : Choice +>c : UnknownYesNo b = d; >b = d : Choice @@ -88,27 +88,27 @@ function f3(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f3 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice c = a; >c = a : Choice.Yes ->c : Choice +>c : UnknownYesNo >a : Choice.Yes c = b; >c = b : YesNo ->c : Choice +>c : UnknownYesNo >b : YesNo c = c; ->c = c : YesNo ->c : Choice ->c : YesNo +>c = c : Choice.Yes | Choice.No +>c : UnknownYesNo +>c : Choice.Yes | Choice.No c = d; >c = d : Choice ->c : Choice +>c : UnknownYesNo >d : Choice } @@ -116,7 +116,7 @@ function f4(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f4 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice d = a; @@ -130,9 +130,9 @@ function f4(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >b : YesNo d = c; ->d = c : Choice +>d = c : UnknownYesNo >d : Choice ->c : Choice +>c : UnknownYesNo d = d; >d = d : Choice @@ -144,7 +144,7 @@ function f5(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f5 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice a = Choice.Unknown; @@ -191,21 +191,21 @@ function f5(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { c = Choice.Unknown; >c = Choice.Unknown : Choice.Unknown ->c : Choice +>c : UnknownYesNo >Choice.Unknown : Choice.Unknown >Choice : typeof Choice >Unknown : Choice.Unknown c = Choice.Yes; >c = Choice.Yes : Choice.Yes ->c : Choice +>c : UnknownYesNo >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes c = Choice.No; >c = Choice.No : Choice.No ->c : Choice +>c : UnknownYesNo >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No @@ -236,7 +236,7 @@ function f6(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f6 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice a === Choice.Unknown; @@ -283,21 +283,21 @@ function f6(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { c === Choice.Unknown; >c === Choice.Unknown : boolean ->c : Choice +>c : UnknownYesNo >Choice.Unknown : Choice.Unknown >Choice : typeof Choice >Unknown : Choice.Unknown c === Choice.Yes; >c === Choice.Yes : boolean ->c : Choice +>c : UnknownYesNo >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes c === Choice.No; >c === Choice.No : boolean ->c : Choice +>c : UnknownYesNo >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No @@ -328,7 +328,7 @@ function f7(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { >f7 : (a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) => void >a : Choice.Yes >b : YesNo ->c : Choice +>c : UnknownYesNo >d : Choice a === a; @@ -344,7 +344,7 @@ function f7(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { a === c; >a === c : boolean >a : Choice.Yes ->c : Choice +>c : UnknownYesNo a === d; >a === d : boolean @@ -364,7 +364,7 @@ function f7(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { b === c; >b === c : boolean >b : YesNo ->c : Choice +>c : UnknownYesNo b === d; >b === d : boolean @@ -373,22 +373,22 @@ function f7(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { c === a; >c === a : boolean ->c : Choice +>c : UnknownYesNo >a : Choice.Yes c === b; >c === b : boolean ->c : Choice +>c : UnknownYesNo >b : YesNo c === c; >c === c : boolean ->c : Choice ->c : Choice +>c : UnknownYesNo +>c : UnknownYesNo c === d; >c === d : boolean ->c : Choice +>c : UnknownYesNo >d : Choice d === a; @@ -404,7 +404,7 @@ function f7(a: Yes, b: YesNo, c: UnknownYesNo, d: Choice) { d === c; >d === c : boolean >d : Choice ->c : Choice +>c : UnknownYesNo d === d; >d === d : boolean @@ -472,10 +472,10 @@ function f11(x: YesNo): YesNo { function f12(x: UnknownYesNo): UnknownYesNo { >f12 : (x: UnknownYesNo) => UnknownYesNo ->x : Choice +>x : UnknownYesNo switch (x) { ->x : Choice +>x : UnknownYesNo case Choice.Unknown: return x; >Choice.Unknown : Choice.Unknown diff --git a/tests/baselines/reference/stringLiteralCheckedInIf02.types b/tests/baselines/reference/stringLiteralCheckedInIf02.types index 8056c2dd43a27..f81c05f1c3a44 100644 --- a/tests/baselines/reference/stringLiteralCheckedInIf02.types +++ b/tests/baselines/reference/stringLiteralCheckedInIf02.types @@ -29,7 +29,7 @@ function f(foo: T) { >foo : T return foo; ->foo : S +>foo : "a" | "b" } else { return foo[0]; diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types index 3f0ff14b4eeb9..a4d08a8d43b38 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types @@ -3,7 +3,7 @@ type T = "foo" | "bar" | "baz"; >T : T var x: "foo" | "bar" | "baz" = undefined; ->x : T +>x : "foo" | "bar" | "baz" >undefined : undefined var y: T = undefined; @@ -12,7 +12,7 @@ var y: T = undefined; if (x === "foo") { >x === "foo" : boolean ->x : T +>x : "foo" | "bar" | "baz" >"foo" : "foo" let a = x; @@ -50,11 +50,11 @@ else { x = y; >x = y : T ->x : T +>x : "foo" | "bar" | "baz" >y : T y = x; ->y = x : T +>y = x : "foo" | "bar" | "baz" >y : T ->x : T +>x : "foo" | "bar" | "baz" diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types index 0dc76b30ad036..fb79356ad2a57 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types @@ -3,7 +3,7 @@ type T = number | "foo" | "bar"; >T : T var x: "foo" | "bar" | number; ->x : T +>x : number | "foo" | "bar" var y: T = undefined; >y : T @@ -11,7 +11,7 @@ var y: T = undefined; if (x === "foo") { >x === "foo" : boolean ->x : T +>x : number | "foo" | "bar" >"foo" : "foo" let a = x; @@ -49,11 +49,11 @@ else { x = y; >x = y : T ->x : T +>x : number | "foo" | "bar" >y : T y = x; ->y = x : T +>y = x : number | "foo" | "bar" >y : T ->x : T +>x : number | "foo" | "bar" diff --git a/tests/baselines/reference/stringLiteralTypesOverloads01.js b/tests/baselines/reference/stringLiteralTypesOverloads01.js index 06b8b46754392..039186e8c68af 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads01.js +++ b/tests/baselines/reference/stringLiteralTypesOverloads01.js @@ -108,6 +108,6 @@ declare const boolean: "boolean"; declare const stringOrNumber: "string" | "number"; declare const stringOrBoolean: "string" | "boolean"; declare const booleanOrNumber: "number" | "boolean"; -declare const stringOrBooleanOrNumber: PrimitiveName; +declare const stringOrBooleanOrNumber: "string" | "number" | "boolean"; declare namespace Consts2 { } diff --git a/tests/baselines/reference/stringLiteralTypesOverloads01.types b/tests/baselines/reference/stringLiteralTypesOverloads01.types index cffe097468b7f..67437fc122ee4 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads01.types +++ b/tests/baselines/reference/stringLiteralTypesOverloads01.types @@ -3,35 +3,35 @@ type PrimitiveName = 'string' | 'number' | 'boolean'; >PrimitiveName : PrimitiveName function getFalsyPrimitive(x: "string"): string; ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >x : "string" function getFalsyPrimitive(x: "number"): number; ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >x : "number" function getFalsyPrimitive(x: "boolean"): boolean; ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >x : "boolean" function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "boolean" | "string"): boolean | string; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "boolean" | "string"): boolean | string; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >x : "string" | "boolean" function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "boolean" | "number"): boolean | number; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "boolean" | "number"): boolean | number; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >x : "number" | "boolean" function getFalsyPrimitive(x: "number" | "string"): number | string; ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "number" | "string"): number | string; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "number" | "string"): number | string; (x: "string" | "number" | "boolean"): string | number | boolean; } >x : "string" | "number" function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; >getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "number" | "string" | "boolean"): number | string | boolean; } ->x : PrimitiveName +>x : "string" | "number" | "boolean" function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >x : PrimitiveName if (x === "string") { @@ -70,19 +70,19 @@ namespace Consts1 { const EMPTY_STRING = getFalsyPrimitive("string"); >EMPTY_STRING : string >getFalsyPrimitive("string") : string ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >"string" : "string" const ZERO = getFalsyPrimitive('number'); >ZERO : number >getFalsyPrimitive('number') : number ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >'number' : "number" const FALSE = getFalsyPrimitive("boolean"); >FALSE : boolean >getFalsyPrimitive("boolean") : boolean ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >"boolean" : "boolean" } @@ -117,8 +117,8 @@ const booleanOrNumber = number || boolean; >boolean : "boolean" const stringOrBooleanOrNumber = stringOrBoolean || number; ->stringOrBooleanOrNumber : PrimitiveName ->stringOrBoolean || number : PrimitiveName +>stringOrBooleanOrNumber : "string" | "number" | "boolean" +>stringOrBoolean || number : "string" | "number" | "boolean" >stringOrBoolean : "string" | "boolean" >number : "number" @@ -128,44 +128,44 @@ namespace Consts2 { const EMPTY_STRING = getFalsyPrimitive(string); >EMPTY_STRING : string >getFalsyPrimitive(string) : string ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >string : "string" const ZERO = getFalsyPrimitive(number); >ZERO : number >getFalsyPrimitive(number) : number ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >number : "number" const FALSE = getFalsyPrimitive(boolean); >FALSE : boolean >getFalsyPrimitive(boolean) : boolean ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >boolean : "boolean" const a = getFalsyPrimitive(stringOrNumber); >a : string | number >getFalsyPrimitive(stringOrNumber) : string | number ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >stringOrNumber : "string" | "number" const b = getFalsyPrimitive(stringOrBoolean); >b : string | boolean >getFalsyPrimitive(stringOrBoolean) : string | boolean ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >stringOrBoolean : "string" | "boolean" const c = getFalsyPrimitive(booleanOrNumber); >c : number | boolean >getFalsyPrimitive(booleanOrNumber) : number | boolean ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } >booleanOrNumber : "number" | "boolean" const d = getFalsyPrimitive(stringOrBooleanOrNumber); >d : string | number | boolean >getFalsyPrimitive(stringOrBooleanOrNumber) : string | number | boolean ->getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: PrimitiveName): string | number | boolean; } ->stringOrBooleanOrNumber : PrimitiveName +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>stringOrBooleanOrNumber : "string" | "number" | "boolean" } diff --git a/tests/baselines/reference/stringPropertyAccess.types b/tests/baselines/reference/stringPropertyAccess.types index da8298178b65c..d395753dcb9d6 100644 --- a/tests/baselines/reference/stringPropertyAccess.types +++ b/tests/baselines/reference/stringPropertyAccess.types @@ -14,9 +14,9 @@ var a = x.charAt(0); var b = x.hasOwnProperty('charAt'); >b : boolean >x.hasOwnProperty('charAt') : boolean ->x.hasOwnProperty : (v: string | number | symbol) => boolean +>x.hasOwnProperty : (v: PropertyKey) => boolean >x : string ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >'charAt' : "charAt" var c = x['charAt'](0); @@ -30,7 +30,7 @@ var c = x['charAt'](0); var e = x['hasOwnProperty']('toFixed'); >e : boolean >x['hasOwnProperty']('toFixed') : boolean ->x['hasOwnProperty'] : (v: string | number | symbol) => boolean +>x['hasOwnProperty'] : (v: PropertyKey) => boolean >x : string >'hasOwnProperty' : "hasOwnProperty" >'toFixed' : "toFixed" diff --git a/tests/baselines/reference/tsxLibraryManagedAttributes.errors.txt b/tests/baselines/reference/tsxLibraryManagedAttributes.errors.txt index 4b4448e42f6f4..75911e6e6c5ca 100644 --- a/tests/baselines/reference/tsxLibraryManagedAttributes.errors.txt +++ b/tests/baselines/reference/tsxLibraryManagedAttributes.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(55,12): error TS2322: Type '{ foo: number; }' is not assignable to type 'Defaultize; bar: PropTypeChecker; baz: PropTypeChecker; }>, { foo: number; }>'. - Type '{ foo: number; }' is missing the following properties from type '{ bar: string | number | ReactComponent<{}, {}> | null | undefined; baz: string; }': bar, baz + Type '{ foo: number; }' is missing the following properties from type '{ bar: ReactNode | null | undefined; baz: string; }': bar, baz tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(57,41): error TS2322: Type '{ bar: string; baz: string; bat: string; }' is not assignable to type 'Defaultize; bar: PropTypeChecker; baz: PropTypeChecker; }>, { foo: number; }>'. Property 'bat' does not exist on type 'Defaultize; bar: PropTypeChecker; baz: PropTypeChecker; }>, { foo: number; }>'. tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(59,42): error TS2322: Type 'null' is not assignable to type 'string'. @@ -9,7 +9,7 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(80,38): error TS2322 Property 'bar' does not exist on type 'Defaultize<{}, { foo: number; }>'. tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(81,29): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(98,12): error TS2322: Type '{ foo: string; }' is not assignable to type 'Defaultize; bar: PropTypeChecker; baz: PropTypeChecker; }>, { foo: string; }>'. - Type '{ foo: string; }' is missing the following properties from type '{ bar: string | number | ReactComponent<{}, {}> | null | undefined; baz: number; }': bar, baz + Type '{ foo: string; }' is missing the following properties from type '{ bar: ReactNode | null | undefined; baz: number; }': bar, baz tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(100,56): error TS2322: Type '{ bar: string; baz: number; bat: string; }' is not assignable to type 'Defaultize; bar: PropTypeChecker; baz: PropTypeChecker; }>, { foo: string; }>'. Property 'bat' does not exist on type 'Defaultize; bar: PropTypeChecker; baz: PropTypeChecker; }>, { foo: string; }>'. tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(102,57): error TS2322: Type 'null' is not assignable to type 'number'. @@ -79,7 +79,7 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(123,49): error TS232 const b = ; // Error, missing required prop bar ~~~~~~~~~ !!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Defaultize; bar: PropTypeChecker; baz: PropTypeChecker; }>, { foo: number; }>'. -!!! error TS2322: Type '{ foo: number; }' is missing the following properties from type '{ bar: string | number | ReactComponent<{}, {}> | null | undefined; baz: string; }': bar, baz +!!! error TS2322: Type '{ foo: number; }' is missing the following properties from type '{ bar: ReactNode | null | undefined; baz: string; }': bar, baz const c = ; const d = ; // Error, baz not a valid prop ~~~ @@ -142,7 +142,7 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(123,49): error TS232 const o = ; // Error, missing required prop bar ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Defaultize; bar: PropTypeChecker; baz: PropTypeChecker; }>, { foo: string; }>'. -!!! error TS2322: Type '{ foo: string; }' is missing the following properties from type '{ bar: string | number | ReactComponent<{}, {}> | null | undefined; baz: number; }': bar, baz +!!! error TS2322: Type '{ foo: string; }' is missing the following properties from type '{ bar: ReactNode | null | undefined; baz: number; }': bar, baz const p = ; const q = ; // Error, baz not a valid prop ~~~ diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt index 0027abe10921b..360f8a72ada6f 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(13,10): error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes & { editable: false; } & { children?: ReactNode; }) | (IntrinsicAttributes & IntrinsicClassAttributes & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })'. +tests/cases/conformance/jsx/file.tsx(13,10): error TS2322: Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & (IntrinsicClassAttributes & (TextProps & { children?: ReactNode; }))'. Property 'onEdit' is missing in type '{ editable: true; }' but required in type '{ editable: true; onEdit: (newText: string) => void; }'. @@ -17,7 +17,7 @@ tests/cases/conformance/jsx/file.tsx(13,10): error TS2322: Type '{ editable: tru // Error let x = ~~~~~~~~~~~~~ -!!! error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes & { editable: false; } & { children?: ReactNode; }) | (IntrinsicAttributes & IntrinsicClassAttributes & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })'. +!!! error TS2322: Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & (IntrinsicClassAttributes & (TextProps & { children?: ReactNode; }))'. !!! error TS2322: Property 'onEdit' is missing in type '{ editable: true; }' but required in type '{ editable: true; onEdit: (newText: string) => void; }'. !!! related TS2728 tests/cases/conformance/jsx/file.tsx:4:36: 'onEdit' is declared here. diff --git a/tests/baselines/reference/typeAliases.types b/tests/baselines/reference/typeAliases.types index f2804339e5892..e884529260e97 100644 --- a/tests/baselines/reference/typeAliases.types +++ b/tests/baselines/reference/typeAliases.types @@ -75,10 +75,10 @@ type T8 = string | boolean; >T8 : T8 var x8: string | boolean; ->x8 : T8 +>x8 : string | boolean var x8: T8; ->x8 : T8 +>x8 : string | boolean type T9 = () => string; >T9 : T9 diff --git a/tests/baselines/reference/typeInferenceLiteralUnion.types b/tests/baselines/reference/typeInferenceLiteralUnion.types index 5fc7807eb832d..c8718f7515eb8 100644 --- a/tests/baselines/reference/typeInferenceLiteralUnion.types +++ b/tests/baselines/reference/typeInferenceLiteralUnion.types @@ -46,7 +46,7 @@ class NumCoercible { */ export function extent(array: Array): [T | Primitive, T | Primitive] | [undefined, undefined] { >extent : (array: Array) => [T | Primitive, T | Primitive] | [undefined, undefined] ->array : (string | number | boolean | Date | T)[] +>array : (Primitive | T)[] return [undefined, undefined]; >[undefined, undefined] : [undefined, undefined] @@ -56,13 +56,13 @@ export function extent(array: Array): [T | Pri let extentMixed: [Primitive | NumCoercible, Primitive | NumCoercible] | [undefined, undefined]; ->extentMixed : [undefined, undefined] | [string | number | boolean | Date | NumCoercible, string | number | boolean | Date | NumCoercible] +>extentMixed : [undefined, undefined] | [Primitive | NumCoercible, Primitive | NumCoercible] extentMixed = extent([new NumCoercible(10), 13, '12', true]); ->extentMixed = extent([new NumCoercible(10), 13, '12', true]) : [undefined, undefined] | [string | number | boolean | Date | NumCoercible, string | number | boolean | Date | NumCoercible] ->extentMixed : [undefined, undefined] | [string | number | boolean | Date | NumCoercible, string | number | boolean | Date | NumCoercible] ->extent([new NumCoercible(10), 13, '12', true]) : [undefined, undefined] | [string | number | boolean | Date | NumCoercible, string | number | boolean | Date | NumCoercible] ->extent : (array: (string | number | boolean | Date | T)[]) => [string | number | boolean | Date | T, string | number | boolean | Date | T] | [undefined, undefined] +>extentMixed = extent([new NumCoercible(10), 13, '12', true]) : [undefined, undefined] | [Primitive | NumCoercible, Primitive | NumCoercible] +>extentMixed : [undefined, undefined] | [Primitive | NumCoercible, Primitive | NumCoercible] +>extent([new NumCoercible(10), 13, '12', true]) : [undefined, undefined] | [Primitive | NumCoercible, Primitive | NumCoercible] +>extent : (array: (Primitive | T)[]) => [Primitive | T, Primitive | T] | [undefined, undefined] >[new NumCoercible(10), 13, '12', true] : (string | number | true | NumCoercible)[] >new NumCoercible(10) : NumCoercible >NumCoercible : typeof NumCoercible diff --git a/tests/baselines/reference/typeParameterLeak.types b/tests/baselines/reference/typeParameterLeak.types index e7aa09a2098df..d5df7698ae874 100644 --- a/tests/baselines/reference/typeParameterLeak.types +++ b/tests/baselines/reference/typeParameterLeak.types @@ -44,7 +44,7 @@ if (b) { const x = b.data; >x : { x: string; } | { y: string; } >b.data : { x: string; } | { y: string; } ->b : BoxTypes +>b : Box<{ x: string; }> | Box<{ y: string; }> >data : { x: string; } | { y: string; } } diff --git a/tests/baselines/reference/typePredicateStructuralMatch.types b/tests/baselines/reference/typePredicateStructuralMatch.types index 5235a14dc8d3c..4d0b371b1071d 100644 --- a/tests/baselines/reference/typePredicateStructuralMatch.types +++ b/tests/baselines/reference/typePredicateStructuralMatch.types @@ -40,9 +40,9 @@ function isResponseInData(value: T | { data: T}): value is { data: T } { return value.hasOwnProperty('data'); >value.hasOwnProperty('data') : boolean ->value.hasOwnProperty : (v: string | number | symbol) => boolean +>value.hasOwnProperty : (v: PropertyKey) => boolean >value : T | { data: T; } ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >'data' : "data" } @@ -70,9 +70,9 @@ function isPlainResponse(value: T | { data: T}): value is T { return !value.hasOwnProperty('data'); >!value.hasOwnProperty('data') : boolean >value.hasOwnProperty('data') : boolean ->value.hasOwnProperty : (v: string | number | symbol) => boolean +>value.hasOwnProperty : (v: PropertyKey) => boolean >value : T | { data: T; } ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >'data' : "data" } diff --git a/tests/baselines/reference/typeUsedAsTypeLiteralIndex.types b/tests/baselines/reference/typeUsedAsTypeLiteralIndex.types index 2b362f0d5b4d4..3b95394188538 100644 --- a/tests/baselines/reference/typeUsedAsTypeLiteralIndex.types +++ b/tests/baselines/reference/typeUsedAsTypeLiteralIndex.types @@ -35,7 +35,7 @@ type T2 = { } type K3 = number | string; ->K3 : K +>K3 : K3 type T3 = { >T3 : T3 @@ -46,7 +46,7 @@ type T3 = { } type K4 = number | string; ->K4 : K +>K4 : K4 type T4 = { >T4 : T4 diff --git a/tests/baselines/reference/unionAndIntersectionInference3.types b/tests/baselines/reference/unionAndIntersectionInference3.types index 978abccf4884e..1e67a3c7f53ba 100644 --- a/tests/baselines/reference/unionAndIntersectionInference3.types +++ b/tests/baselines/reference/unionAndIntersectionInference3.types @@ -6,11 +6,11 @@ type Maybe = T | undefined; declare function concatMaybe(...args: (Maybe | Maybe[])[]): T[]; >concatMaybe : (...args: (Maybe | Maybe[])[]) => T[] ->args : (T | Maybe[] | undefined)[] +>args : (Maybe | Maybe[])[] concatMaybe([1, 2, 3], 4); >concatMaybe([1, 2, 3], 4) : number[] ->concatMaybe : (...args: (T | Maybe[] | undefined)[]) => T[] +>concatMaybe : (...args: (Maybe | Maybe[])[]) => T[] >[1, 2, 3] : number[] >1 : 1 >2 : 2 @@ -163,7 +163,7 @@ declare function withRouter< C extends ComponentType

>( component: C & ComponentType

->component : (C & FunctionComponent

) | (C & ComponentClass

) +>component : C & ComponentType

): ComponentClass>; @@ -175,7 +175,7 @@ declare const MyComponent: ComponentType; withRouter(MyComponent); >withRouter(MyComponent) : ComponentClass> ->withRouter :

>(component: (C & FunctionComponent

) | (C & ComponentClass

)) => ComponentClass>> +>withRouter :

>(component: C & ComponentType

) => ComponentClass>> >MyComponent : ComponentType // Repro from #33490 @@ -188,14 +188,14 @@ type AB = { a: T } | { b: T }; // T & AB normalizes to T & { a: U } | T & { b: U } below declare function foo(obj: T & AB): [T, U]; >foo : (obj: T & AB) => [T, U] ->obj : (T & { a: U; }) | (T & { b: U; }) +>obj : T & AB declare let ab: AB; >ab : AB let z = foo(ab); // [AB, string] ->z : [AB, string] ->foo(ab) : [AB, string] ->foo : (obj: (T & { a: U; }) | (T & { b: U; })) => [T, U] +>z : [{ a: string; } | { b: string; }, string] +>foo(ab) : [{ a: string; } | { b: string; }, string] +>foo : (obj: T & AB) => [T, U] >ab : AB diff --git a/tests/baselines/reference/unionTypeCallSignatures.types b/tests/baselines/reference/unionTypeCallSignatures.types index 4e192bdf9bf30..544f8b709dd48 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.types +++ b/tests/baselines/reference/unionTypeCallSignatures.types @@ -30,7 +30,7 @@ strOrBoolean = unionOfDifferentReturnType("hello"); // error >"hello" : "hello" unionOfDifferentReturnType1(true); // error in type of parameter ->unionOfDifferentReturnType1(true) : (Date & string) | (Date & false) | (Date & true) +>unionOfDifferentReturnType1(true) : (number | Date) & (string | boolean) >unionOfDifferentReturnType1 : { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; } >true : true @@ -56,12 +56,12 @@ strOrBoolean = unionOfDifferentReturnType1("hello"); >"hello" : "hello" unionOfDifferentReturnType1(true); // error in type of parameter ->unionOfDifferentReturnType1(true) : (Date & string) | (Date & false) | (Date & true) +>unionOfDifferentReturnType1(true) : (number | Date) & (string | boolean) >unionOfDifferentReturnType1 : { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; } >true : true unionOfDifferentReturnType1(); // error missing parameter ->unionOfDifferentReturnType1() : (Date & string) | (Date & false) | (Date & true) +>unionOfDifferentReturnType1() : (number | Date) & (string | boolean) >unionOfDifferentReturnType1 : { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; } var unionOfDifferentParameterTypes: { (a: number): number; } | { (a: string): Date; }; diff --git a/tests/baselines/reference/unionTypeConstructSignatures.types b/tests/baselines/reference/unionTypeConstructSignatures.types index 70171c4248ed5..ae73697b634ef 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.types +++ b/tests/baselines/reference/unionTypeConstructSignatures.types @@ -30,7 +30,7 @@ strOrBoolean = new unionOfDifferentReturnType("hello"); // error >"hello" : "hello" new unionOfDifferentReturnType1(true); // error in type of parameter ->new unionOfDifferentReturnType1(true) : (Date & string) | (Date & false) | (Date & true) +>new unionOfDifferentReturnType1(true) : (number | Date) & (string | boolean) >unionOfDifferentReturnType1 : { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; } >true : true @@ -56,12 +56,12 @@ strOrBoolean = new unionOfDifferentReturnType1("hello"); >"hello" : "hello" new unionOfDifferentReturnType1(true); // error in type of parameter ->new unionOfDifferentReturnType1(true) : (Date & string) | (Date & false) | (Date & true) +>new unionOfDifferentReturnType1(true) : (number | Date) & (string | boolean) >unionOfDifferentReturnType1 : { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; } >true : true new unionOfDifferentReturnType1(); // error missing parameter ->new unionOfDifferentReturnType1() : (Date & string) | (Date & false) | (Date & true) +>new unionOfDifferentReturnType1() : (number | Date) & (string | boolean) >unionOfDifferentReturnType1 : { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; } var unionOfDifferentParameterTypes: { new (a: number): number; } | { new (a: string): Date; }; diff --git a/tests/baselines/reference/unionWithIndexSignature.types b/tests/baselines/reference/unionWithIndexSignature.types index 17554d4538a4e..e3acdf8150589 100644 --- a/tests/baselines/reference/unionWithIndexSignature.types +++ b/tests/baselines/reference/unionWithIndexSignature.types @@ -16,12 +16,12 @@ interface StrList { export function foo(arr: T & (NumList | StrList)) { >foo : (arr: T & (NumList | StrList)) => void ->arr : (T & NumList) | (T & StrList) +>arr : T & (NumList | StrList) let zz = arr[1]; // Error >zz : string | number >arr[1] : string | number ->arr : (T & NumList) | (T & StrList) +>arr : T & (NumList | StrList) >1 : 1 } @@ -31,7 +31,7 @@ export type TypedArray = Int32Array | Uint8Array; >TypedArray : TypedArray export function isTypedArray(a: {}): a is Int32Array | Uint8Array { ->isTypedArray : (a: {}) => a is TypedArray +>isTypedArray : (a: {}) => a is Int32Array | Uint8Array >a : {} return a instanceof Int32Array || a instanceof Uint8Array; @@ -45,17 +45,17 @@ export function isTypedArray(a: {}): a is Int32Array | Uint8Array { } export function flatten(arr: T) { ->flatten : (arr: T) => void +>flatten : (arr: T) => void >arr : T if (isTypedArray(arr)) { >isTypedArray(arr) : boolean ->isTypedArray : (a: {}) => a is TypedArray +>isTypedArray : (a: {}) => a is Int32Array | Uint8Array >arr : T arr[1]; >arr[1] : number ->arr : (T & Int32Array) | (T & Uint8Array) +>arr : T & (Int32Array | Uint8Array) >1 : 1 } } diff --git a/tests/baselines/reference/unknownType2.types b/tests/baselines/reference/unknownType2.types index 72ac152771cae..6e8ffab0c2461 100644 --- a/tests/baselines/reference/unknownType2.types +++ b/tests/baselines/reference/unknownType2.types @@ -16,7 +16,7 @@ let validate: (x: unknown) => SomeResponse = x => (x === 'yes' || x === 'no') ? >x : unknown >x => (x === 'yes' || x === 'no') ? x : 'idk' : (x: unknown) => "yes" | "no" | "idk" >x : unknown ->(x === 'yes' || x === 'no') ? x : 'idk' : SomeResponse +>(x === 'yes' || x === 'no') ? x : 'idk' : "yes" | "no" | "idk" >(x === 'yes' || x === 'no') : boolean >x === 'yes' || x === 'no' : boolean >x === 'yes' : boolean @@ -582,7 +582,7 @@ function switchResponse(x: unknown): SomeResponse { >'idk' : "idk" return x; ->x : SomeResponse +>x : "yes" | "no" | "idk" default: throw new Error('unknown response'); diff --git a/tests/baselines/reference/unparenthesizedFunctionTypeInUnionOrIntersection.types b/tests/baselines/reference/unparenthesizedFunctionTypeInUnionOrIntersection.types index 40dd867a696a8..3a98c892d27be 100644 --- a/tests/baselines/reference/unparenthesizedFunctionTypeInUnionOrIntersection.types +++ b/tests/baselines/reference/unparenthesizedFunctionTypeInUnionOrIntersection.types @@ -67,7 +67,7 @@ type OK1 = string | (number); >OK1 : OK1 type OK2 = string | ((number)); ->OK2 : OK1 +>OK2 : OK2 type OK3 = string | (()=> void); >OK3 : OK3 diff --git a/tests/baselines/reference/unspecializedConstraints.types b/tests/baselines/reference/unspecializedConstraints.types index be0cd32f4ae2d..2bcba62cc45b0 100644 --- a/tests/baselines/reference/unspecializedConstraints.types +++ b/tests/baselines/reference/unspecializedConstraints.types @@ -438,12 +438,12 @@ module ts { var hasOwnProperty = Object.prototype.hasOwnProperty; ->hasOwnProperty : (v: string | number | symbol) => boolean ->Object.prototype.hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean +>Object.prototype.hasOwnProperty : (v: PropertyKey) => boolean >Object.prototype : Object >Object : ObjectConstructor >prototype : Object ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean function getProperty(map: Map, key: string): T { >getProperty : (map: Map, key: string) => T @@ -454,7 +454,7 @@ module ts { >!hasOwnProperty.call(map, key) : boolean >hasOwnProperty.call(map, key) : any >hasOwnProperty.call : (this: Function, thisArg: any, ...argArray: any[]) => any ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >call : (this: Function, thisArg: any, ...argArray: any[]) => any >map : Map >key : string @@ -474,7 +474,7 @@ module ts { return hasOwnProperty.call(map, key); >hasOwnProperty.call(map, key) : any >hasOwnProperty.call : (this: Function, thisArg: any, ...argArray: any[]) => any ->hasOwnProperty : (v: string | number | symbol) => boolean +>hasOwnProperty : (v: PropertyKey) => boolean >call : (this: Function, thisArg: any, ...argArray: any[]) => any >map : Map >key : string diff --git a/tests/baselines/reference/variadicTuples1.errors.txt b/tests/baselines/reference/variadicTuples1.errors.txt index 4b457d2eed6f6..c7cd43a4c7178 100644 --- a/tests/baselines/reference/variadicTuples1.errors.txt +++ b/tests/baselines/reference/variadicTuples1.errors.txt @@ -39,7 +39,7 @@ tests/cases/conformance/types/tuple/variadicTuples1.ts(191,5): error TS2322: Typ Type 'readonly string[]' is not assignable to type 'U'. 'U' could be instantiated with an arbitrary type which could be unrelated to 'readonly string[]'. tests/cases/conformance/types/tuple/variadicTuples1.ts(203,5): error TS2322: Type 'string' is not assignable to type 'keyof [1, 2, ...T]'. - Type '"2"' is not assignable to type 'number | "0" | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" | "1"'. + Type '"2"' is not assignable to type 'number | "0" | keyof T[] | "1"'. tests/cases/conformance/types/tuple/variadicTuples1.ts(357,26): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/tuple/variadicTuples1.ts(397,7): error TS2322: Type '[false, false]' is not assignable to type '[...number[], boolean]'. Type at position 0 in source is not compatible with type at position 0 in target. @@ -310,7 +310,7 @@ tests/cases/conformance/types/tuple/variadicTuples1.ts(397,7): error TS2322: Typ k3 = '2'; // Error ~~ !!! error TS2322: Type 'string' is not assignable to type 'keyof [1, 2, ...T]'. -!!! error TS2322: Type '"2"' is not assignable to type 'number | "0" | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" | "1"'. +!!! error TS2322: Type '"2"' is not assignable to type 'number | "0" | keyof T[] | "1"'. } // Inference between variadic tuple types diff --git a/tests/cases/fourslash/quickInfoCanBeTruncated.ts b/tests/cases/fourslash/quickInfoCanBeTruncated.ts index 25ca216a07553..0ee7ebba1e74c 100644 --- a/tests/cases/fourslash/quickInfoCanBeTruncated.ts +++ b/tests/cases/fourslash/quickInfoCanBeTruncated.ts @@ -513,7 +513,7 @@ //// type DeeplyMapped/*6*/ = {[K in keyof Foo]: {[K2 in keyof Foo]: [K, K2, Foo[K], Foo[K2]]}} goTo.marker("1"); -verify.quickInfoIs(`type A = "_0" | "_1" | "_2" | "_3" | "_4" | "_5" | "_6" | "_7" | "_8" | "_9" | "_10" | "_11" | "_12" | "_13" | "_14" | "_15" | "_16" | "_17" | "_18" | "_19" | "_20" | "_21" | "_22" | "_23" | "_24" | ... 474 more ... | "_499"`); +verify.quickInfoIs(`type A = keyof Foo`); goTo.marker("2"); verify.quickInfoIs(`type Less = "_1" | "_2" | "_3" | "_4" | "_5" | "_6" | "_7" | "_8" | "_9" | "_10" | "_11" | "_12" | "_13" | "_14" | "_15" | "_16" | "_17" | "_18" | "_19" | "_20" | "_21" | "_22" | "_23" | "_24" | "_25" | ... 473 more ... | "_499"`); goTo.marker("3");