diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 4909f7136d949..3bccf6b4a9b2d 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -591,6 +591,9 @@ namespace ts { case SyntaxKind.PrefixUnaryExpression: bindPrefixUnaryExpressionFlow(node); break; + case SyntaxKind.PostfixUnaryExpression: + bindPostfixUnaryExpressionFlow(node); + break; case SyntaxKind.BinaryExpression: bindBinaryExpressionFlow(node); break; @@ -1106,6 +1109,16 @@ namespace ts { } else { forEachChild(node, bind); + if (node.operator === SyntaxKind.PlusEqualsToken || node.operator === SyntaxKind.MinusMinusToken) { + bindAssignmentTargetFlow(node.operand); + } + } + } + + function bindPostfixUnaryExpressionFlow(node: PostfixUnaryExpression) { + forEachChild(node, bind); + if (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken) { + bindAssignmentTargetFlow(node.operand); } } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 79488b7b546bf..fbbb38ac6a055 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2922,7 +2922,7 @@ namespace ts { // undefined or any type of the parent. if (!parentType || isTypeAny(parentType)) { if (declaration.initializer) { - return checkExpressionCached(declaration.initializer); + return getBaseTypeOfLiteralType(checkExpressionCached(declaration.initializer)); } return parentType; } @@ -3093,7 +3093,9 @@ namespace ts { // Use the type of the initializer expression if one is present if (declaration.initializer) { - return addOptionality(checkExpressionCached(declaration.initializer), /*optional*/ declaration.questionToken && includeOptionality); + const exprType = checkExpressionCached(declaration.initializer); + const type = getCombinedNodeFlags(declaration) & NodeFlags.Const || getCombinedModifierFlags(declaration) & ModifierFlags.Readonly ? exprType : getBaseTypeOfLiteralType(exprType); + return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality); } // If it is a short-hand property assignment, use the type of the identifier @@ -3115,7 +3117,8 @@ namespace ts { // pattern. Otherwise, it is the type any. function getTypeFromBindingElement(element: BindingElement, includePatternInType?: boolean, reportErrors?: boolean): Type { if (element.initializer) { - return checkExpressionCached(element.initializer); + const exprType = checkExpressionCached(element.initializer); + return getCombinedNodeFlags(element) & NodeFlags.Const ? exprType : getBaseTypeOfLiteralType(exprType); } if (isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); @@ -3399,7 +3402,7 @@ namespace ts { function getTypeOfEnumMember(symbol: Symbol): Type { const links = getSymbolLinks(symbol); if (!links.type) { - links.type = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); + links.type = getDeclaredTypeOfEnumMember(symbol); } return links.type; } @@ -5714,7 +5717,7 @@ namespace ts { function getInferenceMapper(context: InferenceContext): TypeMapper { if (!context.mapper) { const mapper: TypeMapper = t => { - const typeParameters = context.typeParameters; + const typeParameters = context.signature.typeParameters; for (let i = 0; i < typeParameters.length; i++) { if (t === typeParameters[i]) { context.inferences[i].isFixed = true; @@ -5723,7 +5726,7 @@ namespace ts { } return t; }; - mapper.mappedTypes = context.typeParameters; + mapper.mappedTypes = context.signature.typeParameters; mapper.context = context; context.mapper = mapper; } @@ -7148,15 +7151,36 @@ namespace ts { return true; } + function literalTypesWithSameBaseType(types: Type[]): boolean { + let commonBaseType: Type; + for (const t of types) { + const baseType = getBaseTypeOfLiteralType(t); + if (!commonBaseType) { + commonBaseType = baseType; + } + if (baseType === t || baseType !== commonBaseType) { + return false; + } + } + return true; + } + + // When the candidate types are all literal types with the same base type, the common + // supertype is a union of those literal types. Otherwise, the common supertype is the + // first type that is a supertype of each of the other types. + function getSupertypeOrUnion(types: Type[]): Type { + return literalTypesWithSameBaseType(types) ? getUnionType(types) : forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined); + } + function getCommonSupertype(types: Type[]): Type { if (!strictNullChecks) { - return forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined); + return getSupertypeOrUnion(types); } const primaryTypes = filter(types, t => !(t.flags & TypeFlags.Nullable)); if (!primaryTypes.length) { return getUnionType(types, /*subtypeReduction*/ true); } - const supertype = forEach(primaryTypes, t => isSupertypeOfEach(t, primaryTypes) ? t : undefined); + const supertype = getSupertypeOrUnion(primaryTypes); return supertype && includeFalsyTypes(supertype, getFalsyFlagsOfTypes(types) & TypeFlags.Nullable); } @@ -7220,18 +7244,18 @@ namespace ts { return (type.flags & (TypeFlags.Literal | TypeFlags.Undefined | TypeFlags.Null)) !== 0; } - function isUnitUnionType(type: Type): boolean { + function isLiteralType(type: Type): boolean { return type.flags & TypeFlags.Boolean ? true : type.flags & TypeFlags.Union ? type.flags & TypeFlags.Enum ? true : !forEach((type).types, t => !isUnitType(t)) : isUnitType(type); } - function getBaseTypeOfUnitType(type: Type): Type { + function getBaseTypeOfLiteralType(type: Type): Type { return type.flags & TypeFlags.StringLiteral ? stringType : type.flags & TypeFlags.NumberLiteral ? numberType : type.flags & TypeFlags.BooleanLiteral ? booleanType : type.flags & TypeFlags.EnumLiteral ? (type).baseType : - type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Enum) ? getUnionType(map((type).types, getBaseTypeOfUnitType)) : + type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Enum) ? getUnionType(map((type).types, getBaseTypeOfLiteralType)) : type; } @@ -7485,14 +7509,13 @@ namespace ts { } } - function createInferenceContext(typeParameters: TypeParameter[], inferUnionTypes: boolean): InferenceContext { - const inferences = map(typeParameters, createTypeInferencesObject); - + function createInferenceContext(signature: Signature, inferUnionTypes: boolean): InferenceContext { + const inferences = map(signature.typeParameters, createTypeInferencesObject); return { - typeParameters, + signature, inferUnionTypes, inferences, - inferredTypes: new Array(typeParameters.length), + inferredTypes: new Array(signature.typeParameters.length), }; } @@ -7500,6 +7523,7 @@ namespace ts { return { primary: undefined, secondary: undefined, + topLevel: true, isFixed: false, }; } @@ -7521,13 +7545,18 @@ namespace ts { return type.couldContainTypeParameters; } - function inferTypes(context: InferenceContext, source: Type, target: Type) { + function isTypeParameterAtTopLevel(type: Type, typeParameter: TypeParameter): boolean { + return type === typeParameter || type.flags & TypeFlags.UnionOrIntersection && forEach((type).types, t => isTypeParameterAtTopLevel(t, typeParameter)); + } + + function inferTypes(context: InferenceContext, originalSource: Type, originalTarget: Type) { + const typeParameters = context.signature.typeParameters; let sourceStack: Type[]; let targetStack: Type[]; let depth = 0; let inferiority = 0; const visited = createMap(); - inferFromTypes(source, target); + inferFromTypes(originalSource, originalTarget); function isInProcess(source: Type, target: Type) { for (let i = 0; i < depth; i++) { @@ -7581,7 +7610,6 @@ namespace ts { if (source.flags & TypeFlags.ContainsAnyFunctionType) { return; } - const typeParameters = context.typeParameters; for (let i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { const inferences = context.inferences[i]; @@ -7598,6 +7626,9 @@ namespace ts { if (!contains(candidates, source)) { candidates.push(source); } + if (!isTypeParameterAtTopLevel(originalTarget, target)) { + inferences.topLevel = false; + } } return; } @@ -7618,7 +7649,7 @@ namespace ts { let typeParameter: TypeParameter; // First infer to each type in union or intersection that isn't a type parameter for (const t of targetTypes) { - if (t.flags & TypeFlags.TypeParameter && contains(context.typeParameters, t)) { + if (t.flags & TypeFlags.TypeParameter && contains(typeParameters, t)) { typeParameter = t; typeParameterCount++; } @@ -7693,8 +7724,12 @@ namespace ts { } } + function inferFromParameterTypes(source: Type, target: Type) { + return inferFromTypes(source, target); + } + function inferFromSignature(source: Signature, target: Signature) { - forEachMatchingParameterType(source, target, inferFromTypes); + forEachMatchingParameterType(source, target, inferFromParameterTypes); if (source.typePredicate && target.typePredicate && source.typePredicate.kind === target.typePredicate.kind) { inferFromTypes(source.typePredicate.type, target.typePredicate.type); @@ -7753,14 +7788,28 @@ namespace ts { return inferences.primary || inferences.secondary || emptyArray; } + function hasPrimitiveConstraint(type: TypeParameter): boolean { + const constraint = getConstraintOfTypeParameter(type); + return constraint && maybeTypeOfKind(constraint, TypeFlags.Primitive); + } + function getInferredType(context: InferenceContext, index: number): Type { let inferredType = context.inferredTypes[index]; let inferenceSucceeded: boolean; if (!inferredType) { const inferences = getInferenceCandidates(context, index); if (inferences.length) { + // We widen inferred literal types if + // all inferences were made to top-level ocurrences of the type parameter, and + // the type parameter has no constraint or its constraint includes no primitive or literal types, and + // the type parameter was fixed during inference or does not occur at top-level in the return type. + const signature = context.signature; + const widenLiteralTypes = context.inferences[index].topLevel && + !hasPrimitiveConstraint(signature.typeParameters[index]) && + (context.inferences[index].isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), signature.typeParameters[index])); + const baseInferences = widenLiteralTypes ? map(inferences, getBaseTypeOfLiteralType) : inferences; // Infer widened union or supertype, or the unknown type for no common supertype - const unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences, /*subtypeReduction*/ true) : getCommonSupertype(inferences); + const unionOrSuperType = context.inferUnionTypes ? getUnionType(baseInferences, /*subtypeReduction*/ true) : getCommonSupertype(baseInferences); inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType; inferenceSucceeded = !!unionOrSuperType; } @@ -7776,7 +7825,7 @@ namespace ts { // Only do the constraint check if inference succeeded (to prevent cascading errors) if (inferenceSucceeded) { - const constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + const constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]); if (constraint) { const instantiatedConstraint = instantiateType(constraint, getInferenceMapper(context)); if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { @@ -7923,7 +7972,7 @@ namespace ts { if (prop && prop.flags & SymbolFlags.SyntheticProperty) { if ((prop).isDiscriminantProperty === undefined) { (prop).isDiscriminantProperty = !(prop).hasCommonType && - isUnitUnionType(getTypeOfSymbol(prop)); + isLiteralType(getTypeOfSymbol(prop)); } return (prop).isDiscriminantProperty; } @@ -8326,7 +8375,8 @@ namespace ts { // Assignments only narrow the computed type if the declared type is a union type. Thus, we // only need to evaluate the assigned type if the declared type is a union type. if (isMatchingReference(reference, node)) { - return declaredType.flags & TypeFlags.Union ? + const isIncrementOrDecrement = node.parent.kind === SyntaxKind.PrefixUnaryExpression || node.parent.kind === SyntaxKind.PostfixUnaryExpression; + return declaredType.flags & TypeFlags.Union && !isIncrementOrDecrement ? getAssignmentReducedType(declaredType, getInitialOrAssignedType(node)) : declaredType; } @@ -9442,14 +9492,14 @@ namespace ts { if (parameter.dotDotDotToken) { const restTypes: Type[] = []; for (let i = indexOfParameter; i < iife.arguments.length; i++) { - restTypes.push(getTypeOfExpression(iife.arguments[i])); + restTypes.push(getBaseTypeOfLiteralType(checkExpression(iife.arguments[i]))); } return createArrayType(getUnionType(restTypes)); } const links = getNodeLinks(iife); const cached = links.resolvedSignature; links.resolvedSignature = anySignature; - const type = checkExpression(iife.arguments[indexOfParameter]); + const type = getBaseTypeOfLiteralType(checkExpression(iife.arguments[indexOfParameter])); links.resolvedSignature = cached; return type; } @@ -9800,6 +9850,7 @@ namespace ts { case SyntaxKind.BinaryExpression: return getContextualTypeForBinaryOperand(node); case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: return getContextualTypeForObjectLiteralElement(parent); case SyntaxKind.ArrayLiteralExpression: return getContextualTypeForElementExpression(node); @@ -9819,31 +9870,6 @@ namespace ts { return undefined; } - function isLiteralTypeLocation(node: Node): boolean { - const parent = node.parent; - switch (parent.kind) { - case SyntaxKind.BinaryExpression: - switch ((parent).operatorToken.kind) { - case SyntaxKind.EqualsEqualsEqualsToken: - case SyntaxKind.ExclamationEqualsEqualsToken: - case SyntaxKind.EqualsEqualsToken: - case SyntaxKind.ExclamationEqualsToken: - return true; - } - break; - case SyntaxKind.ConditionalExpression: - return (node === (parent).whenTrue || - node === (parent).whenFalse) && - isLiteralTypeLocation(parent); - case SyntaxKind.ParenthesizedExpression: - return isLiteralTypeLocation(parent); - case SyntaxKind.CaseClause: - case SyntaxKind.LiteralType: - return true; - } - return false; - } - // If the given type is an object or union type, if that type has a single signature, and if // that signature is non-generic, return the signature. Otherwise return undefined. function getNonGenericSignature(type: Type): Signature { @@ -9980,7 +10006,7 @@ namespace ts { } } else { - const type = checkExpression(e, contextualMapper); + const type = checkExpressionForMutableLocation(e, contextualMapper); elementTypes.push(type); } hasSpreadElement = hasSpreadElement || e.kind === SyntaxKind.SpreadElementExpression; @@ -10124,7 +10150,7 @@ namespace ts { } else { Debug.assert(memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment); - type = checkExpression((memberDecl).name, contextualMapper); + type = checkExpressionForMutableLocation((memberDecl).name, contextualMapper); } typeFlags |= type.flags; const prop = createSymbol(SymbolFlags.Property | SymbolFlags.Transient | member.flags, member.name); @@ -10849,10 +10875,7 @@ namespace ts { checkClassPropertyAccess(node, left, apparentType, prop); } - let propType = getTypeOfSymbol(prop); - if (prop.flags & SymbolFlags.EnumMember && isLiteralContextForType(node, propType)) { - propType = getDeclaredTypeOfSymbol(prop); - } + const propType = getTypeOfSymbol(prop); // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, @@ -11270,7 +11293,7 @@ namespace ts { // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) function instantiateSignatureInContextOf(signature: Signature, contextualSignature: Signature, contextualMapper: TypeMapper): Signature { - const context = createInferenceContext(signature.typeParameters, /*inferUnionTypes*/ true); + const context = createInferenceContext(signature, /*inferUnionTypes*/ true); forEachMatchingParameterType(contextualSignature, signature, (source, target) => { // Type parameters from outer context referenced by source type are fixed by instantiation of the source type inferTypes(context, instantiateType(source, contextualMapper), target); @@ -11926,7 +11949,7 @@ namespace ts { let candidate: Signature; let typeArgumentsAreValid: boolean; const inferenceContext = originalCandidate.typeParameters - ? createInferenceContext(originalCandidate.typeParameters, /*inferUnionTypes*/ false) + ? createInferenceContext(originalCandidate, /*inferUnionTypes*/ false) : undefined; while (true) { @@ -12357,7 +12380,7 @@ namespace ts { } function checkAssertion(node: AssertionExpression) { - const exprType = getRegularTypeOfObjectLiteral(checkExpression(node.expression)); + const exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(checkExpression(node.expression))); checkSourceElement(node.type); const targetType = getTypeFromTypeNode(node.type); @@ -12547,20 +12570,8 @@ namespace ts { return isAsync ? createPromiseReturnType(func, voidType) : voidType; } } - // When yield/return statements are contextually typed we allow the return type to be a union type. - // Otherwise we require the yield/return expressions to have a best common supertype. - type = contextualSignature ? getUnionType(types, /*subtypeReduction*/ true) : getCommonSupertype(types); - if (!type) { - if (funcIsGenerator) { - error(func, Diagnostics.No_best_common_type_exists_among_yield_expressions); - return createIterableIteratorType(unknownType); - } - else { - error(func, Diagnostics.No_best_common_type_exists_among_return_expressions); - // Defer to unioning the return types so we get a) downstream errors earlier and b) better Salsa experience - return isAsync ? createPromiseReturnType(func, getUnionType(types, /*subtypeReduction*/ true)) : getUnionType(types, /*subtypeReduction*/ true); - } - } + // Return a union of the return expression types. + type = getUnionType(types, /*subtypeReduction*/ true); if (funcIsGenerator) { type = createIterableIteratorType(type); @@ -12569,6 +12580,9 @@ namespace ts { if (!contextualSignature) { reportErrorsFromWidening(func, type); } + if (isUnitType(type) && !(contextualSignature && isLiteralContextualType(getReturnTypeOfSignature(contextualSignature)))) { + type = getBaseTypeOfLiteralType(type); + } const widenedType = getWidenedType(type); // From within an async function you can return either a non-promise value or a promise. Any @@ -12604,7 +12618,7 @@ namespace ts { return false; } const type = checkExpression(node.expression); - if (!isUnitUnionType(type)) { + if (!isLiteralType(type)) { return false; } const switchTypes = getSwitchClauseTypes(node); @@ -12947,7 +12961,7 @@ namespace ts { function checkPrefixUnaryExpression(node: PrefixUnaryExpression): Type { const operandType = checkExpression(node.operand); - if (node.operator === SyntaxKind.MinusToken && node.operand.kind === SyntaxKind.NumericLiteral && isLiteralContextForType(node, numberType)) { + if (node.operator === SyntaxKind.MinusToken && node.operand.kind === SyntaxKind.NumericLiteral) { return getLiteralTypeForText(TypeFlags.NumberLiteral, "" + -(node.operand).text); } switch (node.operator) { @@ -13347,11 +13361,11 @@ namespace ts { case SyntaxKind.ExclamationEqualsToken: case SyntaxKind.EqualsEqualsEqualsToken: case SyntaxKind.ExclamationEqualsEqualsToken: - const leftIsUnit = isUnitUnionType(leftType); - const rightIsUnit = isUnitUnionType(rightType); - if (!leftIsUnit || !rightIsUnit) { - leftType = leftIsUnit ? getBaseTypeOfUnitType(leftType) : leftType; - rightType = rightIsUnit ? getBaseTypeOfUnitType(rightType) : rightType; + const leftIsLiteral = isLiteralType(leftType); + const rightIsLiteral = isLiteralType(rightType); + if (!leftIsLiteral || !rightIsLiteral) { + leftType = leftIsLiteral ? getBaseTypeOfLiteralType(leftType) : leftType; + rightType = rightIsLiteral ? getBaseTypeOfLiteralType(rightType) : rightType; } if (!isTypeEqualityComparableTo(leftType, rightType) && !isTypeEqualityComparableTo(rightType, leftType)) { reportOperatorError(); @@ -13363,7 +13377,7 @@ namespace ts { return checkInExpression(left, right, leftType, rightType); case SyntaxKind.AmpersandAmpersandToken: return getTypeFacts(leftType) & TypeFacts.Truthy ? - includeFalsyTypes(rightType, getFalsyFlags(strictNullChecks ? leftType : getBaseTypeOfUnitType(rightType))) : + includeFalsyTypes(rightType, getFalsyFlags(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType))) : leftType; case SyntaxKind.BarBarToken: return getTypeFacts(leftType) & TypeFacts.Falsy ? @@ -13497,64 +13511,18 @@ namespace ts { return getBestChoiceType(type1, type2); } - function typeContainsLiteralFromEnum(type: Type, enumType: EnumType) { - if (type.flags & TypeFlags.Union) { - for (const t of (type).types) { - if (t.flags & TypeFlags.EnumLiteral && (t).baseType === enumType) { - return true; - } - } - } - if (type.flags & TypeFlags.EnumLiteral) { - return (type).baseType === enumType; - } - return false; - } - - function isLiteralContextForType(node: Expression, type: Type) { - if (isLiteralTypeLocation(node)) { - return true; - } - let contextualType = getContextualType(node); - if (contextualType) { - if (contextualType.flags & TypeFlags.TypeParameter) { - const apparentType = getApparentTypeOfTypeParameter(contextualType); - // If the type parameter is constrained to the base primitive type we're checking for, - // consider this a literal context. For example, given a type parameter 'T extends string', - // this causes us to infer string literal types for T. - if (type === apparentType) { - return true; - } - contextualType = apparentType; - } - if (type.flags & TypeFlags.String) { - return maybeTypeOfKind(contextualType, TypeFlags.StringLiteral); - } - if (type.flags & TypeFlags.Number) { - return maybeTypeOfKind(contextualType, (TypeFlags.NumberLiteral | TypeFlags.EnumLiteral)); - } - if (type.flags & TypeFlags.Boolean) { - return maybeTypeOfKind(contextualType, TypeFlags.BooleanLiteral); - } - if (type.flags & TypeFlags.Enum) { - return typeContainsLiteralFromEnum(contextualType, type); - } - } - return false; - } - function checkLiteralExpression(node: Expression): Type { if (node.kind === SyntaxKind.NumericLiteral) { checkGrammarNumericLiteral(node); } switch (node.kind) { case SyntaxKind.StringLiteral: - return isLiteralContextForType(node, stringType) ? getLiteralTypeForText(TypeFlags.StringLiteral, (node).text) : stringType; + return getLiteralTypeForText(TypeFlags.StringLiteral, (node).text); case SyntaxKind.NumericLiteral: - return isLiteralContextForType(node, numberType) ? getLiteralTypeForText(TypeFlags.NumberLiteral, (node).text) : numberType; + return getLiteralTypeForText(TypeFlags.NumberLiteral, (node).text); case SyntaxKind.TrueKeyword: case SyntaxKind.FalseKeyword: - return isLiteralContextForType(node, booleanType) ? node.kind === SyntaxKind.TrueKeyword ? trueType : falseType : booleanType; + return node.kind === SyntaxKind.TrueKeyword ? trueType : falseType; } } @@ -13593,6 +13561,28 @@ namespace ts { return links.resolvedType; } + function isLiteralContextualType(contextualType: Type) { + if (contextualType) { + if (contextualType.flags & TypeFlags.TypeParameter) { + const apparentType = getApparentTypeOfTypeParameter(contextualType); + // If the type parameter is constrained to the base primitive type we're checking for, + // consider this a literal context. For example, given a type parameter 'T extends string', + // this causes us to infer string literal types for T. + if (apparentType.flags & (TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Enum)) { + return true; + } + contextualType = apparentType; + } + return maybeTypeOfKind(contextualType, TypeFlags.Literal); + } + return false; + } + + function checkExpressionForMutableLocation(node: Expression, contextualMapper?: TypeMapper): Type { + const type = checkExpression(node, contextualMapper); + return isLiteralContextualType(getContextualType(node)) ? type : getBaseTypeOfLiteralType(type); + } + function checkPropertyAssignment(node: PropertyAssignment, contextualMapper?: TypeMapper): Type { // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including @@ -13601,7 +13591,7 @@ namespace ts { checkComputedPropertyName(node.name); } - return checkExpression((node).initializer, contextualMapper); + return checkExpressionForMutableLocation((node).initializer, contextualMapper); } function checkObjectLiteralMethod(node: MethodDeclaration, contextualMapper?: TypeMapper): Type { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cddb132f56c2b..440812664d89d 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1063,10 +1063,6 @@ "category": "Error", "code": 2353 }, - "No best common type exists among return expressions.": { - "category": "Error", - "code": 2354 - }, "A function whose declared type is neither 'void' nor 'any' must return a value.": { "category": "Error", "code": 2355 @@ -1631,10 +1627,6 @@ "category": "Error", "code": 2503 }, - "No best common type exists among yield expressions.": { - "category": "Error", - "code": 2504 - }, "A generator cannot have a 'void' type annotation.": { "category": "Error", "code": 2505 diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4a9338587d273..5a377efadf150 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2593,13 +2593,14 @@ namespace ts { export interface TypeInferences { primary: Type[]; // Inferences made directly to a type parameter secondary: Type[]; // Inferences made to a type parameter in a union type + topLevel: boolean; // True if all inferences were made from top-level (not nested in object type) locations isFixed: boolean; // Whether the type parameter is fixed, as defined in section 4.12.2 of the TypeScript spec // If a type parameter is fixed, no more inferences can be made for the type parameter } /* @internal */ export interface InferenceContext { - typeParameters: TypeParameter[]; // Type parameters for which inferences are made + signature: Signature; // Generic signature for which inferences are made inferUnionTypes: boolean; // Infer union types for disjoint candidates (otherwise undefinedType) inferences: TypeInferences[]; // Inferences made for each type parameter inferredTypes: Type[]; // Inferred type for each type parameter diff --git a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types index fec7593a993eb..92612490eb4c0 100644 --- a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types @@ -56,6 +56,6 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000 >A.Point : typeof A.Point >A : typeof A >Point : typeof A.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types index cd57c0c503dd2..83359d5ae2792 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types @@ -50,6 +50,6 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000 >A.Point : typeof A.Point >A : typeof A >Point : typeof A.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types index 035f2a50c3793..f8525c4e426c8 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types @@ -15,9 +15,9 @@ function Point() { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } === tests/cases/conformance/internalModules/DeclarationMerging/test.ts === diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types index 9d943ab354c23..b0685c4f858cf 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types @@ -11,9 +11,9 @@ class Point { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } module Point { @@ -21,7 +21,7 @@ module Point { function Origin() { return ""; }// not an error, since not exported >Origin : () => string ->"" : string +>"" : "" } @@ -40,9 +40,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } export module Point { @@ -50,6 +50,6 @@ module A { function Origin() { return ""; }// not an error since not exported >Origin : () => string ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types index 8f8ffc8839f48..7aa32879b7c79 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types @@ -11,9 +11,9 @@ class Point { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } module Point { @@ -21,7 +21,7 @@ module Point { var Origin = ""; // not an error, since not exported >Origin : string ->"" : string +>"" : "" } @@ -40,9 +40,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } export module Point { @@ -50,6 +50,6 @@ module A { var Origin = ""; // not an error since not exported >Origin : string ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.types b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.types index 471397299950b..5e6077a09332d 100644 --- a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.types +++ b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.types @@ -7,5 +7,5 @@ class C { x = 10; >x : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/ES3For-ofTypeCheck2.types b/tests/baselines/reference/ES3For-ofTypeCheck2.types index 81230c9cea451..dd5861094980d 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck2.types +++ b/tests/baselines/reference/ES3For-ofTypeCheck2.types @@ -2,5 +2,5 @@ for (var v of [true]) { } >v : boolean >[true] : boolean[] ->true : boolean +>true : true diff --git a/tests/baselines/reference/ES5For-of10.types b/tests/baselines/reference/ES5For-of10.types index d31f89720387b..2813e614e54a7 100644 --- a/tests/baselines/reference/ES5For-of10.types +++ b/tests/baselines/reference/ES5For-of10.types @@ -5,7 +5,7 @@ function foo() { return { x: 0 }; >{ x: 0 } : { x: number; } >x : number ->0 : number +>0 : 0 } for (foo().x of []) { >foo().x : number diff --git a/tests/baselines/reference/ES5For-of13.types b/tests/baselines/reference/ES5For-of13.types index 46125af551e41..150517378d896 100644 --- a/tests/baselines/reference/ES5For-of13.types +++ b/tests/baselines/reference/ES5For-of13.types @@ -2,9 +2,9 @@ for (let v of ['a', 'b', 'c']) { >v : string >['a', 'b', 'c'] : string[] ->'a' : string ->'b' : string ->'c' : string +>'a' : "a" +>'b' : "b" +>'c' : "c" var x = v; >x : string diff --git a/tests/baselines/reference/ES5For-of24.types b/tests/baselines/reference/ES5For-of24.types index c0c4666fbf5d5..aa9aad228e56a 100644 --- a/tests/baselines/reference/ES5For-of24.types +++ b/tests/baselines/reference/ES5For-of24.types @@ -2,9 +2,9 @@ var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 for (var v of a) { >v : number @@ -12,5 +12,5 @@ for (var v of a) { let a = 0; >a : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/ES5For-of25.types b/tests/baselines/reference/ES5For-of25.types index 4650e3244d370..0d304512bf38a 100644 --- a/tests/baselines/reference/ES5For-of25.types +++ b/tests/baselines/reference/ES5For-of25.types @@ -2,9 +2,9 @@ var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 for (var v of a) { >v : number diff --git a/tests/baselines/reference/ES5For-of3.types b/tests/baselines/reference/ES5For-of3.types index 65267fe3f7055..29825c5c32d71 100644 --- a/tests/baselines/reference/ES5For-of3.types +++ b/tests/baselines/reference/ES5For-of3.types @@ -2,9 +2,9 @@ for (var v of ['a', 'b', 'c']) >v : string >['a', 'b', 'c'] : string[] ->'a' : string ->'b' : string ->'c' : string +>'a' : "a" +>'b' : "b" +>'c' : "c" var x = v; >x : string diff --git a/tests/baselines/reference/ES5For-of30.errors.txt b/tests/baselines/reference/ES5For-of30.errors.txt index e99b8284bf336..284dd372e5a72 100644 --- a/tests/baselines/reference/ES5For-of30.errors.txt +++ b/tests/baselines/reference/ES5For-of30.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'string | number' is not an array type. -tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts (3 errors) ==== @@ -10,9 +10,9 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error ~~~~~~~~~~~~~~~ !!! error TS2461: Type 'string | number' is not an array type. ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '1' is not assignable to type 'string'. ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. a; b; } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of9.types b/tests/baselines/reference/ES5For-of9.types index ec41df704c6b9..6df6e295d759e 100644 --- a/tests/baselines/reference/ES5For-of9.types +++ b/tests/baselines/reference/ES5For-of9.types @@ -5,7 +5,7 @@ function foo() { return { x: 0 }; >{ x: 0 } : { x: number; } >x : number ->0 : number +>0 : 0 } for (foo().x of []) { >foo().x : number diff --git a/tests/baselines/reference/ES5For-ofTypeCheck1.types b/tests/baselines/reference/ES5For-ofTypeCheck1.types index 395900d683b12..6faba8c23aaa3 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck1.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck1.types @@ -1,5 +1,5 @@ === tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck1.ts === for (var v of "") { } >v : string ->"" : string +>"" : "" diff --git a/tests/baselines/reference/ES5For-ofTypeCheck12.errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck12.errors.txt index 67af1f4f40116..5310d5886197b 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck12.errors.txt +++ b/tests/baselines/reference/ES5For-ofTypeCheck12.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2495: Type 'number' is not an array type or a string type. +tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2495: Type '0' is not an array type or a string type. ==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts (1 errors) ==== for (const v of 0) { } ~ -!!! error TS2495: Type 'number' is not an array type or a string type. \ No newline at end of file +!!! error TS2495: Type '0' is not an array type or a string type. \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-ofTypeCheck2.types b/tests/baselines/reference/ES5For-ofTypeCheck2.types index d28a2803216d4..f6c9b7c8ba40d 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck2.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck2.types @@ -2,5 +2,5 @@ for (var v of [true]) { } >v : boolean >[true] : boolean[] ->true : boolean +>true : true diff --git a/tests/baselines/reference/ES5For-ofTypeCheck3.types b/tests/baselines/reference/ES5For-ofTypeCheck3.types index a62dcc94f989f..d46cdd0172d56 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck3.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck3.types @@ -2,8 +2,8 @@ var tuple: [string, number] = ["", 0]; >tuple : [string, number] >["", 0] : [string, number] ->"" : string ->0 : number +>"" : "" +>0 : 0 for (var v of tuple) { } >v : string | number diff --git a/tests/baselines/reference/ES5for-of32.types b/tests/baselines/reference/ES5for-of32.types index 034d7a3b1eaba..188500c4859f3 100644 --- a/tests/baselines/reference/ES5for-of32.types +++ b/tests/baselines/reference/ES5for-of32.types @@ -3,13 +3,13 @@ var array = [1,2,3]; >array : number[] >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var sum = 0; >sum : number ->0 : number +>0 : 0 for (let num of array) { >num : number @@ -24,9 +24,9 @@ for (let num of array) { >array = [4,5,6] : number[] >array : number[] >[4,5,6] : number[] ->4 : number ->5 : number ->6 : number +>4 : 4 +>5 : 5 +>6 : 6 } sum += num; diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types index 205335c7eb644..d23289299385f 100644 --- a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types @@ -3,8 +3,8 @@ enum enumdule { >enumdule : enumdule Red, Blue ->Red : enumdule ->Blue : enumdule +>Red : enumdule.Red +>Blue : enumdule.Blue } module enumdule { @@ -25,9 +25,9 @@ var x: enumdule; var x = enumdule.Red; >x : enumdule ->enumdule.Red : enumdule +>enumdule.Red : enumdule.Red >enumdule : typeof enumdule ->Red : enumdule +>Red : enumdule.Red var y: { x: number; y: number }; >y : { x: number; y: number; } @@ -40,6 +40,6 @@ var y = new enumdule.Point(0, 0); >enumdule.Point : typeof enumdule.Point >enumdule : typeof enumdule >Point : typeof enumdule.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types index e47b38a0b61e5..04d0259f04e48 100644 --- a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types +++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types @@ -31,7 +31,7 @@ module A { >Point : Point return 1; ->1 : number +>1 : 1 } } } diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types index a5cefcc521ebf..e832f36e86234 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -17,9 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export class Point3d extends Point { >Point3d : Point3d @@ -34,11 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >z : number ->0 : number +>0 : 0 export class Line{ >Line : Line diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types index ba174d9bbba55..1a97175a833c4 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types @@ -17,9 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export class Point3d extends Point { >Point3d : Point3d @@ -34,11 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >z : number ->0 : number +>0 : 0 export class Line{ >Line : Line diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types index 60a6e122a78d3..957c9ce0207a2 100644 --- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types @@ -33,9 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >p : Point } } diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types index ba862ad77cf83..079b39650d010 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types @@ -33,9 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >p : Point } } diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types index ef72f80ffde49..6fcbb786a68a6 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types @@ -33,9 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >p : Point } } diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types index b4a331b9140e6..c7c78424064d5 100644 --- a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -17,9 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export interface Point3d extends Point { >Point3d : Point3d @@ -34,11 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >z : number ->0 : number +>0 : 0 export interface Line{ >Line : Line diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types index 366e21b6472a5..8d07e4a44dd7f 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types @@ -17,9 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export interface Point3d extends Point { >Point3d : Point3d @@ -34,11 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >z : number ->0 : number +>0 : 0 export interface Line{ >Line : Line diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types index cd8526242faa3..a3ee7c55a4c16 100644 --- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types @@ -18,8 +18,8 @@ module A { >Point : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 export class Line { >Line : Line @@ -42,9 +42,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >p : Point } } diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types index e08a4345a95ad..0ce1b82d67e12 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types @@ -15,9 +15,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export var Unity = { start: new Point(0, 0), end: new Point(1, 0) }; >Unity : { start: Point; end: Point; } @@ -25,12 +25,12 @@ module A { >start : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 >end : Point >new Point(1, 0) : Point >Point : typeof Point ->1 : number ->0 : number +>1 : 1 +>0 : 0 } diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types index faf86ea698268..91504be2c7024 100644 --- a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types @@ -18,8 +18,8 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types index 4ce1912d4411c..39bc5fa8af0ec 100644 --- a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types @@ -18,9 +18,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 interface Point3d extends Point { >Point3d : Point3d @@ -36,10 +36,10 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >z : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types index fe976cd0a3b68..f070f422a52c6 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types @@ -8,9 +8,9 @@ module A { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } } @@ -25,9 +25,9 @@ module B { >Origin : { x: number; y: number; } >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types index 343b69954b025..f728c41b6a146 100644 --- a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types @@ -15,8 +15,8 @@ enum enumdule { >enumdule : enumdule Red, Blue ->Red : enumdule ->Blue : enumdule +>Red : enumdule.Red +>Blue : enumdule.Blue } var x: enumdule; @@ -25,9 +25,9 @@ var x: enumdule; var x = enumdule.Red; >x : enumdule ->enumdule.Red : enumdule +>enumdule.Red : enumdule.Red >enumdule : typeof enumdule ->Red : enumdule +>Red : enumdule.Red var y: { x: number; y: number }; >y : { x: number; y: number; } @@ -40,6 +40,6 @@ var y = new enumdule.Point(0, 0); >enumdule.Point : typeof enumdule.Point >enumdule : typeof enumdule >Point : typeof enumdule.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types index af3c0776b56f7..25a627030c43e 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types @@ -39,9 +39,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } === tests/cases/conformance/internalModules/DeclarationMerging/part2.ts === @@ -51,7 +51,7 @@ module A { // not a collision, since we don't export var Origin: string = "0,0"; >Origin : string ->"0,0" : string +>"0,0" : "0,0" export module Utils { >Utils : typeof Utils @@ -123,8 +123,8 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >o : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types index e005522ddfc45..2d654a580ea38 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types @@ -55,9 +55,9 @@ module otherRoot { >Point : Root.A.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export module Utils { >Utils : typeof Utils diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types index e2dd1f400f4d8..11cb6e95d2814 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types @@ -45,9 +45,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export module Utils { >Utils : typeof Utils @@ -119,8 +119,8 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >o : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.types b/tests/baselines/reference/TypeGuardWithEnumUnion.types index dee8feae27d4a..d33411c4c7c1a 100644 --- a/tests/baselines/reference/TypeGuardWithEnumUnion.types +++ b/tests/baselines/reference/TypeGuardWithEnumUnion.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts === enum Color { R, G, B } >Color : Color ->R : Color ->G : Color ->B : Color +>R : Color.R +>G : Color.G +>B : Color.B function f1(x: Color | string) { >f1 : (x: string | Color) => void diff --git a/tests/baselines/reference/VariableDeclaration10_es6.types b/tests/baselines/reference/VariableDeclaration10_es6.types index 717de7ed0fff5..29056b88ce1a9 100644 --- a/tests/baselines/reference/VariableDeclaration10_es6.types +++ b/tests/baselines/reference/VariableDeclaration10_es6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration10_es6.ts === let a: number = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/VariableDeclaration3_es6.types b/tests/baselines/reference/VariableDeclaration3_es6.types index 1b5bbdb4ea704..5f92a06df1195 100644 --- a/tests/baselines/reference/VariableDeclaration3_es6.types +++ b/tests/baselines/reference/VariableDeclaration3_es6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration3_es6.ts === const a = 1 ->a : number ->1 : number +>a : 1 +>1 : 1 diff --git a/tests/baselines/reference/VariableDeclaration5_es6.types b/tests/baselines/reference/VariableDeclaration5_es6.types index 0dce532be51c1..c0ed35a43e3e0 100644 --- a/tests/baselines/reference/VariableDeclaration5_es6.types +++ b/tests/baselines/reference/VariableDeclaration5_es6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration5_es6.ts === const a: number = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/VariableDeclaration8_es6.types b/tests/baselines/reference/VariableDeclaration8_es6.types index 24a3cd85383fe..e31fddbc09f89 100644 --- a/tests/baselines/reference/VariableDeclaration8_es6.types +++ b/tests/baselines/reference/VariableDeclaration8_es6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration8_es6.ts === let a = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/abstractIdentifierNameStrict.types b/tests/baselines/reference/abstractIdentifierNameStrict.types index 7c79ce58a372e..de6b1f458ac7f 100644 --- a/tests/baselines/reference/abstractIdentifierNameStrict.types +++ b/tests/baselines/reference/abstractIdentifierNameStrict.types @@ -1,15 +1,15 @@ === tests/cases/compiler/abstractIdentifierNameStrict.ts === var abstract = true; >abstract : boolean ->true : boolean +>true : true function foo() { >foo : () => void "use strict"; ->"use strict" : string +>"use strict" : "use strict" var abstract = true; >abstract : boolean ->true : boolean +>true : true } diff --git a/tests/baselines/reference/abstractProperty.types b/tests/baselines/reference/abstractProperty.types index b6aff9356cdb7..aa0d1c6917a94 100644 --- a/tests/baselines/reference/abstractProperty.types +++ b/tests/baselines/reference/abstractProperty.types @@ -40,7 +40,7 @@ class C extends B { get prop() { return "foo"; } >prop : string ->"foo" : string +>"foo" : "foo" set prop(v) { } >prop : string @@ -48,11 +48,11 @@ class C extends B { raw = "edge"; >raw : string ->"edge" : string +>"edge" : "edge" readonly ro = "readonly please"; ->ro : string ->"readonly please" : string +>ro : "readonly please" +>"readonly please" : "readonly please" readonlyProp: string; // don't have to give a value, in fact >readonlyProp : string diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.types b/tests/baselines/reference/accessOverriddenBaseClassMember1.types index f444544ea4891..f0dad0ccafcb7 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.types +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.types @@ -13,11 +13,11 @@ class Point { >"x=" + this.x + " y=" + this.y : string >"x=" + this.x + " y=" : string >"x=" + this.x : string ->"x=" : string +>"x=" : "x=" >this.x : number >this : this >x : number ->" y=" : string +>" y=" : " y=" >this.y : number >this : this >y : number @@ -48,7 +48,7 @@ class ColoredPoint extends Point { >super.toString : () => string >super : Point >toString : () => string ->" color=" : string +>" color=" : " color=" >this.color : string >this : this >color : string diff --git a/tests/baselines/reference/accessorWithES5.types b/tests/baselines/reference/accessorWithES5.types index 29471548918eb..4d23f61c0eb68 100644 --- a/tests/baselines/reference/accessorWithES5.types +++ b/tests/baselines/reference/accessorWithES5.types @@ -7,7 +7,7 @@ class C { >x : number return 1; ->1 : number +>1 : 1 } } @@ -26,7 +26,7 @@ var x = { get a() { return 1 } >a : number ->1 : number +>1 : 1 } var y = { diff --git a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt index 981cb52562546..5393eee87d477 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt +++ b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt @@ -1,14 +1,14 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2322: Type '0' is not assignable to type 'string'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2322: Type '0' is not assignable to type 'string'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -21,13 +21,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. public get AnnotatedSetter_SetterLast() { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. public set AnnotatedSetter_SetterLast(a: number) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -39,13 +39,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '0' is not assignable to type 'string'. public set AnnotatedGetter_GetterLast(aStr) { aStr = 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '0' is not assignable to type 'string'. public get AnnotatedGetter_GetterLast(): string { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types index 98bd191024140..2618f7b3cc72e 100644 --- a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types @@ -22,5 +22,5 @@ var kitty = a(1); >kitty : string >a(1) : string >a : Bar ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types index 9f1a9f03898ef..0994360ca10d5 100644 --- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types @@ -13,9 +13,9 @@ class C { } enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c module M { export var a } >M : typeof M @@ -130,9 +130,9 @@ var r15 = a + E.a; >r15 : any >a + E.a : any >a : any ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var r16 = a + M; >r16 : any @@ -144,13 +144,13 @@ var r17 = a + ''; >r17 : string >a + '' : string >a : any ->'' : string +>'' : "" var r18 = a + 123; >r18 : any >a + 123 : any >a : any ->123 : number +>123 : 123 var r19 = a + { a: '' }; >r19 : any @@ -158,7 +158,7 @@ var r19 = a + { a: '' }; >a : any >{ a: '' } : { a: string; } >a : string ->'' : string +>'' : "" var r20 = a + ((a: string) => { return a }); >r20 : any diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt index bd71b64b50129..124120cef2c99 100644 --- a/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt @@ -6,17 +6,17 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(25,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'boolean'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(26,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'number'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(27,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(30,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(31,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(32,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(30,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'true'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(31,11): error TS2365: Operator '+' cannot be applied to types 'true' and 'false'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(32,11): error TS2365: Operator '+' cannot be applied to types 'true' and '123'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(33,11): error TS2365: Operator '+' cannot be applied to types '{}' and '{}'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(34,11): error TS2365: Operator '+' cannot be applied to types 'number' and 'Number'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(35,11): error TS2365: Operator '+' cannot be applied to types 'number' and '() => void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(36,11): error TS2365: Operator '+' cannot be applied to types 'number' and 'void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(37,11): error TS2365: Operator '+' cannot be applied to types 'number' and 'typeof C'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(38,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'C'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(39,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'void'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(40,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'typeof M'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(38,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'C'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(39,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(40,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'typeof M'. ==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts (19 errors) ==== @@ -67,13 +67,13 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe // other cases var r10 = a + true; ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'true'. var r11 = true + false; ~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'true' and 'false'. var r12 = true + 123; ~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'true' and '123'. var r13 = {} + {}; ~~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '{}' and '{}'. @@ -91,10 +91,10 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe !!! error TS2365: Operator '+' cannot be applied to types 'number' and 'typeof C'. var r18 = E.a + new C(); ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'C'. +!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'C'. var r19 = E.a + C.foo(); ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'void'. var r20 = E.a + M; ~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'typeof M'. \ No newline at end of file +!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'typeof M'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt index 566fb241bf884..d18a9a13d8c78 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt +++ b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'true' and 'true'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(21,10): error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(23,11): error TS2365: Operator '+' cannot be applied to types '() => void' and '() => void'. @@ -47,7 +47,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe !!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. var r8 = null + true; ~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'true' and 'true'. var r9 = null + { a: '' }; ~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types index f4ea168ee0df8..d0feec523b054 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types @@ -3,9 +3,9 @@ enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: any; >a : any @@ -44,7 +44,7 @@ var r4 = null + 1; >r4 : number >null + 1 : number >null : null ->1 : number +>1 : 1 var r5 = null + c; >r5 : number @@ -56,17 +56,17 @@ var r6 = null + E.a; >r6 : number >null + E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var r7 = null + E['a']; >r7 : number >null + E['a'] : number >null : null ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string +>'a' : "a" var r8 = b + null; >r8 : number @@ -77,7 +77,7 @@ var r8 = b + null; var r9 = 1 + null; >r9 : number >1 + null : number ->1 : number +>1 : 1 >null : null var r10 = c + null @@ -89,17 +89,17 @@ var r10 = c + null var r11 = E.a + null; >r11 : number >E.a + null : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >null : null var r12 = E['a'] + null; >r12 : number >E['a'] + null : number ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string +>'a' : "a" >null : null // null + string @@ -113,7 +113,7 @@ var r14 = null + ''; >r14 : string >null + '' : string >null : null ->'' : string +>'' : "" var r15 = d + null; >r15 : string @@ -124,6 +124,6 @@ var r15 = d + null; var r16 = '' + null; >r16 : string >'' + null : string ->'' : string +>'' : "" >null : null diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types index 2b1c27940653d..c952fca906445 100644 --- a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types @@ -1,13 +1,13 @@ === tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNumberAndEnum.ts === enum E { a, b } >E : E ->a : E ->b : E +>a : E.a +>b : E.b enum F { c, d } >F : F ->c : F ->d : F +>c : F.c +>d : F.d var a: number; >a : number @@ -48,46 +48,46 @@ var r4 = b + b; var r5 = 0 + a; >r5 : number >0 + a : number ->0 : number +>0 : 0 >a : number var r6 = E.a + 0; >r6 : number >E.a + 0 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->0 : number +>a : E.a +>0 : 0 var r7 = E.a + E.b; >r7 : number >E.a + E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r8 = E['a'] + E['b']; >r8 : number >E['a'] + E['b'] : number ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string ->E['b'] : E +>'a' : "a" +>E['b'] : E.b >E : typeof E ->'b' : string +>'b' : "b" var r9 = E['a'] + F['c']; >r9 : number >E['a'] + F['c'] : number ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string ->F['c'] : F +>'a' : "a" +>F['c'] : F.c >F : typeof F ->'c' : string +>'c' : "c" var r10 = a + c; >r10 : number diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types index 5413f5f5bdfb4..d938da263b7a9 100644 --- a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithStringAndEveryType.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: any; >a : any @@ -129,21 +129,21 @@ var r16 = x + E.a; >r16 : string >x + E.a : string >x : string ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var r17 = x + ''; >r17 : string >x + '' : string >x : string ->'' : string +>'' : "" var r18 = x + 0; >r18 : string >x + 0 : string >x : string ->0 : number +>0 : 0 var r19 = x + { a: '' }; >r19 : string @@ -151,7 +151,7 @@ var r19 = x + { a: '' }; >x : string >{ a: '' } : { a: string; } >a : string ->'' : string +>'' : "" var r20 = x + []; >r20 : string diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt index 36233e9e9fefa..d61f101a544c2 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'true' and 'true'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(21,10): error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(23,11): error TS2365: Operator '+' cannot be applied to types '() => void' and '() => void'. @@ -47,7 +47,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe !!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. var r8 = undefined + true; ~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'true' and 'true'. var r9 = undefined + { a: '' }; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types index 16f0a4dfa8433..46ba3a147e6c5 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types @@ -3,9 +3,9 @@ enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: any; >a : any @@ -44,7 +44,7 @@ var r4 = undefined + 1; >r4 : number >undefined + 1 : number >undefined : undefined ->1 : number +>1 : 1 var r5 = undefined + c; >r5 : number @@ -56,17 +56,17 @@ var r6 = undefined + E.a; >r6 : number >undefined + E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var r7 = undefined + E['a']; >r7 : number >undefined + E['a'] : number >undefined : undefined ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string +>'a' : "a" var r8 = b + undefined; >r8 : number @@ -77,7 +77,7 @@ var r8 = b + undefined; var r9 = 1 + undefined; >r9 : number >1 + undefined : number ->1 : number +>1 : 1 >undefined : undefined var r10 = c + undefined @@ -89,17 +89,17 @@ var r10 = c + undefined var r11 = E.a + undefined; >r11 : number >E.a + undefined : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >undefined : undefined var r12 = E['a'] + undefined; >r12 : number >E['a'] + undefined : number ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string +>'a' : "a" >undefined : undefined // undefined + string @@ -113,7 +113,7 @@ var r14 = undefined + ''; >r14 : string >undefined + '' : string >undefined : undefined ->'' : string +>'' : "" var r15 = d + undefined; >r15 : string @@ -124,6 +124,6 @@ var r15 = d + undefined; var r16 = '' + undefined; >r16 : string >'' + undefined : string ->'' : string +>'' : "" >undefined : undefined diff --git a/tests/baselines/reference/aliasAssignments.errors.txt b/tests/baselines/reference/aliasAssignments.errors.txt index 18ea36c5d0045..463f74e4c49f9 100644 --- a/tests/baselines/reference/aliasAssignments.errors.txt +++ b/tests/baselines/reference/aliasAssignments.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. +tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type '1' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. @@ -7,7 +7,7 @@ tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tes var x = moduleA; x = 1; // Should be error ~ -!!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. +!!! error TS2322: Type '1' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. var y = 1; y = moduleA; // should be error ~ diff --git a/tests/baselines/reference/ambientDeclarations.types b/tests/baselines/reference/ambientDeclarations.types index f44d49cfc5783..a571eb9fa7bf7 100644 --- a/tests/baselines/reference/ambientDeclarations.types +++ b/tests/baselines/reference/ambientDeclarations.types @@ -103,14 +103,14 @@ declare enum E2 { a = 1, >a : E2 ->1 : number +>1 : 1 b, >b : E2 c = 2, >c : E2 ->2 : number +>2 : 2 d >d : E2 diff --git a/tests/baselines/reference/ambientEnumDeclaration1.types b/tests/baselines/reference/ambientEnumDeclaration1.types index 3ef30e458da95..370d6cd22ae7a 100644 --- a/tests/baselines/reference/ambientEnumDeclaration1.types +++ b/tests/baselines/reference/ambientEnumDeclaration1.types @@ -6,13 +6,13 @@ declare enum E { a = 10, >a : E ->10 : number +>10 : 10 b = 10 + 1, >b : E >10 + 1 : number ->10 : number ->1 : number +>10 : 10 +>1 : 1 c = b, >c : E @@ -23,13 +23,13 @@ declare enum E { >(c) + 1 : number >(c) : E >c : E ->1 : number +>1 : 1 e = 10 << 2 * 8, >e : E >10 << 2 * 8 : number ->10 : number +>10 : 10 >2 * 8 : number ->2 : number ->8 : number +>2 : 2 +>8 : 8 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer1.types b/tests/baselines/reference/ambientEnumElementInitializer1.types index 97db9f199d38c..11ef744950499 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer1.types +++ b/tests/baselines/reference/ambientEnumElementInitializer1.types @@ -4,5 +4,5 @@ declare enum E { e = 3 >e : E ->3 : number +>3 : 3 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer2.types b/tests/baselines/reference/ambientEnumElementInitializer2.types index 7217bc8e6fdb0..47d85bf3c8473 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer2.types +++ b/tests/baselines/reference/ambientEnumElementInitializer2.types @@ -4,6 +4,6 @@ declare enum E { e = -3 // Negative >e : E ->-3 : number ->3 : number +>-3 : -3 +>3 : 3 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer3.types b/tests/baselines/reference/ambientEnumElementInitializer3.types index f3d3b8f3ae2ae..3c099d00ede58 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer3.types +++ b/tests/baselines/reference/ambientEnumElementInitializer3.types @@ -4,5 +4,5 @@ declare enum E { e = 3.3 // Decimal >e : E ->3.3 : number +>3.3 : 3.3 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer4.types b/tests/baselines/reference/ambientEnumElementInitializer4.types index b85649d654d16..3bef657f5bbc8 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer4.types +++ b/tests/baselines/reference/ambientEnumElementInitializer4.types @@ -4,5 +4,5 @@ declare enum E { e = 0xA >e : E ->0xA : number +>0xA : 10 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer5.types b/tests/baselines/reference/ambientEnumElementInitializer5.types index 1c5ea0ecdd3e6..b3020a6d777ca 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer5.types +++ b/tests/baselines/reference/ambientEnumElementInitializer5.types @@ -4,6 +4,6 @@ declare enum E { e = -0xA >e : E ->-0xA : number ->0xA : number +>-0xA : -10 +>0xA : 10 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer6.types b/tests/baselines/reference/ambientEnumElementInitializer6.types index 015d3f4e146ef..f093d0e2dfef5 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer6.types +++ b/tests/baselines/reference/ambientEnumElementInitializer6.types @@ -7,6 +7,6 @@ declare module M { e = 3 >e : E ->3 : number +>3 : 3 } } diff --git a/tests/baselines/reference/ambientModules.types b/tests/baselines/reference/ambientModules.types index 15e6d51b457af..5a0a8c663ab54 100644 --- a/tests/baselines/reference/ambientModules.types +++ b/tests/baselines/reference/ambientModules.types @@ -5,11 +5,11 @@ declare module Foo.Bar { export var foo; }; >foo : any Foo.Bar.foo = 5; ->Foo.Bar.foo = 5 : number +>Foo.Bar.foo = 5 : 5 >Foo.Bar.foo : any >Foo.Bar : typeof Foo.Bar >Foo : typeof Foo >Bar : typeof Foo.Bar >foo : any ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types index 65f26f257700f..b3153722ee32a 100644 --- a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types +++ b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types @@ -53,7 +53,7 @@ class TestClass2 { >x : any return 0; ->0 : number +>0 : 0 } public foo(x: string): number; diff --git a/tests/baselines/reference/amdImportAsPrimaryExpression.types b/tests/baselines/reference/amdImportAsPrimaryExpression.types index 8f6e509419f68..acfe27369f529 100644 --- a/tests/baselines/reference/amdImportAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportAsPrimaryExpression.types @@ -19,8 +19,8 @@ export enum E1 { >E1 : E1 A,B,C ->A : E1 ->B : E1 ->C : E1 +>A : E1.A +>B : E1.B +>C : E1.C } diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types index 9d9faf05af806..32e45936f3349 100644 --- a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types @@ -49,11 +49,11 @@ export class C1 { m1 = 42; >m1 : number ->42 : number +>42 : 42 static s1 = true; >s1 : boolean ->true : boolean +>true : true } export interface I1 { @@ -81,8 +81,8 @@ export enum E1 { >E1 : E1 A,B,C ->A : E1 ->B : E1 ->C : E1 +>A : E1.A +>B : E1.B +>C : E1.C } diff --git a/tests/baselines/reference/amdModuleName1.types b/tests/baselines/reference/amdModuleName1.types index c0db9c8b1b5aa..f7384ddf05703 100644 --- a/tests/baselines/reference/amdModuleName1.types +++ b/tests/baselines/reference/amdModuleName1.types @@ -8,11 +8,11 @@ class Foo { constructor() { this.x = 5; ->this.x = 5 : number +>this.x = 5 : 5 >this.x : number >this : this >x : number ->5 : number +>5 : 5 } } export = Foo; diff --git a/tests/baselines/reference/anonterface.types b/tests/baselines/reference/anonterface.types index b152ce79a1df0..a6c244b28859f 100644 --- a/tests/baselines/reference/anonterface.types +++ b/tests/baselines/reference/anonterface.types @@ -34,9 +34,9 @@ c.m(function(n) { return "hello: "+n; },18); >function(n) { return "hello: "+n; } : (n: number) => string >n : number >"hello: "+n : string ->"hello: " : string +>"hello: " : "hello: " >n : number ->18 : number +>18 : 18 diff --git a/tests/baselines/reference/anyAsFunctionCall.types b/tests/baselines/reference/anyAsFunctionCall.types index 340ccac463fdd..42d0f9fc9509b 100644 --- a/tests/baselines/reference/anyAsFunctionCall.types +++ b/tests/baselines/reference/anyAsFunctionCall.types @@ -14,7 +14,7 @@ var b = x('hello'); >b : any >x('hello') : any >x : any ->'hello' : string +>'hello' : "hello" var c = x(x); >c : any diff --git a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types index bd0d9a9a09227..2ae57579835a2 100644 --- a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types +++ b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types @@ -24,8 +24,8 @@ var o = new Point(3, 4); >o : any >new Point(3, 4) : any >Point : (x: any, y: any) => void ->3 : number ->4 : number +>3 : 3 +>4 : 4 var xx = o.x; >xx : any diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.types b/tests/baselines/reference/anyAssignabilityInInheritance.types index b8575e8edb26d..925dd5d593e52 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.types +++ b/tests/baselines/reference/anyAssignabilityInInheritance.types @@ -246,7 +246,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } declare function foo15(x: typeof f): typeof f; >foo15 : { (x: typeof f): typeof f; (x: any): any; } @@ -273,7 +273,7 @@ module CC { export var bar = 1; >bar : number ->1 : number +>1 : 1 } declare function foo16(x: CC): CC; >foo16 : { (x: CC): CC; (x: any): any; } diff --git a/tests/baselines/reference/anyAssignableToEveryType2.types b/tests/baselines/reference/anyAssignableToEveryType2.types index b3f54211601a0..564b634cde3d1 100644 --- a/tests/baselines/reference/anyAssignableToEveryType2.types +++ b/tests/baselines/reference/anyAssignableToEveryType2.types @@ -187,7 +187,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } interface I15 { >I15 : I15 @@ -210,7 +210,7 @@ module c { export var bar = 1; >bar : number ->1 : number +>1 : 1 } interface I16 { >I16 : I16 diff --git a/tests/baselines/reference/anyPlusAny1.types b/tests/baselines/reference/anyPlusAny1.types index 406d432f06ed0..f6ca9c4996eee 100644 --- a/tests/baselines/reference/anyPlusAny1.types +++ b/tests/baselines/reference/anyPlusAny1.types @@ -3,11 +3,11 @@ var x; >x : any x.name = "hello"; ->x.name = "hello" : string +>x.name = "hello" : "hello" >x.name : any >x : any >name : any ->"hello" : string +>"hello" : "hello" var z = x + x; >z : any diff --git a/tests/baselines/reference/anyPropertyAccess.types b/tests/baselines/reference/anyPropertyAccess.types index 13eec6b53b23a..9b9e5ab84ac8e 100644 --- a/tests/baselines/reference/anyPropertyAccess.types +++ b/tests/baselines/reference/anyPropertyAccess.types @@ -12,14 +12,14 @@ var b = x['foo']; >b : any >x['foo'] : any >x : any ->'foo' : string +>'foo' : "foo" var c = x['fn'](); >c : any >x['fn']() : any >x['fn'] : any >x : any ->'fn' : string +>'fn' : "fn" var d = x.bar.baz; >d : any @@ -34,7 +34,7 @@ var e = x[0].foo; >x[0].foo : any >x[0] : any >x : any ->0 : number +>0 : 0 >foo : any var f = x['0'].bar; @@ -42,6 +42,6 @@ var f = x['0'].bar; >x['0'].bar : any >x['0'] : any >x : any ->'0' : string +>'0' : "0" >bar : any diff --git a/tests/baselines/reference/argsInScope.types b/tests/baselines/reference/argsInScope.types index 745ae2493595b..dacc66be9120a 100644 --- a/tests/baselines/reference/argsInScope.types +++ b/tests/baselines/reference/argsInScope.types @@ -10,7 +10,7 @@ class C { for (var i = 0; i < arguments.length; i++) { >i : number ->0 : number +>0 : 0 >i < arguments.length : boolean >i : number >arguments.length : number @@ -34,7 +34,7 @@ c.P(1,2,3); >c.P : (ii: number, j: number, k: number) => void >c : C >P : (ii: number, j: number, k: number) => void ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 diff --git a/tests/baselines/reference/arguments.types b/tests/baselines/reference/arguments.types index 4699d463b3434..97a23822b7aff 100644 --- a/tests/baselines/reference/arguments.types +++ b/tests/baselines/reference/arguments.types @@ -6,5 +6,5 @@ function f() { >x : any >arguments[12] : any >arguments : IArguments ->12 : number +>12 : 12 } diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt index 89ef8ded91c64..c19f00fa1da73 100644 --- a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments'. +tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type '10' is not assignable to type 'IArguments'. ==== tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS function foo(a) { arguments = 10; /// This shouldnt be of type number and result in error. ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'IArguments'. +!!! error TS2322: Type '10' is not assignable to type 'IArguments'. } \ No newline at end of file diff --git a/tests/baselines/reference/arithAssignTyping.errors.txt b/tests/baselines/reference/arithAssignTyping.errors.txt index c4cd84639a6a5..10f34e94012f2 100644 --- a/tests/baselines/reference/arithAssignTyping.errors.txt +++ b/tests/baselines/reference/arithAssignTyping.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/arithAssignTyping.ts(3,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/arithAssignTyping.ts(4,1): error TS2365: Operator '+=' cannot be applied to types 'typeof f' and 'number'. +tests/cases/compiler/arithAssignTyping.ts(4,1): error TS2365: Operator '+=' cannot be applied to types 'typeof f' and '1'. tests/cases/compiler/arithAssignTyping.ts(5,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/arithAssignTyping.ts(6,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/arithAssignTyping.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -20,7 +20,7 @@ tests/cases/compiler/arithAssignTyping.ts(14,1): error TS2362: The left-hand sid !!! error TS2364: Invalid left-hand side of assignment expression. f += 1; // error ~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'typeof f' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'typeof f' and '1'. f -= 1; // error ~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. diff --git a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types index 8845a52760d36..eeaf6a0ab385b 100644 --- a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types +++ b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types @@ -22,30 +22,30 @@ var ra3 = a * 0; >ra3 : number >a * 0 : number >a : any ->0 : number +>0 : 0 var ra4 = 0 * a; >ra4 : number >0 * a : number ->0 : number +>0 : 0 >a : any var ra5 = 0 * 0; >ra5 : number >0 * 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var ra6 = b * 0; >ra6 : number >b * 0 : number >b : number ->0 : number +>0 : 0 var ra7 = 0 * b; >ra7 : number >0 * b : number ->0 : number +>0 : 0 >b : number var ra8 = b * b; @@ -71,30 +71,30 @@ var rb3 = a / 0; >rb3 : number >a / 0 : number >a : any ->0 : number +>0 : 0 var rb4 = 0 / a; >rb4 : number >0 / a : number ->0 : number +>0 : 0 >a : any var rb5 = 0 / 0; >rb5 : number >0 / 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rb6 = b / 0; >rb6 : number >b / 0 : number >b : number ->0 : number +>0 : 0 var rb7 = 0 / b; >rb7 : number >0 / b : number ->0 : number +>0 : 0 >b : number var rb8 = b / b; @@ -120,30 +120,30 @@ var rc3 = a % 0; >rc3 : number >a % 0 : number >a : any ->0 : number +>0 : 0 var rc4 = 0 % a; >rc4 : number >0 % a : number ->0 : number +>0 : 0 >a : any var rc5 = 0 % 0; >rc5 : number >0 % 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rc6 = b % 0; >rc6 : number >b % 0 : number >b : number ->0 : number +>0 : 0 var rc7 = 0 % b; >rc7 : number >0 % b : number ->0 : number +>0 : 0 >b : number var rc8 = b % b; @@ -169,30 +169,30 @@ var rd3 = a - 0; >rd3 : number >a - 0 : number >a : any ->0 : number +>0 : 0 var rd4 = 0 - a; >rd4 : number >0 - a : number ->0 : number +>0 : 0 >a : any var rd5 = 0 - 0; >rd5 : number >0 - 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rd6 = b - 0; >rd6 : number >b - 0 : number >b : number ->0 : number +>0 : 0 var rd7 = 0 - b; >rd7 : number >0 - b : number ->0 : number +>0 : 0 >b : number var rd8 = b - b; @@ -218,30 +218,30 @@ var re3 = a << 0; >re3 : number >a << 0 : number >a : any ->0 : number +>0 : 0 var re4 = 0 << a; >re4 : number >0 << a : number ->0 : number +>0 : 0 >a : any var re5 = 0 << 0; >re5 : number >0 << 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var re6 = b << 0; >re6 : number >b << 0 : number >b : number ->0 : number +>0 : 0 var re7 = 0 << b; >re7 : number >0 << b : number ->0 : number +>0 : 0 >b : number var re8 = b << b; @@ -267,30 +267,30 @@ var rf3 = a >> 0; >rf3 : number >a >> 0 : number >a : any ->0 : number +>0 : 0 var rf4 = 0 >> a; >rf4 : number >0 >> a : number ->0 : number +>0 : 0 >a : any var rf5 = 0 >> 0; >rf5 : number >0 >> 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rf6 = b >> 0; >rf6 : number >b >> 0 : number >b : number ->0 : number +>0 : 0 var rf7 = 0 >> b; >rf7 : number >0 >> b : number ->0 : number +>0 : 0 >b : number var rf8 = b >> b; @@ -316,30 +316,30 @@ var rg3 = a >>> 0; >rg3 : number >a >>> 0 : number >a : any ->0 : number +>0 : 0 var rg4 = 0 >>> a; >rg4 : number >0 >>> a : number ->0 : number +>0 : 0 >a : any var rg5 = 0 >>> 0; >rg5 : number >0 >>> 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rg6 = b >>> 0; >rg6 : number >b >>> 0 : number >b : number ->0 : number +>0 : 0 var rg7 = 0 >>> b; >rg7 : number >0 >>> b : number ->0 : number +>0 : 0 >b : number var rg8 = b >>> b; @@ -365,30 +365,30 @@ var rh3 = a & 0; >rh3 : number >a & 0 : number >a : any ->0 : number +>0 : 0 var rh4 = 0 & a; >rh4 : number >0 & a : number ->0 : number +>0 : 0 >a : any var rh5 = 0 & 0; >rh5 : number >0 & 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rh6 = b & 0; >rh6 : number >b & 0 : number >b : number ->0 : number +>0 : 0 var rh7 = 0 & b; >rh7 : number >0 & b : number ->0 : number +>0 : 0 >b : number var rh8 = b & b; @@ -414,30 +414,30 @@ var ri3 = a ^ 0; >ri3 : number >a ^ 0 : number >a : any ->0 : number +>0 : 0 var ri4 = 0 ^ a; >ri4 : number >0 ^ a : number ->0 : number +>0 : 0 >a : any var ri5 = 0 ^ 0; >ri5 : number >0 ^ 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var ri6 = b ^ 0; >ri6 : number >b ^ 0 : number >b : number ->0 : number +>0 : 0 var ri7 = 0 ^ b; >ri7 : number >0 ^ b : number ->0 : number +>0 : 0 >b : number var ri8 = b ^ b; @@ -463,30 +463,30 @@ var rj3 = a | 0; >rj3 : number >a | 0 : number >a : any ->0 : number +>0 : 0 var rj4 = 0 | a; >rj4 : number >0 | a : number ->0 : number +>0 : 0 >a : any var rj5 = 0 | 0; >rj5 : number >0 | 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rj6 = b | 0; >rj6 : number >b | 0 : number >b : number ->0 : number +>0 : 0 var rj7 = 0 | b; >rj7 : number >0 | b : number ->0 : number +>0 : 0 >b : number var rj8 = b | b; diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.types b/tests/baselines/reference/arithmeticOperatorWithEnum.types index 3aca5c31798c1..0f2fbe48feb07 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnum.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.types @@ -5,10 +5,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -55,60 +55,60 @@ var ra5 = b * c; var ra6 = E.a * a; >ra6 : number >E.a * a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var ra7 = E.a * b; >ra7 : number >E.a * b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var ra8 = E.a * E.b; >ra8 : number >E.a * E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra9 = E.a * 1; >ra9 : number >E.a * 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var ra10 = a * E.b; >ra10 : number >a * E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra11 = b * E.b; >ra11 : number >b * E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra12 = 1 * E.b; >ra12 : number >1 * E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator / var rb1 = c / a; @@ -144,60 +144,60 @@ var rb5 = b / c; var rb6 = E.a / a; >rb6 : number >E.a / a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rb7 = E.a / b; >rb7 : number >E.a / b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rb8 = E.a / E.b; >rb8 : number >E.a / E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb9 = E.a / 1; >rb9 : number >E.a / 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rb10 = a / E.b; >rb10 : number >a / E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb11 = b / E.b; >rb11 : number >b / E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb12 = 1 / E.b; >rb12 : number >1 / E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator % var rc1 = c % a; @@ -233,60 +233,60 @@ var rc5 = b % c; var rc6 = E.a % a; >rc6 : number >E.a % a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rc7 = E.a % b; >rc7 : number >E.a % b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rc8 = E.a % E.b; >rc8 : number >E.a % E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc9 = E.a % 1; >rc9 : number >E.a % 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rc10 = a % E.b; >rc10 : number >a % E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc11 = b % E.b; >rc11 : number >b % E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc12 = 1 % E.b; >rc12 : number >1 % E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator - var rd1 = c - a; @@ -322,60 +322,60 @@ var rd5 = b - c; var rd6 = E.a - a; >rd6 : number >E.a - a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rd7 = E.a - b; >rd7 : number >E.a - b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rd8 = E.a - E.b; >rd8 : number >E.a - E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd9 = E.a - 1; >rd9 : number >E.a - 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rd10 = a - E.b; >rd10 : number >a - E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd11 = b - E.b; >rd11 : number >b - E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd12 = 1 - E.b; >rd12 : number >1 - E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator << var re1 = c << a; @@ -411,60 +411,60 @@ var re5 = b << c; var re6 = E.a << a; >re6 : number >E.a << a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var re7 = E.a << b; >re7 : number >E.a << b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var re8 = E.a << E.b; >re8 : number >E.a << E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re9 = E.a << 1; >re9 : number >E.a << 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var re10 = a << E.b; >re10 : number >a << E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re11 = b << E.b; >re11 : number >b << E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re12 = 1 << E.b; >re12 : number >1 << E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator >> var rf1 = c >> a; @@ -500,60 +500,60 @@ var rf5 = b >> c; var rf6 = E.a >> a; >rf6 : number >E.a >> a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rf7 = E.a >> b; >rf7 : number >E.a >> b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rf8 = E.a >> E.b; >rf8 : number >E.a >> E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf9 = E.a >> 1; >rf9 : number >E.a >> 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rf10 = a >> E.b; >rf10 : number >a >> E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf11 = b >> E.b; >rf11 : number >b >> E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf12 = 1 >> E.b; >rf12 : number >1 >> E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator >>> var rg1 = c >>> a; @@ -589,60 +589,60 @@ var rg5 = b >>> c; var rg6 = E.a >>> a; >rg6 : number >E.a >>> a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rg7 = E.a >>> b; >rg7 : number >E.a >>> b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rg8 = E.a >>> E.b; >rg8 : number >E.a >>> E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg9 = E.a >>> 1; >rg9 : number >E.a >>> 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rg10 = a >>> E.b; >rg10 : number >a >>> E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg11 = b >>> E.b; >rg11 : number >b >>> E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg12 = 1 >>> E.b; >rg12 : number >1 >>> E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator & var rh1 = c & a; @@ -678,60 +678,60 @@ var rh5 = b & c; var rh6 = E.a & a; >rh6 : number >E.a & a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rh7 = E.a & b; >rh7 : number >E.a & b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rh8 = E.a & E.b; >rh8 : number >E.a & E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh9 = E.a & 1; >rh9 : number >E.a & 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rh10 = a & E.b; >rh10 : number >a & E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh11 = b & E.b; >rh11 : number >b & E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh12 = 1 & E.b; >rh12 : number >1 & E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator ^ var ri1 = c ^ a; @@ -767,60 +767,60 @@ var ri5 = b ^ c; var ri6 = E.a ^ a; >ri6 : number >E.a ^ a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var ri7 = E.a ^ b; >ri7 : number >E.a ^ b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var ri8 = E.a ^ E.b; >ri8 : number >E.a ^ E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri9 = E.a ^ 1; >ri9 : number >E.a ^ 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var ri10 = a ^ E.b; >ri10 : number >a ^ E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri11 = b ^ E.b; >ri11 : number >b ^ E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri12 = 1 ^ E.b; >ri12 : number >1 ^ E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator | var rj1 = c | a; @@ -856,58 +856,58 @@ var rj5 = b | c; var rj6 = E.a | a; >rj6 : number >E.a | a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rj7 = E.a | b; >rj7 : number >E.a | b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rj8 = E.a | E.b; >rj8 : number >E.a | E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj9 = E.a | 1; >rj9 : number >E.a | 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rj10 = a | E.b; >rj10 : number >a | E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj11 = b | E.b; >rj11 : number >b | E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj12 = 1 | E.b; >rj12 : number >1 | E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types index cb9bf3d45b0c8..379bd6f34b32d 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types @@ -5,19 +5,19 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } enum F { >F : F c, ->c : F +>c : F.c d ->d : F +>d : F.d } var a: any; @@ -65,60 +65,60 @@ var ra5 = b * c; var ra6 = E.a * a; >ra6 : number >E.a * a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var ra7 = E.a * b; >ra7 : number >E.a * b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var ra8 = E.a * E.b; >ra8 : number >E.a * E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra9 = E.a * 1; >ra9 : number >E.a * 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var ra10 = a * E.b; >ra10 : number >a * E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra11 = b * E.b; >ra11 : number >b * E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra12 = 1 * E.b; >ra12 : number >1 * E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator / var rb1 = c / a; @@ -154,60 +154,60 @@ var rb5 = b / c; var rb6 = E.a / a; >rb6 : number >E.a / a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rb7 = E.a / b; >rb7 : number >E.a / b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rb8 = E.a / E.b; >rb8 : number >E.a / E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb9 = E.a / 1; >rb9 : number >E.a / 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rb10 = a / E.b; >rb10 : number >a / E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb11 = b / E.b; >rb11 : number >b / E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb12 = 1 / E.b; >rb12 : number >1 / E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator % var rc1 = c % a; @@ -243,60 +243,60 @@ var rc5 = b % c; var rc6 = E.a % a; >rc6 : number >E.a % a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rc7 = E.a % b; >rc7 : number >E.a % b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rc8 = E.a % E.b; >rc8 : number >E.a % E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc9 = E.a % 1; >rc9 : number >E.a % 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rc10 = a % E.b; >rc10 : number >a % E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc11 = b % E.b; >rc11 : number >b % E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc12 = 1 % E.b; >rc12 : number >1 % E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator - var rd1 = c - a; @@ -332,60 +332,60 @@ var rd5 = b - c; var rd6 = E.a - a; >rd6 : number >E.a - a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rd7 = E.a - b; >rd7 : number >E.a - b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rd8 = E.a - E.b; >rd8 : number >E.a - E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd9 = E.a - 1; >rd9 : number >E.a - 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rd10 = a - E.b; >rd10 : number >a - E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd11 = b - E.b; >rd11 : number >b - E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd12 = 1 - E.b; >rd12 : number >1 - E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator << var re1 = c << a; @@ -421,60 +421,60 @@ var re5 = b << c; var re6 = E.a << a; >re6 : number >E.a << a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var re7 = E.a << b; >re7 : number >E.a << b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var re8 = E.a << E.b; >re8 : number >E.a << E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re9 = E.a << 1; >re9 : number >E.a << 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var re10 = a << E.b; >re10 : number >a << E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re11 = b << E.b; >re11 : number >b << E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re12 = 1 << E.b; >re12 : number >1 << E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator >> var rf1 = c >> a; @@ -510,60 +510,60 @@ var rf5 = b >> c; var rf6 = E.a >> a; >rf6 : number >E.a >> a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rf7 = E.a >> b; >rf7 : number >E.a >> b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rf8 = E.a >> E.b; >rf8 : number >E.a >> E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf9 = E.a >> 1; >rf9 : number >E.a >> 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rf10 = a >> E.b; >rf10 : number >a >> E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf11 = b >> E.b; >rf11 : number >b >> E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf12 = 1 >> E.b; >rf12 : number >1 >> E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator >>> var rg1 = c >>> a; @@ -599,60 +599,60 @@ var rg5 = b >>> c; var rg6 = E.a >>> a; >rg6 : number >E.a >>> a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rg7 = E.a >>> b; >rg7 : number >E.a >>> b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rg8 = E.a >>> E.b; >rg8 : number >E.a >>> E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg9 = E.a >>> 1; >rg9 : number >E.a >>> 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rg10 = a >>> E.b; >rg10 : number >a >>> E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg11 = b >>> E.b; >rg11 : number >b >>> E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg12 = 1 >>> E.b; >rg12 : number >1 >>> E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator & var rh1 = c & a; @@ -688,60 +688,60 @@ var rh5 = b & c; var rh6 = E.a & a; >rh6 : number >E.a & a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rh7 = E.a & b; >rh7 : number >E.a & b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rh8 = E.a & E.b; >rh8 : number >E.a & E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh9 = E.a & 1; >rh9 : number >E.a & 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rh10 = a & E.b; >rh10 : number >a & E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh11 = b & E.b; >rh11 : number >b & E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh12 = 1 & E.b; >rh12 : number >1 & E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator ^ var ri1 = c ^ a; @@ -777,60 +777,60 @@ var ri5 = b ^ c; var ri6 = E.a ^ a; >ri6 : number >E.a ^ a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var ri7 = E.a ^ b; >ri7 : number >E.a ^ b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var ri8 = E.a ^ E.b; >ri8 : number >E.a ^ E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri9 = E.a ^ 1; >ri9 : number >E.a ^ 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var ri10 = a ^ E.b; >ri10 : number >a ^ E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri11 = b ^ E.b; >ri11 : number >b ^ E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri12 = 1 ^ E.b; >ri12 : number >1 ^ E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator | var rj1 = c | a; @@ -866,58 +866,58 @@ var rj5 = b | c; var rj6 = E.a | a; >rj6 : number >E.a | a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rj7 = E.a | b; >rj7 : number >E.a | b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rj8 = E.a | E.b; >rj8 : number >E.a | E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj9 = E.a | 1; >rj9 : number >E.a | 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rj10 = a | E.b; >rj10 : number >a | E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj11 = b | E.b; >rj11 : number >b | E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj12 = 1 | E.b; >rj12 : number >1 | E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types index 521fb4d731344..78e2a5945f072 100644 --- a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types @@ -6,10 +6,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -35,15 +35,15 @@ var ra3 = null * 1; >ra3 : number >null * 1 : number >null : null ->1 : number +>1 : 1 var ra4 = null * E.a; >ra4 : number >null * E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var ra5 = a * null; >ra5 : number @@ -60,15 +60,15 @@ var ra6 = b * null; var ra7 = 0 * null; >ra7 : number >0 * null : number ->0 : number +>0 : 0 >null : null var ra8 = E.b * null; >ra8 : number >E.b * null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator / @@ -88,15 +88,15 @@ var rb3 = null / 1; >rb3 : number >null / 1 : number >null : null ->1 : number +>1 : 1 var rb4 = null / E.a; >rb4 : number >null / E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rb5 = a / null; >rb5 : number @@ -113,15 +113,15 @@ var rb6 = b / null; var rb7 = 0 / null; >rb7 : number >0 / null : number ->0 : number +>0 : 0 >null : null var rb8 = E.b / null; >rb8 : number >E.b / null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator % @@ -141,15 +141,15 @@ var rc3 = null % 1; >rc3 : number >null % 1 : number >null : null ->1 : number +>1 : 1 var rc4 = null % E.a; >rc4 : number >null % E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rc5 = a % null; >rc5 : number @@ -166,15 +166,15 @@ var rc6 = b % null; var rc7 = 0 % null; >rc7 : number >0 % null : number ->0 : number +>0 : 0 >null : null var rc8 = E.b % null; >rc8 : number >E.b % null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator - @@ -194,15 +194,15 @@ var rd3 = null - 1; >rd3 : number >null - 1 : number >null : null ->1 : number +>1 : 1 var rd4 = null - E.a; >rd4 : number >null - E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rd5 = a - null; >rd5 : number @@ -219,15 +219,15 @@ var rd6 = b - null; var rd7 = 0 - null; >rd7 : number >0 - null : number ->0 : number +>0 : 0 >null : null var rd8 = E.b - null; >rd8 : number >E.b - null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator << @@ -247,15 +247,15 @@ var re3 = null << 1; >re3 : number >null << 1 : number >null : null ->1 : number +>1 : 1 var re4 = null << E.a; >re4 : number >null << E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var re5 = a << null; >re5 : number @@ -272,15 +272,15 @@ var re6 = b << null; var re7 = 0 << null; >re7 : number >0 << null : number ->0 : number +>0 : 0 >null : null var re8 = E.b << null; >re8 : number >E.b << null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator >> @@ -300,15 +300,15 @@ var rf3 = null >> 1; >rf3 : number >null >> 1 : number >null : null ->1 : number +>1 : 1 var rf4 = null >> E.a; >rf4 : number >null >> E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rf5 = a >> null; >rf5 : number @@ -325,15 +325,15 @@ var rf6 = b >> null; var rf7 = 0 >> null; >rf7 : number >0 >> null : number ->0 : number +>0 : 0 >null : null var rf8 = E.b >> null; >rf8 : number >E.b >> null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator >>> @@ -353,15 +353,15 @@ var rg3 = null >>> 1; >rg3 : number >null >>> 1 : number >null : null ->1 : number +>1 : 1 var rg4 = null >>> E.a; >rg4 : number >null >>> E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rg5 = a >>> null; >rg5 : number @@ -378,15 +378,15 @@ var rg6 = b >>> null; var rg7 = 0 >>> null; >rg7 : number >0 >>> null : number ->0 : number +>0 : 0 >null : null var rg8 = E.b >>> null; >rg8 : number >E.b >>> null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator & @@ -406,15 +406,15 @@ var rh3 = null & 1; >rh3 : number >null & 1 : number >null : null ->1 : number +>1 : 1 var rh4 = null & E.a; >rh4 : number >null & E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rh5 = a & null; >rh5 : number @@ -431,15 +431,15 @@ var rh6 = b & null; var rh7 = 0 & null; >rh7 : number >0 & null : number ->0 : number +>0 : 0 >null : null var rh8 = E.b & null; >rh8 : number >E.b & null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator ^ @@ -459,15 +459,15 @@ var ri3 = null ^ 1; >ri3 : number >null ^ 1 : number >null : null ->1 : number +>1 : 1 var ri4 = null ^ E.a; >ri4 : number >null ^ E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var ri5 = a ^ null; >ri5 : number @@ -484,15 +484,15 @@ var ri6 = b ^ null; var ri7 = 0 ^ null; >ri7 : number >0 ^ null : number ->0 : number +>0 : 0 >null : null var ri8 = E.b ^ null; >ri8 : number >E.b ^ null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator | @@ -512,15 +512,15 @@ var rj3 = null | 1; >rj3 : number >null | 1 : number >null : null ->1 : number +>1 : 1 var rj4 = null | E.a; >rj4 : number >null | E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rj5 = a | null; >rj5 : number @@ -537,14 +537,14 @@ var rj6 = b | null; var rj7 = 0 | null; >rj7 : number >0 | null : number ->0 : number +>0 : 0 >null : null var rj8 = E.b | null; >rj8 : number >E.b | null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types index 77dbe1c14418c..2a714a35210b4 100644 --- a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types @@ -6,10 +6,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -35,15 +35,15 @@ var ra3 = undefined * 1; >ra3 : number >undefined * 1 : number >undefined : undefined ->1 : number +>1 : 1 var ra4 = undefined * E.a; >ra4 : number >undefined * E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var ra5 = a * undefined; >ra5 : number @@ -60,15 +60,15 @@ var ra6 = b * undefined; var ra7 = 0 * undefined; >ra7 : number >0 * undefined : number ->0 : number +>0 : 0 >undefined : undefined var ra8 = E.b * undefined; >ra8 : number >E.b * undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator / @@ -88,15 +88,15 @@ var rb3 = undefined / 1; >rb3 : number >undefined / 1 : number >undefined : undefined ->1 : number +>1 : 1 var rb4 = undefined / E.a; >rb4 : number >undefined / E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rb5 = a / undefined; >rb5 : number @@ -113,15 +113,15 @@ var rb6 = b / undefined; var rb7 = 0 / undefined; >rb7 : number >0 / undefined : number ->0 : number +>0 : 0 >undefined : undefined var rb8 = E.b / undefined; >rb8 : number >E.b / undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator % @@ -141,15 +141,15 @@ var rc3 = undefined % 1; >rc3 : number >undefined % 1 : number >undefined : undefined ->1 : number +>1 : 1 var rc4 = undefined % E.a; >rc4 : number >undefined % E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rc5 = a % undefined; >rc5 : number @@ -166,15 +166,15 @@ var rc6 = b % undefined; var rc7 = 0 % undefined; >rc7 : number >0 % undefined : number ->0 : number +>0 : 0 >undefined : undefined var rc8 = E.b % undefined; >rc8 : number >E.b % undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator - @@ -194,15 +194,15 @@ var rd3 = undefined - 1; >rd3 : number >undefined - 1 : number >undefined : undefined ->1 : number +>1 : 1 var rd4 = undefined - E.a; >rd4 : number >undefined - E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rd5 = a - undefined; >rd5 : number @@ -219,15 +219,15 @@ var rd6 = b - undefined; var rd7 = 0 - undefined; >rd7 : number >0 - undefined : number ->0 : number +>0 : 0 >undefined : undefined var rd8 = E.b - undefined; >rd8 : number >E.b - undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator << @@ -247,15 +247,15 @@ var re3 = undefined << 1; >re3 : number >undefined << 1 : number >undefined : undefined ->1 : number +>1 : 1 var re4 = undefined << E.a; >re4 : number >undefined << E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var re5 = a << undefined; >re5 : number @@ -272,15 +272,15 @@ var re6 = b << undefined; var re7 = 0 << undefined; >re7 : number >0 << undefined : number ->0 : number +>0 : 0 >undefined : undefined var re8 = E.b << undefined; >re8 : number >E.b << undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator >> @@ -300,15 +300,15 @@ var rf3 = undefined >> 1; >rf3 : number >undefined >> 1 : number >undefined : undefined ->1 : number +>1 : 1 var rf4 = undefined >> E.a; >rf4 : number >undefined >> E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rf5 = a >> undefined; >rf5 : number @@ -325,15 +325,15 @@ var rf6 = b >> undefined; var rf7 = 0 >> undefined; >rf7 : number >0 >> undefined : number ->0 : number +>0 : 0 >undefined : undefined var rf8 = E.b >> undefined; >rf8 : number >E.b >> undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator >>> @@ -353,15 +353,15 @@ var rg3 = undefined >>> 1; >rg3 : number >undefined >>> 1 : number >undefined : undefined ->1 : number +>1 : 1 var rg4 = undefined >>> E.a; >rg4 : number >undefined >>> E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rg5 = a >>> undefined; >rg5 : number @@ -378,15 +378,15 @@ var rg6 = b >>> undefined; var rg7 = 0 >>> undefined; >rg7 : number >0 >>> undefined : number ->0 : number +>0 : 0 >undefined : undefined var rg8 = E.b >>> undefined; >rg8 : number >E.b >>> undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator & @@ -406,15 +406,15 @@ var rh3 = undefined & 1; >rh3 : number >undefined & 1 : number >undefined : undefined ->1 : number +>1 : 1 var rh4 = undefined & E.a; >rh4 : number >undefined & E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rh5 = a & undefined; >rh5 : number @@ -431,15 +431,15 @@ var rh6 = b & undefined; var rh7 = 0 & undefined; >rh7 : number >0 & undefined : number ->0 : number +>0 : 0 >undefined : undefined var rh8 = E.b & undefined; >rh8 : number >E.b & undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator ^ @@ -459,15 +459,15 @@ var ri3 = undefined ^ 1; >ri3 : number >undefined ^ 1 : number >undefined : undefined ->1 : number +>1 : 1 var ri4 = undefined ^ E.a; >ri4 : number >undefined ^ E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var ri5 = a ^ undefined; >ri5 : number @@ -484,15 +484,15 @@ var ri6 = b ^ undefined; var ri7 = 0 ^ undefined; >ri7 : number >0 ^ undefined : number ->0 : number +>0 : 0 >undefined : undefined var ri8 = E.b ^ undefined; >ri8 : number >E.b ^ undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator | @@ -512,15 +512,15 @@ var rj3 = undefined | 1; >rj3 : number >undefined | 1 : number >undefined : undefined ->1 : number +>1 : 1 var rj4 = undefined | E.a; >rj4 : number >undefined | E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rj5 = a | undefined; >rj5 : number @@ -537,14 +537,14 @@ var rj6 = b | undefined; var rj7 = 0 | undefined; >rj7 : number >0 | undefined : number ->0 : number +>0 : 0 >undefined : undefined var rj8 = E.b | undefined; >rj8 : number >E.b | undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined diff --git a/tests/baselines/reference/arrayAugment.types b/tests/baselines/reference/arrayAugment.types index 042b7265ec849..6d4e5a70a5100 100644 --- a/tests/baselines/reference/arrayAugment.types +++ b/tests/baselines/reference/arrayAugment.types @@ -12,7 +12,7 @@ interface Array { var x = ['']; >x : string[] >[''] : string[] ->'' : string +>'' : "" var y = x.split(4); >y : string[][] @@ -20,7 +20,7 @@ var y = x.split(4); >x.split : (parts: number) => string[][] >x : string[] >split : (parts: number) => string[][] ->4 : number +>4 : 4 var y: string[][]; // Expect no error here >y : string[][] diff --git a/tests/baselines/reference/arrayBestCommonTypes.types b/tests/baselines/reference/arrayBestCommonTypes.types index 0b4a871cd40ac..864b1adfacba6 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.types +++ b/tests/baselines/reference/arrayBestCommonTypes.types @@ -40,7 +40,7 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : any >y : boolean ->false : boolean +>false : false >null : null public x() { @@ -55,9 +55,9 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2][0] : number >[4, 2] : number[] ->4 : number ->2 : number ->0 : number +>4 : 4 +>2 : 2 +>0 : 0 (this.voidIfAny([4, 2, undefined][0])); >(this.voidIfAny([4, 2, undefined][0])) : number @@ -68,10 +68,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2, undefined][0] : number >[4, 2, undefined] : number[] ->4 : number ->2 : number +>4 : 4 +>2 : 2 >undefined : undefined ->0 : number +>0 : 0 (this.voidIfAny([undefined, 2, 4][0])); >(this.voidIfAny([undefined, 2, 4][0])) : number @@ -83,9 +83,9 @@ module EmptyTypes { >[undefined, 2, 4][0] : number >[undefined, 2, 4] : number[] >undefined : undefined ->2 : number ->4 : number ->0 : number +>2 : 2 +>4 : 4 +>0 : 0 (this.voidIfAny([null, 2, 4][0])); >(this.voidIfAny([null, 2, 4][0])) : number @@ -97,9 +97,9 @@ module EmptyTypes { >[null, 2, 4][0] : number >[null, 2, 4] : number[] >null : null ->2 : number ->4 : number ->0 : number +>2 : 2 +>4 : 4 +>0 : 0 (this.voidIfAny([2, 4, null][0])); >(this.voidIfAny([2, 4, null][0])) : number @@ -110,10 +110,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[2, 4, null][0] : number >[2, 4, null] : number[] ->2 : number ->4 : number +>2 : 2 +>4 : 4 >null : null ->0 : number +>0 : 0 (this.voidIfAny([undefined, 4, null][0])); >(this.voidIfAny([undefined, 4, null][0])) : number @@ -125,9 +125,9 @@ module EmptyTypes { >[undefined, 4, null][0] : number >[undefined, 4, null] : number[] >undefined : undefined ->4 : number +>4 : 4 >null : null ->0 : number +>0 : 0 (this.voidIfAny(['', "q"][0])); >(this.voidIfAny(['', "q"][0])) : number @@ -138,9 +138,9 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q"][0] : string >['', "q"] : string[] ->'' : string ->"q" : string ->0 : number +>'' : "" +>"q" : "q" +>0 : 0 (this.voidIfAny(['', "q", undefined][0])); >(this.voidIfAny(['', "q", undefined][0])) : number @@ -151,10 +151,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q", undefined][0] : string >['', "q", undefined] : string[] ->'' : string ->"q" : string +>'' : "" +>"q" : "q" >undefined : undefined ->0 : number +>0 : 0 (this.voidIfAny([undefined, "q", ''][0])); >(this.voidIfAny([undefined, "q", ''][0])) : number @@ -166,9 +166,9 @@ module EmptyTypes { >[undefined, "q", ''][0] : string >[undefined, "q", ''] : string[] >undefined : undefined ->"q" : string ->'' : string ->0 : number +>"q" : "q" +>'' : "" +>0 : 0 (this.voidIfAny([null, "q", ''][0])); >(this.voidIfAny([null, "q", ''][0])) : number @@ -180,9 +180,9 @@ module EmptyTypes { >[null, "q", ''][0] : string >[null, "q", ''] : string[] >null : null ->"q" : string ->'' : string ->0 : number +>"q" : "q" +>'' : "" +>0 : 0 (this.voidIfAny(["q", '', null][0])); >(this.voidIfAny(["q", '', null][0])) : number @@ -193,10 +193,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >["q", '', null][0] : string >["q", '', null] : string[] ->"q" : string ->'' : string +>"q" : "q" +>'' : "" >null : null ->0 : number +>0 : 0 (this.voidIfAny([undefined, '', null][0])); >(this.voidIfAny([undefined, '', null][0])) : number @@ -208,9 +208,9 @@ module EmptyTypes { >[undefined, '', null][0] : string >[undefined, '', null] : string[] >undefined : undefined ->'' : string +>'' : "" >null : null ->0 : number +>0 : 0 (this.voidIfAny([[3, 4], [null]][0][0])); >(this.voidIfAny([[3, 4], [null]][0][0])) : number @@ -223,12 +223,12 @@ module EmptyTypes { >[[3, 4], [null]][0] : number[] >[[3, 4], [null]] : number[][] >[3, 4] : number[] ->3 : number ->4 : number +>3 : 3 +>4 : 4 >[null] : null[] >null : null ->0 : number ->0 : number +>0 : 0 +>0 : 0 var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; @@ -239,13 +239,13 @@ module EmptyTypes { >[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: derived; }[] >{ x: 7, y: new derived() } : { x: number; y: derived; } >x : number ->7 : number +>7 : 7 >y : derived >new derived() : derived >derived : typeof derived >{ x: 5, y: new base() } : { x: number; y: base; } >x : number ->5 : number +>5 : 5 >y : base >new base() : base >base : typeof base @@ -257,13 +257,13 @@ module EmptyTypes { >base : base >[{ x: true, y: new derived() }, { x: false, y: new base() }] : ({ x: true; y: derived; } | { x: false; y: base; })[] >{ x: true, y: new derived() } : { x: true; y: derived; } ->x : true +>x : boolean >true : true >y : derived >new derived() : derived >derived : typeof derived >{ x: false, y: new base() } : { x: false; y: base; } ->x : false +>x : boolean >false : false >y : base >new base() : base @@ -283,7 +283,7 @@ module EmptyTypes { >base : typeof base >{ x: '', y: new derived() } : { x: string; y: derived; } >x : string ->'' : string +>'' : "" >y : derived >new derived() : derived >derived : typeof derived @@ -298,19 +298,19 @@ module EmptyTypes { >[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; >a2 : { x: any; y: string; }[] @@ -319,36 +319,36 @@ module EmptyTypes { >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; >a3 : { x: any; y: string; }[] >[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" var ifaceObj: iface = null; >ifaceObj : iface @@ -443,7 +443,7 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : any >y : boolean ->false : boolean +>false : false >null : null public x() { @@ -458,9 +458,9 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2][0] : number >[4, 2] : number[] ->4 : number ->2 : number ->0 : number +>4 : 4 +>2 : 2 +>0 : 0 (this.voidIfAny([4, 2, undefined][0])); >(this.voidIfAny([4, 2, undefined][0])) : number @@ -471,10 +471,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2, undefined][0] : number >[4, 2, undefined] : number[] ->4 : number ->2 : number +>4 : 4 +>2 : 2 >undefined : undefined ->0 : number +>0 : 0 (this.voidIfAny([undefined, 2, 4][0])); >(this.voidIfAny([undefined, 2, 4][0])) : number @@ -486,9 +486,9 @@ module NonEmptyTypes { >[undefined, 2, 4][0] : number >[undefined, 2, 4] : number[] >undefined : undefined ->2 : number ->4 : number ->0 : number +>2 : 2 +>4 : 4 +>0 : 0 (this.voidIfAny([null, 2, 4][0])); >(this.voidIfAny([null, 2, 4][0])) : number @@ -500,9 +500,9 @@ module NonEmptyTypes { >[null, 2, 4][0] : number >[null, 2, 4] : number[] >null : null ->2 : number ->4 : number ->0 : number +>2 : 2 +>4 : 4 +>0 : 0 (this.voidIfAny([2, 4, null][0])); >(this.voidIfAny([2, 4, null][0])) : number @@ -513,10 +513,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[2, 4, null][0] : number >[2, 4, null] : number[] ->2 : number ->4 : number +>2 : 2 +>4 : 4 >null : null ->0 : number +>0 : 0 (this.voidIfAny([undefined, 4, null][0])); >(this.voidIfAny([undefined, 4, null][0])) : number @@ -528,9 +528,9 @@ module NonEmptyTypes { >[undefined, 4, null][0] : number >[undefined, 4, null] : number[] >undefined : undefined ->4 : number +>4 : 4 >null : null ->0 : number +>0 : 0 (this.voidIfAny(['', "q"][0])); >(this.voidIfAny(['', "q"][0])) : number @@ -541,9 +541,9 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q"][0] : string >['', "q"] : string[] ->'' : string ->"q" : string ->0 : number +>'' : "" +>"q" : "q" +>0 : 0 (this.voidIfAny(['', "q", undefined][0])); >(this.voidIfAny(['', "q", undefined][0])) : number @@ -554,10 +554,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q", undefined][0] : string >['', "q", undefined] : string[] ->'' : string ->"q" : string +>'' : "" +>"q" : "q" >undefined : undefined ->0 : number +>0 : 0 (this.voidIfAny([undefined, "q", ''][0])); >(this.voidIfAny([undefined, "q", ''][0])) : number @@ -569,9 +569,9 @@ module NonEmptyTypes { >[undefined, "q", ''][0] : string >[undefined, "q", ''] : string[] >undefined : undefined ->"q" : string ->'' : string ->0 : number +>"q" : "q" +>'' : "" +>0 : 0 (this.voidIfAny([null, "q", ''][0])); >(this.voidIfAny([null, "q", ''][0])) : number @@ -583,9 +583,9 @@ module NonEmptyTypes { >[null, "q", ''][0] : string >[null, "q", ''] : string[] >null : null ->"q" : string ->'' : string ->0 : number +>"q" : "q" +>'' : "" +>0 : 0 (this.voidIfAny(["q", '', null][0])); >(this.voidIfAny(["q", '', null][0])) : number @@ -596,10 +596,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >["q", '', null][0] : string >["q", '', null] : string[] ->"q" : string ->'' : string +>"q" : "q" +>'' : "" >null : null ->0 : number +>0 : 0 (this.voidIfAny([undefined, '', null][0])); >(this.voidIfAny([undefined, '', null][0])) : number @@ -611,9 +611,9 @@ module NonEmptyTypes { >[undefined, '', null][0] : string >[undefined, '', null] : string[] >undefined : undefined ->'' : string +>'' : "" >null : null ->0 : number +>0 : 0 (this.voidIfAny([[3, 4], [null]][0][0])); >(this.voidIfAny([[3, 4], [null]][0][0])) : number @@ -626,12 +626,12 @@ module NonEmptyTypes { >[[3, 4], [null]][0] : number[] >[[3, 4], [null]] : number[][] >[3, 4] : number[] ->3 : number ->4 : number +>3 : 3 +>4 : 4 >[null] : null[] >null : null ->0 : number ->0 : number +>0 : 0 +>0 : 0 var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; @@ -642,13 +642,13 @@ module NonEmptyTypes { >[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: base; }[] >{ x: 7, y: new derived() } : { x: number; y: derived; } >x : number ->7 : number +>7 : 7 >y : derived >new derived() : derived >derived : typeof derived >{ x: 5, y: new base() } : { x: number; y: base; } >x : number ->5 : number +>5 : 5 >y : base >new base() : base >base : typeof base @@ -660,13 +660,13 @@ module NonEmptyTypes { >base : base >[{ x: true, y: new derived() }, { x: false, y: new base() }] : ({ x: true; y: derived; } | { x: false; y: base; })[] >{ x: true, y: new derived() } : { x: true; y: derived; } ->x : true +>x : boolean >true : true >y : derived >new derived() : derived >derived : typeof derived >{ x: false, y: new base() } : { x: false; y: base; } ->x : false +>x : boolean >false : false >y : base >new base() : base @@ -686,7 +686,7 @@ module NonEmptyTypes { >base : typeof base >{ x: '', y: new derived() } : { x: string; y: derived; } >x : string ->'' : string +>'' : "" >y : derived >new derived() : derived >derived : typeof derived @@ -701,19 +701,19 @@ module NonEmptyTypes { >[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; >a2 : { x: any; y: string; }[] @@ -722,36 +722,36 @@ module NonEmptyTypes { >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; >a3 : { x: any; y: string; }[] >[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" var ifaceObj: iface = null; >ifaceObj : iface diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types index 77db8cc250dd1..38649f2b02d27 100644 --- a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types @@ -43,12 +43,12 @@ function f([, a, , b, , , , s, , , ] = results) { >a : string >s[1] : string >s : string ->1 : number +>1 : 1 b = s[2]; >b = s[2] : string >b : string >s[2] : string >s : string ->2 : number +>2 : 2 } diff --git a/tests/baselines/reference/arrayConcat2.types b/tests/baselines/reference/arrayConcat2.types index 27fe754c48504..7687c5ed8fe7b 100644 --- a/tests/baselines/reference/arrayConcat2.types +++ b/tests/baselines/reference/arrayConcat2.types @@ -8,15 +8,15 @@ a.concat("hello", 'world'); >a.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >a : string[] >concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } ->"hello" : string ->'world' : string +>"hello" : "hello" +>'world' : "world" a.concat('Hello'); >a.concat('Hello') : string[] >a.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >a : string[] >concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } ->'Hello' : string +>'Hello' : "Hello" var b = new Array(); >b : string[] @@ -28,5 +28,5 @@ b.concat('hello'); >b.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >b : string[] >concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } ->'hello' : string +>'hello' : "hello" diff --git a/tests/baselines/reference/arrayConcatMap.types b/tests/baselines/reference/arrayConcatMap.types index 647406ef1c3d7..89289e58d4e18 100644 --- a/tests/baselines/reference/arrayConcatMap.types +++ b/tests/baselines/reference/arrayConcatMap.types @@ -10,11 +10,11 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) >[{ a: 1 }] : { a: number; }[] >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 >[{ a: 2 }] : { a: number; }[] >{ a: 2 } : { a: number; } >a : number ->2 : number +>2 : 2 .map(b => b.a); >map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] diff --git a/tests/baselines/reference/arrayConstructors1.types b/tests/baselines/reference/arrayConstructors1.types index 89807cd034805..c5a49e56f90a9 100644 --- a/tests/baselines/reference/arrayConstructors1.types +++ b/tests/baselines/reference/arrayConstructors1.types @@ -7,23 +7,23 @@ x = new Array(1); >x : string[] >new Array(1) : any[] >Array : ArrayConstructor ->1 : number +>1 : 1 x = new Array('hi', 'bye'); >x = new Array('hi', 'bye') : string[] >x : string[] >new Array('hi', 'bye') : string[] >Array : ArrayConstructor ->'hi' : string ->'bye' : string +>'hi' : "hi" +>'bye' : "bye" x = new Array('hi', 'bye'); >x = new Array('hi', 'bye') : string[] >x : string[] >new Array('hi', 'bye') : string[] >Array : ArrayConstructor ->'hi' : string ->'bye' : string +>'hi' : "hi" +>'bye' : "bye" var y: number[]; >y : number[] @@ -33,21 +33,21 @@ y = new Array(1); >y : number[] >new Array(1) : any[] >Array : ArrayConstructor ->1 : number +>1 : 1 y = new Array(1,2); >y = new Array(1,2) : number[] >y : number[] >new Array(1,2) : number[] >Array : ArrayConstructor ->1 : number ->2 : number +>1 : 1 +>2 : 2 y = new Array(1, 2); >y = new Array(1, 2) : number[] >y : number[] >new Array(1, 2) : number[] >Array : ArrayConstructor ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/arrayFilter.types b/tests/baselines/reference/arrayFilter.types index f3d6d42174494..43ef4161a0654 100644 --- a/tests/baselines/reference/arrayFilter.types +++ b/tests/baselines/reference/arrayFilter.types @@ -6,7 +6,7 @@ var foo = [ { name: 'bar' }, >{ name: 'bar' } : { name: string; } >name : string ->'bar' : string +>'bar' : "bar" { name: null }, >{ name: null } : { name: null; } @@ -16,7 +16,7 @@ var foo = [ { name: 'baz' } >{ name: 'baz' } : { name: string; } >name : string ->'baz' : string +>'baz' : "baz" ] diff --git a/tests/baselines/reference/arrayLiteral.types b/tests/baselines/reference/arrayLiteral.types index a7b915de79dac..c36cc93c68e38 100644 --- a/tests/baselines/reference/arrayLiteral.types +++ b/tests/baselines/reference/arrayLiteral.types @@ -9,18 +9,18 @@ var x = new Array(1); >x : any[] >new Array(1) : any[] >Array : ArrayConstructor ->1 : number +>1 : 1 var y = [1]; >y : number[] >[1] : number[] ->1 : number +>1 : 1 var y = [1, 2]; >y : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var y = new Array(); >y : number[] @@ -35,18 +35,18 @@ var x2: number[] = new Array(1); >x2 : number[] >new Array(1) : any[] >Array : ArrayConstructor ->1 : number +>1 : 1 var y2: number[] = [1]; >y2 : number[] >[1] : number[] ->1 : number +>1 : 1 var y2: number[] = [1, 2]; >y2 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var y2: number[] = new Array(); >y2 : number[] diff --git a/tests/baselines/reference/arrayLiteral1.types b/tests/baselines/reference/arrayLiteral1.types index eb83fa87035f4..e0ee33c1ef427 100644 --- a/tests/baselines/reference/arrayLiteral1.types +++ b/tests/baselines/reference/arrayLiteral1.types @@ -2,6 +2,6 @@ var v30 = [1, 2]; >v30 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/arrayLiteral2.types b/tests/baselines/reference/arrayLiteral2.types index 1c3c81117d9d1..5bbc2f4fce829 100644 --- a/tests/baselines/reference/arrayLiteral2.types +++ b/tests/baselines/reference/arrayLiteral2.types @@ -2,7 +2,7 @@ var v30 = [1, 2], v31; >v30 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >v31 : any diff --git a/tests/baselines/reference/arrayLiteralComments.types b/tests/baselines/reference/arrayLiteralComments.types index e18635167927c..80199c0f808e1 100644 --- a/tests/baselines/reference/arrayLiteralComments.types +++ b/tests/baselines/reference/arrayLiteralComments.types @@ -9,28 +9,28 @@ var testArrayWithFunc = [ let x = 1; >x : number ->1 : number +>1 : 1 }, // String comment '1', ->'1' : string +>'1' : "1" // Numeric comment 2, ->2 : number +>2 : 2 // Object comment { a: 1 }, >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 // Array comment [1, 2, 3] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 ] diff --git a/tests/baselines/reference/arrayLiteralContextualType.types b/tests/baselines/reference/arrayLiteralContextualType.types index 0513908929e5a..f9d65aa2dff36 100644 --- a/tests/baselines/reference/arrayLiteralContextualType.types +++ b/tests/baselines/reference/arrayLiteralContextualType.types @@ -11,11 +11,11 @@ class Giraffe { name = "Giraffe"; >name : string ->"Giraffe" : string +>"Giraffe" : "Giraffe" neckLength = "3m"; >neckLength : string ->"3m" : string +>"3m" : "3m" } class Elephant { @@ -23,11 +23,11 @@ class Elephant { name = "Elephant"; >name : string ->"Elephant" : string +>"Elephant" : "Elephant" trunkDiameter = "20cm"; >trunkDiameter : string ->"20cm" : string +>"20cm" : "20cm" } function foo(animals: IAnimal[]) { } diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types index fcbaa22bc6a03..4b46e0bf29f00 100644 --- a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types @@ -8,6 +8,6 @@ panic([], 'one', 'two'); >panic([], 'one', 'two') : void >panic : (val: string[], ...opt: string[]) => void >[] : undefined[] ->'one' : string ->'two' : string +>'one' : "one" +>'two' : "two" diff --git a/tests/baselines/reference/arrayLiteralSpread.types b/tests/baselines/reference/arrayLiteralSpread.types index 7b9a34c0abee0..fd6ae24326504 100644 --- a/tests/baselines/reference/arrayLiteralSpread.types +++ b/tests/baselines/reference/arrayLiteralSpread.types @@ -5,9 +5,9 @@ function f0() { var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var a1 = [...a]; >a1 : number[] @@ -18,15 +18,15 @@ function f0() { var a2 = [1, ...a]; >a2 : number[] >[1, ...a] : number[] ->1 : number +>1 : 1 >...a : number >a : number[] var a3 = [1, 2, ...a]; >a3 : number[] >[1, 2, ...a] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : number >a : number[] @@ -35,33 +35,33 @@ function f0() { >[...a, 1] : number[] >...a : number >a : number[] ->1 : number +>1 : 1 var a5 = [...a, 1, 2]; >a5 : number[] >[...a, 1, 2] : number[] >...a : number >a : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a6 = [1, 2, ...a, 1, 2]; >a6 : number[] >[1, 2, ...a, 1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : number >a : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a7 = [1, ...a, 2, ...a]; >a7 : number[] >[1, ...a, 2, ...a] : number[] ->1 : number +>1 : 1 >...a : number >a : number[] ->2 : number +>2 : 2 >...a : number >a : number[] @@ -82,17 +82,17 @@ function f1() { var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var b = ["hello", ...a, true]; >b : (string | number | boolean)[] >["hello", ...a, true] : (string | number | boolean)[] ->"hello" : string +>"hello" : "hello" >...a : number >a : number[] ->true : boolean +>true : true var b: (string | number | boolean)[]; >b : (string | number | boolean)[] @@ -128,6 +128,6 @@ function f2() { >[...[5]] : number[] >...[5] : number >[5] : number[] ->5 : number +>5 : 5 } diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types index aad515b62ee5f..43cbb87e8435f 100644 --- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types @@ -41,21 +41,21 @@ var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] >(x: Object) => 1 : (x: Object) => number >x : Object >Object : Object ->1 : number +>1 : 1 >(x: string) => 2 : (x: string) => number >x : string ->2 : number +>2 : 2 var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] >es : ((x: string) => number)[] >[(x: string) => 2, (x: Object) => 1] : ((x: string) => number)[] >(x: string) => 2 : (x: string) => number >x : string ->2 : number +>2 : 2 >(x: Object) => 1 : (x: Object) => number >x : Object >Object : Object ->1 : number +>1 : 1 var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[] >fs : (((a: { x: number; y?: number; }) => number) | ((b: { x: number; z?: number; }) => number))[] @@ -64,12 +64,12 @@ var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => >a : { x: number; y?: number; } >x : number >y : number ->1 : number +>1 : 1 >(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number; }) => number >b : { x: number; z?: number; } >x : number >z : number ->2 : number +>2 : 2 var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[] >gs : (((b: { x: number; z?: number; }) => number) | ((a: { x: number; y?: number; }) => number))[] @@ -78,10 +78,10 @@ var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => >b : { x: number; z?: number; } >x : number >z : number ->2 : number +>2 : 2 >(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number; }) => number >a : { x: number; y?: number; } >x : number >y : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/arrayLiterals2ES5.types b/tests/baselines/reference/arrayLiterals2ES5.types index 6eae997f4654c..c3256db925e02 100644 --- a/tests/baselines/reference/arrayLiterals2ES5.types +++ b/tests/baselines/reference/arrayLiterals2ES5.types @@ -13,15 +13,15 @@ var a0 = [,, 2, 3, 4] >[,, 2, 3, 4] : number[] > : undefined > : undefined ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 var a1 = ["hello", "world"] >a1 : string[] >["hello", "world"] : string[] ->"hello" : string ->"world" : string +>"hello" : "hello" +>"world" : "world" var a2 = [, , , ...a0, "hello"]; >a2 : (string | number)[] @@ -31,7 +31,7 @@ var a2 = [, , , ...a0, "hello"]; > : undefined >...a0 : number >a0 : number[] ->"hello" : string +>"hello" : "hello" var a3 = [,, ...a0] >a3 : number[] @@ -45,7 +45,7 @@ var a4 = [() => 1, ]; >a4 : (() => number)[] >[() => 1, ] : (() => number)[] >() => 1 : () => number ->1 : number +>1 : 1 var a5 = [...a0, , ] >a5 : number[] @@ -74,12 +74,12 @@ var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >b1 : [number[], string[]] >[[1, 2, 3], ["hello", "string"]] : [number[], string[]] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >["hello", "string"] : string[] ->"hello" : string ->"string" : string +>"hello" : "hello" +>"string" : "string" // The resulting type an array literal expression is determined as follows: // - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), @@ -89,16 +89,16 @@ var [c0, c1] = [1, 2]; // tuple type [number, number] >c0 : number >c1 : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] >c2 : number >c3 : number >[1, 2, true] : [number, number, boolean] ->1 : number ->2 : number ->true : boolean +>1 : 1 +>2 : 2 +>true : true // The resulting type an array literal expression is determined as follows: // - the resulting type is an array type with an element type that is the union of the types of the @@ -106,27 +106,27 @@ var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] var temp = ["s", "t", "r"]; >temp : string[] >["s", "t", "r"] : string[] ->"s" : string ->"t" : string ->"r" : string +>"s" : "s" +>"t" : "t" +>"r" : "r" var temp1 = [1, 2, 3]; >temp1 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >temp2 : [number[], string[]] >[[1, 2, 3], ["hello", "string"]] : [number[], string[]] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >["hello", "string"] : string[] ->"hello" : string ->"string" : string +>"hello" : "hello" +>"string" : "string" var temp3 = [undefined, null, undefined]; >temp3 : any[] @@ -153,8 +153,8 @@ interface myArray2 extends Array { } var d0 = [1, true, ...temp,]; // has type (string|number|boolean)[] >d0 : (string | number | boolean)[] >[1, true, ...temp,] : (string | number | boolean)[] ->1 : number ->true : boolean +>1 : 1 +>true : true >...temp : string >temp : string[] @@ -221,5 +221,5 @@ var d9 = [[...temp1], ...["hello"]]; >temp1 : number[] >...["hello"] : string >["hello"] : string[] ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/arrayLiterals2ES6.types b/tests/baselines/reference/arrayLiterals2ES6.types index f05b0ca9282a6..57f3f44f62d84 100644 --- a/tests/baselines/reference/arrayLiterals2ES6.types +++ b/tests/baselines/reference/arrayLiterals2ES6.types @@ -13,15 +13,15 @@ var a0 = [, , 2, 3, 4] >[, , 2, 3, 4] : number[] > : undefined > : undefined ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 var a1 = ["hello", "world"] >a1 : string[] >["hello", "world"] : string[] ->"hello" : string ->"world" : string +>"hello" : "hello" +>"world" : "world" var a2 = [, , , ...a0, "hello"]; >a2 : (string | number)[] @@ -31,7 +31,7 @@ var a2 = [, , , ...a0, "hello"]; > : undefined >...a0 : number >a0 : number[] ->"hello" : string +>"hello" : "hello" var a3 = [, , ...a0] >a3 : number[] @@ -45,7 +45,7 @@ var a4 = [() => 1, ]; >a4 : (() => number)[] >[() => 1, ] : (() => number)[] >() => 1 : () => number ->1 : number +>1 : 1 var a5 = [...a0, , ] >a5 : number[] @@ -74,12 +74,12 @@ var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >b1 : [number[], string[]] >[[1, 2, 3], ["hello", "string"]] : [number[], string[]] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >["hello", "string"] : string[] ->"hello" : string ->"string" : string +>"hello" : "hello" +>"string" : "string" // The resulting type an array literal expression is determined as follows: // - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), @@ -89,16 +89,16 @@ var [c0, c1] = [1, 2]; // tuple type [number, number] >c0 : number >c1 : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] >c2 : number >c3 : number >[1, 2, true] : [number, number, boolean] ->1 : number ->2 : number ->true : boolean +>1 : 1 +>2 : 2 +>true : true // The resulting type an array literal expression is determined as follows: // - the resulting type is an array type with an element type that is the union of the types of the @@ -106,27 +106,27 @@ var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] var temp = ["s", "t", "r"]; >temp : string[] >["s", "t", "r"] : string[] ->"s" : string ->"t" : string ->"r" : string +>"s" : "s" +>"t" : "t" +>"r" : "r" var temp1 = [1, 2, 3]; >temp1 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >temp2 : [number[], string[]] >[[1, 2, 3], ["hello", "string"]] : [number[], string[]] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >["hello", "string"] : string[] ->"hello" : string ->"string" : string +>"hello" : "hello" +>"string" : "string" interface myArray extends Array { } >myArray : myArray @@ -142,8 +142,8 @@ interface myArray2 extends Array { } var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[] >d0 : (string | number | boolean)[] >[1, true, ...temp, ] : (string | number | boolean)[] ->1 : number ->true : boolean +>1 : 1 +>true : true >...temp : string >temp : string[] @@ -208,5 +208,5 @@ var d9 = [[...temp1], ...["hello"]]; >temp1 : number[] >...["hello"] : string >["hello"] : string[] ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/arrayLiterals3.errors.txt b/tests/baselines/reference/arrayLiterals3.errors.txt index 1f0dd30c09ce6..3ebf4174f51bd 100644 --- a/tests/baselines/reference/arrayLiterals3.errors.txt +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(10,5): error TS2322: Type 'undefined[]' is not assignable to type '[any, any, any]'. Property '0' is missing in type 'undefined[]'. -tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error TS2322: Type '["string", number, boolean]' is not assignable to type '[boolean, string, number]'. + Type '"string"' is not assignable to type 'boolean'. tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'. Types of property 'pop' are incompatible. Type '() => string | number | boolean' is not assignable to type '() => number'. @@ -36,8 +36,8 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error !!! error TS2322: Property '0' is missing in type 'undefined[]'. var a1: [boolean, string, number] = ["string", 1, true]; // Error ~~ -!!! error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '["string", number, boolean]' is not assignable to type '[boolean, string, number]'. +!!! error TS2322: Type '"string"' is not assignable to type 'boolean'. // The resulting type an array literal expression is determined as follows: // - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.types b/tests/baselines/reference/arrayOfFunctionTypes3.types index 0ed92991ed08a..124542f581442 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.types +++ b/tests/baselines/reference/arrayOfFunctionTypes3.types @@ -5,7 +5,7 @@ var x = [() => 1, () => { }]; >x : (() => void)[] >[() => 1, () => { }] : (() => void)[] >() => 1 : () => number ->1 : number +>1 : 1 >() => { } : () => void var r2 = x[0](); @@ -13,7 +13,7 @@ var r2 = x[0](); >x[0]() : void >x[0] : () => void >x : (() => void)[] ->0 : number +>0 : 0 class C { >C : C @@ -32,7 +32,7 @@ var r3 = new y[0](); >new y[0]() : C >y[0] : typeof C >y : typeof C[] ->0 : number +>0 : 0 var a: { (x: number): number; (x: string): string; }; >a : { (x: number): number; (x: string): string; } @@ -60,19 +60,19 @@ var r4 = z[0]; >r4 : { (x: number): number; (x: any): any; } >z[0] : { (x: number): number; (x: any): any; } >z : { (x: number): number; (x: any): any; }[] ->0 : number +>0 : 0 var r5 = r4(''); // any not string >r5 : any >r4('') : any >r4 : { (x: number): number; (x: any): any; } ->'' : string +>'' : "" var r5b = r4(1); >r5b : number >r4(1) : number >r4 : { (x: number): number; (x: any): any; } ->1 : number +>1 : 1 var a2: { (x: T): number; (x: string): string;}; >a2 : { (x: T): number; (x: string): string; } @@ -106,11 +106,11 @@ var r6 = z2[0]; >r6 : { (x: number): number; (x: T): any; } >z2[0] : { (x: number): number; (x: T): any; } >z2 : { (x: number): number; (x: T): any; }[] ->0 : number +>0 : 0 var r7 = r6(''); // any not string >r7 : any >r6('') : any >r6 : { (x: number): number; (x: T): any; } ->'' : string +>'' : "" diff --git a/tests/baselines/reference/arrayconcat.types b/tests/baselines/reference/arrayconcat.types index 45615cd63b84a..27724c63ab1da 100644 --- a/tests/baselines/reference/arrayconcat.types +++ b/tests/baselines/reference/arrayconcat.types @@ -46,7 +46,7 @@ class parser { >this : this >options : IOptions[] >sort : (compareFn?: (a: IOptions, b: IOptions) => number) => IOptions[] ->function(a, b) { var aName = a.name.toLowerCase(); var bName = b.name.toLowerCase(); if (aName > bName) { return 1; } else if (aName < bName) { return -1; } else { return 0; } } : (a: IOptions, b: IOptions) => number +>function(a, b) { var aName = a.name.toLowerCase(); var bName = b.name.toLowerCase(); if (aName > bName) { return 1; } else if (aName < bName) { return -1; } else { return 0; } } : (a: IOptions, b: IOptions) => 0 | 1 | -1 >a : IOptions >b : IOptions @@ -74,7 +74,7 @@ class parser { >bName : string return 1; ->1 : number +>1 : 1 } else if (aName < bName) { >aName < bName : boolean @@ -82,12 +82,12 @@ class parser { >bName : string return -1; ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 } else { return 0; ->0 : number +>0 : 0 } }); } diff --git a/tests/baselines/reference/arrowFunctionExpressions.types b/tests/baselines/reference/arrowFunctionExpressions.types index 41344c61cc420..aad43240daa6c 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.types +++ b/tests/baselines/reference/arrowFunctionExpressions.types @@ -21,13 +21,13 @@ var b = j => { return 0; } >b : (j: any) => number >j => { return 0; } : (j: any) => number >j : any ->0 : number +>0 : 0 var b = (j) => { return 0; } >b : (j: any) => number >(j) => { return 0; } : (j: any) => number >j : any ->0 : number +>0 : 0 // Identifier => AssignmentExpression is equivalent to(Identifier) => AssignmentExpression var c: number; @@ -80,7 +80,7 @@ var p5 = ([a = 1]) => { }; >p5 : ([a]: [number]) => void >([a = 1]) => { } : ([a]: [number]) => void >a : number ->1 : number +>1 : 1 var p6 = ({ a }) => { }; >p6 : ({a}: { a: any; }) => void @@ -97,17 +97,17 @@ var p8 = ({ a = 1 }) => { }; >p8 : ({a}: { a?: number; }) => void >({ a = 1 }) => { } : ({a}: { a?: number; }) => void >a : number ->1 : number +>1 : 1 var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; >p9 : ({a: {b}}: { a?: { b?: number; }; }) => void >({ a: { b = 1 } = { b: 1 } }) => { } : ({a: {b}}: { a?: { b?: number; }; }) => void >a : any >b : number ->1 : number +>1 : 1 >{ b: 1 } : { b?: number; } >b : number ->1 : number +>1 : 1 var p10 = ([{ value, done }]) => { }; >p10 : ([{value, done}]: [{ value: any; done: any; }]) => void @@ -126,7 +126,7 @@ class MyClass { >n : any >n + 1 : any >n : any ->1 : number +>1 : 1 p = (n) => n && this; >p : (n: any) => this @@ -145,7 +145,7 @@ class MyClass { >n : any >n + 1 : any >n : any ->1 : number +>1 : 1 var p = (n) => n && this; >p : (n: any) => this @@ -177,8 +177,8 @@ var e = arrrr()(3)()(4); >arrrr()(3) : () => (n: number) => number >arrrr() : (m: number) => () => (n: number) => number >arrrr : () => (m: number) => () => (n: number) => number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e: number; >e : number @@ -203,8 +203,8 @@ function someFn() { >arr(3)(4) : number >arr(3) : (p: number) => number >arr : (n: number) => (p: number) => number ->3 : number ->4 : number +>3 : 3 +>4 : 4 >toExponential : (fractionDigits?: number) => string } @@ -217,7 +217,7 @@ function someOtherFn() { >(n: number) => '' + n : (n: number) => string >n : number >'' + n : string ->'' : string +>'' : "" >n : number arr(4).charAt(0); @@ -225,9 +225,9 @@ function someOtherFn() { >arr(4).charAt : (pos: number) => string >arr(4) : string >arr : (n: number) => string ->4 : number +>4 : 4 >charAt : (pos: number) => string ->0 : number +>0 : 0 } // Arrow function used in nested function in function @@ -270,14 +270,14 @@ var f = (n: string) => { return fn(4); >fn(4) : () => string >fn : (x: number) => () => string ->4 : number +>4 : 4 } var g = f('')(); >g : string >f('')() : string >f('') : () => string >f : (n: string) => () => string ->'' : string +>'' : "" var g: string; >g : string @@ -314,7 +314,7 @@ var h = someOuterFn()('')()(); >someOuterFn()('') : () => () => number >someOuterFn() : (n: string) => () => () => number >someOuterFn : () => (n: string) => () => () => number ->'' : string +>'' : "" h.toExponential(); >h.toExponential() : string @@ -348,7 +348,7 @@ function tryCatchFn() { >() => this + '' : () => string >this + '' : string >this : any ->'' : string +>'' : "" } } diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement1.types b/tests/baselines/reference/arrowFunctionInExpressionStatement1.types index a38a868f85b43..c2954cd7bec78 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement1.types +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement1.types @@ -1,5 +1,5 @@ === tests/cases/compiler/arrowFunctionInExpressionStatement1.ts === () => 0; >() => 0 : () => number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement2.types b/tests/baselines/reference/arrowFunctionInExpressionStatement2.types index bfbd11e8c0873..04db38ac58135 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement2.types +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement2.types @@ -4,5 +4,5 @@ module M { () => 0; >() => 0 : () => number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types index 0093ace2d9caf..8a006d7f1d4d4 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types @@ -6,9 +6,9 @@ var a = () => { name: "foo", message: "bar" }; >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var b = () => ({ name: "foo", message: "bar" }); >b : () => Error @@ -18,9 +18,9 @@ var b = () => ({ name: "foo", message: "bar" }); >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var c = () => ({ name: "foo", message: "bar" }); >c : () => { name: string; message: string; } @@ -28,9 +28,9 @@ var c = () => ({ name: "foo", message: "bar" }); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var d = () => ((({ name: "foo", message: "bar" }))); >d : () => Error @@ -42,7 +42,7 @@ var d = () => ((({ name: "foo", message: "bar" }))); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types index 31d2a63fec022..615f19aaf6b6e 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types @@ -6,9 +6,9 @@ var a = () => { name: "foo", message: "bar" }; >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var b = () => ({ name: "foo", message: "bar" }); >b : () => Error @@ -18,9 +18,9 @@ var b = () => ({ name: "foo", message: "bar" }); >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var c = () => ({ name: "foo", message: "bar" }); >c : () => { name: string; message: string; } @@ -28,9 +28,9 @@ var c = () => ({ name: "foo", message: "bar" }); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var d = () => ((({ name: "foo", message: "bar" }))); >d : () => Error @@ -42,7 +42,7 @@ var d = () => ((({ name: "foo", message: "bar" }))); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" diff --git a/tests/baselines/reference/asOpEmitParens.types b/tests/baselines/reference/asOpEmitParens.types index b87d7f4d91f9c..3204a6e5cac5b 100644 --- a/tests/baselines/reference/asOpEmitParens.types +++ b/tests/baselines/reference/asOpEmitParens.types @@ -9,8 +9,8 @@ declare var x; >x + 1 as number : number >x + 1 : any >x : any ->1 : number ->3 : number +>1 : 1 +>3 : 3 // Should still emit as x.y (x as any).y; diff --git a/tests/baselines/reference/asOperator1.types b/tests/baselines/reference/asOperator1.types index 3f69871ea0942..cf4a0b770be02 100644 --- a/tests/baselines/reference/asOperator1.types +++ b/tests/baselines/reference/asOperator1.types @@ -1,7 +1,7 @@ === tests/cases/conformance/expressions/asOperator/asOperator1.ts === var as = 43; >as : number ->43 : number +>43 : 43 var x = undefined as number; >x : number @@ -26,10 +26,10 @@ var z = Date as any as string; var j = 32 as number|string; >j : string | number >32 as number|string : string | number ->32 : number +>32 : 32 j = ''; ->j = '' : string +>j = '' : "" >j : string | number ->'' : string +>'' : "" diff --git a/tests/baselines/reference/asOperator3.types b/tests/baselines/reference/asOperator3.types index 507dfd8b5726f..a888d70892b3e 100644 --- a/tests/baselines/reference/asOperator3.types +++ b/tests/baselines/reference/asOperator3.types @@ -8,30 +8,30 @@ var a = `${123 + 456 as number}`; >`${123 + 456 as number}` : string >123 + 456 as number : number >123 + 456 : number ->123 : number ->456 : number +>123 : 123 +>456 : 456 var b = `leading ${123 + 456 as number}`; >b : string >`leading ${123 + 456 as number}` : string >123 + 456 as number : number >123 + 456 : number ->123 : number ->456 : number +>123 : 123 +>456 : 456 var c = `${123 + 456 as number} trailing`; >c : string >`${123 + 456 as number} trailing` : string >123 + 456 as number : number >123 + 456 : number ->123 : number ->456 : number +>123 : 123 +>456 : 456 var d = `Hello ${123} World` as string; >d : string >`Hello ${123} World` as string : string >`Hello ${123} World` : string ->123 : number +>123 : 123 var e = `Hello` as string; >e : string @@ -42,9 +42,9 @@ var f = 1 + `${1} end of string` as string; >f : string >1 + `${1} end of string` as string : string >1 + `${1} end of string` : string ->1 : number +>1 : 1 >`${1} end of string` : string ->1 : number +>1 : 1 var g = tag `Hello ${123} World` as string; >g : string @@ -52,7 +52,7 @@ var g = tag `Hello ${123} World` as string; >tag `Hello ${123} World` : any >tag : (...x: any[]) => any >`Hello ${123} World` : string ->123 : number +>123 : 123 var h = tag `Hello` as string; >h : string diff --git a/tests/baselines/reference/asOperatorASI.types b/tests/baselines/reference/asOperatorASI.types index 61c2d115cf4f6..e5e1de88c29fd 100644 --- a/tests/baselines/reference/asOperatorASI.types +++ b/tests/baselines/reference/asOperatorASI.types @@ -9,7 +9,7 @@ declare function as(...args: any[]); // Example 1 var x = 10 >x : number ->10 : number +>10 : 10 as `Hello world`; // should not error >as `Hello world` : any @@ -19,7 +19,7 @@ as `Hello world`; // should not error // Example 2 var y = 20 >y : number ->20 : number +>20 : 20 as(Foo); // should emit >as(Foo) : any diff --git a/tests/baselines/reference/asiArith.types b/tests/baselines/reference/asiArith.types index 13394d2f1c29e..b2c7410a403d9 100644 --- a/tests/baselines/reference/asiArith.types +++ b/tests/baselines/reference/asiArith.types @@ -1,11 +1,11 @@ === tests/cases/compiler/asiArith.ts === var x = 1; >x : number ->1 : number +>1 : 1 var y = 1; >y : number ->1 : number +>1 : 1 var z = >z : number @@ -28,11 +28,11 @@ y var a = 1; >a : number ->1 : number +>1 : 1 var b = 1; >b : number ->1 : number +>1 : 1 var c = >c : number diff --git a/tests/baselines/reference/asiBreak.types b/tests/baselines/reference/asiBreak.types index af3d6a040d5b7..7e7a8efb71f1d 100644 --- a/tests/baselines/reference/asiBreak.types +++ b/tests/baselines/reference/asiBreak.types @@ -1,4 +1,4 @@ === tests/cases/compiler/asiBreak.ts === while (true) break ->true : boolean +>true : true diff --git a/tests/baselines/reference/asiContinue.types b/tests/baselines/reference/asiContinue.types index e2eb5ba107d2e..0de6786fee13d 100644 --- a/tests/baselines/reference/asiContinue.types +++ b/tests/baselines/reference/asiContinue.types @@ -1,4 +1,4 @@ === tests/cases/compiler/asiContinue.ts === while (true) continue ->true : boolean +>true : true diff --git a/tests/baselines/reference/asiInES6Classes.types b/tests/baselines/reference/asiInES6Classes.types index 41940a0f4772f..6a93269497c55 100644 --- a/tests/baselines/reference/asiInES6Classes.types +++ b/tests/baselines/reference/asiInES6Classes.types @@ -10,7 +10,7 @@ class Foo { done: false >done : boolean ->false : boolean +>false : false } @@ -20,7 +20,7 @@ class Foo { >bar : () => number return 3; ->3 : number +>3 : 3 } diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types index 3e6aade9a2180..744687429ce14 100644 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types @@ -13,6 +13,6 @@ module // this is the identifier 'module' >module : string "my external module" // this is just a string ->"my external module" : string +>"my external module" : "my external module" { } // this is a block body diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types index 676718539938e..ae82f5f68a458 100644 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types @@ -16,7 +16,7 @@ module container { >module : string "my external module" // this is just a string ->"my external module" : string +>"my external module" : "my external module" { } // this is a block body } diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.types b/tests/baselines/reference/asiPreventsParsingAsNamespace04.types index 3fa2a448cf9e7..7cab2a7be3640 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace04.types +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace04.types @@ -2,7 +2,7 @@ let module = 10; >module : number ->10 : number +>10 : 10 module in {} >module in {} : boolean diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace05.types b/tests/baselines/reference/asiPreventsParsingAsNamespace05.types index 515147c1096a8..e1492c8c582a8 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace05.types +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace05.types @@ -2,7 +2,7 @@ let namespace = 10; >namespace : number ->10 : number +>10 : 10 namespace a.b { >a : typeof a @@ -10,7 +10,7 @@ namespace a.b { export let c = 20; >c : number ->20 : number +>20 : 20 } namespace diff --git a/tests/baselines/reference/assign1.types b/tests/baselines/reference/assign1.types index d600c4055afc1..51d9c72c54e9c 100644 --- a/tests/baselines/reference/assign1.types +++ b/tests/baselines/reference/assign1.types @@ -17,8 +17,8 @@ module M { >I : I >{salt:2,pepper:0} : { salt: number; pepper: number; } >salt : number ->2 : number +>2 : 2 >pepper : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/assignEveryTypeToAny.types b/tests/baselines/reference/assignEveryTypeToAny.types index dfff671a875b3..cfc24e1da65b8 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.types +++ b/tests/baselines/reference/assignEveryTypeToAny.types @@ -5,13 +5,13 @@ var x: any; >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 var a = 2; >a : number ->2 : number +>2 : 2 x = a; >x = a : number @@ -19,27 +19,27 @@ x = a; >a : number x = true; ->x = true : boolean +>x = true : true >x : any ->true : boolean +>true : true var b = true; >b : boolean ->true : boolean +>true : true x = b; ->x = b : boolean +>x = b : true >x : any ->b : boolean +>b : true x = ""; ->x = "" : string +>x = "" : "" >x : any ->"" : string +>"" : "" var c = ""; >c : string ->"" : string +>"" : "" x = c; >x = c : string @@ -142,7 +142,7 @@ x = { f() { return 1; } } >x : any >{ f() { return 1; } } : { f(): number; } >f : () => number ->1 : number +>1 : 1 x = { f(x: T) { return x; } } >x = { f(x: T) { return x; } } : { f(x: T): T; } diff --git a/tests/baselines/reference/assignToFn.errors.txt b/tests/baselines/reference/assignToFn.errors.txt index 7f2c7855a359d..42a1a129a2395 100644 --- a/tests/baselines/reference/assignToFn.errors.txt +++ b/tests/baselines/reference/assignToFn.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. +tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type '"hello"' is not assignable to type '(n: number) => boolean'. ==== tests/cases/compiler/assignToFn.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assi x.f="hello"; ~~~ -!!! error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. +!!! error TS2322: Type '"hello"' is not assignable to type '(n: number) => boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt index 0936c532ab331..e9fc3bd2f7f52 100644 --- a/tests/baselines/reference/assignmentCompat1.errors.txt +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -2,8 +2,8 @@ tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [index: st Property 'one' is missing in type '{ [index: string]: any; }'. tests/cases/compiler/assignmentCompat1.ts(6,1): error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'. Property 'one' is missing in type '{ [index: number]: any; }'. -tests/cases/compiler/assignmentCompat1.ts(8,1): error TS2322: Type 'string' is not assignable to type '{ [index: string]: any; }'. -tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'boolean' is not assignable to type '{ [index: number]: any; }'. +tests/cases/compiler/assignmentCompat1.ts(8,1): error TS2322: Type '"foo"' is not assignable to type '{ [index: string]: any; }'. +tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'false' is not assignable to type '{ [index: number]: any; }'. ==== tests/cases/compiler/assignmentCompat1.ts (4 errors) ==== @@ -22,10 +22,10 @@ tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'boolean' is z = x; // Ok because index signature type is any y = "foo"; // Error ~ -!!! error TS2322: Type 'string' is not assignable to type '{ [index: string]: any; }'. +!!! error TS2322: Type '"foo"' is not assignable to type '{ [index: string]: any; }'. z = "foo"; // OK, string has numeric indexer z = false; // Error ~ -!!! error TS2322: Type 'boolean' is not assignable to type '{ [index: number]: any; }'. +!!! error TS2322: Type 'false' is not assignable to type '{ [index: number]: any; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatForEnums.types b/tests/baselines/reference/assignmentCompatForEnums.types index e8b48bd02bd3e..dde41372e11d5 100644 --- a/tests/baselines/reference/assignmentCompatForEnums.types +++ b/tests/baselines/reference/assignmentCompatForEnums.types @@ -1,8 +1,8 @@ === tests/cases/compiler/assignmentCompatForEnums.ts === enum TokenType { One, Two }; >TokenType : TokenType ->One : TokenType ->Two : TokenType +>One : TokenType.One +>Two : TokenType.Two var list = {}; >list : {} @@ -27,7 +27,7 @@ function foo() { >TokenType : TokenType >list['one'] : any >list : {} ->'one' : string +>'one' : "one" } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.types b/tests/baselines/reference/assignmentCompatWithObjectMembers.types index f56b0b1dc74bc..ced87c605c999 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.types @@ -49,13 +49,13 @@ module SimpleTypes { >a2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" var b2 = { foo: '' }; >b2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.types b/tests/baselines/reference/assignmentCompatWithObjectMembers2.types index 560644f860e46..76316afd3ccd5 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers2.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.types @@ -50,13 +50,13 @@ var a2 = { foo: '' }; >a2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" var b2 = { foo: '' }; >b2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types index 3046c2f609d5b..88eadd4c36ac8 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types @@ -53,14 +53,14 @@ var a2: S2 = { foo: '' }; >S2 : S2 >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" var b2: T2 = { foo: '' }; >b2 : T2 >T2 : T2 >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types index 440ef006e0a67..0c44316d3249b 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types @@ -43,12 +43,12 @@ var b: { 1.0: string; baz?: string } var a2 = { 1.0: '' }; >a2 : { 1.0: string; } >{ 1.0: '' } : { 1.0: string; } ->'' : string +>'' : "" var b2 = { 1: '' }; >b2 : { 1: string; } >{ 1: '' } : { 1: string; } ->'' : string +>'' : "" s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatability1.types b/tests/baselines/reference/assignmentCompatability1.types index 66174a4036e4b..6f47a6e5244ce 100644 --- a/tests/baselines/reference/assignmentCompatability1.types +++ b/tests/baselines/reference/assignmentCompatability1.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability10.types b/tests/baselines/reference/assignmentCompatability10.types index f4c2bba451d16..9784acfdabc75 100644 --- a/tests/baselines/reference/assignmentCompatability10.types +++ b/tests/baselines/reference/assignmentCompatability10.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -34,7 +34,7 @@ module __test2__ { >x4 : classWithPublicAndOptional >new classWithPublicAndOptional(1) : classWithPublicAndOptional >classWithPublicAndOptional : typeof classWithPublicAndOptional ->1 : number +>1 : 1 export var __val__x4 = x4; >__val__x4 : classWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability2.types b/tests/baselines/reference/assignmentCompatability2.types index f46a81cf51f96..58fb86b5c7f1c 100644 --- a/tests/baselines/reference/assignmentCompatability2.types +++ b/tests/baselines/reference/assignmentCompatability2.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability3.types b/tests/baselines/reference/assignmentCompatability3.types index 67e553235edcb..4525500cfec16 100644 --- a/tests/baselines/reference/assignmentCompatability3.types +++ b/tests/baselines/reference/assignmentCompatability3.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -27,7 +27,7 @@ module __test2__ { >obj : { one: number; } >{one: 1} : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj = obj; >__val__obj : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability36.types b/tests/baselines/reference/assignmentCompatability36.types index b67be38e2b464..59ccc04195fbf 100644 --- a/tests/baselines/reference/assignmentCompatability36.types +++ b/tests/baselines/reference/assignmentCompatability36.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability4.types b/tests/baselines/reference/assignmentCompatability4.types index 0cafbaa4dd724..bc5e805875c1d 100644 --- a/tests/baselines/reference/assignmentCompatability4.types +++ b/tests/baselines/reference/assignmentCompatability4.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability5.types b/tests/baselines/reference/assignmentCompatability5.types index 8f8dbb0f64947..755ce16ec69cf 100644 --- a/tests/baselines/reference/assignmentCompatability5.types +++ b/tests/baselines/reference/assignmentCompatability5.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -32,7 +32,7 @@ module __test2__ { >interfaceOne : interfaceOne >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj1 = obj1; >__val__obj1 : interfaceOne diff --git a/tests/baselines/reference/assignmentCompatability6.types b/tests/baselines/reference/assignmentCompatability6.types index 1191ff8bc265c..d437d5a746962 100644 --- a/tests/baselines/reference/assignmentCompatability6.types +++ b/tests/baselines/reference/assignmentCompatability6.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability7.types b/tests/baselines/reference/assignmentCompatability7.types index 77b67514473e7..3dad9966d836a 100644 --- a/tests/baselines/reference/assignmentCompatability7.types +++ b/tests/baselines/reference/assignmentCompatability7.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -35,7 +35,7 @@ module __test2__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability8.types b/tests/baselines/reference/assignmentCompatability8.types index 554f9b3caedd9..d4cc5ebc33e7d 100644 --- a/tests/baselines/reference/assignmentCompatability8.types +++ b/tests/baselines/reference/assignmentCompatability8.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -31,7 +31,7 @@ module __test2__ { >x1 : classWithPublic >new classWithPublic(1) : classWithPublic >classWithPublic : typeof classWithPublic ->1 : number +>1 : 1 export var __val__x1 = x1; >__val__x1 : classWithPublic diff --git a/tests/baselines/reference/assignmentCompatability9.types b/tests/baselines/reference/assignmentCompatability9.types index d8fe3a764a499..671697f35f716 100644 --- a/tests/baselines/reference/assignmentCompatability9.types +++ b/tests/baselines/reference/assignmentCompatability9.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt index 33a2269f747f0..e9adcba03b73b 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type '""' is not assignable to type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'string[]'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type '4' is not assignable to type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Applicable'. Property 'apply' is missing in type '{}'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type '""' is not assignable to parameter of type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type '4' is not assignable to parameter of type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(25,4): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Applicable'. Property 'apply' is missing in type '{}'. @@ -23,14 +23,14 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi // Should fail x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'Applicable'. +!!! error TS2322: Type '""' is not assignable to type 'Applicable'. x = ['']; ~ !!! error TS2322: Type 'string[]' is not assignable to type 'Applicable'. !!! error TS2322: Property 'apply' is missing in type 'string[]'. x = 4; ~ -!!! error TS2322: Type 'number' is not assignable to type 'Applicable'. +!!! error TS2322: Type '4' is not assignable to type 'Applicable'. x = {}; ~ !!! error TS2322: Type '{}' is not assignable to type 'Applicable'. @@ -45,13 +45,13 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi // Should Fail fn(''); ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'Applicable'. fn(['']); ~~~~ !!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. fn(4); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Applicable'. +!!! error TS2345: Argument of type '4' is not assignable to parameter of type 'Applicable'. fn({}); ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'Applicable'. diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt index 1651e5082ee96..1755630217870 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type '""' is not assignable to type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Callable'. Property 'call' is missing in type 'string[]'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type '4' is not assignable to type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Callable'. Property 'call' is missing in type '{}'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type '""' is not assignable to parameter of type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type '4' is not assignable to parameter of type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(25,4): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Callable'. Property 'call' is missing in type '{}'. @@ -23,14 +23,14 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio // Should fail x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'Callable'. +!!! error TS2322: Type '""' is not assignable to type 'Callable'. x = ['']; ~ !!! error TS2322: Type 'string[]' is not assignable to type 'Callable'. !!! error TS2322: Property 'call' is missing in type 'string[]'. x = 4; ~ -!!! error TS2322: Type 'number' is not assignable to type 'Callable'. +!!! error TS2322: Type '4' is not assignable to type 'Callable'. x = {}; ~ !!! error TS2322: Type '{}' is not assignable to type 'Callable'. @@ -45,13 +45,13 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio // Should Fail fn(''); ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'Callable'. fn(['']); ~~~~ !!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'. fn(4); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Callable'. +!!! error TS2345: Argument of type '4' is not assignable to parameter of type 'Callable'. fn({}); ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'Callable'. diff --git a/tests/baselines/reference/assignmentLHSIsReference.types b/tests/baselines/reference/assignmentLHSIsReference.types index 47204740165ff..dfb3b236c0aa2 100644 --- a/tests/baselines/reference/assignmentLHSIsReference.types +++ b/tests/baselines/reference/assignmentLHSIsReference.types @@ -37,7 +37,7 @@ x3['a'] = value; >x3['a'] = value : any >x3['a'] : string >x3 : { a: string; } ->'a' : string +>'a' : "a" >value : any // parentheses, the contained expression is reference @@ -71,6 +71,6 @@ function fn2(x4: number) { >(x3['a']) : string >x3['a'] : string >x3 : { a: string; } ->'a' : string +>'a' : "a" >value : any diff --git a/tests/baselines/reference/assignmentNonObjectTypeConstraints.types b/tests/baselines/reference/assignmentNonObjectTypeConstraints.types index e2c3176940d38..2037d058aff2d 100644 --- a/tests/baselines/reference/assignmentNonObjectTypeConstraints.types +++ b/tests/baselines/reference/assignmentNonObjectTypeConstraints.types @@ -1,9 +1,9 @@ === tests/cases/compiler/assignmentNonObjectTypeConstraints.ts === const enum E { A, B, C } >E : E ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C function foo(x: T) { >foo : (x: T) => void diff --git a/tests/baselines/reference/assignmentStricterConstraints.types b/tests/baselines/reference/assignmentStricterConstraints.types index 3a72d92f51c06..c1a7c86c74432 100644 --- a/tests/baselines/reference/assignmentStricterConstraints.types +++ b/tests/baselines/reference/assignmentStricterConstraints.types @@ -34,6 +34,6 @@ g = f g(1, "") >g(1, "") : void >g : (x: T, y: S) => void ->1 : number ->"" : string +>1 : 1 +>"" : "" diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt index a50ffdf72d71a..b929704880ecd 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(13,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(4,1): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(5,1): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(13,1): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(14,1): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(15,1): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2364: Invalid left-hand side of assignment expression. @@ -17,13 +17,13 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(44,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(48,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(49,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(54,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(55,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(56,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(44,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(48,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(49,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(54,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(55,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(56,5): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(62,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(63,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(69,1): error TS2364: Invalid left-hand side of assignment expression. @@ -36,10 +36,10 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (x) = 3; // OK x = ''; // Error ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (x) = ''; // Error ~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. module M { export var y: number; @@ -49,13 +49,13 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (M.y) = 3; // OK M.y = ''; // Error ~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (M).y = ''; // Error ~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (M.y) = ''; // Error ~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. M = { y: 3 }; // Error ~ @@ -107,32 +107,32 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (x) = 3; // OK x = ''; // Error ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (x) = ''; // Error ~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (y).t = 3; // OK (y.t) = 3; // OK (y).t = ''; // Error ~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (y.t) = ''; // Error ~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. y['t'] = 3; // OK (y)['t'] = 3; // OK (y['t']) = 3; // OK y['t'] = ''; // Error ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (y)['t'] = ''; // Error ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (y['t']) = ''; // Error ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. } enum E { diff --git a/tests/baselines/reference/assignmentTypeNarrowing.types b/tests/baselines/reference/assignmentTypeNarrowing.types index f46b2a16c3b5e..8c5fea315cec2 100644 --- a/tests/baselines/reference/assignmentTypeNarrowing.types +++ b/tests/baselines/reference/assignmentTypeNarrowing.types @@ -4,9 +4,9 @@ let x: string | number | boolean | RegExp; >RegExp : RegExp x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | RegExp ->"" : string +>"" : "" x; // string >x : string @@ -24,11 +24,11 @@ x; // boolean [x = ""] = [1]; >[x = ""] = [1] : [number] >[x = ""] : [string] ->x = "" : string +>x = "" : "" >x : string | number | boolean | RegExp ->"" : string +>"" : "" >[1] : [number] ->1 : number +>1 : 1 x; // string | number >x : string | number @@ -39,21 +39,21 @@ x; // string | number >{x} : { x: string | number | boolean | RegExp; } >x : string | number | boolean | RegExp >{x: true} : { x: true; } ->x : true +>x : boolean >true : true x; // boolean >x : true ({y: x} = {y: 1}); ->({y: x} = {y: 1}) : { y: number; } ->{y: x} = {y: 1} : { y: number; } +>({y: x} = {y: 1}) : { y: 1; } +>{y: x} = {y: 1} : { y: 1; } >{y: x} : { y: string | number | boolean | RegExp; } >y : string | number | boolean | RegExp >x : string | number | boolean | RegExp ->{y: 1} : { y: number; } +>{y: 1} : { y: 1; } >y : number ->1 : number +>1 : 1 x; // number >x : number @@ -64,7 +64,7 @@ x; // number >{x = ""} : { x?: string | number | boolean | RegExp; } >x : string | number | boolean | RegExp >{x: true} : { x?: true; } ->x : true +>x : boolean >true : true x; // string | boolean @@ -80,7 +80,7 @@ x; // string | boolean >/a/ : RegExp >{y: 1} : { y?: number; } >y : number ->1 : number +>1 : 1 x; // number | RegExp >x : number | RegExp diff --git a/tests/baselines/reference/asyncFunctionReturnType.types b/tests/baselines/reference/asyncFunctionReturnType.types index f848f7e154627..db9f8e42d5261 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.types +++ b/tests/baselines/reference/asyncFunctionReturnType.types @@ -5,8 +5,8 @@ async function fAsync() { // Without explicit type annotation, this is just an array. return [1, true]; >[1, true] : (number | boolean)[] ->1 : number ->true : boolean +>1 : 1 +>true : true } async function fAsyncExplicit(): Promise<[number, boolean]> { @@ -16,7 +16,7 @@ async function fAsyncExplicit(): Promise<[number, boolean]> { // This is contextually typed as a tuple. return [1, true]; >[1, true] : [number, true] ->1 : number +>1 : 1 >true : true } diff --git a/tests/baselines/reference/asyncMethodWithSuper_es5.types b/tests/baselines/reference/asyncMethodWithSuper_es5.types index 4d14528409cf6..4622d83a67994 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es5.types +++ b/tests/baselines/reference/asyncMethodWithSuper_es5.types @@ -27,7 +27,7 @@ class B extends A { >super["x"]() : void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (read) const a = super.x; @@ -41,7 +41,7 @@ class B extends A { >b : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" } // async method with assignment/destructuring on 'super' requires a binding @@ -64,7 +64,7 @@ class B extends A { >super["x"]() : void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (read) const a = super.x; @@ -78,7 +78,7 @@ class B extends A { >b : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (assign) super.x = f; @@ -93,7 +93,7 @@ class B extends A { >super["x"] = f : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" >f : () => void // destructuring assign with property access @@ -116,7 +116,7 @@ class B extends A { >f : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" >{ f } : { f: () => void; } >f : () => void } diff --git a/tests/baselines/reference/asyncMethodWithSuper_es6.types b/tests/baselines/reference/asyncMethodWithSuper_es6.types index 04c5b5a9baf0e..030c9fe4e6ad2 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es6.types +++ b/tests/baselines/reference/asyncMethodWithSuper_es6.types @@ -27,7 +27,7 @@ class B extends A { >super["x"]() : void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (read) const a = super.x; @@ -41,7 +41,7 @@ class B extends A { >b : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" } // async method with assignment/destructuring on 'super' requires a binding @@ -64,7 +64,7 @@ class B extends A { >super["x"]() : void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (read) const a = super.x; @@ -78,7 +78,7 @@ class B extends A { >b : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (assign) super.x = f; @@ -93,7 +93,7 @@ class B extends A { >super["x"] = f : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" >f : () => void // destructuring assign with property access @@ -116,7 +116,7 @@ class B extends A { >f : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" >{ f } : { f: () => void; } >f : () => void } diff --git a/tests/baselines/reference/asyncUseStrict_es5.types b/tests/baselines/reference/asyncUseStrict_es5.types index c7eafb3433c5e..a8744a605590f 100644 --- a/tests/baselines/reference/asyncUseStrict_es5.types +++ b/tests/baselines/reference/asyncUseStrict_es5.types @@ -11,7 +11,7 @@ async function func(): Promise { >Promise : Promise "use strict"; ->"use strict" : string +>"use strict" : "use strict" var b = await p || a; >b : boolean diff --git a/tests/baselines/reference/asyncUseStrict_es6.types b/tests/baselines/reference/asyncUseStrict_es6.types index 7e6fd8720817e..e92da865316a6 100644 --- a/tests/baselines/reference/asyncUseStrict_es6.types +++ b/tests/baselines/reference/asyncUseStrict_es6.types @@ -11,7 +11,7 @@ async function func(): Promise { >Promise : Promise "use strict"; ->"use strict" : string +>"use strict" : "use strict" var b = await p || a; >b : boolean diff --git a/tests/baselines/reference/augmentExportEquals3.types b/tests/baselines/reference/augmentExportEquals3.types index 4df7bbc60fa85..edcd1820f241e 100644 --- a/tests/baselines/reference/augmentExportEquals3.types +++ b/tests/baselines/reference/augmentExportEquals3.types @@ -8,7 +8,7 @@ namespace foo { export var v = 1; >v : number ->1 : number +>1 : 1 } export = foo; >foo : typeof foo @@ -18,11 +18,11 @@ import x = require("./file1"); >x : typeof x x.b = 1; ->x.b = 1 : number +>x.b = 1 : 1 >x.b : number >x : typeof x >b : number ->1 : number +>1 : 1 // OK - './file1' is a namespace declare module "./file1" { diff --git a/tests/baselines/reference/augmentExportEquals3_1.types b/tests/baselines/reference/augmentExportEquals3_1.types index 8a70a6ec0a6bf..62d08bd259791 100644 --- a/tests/baselines/reference/augmentExportEquals3_1.types +++ b/tests/baselines/reference/augmentExportEquals3_1.types @@ -20,11 +20,11 @@ import x = require("file1"); >x : typeof x x.b = 1; ->x.b = 1 : number +>x.b = 1 : 1 >x.b : number >x : typeof x >b : number ->1 : number +>1 : 1 // OK - './file1' is a namespace declare module "file1" { diff --git a/tests/baselines/reference/augmentExportEquals4.types b/tests/baselines/reference/augmentExportEquals4.types index 3d25ae2decb84..e16e3dd19a12b 100644 --- a/tests/baselines/reference/augmentExportEquals4.types +++ b/tests/baselines/reference/augmentExportEquals4.types @@ -8,7 +8,7 @@ namespace foo { export var v = 1; >v : number ->1 : number +>1 : 1 } export = foo; >foo : foo @@ -18,11 +18,11 @@ import x = require("./file1"); >x : typeof x x.b = 1; ->x.b = 1 : number +>x.b = 1 : 1 >x.b : number >x : typeof x >b : number ->1 : number +>1 : 1 // OK - './file1' is a namespace declare module "./file1" { diff --git a/tests/baselines/reference/augmentExportEquals4_1.types b/tests/baselines/reference/augmentExportEquals4_1.types index 9f21928600053..d6f88c3be8d8b 100644 --- a/tests/baselines/reference/augmentExportEquals4_1.types +++ b/tests/baselines/reference/augmentExportEquals4_1.types @@ -21,11 +21,11 @@ import x = require("file1"); >x : typeof x x.b = 1; ->x.b = 1 : number +>x.b = 1 : 1 >x.b : number >x : typeof x >b : number ->1 : number +>1 : 1 // OK - './file1' is a namespace declare module "file1" { diff --git a/tests/baselines/reference/augmentExportEquals6.types b/tests/baselines/reference/augmentExportEquals6.types index 1a2b2b22ccb2f..31a1ea4d86cdf 100644 --- a/tests/baselines/reference/augmentExportEquals6.types +++ b/tests/baselines/reference/augmentExportEquals6.types @@ -21,13 +21,13 @@ import x = require("./file1"); >x : typeof x x.B.b = 1; ->x.B.b = 1 : number +>x.B.b = 1 : 1 >x.B.b : number >x.B : typeof x.B >x : typeof x >B : typeof x.B >b : number ->1 : number +>1 : 1 // OK - './file1' is a namespace declare module "./file1" { diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types index 898da985aad88..a0951c324f202 100644 --- a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types @@ -27,12 +27,12 @@ var a = {}[0]; // Should be Foo >a : any >{}[0] : any >{} : {} ->0 : number +>0 : 0 var b = (() => { })[0]; // Should be Bar >b : any >(() => { })[0] : any >(() => { }) : () => void >() => { } : () => void ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types index c47c98ebc9c9a..d8388fc81a883 100644 --- a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types @@ -23,23 +23,23 @@ var r1 = o['data']; // Should be number >r1 : number >o['data'] : number >o : {} ->'data' : string +>'data' : "data" var r2 = o['functionData']; // Should be any (no property found) >r2 : any >o['functionData'] : any >o : {} ->'functionData' : string +>'functionData' : "functionData" var r3 = f['functionData']; // Should be string >r3 : string >f['functionData'] : string >f : () => void ->'functionData' : string +>'functionData' : "functionData" var r4 = f['data']; // Should be number >r4 : number >f['data'] : number >f : () => void ->'data' : string +>'data' : "data" diff --git a/tests/baselines/reference/augmentedTypesClass3.types b/tests/baselines/reference/augmentedTypesClass3.types index bed118b5978de..64e403d266117 100644 --- a/tests/baselines/reference/augmentedTypesClass3.types +++ b/tests/baselines/reference/augmentedTypesClass3.types @@ -14,7 +14,7 @@ class c5a { public foo() { } } module c5a { var y = 2; } // should be ok >c5a : typeof c5a >y : number ->2 : number +>2 : 2 class c5b { public foo() { } } >c5b : c5b @@ -23,7 +23,7 @@ class c5b { public foo() { } } module c5b { export var y = 2; } // should be ok >c5b : typeof c5b >y : number ->2 : number +>2 : 2 //// class then import class c5c { public foo() { } } diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.types b/tests/baselines/reference/augmentedTypesExternalModule1.types index e652ecb08e106..2d3f8394d82c4 100644 --- a/tests/baselines/reference/augmentedTypesExternalModule1.types +++ b/tests/baselines/reference/augmentedTypesExternalModule1.types @@ -1,7 +1,7 @@ === tests/cases/compiler/augmentedTypesExternalModule1.ts === export var a = 1; >a : number ->1 : number +>1 : 1 class c5 { public foo() { } } >c5 : c5 diff --git a/tests/baselines/reference/augmentedTypesModules3b.types b/tests/baselines/reference/augmentedTypesModules3b.types index 38134c7c1c262..0d1ebe2bb4248 100644 --- a/tests/baselines/reference/augmentedTypesModules3b.types +++ b/tests/baselines/reference/augmentedTypesModules3b.types @@ -6,7 +6,7 @@ class m3b { foo() { } } module m3b { var y = 2; } >m3b : typeof m3b >y : number ->2 : number +>2 : 2 class m3c { foo() { } } >m3c : m3c @@ -15,7 +15,7 @@ class m3c { foo() { } } module m3c { export var y = 2; } >m3c : typeof m3c >y : number ->2 : number +>2 : 2 declare class m3d { foo(): void } >m3d : m3d @@ -24,12 +24,12 @@ declare class m3d { foo(): void } module m3d { export var y = 2; } >m3d : typeof m3d >y : number ->2 : number +>2 : 2 module m3e { export var y = 2; } >m3e : typeof m3e >y : number ->2 : number +>2 : 2 declare class m3e { foo(): void } >m3e : m3e diff --git a/tests/baselines/reference/augmentedTypesModules4.types b/tests/baselines/reference/augmentedTypesModules4.types index 15d7c28e1d638..7e47abc41e8b2 100644 --- a/tests/baselines/reference/augmentedTypesModules4.types +++ b/tests/baselines/reference/augmentedTypesModules4.types @@ -10,7 +10,7 @@ enum m4 { } module m4a { var y = 2; } >m4a : typeof m4a >y : number ->2 : number +>2 : 2 enum m4a { One } >m4a : m4a @@ -19,7 +19,7 @@ enum m4a { One } module m4b { export var y = 2; } >m4b : typeof m4b >y : number ->2 : number +>2 : 2 enum m4b { One } >m4b : m4b @@ -48,7 +48,7 @@ enum m4d { One } module m5 { export var y = 2; } >m5 : typeof m5 >y : number ->2 : number +>2 : 2 module m5 { export interface I { foo(): void } } // should already be reasonably well covered >m5 : typeof m5 diff --git a/tests/baselines/reference/autonumberingInEnums.types b/tests/baselines/reference/autonumberingInEnums.types index 35d5a1505a532..8e3606dd8b349 100644 --- a/tests/baselines/reference/autonumberingInEnums.types +++ b/tests/baselines/reference/autonumberingInEnums.types @@ -3,13 +3,13 @@ enum Foo { >Foo : Foo a = 1 ->a : Foo ->1 : number +>a : Foo.a +>1 : 1 } enum Foo { >Foo : Foo b // should work fine ->b : Foo +>b : Foo.b } diff --git a/tests/baselines/reference/avoid.types b/tests/baselines/reference/avoid.types index 25fe27a2ea07d..a4ecdb6f2c622 100644 --- a/tests/baselines/reference/avoid.types +++ b/tests/baselines/reference/avoid.types @@ -4,7 +4,7 @@ function f() { var x=1; >x : number ->1 : number +>1 : 1 } var y=f(); // error void fn diff --git a/tests/baselines/reference/await_unaryExpression_es6.types b/tests/baselines/reference/await_unaryExpression_es6.types index 2a4b7354d3ebf..14b4fbf89ac27 100644 --- a/tests/baselines/reference/await_unaryExpression_es6.types +++ b/tests/baselines/reference/await_unaryExpression_es6.types @@ -5,8 +5,8 @@ async function bar() { !await 42; // OK >!await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar1() { @@ -14,8 +14,8 @@ async function bar1() { +await 42; // OK >+await 42 : number ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar3() { @@ -23,8 +23,8 @@ async function bar3() { -await 42; // OK >-await 42 : number ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar4() { @@ -32,6 +32,6 @@ async function bar4() { ~await 42; // OK >~await 42 : number ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } diff --git a/tests/baselines/reference/await_unaryExpression_es6_1.types b/tests/baselines/reference/await_unaryExpression_es6_1.types index a5c3740b677f1..15544420189d1 100644 --- a/tests/baselines/reference/await_unaryExpression_es6_1.types +++ b/tests/baselines/reference/await_unaryExpression_es6_1.types @@ -5,8 +5,8 @@ async function bar() { !await 42; // OK >!await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar1() { @@ -14,8 +14,8 @@ async function bar1() { delete await 42; // OK >delete await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar2() { @@ -23,8 +23,8 @@ async function bar2() { delete await 42; // OK >delete await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar3() { @@ -32,8 +32,8 @@ async function bar3() { void await 42; >void await 42 : undefined ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar4() { @@ -41,6 +41,6 @@ async function bar4() { +await 42; >+await 42 : number ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } diff --git a/tests/baselines/reference/await_unaryExpression_es6_2.types b/tests/baselines/reference/await_unaryExpression_es6_2.types index b438f063add31..6142eec825bb9 100644 --- a/tests/baselines/reference/await_unaryExpression_es6_2.types +++ b/tests/baselines/reference/await_unaryExpression_es6_2.types @@ -5,8 +5,8 @@ async function bar1() { delete await 42; >delete await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar2() { @@ -14,8 +14,8 @@ async function bar2() { delete await 42; >delete await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar3() { @@ -23,6 +23,6 @@ async function bar3() { void await 42; >void await 42 : undefined ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } diff --git a/tests/baselines/reference/baseCheck.errors.txt b/tests/baselines/reference/baseCheck.errors.txt index c31ba95476aee..1f267f5530158 100644 --- a/tests/baselines/reference/baseCheck.errors.txt +++ b/tests/baselines/reference/baseCheck.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/baseCheck.ts(9,18): error TS2304: Cannot find name 'loc'. tests/cases/compiler/baseCheck.ts(17,53): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/baseCheck.ts(17,59): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/baseCheck.ts(18,62): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. -tests/cases/compiler/baseCheck.ts(19,59): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/baseCheck.ts(19,59): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/compiler/baseCheck.ts(19,68): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/baseCheck.ts(22,9): error TS2304: Cannot find name 'x'. tests/cases/compiler/baseCheck.ts(23,7): error TS2304: Cannot find name 'x'. @@ -38,7 +38,7 @@ tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'. !!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. class F extends C { constructor(public z: number) { super("hello", this.z) } } // first param type ~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. ~~~~ !!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. diff --git a/tests/baselines/reference/baseIndexSignatureResolution.types b/tests/baselines/reference/baseIndexSignatureResolution.types index 90d143155fb28..17fb5cf85de77 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.types +++ b/tests/baselines/reference/baseIndexSignatureResolution.types @@ -37,7 +37,7 @@ var y: Derived = x[0]; >Derived : Derived >x[0] : Derived >x : FooOf ->0 : number +>0 : 0 /* // Note - the equivalent for normal interface methods works fine: diff --git a/tests/baselines/reference/bestChoiceType.types b/tests/baselines/reference/bestChoiceType.types index f88cf64e5a27b..b1b4d41975611 100644 --- a/tests/baselines/reference/bestChoiceType.types +++ b/tests/baselines/reference/bestChoiceType.types @@ -9,7 +9,7 @@ >''.match(/ /) || [] : RegExpMatchArray >''.match(/ /) : RegExpMatchArray | null >''.match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } ->'' : string +>'' : "" >match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } >/ / : RegExp >[] : never[] @@ -30,7 +30,7 @@ function f1() { >x : RegExpMatchArray | null >''.match(/ /) : RegExpMatchArray | null >''.match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } ->'' : string +>'' : "" >match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } >/ / : RegExp @@ -61,7 +61,7 @@ function f2() { >x : RegExpMatchArray | null >''.match(/ /) : RegExpMatchArray | null >''.match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } ->'' : string +>'' : "" >match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } >/ / : RegExp diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types index 2a5ee6a2fe230..f3ea48e637b53 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types @@ -40,36 +40,36 @@ var derived2: Derived2; var r = true ? 1 : 2; >r : number ->true ? 1 : 2 : number ->true : boolean ->1 : number ->2 : number +>true ? 1 : 2 : 1 | 2 +>true : true +>1 : 1 +>2 : 2 var r3 = true ? 1 : {}; >r3 : {} >true ? 1 : {} : {} ->true : boolean ->1 : number +>true : true +>1 : 1 >{} : {} var r4 = true ? a : b; // typeof a >r4 : { x: number; y?: number; } | { x: number; z?: number; } >true ? a : b : { x: number; y?: number; } | { x: number; z?: number; } ->true : boolean +>true : true >a : { x: number; y?: number; } >b : { x: number; z?: number; } var r5 = true ? b : a; // typeof b >r5 : { x: number; y?: number; } | { x: number; z?: number; } >true ? b : a : { x: number; y?: number; } | { x: number; z?: number; } ->true : boolean +>true : true >b : { x: number; z?: number; } >a : { x: number; y?: number; } var r6 = true ? (x: number) => { } : (x: Object) => { }; // returns number => void >r6 : (x: number) => void >true ? (x: number) => { } : (x: Object) => { } : (x: number) => void ->true : boolean +>true : true >(x: number) => { } : (x: number) => void >x : number >(x: Object) => { } : (x: Object) => void @@ -81,7 +81,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; >x : Object >Object : Object >true ? (x: number) => { } : (x: Object) => { } : (x: number) => void ->true : boolean +>true : true >(x: number) => { } : (x: number) => void >x : number >(x: Object) => { } : (x: Object) => void @@ -91,7 +91,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => void >r8 : (x: Object) => void >true ? (x: Object) => { } : (x: number) => { } : (x: Object) => void ->true : boolean +>true : true >(x: Object) => { } : (x: Object) => void >x : Object >Object : Object @@ -102,14 +102,14 @@ var r10: Base = true ? derived : derived2; // no error since we use the contextu >r10 : Base >Base : Base >true ? derived : derived2 : Derived | Derived2 ->true : boolean +>true : true >derived : Derived >derived2 : Derived2 var r11 = true ? base : derived2; >r11 : Base >true ? base : derived2 : Base ->true : boolean +>true : true >base : Base >derived2 : Derived2 @@ -125,7 +125,7 @@ function foo5(t: T, u: U): Object { return true ? t : u; // BCT is Object >true ? t : u : T | U ->true : boolean +>true : true >t : T >u : U } diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types index 833bddd0e7c62..ad09c274c9ba6 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types @@ -30,15 +30,15 @@ var derived2: Derived2; var r2 = true ? 1 : ''; >r2 : string | number ->true ? 1 : '' : string | number ->true : boolean ->1 : number ->'' : string +>true ? 1 : '' : "" | 1 +>true : true +>1 : 1 +>'' : "" var r9 = true ? derived : derived2; >r9 : Derived | Derived2 >true ? derived : derived2 : Derived | Derived2 ->true : boolean +>true : true >derived : Derived >derived2 : Derived2 @@ -53,7 +53,7 @@ function foo(t: T, u: U) { return true ? t : u; >true ? t : u : T | U ->true : boolean +>true : true >t : T >u : U } @@ -70,7 +70,7 @@ function foo2(t: T, u: U) { // Error for referencing own type pa return true ? t : u; // Ok because BCT(T, U) = U >true ? t : u : U ->true : boolean +>true : true >t : T >u : U } @@ -89,7 +89,7 @@ function foo3(t: T, u: U) { return true ? t : u; >true ? t : u : U ->true : boolean +>true : true >t : T >u : U } diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.types b/tests/baselines/reference/bestCommonTypeOfTuple.types index 02c504b6ec35e..82c96ecb86c76 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple.types @@ -2,12 +2,12 @@ function f1(x: number): string { return "foo"; } >f1 : (x: number) => string >x : number ->"foo" : string +>"foo" : "foo" function f2(x: number): number { return 10; } >f2 : (x: number) => number >x : number ->10 : number +>10 : 10 function f3(x: number): boolean { return true; } >f3 : (x: number) => boolean @@ -64,7 +64,7 @@ t3 = [5, undefined]; >t3 = [5, undefined] : [number, undefined] >t3 : [number, any] >[5, undefined] : [number, undefined] ->5 : number +>5 : 5 >undefined : undefined t4 = [E1.one, E2.two, 20]; @@ -77,29 +77,29 @@ t4 = [E1.one, E2.two, 20]; >E2.two : E2 >E2 : typeof E2 >two : E2 ->20 : number +>20 : 20 var e1 = t1[2]; // {} >e1 : ((x: number) => string) | ((x: number) => number) >t1[2] : ((x: number) => string) | ((x: number) => number) >t1 : [(x: number) => string, (x: number) => number] ->2 : number +>2 : 2 var e2 = t2[2]; // {} >e2 : E1 | E2 >t2[2] : E1 | E2 >t2 : [E1, E2] ->2 : number +>2 : 2 var e3 = t3[2]; // any >e3 : any >t3[2] : any >t3 : [number, any] ->2 : number +>2 : 2 var e4 = t4[3]; // number >e4 : number | E1 | E2 >t4[3] : number | E1 | E2 >t4 : [E1, E2, number] ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.types b/tests/baselines/reference/bestCommonTypeOfTuple2.types index 864d3030d8886..b64da59d5b0a3 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.types @@ -30,14 +30,14 @@ class C1 implements base1 { i = "foo"; c } >C1 : C1 >base1 : base1 >i : string ->"foo" : string +>"foo" : "foo" >c : any class D1 extends C1 { i = "bar"; d } >D1 : D1 >C1 : C1 >i : string ->"bar" : string +>"bar" : "bar" >d : any var t1: [C, base]; @@ -69,29 +69,29 @@ var e11 = t1[4]; // base >e11 : base | C >t1[4] : base | C >t1 : [C, base] ->4 : number +>4 : 4 var e21 = t2[4]; // {} >e21 : C | D >t2[4] : C | D >t2 : [C, D] ->4 : number +>4 : 4 var e31 = t3[4]; // C1 >e31 : C1 | D1 >t3[4] : C1 | D1 >t3 : [C1, D1] ->4 : number +>4 : 4 var e41 = t4[2]; // base1 >e41 : base1 | C1 >t4[2] : base1 | C1 >t4 : [base1, C1] ->2 : number +>2 : 2 var e51 = t5[2]; // {} >e51 : F | C1 >t5[2] : F | C1 >t5 : [C1, F] ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.types b/tests/baselines/reference/bestCommonTypeReturnStatement.types index 31f72ab93b4da..b327e707350cc 100644 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.types +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.types @@ -15,10 +15,10 @@ interface IPromise { } function f() { ->f : () => IPromise +>f : () => IPromise if (true) return b(); ->true : boolean +>true : true >b() : IPromise >b : () => IPromise diff --git a/tests/baselines/reference/binaryArithmatic1.types b/tests/baselines/reference/binaryArithmatic1.types index 43f4f26de60cc..3d24fe4b44efb 100644 --- a/tests/baselines/reference/binaryArithmatic1.types +++ b/tests/baselines/reference/binaryArithmatic1.types @@ -2,6 +2,6 @@ var v = 4 | null; >v : number >4 | null : number ->4 : number +>4 : 4 >null : null diff --git a/tests/baselines/reference/binaryArithmatic2.types b/tests/baselines/reference/binaryArithmatic2.types index 77cbce5b1e323..1ce8776384c48 100644 --- a/tests/baselines/reference/binaryArithmatic2.types +++ b/tests/baselines/reference/binaryArithmatic2.types @@ -2,6 +2,6 @@ var v = 4 | undefined; >v : number >4 | undefined : number ->4 : number +>4 : 4 >undefined : undefined diff --git a/tests/baselines/reference/binaryIntegerLiteral.types b/tests/baselines/reference/binaryIntegerLiteral.types index 4ff3c3c28a37c..5cee371fdbeb7 100644 --- a/tests/baselines/reference/binaryIntegerLiteral.types +++ b/tests/baselines/reference/binaryIntegerLiteral.types @@ -1,26 +1,26 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts === var bin1 = 0b11010; >bin1 : number ->0b11010 : number +>0b11010 : 26 var bin2 = 0B11010; >bin2 : number ->0B11010 : number +>0B11010 : 26 var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin3 : number ->0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : 9.671406556917009e+24 var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin4 : number ->0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : Infinity var obj1 = { >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } >{ 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,} : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0b11010: "Hello", ->"Hello" : string +>"Hello" : "Hello" a: bin1, >a : number @@ -31,10 +31,10 @@ var obj1 = { b: 0b11010, >b : number ->0b11010 : number +>0b11010 : 26 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, ->true : boolean +>true : true } var obj2 = { @@ -42,7 +42,7 @@ var obj2 = { >{ 0B11010: "World", a: bin2, bin2, b: 0B11010, 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,} : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0B11010: "World", ->"World" : string +>"World" : "World" a: bin2, >a : number @@ -53,100 +53,100 @@ var obj2 = { b: 0B11010, >b : number ->0B11010 : number +>0B11010 : 26 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, ->false : boolean +>false : false } obj1[0b11010]; // string >obj1[0b11010] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->0b11010 : number +>0b11010 : 26 obj1[26]; // string >obj1[26] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->26 : number +>26 : 26 obj1["26"]; // string >obj1["26"] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"26" : string +>"26" : "26" obj1["0b11010"]; // any >obj1["0b11010"] : any >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"0b11010" : string +>"0b11010" : "0b11010" obj1["a"]; // number >obj1["a"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"a" : string +>"a" : "a" obj1["b"]; // number >obj1["b"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"b" : string +>"b" : "b" obj1["bin1"]; // number >obj1["bin1"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"bin1" : string +>"bin1" : "bin1" obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" obj2[0B11010]; // string >obj2[0B11010] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->0B11010 : number +>0B11010 : 26 obj2[26]; // string >obj2[26] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->26 : number +>26 : 26 obj2["26"]; // string >obj2["26"] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"26" : string +>"26" : "26" obj2["0B11010"]; // any >obj2["0B11010"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"0B11010" : string +>"0B11010" : "0B11010" obj2["a"]; // number >obj2["a"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"a" : string +>"a" : "a" obj2["b"]; // number >obj2["b"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"b" : string +>"b" : "b" obj2["bin2"]; // number >obj2["bin2"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"bin2" : string +>"bin2" : "bin2" obj2[9.671406556917009e+24]; // boolean >obj2[9.671406556917009e+24] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->9.671406556917009e+24 : number +>9.671406556917009e+24 : 9.671406556917009e+24 obj2["9.671406556917009e+24"]; // boolean >obj2["9.671406556917009e+24"] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"9.671406556917009e+24" : string +>"9.671406556917009e+24" : "9.671406556917009e+24" obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.types b/tests/baselines/reference/binaryIntegerLiteralES6.types index 47bfe6f548d92..ab28010283bea 100644 --- a/tests/baselines/reference/binaryIntegerLiteralES6.types +++ b/tests/baselines/reference/binaryIntegerLiteralES6.types @@ -1,26 +1,26 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralES6.ts === var bin1 = 0b11010; >bin1 : number ->0b11010 : number +>0b11010 : 26 var bin2 = 0B11010; >bin2 : number ->0B11010 : number +>0B11010 : 26 var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin3 : number ->0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : 9.671406556917009e+24 var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin4 : number ->0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : Infinity var obj1 = { >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } >{ 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,} : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0b11010: "Hello", ->"Hello" : string +>"Hello" : "Hello" a: bin1, >a : number @@ -31,10 +31,10 @@ var obj1 = { b: 0b11010, >b : number ->0b11010 : number +>0b11010 : 26 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, ->true : boolean +>true : true } var obj2 = { @@ -42,7 +42,7 @@ var obj2 = { >{ 0B11010: "World", a: bin2, bin2, b: 0B11010, 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,} : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0B11010: "World", ->"World" : string +>"World" : "World" a: bin2, >a : number @@ -53,101 +53,101 @@ var obj2 = { b: 0B11010, >b : number ->0B11010 : number +>0B11010 : 26 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, ->false : boolean +>false : false } obj1[0b11010]; // string >obj1[0b11010] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->0b11010 : number +>0b11010 : 26 obj1[26]; // string >obj1[26] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->26 : number +>26 : 26 obj1["26"]; // string >obj1["26"] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"26" : string +>"26" : "26" obj1["0b11010"]; // any >obj1["0b11010"] : any >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"0b11010" : string +>"0b11010" : "0b11010" obj1["a"]; // number >obj1["a"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"a" : string +>"a" : "a" obj1["b"]; // number >obj1["b"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"b" : string +>"b" : "b" obj1["bin1"]; // number >obj1["bin1"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"bin1" : string +>"bin1" : "bin1" obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" obj2[0B11010]; // string >obj2[0B11010] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->0B11010 : number +>0B11010 : 26 obj2[26]; // string >obj2[26] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->26 : number +>26 : 26 obj2["26"]; // string >obj2["26"] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"26" : string +>"26" : "26" obj2["0B11010"]; // any >obj2["0B11010"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"0B11010" : string +>"0B11010" : "0B11010" obj2["a"]; // number >obj2["a"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"a" : string +>"a" : "a" obj2["b"]; // number >obj2["b"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"b" : string +>"b" : "b" obj2["bin2"]; // number >obj2["bin2"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"bin2" : string +>"bin2" : "bin2" obj2[9.671406556917009e+24]; // boolean >obj2[9.671406556917009e+24] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->9.671406556917009e+24 : number +>9.671406556917009e+24 : 9.671406556917009e+24 obj2["9.671406556917009e+24"]; // boolean >obj2["9.671406556917009e+24"] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"9.671406556917009e+24" : string +>"9.671406556917009e+24" : "9.671406556917009e+24" obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.types b/tests/baselines/reference/binopAssignmentShouldHaveType.types index d09138bbb8851..7adfb46792e7c 100644 --- a/tests/baselines/reference/binopAssignmentShouldHaveType.types +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.types @@ -3,7 +3,7 @@ declare var console; >console : any "use strict"; ->"use strict" : string +>"use strict" : "use strict" module Test { >Test : typeof Test @@ -15,7 +15,7 @@ module Test { >getName : () => string return "name"; ->"name" : string +>"name" : "name" } bug() { >bug : () => void @@ -35,7 +35,7 @@ module Test { >this : this >getName : () => string >length : number ->0 : number +>0 : 0 console.log(name); >console.log(name) : any diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types index 34e2b31a7e896..2875a46355c71 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types @@ -15,7 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -39,16 +39,16 @@ var ResultIsNumber1 = ~BOOLEAN; var ResultIsNumber2 = ~true; >ResultIsNumber2 : number >~true : number ->true : boolean +>true : true var ResultIsNumber3 = ~{ x: true, y: false }; >ResultIsNumber3 : number >~{ x: true, y: false } : number >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsNumber4 = ~objA.a; @@ -89,7 +89,7 @@ var ResultIsNumber8 = ~~BOOLEAN; // miss assignment operators ~true; >~true : number ->true : boolean +>true : true ~BOOLEAN; >~BOOLEAN : number @@ -101,10 +101,10 @@ var ResultIsNumber8 = ~~BOOLEAN; >foo : () => boolean ~true, false; ->~true, false : boolean +>~true, false : false >~true : number ->true : boolean ->false : boolean +>true : true +>false : false ~objA.a; >~objA.a : number diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types index bb8be9b3f54e3..03008f67d110b 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types @@ -3,8 +3,8 @@ enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 +>A : ENUM1.A +>B : ENUM1.B // enum type var var ResultIsNumber1 = ~ENUM1; @@ -16,21 +16,21 @@ var ResultIsNumber1 = ~ENUM1; var ResultIsNumber2 = ~ENUM1["A"]; >ResultIsNumber2 : number >~ENUM1["A"] : number ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string +>"A" : "A" var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); >ResultIsNumber3 : number >~(ENUM1.A + ENUM1["B"]) : number >(ENUM1.A + ENUM1["B"]) : number >ENUM1.A + ENUM1["B"] : number ->ENUM1.A : ENUM1 +>ENUM1.A : ENUM1.A >ENUM1 : typeof ENUM1 ->A : ENUM1 ->ENUM1["B"] : ENUM1 +>A : ENUM1.A +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" // multiple ~ operators var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); @@ -40,12 +40,12 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); >~(ENUM1["A"] + ENUM1.B) : number >(ENUM1["A"] + ENUM1.B) : number >ENUM1["A"] + ENUM1.B : number ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string ->ENUM1.B : ENUM1 +>"A" : "A" +>ENUM1.B : ENUM1.B >ENUM1 : typeof ENUM1 ->B : ENUM1 +>B : ENUM1.B // miss assignment operators ~ENUM1; @@ -54,18 +54,18 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); ~ENUM1["A"]; >~ENUM1["A"] : number ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string +>"A" : "A" ~ENUM1.A, ~ENUM1["B"]; >~ENUM1.A, ~ENUM1["B"] : number >~ENUM1.A : number ->ENUM1.A : ENUM1 +>ENUM1.A : ENUM1.A >ENUM1 : typeof ENUM1 ->A : ENUM1 +>A : ENUM1.A >~ENUM1["B"] : number ->ENUM1["B"] : ENUM1 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types index 228bd43e593ed..8dc3c31867fc3 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsNumber2 = ~NUMBER1; var ResultIsNumber3 = ~1; >ResultIsNumber3 : number >~1 : number ->1 : number +>1 : 1 var ResultIsNumber4 = ~{ x: 1, y: 2}; >ResultIsNumber4 : number >~{ x: 1, y: 2} : number >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; >ResultIsNumber5 : number >~{ x: 1, y: (n: number) => { return n; } } : number >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsNumber8 = ~NUMBER1[0]; >~NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsNumber9 = ~foo(); >ResultIsNumber9 : number diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types index 4f1ca481a1f60..130b52c84717d 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types @@ -6,12 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] ->"" : string ->"abc" : string +>"" : "" +>"abc" : "abc" function foo(): string { return "abc"; } >foo : () => string ->"abc" : string +>"abc" : "abc" class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return ""; } >foo : () => string ->"" : string +>"" : "" } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsNumber2 = ~STRING1; var ResultIsNumber3 = ~""; >ResultIsNumber3 : number >~"" : number ->"" : string +>"" : "" var ResultIsNumber4 = ~{ x: "", y: "" }; >ResultIsNumber4 : number >~{ x: "", y: "" } : number >{ x: "", y: "" } : { x: string; y: string; } >x : string ->"" : string +>"" : "" >y : string ->"" : string +>"" : "" var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; >ResultIsNumber5 : number >~{ x: "", y: (s: string) => { return s; } } : number >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string ->"" : string +>"" : "" >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -92,7 +92,7 @@ var ResultIsNumber8 = ~STRING1[0]; >~STRING1[0] : number >STRING1[0] : string >STRING1 : string[] ->0 : number +>0 : 0 var ResultIsNumber9 = ~foo(); >ResultIsNumber9 : number @@ -123,7 +123,7 @@ var ResultIsNumber12 = ~STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 // multiple ~ operators var ResultIsNumber13 = ~~STRING; diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.types index 7ced53508e69c..4824b6418410d 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.types @@ -9,14 +9,14 @@ declare function use(n: number): void; >function () { 'use strict' for (let i = 0; i < 9; ++i) { (() => use(++i))(); }} : () => void 'use strict' ->'use strict' : string +>'use strict' : "use strict" for (let i = 0; i < 9; ++i) { >i : number ->0 : number +>0 : 0 >i < 9 : boolean >i : number ->9 : number +>9 : 9 >++i : number >i : number diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types index 477d36982f44c..d1ae4ee20f4f7 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types @@ -1,9 +1,9 @@ === tests/cases/compiler/blockScopedBindingsReassignedInLoop2.ts === for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -31,17 +31,17 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } else { y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -69,9 +69,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } else { y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } @@ -80,9 +80,9 @@ loop: for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -111,9 +111,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } else { y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } @@ -122,9 +122,9 @@ loop: for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -153,8 +153,8 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } else { y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types index ee69f9a5a9f62..3dab1458b6740 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types @@ -2,9 +2,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -33,10 +33,10 @@ for (let x = 1, y = 2; x < y; ++x, --y) { else { for (let a = 1; a < 5; --a) { >a : number ->1 : number +>1 : 1 >a < 5 : boolean >a : number ->5 : number +>5 : 5 >--a : number >a : number @@ -63,18 +63,18 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -103,10 +103,10 @@ for (let x = 1, y = 2; x < y; ++x, --y) { else { for (let a = 1; a < 5; --a) { >a : number ->1 : number +>1 : 1 >a < 5 : boolean >a : number ->5 : number +>5 : 5 >--a : number >a : number @@ -133,9 +133,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } @@ -144,9 +144,9 @@ loop2: for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -179,10 +179,10 @@ for (let x = 1, y = 2; x < y; ++x, --y) { for (let a = 1; a < 5; --a) { >a : number ->1 : number +>1 : 1 >a < 5 : boolean >a : number ->5 : number +>5 : 5 >--a : number >a : number @@ -213,9 +213,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } @@ -224,9 +224,9 @@ loop2: for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -259,10 +259,10 @@ for (let x = 1, y = 2; x < y; ++x, --y) { for (let a = 1; a < 5; --a) { >a : number ->1 : number +>1 : 1 >a < 5 : boolean >a : number ->5 : number +>5 : 5 >--a : number >a : number @@ -293,9 +293,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types index c3576bbccd264..fb0367e878266 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types @@ -4,9 +4,9 @@ function f1() { for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -31,13 +31,13 @@ function f1() { >1 : 1 return 1; ->1 : number +>1 : 1 } else { y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } } diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types index 47a0fd5289125..73d13e76afd88 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types @@ -1,9 +1,9 @@ === tests/cases/compiler/blockScopedBindingsReassignedInLoop5.ts === for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -30,8 +30,8 @@ for (let x = 1, y = 2; x < y; ++x, --y) { break; else y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types index c4287869ec0a3..8936ded623929 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types @@ -6,8 +6,8 @@ function f1() { >x : number >y : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >x < y : boolean >x : number >y : number @@ -38,9 +38,9 @@ function f1() { >2 : 2 y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 else return; @@ -59,11 +59,11 @@ function f2() { >[{a: 1, b: {c: 2}}] : [{ a: number; b: { c: number; }; }] >{a: 1, b: {c: 2}} : { a: number; b: { c: number; }; } >a : number ->1 : number +>1 : 1 >b : { c: number; } >{c: 2} : { c: number; } >c : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -94,9 +94,9 @@ function f2() { >2 : 2 y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 else return; diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5.types b/tests/baselines/reference/blockScopedFunctionDeclarationES5.types index b3c4d9b7d73a1..8dfdd11da4338 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES5.types +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5.types @@ -1,6 +1,6 @@ === tests/cases/compiler/blockScopedFunctionDeclarationES5.ts === if (true) { ->true : boolean +>true : true function foo() { } >foo : () => void diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES6.types b/tests/baselines/reference/blockScopedFunctionDeclarationES6.types index 7ab74feb0ede1..8f87507a5ac05 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES6.types +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES6.types @@ -1,6 +1,6 @@ === tests/cases/compiler/blockScopedFunctionDeclarationES6.ts === if (true) { ->true : boolean +>true : true function foo() { } >foo : () => void diff --git a/tests/baselines/reference/bom-utf16be.types b/tests/baselines/reference/bom-utf16be.types index 1787d1022451b..e13c45ede2ff2 100644 --- a/tests/baselines/reference/bom-utf16be.types +++ b/tests/baselines/reference/bom-utf16be.types @@ -1,5 +1,5 @@ === tests/cases/compiler/bom-utf16be.ts === var x=10; >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/bom-utf16le.types b/tests/baselines/reference/bom-utf16le.types index 865c94eb82d07..bb2038bb23d45 100644 --- a/tests/baselines/reference/bom-utf16le.types +++ b/tests/baselines/reference/bom-utf16le.types @@ -1,5 +1,5 @@ === tests/cases/compiler/bom-utf16le.ts === var x=10; >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/bom-utf8.types b/tests/baselines/reference/bom-utf8.types index d96d013238317..0f2b45b8ea9a1 100644 --- a/tests/baselines/reference/bom-utf8.types +++ b/tests/baselines/reference/bom-utf8.types @@ -1,5 +1,5 @@ === tests/cases/compiler/bom-utf8.ts === var x=10; >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/booleanAssignment.errors.txt b/tests/baselines/reference/booleanAssignment.errors.txt index 15b506d3df4bf..fc25fd4007fff 100644 --- a/tests/baselines/reference/booleanAssignment.errors.txt +++ b/tests/baselines/reference/booleanAssignment.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/booleanAssignment.ts(2,1): error TS2322: Type 'number' is not assignable to type 'Boolean'. -tests/cases/compiler/booleanAssignment.ts(3,1): error TS2322: Type 'string' is not assignable to type 'Boolean'. +tests/cases/compiler/booleanAssignment.ts(2,1): error TS2322: Type '1' is not assignable to type 'Boolean'. +tests/cases/compiler/booleanAssignment.ts(3,1): error TS2322: Type '"a"' is not assignable to type 'Boolean'. tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not assignable to type 'Boolean'. Types of property 'valueOf' are incompatible. Type '() => Object' is not assignable to type '() => boolean'. @@ -10,10 +10,10 @@ tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not a var b = new Boolean(); b = 1; // Error ~ -!!! error TS2322: Type 'number' is not assignable to type 'Boolean'. +!!! error TS2322: Type '1' is not assignable to type 'Boolean'. b = "a"; // Error ~ -!!! error TS2322: Type 'string' is not assignable to type 'Boolean'. +!!! error TS2322: Type '"a"' is not assignable to type 'Boolean'. b = {}; // Error ~ !!! error TS2322: Type '{}' is not assignable to type 'Boolean'. diff --git a/tests/baselines/reference/booleanLiteralTypes1.types b/tests/baselines/reference/booleanLiteralTypes1.types index 704eba4055b00..3ea7000e3be0b 100644 --- a/tests/baselines/reference/booleanLiteralTypes1.types +++ b/tests/baselines/reference/booleanLiteralTypes1.types @@ -84,13 +84,13 @@ function f4(t: true, f: false) { >false : false var x1 = t && f; ->x1 : false +>x1 : boolean >t && f : false >t : true >f : false var x2 = f && t; ->x2 : false +>x2 : boolean >f && t : false >f : false >t : true @@ -102,7 +102,7 @@ function f4(t: true, f: false) { >f : false var x4 = f || t; ->x4 : true +>x4 : boolean >f || t : true >f : false >t : true @@ -113,7 +113,7 @@ function f4(t: true, f: false) { >t : true var x6 = !f; ->x6 : true +>x6 : boolean >!f : true >f : false } @@ -162,11 +162,11 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } function f10(x: true | false) { ->f10 : (x: boolean) => string +>f10 : (x: boolean) => "true" | "false" >x : boolean >true : true >false : false @@ -176,16 +176,16 @@ function f10(x: true | false) { case true: return "true"; >true : true ->"true" : string +>"true" : "true" case false: return "false"; >false : false ->"false" : string +>"false" : "false" } } function f11(x: true | false) { ->f11 : (x: boolean) => string +>f11 : (x: boolean) => "true" | "false" >x : boolean >true : true >false : false @@ -195,11 +195,11 @@ function f11(x: true | false) { case true: return "true"; >true : true ->"true" : string +>"true" : "true" case false: return "false"; >false : false ->"false" : string +>"false" : "false" } return assertNever(x); >assertNever(x) : never diff --git a/tests/baselines/reference/booleanLiteralTypes2.types b/tests/baselines/reference/booleanLiteralTypes2.types index 76cca9481d4a0..e5e4fba7f4f5c 100644 --- a/tests/baselines/reference/booleanLiteralTypes2.types +++ b/tests/baselines/reference/booleanLiteralTypes2.types @@ -85,36 +85,36 @@ function f4(t: true, f: false) { >false : false var x1 = t && f; ->x1 : false +>x1 : boolean >t && f : false >t : true >f : false var x2 = f && t; ->x2 : false +>x2 : boolean >f && t : false >f : false >t : true var x3 = t || f; ->x3 : true +>x3 : boolean >t || f : true >t : true >f : false var x4 = f || t; ->x4 : true +>x4 : boolean >f || t : true >f : false >t : true var x5 = !t; ->x5 : false +>x5 : boolean >!t : false >t : true var x6 = !f; ->x6 : true +>x6 : boolean >!f : true >f : false } @@ -163,11 +163,11 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } function f10(x: true | false) { ->f10 : (x: boolean) => string +>f10 : (x: boolean) => "true" | "false" >x : boolean >true : true >false : false @@ -177,16 +177,16 @@ function f10(x: true | false) { case true: return "true"; >true : true ->"true" : string +>"true" : "true" case false: return "false"; >false : false ->"false" : string +>"false" : "false" } } function f11(x: true | false) { ->f11 : (x: boolean) => string +>f11 : (x: boolean) => "true" | "false" >x : boolean >true : true >false : false @@ -196,11 +196,11 @@ function f11(x: true | false) { case true: return "true"; >true : true ->"true" : string +>"true" : "true" case false: return "false"; >false : false ->"false" : string +>"false" : "false" } return assertNever(x); >assertNever(x) : never diff --git a/tests/baselines/reference/booleanPropertyAccess.types b/tests/baselines/reference/booleanPropertyAccess.types index 2795b36cee525..a0b800b5574c8 100644 --- a/tests/baselines/reference/booleanPropertyAccess.types +++ b/tests/baselines/reference/booleanPropertyAccess.types @@ -1,19 +1,19 @@ === tests/cases/conformance/types/primitives/boolean/booleanPropertyAccess.ts === var x = true; >x : boolean ->true : boolean +>true : true var a = x.toString(); >a : string >x.toString() : string >x.toString : () => string ->x : boolean +>x : true >toString : () => string var b = x['toString'](); >b : string >x['toString']() : string >x['toString'] : () => string ->x : boolean ->'toString' : string +>x : true +>'toString' : "toString" diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement1.types b/tests/baselines/reference/breakInIterationOrSwitchStatement1.types index 545a20ecc555b..fad31ae3c9214 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement1.types +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/breakInIterationOrSwitchStatement1.ts === while (true) { ->true : boolean +>true : true break; } diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement2.types b/tests/baselines/reference/breakInIterationOrSwitchStatement2.types index 5736be6c923c4..e954d459f7386 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement2.types +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement2.types @@ -3,5 +3,5 @@ do { break; } while (true); ->true : boolean +>true : true diff --git a/tests/baselines/reference/breakTarget2.types b/tests/baselines/reference/breakTarget2.types index 412203accd1fa..bf465eb568d18 100644 --- a/tests/baselines/reference/breakTarget2.types +++ b/tests/baselines/reference/breakTarget2.types @@ -3,7 +3,7 @@ target: >target : any while (true) { ->true : boolean +>true : true break target; >target : any diff --git a/tests/baselines/reference/breakTarget3.types b/tests/baselines/reference/breakTarget3.types index e4b5f8a1c6110..6e926768e12a5 100644 --- a/tests/baselines/reference/breakTarget3.types +++ b/tests/baselines/reference/breakTarget3.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true break target1; >target1 : any diff --git a/tests/baselines/reference/breakTarget4.types b/tests/baselines/reference/breakTarget4.types index 8b6ccf600ad32..80bee56f9c737 100644 --- a/tests/baselines/reference/breakTarget4.types +++ b/tests/baselines/reference/breakTarget4.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true break target2; >target2 : any diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types index 76b8a51370261..69188eacd1a1c 100644 --- a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types @@ -15,7 +15,7 @@ var i: I; >I : I var y = i(""); // y should be string ->y : "" +>y : string >i("") : "" >i : I >"" : "" diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types index e3bcb35805fb2..99fc2d955d146 100644 --- a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types @@ -11,9 +11,9 @@ function f(x: T): T { return null; } var r = f(1); >r : number ->f(1) : number +>f(1) : 1 >f : (x: T) => T ->1 : number +>1 : 1 var f2 = (x: T): T => { return null; } >f2 : (x: T) => T @@ -26,9 +26,9 @@ var f2 = (x: T): T => { return null; } var r2 = f2(1); >r2 : number ->f2(1) : number +>f2(1) : 1 >f2 : (x: T) => T ->1 : number +>1 : 1 var f3: { (x: T): T; } >f3 : (x: T) => T @@ -39,9 +39,9 @@ var f3: { (x: T): T; } var r3 = f3(1); >r3 : number ->f3(1) : number +>f3(1) : 1 >f3 : (x: T) => T ->1 : number +>1 : 1 class C { >C : C @@ -59,13 +59,13 @@ class C { } var r4 = (new C()).f(1); >r4 : number ->(new C()).f(1) : number +>(new C()).f(1) : 1 >(new C()).f : (x: T) => T >(new C()) : C >new C() : C >C : typeof C >f : (x: T) => T ->1 : number +>1 : 1 interface I { >I : I @@ -83,11 +83,11 @@ var i: I; var r5 = i.f(1); >r5 : number ->i.f(1) : number +>i.f(1) : 1 >i.f : (x: T) => T >i : I >f : (x: T) => T ->1 : number +>1 : 1 class C2 { >C2 : C2 @@ -111,7 +111,7 @@ var r6 = (new C2()).f(1); >new C2() : C2<{}> >C2 : typeof C2 >f : (x: {}) => {} ->1 : number +>1 : 1 interface I2 { >I2 : I2 @@ -133,5 +133,5 @@ var r7 = i2.f(1); >i2.f : (x: number) => number >i2 : I2 >f : (x: number) => number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt index 63a63309c31f6..0b542186c292d 100644 --- a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt +++ b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt @@ -12,7 +12,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWith tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(35,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(44,9): error TS1015: Parameter cannot have question mark and initializer. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(46,9): error TS1015: Parameter cannot have question mark and initializer. @@ -91,7 +91,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWith ~ !!! error TS1015: Parameter cannot have question mark and initializer. ~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. b: (x?: any = '') => { } ~ !!! error TS1015: Parameter cannot have question mark and initializer. diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types index 062961ac09350..9fe90ae83c3f7 100644 --- a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types @@ -9,7 +9,7 @@ var r = foo(1); // void since there's a body >r : void >foo(1) : void >foo : (x: any) => void ->1 : number +>1 : 1 interface I { >I : I diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types index 689ac62c35b68..0b515750aecc6 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types @@ -8,13 +8,13 @@ function foo(x) { >x : any return 1; ->1 : number +>1 : 1 } var r = foo(1); >r : number >foo(1) : number >foo : (x: any) => number ->1 : number +>1 : 1 function foo2(x) { >foo2 : (x: any) => number @@ -29,7 +29,7 @@ var r2 = foo2(1); >r2 : number >foo2(1) : number >foo2 : (x: any) => number ->1 : number +>1 : 1 function foo3() { >foo3 : () => any @@ -54,30 +54,30 @@ function foo4(x: T) { } var r4 = foo4(1); >r4 : number ->foo4(1) : number +>foo4(1) : 1 >foo4 : (x: T) => T ->1 : number +>1 : 1 function foo5(x) { ->foo5 : (x: any) => number +>foo5 : (x: any) => 1 | 2 >x : any if (true) { ->true : boolean +>true : true return 1; ->1 : number +>1 : 1 } else { return 2; ->2 : number +>2 : 2 } } var r5 = foo5(1); >r5 : number ->foo5(1) : number ->foo5 : (x: any) => number ->1 : number +>foo5(1) : 1 | 2 +>foo5 : (x: any) => 1 | 2 +>1 : 1 function foo6(x) { >foo6 : (x: any) => any[] @@ -100,7 +100,7 @@ var r6 = foo6(1); >r6 : any[] >foo6(1) : any[] >foo6 : (x: any) => any[] ->1 : number +>1 : 1 function foo7(x) { >foo7 : (x: any) => string @@ -114,7 +114,7 @@ var r7 = foo7(1); >r7 : string >foo7(1) : string >foo7 : (x: any) => string ->1 : number +>1 : 1 // object types function foo8(x: number) { @@ -130,7 +130,7 @@ var r8 = foo8(1); >r8 : { x: number; } >foo8(1) : { x: number; } >foo8 : (x: number) => { x: number; } ->1 : number +>1 : 1 interface I { >I : I @@ -153,7 +153,7 @@ var r9 = foo9(1); >r9 : I >foo9(1) : I >foo9 : (x: number) => I ->1 : number +>1 : 1 class C { >C : C @@ -176,14 +176,14 @@ var r10 = foo10(1); >r10 : C >foo10(1) : C >foo10 : (x: number) => C ->1 : number +>1 : 1 module M { >M : typeof M export var x = 1; >x : number ->1 : number +>1 : 1 export class C { foo: string } >C : C @@ -230,12 +230,12 @@ var r12 = foo12(); function m1() { return 1; } >m1 : typeof m1 ->1 : number +>1 : 1 module m1 { export var y = 2; } >m1 : typeof m1 >y : number ->2 : number +>2 : 2 function foo13() { >foo13 : () => typeof m1 @@ -262,7 +262,7 @@ module c1 { export var x = 1; >x : number ->1 : number +>1 : 1 } function foo14() { >foo14 : () => typeof c1 @@ -282,7 +282,7 @@ enum e1 { A } module e1 { export var y = 1; } >e1 : typeof e1 >y : number ->1 : number +>1 : 1 function foo15() { >foo15 : () => typeof e1 diff --git a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt index 1c558910a8c0a..03219e806ef08 100644 --- a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt +++ b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts(9,10): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts(9,10): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts (1 errors) ==== @@ -12,5 +12,5 @@ tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts(9,10) test("expects boolean instead of string"); // should not error - "test" should not expect a boolean test(true); // should error - string expected ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt index 4ff65843eba64..87999dec851d4 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I'. Named property 'foo' of types 'I' and 'I' are not identical. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(13,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(13,16): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts (2 errors) ==== @@ -21,5 +21,5 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesTha var r = x.foo(1); // no error var r2 = x.foo(''); // error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.types b/tests/baselines/reference/callSignaturesWithOptionalParameters.types index 4ade0e8afe4ba..e01eed3835a6f 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.types @@ -20,7 +20,7 @@ var f2 = (x: number, y?: number) => { } foo(1); >foo(1) : void >foo : (x?: number) => void ->1 : number +>1 : 1 foo(); >foo() : void @@ -29,7 +29,7 @@ foo(); f(1); >f(1) : void >f : (x?: number) => void ->1 : number +>1 : 1 f(); >f() : void @@ -38,13 +38,13 @@ f(); f2(1); >f2(1) : void >f2 : (x: number, y?: number) => void ->1 : number +>1 : 1 f2(1, 2); >f2(1, 2) : void >f2 : (x: number, y?: number) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 class C { >C : C @@ -69,7 +69,7 @@ c.foo(1); >c.foo : (x?: number) => void >c : C >foo : (x?: number) => void ->1 : number +>1 : 1 interface I { >I : I @@ -94,22 +94,22 @@ i(); i(1); >i(1) : any >i : I ->1 : number +>1 : 1 i.foo(1); >i.foo(1) : any >i.foo : (x: number, y?: number) => any >i : I >foo : (x: number, y?: number) => any ->1 : number +>1 : 1 i.foo(1, 2); >i.foo(1, 2) : any >i.foo : (x: number, y?: number) => any >i : I >foo : (x: number, y?: number) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a: { >a : { (x?: number): any; foo(x?: number): any; } @@ -129,7 +129,7 @@ a(); a(1); >a(1) : any >a : { (x?: number): any; foo(x?: number): any; } ->1 : number +>1 : 1 a.foo(); >a.foo() : any @@ -142,7 +142,7 @@ a.foo(1); >a.foo : (x?: number) => any >a : { (x?: number): any; foo(x?: number): any; } >foo : (x?: number) => any ->1 : number +>1 : 1 var b = { >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } @@ -176,22 +176,22 @@ b.foo(1); >b.foo : (x?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >foo : (x?: number) => void ->1 : number +>1 : 1 b.a(1); >b.a(1) : void >b.a : (x: number, y?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >a : (x: number, y?: number) => void ->1 : number +>1 : 1 b.a(1, 2); >b.a(1, 2) : void >b.a : (x: number, y?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >a : (x: number, y?: number) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 b.b(); >b.b() : void @@ -204,5 +204,5 @@ b.b(1); >b.b : (x?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >b : (x?: number) => void ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types index f726840752eb5..c800a62d09650 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types @@ -12,7 +12,7 @@ function foo(x?: number) { } foo(1); >foo(1) : any >foo : (x?: number) => any ->1 : number +>1 : 1 foo(); >foo() : any @@ -35,13 +35,13 @@ function foo2(x: number, y?: number) { } foo2(1); >foo2(1) : any >foo2 : { (x: number): any; (x: number, y?: number): any; } ->1 : number +>1 : 1 foo2(1, 2); >foo2(1, 2) : any >foo2 : { (x: number): any; (x: number, y?: number): any; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 class C { >C : C @@ -84,22 +84,22 @@ c.foo(1); >c.foo : (x?: number) => any >c : C >foo : (x?: number) => any ->1 : number +>1 : 1 c.foo2(1); >c.foo2(1) : any >c.foo2 : { (x: number): any; (x: number, y?: number): any; } >c : C >foo2 : { (x: number): any; (x: number, y?: number): any; } ->1 : number +>1 : 1 c.foo2(1, 2); >c.foo2(1, 2) : any >c.foo2 : { (x: number): any; (x: number, y?: number): any; } >c : C >foo2 : { (x: number): any; (x: number, y?: number): any; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 interface I { >I : I @@ -134,37 +134,37 @@ i(); i(1); >i(1) : any >i : I ->1 : number +>1 : 1 i(1, 2); >i(1, 2) : any >i : I ->1 : number ->2 : number +>1 : 1 +>2 : 2 i.foo(1); >i.foo(1) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number +>1 : 1 i.foo(1, 2); >i.foo(1, 2) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 i.foo(1, 2, 3); >i.foo(1, 2, 3) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var a: { >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } @@ -195,35 +195,35 @@ a(); a(1); >a(1) : any >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } ->1 : number +>1 : 1 a(1, 2); >a(1, 2) : any >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 a.foo(1); >a.foo(1) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number +>1 : 1 a.foo(1, 2); >a.foo(1, 2) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 a.foo(1, 2, 3); >a.foo(1, 2, 3) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 diff --git a/tests/baselines/reference/callWithSpread.types b/tests/baselines/reference/callWithSpread.types index bc120dc4043bc..c9403f1bb69d4 100644 --- a/tests/baselines/reference/callWithSpread.types +++ b/tests/baselines/reference/callWithSpread.types @@ -33,43 +33,43 @@ var xa: X[]; foo(1, 2, "abc"); >foo(1, 2, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" foo(1, 2, ...a); >foo(1, 2, ...a) : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] foo(1, 2, ...a, "abc"); >foo(1, 2, ...a, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" obj.foo(1, 2, "abc"); >obj.foo(1, 2, "abc") : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" obj.foo(1, 2, ...a); >obj.foo(1, 2, ...a) : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -78,11 +78,11 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" (obj.foo)(1, 2, "abc"); >(obj.foo)(1, 2, "abc") : any @@ -90,9 +90,9 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" (obj.foo)(1, 2, ...a); >(obj.foo)(1, 2, ...a) : any @@ -100,8 +100,8 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -111,32 +111,32 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" xa[1].foo(1, 2, "abc"); >xa[1].foo(1, 2, "abc") : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" xa[1].foo(1, 2, ...a); >xa[1].foo(1, 2, ...a) : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -145,13 +145,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" (xa[1].foo)(...[1, 2, "abc"]); >(xa[1].foo)(...[1, 2, "abc"]) : any @@ -161,13 +161,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any >...[1, 2, "abc"] : string | number >[1, 2, "abc"] : (string | number)[] ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" class C { >C : C @@ -211,14 +211,14 @@ class D extends C { super(1, 2); >super(1, 2) : void >super : typeof C ->1 : number ->2 : number +>1 : 1 +>2 : 2 super(1, 2, ...a); >super(1, 2, ...a) : void >super : typeof C ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] } @@ -230,16 +230,16 @@ class D extends C { >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 super.foo(1, 2, ...a); >super.foo(1, 2, ...a) : void >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] } diff --git a/tests/baselines/reference/callWithSpreadES6.types b/tests/baselines/reference/callWithSpreadES6.types index 99fe1330df9aa..b25b8dc02b543 100644 --- a/tests/baselines/reference/callWithSpreadES6.types +++ b/tests/baselines/reference/callWithSpreadES6.types @@ -34,43 +34,43 @@ var xa: X[]; foo(1, 2, "abc"); >foo(1, 2, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" foo(1, 2, ...a); >foo(1, 2, ...a) : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] foo(1, 2, ...a, "abc"); >foo(1, 2, ...a, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" obj.foo(1, 2, "abc"); >obj.foo(1, 2, "abc") : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" obj.foo(1, 2, ...a); >obj.foo(1, 2, ...a) : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -79,11 +79,11 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" (obj.foo)(1, 2, "abc"); >(obj.foo)(1, 2, "abc") : any @@ -91,9 +91,9 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" (obj.foo)(1, 2, ...a); >(obj.foo)(1, 2, ...a) : any @@ -101,8 +101,8 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -112,32 +112,32 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" xa[1].foo(1, 2, "abc"); >xa[1].foo(1, 2, "abc") : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" xa[1].foo(1, 2, ...a); >xa[1].foo(1, 2, ...a) : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -146,13 +146,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" (xa[1].foo)(...[1, 2, "abc"]); >(xa[1].foo)(...[1, 2, "abc"]) : any @@ -162,13 +162,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any >...[1, 2, "abc"] : string | number >[1, 2, "abc"] : (string | number)[] ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" class C { >C : C @@ -212,14 +212,14 @@ class D extends C { super(1, 2); >super(1, 2) : void >super : typeof C ->1 : number ->2 : number +>1 : 1 +>2 : 2 super(1, 2, ...a); >super(1, 2, ...a) : void >super : typeof C ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] } @@ -231,16 +231,16 @@ class D extends C { >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 super.foo(1, 2, ...a); >super.foo(1, 2, ...a) : void >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] } diff --git a/tests/baselines/reference/capturedLetConstInLoop1.errors.txt b/tests/baselines/reference/capturedLetConstInLoop1.errors.txt new file mode 100644 index 0000000000000..a10b380bcf9a4 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop1.errors.txt @@ -0,0 +1,128 @@ +tests/cases/compiler/capturedLetConstInLoop1.ts(69,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1.ts(86,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1.ts(92,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1.ts(109,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop1.ts (4 errors) ==== + //==== let + for (let x in {}) { + (function() { return x}); + (() => x); + } + + for (let x of []) { + (function() { return x}); + (() => x); + } + + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + } + + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + } + + do { + let x; + (function() { return x}); + (() => x); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + } + + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + } + + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + } + + do { + let x, y; + (function() { return x + y}); + (() => x + y); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + } + + //=========const + for (const x in {}) { + (function() { return x}); + (() => x); + } + + for (const x of []) { + (function() { return x}); + (() => x); + } + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + } + + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + } + + do { + const x = 1; + (function() { return x}); + (() => x); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + } + + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + } + + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop10.types b/tests/baselines/reference/capturedLetConstInLoop10.types index e4bca4d906a17..19f328f72bd8a 100644 --- a/tests/baselines/reference/capturedLetConstInLoop10.types +++ b/tests/baselines/reference/capturedLetConstInLoop10.types @@ -8,7 +8,7 @@ class A { for (let x of [0]) { >x : number >[0] : number[] ->0 : number +>0 : 0 let f = function() { return x; }; >f : () => number @@ -35,7 +35,7 @@ class A { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 let a = function() { return x; }; >a : () => number @@ -45,7 +45,7 @@ class A { for (let y of [1]) { >y : number >[1] : number[] ->1 : number +>1 : 1 let b = function() { return y; }; >b : () => number @@ -75,7 +75,7 @@ class A { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 let a = function() { return x; }; >a : () => number @@ -93,7 +93,7 @@ class A { for (let y of [1]) { >y : number >[1] : number[] ->1 : number +>1 : 1 let b = function() { return y; }; >b : () => number @@ -127,7 +127,7 @@ class B { for (let x of [0]) { >x : number >[0] : number[] ->0 : number +>0 : 0 let f = () => x; >f : () => number diff --git a/tests/baselines/reference/capturedLetConstInLoop10_ES6.types b/tests/baselines/reference/capturedLetConstInLoop10_ES6.types index 068c124582d54..9807d60a1cd8b 100644 --- a/tests/baselines/reference/capturedLetConstInLoop10_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop10_ES6.types @@ -8,7 +8,7 @@ class A { for (let x of [0]) { >x : number >[0] : number[] ->0 : number +>0 : 0 let f = function() { return x; }; >f : () => number @@ -35,7 +35,7 @@ class A { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 let a = function() { return x; }; >a : () => number @@ -45,7 +45,7 @@ class A { for (let y of [1]) { >y : number >[1] : number[] ->1 : number +>1 : 1 let b = function() { return y; }; >b : () => number @@ -75,7 +75,7 @@ class A { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 let a = function() { return x; }; >a : () => number @@ -93,7 +93,7 @@ class A { for (let y of [1]) { >y : number >[1] : number[] ->1 : number +>1 : 1 let b = function() { return y; }; >b : () => number @@ -127,7 +127,7 @@ class B { for (let x of [0]) { >x : number >[0] : number[] ->0 : number +>0 : 0 let f = () => x; >f : () => number diff --git a/tests/baselines/reference/capturedLetConstInLoop11.types b/tests/baselines/reference/capturedLetConstInLoop11.types index 09fad9f202308..e150744627d2f 100644 --- a/tests/baselines/reference/capturedLetConstInLoop11.types +++ b/tests/baselines/reference/capturedLetConstInLoop11.types @@ -2,7 +2,7 @@ for (;;) { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -14,16 +14,16 @@ function foo() { for (;;) { const a = 0; ->a : number ->0 : number +>a : 0 +>0 : 0 switch(a) { ->a : number +>a : 0 case 0: return () => a; >0 : 0 >() => a : () => number ->a : number +>a : 0 } } } diff --git a/tests/baselines/reference/capturedLetConstInLoop11_ES6.types b/tests/baselines/reference/capturedLetConstInLoop11_ES6.types index d6fd971202c54..883be74b66d72 100644 --- a/tests/baselines/reference/capturedLetConstInLoop11_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop11_ES6.types @@ -2,7 +2,7 @@ for (;;) { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -14,16 +14,16 @@ function foo() { for (;;) { const a = 0; ->a : number ->0 : number +>a : 0 +>0 : 0 switch(a) { ->a : number +>a : 0 case 0: return () => a; >0 : 0 >() => a : () => number ->a : number +>a : 0 } } } diff --git a/tests/baselines/reference/capturedLetConstInLoop12.types b/tests/baselines/reference/capturedLetConstInLoop12.types index aee671b4d36ae..1e8877fe53ad0 100644 --- a/tests/baselines/reference/capturedLetConstInLoop12.types +++ b/tests/baselines/reference/capturedLetConstInLoop12.types @@ -5,14 +5,14 @@ >function() { "use strict"; for (let i = 0; i < 4; i++) { (() => [i] = [i + 1])(); }} : () => void "use strict"; ->"use strict" : string +>"use strict" : "use strict" for (let i = 0; i < 4; i++) { >i : number ->0 : number +>0 : 0 >i < 4 : boolean >i : number ->4 : number +>4 : 4 >i++ : number >i : number @@ -26,7 +26,7 @@ >[i + 1] : [number] >i + 1 : number >i : number ->1 : number +>1 : 1 } })(); @@ -36,14 +36,14 @@ >function() { "use strict"; for (let i = 0; i < 4; i++) { (() => ({a:i} = {a:i + 1}))(); }} : () => void "use strict"; ->"use strict" : string +>"use strict" : "use strict" for (let i = 0; i < 4; i++) { >i : number ->0 : number +>0 : 0 >i < 4 : boolean >i : number ->4 : number +>4 : 4 >i++ : number >i : number @@ -60,6 +60,6 @@ >a : number >i + 1 : number >i : number ->1 : number +>1 : 1 } })(); diff --git a/tests/baselines/reference/capturedLetConstInLoop1_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop1_ES6.errors.txt new file mode 100644 index 0000000000000..24c5ddf17b617 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop1_ES6.errors.txt @@ -0,0 +1,128 @@ +tests/cases/compiler/capturedLetConstInLoop1_ES6.ts(69,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1_ES6.ts(86,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1_ES6.ts(92,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1_ES6.ts(109,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop1_ES6.ts (4 errors) ==== + //==== let + for (let x in {}) { + (function() { return x}); + (() => x); + } + + for (let x of []) { + (function() { return x}); + (() => x); + } + + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + } + + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + } + + do { + let x; + (function() { return x}); + (() => x); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + } + + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + } + + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + } + + do { + let x, y; + (function() { return x + y}); + (() => x + y); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + } + + //=========const + for (const x in {}) { + (function() { return x}); + (() => x); + } + + for (const x of []) { + (function() { return x}); + (() => x); + } + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + } + + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + } + + do { + const x = 1; + (function() { return x}); + (() => x); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + } + + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + } + + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop2.errors.txt b/tests/baselines/reference/capturedLetConstInLoop2.errors.txt new file mode 100644 index 0000000000000..9125a87ecfe9b --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop2.errors.txt @@ -0,0 +1,191 @@ +tests/cases/compiler/capturedLetConstInLoop2.ts(108,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2.ts(133,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2.ts(142,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2.ts(170,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop2.ts (4 errors) ==== + + + // ========let + function foo0(x) { + for (let x of []) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo0_1(x) { + for (let x in []) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo2(x) { + while (1 === 1) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo3(x) { + do { + let x; + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } while (1 === 1) + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + let a = arguments.length; + let x = 1; + (function() { return x + a }); + (() => x + a); + } + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + function foo7(x) { + do { + let x, y; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } while (1 === 1) + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + ///=======const + function foo0_c(x) { + for (const x of []) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo0_1_c(x) { + for (const x in []) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo2_c(x) { + while (1 === 1) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo3_c(x) { + do { + const x = 1; + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } while (1 === 1) + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + const x = 1; + (function() { return x + a }); + (() => x + a); + } + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y =1 ; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } while (1 === 1) + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop2_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop2_ES6.errors.txt new file mode 100644 index 0000000000000..d61bf3619c732 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop2_ES6.errors.txt @@ -0,0 +1,190 @@ +tests/cases/compiler/capturedLetConstInLoop2_ES6.ts(107,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2_ES6.ts(132,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2_ES6.ts(141,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2_ES6.ts(169,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop2_ES6.ts (4 errors) ==== + + // ========let + function foo0(x) { + for (let x of []) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo0_1(x) { + for (let x in []) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo2(x) { + while (1 === 1) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo3(x) { + do { + let x; + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } while (1 === 1) + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + let a = arguments.length; + let x = 1; + (function() { return x + a }); + (() => x + a); + } + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + function foo7(x) { + do { + let x, y; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } while (1 === 1) + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + ///=======const + function foo0_c(x) { + for (const x of []) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo0_1_c(x) { + for (const x in []) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo2_c(x) { + while (1 === 1) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo3_c(x) { + do { + const x = 1; + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } while (1 === 1) + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + const x = 1; + (function() { return x + a }); + (() => x + a); + } + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y =1 ; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } while (1 === 1) + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop3.errors.txt b/tests/baselines/reference/capturedLetConstInLoop3.errors.txt new file mode 100644 index 0000000000000..ecc9dbcccc5a5 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop3.errors.txt @@ -0,0 +1,232 @@ +tests/cases/compiler/capturedLetConstInLoop3.ts(132,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3.ts(164,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3.ts(175,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3.ts(209,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop3.ts (4 errors) ==== + ///=========let + declare function use(a: any); + function foo0(x) { + for (let x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo0_1(x) { + for (let x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo2(x) { + while (1 === 1) { + let x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo3(x) { + do { + let x; + var v; + (function() { return x + v }); + (() => x + v); + } while (1 === 1); + + use(v); + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v) + } + + function foo7(x) { + do { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } while (1 === 1); + + use(v); + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + //===const + function foo0_c(x) { + for (const x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo0_1_c(x) { + for (const x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo2_c(x) { + while (1 === 1) { + const x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo3_c(x) { + do { + const x = 1; + var v; + (function() { return x + v }); + (() => x + v); + } while (1 === 1); + + use(v); + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = y; + const x = 1; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v) + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } while (1 === 1); + + use(v); + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop3_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop3_ES6.errors.txt new file mode 100644 index 0000000000000..487c47e32a5c6 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop3_ES6.errors.txt @@ -0,0 +1,233 @@ +tests/cases/compiler/capturedLetConstInLoop3_ES6.ts(133,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3_ES6.ts(165,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3_ES6.ts(176,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3_ES6.ts(210,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop3_ES6.ts (4 errors) ==== + + ///=========let + declare function use(a: any); + function foo0(x) { + for (let x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo0_1(x) { + for (let x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo2(x) { + while (1 === 1) { + let x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo3(x) { + do { + let x; + var v; + (function() { return x + v }); + (() => x + v); + } while (1 === 1); + + use(v); + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v) + } + + function foo7(x) { + do { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } while (1 === 1); + + use(v); + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + //===const + function foo0_c(x) { + for (const x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo0_1_c(x) { + for (const x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo2_c(x) { + while (1 === 1) { + const x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo3_c(x) { + do { + const x = 1; + var v; + (function() { return x + v }); + (() => x + v); + } while (1 === 1); + + use(v); + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = y; + const x = 1; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v) + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } while (1 === 1); + + use(v); + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop4.errors.txt b/tests/baselines/reference/capturedLetConstInLoop4.errors.txt new file mode 100644 index 0000000000000..000286537b8e5 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop4.errors.txt @@ -0,0 +1,158 @@ +tests/cases/compiler/capturedLetConstInLoop4.ts(90,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4.ts(110,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4.ts(117,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4.ts(137,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop4.ts (4 errors) ==== + + //======let + export function exportedFoo() { + return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8; + } + + for (let x of []) { + var v0 = x; + (function() { return x + v0}); + (() => x); + } + + for (let x in []) { + var v00 = x; + (function() { return x + v00}); + (() => x); + } + + for (let x = 0; x < 1; ++x) { + var v1 = x; + (function() { return x + v1}); + (() => x); + } + + while (1 === 1) { + let x; + var v2 = x; + (function() { return x + v2}); + (() => x); + } + + do { + let x; + var v3 = x; + (function() { return x + v3}); + (() => x); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + var v4 = x; + (function() { return x + v4}); + (() => x); + } + + for (let x = 0, y = 1; x < 1; ++x) { + var v5 = x; + (function() { return x + y + v5}); + (() => x + y); + } + + while (1 === 1) { + let x, y; + var v6 = x; + (function() { return x + y + v6}); + (() => x + y); + } + + do { + let x, y; + var v7 = x; + (function() { return x + y + v7}); + (() => x + y); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + var v8 = x; + (function() { return x + y + v8}); + (() => x + y); + } + + //======const + export function exportedFoo2() { + return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c; + } + + for (const x of []) { + var v0_c = x; + (function() { return x + v0_c}); + (() => x); + } + + for (const x in []) { + var v00_c = x; + (function() { return x + v00}); + (() => x); + } + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v1_c = x; + (function() { return x + v1_c}); + (() => x); + } + + while (1 === 1) { + const x =1; + var v2_c = x; + (function() { return x + v2_c}); + (() => x); + } + + do { + const x = 1; + var v3_c = x; + (function() { return x + v3_c}); + (() => x); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v4_c = x; + (function() { return x + v4_c}); + (() => x); + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v5_c = x; + (function() { return x + y + v5_c}); + (() => x + y); + } + + while (1 === 1) { + const x = 1, y = 1; + var v6_c = x; + (function() { return x + y + v6_c}); + (() => x + y); + } + + do { + const x = 1, y = 1; + var v7_c = x; + (function() { return x + y + v7_c}); + (() => x + y); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v8_c = x; + (function() { return x + y + v8_c}); + (() => x + y); + } + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop4_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop4_ES6.errors.txt new file mode 100644 index 0000000000000..a83bb1d414f24 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop4_ES6.errors.txt @@ -0,0 +1,158 @@ +tests/cases/compiler/capturedLetConstInLoop4_ES6.ts(90,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4_ES6.ts(110,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4_ES6.ts(117,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4_ES6.ts(137,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop4_ES6.ts (4 errors) ==== + + //======let + export function exportedFoo() { + return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8; + } + + for (let x of []) { + var v0 = x; + (function() { return x + v0}); + (() => x); + } + + for (let x in []) { + var v00 = x; + (function() { return x + v00}); + (() => x); + } + + for (let x = 0; x < 1; ++x) { + var v1 = x; + (function() { return x + v1}); + (() => x); + } + + while (1 === 1) { + let x; + var v2 = x; + (function() { return x + v2}); + (() => x); + } + + do { + let x; + var v3 = x; + (function() { return x + v3}); + (() => x); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + var v4 = x; + (function() { return x + v4}); + (() => x); + } + + for (let x = 0, y = 1; x < 1; ++x) { + var v5 = x; + (function() { return x + y + v5}); + (() => x + y); + } + + while (1 === 1) { + let x, y; + var v6 = x; + (function() { return x + y + v6}); + (() => x + y); + } + + do { + let x, y; + var v7 = x; + (function() { return x + y + v7}); + (() => x + y); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + var v8 = x; + (function() { return x + y + v8}); + (() => x + y); + } + + //======const + export function exportedFoo2() { + return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c; + } + + for (const x of []) { + var v0_c = x; + (function() { return x + v0_c}); + (() => x); + } + + for (const x in []) { + var v00_c = x; + (function() { return x + v00}); + (() => x); + } + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v1_c = x; + (function() { return x + v1_c}); + (() => x); + } + + while (1 === 1) { + const x =1; + var v2_c = x; + (function() { return x + v2_c}); + (() => x); + } + + do { + const x = 1; + var v3_c = x; + (function() { return x + v3_c}); + (() => x); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v4_c = x; + (function() { return x + v4_c}); + (() => x); + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v5_c = x; + (function() { return x + y + v5_c}); + (() => x + y); + } + + while (1 === 1) { + const x = 1, y = 1; + var v6_c = x; + (function() { return x + y + v6_c}); + (() => x + y); + } + + do { + const x = 1, y = 1; + var v7_c = x; + (function() { return x + y + v7_c}); + (() => x + y); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v8_c = x; + (function() { return x + y + v8_c}); + (() => x + y); + } + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop5.errors.txt b/tests/baselines/reference/capturedLetConstInLoop5.errors.txt new file mode 100644 index 0000000000000..b182d8347de46 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop5.errors.txt @@ -0,0 +1,300 @@ +tests/cases/compiler/capturedLetConstInLoop5.ts(170,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5.ts(174,13): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5.ts(211,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5.ts(225,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5.ts(229,13): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5.ts(268,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop5.ts (6 errors) ==== + declare function use(a: any); + + //====let + function foo0(x) { + for (let x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo00(x) { + for (let x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == "1") { + return; + } + } + + use(v); + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo2(x) { + while (1 === 1) { + let x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo3(x) { + do { + let x; + var v; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + }; + + use(v) + } + + function foo7(x) { + do { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } while (1 === 1); + + use(v); + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } + + //====const + function foo0_c(x) { + for (const x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo00_c(x) { + for (const x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == "1") { + return; + } + } + + use(v); + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + return; + } + } + + use(v); + } + + function foo2_c(x) { + while (1 === 1) { + const x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo3_c(x) { + do { + const x = 1; + var v; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + return; + } + } + + use(v); + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v) + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop5_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop5_ES6.errors.txt new file mode 100644 index 0000000000000..05eb0626e2d6a --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop5_ES6.errors.txt @@ -0,0 +1,301 @@ +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(171,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(175,13): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(212,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(226,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(230,13): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(269,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop5_ES6.ts (6 errors) ==== + + declare function use(a: any); + + //====let + function foo0(x) { + for (let x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo00(x) { + for (let x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == "1") { + return; + } + } + + use(v); + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo2(x) { + while (1 === 1) { + let x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo3(x) { + do { + let x; + var v; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + }; + + use(v) + } + + function foo7(x) { + do { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } while (1 === 1); + + use(v); + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } + + //====const + function foo0_c(x) { + for (const x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo00_c(x) { + for (const x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == "1") { + return; + } + } + + use(v); + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + return; + } + } + + use(v); + } + + function foo2_c(x) { + while (1 === 1) { + const x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo3_c(x) { + do { + const x = 1; + var v; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + return; + } + } + + use(v); + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v) + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop6.errors.txt new file mode 100644 index 0000000000000..c332c5b732390 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop6.errors.txt @@ -0,0 +1,265 @@ +tests/cases/compiler/capturedLetConstInLoop6.ts(144,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6.ts(147,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6.ts(150,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop6.ts(179,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6.ts(191,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6.ts(194,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6.ts(197,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop6.ts(226,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop6.ts (8 errors) ==== + // ====let + for (let x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (let x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "2") { + continue; + } + } + + + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + // ====const + + for (const x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (const x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "2") { + continue; + } + } + + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + } + + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + } + + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop6_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop6_ES6.errors.txt new file mode 100644 index 0000000000000..18ecfe7c66624 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop6_ES6.errors.txt @@ -0,0 +1,265 @@ +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(144,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(147,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(150,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(179,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(191,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(194,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(197,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(226,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop6_ES6.ts (8 errors) ==== + // ====let + for (let x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (let x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "2") { + continue; + } + } + + + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + // ====const + + for (const x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (const x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "2") { + continue; + } + } + + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + } + + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + } + + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop7.errors.txt b/tests/baselines/reference/capturedLetConstInLoop7.errors.txt new file mode 100644 index 0000000000000..29e6fbca6cd2a --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop7.errors.txt @@ -0,0 +1,414 @@ +tests/cases/compiler/capturedLetConstInLoop7.ts(227,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(230,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(233,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(236,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7.ts(239,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7.ts(283,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(302,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(305,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(308,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(311,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7.ts(314,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7.ts(359,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop7.ts (12 errors) ==== + //===let + l0: + for (let x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l0; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l0; + } + } + + l00: + for (let x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "1") { + break l00; + } + if (x == "2") { + continue; + } + if (x == "2") { + continue l00; + } + } + + l1: + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l1; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + } + + l2: + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l2; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l2; + } + } + + l3: + do { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l3; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l3; + } + } while (1 === 1) + + l4: + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l4; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l4; + } + } + + l5: + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l5; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l5; + } + } + + l6: + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l6; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l6; + } + + } + + l7: + do { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l7; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l7; + } + } while (1 === 1) + + l8: + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l8; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l8; + } + } + + //===const + l0_c: + for (const x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l0_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l0_c; + } + } + + l00_c: + for (const x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "1") { + break l00_c; + } + if (x == "2") { + continue; + } + if (x == "2") { + continue l00_c; + } + } + + l1_c: + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1_c; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1_c; + } + } + + l2_c: + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l2_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l2_c; + } + } + + l3_c: + do { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l3_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l3_c; + } + } while (1 === 1) + + l4_c: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l4_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l4_c; + } + } + + l5_c: + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l5_c; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l5_c; + } + } + + l6_c: + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l6_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l6_c; + } + + } + + l7_c: + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l7_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l7_c; + } + } while (1 === 1) + + l8_c: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l8_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l8_c; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop7_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop7_ES6.errors.txt new file mode 100644 index 0000000000000..a2001dc09b39c --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop7_ES6.errors.txt @@ -0,0 +1,414 @@ +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(227,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(230,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(233,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(236,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(239,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(283,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(302,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(305,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(308,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(311,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(314,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(359,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop7_ES6.ts (12 errors) ==== + //===let + l0: + for (let x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l0; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l0; + } + } + + l00: + for (let x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "1") { + break l00; + } + if (x == "2") { + continue; + } + if (x == "2") { + continue l00; + } + } + + l1: + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l1; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + } + + l2: + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l2; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l2; + } + } + + l3: + do { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l3; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l3; + } + } while (1 === 1) + + l4: + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l4; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l4; + } + } + + l5: + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l5; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l5; + } + } + + l6: + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l6; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l6; + } + + } + + l7: + do { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l7; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l7; + } + } while (1 === 1) + + l8: + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l8; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l8; + } + } + + //===const + l0_c: + for (const x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l0_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l0_c; + } + } + + l00_c: + for (const x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "1") { + break l00_c; + } + if (x == "2") { + continue; + } + if (x == "2") { + continue l00_c; + } + } + + l1_c: + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1_c; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1_c; + } + } + + l2_c: + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l2_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l2_c; + } + } + + l3_c: + do { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l3_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l3_c; + } + } while (1 === 1) + + l4_c: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l4_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l4_c; + } + } + + l5_c: + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l5_c; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l5_c; + } + } + + l6_c: + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l6_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l6_c; + } + + } + + l7_c: + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l7_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l7_c; + } + } while (1 === 1) + + l8_c: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l8_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l8_c; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop8.errors.txt b/tests/baselines/reference/capturedLetConstInLoop8.errors.txt new file mode 100644 index 0000000000000..c3743feaf90c6 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop8.errors.txt @@ -0,0 +1,186 @@ +tests/cases/compiler/capturedLetConstInLoop8.ts(66,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(68,27): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(70,31): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(73,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(76,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(79,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(82,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(86,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(89,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(92,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(95,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(98,21): error TS2365: Operator '==' cannot be applied to types '0' and '3'. +tests/cases/compiler/capturedLetConstInLoop8.ts(102,17): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(105,17): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(108,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(111,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(114,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(117,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(120,17): error TS2365: Operator '==' cannot be applied to types '0' and '3'. + + +==== tests/cases/compiler/capturedLetConstInLoop8.ts (19 errors) ==== + function foo() { + l0: + for (let z = 0; z < 1; ++z) { + l1: + for (let x = 0; x < 1; ++x) { + ll1: + for (let y = 0; y < 1; ++y) { + (function() { return x + y }); + (() => x + y); + if (y == 1) { + break; + } + if (y == 1) { + break l1; + } + if (y == 1) { + break ll1; + } + if (y == 1) { + continue l0; + } + + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + if (x == 2) { + continue ll1; + } + if (x == 2) { + return "123" + } + if (x == 3) { + return; + } + } + if (x == 1) { + break; + } + if (x == 1) { + break l1; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + if (x == 2) { + continue l0; + } + if (x == 2) { + return "456"; + } + if (x == 3) { + return; + } + } + } + } + + function foo_c() { + l0: + for (const z = 0; z < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + l1: + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + ll1: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y }); + (() => x + y); + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break ll1; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + continue l0; + } + + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue ll1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + return "123" + } + if (x == 3) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '3'. + return; + } + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l0; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + return "456"; + } + if (x == 3) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '3'. + return; + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop8_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop8_ES6.errors.txt new file mode 100644 index 0000000000000..da6947884fa17 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop8_ES6.errors.txt @@ -0,0 +1,186 @@ +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(66,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(68,27): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(70,31): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(73,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(76,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(79,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(82,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(86,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(89,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(92,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(95,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(98,21): error TS2365: Operator '==' cannot be applied to types '0' and '3'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(102,17): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(105,17): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(108,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(111,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(114,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(117,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(120,17): error TS2365: Operator '==' cannot be applied to types '0' and '3'. + + +==== tests/cases/compiler/capturedLetConstInLoop8_ES6.ts (19 errors) ==== + function foo() { + l0: + for (let z = 0; z < 1; ++z) { + l1: + for (let x = 0; x < 1; ++x) { + ll1: + for (let y = 0; y < 1; ++y) { + (function() { return x + y }); + (() => x + y); + if (y == 1) { + break; + } + if (y == 1) { + break l1; + } + if (y == 1) { + break ll1; + } + if (y == 1) { + continue l0; + } + + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + if (x == 2) { + continue ll1; + } + if (x == 2) { + return "123" + } + if (x == 3) { + return; + } + } + if (x == 1) { + break; + } + if (x == 1) { + break l1; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + if (x == 2) { + continue l0; + } + if (x == 2) { + return "456"; + } + if (x == 3) { + return; + } + } + } + } + + function foo_c() { + l0: + for (const z = 0; z < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + l1: + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + ll1: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y }); + (() => x + y); + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break ll1; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + continue l0; + } + + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue ll1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + return "123" + } + if (x == 3) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '3'. + return; + } + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l0; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + return "456"; + } + if (x == 3) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '3'. + return; + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop9.types b/tests/baselines/reference/capturedLetConstInLoop9.types index 9f1bab2014871..486697b8d8409 100644 --- a/tests/baselines/reference/capturedLetConstInLoop9.types +++ b/tests/baselines/reference/capturedLetConstInLoop9.types @@ -1,10 +1,10 @@ === tests/cases/compiler/capturedLetConstInLoop9.ts === for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -78,7 +78,7 @@ for (let x = 0; x < 1; ++x) { return x + 1; >x + 1 : any >x : any ->1 : number +>1 : 1 } } } @@ -88,7 +88,7 @@ declare function use(a: any); >a : any function foo() { ->foo : () => number +>foo : () => 50 | 100 l0: >l0 : any @@ -125,9 +125,9 @@ function foo() { >[{x:1, y:2}] : [{ x: number; y: number; }] >{x:1, y:2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 if (b === 1) { >b === 1 : boolean @@ -160,7 +160,7 @@ function foo() { } return 50; ->50 : number +>50 : 50 } for (let b of []) { @@ -174,7 +174,7 @@ function foo() { >[{x1:1, y:arguments.length}] : [{ x1: number; y: number; }] >{x1:1, y:arguments.length} : { x1: number; y: number; } >x1 : number ->1 : number +>1 : 1 >y : number >arguments.length : number >arguments : IArguments @@ -202,7 +202,7 @@ function foo() { >b : any return 100; ->100 : number +>100 : 100 } @@ -307,10 +307,10 @@ class C { for (let i = 0; i < 100; i++) { >i : number ->0 : number +>0 : 0 >i < 100 : boolean >i : number ->100 : number +>100 : 100 >i++ : number >i : number diff --git a/tests/baselines/reference/capturedLetConstInLoop9_ES6.types b/tests/baselines/reference/capturedLetConstInLoop9_ES6.types index 8a4adafe34069..be4457315eeeb 100644 --- a/tests/baselines/reference/capturedLetConstInLoop9_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop9_ES6.types @@ -2,10 +2,10 @@ for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -79,7 +79,7 @@ for (let x = 0; x < 1; ++x) { return x + 1; >x + 1 : any >x : any ->1 : number +>1 : 1 } } } @@ -89,7 +89,7 @@ declare function use(a: any); >a : any function foo() { ->foo : () => number +>foo : () => 50 | 100 l0: >l0 : any @@ -126,9 +126,9 @@ function foo() { >[{x:1, y:2}] : [{ x: number; y: number; }] >{x:1, y:2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 if (b === 1) { >b === 1 : boolean @@ -161,7 +161,7 @@ function foo() { } return 50; ->50 : number +>50 : 50 } for (let b of []) { @@ -175,7 +175,7 @@ function foo() { >[{x1:1, y:arguments.length}] : [{ x1: number; y: number; }] >{x1:1, y:arguments.length} : { x1: number; y: number; } >x1 : number ->1 : number +>1 : 1 >y : number >arguments.length : number >arguments : IArguments @@ -202,7 +202,7 @@ function foo() { >b : any return 100; ->100 : number +>100 : 100 } @@ -307,10 +307,10 @@ class C { for (let i = 0; i < 100; i++) { >i : number ->0 : number +>0 : 0 >i < 100 : boolean >i : number ->100 : number +>100 : 100 >i++ : number >i : number diff --git a/tests/baselines/reference/capturedParametersInInitializers1.types b/tests/baselines/reference/capturedParametersInInitializers1.types index 493c608c145ff..9e5dee1b82e2a 100644 --- a/tests/baselines/reference/capturedParametersInInitializers1.types +++ b/tests/baselines/reference/capturedParametersInInitializers1.types @@ -7,7 +7,7 @@ function foo1(y = class {c = x}, x = 1) { >c : number >x : number >x : number ->1 : number +>1 : 1 new y().c; >new y().c : number @@ -24,7 +24,7 @@ function foo2(y = function(x: typeof z) {}, z = 1) { >x : number >z : number >z : number ->1 : number +>1 : 1 } @@ -41,6 +41,6 @@ function foo3(y = { x: a }, z = 1) { >z : number >a : any >z : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/castExpressionParentheses.types b/tests/baselines/reference/castExpressionParentheses.types index cdfbf4f7db236..dafe3377aea94 100644 --- a/tests/baselines/reference/castExpressionParentheses.types +++ b/tests/baselines/reference/castExpressionParentheses.types @@ -9,49 +9,49 @@ declare var a; >{a:0} : any >{a:0} : { a: number; } >a : number ->0 : number +>0 : 0 ([1,3,]); >([1,3,]) : any >[1,3,] : any >[1,3,] : number[] ->1 : number ->3 : number +>1 : 1 +>3 : 3 ("string"); >("string") : any >"string" : any ->"string" : string +>"string" : "string" (23.0); >(23.0) : any >23.0 : any ->23.0 : number +>23.0 : 23 (1); >(1) : any >1 : any ->1 : number +>1 : 1 (1.); >(1.) : any >1. : any ->1. : number +>1. : 1 (1.0); >(1.0) : any >1.0 : any ->1.0 : number +>1.0 : 1 (12e+34); >(12e+34) : any >12e+34 : any ->12e+34 : number +>12e+34 : 1.2e+35 (0xff); >(0xff) : any >0xff : any ->0xff : number +>0xff : 255 (/regexp/g); >(/regexp/g) : any @@ -61,12 +61,12 @@ declare var a; (false); >(false) : any >false : any ->false : boolean +>false : false (true); >(true) : any >true : any ->true : boolean +>true : true (null); >(null) : any @@ -106,7 +106,7 @@ declare var a; >a[0] : any >a[0] : any >a : any ->0 : number +>0 : 0 (a.b["0"]); >(a.b["0"]) : any @@ -115,7 +115,7 @@ declare var a; >a.b : any >a : any >b : any ->"0" : string +>"0" : "0" (a()).x; >(a()).x : any @@ -133,42 +133,42 @@ declare var A; >(1).foo : any >(1) : any >1 : any ->1 : number +>1 : 1 >foo : any (1.).foo; >(1.).foo : any >(1.) : any >1. : any ->1. : number +>1. : 1 >foo : any (1.0).foo; >(1.0).foo : any >(1.0) : any >1.0 : any ->1.0 : number +>1.0 : 1 >foo : any (12e+34).foo; >(12e+34).foo : any >(12e+34) : any >12e+34 : any ->12e+34 : number +>12e+34 : 1.2e+35 >foo : any (0xff).foo; >(0xff).foo : any >(0xff) : any >0xff : any ->0xff : number +>0xff : 255 >foo : any ((1.0)); >((1.0)) : any >(1.0) : any ->(1.0) : number ->1.0 : number +>(1.0) : 1 +>1.0 : 1 (new A).foo; >(new A).foo : any diff --git a/tests/baselines/reference/castOfAwait.types b/tests/baselines/reference/castOfAwait.types index ad3597f6c018a..30220ca2ab6fe 100644 --- a/tests/baselines/reference/castOfAwait.types +++ b/tests/baselines/reference/castOfAwait.types @@ -4,18 +4,18 @@ async function f() { await 0; > await 0 : number ->await 0 : number ->0 : number +>await 0 : 0 +>0 : 0 typeof await 0; >typeof await 0 : string ->await 0 : number ->0 : number +>await 0 : 0 +>0 : 0 void await 0; >void await 0 : undefined ->await 0 : number ->0 : number +>await 0 : 0 +>0 : 0 await void typeof void await 0; >await void typeof void await 0 : any @@ -24,12 +24,12 @@ async function f() { >typeof void await 0 : string > void await 0 : number >void await 0 : undefined ->await 0 : number ->0 : number +>await 0 : 0 +>0 : 0 await await 0; ->await await 0 : number ->await 0 : number ->0 : number +>await await 0 : 0 +>await 0 : 0 +>0 : 0 } diff --git a/tests/baselines/reference/castTest.types b/tests/baselines/reference/castTest.types index 03e119d17eda0..666b2ccf78e05 100644 --- a/tests/baselines/reference/castTest.types +++ b/tests/baselines/reference/castTest.types @@ -2,7 +2,7 @@ var x : any = 0; >x : any ->0 : number +>0 : 0 var z = x; >z : number @@ -18,7 +18,7 @@ var y = x + z; var a = 0; >a : any >0 : any ->0 : number +>0 : 0 var b = true; >b : boolean @@ -28,7 +28,7 @@ var b = true; var s = ""; >s : string >"" : string ->"" : string +>"" : "" var ar = null; >ar : any[] @@ -76,11 +76,11 @@ var p_cast = ({ x: 0, >x : number ->0 : number +>0 : 0 y: 0, >y : number ->0 : number +>0 : 0 add: function(dx, dy) { >add : (dx: number, dy: number) => Point diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt index 8f5924586df49..56f4cad5a47bd 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt @@ -2,9 +2,9 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete Type 'T' is not assignable to type 'S'. tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(10,29): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. Type 'T' is not assignable to type 'S'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts (5 errors) ==== @@ -47,16 +47,16 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete // Should get an error that we are assigning a string to a number (new Chain2(i)).then(ii => t).then(tt => s).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. // Staying at T or S should keep the constraint. // Get an error when we assign a string to a number in both cases (new Chain2(i)).then(ii => t).then(tt => t).then(tt => t).then(tt => t).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (new Chain2(i)).then(ii => s).then(ss => s).then(ss => s).then(ss => s).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. return null; } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.types b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.types index d734b0c6ad091..85a1af6fbdcf6 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.types +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.types @@ -18,11 +18,11 @@ class Derived extends Based { >this : this this.x = 10; ->this.x = 10 : number +>this.x = 10 : 10 >this.x : number >this : this >x : number ->10 : number +>10 : 10 var that = this; >that : this diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types index a26ca2a6d7972..60179ec27bf12 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types @@ -30,11 +30,11 @@ class Derived extends Based { >super : typeof Based this.x = 10; ->this.x = 10 : number +>this.x = 10 : 10 >this.x : number >this : this >x : number ->10 : number +>10 : 10 var that = this; >that : this diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.types b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.types index f42a0ac8563ba..b2bf4824721bd 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.types +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.types @@ -43,11 +43,11 @@ class Derived extends Based { >super : typeof Based this.x = 10; ->this.x = 10 : number +>this.x = 10 : 10 >this.x : number >this : this >x : number ->10 : number +>10 : 10 var that = this; >that : this diff --git a/tests/baselines/reference/circularObjectLiteralAccessors.types b/tests/baselines/reference/circularObjectLiteralAccessors.types index 1f01432db5a24..e190ea5e6d3f1 100644 --- a/tests/baselines/reference/circularObjectLiteralAccessors.types +++ b/tests/baselines/reference/circularObjectLiteralAccessors.types @@ -33,6 +33,6 @@ const a = { }, foo: '' >foo : string ->'' : string +>'' : "" }; diff --git a/tests/baselines/reference/classAbstractAsIdentifier.types b/tests/baselines/reference/classAbstractAsIdentifier.types index e2894af804d23..63f15dc4a4cd0 100644 --- a/tests/baselines/reference/classAbstractAsIdentifier.types +++ b/tests/baselines/reference/classAbstractAsIdentifier.types @@ -4,7 +4,7 @@ class abstract { foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } new abstract; diff --git a/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt b/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt index c6c242396d8d8..fbcc597409a21 100644 --- a/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt +++ b/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(7,1): error TS2322: Type 'typeof A' is not assignable to type 'new () => A'. Cannot assign an abstract constructor type to a non-abstract constructor type. -tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(8,1): error TS2322: Type 'string' is not assignable to type 'new () => A'. +tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(8,1): error TS2322: Type '"asdf"' is not assignable to type 'new () => A'. ==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts (2 errors) ==== @@ -16,4 +16,4 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst !!! error TS2322: Cannot assign an abstract constructor type to a non-abstract constructor type. AAA = "asdf"; ~~~ -!!! error TS2322: Type 'string' is not assignable to type 'new () => A'. \ No newline at end of file +!!! error TS2322: Type '"asdf"' is not assignable to type 'new () => A'. \ No newline at end of file diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.types b/tests/baselines/reference/classAppearsToHaveMembersOfObject.types index 65c37e7dfeb47..9c87fa18ecddb 100644 --- a/tests/baselines/reference/classAppearsToHaveMembersOfObject.types +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.types @@ -20,7 +20,7 @@ var r2 = c.hasOwnProperty(''); >c.hasOwnProperty : (v: string) => boolean >c : C >hasOwnProperty : (v: string) => boolean ->'' : string +>'' : "" var o: Object = c; >o : Object diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types index 11fcac506b63b..728a201d79e3e 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types @@ -10,7 +10,7 @@ module M { export var v = 0; >v : number ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.types b/tests/baselines/reference/classDoesNotDependOnBaseTypes.types index 529be3c66353f..5ac20c6e0fadb 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.types +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.types @@ -10,17 +10,17 @@ if (typeof x !== "string") { >"string" : "string" x[0] = ""; ->x[0] = "" : string +>x[0] = "" : "" >x[0] : StringTree >x : StringTreeCollection ->0 : number ->"" : string +>0 : 0 +>"" : "" x[0] = new StringTreeCollection; >x[0] = new StringTreeCollection : StringTreeCollection >x[0] : StringTree >x : StringTreeCollection ->0 : number +>0 : 0 >new StringTreeCollection : StringTreeCollection >StringTreeCollection : typeof StringTreeCollection } diff --git a/tests/baselines/reference/classExpression5.types b/tests/baselines/reference/classExpression5.types index 25c4b66b8f331..cf207c1cb0baa 100644 --- a/tests/baselines/reference/classExpression5.types +++ b/tests/baselines/reference/classExpression5.types @@ -9,7 +9,7 @@ new class { >hi : () => string return "Hi!"; ->"Hi!" : string +>"Hi!" : "Hi!" } }().hi(); >hi : () => string diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.types b/tests/baselines/reference/classExpressionWithStaticProperties1.types index 168bb02847421..2cdcd1581b1a2 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties1.types +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.types @@ -6,11 +6,11 @@ var v = class C { static a = 1; >a : number ->1 : number +>1 : 1 static b = 2; >b : number ->2 : number +>2 : 2 static c = C.a + C.b; >c : number diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.types b/tests/baselines/reference/classExpressionWithStaticProperties2.types index 221b479411116..2db30ff3105b4 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties2.types +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.types @@ -6,7 +6,7 @@ var v = class C { static a = 1; >a : number ->1 : number +>1 : 1 static b >b : any @@ -17,7 +17,7 @@ var v = class C { x: "hi" >x : string ->"hi" : string +>"hi" : "hi" } static d = C.c.x + " world"; >d : string @@ -27,6 +27,6 @@ var v = class C { >C : typeof C >c : { x: string; } >x : string ->" world" : string +>" world" : " world" }; diff --git a/tests/baselines/reference/classExpressionWithStaticProperties3.types b/tests/baselines/reference/classExpressionWithStaticProperties3.types index c6ff6d1b56b47..b7f6102c8b731 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties3.types +++ b/tests/baselines/reference/classExpressionWithStaticProperties3.types @@ -10,10 +10,10 @@ const arr: {y(): number}[] = []; for (let i = 0; i < 3; i++) { >i : number ->0 : number +>0 : 0 >i < 3 : boolean >i : number ->3 : number +>3 : 3 >i++ : number >i : number @@ -36,7 +36,7 @@ for (let i = 0; i < 3; i++) { >C.x : number >C : typeof C >x : number ->2 : number +>2 : 2 }); } diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types index 0ba6ada4131f2..62f29b643610d 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types @@ -6,11 +6,11 @@ var v = class C { static a = 1; >a : number ->1 : number +>1 : 1 static b = 2; >b : number ->2 : number +>2 : 2 static c = C.a + 3; >c : number @@ -18,6 +18,6 @@ var v = class C { >C.a : number >C : typeof C >a : number ->3 : number +>3 : 3 }; diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types index 97d6940a3fc61..0c448d73ede7e 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types @@ -6,7 +6,7 @@ var v = class C { static a = 1; >a : number ->1 : number +>1 : 1 static b >b : any @@ -17,7 +17,7 @@ var v = class C { x: "hi" >x : string ->"hi" : string +>"hi" : "hi" } static d = C.c.x + " world"; >d : string @@ -27,6 +27,6 @@ var v = class C { >C : typeof C >c : { x: string; } >x : string ->" world" : string +>" world" : " world" }; diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types index 92f14f3f65f50..3bc780785aa6c 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types @@ -10,10 +10,10 @@ const arr: {y(): number}[] = []; for (let i = 0; i < 3; i++) { >i : number ->0 : number +>0 : 0 >i < 3 : boolean >i : number ->3 : number +>3 : 3 >i++ : number >i : number @@ -36,7 +36,7 @@ for (let i = 0; i < 3; i++) { >C.x : number >C : typeof C >x : number ->2 : number +>2 : 2 }); } diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES64.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES64.types index f48ec6fdde6b6..0f76461bb7138 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES64.types +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES64.types @@ -3,5 +3,5 @@ >(class { static x = 0; }) : typeof (Anonymous class) >class { static x = 0; } : typeof (Anonymous class) >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/classExtendingClass.types b/tests/baselines/reference/classExtendingClass.types index f91493e97fdf5..3c03fb1837a0b 100644 --- a/tests/baselines/reference/classExtendingClass.types +++ b/tests/baselines/reference/classExtendingClass.types @@ -102,7 +102,7 @@ var r7 = d2.thing(''); >d2.thing : (x: string) => void >d2 : D2 >thing : (x: string) => void ->'' : string +>'' : "" var r8 = D2.other(1); >r8 : void @@ -110,5 +110,5 @@ var r8 = D2.other(1); >D2.other : (x: T) => void >D2 : typeof D2 >other : (x: T) => void ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/classExtendingNonConstructor.errors.txt b/tests/baselines/reference/classExtendingNonConstructor.errors.txt index 17b3610d25242..b2c5ce4955af9 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.errors.txt +++ b/tests/baselines/reference/classExtendingNonConstructor.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(7,18): error TS2507: Type 'undefined' is not a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(8,18): error TS2507: Type 'boolean' is not a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(9,18): error TS2507: Type 'boolean' is not a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(10,18): error TS2507: Type 'number' is not a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(11,18): error TS2507: Type 'string' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(8,18): error TS2507: Type 'true' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(9,18): error TS2507: Type 'false' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(10,18): error TS2507: Type '42' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(11,18): error TS2507: Type '"hello"' is not a constructor function type. tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(12,18): error TS2507: Type '{}' is not a constructor function type. tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(13,18): error TS2507: Type '() => void' is not a constructor function type. @@ -19,16 +19,16 @@ tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.t !!! error TS2507: Type 'undefined' is not a constructor function type. class C2 extends true { } ~~~~ -!!! error TS2507: Type 'boolean' is not a constructor function type. +!!! error TS2507: Type 'true' is not a constructor function type. class C3 extends false { } ~~~~~ -!!! error TS2507: Type 'boolean' is not a constructor function type. +!!! error TS2507: Type 'false' is not a constructor function type. class C4 extends 42 { } ~~ -!!! error TS2507: Type 'number' is not a constructor function type. +!!! error TS2507: Type '42' is not a constructor function type. class C5 extends "hello" { } ~~~~~~~ -!!! error TS2507: Type 'string' is not a constructor function type. +!!! error TS2507: Type '"hello"' is not a constructor function type. class C6 extends x { } ~ !!! error TS2507: Type '{}' is not a constructor function type. diff --git a/tests/baselines/reference/classImplementsClass3.types b/tests/baselines/reference/classImplementsClass3.types index 6f97a96a56e48..266ff33e29b6e 100644 --- a/tests/baselines/reference/classImplementsClass3.types +++ b/tests/baselines/reference/classImplementsClass3.types @@ -2,7 +2,7 @@ class A { foo(): number { return 1; } } >A : A >foo : () => number ->1 : number +>1 : 1 class C implements A { >C : C @@ -12,7 +12,7 @@ class C implements A { >foo : () => number return 1; ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/classMemberInitializerScoping.errors.txt b/tests/baselines/reference/classMemberInitializerScoping.errors.txt index dddc7a82a3f52..d6625b3d1f8e9 100644 --- a/tests/baselines/reference/classMemberInitializerScoping.errors.txt +++ b/tests/baselines/reference/classMemberInitializerScoping.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/classMemberInitializerScoping.ts(3,17): error TS2301: Initializer of instance member variable 'y' cannot reference identifier 'aaa' declared in the constructor. -tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/compiler/classMemberInitializerScoping.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2322: Type ' constructor(aaa) { this.y = ''; // was: error, cannot assign string to number ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. } } diff --git a/tests/baselines/reference/classStaticPropertyTypeGuard.types b/tests/baselines/reference/classStaticPropertyTypeGuard.types index f89854c919d23..f9bf8b68062fd 100644 --- a/tests/baselines/reference/classStaticPropertyTypeGuard.types +++ b/tests/baselines/reference/classStaticPropertyTypeGuard.types @@ -22,10 +22,10 @@ class A { >_a : string } return A._a = 'helloworld'; ->A._a = 'helloworld' : string +>A._a = 'helloworld' : "helloworld" >A._a : string | undefined >A : typeof A >_a : string | undefined ->'helloworld' : string +>'helloworld' : "helloworld" } } diff --git a/tests/baselines/reference/classWithEmptyBody.types b/tests/baselines/reference/classWithEmptyBody.types index 1ac111796e807..acb038a72a25c 100644 --- a/tests/baselines/reference/classWithEmptyBody.types +++ b/tests/baselines/reference/classWithEmptyBody.types @@ -12,16 +12,16 @@ var o: {} = c; >c : C c = 1; ->c = 1 : number +>c = 1 : 1 >c : C ->1 : number +>1 : 1 c = { foo: '' } >c = { foo: '' } : { foo: string; } >c : C >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" c = () => { } >c = () => { } : () => void @@ -33,7 +33,7 @@ class D { constructor() { return 1; ->1 : number +>1 : 1 } } @@ -46,16 +46,16 @@ var o: {} = d; >d : D d = 1; ->d = 1 : number +>d = 1 : 1 >d : D ->1 : number +>1 : 1 d = { foo: '' } >d = { foo: '' } : { foo: string; } >d : D >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" d = () => { } >d = () => { } : () => void diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types index 94460dfdeaf45..272ba94f7f22d 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types @@ -14,7 +14,7 @@ class C { public get z() { return 1; } >z : number ->1 : number +>1 : 1 public set z(v) { } >z : number diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types index b359713f292ba..22440da176824 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types @@ -14,7 +14,7 @@ class C { public get z() { return 1; } >z : number ->1 : number +>1 : 1 public set z(v) { } >z : number diff --git a/tests/baselines/reference/classWithProtectedProperty.types b/tests/baselines/reference/classWithProtectedProperty.types index 1f53ea2aad9b4..079c749c377c4 100644 --- a/tests/baselines/reference/classWithProtectedProperty.types +++ b/tests/baselines/reference/classWithProtectedProperty.types @@ -9,32 +9,32 @@ class C { protected a = ''; >a : string ->'' : string +>'' : "" protected b: string = ''; >b : string ->'' : string +>'' : "" protected c() { return '' } >c : () => string ->'' : string +>'' : "" protected d = () => ''; >d : () => string >() => '' : () => string ->'' : string +>'' : "" protected static e; >e : any protected static f() { return '' } >f : () => string ->'' : string +>'' : "" protected static g = () => ''; >g : () => string >() => '' : () => string ->'' : string +>'' : "" } class D extends C { diff --git a/tests/baselines/reference/classWithPublicProperty.types b/tests/baselines/reference/classWithPublicProperty.types index 09d3c0668d155..1ea0c2920e47d 100644 --- a/tests/baselines/reference/classWithPublicProperty.types +++ b/tests/baselines/reference/classWithPublicProperty.types @@ -7,32 +7,32 @@ class C { public a = ''; >a : string ->'' : string +>'' : "" public b: string = ''; >b : string ->'' : string +>'' : "" public c() { return '' } >c : () => string ->'' : string +>'' : "" public d = () => ''; >d : () => string >() => '' : () => string ->'' : string +>'' : "" public static e; >e : any public static f() { return '' } >f : () => string ->'' : string +>'' : "" public static g = () => ''; >g : () => string >() => '' : () => string ->'' : string +>'' : "" } // all of these are valid diff --git a/tests/baselines/reference/classdecl.types b/tests/baselines/reference/classdecl.types index 6339873656343..82b2bba8bfbae 100644 --- a/tests/baselines/reference/classdecl.types +++ b/tests/baselines/reference/classdecl.types @@ -24,7 +24,7 @@ class a { >d : number return 30; ->30 : number +>30 : 30 } public set d(a: number) { >d : number @@ -37,9 +37,9 @@ class a { return { x: 30, y: 40 }; >{ x: 30, y: 40 } : { x: number; y: number; } >x : number ->30 : number +>30 : 30 >y : number ->40 : number +>40 : 40 } private static d2() { @@ -49,7 +49,7 @@ class a { >p3 : string return "string"; ->"string" : string +>"string" : "string" } private pv3; >pv3 : any diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.types b/tests/baselines/reference/cloduleAcrossModuleDefinitions.types index 53ef83927747a..2e46dc73e1754 100644 --- a/tests/baselines/reference/cloduleAcrossModuleDefinitions.types +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.types @@ -21,7 +21,7 @@ module A { export var x = 1; >x : number ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/cloduleTest1.types b/tests/baselines/reference/cloduleTest1.types index 67c1fd6120fe2..059329a3d8a12 100644 --- a/tests/baselines/reference/cloduleTest1.types +++ b/tests/baselines/reference/cloduleTest1.types @@ -30,7 +30,7 @@ >$('.foo').addClass : (className: string) => $ >$('.foo') : $ >$ : typeof $ ->'.foo' : string +>'.foo' : ".foo" >addClass : (className: string) => $ ->'bar' : string +>'bar' : "bar" diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types index 9c6fbac15394c..e951a2dbcc6a9 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types @@ -4,7 +4,7 @@ module M { export var x = 3; >x : number ->3 : number +>3 : 3 class c { >c : c @@ -40,7 +40,7 @@ module M { constructor() { var M = 10; >M : number ->10 : number +>10 : 10 var p = x; >p : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types index 5c99bc7b40bb5..6879c6bf3d8ca 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types @@ -4,7 +4,7 @@ module M { export var x = 3; >x : number ->3 : number +>3 : 3 function fn(M, p = x) { } >fn : (M: any, p?: number) => void diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types index 651ba5344ad49..959a45ab372e6 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types @@ -4,7 +4,7 @@ module m1 { export var m1 = 10; >m1 : number ->10 : number +>10 : 10 var b = m1; >b : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types index e7c6d9021eb56..77d813e108185 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types @@ -4,7 +4,7 @@ module M { export var x = 3; >x : number ->3 : number +>3 : 3 class c { >c : c diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types index 4ffaf6dad0479..ddf5faee5f0f1 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types @@ -4,14 +4,14 @@ module M { export var x = 3; >x : number ->3 : number +>3 : 3 module m1 { >m1 : typeof m1 var M = 10; >M : number ->10 : number +>10 : 10 var p = x; >p : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types index b71eeb621d026..2f8c05f2357cb 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types @@ -44,7 +44,7 @@ module m2 { } export var b10 = 10; >b10 : number ->10 : number +>10 : 10 var x = new c1(); >x : c1 diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types index 0db9958d533a2..cdee6af63a930 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types @@ -54,5 +54,5 @@ module m4 { } var a = 10; >a : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types index 76210f7dda04e..98f2f71c20ed0 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types @@ -25,5 +25,5 @@ module m2 { var a = 10; >a : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types index 9804380fd7a59..a2c3e1d8cd321 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types @@ -25,5 +25,5 @@ module m4 { var a = 10; >a : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types index 1c4c56de99cf2..fbf41e94837c6 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types @@ -84,7 +84,7 @@ module m2 { } var a = 10; >a : number ->10 : number +>10 : 10 } === tests/cases/compiler/collisionExportsRequireAndAmbientModule_globalFile.ts === @@ -158,6 +158,6 @@ module m4 { var a = 10; >a : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types index 90a9b8968e5c4..d88a7b5e04e3e 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types @@ -25,7 +25,7 @@ module m2 { var a = 10; >a : number ->10 : number +>10 : 10 } === tests/cases/compiler/collisionExportsRequireAndAmbientVar_globalFile.ts === @@ -55,5 +55,5 @@ module m4 { var a = 10; >a : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types index 3cc0835950811..8d520ec186a99 100644 --- a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types +++ b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types @@ -3,13 +3,13 @@ function exports() { >exports : () => number return 1; ->1 : number +>1 : 1 } function require() { >require : () => string return "require"; ->"require" : string +>"require" : "require" } module m3 { >m3 : typeof m3 @@ -18,13 +18,13 @@ module m3 { >exports : () => number return 1; ->1 : number +>1 : 1 } function require() { >require : () => string return "require"; ->"require" : string +>"require" : "require" } } module m4 { @@ -34,12 +34,12 @@ module m4 { >exports : () => number return 1; ->1 : number +>1 : 1 } export function require() { >require : () => string return "require"; ->"require" : string +>"require" : "require" } } diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.types b/tests/baselines/reference/collisionRestParameterArrowFunctions.types index dcd52e5f76637..8a2b531641970 100644 --- a/tests/baselines/reference/collisionRestParameterArrowFunctions.types +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.types @@ -7,7 +7,7 @@ var f1 = (_i: number, ...restParameters) => { //_i is error var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } var f1NoError = (_i: number) => { // no error >f1NoError : (_i: number) => void @@ -16,7 +16,7 @@ var f1NoError = (_i: number) => { // no error var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } var f2 = (...restParameters) => { @@ -26,7 +26,7 @@ var f2 = (...restParameters) => { var _i = 10; // No Error >_i : number ->10 : number +>10 : 10 } var f2NoError = () => { >f2NoError : () => void @@ -34,5 +34,5 @@ var f2NoError = () => { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.types b/tests/baselines/reference/collisionRestParameterClassConstructor.types index f86d6d80d2136..08f87481103c6 100644 --- a/tests/baselines/reference/collisionRestParameterClassConstructor.types +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.types @@ -9,7 +9,7 @@ class c1 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } class c1NoError { @@ -20,7 +20,7 @@ class c1NoError { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } @@ -32,7 +32,7 @@ class c2 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } class c2NoError { @@ -41,7 +41,7 @@ class c2NoError { constructor() { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } @@ -54,7 +54,7 @@ class c3 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } class c3NoError { @@ -65,7 +65,7 @@ class c3NoError { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.types b/tests/baselines/reference/collisionRestParameterClassMethod.types index bc6b09dd795cb..c5ab80d3bd120 100644 --- a/tests/baselines/reference/collisionRestParameterClassMethod.types +++ b/tests/baselines/reference/collisionRestParameterClassMethod.types @@ -9,7 +9,7 @@ class c1 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } public fooNoError(_i: number) { // no error >fooNoError : (_i: number) => void @@ -17,7 +17,7 @@ class c1 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } public f4(_i: number, ...rest); // no codegen no error >f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; } @@ -95,13 +95,13 @@ class c3 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } public fooNoError() { >fooNoError : () => void var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/collisionRestParameterFunction.types b/tests/baselines/reference/collisionRestParameterFunction.types index d988f74c9284a..3de29038c25b8 100644 --- a/tests/baselines/reference/collisionRestParameterFunction.types +++ b/tests/baselines/reference/collisionRestParameterFunction.types @@ -7,7 +7,7 @@ function f1(_i: number, ...restParameters) { //_i is error var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f1NoError(_i: number) { // no error >f1NoError : (_i: number) => void @@ -15,7 +15,7 @@ function f1NoError(_i: number) { // no error var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } declare function f2(_i: number, ...restParameters); // no error - no code gen @@ -33,14 +33,14 @@ function f3(...restParameters) { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f3NoError() { >f3NoError : () => void var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f4(_i: number, ...rest); // no codegen no error diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.types b/tests/baselines/reference/collisionRestParameterFunctionExpressions.types index f8ca0c18ed8e0..c0ee39e81f261 100644 --- a/tests/baselines/reference/collisionRestParameterFunctionExpressions.types +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.types @@ -9,7 +9,7 @@ function foo() { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f1NoError(_i: number) { // no error >f1NoError : (_i: number) => void @@ -17,7 +17,7 @@ function foo() { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f3(...restParameters) { >f3 : (...restParameters: any[]) => void @@ -25,14 +25,14 @@ function foo() { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f3NoError() { >f3NoError : () => void var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f4(_i: number, ...rest); // no codegen no error diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types index fadc27dfa6c4a..8245f487915d9 100644 --- a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types @@ -6,7 +6,7 @@ declare var console: { log(msg?: string): void; }; var _i = "This is what I'd expect to see"; >_i : string ->"This is what I'd expect to see" : string +>"This is what I'd expect to see" : "This is what I'd expect to see" class Foo { >Foo : Foo diff --git a/tests/baselines/reference/commaOperator1.types b/tests/baselines/reference/commaOperator1.types index 8116fec83284b..67011aba4b979 100644 --- a/tests/baselines/reference/commaOperator1.types +++ b/tests/baselines/reference/commaOperator1.types @@ -1,29 +1,29 @@ === tests/cases/compiler/commaOperator1.ts === var v1 = ((1, 2, 3), 4, 5, (6, 7)); >v1 : number ->((1, 2, 3), 4, 5, (6, 7)) : number ->(1, 2, 3), 4, 5, (6, 7) : number ->(1, 2, 3), 4, 5 : number ->(1, 2, 3), 4 : number ->(1, 2, 3) : number ->1, 2, 3 : number ->1, 2 : number ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->(6, 7) : number ->6, 7 : number ->6 : number ->7 : number +>((1, 2, 3), 4, 5, (6, 7)) : 7 +>(1, 2, 3), 4, 5, (6, 7) : 7 +>(1, 2, 3), 4, 5 : 5 +>(1, 2, 3), 4 : 4 +>(1, 2, 3) : 3 +>1, 2, 3 : 3 +>1, 2 : 2 +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>(6, 7) : 7 +>6, 7 : 7 +>6 : 6 +>7 : 7 function f1() { >f1 : () => number var a = 1; >a : number ->1 : number +>1 : 1 return a, v1, a; >a, v1, a : number diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.types b/tests/baselines/reference/commaOperatorOtherValidOperation.types index bc7bdd8115701..71fc5853c9a51 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.types +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.types @@ -2,9 +2,9 @@ //Comma operator in for loop for (var i = 0, j = 10; i < j; i++, j--) >i : number ->0 : number +>0 : 0 >j : number ->10 : number +>10 : 10 >i < j : boolean >i : number >j : number @@ -31,8 +31,8 @@ var resultIsString = foo(1, "123"); >resultIsString : string >foo(1, "123") : string >foo : (x: number, y: string) => string ->1 : number ->"123" : string +>1 : 1 +>"123" : "123" //TypeParameters function foo1() diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types index a8217c2d2485d..e2535bd17abab 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types @@ -83,7 +83,7 @@ var x: any; 1, ANY; >1, ANY : any ->1 : number +>1 : 1 >ANY : any ++NUMBER, ANY; @@ -94,28 +94,28 @@ var x: any; "string", [null, 1]; >"string", [null, 1] : number[] ->"string" : string +>"string" : "string" >[null, 1] : number[] >null : null ->1 : number +>1 : 1 "string".charAt(0), [null, 1]; >"string".charAt(0), [null, 1] : number[] >"string".charAt(0) : string >"string".charAt : (pos: number) => string ->"string" : string +>"string" : "string" >charAt : (pos: number) => string ->0 : number +>0 : 0 >[null, 1] : number[] >null : null ->1 : number +>1 : 1 true, x("any"); >true, x("any") : any ->true : boolean +>true : true >x("any") : any >x : any ->"any" : string +>"any" : "any" !BOOLEAN, x.doSomeThing(); >!BOOLEAN, x.doSomeThing() : any @@ -130,7 +130,7 @@ var resultIsAny6 = (1, ANY); >resultIsAny6 : any >(1, ANY) : any >1, ANY : any ->1 : number +>1 : 1 >ANY : any var resultIsAny7 = (++NUMBER, ANY); @@ -145,7 +145,7 @@ var resultIsAny8 = ("string", null); >resultIsAny8 : any >("string", null) : null >"string", null : null ->"string" : string +>"string" : "string" >null : null var resultIsAny9 = ("string".charAt(0), undefined); @@ -154,19 +154,19 @@ var resultIsAny9 = ("string".charAt(0), undefined); >"string".charAt(0), undefined : undefined >"string".charAt(0) : string >"string".charAt : (pos: number) => string ->"string" : string +>"string" : "string" >charAt : (pos: number) => string ->0 : number +>0 : 0 >undefined : undefined var resultIsAny10 = (true, x("any")); >resultIsAny10 : any >(true, x("any")) : any >true, x("any") : any ->true : boolean +>true : true >x("any") : any >x : any ->"any" : string +>"any" : "any" var resultIsAny11 = (!BOOLEAN, x.doSomeThing()); >resultIsAny11 : any diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types index b846d2cd56b2f..6c791bdee2c57 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types @@ -91,22 +91,22 @@ ANY = undefined, BOOLEAN; >BOOLEAN : boolean 1, true; ->1, true : boolean ->1 : number ->true : boolean +>1, true : true +>1 : 1 +>true : true ++NUMBER, true; ->++NUMBER, true : boolean +>++NUMBER, true : true >++NUMBER : number >NUMBER : number ->true : boolean +>true : true [1, 2, 3], !BOOLEAN; >[1, 2, 3], !BOOLEAN : boolean >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >!BOOLEAN : boolean >BOOLEAN : boolean @@ -115,22 +115,22 @@ OBJECT = [1, 2, 3], BOOLEAN = false; >OBJECT = [1, 2, 3] : number[] >OBJECT : Object >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >BOOLEAN = false : false >BOOLEAN : boolean >false : false var resultIsBoolean6 = (null, BOOLEAN); ->resultIsBoolean6 : false +>resultIsBoolean6 : boolean >(null, BOOLEAN) : false >null, BOOLEAN : false >null : null >BOOLEAN : false var resultIsBoolean7 = (ANY = undefined, BOOLEAN); ->resultIsBoolean7 : false +>resultIsBoolean7 : boolean >(ANY = undefined, BOOLEAN) : false >ANY = undefined, BOOLEAN : false >ANY = undefined : undefined @@ -140,40 +140,40 @@ var resultIsBoolean7 = (ANY = undefined, BOOLEAN); var resultIsBoolean8 = (1, true); >resultIsBoolean8 : boolean ->(1, true) : boolean ->1, true : boolean ->1 : number ->true : boolean +>(1, true) : true +>1, true : true +>1 : 1 +>true : true var resultIsBoolean9 = (++NUMBER, true); >resultIsBoolean9 : boolean ->(++NUMBER, true) : boolean ->++NUMBER, true : boolean +>(++NUMBER, true) : true +>++NUMBER, true : true >++NUMBER : number >NUMBER : number ->true : boolean +>true : true var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); ->resultIsBoolean10 : true +>resultIsBoolean10 : boolean >([1, 2, 3], !BOOLEAN) : true >[1, 2, 3], !BOOLEAN : true >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >!BOOLEAN : true >BOOLEAN : false var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); ->resultIsBoolean11 : false +>resultIsBoolean11 : boolean >(OBJECT = [1, 2, 3], BOOLEAN = false) : false >OBJECT = [1, 2, 3], BOOLEAN = false : false >OBJECT = [1, 2, 3] : number[] >OBJECT : Object >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >BOOLEAN = false : false >BOOLEAN : boolean >false : false diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types index 7706cc554411e..2a53a23c4e0fa 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types @@ -91,33 +91,33 @@ ANY = undefined, NUMBER; >NUMBER : number true, 1; ->true, 1 : number ->true : boolean ->1 : number +>true, 1 : 1 +>true : true +>1 : 1 BOOLEAN = false, 1; ->BOOLEAN = false, 1 : number +>BOOLEAN = false, 1 : 1 >BOOLEAN = false : false >BOOLEAN : boolean >false : false ->1 : number +>1 : 1 "", NUMBER = 1; ->"", NUMBER = 1 : number ->"" : string ->NUMBER = 1 : number +>"", NUMBER = 1 : 1 +>"" : "" +>NUMBER = 1 : 1 >NUMBER : number ->1 : number +>1 : 1 STRING.trim(), NUMBER = 1; ->STRING.trim(), NUMBER = 1 : number +>STRING.trim(), NUMBER = 1 : 1 >STRING.trim() : string >STRING.trim : () => string >STRING : string >trim : () => string ->NUMBER = 1 : number +>NUMBER = 1 : 1 >NUMBER : number ->1 : number +>1 : 1 var resultIsNumber6 = (null, NUMBER); >resultIsNumber6 : number @@ -137,38 +137,38 @@ var resultIsNumber7 = (ANY = undefined, NUMBER); var resultIsNumber8 = (true, 1); >resultIsNumber8 : number ->(true, 1) : number ->true, 1 : number ->true : boolean ->1 : number +>(true, 1) : 1 +>true, 1 : 1 +>true : true +>1 : 1 var resultIsNumber9 = (BOOLEAN = false, 1); >resultIsNumber9 : number ->(BOOLEAN = false, 1) : number ->BOOLEAN = false, 1 : number +>(BOOLEAN = false, 1) : 1 +>BOOLEAN = false, 1 : 1 >BOOLEAN = false : false >BOOLEAN : boolean >false : false ->1 : number +>1 : 1 var resultIsNumber10 = ("", NUMBER = 1); >resultIsNumber10 : number ->("", NUMBER = 1) : number ->"", NUMBER = 1 : number ->"" : string ->NUMBER = 1 : number +>("", NUMBER = 1) : 1 +>"", NUMBER = 1 : 1 +>"" : "" +>NUMBER = 1 : 1 >NUMBER : number ->1 : number +>1 : 1 var resultIsNumber11 = (STRING.trim(), NUMBER = 1); >resultIsNumber11 : number ->(STRING.trim(), NUMBER = 1) : number ->STRING.trim(), NUMBER = 1 : number +>(STRING.trim(), NUMBER = 1) : 1 +>STRING.trim(), NUMBER = 1 : 1 >STRING.trim() : string >STRING.trim : () => string >STRING : string >trim : () => string ->NUMBER = 1 : number +>NUMBER = 1 : 1 >NUMBER : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types index 9c948da969978..15d9f074da58a 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types @@ -99,7 +99,7 @@ ANY = null, OBJECT true, {} >true, {} : {} ->true : boolean +>true : true >{} : {} !BOOLEAN, [] @@ -110,7 +110,7 @@ true, {} "string", new Date() >"string", new Date() : Date ->"string" : string +>"string" : "string" >new Date() : Date >Date : DateConstructor @@ -143,7 +143,7 @@ var resultIsObject8 = (true, {}); >resultIsObject8 : {} >(true, {}) : {} >true, {} : {} ->true : boolean +>true : true >{} : {} var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); @@ -154,15 +154,15 @@ var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); >BOOLEAN : boolean >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" var resultIsObject10 = ("string", new Date()); >resultIsObject10 : Date >("string", new Date()) : Date >"string", new Date() : Date ->"string" : string +>"string" : "string" >new Date() : Date >Date : DateConstructor diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types index a28202876d25e..ca0cb47536283 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types @@ -95,22 +95,22 @@ ANY = new Date(), STRING; >STRING : string true, ""; ->true, "" : string ->true : boolean ->"" : string +>true, "" : "" +>true : true +>"" : "" BOOLEAN == undefined, ""; ->BOOLEAN == undefined, "" : string +>BOOLEAN == undefined, "" : "" >BOOLEAN == undefined : boolean >BOOLEAN : boolean >undefined : undefined ->"" : string +>"" : "" ["a", "b"], NUMBER.toString(); >["a", "b"], NUMBER.toString() : string >["a", "b"] : string[] ->"a" : string ->"b" : string +>"a" : "a" +>"b" : "b" >NUMBER.toString() : string >NUMBER.toString : (radix?: number) => string >NUMBER : number @@ -124,7 +124,7 @@ OBJECT = new Object, STRING + "string"; >Object : ObjectConstructor >STRING + "string" : string >STRING : string ->"string" : string +>"string" : "string" var resultIsString6 = (null, STRING); >resultIsString6 : string @@ -145,27 +145,27 @@ var resultIsString7 = (ANY = new Date(), STRING); var resultIsString8 = (true, ""); >resultIsString8 : string ->(true, "") : string ->true, "" : string ->true : boolean ->"" : string +>(true, "") : "" +>true, "" : "" +>true : true +>"" : "" var resultIsString9 = (BOOLEAN == undefined, ""); >resultIsString9 : string ->(BOOLEAN == undefined, "") : string ->BOOLEAN == undefined, "" : string +>(BOOLEAN == undefined, "") : "" +>BOOLEAN == undefined, "" : "" >BOOLEAN == undefined : boolean >BOOLEAN : boolean >undefined : undefined ->"" : string +>"" : "" var resultIsString10 = (["a", "b"], NUMBER.toString()); >resultIsString10 : string >(["a", "b"], NUMBER.toString()) : string >["a", "b"], NUMBER.toString() : string >["a", "b"] : string[] ->"a" : string ->"b" : string +>"a" : "a" +>"b" : "b" >NUMBER.toString() : string >NUMBER.toString : (radix?: number) => string >NUMBER : number @@ -179,5 +179,5 @@ var resultIsString11 = (new Object, STRING + "string"); >Object : ObjectConstructor >STRING + "string" : string >STRING : string ->"string" : string +>"string" : "string" diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.types b/tests/baselines/reference/commaOperatorsMultipleOperators.types index 9a2c7c7e5c5fa..99796e36cb714 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.types +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.types @@ -99,11 +99,11 @@ var resultIsObject1 = (NUMBER, STRING, OBJECT); //Literal and expression null, true, 1; ->null, true, 1 : number ->null, true : boolean +>null, true, 1 : 1 +>null, true : true >null : null ->true : boolean ->1 : number +>true : true +>1 : 1 ++NUMBER, STRING.charAt(0), new Object(); >++NUMBER, STRING.charAt(0), new Object() : Object @@ -114,18 +114,18 @@ null, true, 1; >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 >new Object() : Object >Object : ObjectConstructor var resultIsNumber2 = (null, true, 1); >resultIsNumber2 : number ->(null, true, 1) : number ->null, true, 1 : number ->null, true : boolean +>(null, true, 1) : 1 +>null, true, 1 : 1 +>null, true : true >null : null ->true : boolean ->1 : number +>true : true +>1 : 1 var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); >resultIsObject2 : Object @@ -138,7 +138,7 @@ var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 >new Object() : Object >Object : ObjectConstructor diff --git a/tests/baselines/reference/commentBeforeStaticMethod1.types b/tests/baselines/reference/commentBeforeStaticMethod1.types index 1b16709a701d1..0c9e69ed7a08c 100644 --- a/tests/baselines/reference/commentBeforeStaticMethod1.types +++ b/tests/baselines/reference/commentBeforeStaticMethod1.types @@ -9,6 +9,6 @@ class C { >foo : () => string return "bar"; ->"bar" : string +>"bar" : "bar" } } diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.types b/tests/baselines/reference/commentEmitAtEndOfFile1.types index f96a1069a06cf..2071e98af8d8f 100644 --- a/tests/baselines/reference/commentEmitAtEndOfFile1.types +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.types @@ -3,7 +3,7 @@ // test var f = '' >f : string ->'' : string +>'' : "" // test #2 module foo { diff --git a/tests/baselines/reference/commentOnAmbientVariable2.types b/tests/baselines/reference/commentOnAmbientVariable2.types index 28760dca1ec2a..10e5a44286208 100644 --- a/tests/baselines/reference/commentOnAmbientVariable2.types +++ b/tests/baselines/reference/commentOnAmbientVariable2.types @@ -4,12 +4,12 @@ declare var x: number; >x : number x = 2; ->x = 2 : number +>x = 2 : 2 >x : number ->2 : number +>2 : 2 === tests/cases/compiler/commentOnAmbientVariable2_1.ts === var y = 1; >y : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/commentOnExpressionStatement1.types b/tests/baselines/reference/commentOnExpressionStatement1.types index 11d5fe1c6b580..39141c8d52e71 100644 --- a/tests/baselines/reference/commentOnExpressionStatement1.types +++ b/tests/baselines/reference/commentOnExpressionStatement1.types @@ -2,6 +2,6 @@ 1 + 1; // Comment. >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/commentOnIfStatement1.types b/tests/baselines/reference/commentOnIfStatement1.types index 7b983156f4dd1..4f7fcdddd22a3 100644 --- a/tests/baselines/reference/commentOnIfStatement1.types +++ b/tests/baselines/reference/commentOnIfStatement1.types @@ -2,5 +2,5 @@ // Test if (true) { ->true : boolean +>true : true } diff --git a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types index 6dd530e438bda..b853046883005 100644 --- a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types +++ b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types @@ -12,5 +12,5 @@ Foo(() => // do something 127); ->127 : number +>127 : 127 diff --git a/tests/baselines/reference/commentsAfterFunctionExpression1.types b/tests/baselines/reference/commentsAfterFunctionExpression1.types index 4a6b12bc21085..b5712f1750c89 100644 --- a/tests/baselines/reference/commentsAfterFunctionExpression1.types +++ b/tests/baselines/reference/commentsAfterFunctionExpression1.types @@ -7,20 +7,20 @@ var v = { >f : (a: any) => number >a => 0 : (a: any) => number >a : any ->0 : number +>0 : 0 g: (a => 0) /*t2*/, >g : (a: any) => number >(a => 0) : (a: any) => number >a => 0 : (a: any) => number >a : any ->0 : number +>0 : 0 h: (a => 0 /*t3*/) >h : (a: any) => number >(a => 0 /*t3*/) : (a: any) => number >a => 0 : (a: any) => number >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/commentsArgumentsOfCallExpression1.types b/tests/baselines/reference/commentsArgumentsOfCallExpression1.types index bcab3e3de3666..81425e0dd5fa6 100644 --- a/tests/baselines/reference/commentsArgumentsOfCallExpression1.types +++ b/tests/baselines/reference/commentsArgumentsOfCallExpression1.types @@ -6,7 +6,7 @@ function foo(/*c1*/ x: any) { } foo(/*c2*/ 1); >foo(/*c2*/ 1) : void >foo : (x: any) => void ->1 : number +>1 : 1 foo(/*c3*/ function () { }); >foo(/*c3*/ function () { }) : void diff --git a/tests/baselines/reference/commentsArgumentsOfCallExpression2.types b/tests/baselines/reference/commentsArgumentsOfCallExpression2.types index f0a10077e669a..7ec29aa912430 100644 --- a/tests/baselines/reference/commentsArgumentsOfCallExpression2.types +++ b/tests/baselines/reference/commentsArgumentsOfCallExpression2.types @@ -12,10 +12,10 @@ var a, b: any; foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b); >foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b) : void >foo : (x: any, y: any, w?: any) => void ->1 : number +>1 : 1 >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 >a + b : any >a : any >b : any @@ -51,5 +51,5 @@ foo( /*e4*/ /*e5*/ "hello"); ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/commentsBeforeFunctionExpression1.types b/tests/baselines/reference/commentsBeforeFunctionExpression1.types index a057918a74d7c..7182935f6b38f 100644 --- a/tests/baselines/reference/commentsBeforeFunctionExpression1.types +++ b/tests/baselines/reference/commentsBeforeFunctionExpression1.types @@ -7,6 +7,6 @@ var v = { >f : (a: any) => number >(a) => 0 : (a: any) => number >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/commentsClassMembers.types b/tests/baselines/reference/commentsClassMembers.types index b599edc046315..3824b8acac016 100644 --- a/tests/baselines/reference/commentsClassMembers.types +++ b/tests/baselines/reference/commentsClassMembers.types @@ -574,7 +574,7 @@ var i1_r = i1.p2(20); >i1.p2 : (b: number) => number >i1 : c1 >p2 : (b: number) => number ->20 : number +>20 : 20 var i1_prop = i1.p3; >i1_prop : number @@ -607,7 +607,7 @@ var i1_ncr = i1.nc_p2(20); >i1.nc_p2 : (b: number) => number >i1 : c1 >nc_p2 : (b: number) => number ->20 : number +>20 : 20 var i1_ncprop = i1.nc_p3; >i1_ncprop : number @@ -640,7 +640,7 @@ var i1_s_r = c1.s2(20); >c1.s2 : (b: number) => number >c1 : typeof c1 >s2 : (b: number) => number ->20 : number +>20 : 20 var i1_s_prop = c1.s3; >i1_s_prop : number @@ -673,7 +673,7 @@ var i1_s_ncr = c1.nc_s2(20); >c1.nc_s2 : (b: number) => number >c1 : typeof c1 >nc_s2 : (b: number) => number ->20 : number +>20 : 20 var i1_s_ncprop = c1.nc_s3; >i1_s_ncprop : number @@ -743,11 +743,11 @@ class cProperties { public x = 10; /*trailing comment for property*/ >x : number ->10 : number +>10 : 10 private y = 10; // trailing comment of // style >y : number ->10 : number +>10 : 10 } var cProperties_i = new cProperties(); >cProperties_i : cProperties diff --git a/tests/baselines/reference/commentsCommentParsing.types b/tests/baselines/reference/commentsCommentParsing.types index a6e24609642f0..b41822679d864 100644 --- a/tests/baselines/reference/commentsCommentParsing.types +++ b/tests/baselines/reference/commentsCommentParsing.types @@ -151,8 +151,8 @@ function sum(a: number, b: number) { sum(10, 20); >sum(10, 20) : number >sum : (a: number, b: number) => number ->10 : number ->20 : number +>10 : 10 +>20 : 20 /** This is multiplication function*/ /** @param */ diff --git a/tests/baselines/reference/commentsEnums.types b/tests/baselines/reference/commentsEnums.types index ef2c52067d1ce..71d062f790aca 100644 --- a/tests/baselines/reference/commentsEnums.types +++ b/tests/baselines/reference/commentsEnums.types @@ -6,18 +6,18 @@ enum Colors { /** Fancy name for 'blue'*/ Cornflower /* blue */, ->Cornflower : Colors +>Cornflower : Colors.Cornflower /** Fancy name for 'pink'*/ FancyPink ->FancyPink : Colors +>FancyPink : Colors.FancyPink } // trailing comment var x = Colors.Cornflower; >x : Colors ->Colors.Cornflower : Colors +>Colors.Cornflower : Colors.Cornflower >Colors : typeof Colors ->Cornflower : Colors +>Cornflower : Colors.Cornflower x = Colors.FancyPink; >x = Colors.FancyPink : Colors.FancyPink diff --git a/tests/baselines/reference/commentsFunction.types b/tests/baselines/reference/commentsFunction.types index db5e518339d0e..75a6cb6eaaf4a 100644 --- a/tests/baselines/reference/commentsFunction.types +++ b/tests/baselines/reference/commentsFunction.types @@ -26,8 +26,8 @@ function fooWithParameters(/** this is comment about a*/a: string, fooWithParameters("a", 10); >fooWithParameters("a", 10) : void >fooWithParameters : (a: string, b: number) => void ->"a" : string ->10 : number +>"a" : "a" +>10 : 10 /** fooFunc * comment @@ -64,14 +64,14 @@ var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: nu lambdaFoo(10, 20); >lambdaFoo(10, 20) : number >lambdaFoo : (a: number, b: number) => number ->10 : number ->20 : number +>10 : 10 +>20 : 20 lambddaNoVarComment(10, 20); >lambddaNoVarComment(10, 20) : number >lambddaNoVarComment : (a: number, b: number) => number ->10 : number ->20 : number +>10 : 10 +>20 : 20 function blah(a: string /* multiline trailing comment >blah : (a: string) => void @@ -104,12 +104,12 @@ lambdaFoo = (a, b) => a * b; // This is trailing comment /*leading comment*/() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) >() => 0 : () => number ->0 : number +>0 : 0 /*leading comment*/(() => 0); //trailing comment >(() => 0) : () => number >() => 0 : () => number ->0 : number +>0 : 0 function blah4(/*1*/a: string/*2*/,/*3*/b: string/*4*/) { >blah4 : (a: string, b: string) => void diff --git a/tests/baselines/reference/commentsInheritance.types b/tests/baselines/reference/commentsInheritance.types index 21dcde99dbf83..804da3fd76019 100644 --- a/tests/baselines/reference/commentsInheritance.types +++ b/tests/baselines/reference/commentsInheritance.types @@ -122,7 +122,7 @@ class c2 { >c2_prop : number return 10; ->10 : number +>10 : 10 } public c2_nc_p1: number; >c2_nc_p1 : number @@ -134,7 +134,7 @@ class c2 { >c2_nc_prop : number return 10; ->10 : number +>10 : 10 } /** c2 p1*/ public p1: number; @@ -149,7 +149,7 @@ class c2 { >prop : number return 10; ->10 : number +>10 : 10 } public nc_p1: number; >nc_p1 : number @@ -161,7 +161,7 @@ class c2 { >nc_prop : number return 10; ->10 : number +>10 : 10 } /** c2 constructor*/ constructor(a: number) { @@ -183,7 +183,7 @@ class c3 extends c2 { super(10); >super(10) : void >super : typeof c2 ->10 : number +>10 : 10 } /** c3 p1*/ public p1: number; @@ -198,7 +198,7 @@ class c3 extends c2 { >prop : number return 10; ->10 : number +>10 : 10 } public nc_p1: number; >nc_p1 : number @@ -210,14 +210,14 @@ class c3 extends c2 { >nc_prop : number return 10; ->10 : number +>10 : 10 } } var c2_i = new c2(10); >c2_i : c2 >new c2(10) : c2 >c2 : typeof c2 ->10 : number +>10 : 10 var c3_i = new c3(); >c3_i : c3 @@ -238,7 +238,7 @@ var c4_i = new c4(10); >c4_i : c4 >new c4(10) : c4 >c4 : typeof c4 ->10 : number +>10 : 10 interface i2 { >i2 : i2 diff --git a/tests/baselines/reference/commentsInterface.types b/tests/baselines/reference/commentsInterface.types index 13cc2b19f605c..97b64d4c6050f 100644 --- a/tests/baselines/reference/commentsInterface.types +++ b/tests/baselines/reference/commentsInterface.types @@ -86,19 +86,19 @@ var i2_i_foo_r = i2_i.foo(30); >i2_i.foo : (b: number) => string >i2_i : i2 >foo : (b: number) => string ->30 : number +>30 : 30 var i2_i_i2_si = i2_i["hello"]; >i2_i_i2_si : any >i2_i["hello"] : any >i2_i : i2 ->"hello" : string +>"hello" : "hello" var i2_i_i2_ii = i2_i[30]; >i2_i_i2_ii : number >i2_i[30] : number >i2_i : i2 ->30 : number +>30 : 30 var i2_i_n = new i2_i(i1_i); >i2_i_n : any @@ -124,14 +124,14 @@ var i2_i_nc_foo_r = i2_i.nc_foo(30); >i2_i.nc_foo : (b: number) => string >i2_i : i2 >nc_foo : (b: number) => string ->30 : number +>30 : 30 var i2_i_r = i2_i(10, 20); >i2_i_r : number >i2_i(10, 20) : number >i2_i : i2 ->10 : number ->20 : number +>10 : 10 +>20 : 20 var i2_i_fnfoo = i2_i.fnfoo; >i2_i_fnfoo : (b: number) => string @@ -145,7 +145,7 @@ var i2_i_fnfoo_r = i2_i.fnfoo(10); >i2_i.fnfoo : (b: number) => string >i2_i : i2 >fnfoo : (b: number) => string ->10 : number +>10 : 10 var i2_i_nc_fnfoo = i2_i.nc_fnfoo; >i2_i_nc_fnfoo : (b: number) => string @@ -159,7 +159,7 @@ var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); >i2_i.nc_fnfoo : (b: number) => string >i2_i : i2 >nc_fnfoo : (b: number) => string ->10 : number +>10 : 10 interface i3 { >i3 : i3 @@ -203,7 +203,7 @@ i3_i = { >(/**i3_i a*/a: number) => "Hello" + a : (a: number) => string >a : number >"Hello" + a : string ->"Hello" : string +>"Hello" : "Hello" >a : number l: this.f, @@ -219,7 +219,7 @@ i3_i = { >this.f : any >this : any >f : any ->10 : number +>10 : 10 nc_x: this.l(this.x), >nc_x : any @@ -249,26 +249,26 @@ i3_i.f(10); >i3_i.f : (a: number) => string >i3_i : i3 >f : (a: number) => string ->10 : number +>10 : 10 i3_i.l(10); >i3_i.l(10) : string >i3_i.l : (b: number) => string >i3_i : i3 >l : (b: number) => string ->10 : number +>10 : 10 i3_i.nc_f(10); >i3_i.nc_f(10) : string >i3_i.nc_f : (a: number) => string >i3_i : i3 >nc_f : (a: number) => string ->10 : number +>10 : 10 i3_i.nc_l(10); >i3_i.nc_l(10) : string >i3_i.nc_l : (b: number) => string >i3_i : i3 >nc_l : (b: number) => string ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.types b/tests/baselines/reference/commentsOnObjectLiteral3.types index a63920fce0f3a..4053e7e3f8938 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3.types +++ b/tests/baselines/reference/commentsOnObjectLiteral3.types @@ -7,7 +7,7 @@ var v = { //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, >prop : number ->1 : number +>1 : 1 //property func: function () { diff --git a/tests/baselines/reference/commentsOnObjectLiteral4.types b/tests/baselines/reference/commentsOnObjectLiteral4.types index 5d20d4f79cc87..097d43cdd6d83 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral4.types +++ b/tests/baselines/reference/commentsOnObjectLiteral4.types @@ -11,7 +11,7 @@ var v = { >bar : number return 12; ->12 : number +>12 : 12 } } diff --git a/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.types b/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.types index 93ce87558d8b7..538afc61ee104 100644 --- a/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.types +++ b/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.types @@ -13,7 +13,7 @@ var resolve = { id1: /* c1 */ "hello", >id1 : string ->"hello" : string +>"hello" : "hello" id2: >id2 : (details: any) => any diff --git a/tests/baselines/reference/commentsOnRequireStatement.types b/tests/baselines/reference/commentsOnRequireStatement.types index 2cc6154ed6065..cd146c731f721 100644 --- a/tests/baselines/reference/commentsOnRequireStatement.types +++ b/tests/baselines/reference/commentsOnRequireStatement.types @@ -2,12 +2,12 @@ export var subject = 10; >subject : number ->10 : number +>10 : 10 === tests/cases/compiler/1.ts === export var subject1 = 10; >subject1 : number ->10 : number +>10 : 10 === tests/cases/compiler/2.ts === /* blah0 */ diff --git a/tests/baselines/reference/commentsOnReturnStatement1.types b/tests/baselines/reference/commentsOnReturnStatement1.types index d44c91c0a8c5a..0188f088c3ad0 100644 --- a/tests/baselines/reference/commentsOnReturnStatement1.types +++ b/tests/baselines/reference/commentsOnReturnStatement1.types @@ -8,10 +8,10 @@ class DebugClass { // Start Debugger Test Code var i = 0; >i : number ->0 : number +>0 : 0 // End Debugger Test Code return true; ->true : boolean +>true : true } } diff --git a/tests/baselines/reference/commentsOnStaticMembers.types b/tests/baselines/reference/commentsOnStaticMembers.types index 46a1ca211ffd1..b4fae1094b68e 100644 --- a/tests/baselines/reference/commentsOnStaticMembers.types +++ b/tests/baselines/reference/commentsOnStaticMembers.types @@ -8,7 +8,7 @@ class test { */ public static p1: string = ""; >p1 : string ->"" : string +>"" : "" /** * p2 comment does not appear in output @@ -21,7 +21,7 @@ class test { */ private static p3: string = ""; >p3 : string ->"" : string +>"" : "" /** * p4 comment does not appear in output diff --git a/tests/baselines/reference/commentsOverloads.types b/tests/baselines/reference/commentsOverloads.types index 3281ab83ab600..88632e04c6a48 100644 --- a/tests/baselines/reference/commentsOverloads.types +++ b/tests/baselines/reference/commentsOverloads.types @@ -13,17 +13,17 @@ function f1(aOrb: any) { >aOrb : any return 10; ->10 : number +>10 : 10 } f1("hello"); >f1("hello") : number >f1 : { (a: number): number; (b: string): number; } ->"hello" : string +>"hello" : "hello" f1(10); >f1(10) : number >f1 : { (a: number): number; (b: string): number; } ->10 : number +>10 : 10 function f2(a: number): number; >f2 : { (a: number): number; (b: string): number; } @@ -40,17 +40,17 @@ function f2(aOrb: any) { >aOrb : any return 10; ->10 : number +>10 : 10 } f2("hello"); >f2("hello") : number >f2 : { (a: number): number; (b: string): number; } ->"hello" : string +>"hello" : "hello" f2(10); >f2(10) : number >f2 : { (a: number): number; (b: string): number; } ->10 : number +>10 : 10 function f3(a: number): number; >f3 : { (a: number): number; (b: string): number; } @@ -65,17 +65,17 @@ function f3(aOrb: any) { >aOrb : any return 10; ->10 : number +>10 : 10 } f3("hello"); >f3("hello") : number >f3 : { (a: number): number; (b: string): number; } ->"hello" : string +>"hello" : "hello" f3(10); >f3(10) : number >f3 : { (a: number): number; (b: string): number; } ->10 : number +>10 : 10 /** this is signature 4 - with number parameter*/ function f4(/**param a*/a: number): number; @@ -92,17 +92,17 @@ function f4(aOrb: any) { >aOrb : any return 10; ->10 : number +>10 : 10 } f4("hello"); >f4("hello") : number >f4 : { (a: number): number; (b: string): number; } ->"hello" : string +>"hello" : "hello" f4(10); >f4(10) : number >f4 : { (a: number): number; (b: string): number; } ->10 : number +>10 : 10 interface i1 { >i1 : i1 @@ -252,7 +252,7 @@ class c { >aorb : any return 10; ->10 : number +>10 : 10 } /** prop2 1*/ public prop2(a: number): number; @@ -268,7 +268,7 @@ class c { >aorb : any return 10; ->10 : number +>10 : 10 } public prop3(a: number): number; >prop3 : { (a: number): number; (b: string): number; } @@ -284,7 +284,7 @@ class c { >aorb : any return 10; ->10 : number +>10 : 10 } /** prop4 1*/ public prop4(a: number): number; @@ -301,7 +301,7 @@ class c { >aorb : any return 10; ->10 : number +>10 : 10 } /** prop5 1*/ public prop5(a: number): number; @@ -319,7 +319,7 @@ class c { >aorb : any return 10; ->10 : number +>10 : 10 } } class c1 { @@ -405,59 +405,59 @@ var c1_i_1 = new c1(10); >c1_i_1 : c1 >new c1(10) : c1 >c1 : typeof c1 ->10 : number +>10 : 10 var c1_i_2 = new c1("hello"); >c1_i_2 : c1 >new c1("hello") : c1 >c1 : typeof c1 ->"hello" : string +>"hello" : "hello" var c2_i_1 = new c2(10); >c2_i_1 : c2 >new c2(10) : c2 >c2 : typeof c2 ->10 : number +>10 : 10 var c2_i_2 = new c2("hello"); >c2_i_2 : c2 >new c2("hello") : c2 >c2 : typeof c2 ->"hello" : string +>"hello" : "hello" var c3_i_1 = new c3(10); >c3_i_1 : c3 >new c3(10) : c3 >c3 : typeof c3 ->10 : number +>10 : 10 var c3_i_2 = new c3("hello"); >c3_i_2 : c3 >new c3("hello") : c3 >c3 : typeof c3 ->"hello" : string +>"hello" : "hello" var c4_i_1 = new c4(10); >c4_i_1 : c4 >new c4(10) : c4 >c4 : typeof c4 ->10 : number +>10 : 10 var c4_i_2 = new c4("hello"); >c4_i_2 : c4 >new c4("hello") : c4 >c4 : typeof c4 ->"hello" : string +>"hello" : "hello" var c5_i_1 = new c5(10); >c5_i_1 : c5 >new c5(10) : c5 >c5 : typeof c5 ->10 : number +>10 : 10 var c5_i_2 = new c5("hello"); >c5_i_2 : c5 >new c5("hello") : c5 >c5 : typeof c5 ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/commentsPropertySignature1.types b/tests/baselines/reference/commentsPropertySignature1.types index 09dad1eaefb0f..f5fdf48042b96 100644 --- a/tests/baselines/reference/commentsPropertySignature1.types +++ b/tests/baselines/reference/commentsPropertySignature1.types @@ -6,7 +6,7 @@ var a = { /** own x*/ x: 0 >x : number ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/commentsVarDecl.types b/tests/baselines/reference/commentsVarDecl.types index 033590b344516..1127f5ed3f4b0 100644 --- a/tests/baselines/reference/commentsVarDecl.types +++ b/tests/baselines/reference/commentsVarDecl.types @@ -3,30 +3,30 @@ /** Variable comments*/ var myVariable = 10; // This trailing Comment1 >myVariable : number ->10 : number +>10 : 10 /** This is another variable comment*/ var anotherVariable = 30; >anotherVariable : number ->30 : number +>30 : 30 // shouldn't appear var aVar = ""; >aVar : string ->"" : string +>"" : "" /** this is multiline comment * All these variables are of number type */ var anotherAnotherVariable = 70; /* these are multiple trailing comments */ /* multiple trailing comments */ >anotherAnotherVariable : number ->70 : number +>70 : 70 /** Triple slash multiline comment*/ /** another line in the comment*/ /** comment line 2*/ var x = 70; /* multiline trailing comment >x : number ->70 : number +>70 : 70 this is multiline trailing comment */ /** Triple slash comment on the assignement shouldnt be in .d.ts file*/ @@ -39,12 +39,12 @@ x = myVariable; /** jsdocstyle comment - only this comment should be in .d.ts file*/ var n = 30; >n : number ->30 : number +>30 : 30 /** var deckaration with comment on type as well*/ var y = /** value comment */ 20; >y : number ->20 : number +>20 : 20 /// var deckaration with comment on type as well var yy = @@ -52,7 +52,7 @@ var yy = /// value comment 20; ->20 : number +>20 : 20 /** comment2 */ var z = /** lambda comment */ (x: number, y: number) => x + y; diff --git a/tests/baselines/reference/commentsVariableStatement1.types b/tests/baselines/reference/commentsVariableStatement1.types index 4bb6753db8a58..1684f25c570b5 100644 --- a/tests/baselines/reference/commentsVariableStatement1.types +++ b/tests/baselines/reference/commentsVariableStatement1.types @@ -3,5 +3,5 @@ /** Comment */ var v = 1; >v : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/commentsdoNotEmitComments.types b/tests/baselines/reference/commentsdoNotEmitComments.types index 465c841e20f66..e30555db69a86 100644 --- a/tests/baselines/reference/commentsdoNotEmitComments.types +++ b/tests/baselines/reference/commentsdoNotEmitComments.types @@ -3,7 +3,7 @@ /** Variable comments*/ var myVariable = 10; >myVariable : number ->10 : number +>10 : 10 /** function comments*/ function foo(/** parameter comment*/p: number) { @@ -18,7 +18,7 @@ var fooVar: () => void; foo(50); >foo(50) : void >foo : (p: number) => void ->50 : number +>50 : 50 fooVar(); >fooVar() : void @@ -35,7 +35,7 @@ class c { /** property comment */ public b = 10; >b : number ->10 : number +>10 : 10 /** function comment */ public myFoo() { @@ -158,9 +158,9 @@ declare var x; /** const enum member value comment (generated by TS) */ const enum color { red, green, blue } >color : color ->red : color ->green : color ->blue : color +>red : color.red +>green : color.green +>blue : color.blue var shade: color = color.green; >shade : color diff --git a/tests/baselines/reference/commentsemitComments.types b/tests/baselines/reference/commentsemitComments.types index 2594fb53fe967..03bf0912092d1 100644 --- a/tests/baselines/reference/commentsemitComments.types +++ b/tests/baselines/reference/commentsemitComments.types @@ -3,7 +3,7 @@ /** Variable comments*/ var myVariable = 10; >myVariable : number ->10 : number +>10 : 10 /** function comments*/ function foo(/** parameter comment*/p: number) { @@ -18,7 +18,7 @@ var fooVar: () => void; foo(50); >foo(50) : void >foo : (p: number) => void ->50 : number +>50 : 50 fooVar(); >fooVar() : void @@ -35,7 +35,7 @@ class c { /** property comment */ public b = 10; >b : number ->10 : number +>10 : 10 /** function comment */ public myFoo() { diff --git a/tests/baselines/reference/commonJSImportAsPrimaryExpression.types b/tests/baselines/reference/commonJSImportAsPrimaryExpression.types index 01d96b31fc73b..921c659500ce3 100644 --- a/tests/baselines/reference/commonJSImportAsPrimaryExpression.types +++ b/tests/baselines/reference/commonJSImportAsPrimaryExpression.types @@ -18,10 +18,10 @@ export class C1 { m1 = 42; >m1 : number ->42 : number +>42 : 42 static s1 = true; >s1 : boolean ->true : boolean +>true : true } diff --git a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types index 9d9faf05af806..32e45936f3349 100644 --- a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types @@ -49,11 +49,11 @@ export class C1 { m1 = 42; >m1 : number ->42 : number +>42 : 42 static s1 = true; >s1 : boolean ->true : boolean +>true : true } export interface I1 { @@ -81,8 +81,8 @@ export enum E1 { >E1 : E1 A,B,C ->A : E1 ->B : E1 ->C : E1 +>A : E1.A +>B : E1.B +>C : E1.C } diff --git a/tests/baselines/reference/commonSourceDir5.types b/tests/baselines/reference/commonSourceDir5.types index dd72099d54207..f1c3e40e983d7 100644 --- a/tests/baselines/reference/commonSourceDir5.types +++ b/tests/baselines/reference/commonSourceDir5.types @@ -19,8 +19,8 @@ export var i = Math.sqrt(-1); >Math.sqrt : (x: number) => number >Math : Math >sqrt : (x: number) => number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 export var z = pi * pi; >z : number diff --git a/tests/baselines/reference/commonSourceDir6.types b/tests/baselines/reference/commonSourceDir6.types index e30cdd2deeea5..890b95048fe98 100644 --- a/tests/baselines/reference/commonSourceDir6.types +++ b/tests/baselines/reference/commonSourceDir6.types @@ -18,8 +18,8 @@ export var i = Math.sqrt(-1); >Math.sqrt : (x: number) => number >Math : Math >sqrt : (x: number) => number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 export var z = pi * pi; >z : number diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types index a21af43e9c733..b4f1a81bff492 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: number; >a : number diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types index e132f03cfa3aa..9e3c5f59cbf9d 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types @@ -4,9 +4,9 @@ var x: any; enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c function foo(t: T) { >foo : (t: T) => void diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types index 12d9235d44b73..e185a1d501b76 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithOneOperandIsNull.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c function foo(t: T) { >foo : (t: T) => void diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types index b4a70c3e3d6f4..00f6ca234a2ee 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types @@ -5,9 +5,9 @@ var x: typeof undefined; enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c function foo(t: T) { >foo : (t: T) => void diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types index 0f07c158cc4e4..bf513174ef2f8 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeEnumAndNumber.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: E; >a : E @@ -28,34 +28,34 @@ var ra2 = b < a; var ra3 = E.a < b; >ra3 : boolean >E.a < b : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var ra4 = b < E.a; >ra4 : boolean >b < E.a : boolean >b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var ra5 = E.a < 0; >ra5 : boolean >E.a < 0 : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->0 : number +>a : E.a +>0 : 0 var ra6 = 0 < E.a; >ra6 : boolean >0 < E.a : boolean ->0 : number ->E.a : E +>0 : 0 +>E.a : E.a >E : typeof E ->a : E +>a : E.a // operator > var rb1 = a > b; @@ -73,34 +73,34 @@ var rb2 = b > a; var rb3 = E.a > b; >rb3 : boolean >E.a > b : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rb4 = b > E.a; >rb4 : boolean >b > E.a : boolean >b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rb5 = E.a > 0; >rb5 : boolean >E.a > 0 : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->0 : number +>a : E.a +>0 : 0 var rb6 = 0 > E.a; >rb6 : boolean >0 > E.a : boolean ->0 : number ->E.a : E +>0 : 0 +>E.a : E.a >E : typeof E ->a : E +>a : E.a // operator <= var rc1 = a <= b; @@ -118,34 +118,34 @@ var rc2 = b <= a; var rc3 = E.a <= b; >rc3 : boolean >E.a <= b : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rc4 = b <= E.a; >rc4 : boolean >b <= E.a : boolean >b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rc5 = E.a <= 0; >rc5 : boolean >E.a <= 0 : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->0 : number +>a : E.a +>0 : 0 var rc6 = 0 <= E.a; >rc6 : boolean >0 <= E.a : boolean ->0 : number ->E.a : E +>0 : 0 +>E.a : E.a >E : typeof E ->a : E +>a : E.a // operator >= var rd1 = a >= b; @@ -163,34 +163,34 @@ var rd2 = b >= a; var rd3 = E.a >= b; >rd3 : boolean >E.a >= b : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rd4 = b >= E.a; >rd4 : boolean >b >= E.a : boolean >b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rd5 = E.a >= 0; >rd5 : boolean >E.a >= 0 : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->0 : number +>a : E.a +>0 : 0 var rd6 = 0 >= E.a; >rd6 : boolean >0 >= E.a : boolean ->0 : number ->E.a : E +>0 : 0 +>E.a : E.a >E : typeof E ->a : E +>a : E.a // operator == var re1 = a == b; diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types index 77189e5fee233..64eb0ddfdbbe3 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types @@ -1,8 +1,8 @@ === tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts === enum E { a, b } >E : E ->a : E ->b : E +>a : E.a +>b : E.b var a: any; >a : any @@ -26,24 +26,24 @@ x1 += b; x1 += true; >x1 += true : any >x1 : any ->true : boolean +>true : true x1 += 0; >x1 += 0 : any >x1 : any ->0 : number +>0 : 0 x1 += ''; >x1 += '' : string >x1 : any ->'' : string +>'' : "" x1 += E.a; >x1 += E.a : any >x1 : any ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a x1 += {}; >x1 += {} : any @@ -76,24 +76,24 @@ x2 += b; x2 += true; >x2 += true : string >x2 : string ->true : boolean +>true : true x2 += 0; >x2 += 0 : string >x2 : string ->0 : number +>0 : 0 x2 += ''; >x2 += '' : string >x2 : string ->'' : string +>'' : "" x2 += E.a; >x2 += E.a : string >x2 : string ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a x2 += {}; >x2 += {} : string @@ -121,14 +121,14 @@ x3 += a; x3 += 0; >x3 += 0 : number >x3 : number ->0 : number +>0 : 0 x3 += E.a; >x3 += E.a : number >x3 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a x3 += null; >x3 += null : number @@ -190,7 +190,7 @@ x6 += a; x6 += ''; >x6 += '' : string >x6 : {} ->'' : string +>'' : "" var x7: void; >x7 : void diff --git a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt index 2bc8a82ed3b5d..cadc5c945d1a0 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt @@ -1,29 +1,29 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(6,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'void'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(7,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'true'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(8,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'number'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(9,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(8,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and '0'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(9,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E.a'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(10,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(11,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(12,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(15,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'void'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(16,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'boolean'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(17,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'number'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(18,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'E'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(16,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'true'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(17,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '0'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(18,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'E.a'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(19,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(20,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(21,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(24,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(25,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'boolean'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(26,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'number'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(27,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'E'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(25,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'true'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(26,1): error TS2365: Operator '+=' cannot be applied to types 'void' and '0'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(27,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'E.a'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(28,1): error TS2365: Operator '+=' cannot be applied to types 'void' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(29,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(30,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(33,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(34,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(34,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'true'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(35,1): error TS2365: Operator '+=' cannot be applied to types 'number' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(38,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'void'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(39,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'boolean'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(39,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'true'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(40,1): error TS2365: Operator '+=' cannot be applied to types 'E' and '{}'. @@ -41,10 +41,10 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'true'. x1 += 0; ~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and '0'. x1 += E.a; ~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E.a'. x1 += {}; ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and '{}'. @@ -61,13 +61,13 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'void'. x2 += true; ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'true'. x2 += 0; ~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and '0'. x2 += E.a; ~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'E'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'E.a'. x2 += {}; ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. @@ -84,13 +84,13 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. x3 += true; ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'true'. x3 += 0; ~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and '0'. x3 += E.a; ~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'E.a'. x3 += {}; ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'void' and '{}'. @@ -107,7 +107,7 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. x4 += true; ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'true'. x4 += {}; ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'number' and '{}'. @@ -118,7 +118,7 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'void'. x5 += true; ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'true'. x5 += {}; ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'E' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types index 3b346bac53b2f..81fff36594ec3 100644 --- a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types +++ b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentLHSCanBeAssigned.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: any; >a : any diff --git a/tests/baselines/reference/compoundAssignmentLHSIsReference.types b/tests/baselines/reference/compoundAssignmentLHSIsReference.types index 12c601d377f65..4816307f50895 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsReference.types +++ b/tests/baselines/reference/compoundAssignmentLHSIsReference.types @@ -54,14 +54,14 @@ x3['a'] *= value; >x3['a'] *= value : number >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any x3['a'] += value; >x3['a'] += value : any >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any // parentheses, the contained expression is reference @@ -115,7 +115,7 @@ function fn2(x4: number) { >(x3['a']) : number >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any (x3['a']) += value; @@ -123,6 +123,6 @@ function fn2(x4: number) { >(x3['a']) : number >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types index 060a231da1b4f..46f9d762ca3c5 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned1.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: any; >a : any diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types index 35f42f4fa77db..55b90382d7ba8 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types @@ -37,7 +37,7 @@ x3['a'] **= value; >x3['a'] **= value : number >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any // parentheses, the contained expression is reference @@ -71,6 +71,6 @@ function fn2(x4: number) { >(x3['a']) : number >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any diff --git a/tests/baselines/reference/compoundVarDecl1.types b/tests/baselines/reference/compoundVarDecl1.types index 40f12ea52c065..08c1716760d98 100644 --- a/tests/baselines/reference/compoundVarDecl1.types +++ b/tests/baselines/reference/compoundVarDecl1.types @@ -2,18 +2,18 @@ module Foo { var a = 1, b = 1; a = b + 2; } >Foo : typeof Foo >a : number ->1 : number +>1 : 1 >b : number ->1 : number +>1 : 1 >a = b + 2 : number >a : number >b + 2 : number >b : number ->2 : number +>2 : 2 var foo = 4, bar = 5; >foo : number ->4 : number +>4 : 4 >bar : number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt b/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt index dc536e544b23f..283f1d439b86d 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/computedPropertiesInDestructuring1.ts(20,8): error TS2349: Cannot invoke an expression whose type lacks a call signature. tests/cases/compiler/computedPropertiesInDestructuring1.ts(21,12): error TS2339: Property 'toExponential' does not exist on type 'string'. tests/cases/compiler/computedPropertiesInDestructuring1.ts(33,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. -tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: Operator '+' cannot be applied to types '1' and '{}'. ==== tests/cases/compiler/computedPropertiesInDestructuring1.ts (4 errors) ==== @@ -46,7 +46,7 @@ tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: !!! error TS2349: Cannot invoke an expression whose type lacks a call signature. [{[(1 + {})]: bar4}] = [{bar: "bar"}]; ~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. +!!! error TS2365: Operator '+' cannot be applied to types '1' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt index 96ab892d1b953..0affcfebb0cee 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(21,8): error TS2349: Cannot invoke an expression whose type lacks a call signature. tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(22,12): error TS2339: Property 'toExponential' does not exist on type 'string'. tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(34,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. -tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS2365: Operator '+' cannot be applied to types '1' and '{}'. ==== tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts (4 errors) ==== @@ -47,5 +47,5 @@ tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS23 !!! error TS2349: Cannot invoke an expression whose type lacks a call signature. [{[(1 + {})]: bar4}] = [{bar: "bar"}]; ~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. +!!! error TS2365: Operator '+' cannot be applied to types '1' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2.types b/tests/baselines/reference/computedPropertiesInDestructuring2.types index 0fa2066227047..137a0793e6dd7 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring2.types +++ b/tests/baselines/reference/computedPropertiesInDestructuring2.types @@ -2,7 +2,7 @@ let foo2 = () => "bar"; >foo2 : () => string >() => "bar" : () => string ->"bar" : string +>"bar" : "bar" let {[foo2()]: bar3} = {}; >foo2() : string diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types index f0d8b1033c829..979689438d299 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types +++ b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types @@ -3,7 +3,7 @@ let foo2 = () => "bar"; >foo2 : () => string >() => "bar" : () => string ->"bar" : string +>"bar" : "bar" let {[foo2()]: bar3} = {}; >foo2() : string diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.types b/tests/baselines/reference/computedPropertyNames10_ES5.types index b9d999397abf1..650890fb10ebe 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.types +++ b/tests/baselines/reference/computedPropertyNames10_ES5.types @@ -33,17 +33,17 @@ var v = { >s : string [""]() { }, ->"" : string +>"" : "" [0]() { }, ->0 : number +>0 : 0 [a]() { }, >a : any [true]() { }, >true : any ->true : boolean +>true : true [`hello bye`]() { }, >`hello bye` : string diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.types b/tests/baselines/reference/computedPropertyNames10_ES6.types index 1883febb39b79..2ff86ed9712d0 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.types +++ b/tests/baselines/reference/computedPropertyNames10_ES6.types @@ -33,17 +33,17 @@ var v = { >s : string [""]() { }, ->"" : string +>"" : "" [0]() { }, ->0 : number +>0 : 0 [a]() { }, >a : any [true]() { }, >true : any ->true : boolean +>true : true [`hello bye`]() { }, >`hello bye` : string diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.types b/tests/baselines/reference/computedPropertyNames11_ES5.types index e15b46cc6c174..0787a889f4031 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.types +++ b/tests/baselines/reference/computedPropertyNames11_ES5.types @@ -14,7 +14,7 @@ var v = { get [s]() { return 0; }, >s : string ->0 : number +>0 : 0 set [n](v) { }, >n : number @@ -24,7 +24,7 @@ var v = { >s + s : string >s : string >s : string ->0 : number +>0 : 0 set [s + n](v) { }, >s + n : string @@ -35,15 +35,15 @@ var v = { get [+s]() { return 0; }, >+s : number >s : string ->0 : number +>0 : 0 set [""](v) { }, ->"" : string +>"" : "" >v : any get [0]() { return 0; }, ->0 : number ->0 : number +>0 : 0 +>0 : 0 set [a](v) { }, >a : any @@ -51,8 +51,8 @@ var v = { get [true]() { return 0; }, >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 set [`hello bye`](v) { }, >`hello bye` : string @@ -61,5 +61,5 @@ var v = { get [`hello ${a} bye`]() { return 0; } >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.types b/tests/baselines/reference/computedPropertyNames11_ES6.types index eb5fc105a7a82..4783d07a2afa0 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.types +++ b/tests/baselines/reference/computedPropertyNames11_ES6.types @@ -14,7 +14,7 @@ var v = { get [s]() { return 0; }, >s : string ->0 : number +>0 : 0 set [n](v) { }, >n : number @@ -24,7 +24,7 @@ var v = { >s + s : string >s : string >s : string ->0 : number +>0 : 0 set [s + n](v) { }, >s + n : string @@ -35,15 +35,15 @@ var v = { get [+s]() { return 0; }, >+s : number >s : string ->0 : number +>0 : 0 set [""](v) { }, ->"" : string +>"" : "" >v : any get [0]() { return 0; }, ->0 : number ->0 : number +>0 : 0 +>0 : 0 set [a](v) { }, >a : any @@ -51,8 +51,8 @@ var v = { get [true]() { return 0; }, >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 set [`hello bye`](v) { }, >`hello bye` : string @@ -61,5 +61,5 @@ var v = { get [`hello ${a} bye`]() { return 0; } >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.types b/tests/baselines/reference/computedPropertyNames13_ES5.types index 59694df32a7f7..2585fe15f94e9 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.types +++ b/tests/baselines/reference/computedPropertyNames13_ES5.types @@ -32,17 +32,17 @@ class C { >s : string static [""]() { } ->"" : string +>"" : "" [0]() { } ->0 : number +>0 : 0 [a]() { } >a : any static [true]() { } >true : any ->true : boolean +>true : true [`hello bye`]() { } >`hello bye` : string diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.types b/tests/baselines/reference/computedPropertyNames13_ES6.types index a2d0f14e72c66..61e8cae265c0a 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES6.types +++ b/tests/baselines/reference/computedPropertyNames13_ES6.types @@ -32,17 +32,17 @@ class C { >s : string static [""]() { } ->"" : string +>"" : "" [0]() { } ->0 : number +>0 : 0 [a]() { } >a : any static [true]() { } >true : any ->true : boolean +>true : true [`hello bye`]() { } >`hello bye` : string diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.types b/tests/baselines/reference/computedPropertyNames16_ES5.types index ab7ea23cffea1..5c0fb34bc25dc 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.types +++ b/tests/baselines/reference/computedPropertyNames16_ES5.types @@ -13,7 +13,7 @@ class C { get [s]() { return 0;} >s : string ->0 : number +>0 : 0 set [n](v) { } >n : number @@ -23,7 +23,7 @@ class C { >s + s : string >s : string >s : string ->0 : number +>0 : 0 set [s + n](v) { } >s + n : string @@ -34,15 +34,15 @@ class C { get [+s]() { return 0; } >+s : number >s : string ->0 : number +>0 : 0 static set [""](v) { } ->"" : string +>"" : "" >v : any get [0]() { return 0; } ->0 : number ->0 : number +>0 : 0 +>0 : 0 set [a](v) { } >a : any @@ -50,8 +50,8 @@ class C { static get [true]() { return 0; } >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 set [`hello bye`](v) { } >`hello bye` : string @@ -60,5 +60,5 @@ class C { get [`hello ${a} bye`]() { return 0; } >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.types b/tests/baselines/reference/computedPropertyNames16_ES6.types index c7286e6640e1b..7ebb2cd006051 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES6.types +++ b/tests/baselines/reference/computedPropertyNames16_ES6.types @@ -13,7 +13,7 @@ class C { get [s]() { return 0;} >s : string ->0 : number +>0 : 0 set [n](v) { } >n : number @@ -23,7 +23,7 @@ class C { >s + s : string >s : string >s : string ->0 : number +>0 : 0 set [s + n](v) { } >s + n : string @@ -34,15 +34,15 @@ class C { get [+s]() { return 0; } >+s : number >s : string ->0 : number +>0 : 0 static set [""](v) { } ->"" : string +>"" : "" >v : any get [0]() { return 0; } ->0 : number ->0 : number +>0 : 0 +>0 : 0 set [a](v) { } >a : any @@ -50,8 +50,8 @@ class C { static get [true]() { return 0; } >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 set [`hello bye`](v) { } >`hello bye` : string @@ -60,5 +60,5 @@ class C { get [`hello ${a} bye`]() { return 0; } >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.types b/tests/baselines/reference/computedPropertyNames18_ES5.types index d6808a8edc001..e9de10f5acec9 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5.types +++ b/tests/baselines/reference/computedPropertyNames18_ES5.types @@ -10,6 +10,6 @@ function foo() { >this.bar : any >this : any >bar : any ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.types b/tests/baselines/reference/computedPropertyNames18_ES6.types index 11d58e48c6920..1b376e9a1e3e2 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES6.types +++ b/tests/baselines/reference/computedPropertyNames18_ES6.types @@ -10,6 +10,6 @@ function foo() { >this.bar : any >this : any >bar : any ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.types b/tests/baselines/reference/computedPropertyNames1_ES5.types index a77895e06d1fc..d0c11e448bbfd 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5.types +++ b/tests/baselines/reference/computedPropertyNames1_ES5.types @@ -5,13 +5,13 @@ var v = { get [0 + 1]() { return 0 }, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 set [0 + 1](v: string) { } //No error >0 + 1 : number ->0 : number ->1 : number +>0 : 0 +>1 : 1 >v : string } diff --git a/tests/baselines/reference/computedPropertyNames1_ES6.types b/tests/baselines/reference/computedPropertyNames1_ES6.types index 503988b0314f7..6fddad0067ce2 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES6.types +++ b/tests/baselines/reference/computedPropertyNames1_ES6.types @@ -5,13 +5,13 @@ var v = { get [0 + 1]() { return 0 }, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 set [0 + 1](v: string) { } //No error >0 + 1 : number ->0 : number ->1 : number +>0 : 0 +>1 : 1 >v : string } diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.types b/tests/baselines/reference/computedPropertyNames20_ES5.types index 65ee55be379fc..d685b52ef0628 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5.types +++ b/tests/baselines/reference/computedPropertyNames20_ES5.types @@ -7,5 +7,5 @@ var obj = { >this.bar : any >this : any >bar : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames20_ES6.types b/tests/baselines/reference/computedPropertyNames20_ES6.types index 91e5c8d78433b..af475ee66e6b3 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES6.types +++ b/tests/baselines/reference/computedPropertyNames20_ES6.types @@ -7,5 +7,5 @@ var obj = { >this.bar : any >this : any >bar : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.types b/tests/baselines/reference/computedPropertyNames22_ES5.types index eeec22d2e6129..e244d4fb554de 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.types +++ b/tests/baselines/reference/computedPropertyNames22_ES5.types @@ -17,6 +17,6 @@ class C { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames22_ES6.types b/tests/baselines/reference/computedPropertyNames22_ES6.types index af9ef9d3a317f..06329679bfbe5 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES6.types +++ b/tests/baselines/reference/computedPropertyNames22_ES6.types @@ -17,6 +17,6 @@ class C { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.types b/tests/baselines/reference/computedPropertyNames25_ES5.types index f1acc296709a5..aed429942551a 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.types +++ b/tests/baselines/reference/computedPropertyNames25_ES5.types @@ -6,7 +6,7 @@ class Base { >bar : () => number return 0; ->0 : number +>0 : 0 } } class C extends Base { @@ -28,6 +28,6 @@ class C extends Base { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames25_ES6.types b/tests/baselines/reference/computedPropertyNames25_ES6.types index 26c3801390640..73a4ca912f9bc 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES6.types +++ b/tests/baselines/reference/computedPropertyNames25_ES6.types @@ -6,7 +6,7 @@ class Base { >bar : () => number return 0; ->0 : number +>0 : 0 } } class C extends Base { @@ -28,6 +28,6 @@ class C extends Base { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.types b/tests/baselines/reference/computedPropertyNames28_ES5.types index 89a2a7ac017e6..0d816d980fe82 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.types +++ b/tests/baselines/reference/computedPropertyNames28_ES5.types @@ -16,11 +16,11 @@ class C extends Base { >{ [(super(), "prop")]() { } } : { [x: string]: () => void; } [(super(), "prop")]() { } ->(super(), "prop") : string ->super(), "prop" : string +>(super(), "prop") : "prop" +>super(), "prop" : "prop" >super() : void >super : typeof Base ->"prop" : string +>"prop" : "prop" }; } diff --git a/tests/baselines/reference/computedPropertyNames28_ES6.types b/tests/baselines/reference/computedPropertyNames28_ES6.types index df020c9a5ff55..7c803ec43afaa 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES6.types +++ b/tests/baselines/reference/computedPropertyNames28_ES6.types @@ -16,11 +16,11 @@ class C extends Base { >{ [(super(), "prop")]() { } } : { [x: string]: () => void; } [(super(), "prop")]() { } ->(super(), "prop") : string ->super(), "prop" : string +>(super(), "prop") : "prop" +>super(), "prop" : "prop" >super() : void >super : typeof Base ->"prop" : string +>"prop" : "prop" }; } diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.types b/tests/baselines/reference/computedPropertyNames29_ES5.types index d2f89ef6b18e8..3f825c244e022 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.types +++ b/tests/baselines/reference/computedPropertyNames29_ES5.types @@ -21,6 +21,6 @@ class C { }; } return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames29_ES6.types b/tests/baselines/reference/computedPropertyNames29_ES6.types index bb324b2b38250..a1375622271b9 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES6.types +++ b/tests/baselines/reference/computedPropertyNames29_ES6.types @@ -21,6 +21,6 @@ class C { }; } return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.types b/tests/baselines/reference/computedPropertyNames31_ES5.types index 832b2bc067a62..37661cbec118c 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.types +++ b/tests/baselines/reference/computedPropertyNames31_ES5.types @@ -6,7 +6,7 @@ class Base { >bar : () => number return 0; ->0 : number +>0 : 0 } } class C extends Base { @@ -32,6 +32,6 @@ class C extends Base { }; } return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.types b/tests/baselines/reference/computedPropertyNames31_ES6.types index 4f59b1e8c6d34..dbb4f47662eae 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES6.types +++ b/tests/baselines/reference/computedPropertyNames31_ES6.types @@ -6,7 +6,7 @@ class Base { >bar : () => number return 0; ->0 : number +>0 : 0 } } class C extends Base { @@ -32,6 +32,6 @@ class C extends Base { }; } return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.types b/tests/baselines/reference/computedPropertyNames33_ES5.types index 7031981481f62..046d4bf96a9a8 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.types +++ b/tests/baselines/reference/computedPropertyNames33_ES5.types @@ -2,7 +2,7 @@ function foo() { return '' } >foo : () => string >T : T ->'' : string +>'' : "" class C { >C : C @@ -22,6 +22,6 @@ class C { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames33_ES6.types b/tests/baselines/reference/computedPropertyNames33_ES6.types index 3c57daf2ace16..07cf7c1639f21 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES6.types +++ b/tests/baselines/reference/computedPropertyNames33_ES6.types @@ -2,7 +2,7 @@ function foo() { return '' } >foo : () => string >T : T ->'' : string +>'' : "" class C { >C : C @@ -22,6 +22,6 @@ class C { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.types b/tests/baselines/reference/computedPropertyNames37_ES5.types index 21b68c7c12cb3..b1ba3a4315e95 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5.types +++ b/tests/baselines/reference/computedPropertyNames37_ES5.types @@ -17,12 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } ->"get1" : string +>"get1" : "get1" >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } ->"set1" : string +>"set1" : "set1" >p : Foo2 >Foo2 : Foo2 } diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.types b/tests/baselines/reference/computedPropertyNames37_ES6.types index e436a54172bbc..67c84380e8b50 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES6.types +++ b/tests/baselines/reference/computedPropertyNames37_ES6.types @@ -17,12 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } ->"get1" : string +>"get1" : "get1" >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } ->"set1" : string +>"set1" : "set1" >p : Foo2 >Foo2 : Foo2 } diff --git a/tests/baselines/reference/computedPropertyNames41_ES5.types b/tests/baselines/reference/computedPropertyNames41_ES5.types index 5aa7ae44404f1..0be69bec4a5ea 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES5.types +++ b/tests/baselines/reference/computedPropertyNames41_ES5.types @@ -17,7 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } ->"" : string +>"" : "" >new Foo : Foo >Foo : typeof Foo } diff --git a/tests/baselines/reference/computedPropertyNames41_ES6.types b/tests/baselines/reference/computedPropertyNames41_ES6.types index 70bfcf12a7548..297a41eececdc 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES6.types +++ b/tests/baselines/reference/computedPropertyNames41_ES6.types @@ -17,7 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } ->"" : string +>"" : "" >new Foo : Foo >Foo : typeof Foo } diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.types b/tests/baselines/reference/computedPropertyNames46_ES5.types index b8df0d56e1398..7ea3ffda24410 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5.types +++ b/tests/baselines/reference/computedPropertyNames46_ES5.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES5.ts === var o = { ->o : { [x: string]: number; } ->{ ["" || 0]: 0} : { [x: string]: number; } +>o : { [x: number]: number; } +>{ ["" || 0]: 0} : { [x: number]: number; } ["" || 0]: 0 ->"" || 0 : string | number ->"" : string ->0 : number ->0 : number +>"" || 0 : 0 +>"" : "" +>0 : 0 +>0 : 0 }; diff --git a/tests/baselines/reference/computedPropertyNames46_ES6.types b/tests/baselines/reference/computedPropertyNames46_ES6.types index a786eca200c35..3914f6facefab 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES6.types +++ b/tests/baselines/reference/computedPropertyNames46_ES6.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES6.ts === var o = { ->o : { [x: string]: number; } ->{ ["" || 0]: 0} : { [x: string]: number; } +>o : { [x: number]: number; } +>{ ["" || 0]: 0} : { [x: number]: number; } ["" || 0]: 0 ->"" || 0 : string | number ->"" : string ->0 : number ->0 : number +>"" || 0 : 0 +>"" : "" +>0 : 0 +>0 : 0 }; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.types b/tests/baselines/reference/computedPropertyNames47_ES5.types index cdc2c3301f66b..19811ae8ec29c 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5.types +++ b/tests/baselines/reference/computedPropertyNames47_ES5.types @@ -19,6 +19,6 @@ var o = { >E2.x : E2 >E2 : typeof E2 >x : E2 ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/computedPropertyNames47_ES6.types b/tests/baselines/reference/computedPropertyNames47_ES6.types index a923e934d66d7..46edecb450a45 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES6.types +++ b/tests/baselines/reference/computedPropertyNames47_ES6.types @@ -19,6 +19,6 @@ var o = { >E2.x : E2 >E2 : typeof E2 >x : E2 ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.types b/tests/baselines/reference/computedPropertyNames48_ES5.types index 12752d8abeb15..545dc64143429 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.types +++ b/tests/baselines/reference/computedPropertyNames48_ES5.types @@ -21,7 +21,7 @@ extractIndexer({ [a]: "" >a : any ->"" : string +>"" : "" }); // Should return string @@ -34,19 +34,19 @@ extractIndexer({ >E.x : E >E : typeof E >x : E ->"" : string +>"" : "" }); // Should return string extractIndexer({ >extractIndexer({ ["" || 0]: ""}) : string >extractIndexer : (p: { [n: number]: T; }) => T ->{ ["" || 0]: ""} : { [x: string]: string; } +>{ ["" || 0]: ""} : { [x: number]: string; } ["" || 0]: "" ->"" || 0 : string | number ->"" : string ->0 : number ->"" : string +>"" || 0 : 0 +>"" : "" +>0 : 0 +>"" : "" }); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames48_ES6.types b/tests/baselines/reference/computedPropertyNames48_ES6.types index 832bc3c702557..0f352b57d2447 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES6.types +++ b/tests/baselines/reference/computedPropertyNames48_ES6.types @@ -21,7 +21,7 @@ extractIndexer({ [a]: "" >a : any ->"" : string +>"" : "" }); // Should return string @@ -34,19 +34,19 @@ extractIndexer({ >E.x : E >E : typeof E >x : E ->"" : string +>"" : "" }); // Should return string extractIndexer({ >extractIndexer({ ["" || 0]: ""}) : string >extractIndexer : (p: { [n: number]: T; }) => T ->{ ["" || 0]: ""} : { [x: string]: string; } +>{ ["" || 0]: ""} : { [x: number]: string; } ["" || 0]: "" ->"" || 0 : string | number ->"" : string ->0 : number ->"" : string +>"" || 0 : 0 +>"" : "" +>0 : 0 +>"" : "" }); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.types b/tests/baselines/reference/computedPropertyNames4_ES5.types index a71b3984ec8fb..64ef5f6a61119 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.types +++ b/tests/baselines/reference/computedPropertyNames4_ES5.types @@ -14,7 +14,7 @@ var v = { [s]: 0, >s : string ->0 : number +>0 : 0 [n]: n, >n : number @@ -24,13 +24,13 @@ var v = { >s + s : string >s : string >s : string ->1 : number +>1 : 1 [s + n]: 2, >s + n : string >s : string >n : number ->2 : number +>2 : 2 [+s]: s, >+s : number @@ -38,28 +38,28 @@ var v = { >s : string [""]: 0, ->"" : string ->0 : number +>"" : "" +>0 : 0 [0]: 0, ->0 : number ->0 : number +>0 : 0 +>0 : 0 [a]: 1, >a : any ->1 : number +>1 : 1 [true]: 0, >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 [`hello bye`]: 0, >`hello bye` : string ->0 : number +>0 : 0 [`hello ${a} bye`]: 0 >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.types b/tests/baselines/reference/computedPropertyNames4_ES6.types index a4bcc59711c11..0c608e2160114 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.types +++ b/tests/baselines/reference/computedPropertyNames4_ES6.types @@ -14,7 +14,7 @@ var v = { [s]: 0, >s : string ->0 : number +>0 : 0 [n]: n, >n : number @@ -24,13 +24,13 @@ var v = { >s + s : string >s : string >s : string ->1 : number +>1 : 1 [s + n]: 2, >s + n : string >s : string >n : number ->2 : number +>2 : 2 [+s]: s, >+s : number @@ -38,28 +38,28 @@ var v = { >s : string [""]: 0, ->"" : string ->0 : number +>"" : "" +>0 : 0 [0]: 0, ->0 : number ->0 : number +>0 : 0 +>0 : 0 [a]: 1, >a : any ->1 : number +>1 : 1 [true]: 0, >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 [`hello bye`]: 0, >`hello bye` : string ->0 : number +>0 : 0 [`hello ${a} bye`]: 0 >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.types b/tests/baselines/reference/computedPropertyNames7_ES5.types index 3411198b59070..fbc070e39514f 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5.types +++ b/tests/baselines/reference/computedPropertyNames7_ES5.types @@ -13,5 +13,5 @@ var v = { >E.member : E >E : typeof E >member : E ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames7_ES6.types b/tests/baselines/reference/computedPropertyNames7_ES6.types index eb72d546dbcd5..f8f1dd7f7917d 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES6.types +++ b/tests/baselines/reference/computedPropertyNames7_ES6.types @@ -13,5 +13,5 @@ var v = { >E.member : E >E : typeof E >member : E ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt index 7fa95fe942616..f277df6f4c8f6 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts(5,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts(5,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts (1 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt index 116cd1a25311e..689ec135d3f10 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES6.ts(5,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES6.ts(5,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES6.ts (1 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types index 09cad59462448..05ae43cf69b46 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types @@ -18,8 +18,8 @@ var o: I = { ["" + 0](y) { return y.length; }, >"" + 0 : string ->"" : string ->0 : number +>"" : "" +>0 : 0 >y : string >y.length : number >y : string @@ -27,8 +27,8 @@ var o: I = { ["" + 1]: y => y.length >"" + 1 : string ->"" : string ->1 : number +>"" : "" +>1 : 1 >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types index d9e9970ebec6a..9caae76eedab3 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types @@ -18,8 +18,8 @@ var o: I = { ["" + 0](y) { return y.length; }, >"" + 0 : string ->"" : string ->0 : number +>"" : "" +>0 : 0 >y : string >y.length : number >y : string @@ -27,8 +27,8 @@ var o: I = { ["" + 1]: y => y.length >"" + 1 : string ->"" : string ->1 : number +>"" : "" +>1 : 1 >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types index 5a5c48f253662..a9ca7b5ac6c6f 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types @@ -18,7 +18,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number ->"foo" : string +>"foo" : "foo" >y : string >y.length : number >y : string @@ -26,7 +26,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number ->"bar" : string +>"bar" : "bar" >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types index 330351790ca04..990b22b178fe1 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types @@ -18,7 +18,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number ->"foo" : string +>"foo" : "foo" >y : string >y.length : number >y : string @@ -26,7 +26,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number ->"bar" : string +>"bar" : "bar" >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types index faff27c9154ba..58c6c3c58f2f4 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types @@ -14,7 +14,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number ->"foo" : string +>"foo" : "foo" >y : string >y.length : number >y : string @@ -22,7 +22,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number ->"bar" : string +>"bar" : "bar" >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types index 18c3295794485..89f62c9a02ddd 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types @@ -14,7 +14,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number ->"foo" : string +>"foo" : "foo" >y : string >y.length : number >y : string @@ -22,7 +22,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number ->"bar" : string +>"bar" : "bar" >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types index 6f75f1a363338..1fe66e50ce5cd 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types @@ -16,13 +16,13 @@ var o: I = { [""+"foo"]: "", >""+"foo" : string ->"" : string ->"foo" : string ->"" : string +>"" : "" +>"foo" : "foo" +>"" : "" [""+"bar"]: 0 >""+"bar" : string ->"" : string ->"bar" : string ->0 : number +>"" : "" +>"bar" : "bar" +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types index 9ee84176237af..0a74effe990bf 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types @@ -16,13 +16,13 @@ var o: I = { [""+"foo"]: "", >""+"foo" : string ->"" : string ->"foo" : string ->"" : string +>"" : "" +>"foo" : "foo" +>"" : "" [""+"bar"]: 0 >""+"bar" : string ->"" : string ->"bar" : string ->0 : number +>"" : "" +>"bar" : "bar" +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types index 38594f756ab61..5721a1fcc86a9 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types @@ -16,11 +16,11 @@ var o: I = { [+"foo"]: "", >+"foo" : number ->"foo" : string ->"" : string +>"foo" : "foo" +>"" : "" [+"bar"]: 0 >+"bar" : number ->"bar" : string ->0 : number +>"bar" : "bar" +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types index a07b2e8cd95c1..a63da9b633d6c 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types @@ -16,11 +16,11 @@ var o: I = { [+"foo"]: "", >+"foo" : number ->"foo" : string ->"" : string +>"foo" : "foo" +>"" : "" [+"bar"]: 0 >+"bar" : number ->"bar" : string ->0 : number +>"bar" : "bar" +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types index 564689ffdeb5a..636510726446d 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types @@ -19,31 +19,31 @@ declare function foo(obj: I): T foo({ >foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] >foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | true | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } +>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: true | "" | 0 | (() => void) | number[]; [x: number]: 0 | (() => void) | number[]; 0: () => void; p: ""; } p: "", >p : string ->"" : string +>"" : "" 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string ->"hi" : string ->"bye" : string +>"hi" : "hi" +>"bye" : "bye" >true : true [0 + 1]: 0, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 [+"hi"]: [0] >+"hi" : number ->"hi" : string +>"hi" : "hi" >[0] : number[] ->0 : number +>0 : 0 }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types index a771faba97e5a..fa34f015a2361 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types @@ -19,31 +19,31 @@ declare function foo(obj: I): T foo({ >foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] >foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | true | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } +>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: true | "" | 0 | (() => void) | number[]; [x: number]: 0 | (() => void) | number[]; 0: () => void; p: ""; } p: "", >p : string ->"" : string +>"" : "" 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string ->"hi" : string ->"bye" : string +>"hi" : "hi" +>"bye" : "bye" >true : true [0 + 1]: 0, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 [+"hi"]: [0] >+"hi" : number ->"hi" : string +>"hi" : "hi" >[0] : number[] ->0 : number +>0 : 0 }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types index c209945630332..b77a129a0b43e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types @@ -42,21 +42,21 @@ foo({ ["hi" + "bye"]: true, >"hi" + "bye" : string ->"hi" : string ->"bye" : string ->true : boolean +>"hi" : "hi" +>"bye" : "bye" +>true : true [0 + 1]: 0, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 [+"hi"]: [0] >+"hi" : number ->"hi" : string +>"hi" : "hi" >[0] : number[] ->0 : number +>0 : 0 }); @@ -65,5 +65,5 @@ g({ p: "" }); >g : (obj: J) => T >{ p: "" } : { p: string; } >p : string ->"" : string +>"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types index 6ae7d7eeadacc..f041b2b4eb49a 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types @@ -42,21 +42,21 @@ foo({ ["hi" + "bye"]: true, >"hi" + "bye" : string ->"hi" : string ->"bye" : string ->true : boolean +>"hi" : "hi" +>"bye" : "bye" +>true : true [0 + 1]: 0, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 [+"hi"]: [0] >+"hi" : number ->"hi" : string +>"hi" : "hi" >[0] : number[] ->0 : number +>0 : 0 }); @@ -65,5 +65,5 @@ g({ p: "" }); >g : (obj: J) => T >{ p: "" } : { p: string; } >p : string ->"" : string +>"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt index ee36609095a04..6bfc98ae6a82a 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(6,5): error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [""+"foo"]: "", [""+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt index 1048fd2e119e7..30f0b6f529e95 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(6,5): error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [""+"foo"]: "", [""+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt index e76b3a704dc6e..4f94dd3467f85 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(6,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(6,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt index 468ad400c26cc..5eeccfe729302 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(6,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(6,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types index a05d555649582..dd12b763441a4 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types @@ -4,18 +4,18 @@ class C { ["" + ""]() { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" get ["" + ""]() { return 0; } >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types index 8b635956dcd46..2ee96225fb924 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types @@ -4,18 +4,18 @@ class C { ["" + ""]() { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" get ["" + ""]() { return 0; } >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types index c49010b2c0940..30fc69390e538 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types @@ -4,18 +4,18 @@ class C { static ["" + ""]() { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" static get ["" + ""]() { return 0; } >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 static set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types index 0b0083b9a1ad1..181b935790c81 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types @@ -4,18 +4,18 @@ class C { static ["" + ""]() { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" static get ["" + ""]() { return 0; } >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 static set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types index 0653059b53598..fd5971fc84958 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types @@ -5,24 +5,24 @@ var v = { ["" + ""]: 0, >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 ["" + ""]() { }, >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" get ["" + ""]() { return 0; }, >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types index 45d1e74f24a33..886d93e061cc4 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types @@ -5,24 +5,24 @@ var v = { ["" + ""]: 0, >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 ["" + ""]() { }, >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" get ["" + ""]() { return 0; }, >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types index 528591441b0ad..555782bf6cf1f 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types @@ -3,14 +3,14 @@ class C { >C : C ["hello"]() { ->"hello" : string +>"hello" : "hello" debugger; } get ["goodbye"]() { ->"goodbye" : string +>"goodbye" : "goodbye" return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types index cd7b75384b093..93ce203c0efa2 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types @@ -3,14 +3,14 @@ class C { >C : C ["hello"]() { ->"hello" : string +>"hello" : "hello" debugger; } get ["goodbye"]() { ->"goodbye" : string +>"goodbye" : "goodbye" return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types index 29b64c990c2bb..bf2352f338d8b 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types @@ -4,14 +4,14 @@ var v = { >{ ["hello"]() { debugger; }, get ["goodbye"]() { return 0; }} : { ["hello"](): void; readonly ["goodbye"]: number; } ["hello"]() { ->"hello" : string +>"hello" : "hello" debugger; }, get ["goodbye"]() { ->"goodbye" : string +>"goodbye" : "goodbye" return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types index fea16b5de8d06..ae4429d043702 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types @@ -4,14 +4,14 @@ var v = { >{ ["hello"]() { debugger; }, get ["goodbye"]() { return 0; }} : { ["hello"](): void; readonly ["goodbye"]: number; } ["hello"]() { ->"hello" : string +>"hello" : "hello" debugger; }, get ["goodbye"]() { ->"goodbye" : string +>"goodbye" : "goodbye" return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types index d003b6b32f110..9a99ae7605bd9 100644 --- a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types @@ -4,7 +4,7 @@ class C { static staticProp = 10; >staticProp : number ->10 : number +>10 : 10 get [C.staticProp]() { >C.staticProp : number @@ -12,7 +12,7 @@ class C { >staticProp : number return "hello"; ->"hello" : string +>"hello" : "hello" } set [C.staticProp](x: string) { >C.staticProp : number diff --git a/tests/baselines/reference/concatError.types b/tests/baselines/reference/concatError.types index 9624342bd2141..bb9a85a91b4c6 100644 --- a/tests/baselines/reference/concatError.types +++ b/tests/baselines/reference/concatError.types @@ -20,7 +20,7 @@ fa = fa.concat([0]); >fa : number[] >concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } >[0] : number[] ->0 : number +>0 : 0 fa = fa.concat(0); >fa = fa.concat(0) : number[] @@ -29,7 +29,7 @@ fa = fa.concat(0); >fa.concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } >fa : number[] >concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/concatTuples.types b/tests/baselines/reference/concatTuples.types index 3923470b78d5a..fbb3ce96a5743 100644 --- a/tests/baselines/reference/concatTuples.types +++ b/tests/baselines/reference/concatTuples.types @@ -3,8 +3,8 @@ let ijs: [number, number][] = [[1, 2]]; >ijs : [number, number][] >[[1, 2]] : [number, number][] >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 ijs = ijs.concat([[3, 4], [5, 6]]); >ijs = ijs.concat([[3, 4], [5, 6]]) : [number, number][] @@ -15,9 +15,9 @@ ijs = ijs.concat([[3, 4], [5, 6]]); >concat : { (...items: [number, number][][]): [number, number][]; (...items: ([number, number] | [number, number][])[]): [number, number][]; } >[[3, 4], [5, 6]] : [number, number][] >[3, 4] : [number, number] ->3 : number ->4 : number +>3 : 3 +>4 : 4 >[5, 6] : [number, number] ->5 : number ->6 : number +>5 : 5 +>6 : 6 diff --git a/tests/baselines/reference/conditionalExpression1.errors.txt b/tests/baselines/reference/conditionalExpression1.errors.txt index 0e2919867858d..66af533680866 100644 --- a/tests/baselines/reference/conditionalExpression1.errors.txt +++ b/tests/baselines/reference/conditionalExpression1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. +tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type '"" | 1' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/compiler/conditionalExpression1.ts (1 errors) ==== var x: boolean = (true ? 1 : ""); // should be an error ~ -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type '"" | 1' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalExpressions2.types b/tests/baselines/reference/conditionalExpressions2.types index 77714e664fb01..0247b0f649d80 100644 --- a/tests/baselines/reference/conditionalExpressions2.types +++ b/tests/baselines/reference/conditionalExpressions2.types @@ -2,53 +2,53 @@ var a = false ? 1 : null; >a : number ->false ? 1 : null : number ->false : boolean ->1 : number +>false ? 1 : null : 1 +>false : false +>1 : 1 >null : null var b = false ? undefined : 0; >b : number ->false ? undefined : 0 : number ->false : boolean +>false ? undefined : 0 : 0 +>false : false >undefined : undefined ->0 : number +>0 : 0 var c = false ? 1 : 0; >c : number ->false ? 1 : 0 : number ->false : boolean ->1 : number ->0 : number +>false ? 1 : 0 : 0 | 1 +>false : false +>1 : 1 +>0 : 0 var d = false ? false : true; >d : boolean >false ? false : true : boolean ->false : boolean ->false : boolean ->true : boolean +>false : false +>false : false +>true : true var e = false ? "foo" : "bar"; >e : string ->false ? "foo" : "bar" : string ->false : boolean ->"foo" : string ->"bar" : string +>false ? "foo" : "bar" : "foo" | "bar" +>false : false +>"foo" : "foo" +>"bar" : "bar" var f = false ? null : undefined; >f : any >false ? null : undefined : null ->false : boolean +>false : false >null : null >undefined : undefined var g = true ? {g:5} : null; >g : { g: number; } >true ? {g:5} : null : { g: number; } ->true : boolean +>true : true >{g:5} : { g: number; } >g : number ->5 : number +>5 : 5 >null : null var h = [{h:5}, null]; @@ -56,14 +56,14 @@ var h = [{h:5}, null]; >[{h:5}, null] : { h: number; }[] >{h:5} : { h: number; } >h : number ->5 : number +>5 : 5 >null : null function i() { if (true) { return { x: 5 }; } else { return null; } } >i : () => { x: number; } ->true : boolean +>true : true >{ x: 5 } : { x: number; } >x : number ->5 : number +>5 : 5 >null : null diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.errors.txt b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.errors.txt new file mode 100644 index 0000000000000..25153c1ba15c7 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.errors.txt @@ -0,0 +1,71 @@ +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsBooleanType.ts(35,1): error TS2365: Operator '>' cannot be applied to types '2' and '1'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsBooleanType.ts(58,23): error TS2365: Operator '>' cannot be applied to types '2' and '1'. + + +==== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsBooleanType.ts (2 errors) ==== + //Cond ? Expr1 : Expr2, Cond is of boolean type, Expr1 and Expr2 have the same type + var condBoolean: boolean; + + var exprAny1: any; + var exprBoolean1: boolean; + var exprNumber1: number; + var exprString1: string; + var exprIsObject1: Object; + + var exprAny2: any; + var exprBoolean2: boolean; + var exprNumber2: number; + var exprString2: string; + var exprIsObject2: Object; + + //Cond is a boolean type variable + condBoolean ? exprAny1 : exprAny2; + condBoolean ? exprBoolean1 : exprBoolean2; + condBoolean ? exprNumber1 : exprNumber2; + condBoolean ? exprString1 : exprString2; + condBoolean ? exprIsObject1 : exprIsObject2; + condBoolean ? exprString1 : exprBoolean1; // union + + //Cond is a boolean type literal + true ? exprAny1 : exprAny2; + false ? exprBoolean1 : exprBoolean2; + true ? exprNumber1 : exprNumber2; + false ? exprString1 : exprString2; + true ? exprIsObject1 : exprIsObject2; + true ? exprString1 : exprBoolean1; // union + + //Cond is a boolean type expression + !true ? exprAny1 : exprAny2; + typeof "123" == "string" ? exprBoolean1 : exprBoolean2; + 2 > 1 ? exprNumber1 : exprNumber2; + ~~~~~ +!!! error TS2365: Operator '>' cannot be applied to types '2' and '1'. + null === undefined ? exprString1 : exprString2; + true || false ? exprIsObject1 : exprIsObject2; + null === undefined ? exprString1 : exprBoolean1; // union + + //Results shoud be same as Expr1 and Expr2 + var resultIsAny1 = condBoolean ? exprAny1 : exprAny2; + var resultIsBoolean1 = condBoolean ? exprBoolean1 : exprBoolean2; + var resultIsNumber1 = condBoolean ? exprNumber1 : exprNumber2; + var resultIsString1 = condBoolean ? exprString1 : exprString2; + var resultIsObject1 = condBoolean ? exprIsObject1 : exprIsObject2; + var resultIsStringOrBoolean1 = condBoolean ? exprString1 : exprBoolean1; // union + + var resultIsAny2 = true ? exprAny1 : exprAny2; + var resultIsBoolean2 = false ? exprBoolean1 : exprBoolean2; + var resultIsNumber2 = true ? exprNumber1 : exprNumber2; + var resultIsString2 = false ? exprString1 : exprString2; + var resultIsObject2 = true ? exprIsObject1 : exprIsObject2; + var resultIsStringOrBoolean2 = true ? exprString1 : exprBoolean1; // union + var resultIsStringOrBoolean3 = false ? exprString1 : exprBoolean1; // union + + var resultIsAny3 = !true ? exprAny1 : exprAny2; + var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; + var resultIsNumber3 = 2 > 1 ? exprNumber1 : exprNumber2; + ~~~~~ +!!! error TS2365: Operator '>' cannot be applied to types '2' and '1'. + var resultIsString3 = null === undefined ? exprString1 : exprString2; + var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; + var resultIsStringOrBoolean4 = typeof "123" === "string" ? exprString1 : exprBoolean1; // union + \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types index 5951dc0735008..f1d7e7bd369cb 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types @@ -75,73 +75,73 @@ condNumber ? exprString1 : exprBoolean1; // Union //Cond is a number type literal 1 ? exprAny1 : exprAny2; >1 ? exprAny1 : exprAny2 : any ->1 : number +>1 : 1 >exprAny1 : any >exprAny2 : any 0 ? exprBoolean1 : exprBoolean2; >0 ? exprBoolean1 : exprBoolean2 : boolean ->0 : number +>0 : 0 >exprBoolean1 : boolean >exprBoolean2 : boolean 0.123456789 ? exprNumber1 : exprNumber2; >0.123456789 ? exprNumber1 : exprNumber2 : number ->0.123456789 : number +>0.123456789 : 0.123456789 >exprNumber1 : number >exprNumber2 : number - 10000000000000 ? exprString1 : exprString2; >- 10000000000000 ? exprString1 : exprString2 : string ->- 10000000000000 : number ->10000000000000 : number +>- 10000000000000 : -10000000000000 +>10000000000000 : 10000000000000 >exprString1 : string >exprString2 : string 1000000000000 ? exprIsObject1 : exprIsObject2; >1000000000000 ? exprIsObject1 : exprIsObject2 : Object ->1000000000000 : number +>1000000000000 : 1000000000000 >exprIsObject1 : Object >exprIsObject2 : Object 10000 ? exprString1 : exprBoolean1; // Union >10000 ? exprString1 : exprBoolean1 : string | boolean ->10000 : number +>10000 : 10000 >exprString1 : string >exprBoolean1 : boolean //Cond is a number type expression function foo() { return 1 }; >foo : () => number ->1 : number +>1 : 1 var array = [1, 2, 3]; >array : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 * 0 ? exprAny1 : exprAny2; >1 * 0 ? exprAny1 : exprAny2 : any >1 * 0 : number ->1 : number ->0 : number +>1 : 1 +>0 : 0 >exprAny1 : any >exprAny2 : any 1 + 1 ? exprBoolean1 : exprBoolean2; >1 + 1 ? exprBoolean1 : exprBoolean2 : boolean >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 >exprBoolean1 : boolean >exprBoolean2 : boolean "string".length ? exprNumber1 : exprNumber2; >"string".length ? exprNumber1 : exprNumber2 : number >"string".length : number ->"string" : string +>"string" : "string" >length : number >exprNumber1 : number >exprNumber2 : number @@ -160,7 +160,7 @@ foo() / array[1] ? exprIsObject1 : exprIsObject2; >foo : () => number >array[1] : number >array : number[] ->1 : number +>1 : 1 >exprIsObject1 : Object >exprIsObject2 : Object @@ -217,43 +217,43 @@ var resultIsStringOrBoolean1 = condNumber ? exprString1 : exprBoolean1; // Union var resultIsAny2 = 1 ? exprAny1 : exprAny2; >resultIsAny2 : any >1 ? exprAny1 : exprAny2 : any ->1 : number +>1 : 1 >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = 0 ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >0 ? exprBoolean1 : exprBoolean2 : boolean ->0 : number +>0 : 0 >exprBoolean1 : boolean >exprBoolean2 : boolean var resultIsNumber2 = 0.123456789 ? exprNumber1 : exprNumber2; >resultIsNumber2 : number >0.123456789 ? exprNumber1 : exprNumber2 : number ->0.123456789 : number +>0.123456789 : 0.123456789 >exprNumber1 : number >exprNumber2 : number var resultIsString2 = - 10000000000000 ? exprString1 : exprString2; >resultIsString2 : string >- 10000000000000 ? exprString1 : exprString2 : string ->- 10000000000000 : number ->10000000000000 : number +>- 10000000000000 : -10000000000000 +>10000000000000 : 10000000000000 >exprString1 : string >exprString2 : string var resultIsObject2 = 1000000000000 ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >1000000000000 ? exprIsObject1 : exprIsObject2 : Object ->1000000000000 : number +>1000000000000 : 1000000000000 >exprIsObject1 : Object >exprIsObject2 : Object var resultIsStringOrBoolean2 = 10000 ? exprString1 : exprBoolean1; // Union >resultIsStringOrBoolean2 : string | boolean >10000 ? exprString1 : exprBoolean1 : string | boolean ->10000 : number +>10000 : 10000 >exprString1 : string >exprBoolean1 : boolean @@ -261,8 +261,8 @@ var resultIsAny3 = 1 * 0 ? exprAny1 : exprAny2; >resultIsAny3 : any >1 * 0 ? exprAny1 : exprAny2 : any >1 * 0 : number ->1 : number ->0 : number +>1 : 1 +>0 : 0 >exprAny1 : any >exprAny2 : any @@ -270,8 +270,8 @@ var resultIsBoolean3 = 1 + 1 ? exprBoolean1 : exprBoolean2; >resultIsBoolean3 : boolean >1 + 1 ? exprBoolean1 : exprBoolean2 : boolean >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -279,7 +279,7 @@ var resultIsNumber3 = "string".length ? exprNumber1 : exprNumber2; >resultIsNumber3 : number >"string".length ? exprNumber1 : exprNumber2 : number >"string".length : number ->"string" : string +>"string" : "string" >length : number >exprNumber1 : number >exprNumber2 : number @@ -300,7 +300,7 @@ var resultIsObject3 = foo() / array[1] ? exprIsObject1 : exprIsObject2; >foo : () => number >array[1] : number >array : number[] ->1 : number +>1 : 1 >exprIsObject1 : Object >exprIsObject2 : Object @@ -312,7 +312,7 @@ var resultIsStringOrBoolean3 = foo() / array[1] ? exprString1 : exprBoolean1; // >foo : () => number >array[1] : number >array : number[] ->1 : number +>1 : 1 >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types index 14a0f375ead04..34cfe67f6021e 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types @@ -115,9 +115,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprString1 : string >exprString2 : string @@ -126,9 +126,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprIsObject1 : Object >exprIsObject2 : Object @@ -137,9 +137,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprString1 : string >exprBoolean1 : boolean @@ -271,9 +271,9 @@ var resultIsString2 = ({ a: 1, b: "s" }) ? exprString1 : exprString2; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprString1 : string >exprString2 : string @@ -283,9 +283,9 @@ var resultIsObject2 = ({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprIsObject1 : Object >exprIsObject2 : Object @@ -295,9 +295,9 @@ var resultIsStringOrBoolean2 = ({ a: 1, b: "s" }) ? exprString1 : exprBoolean1; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types index d79e570ec4245..5903a10d4e58f 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types +++ b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types @@ -130,7 +130,7 @@ x("x") ? exprBoolean1 : exprBoolean2; >x("x") ? exprBoolean1 : exprBoolean2 : boolean >x("x") : any >x : any ->"x" : string +>"x" : "x" >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -146,7 +146,7 @@ x("x") ? exprString1 : exprString2; >x("x") ? exprString1 : exprString2 : string >x("x") : any >x : any ->"x" : string +>"x" : "x" >exprString1 : string >exprString2 : string @@ -288,7 +288,7 @@ var resultIsBoolean3 = x("x") ? exprBoolean1 : exprBoolean2; >x("x") ? exprBoolean1 : exprBoolean2 : boolean >x("x") : any >x : any ->"x" : string +>"x" : "x" >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -306,7 +306,7 @@ var resultIsString3 = x("x") ? exprString1 : exprString2; >x("x") ? exprString1 : exprString2 : string >x("x") : any >x : any ->"x" : string +>"x" : "x" >exprString1 : string >exprString2 : string diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types index af5abb25063e8..a6906d7024a80 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types @@ -75,51 +75,51 @@ condString ? exprString1 : exprBoolean1; // union //Cond is a string type literal "" ? exprAny1 : exprAny2; >"" ? exprAny1 : exprAny2 : any ->"" : string +>"" : "" >exprAny1 : any >exprAny2 : any "string" ? exprBoolean1 : exprBoolean2; >"string" ? exprBoolean1 : exprBoolean2 : boolean ->"string" : string +>"string" : "string" >exprBoolean1 : boolean >exprBoolean2 : boolean 'c' ? exprNumber1 : exprNumber2; >'c' ? exprNumber1 : exprNumber2 : number ->'c' : string +>'c' : "c" >exprNumber1 : number >exprNumber2 : number 'string' ? exprString1 : exprString2; >'string' ? exprString1 : exprString2 : string ->'string' : string +>'string' : "string" >exprString1 : string >exprString2 : string " " ? exprIsObject1 : exprIsObject2; >" " ? exprIsObject1 : exprIsObject2 : Object ->" " : string +>" " : " " >exprIsObject1 : Object >exprIsObject2 : Object "hello " ? exprString1 : exprBoolean1; // union >"hello " ? exprString1 : exprBoolean1 : string | boolean ->"hello " : string +>"hello " : "hello " >exprString1 : string >exprBoolean1 : boolean //Cond is a string type expression function foo() { return "string" }; >foo : () => string ->"string" : string +>"string" : "string" var array = ["1", "2", "3"]; >array : string[] >["1", "2", "3"] : string[] ->"1" : string ->"2" : string ->"3" : string +>"1" : "1" +>"2" : "2" +>"3" : "3" typeof condString ? exprAny1 : exprAny2; >typeof condString ? exprAny1 : exprAny2 : any @@ -140,7 +140,7 @@ condString + "string" ? exprNumber1 : exprNumber2; >condString + "string" ? exprNumber1 : exprNumber2 : number >condString + "string" : string >condString : string ->"string" : string +>"string" : "string" >exprNumber1 : number >exprNumber2 : number @@ -155,7 +155,7 @@ array[1] ? exprIsObject1 : exprIsObject2; >array[1] ? exprIsObject1 : exprIsObject2 : Object >array[1] : string >array : string[] ->1 : number +>1 : 1 >exprIsObject1 : Object >exprIsObject2 : Object @@ -212,42 +212,42 @@ var resultIsStringOrBoolean1 = condString ? exprString1 : exprBoolean1; // union var resultIsAny2 = "" ? exprAny1 : exprAny2; >resultIsAny2 : any >"" ? exprAny1 : exprAny2 : any ->"" : string +>"" : "" >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = "string" ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >"string" ? exprBoolean1 : exprBoolean2 : boolean ->"string" : string +>"string" : "string" >exprBoolean1 : boolean >exprBoolean2 : boolean var resultIsNumber2 = 'c' ? exprNumber1 : exprNumber2; >resultIsNumber2 : number >'c' ? exprNumber1 : exprNumber2 : number ->'c' : string +>'c' : "c" >exprNumber1 : number >exprNumber2 : number var resultIsString2 = 'string' ? exprString1 : exprString2; >resultIsString2 : string >'string' ? exprString1 : exprString2 : string ->'string' : string +>'string' : "string" >exprString1 : string >exprString2 : string var resultIsObject2 = " " ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >" " ? exprIsObject1 : exprIsObject2 : Object ->" " : string +>" " : " " >exprIsObject1 : Object >exprIsObject2 : Object var resultIsStringOrBoolean2 = "hello" ? exprString1 : exprBoolean1; // union >resultIsStringOrBoolean2 : string | boolean >"hello" ? exprString1 : exprBoolean1 : string | boolean ->"hello" : string +>"hello" : "hello" >exprString1 : string >exprBoolean1 : boolean @@ -273,7 +273,7 @@ var resultIsNumber3 = condString + "string" ? exprNumber1 : exprNumber2; >condString + "string" ? exprNumber1 : exprNumber2 : number >condString + "string" : string >condString : string ->"string" : string +>"string" : "string" >exprNumber1 : number >exprNumber2 : number @@ -290,7 +290,7 @@ var resultIsObject3 = array[1] ? exprIsObject1 : exprIsObject2; >array[1] ? exprIsObject1 : exprIsObject2 : Object >array[1] : string >array : string[] ->1 : number +>1 : 1 >exprIsObject1 : Object >exprIsObject2 : Object diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types index 3f5f6454eda08..3a655853163dc 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types @@ -32,62 +32,62 @@ var b: B; //Be Not contextually typed true ? x : a; >true ? x : a : X ->true : boolean +>true : true >x : X >a : A var result1 = true ? x : a; >result1 : X >true ? x : a : X ->true : boolean +>true : true >x : X >a : A //Expr1 and Expr2 are literals true ? {} : 1; >true ? {} : 1 : {} ->true : boolean +>true : true >{} : {} ->1 : number +>1 : 1 true ? { a: 1 } : { a: 2, b: 'string' }; >true ? { a: 1 } : { a: 2, b: 'string' } : { a: number; } | { a: number; b: string; } ->true : boolean +>true : true >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number ->2 : number +>2 : 2 >b : string ->'string' : string +>'string' : "string" var result2 = true ? {} : 1; >result2 : {} >true ? {} : 1 : {} ->true : boolean +>true : true >{} : {} ->1 : number +>1 : 1 var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; >result3 : { a: number; } | { a: number; b: string; } >true ? { a: 1 } : { a: 2, b: 'string' } : { a: number; } | { a: number; b: string; } ->true : boolean +>true : true >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number ->2 : number +>2 : 2 >b : string ->'string' : string +>'string' : "string" //Contextually typed var resultIsX1: X = true ? x : a; >resultIsX1 : X >X : X >true ? x : a : X ->true : boolean +>true : true >x : X >a : A @@ -96,7 +96,7 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; >t : A >A : A >true ? (m) => m.propertyX : (n) => n.propertyA : (m: A) => any ->true : boolean +>true : true >(m) => m.propertyX : (m: A) => any >m : A >m.propertyX : any @@ -112,62 +112,62 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; //Be Not contextually typed true ? a : x; >true ? a : x : X ->true : boolean +>true : true >a : A >x : X var result5 = true ? a : x; >result5 : X >true ? a : x : X ->true : boolean +>true : true >a : A >x : X //Expr1 and Expr2 are literals true ? 1 : {}; >true ? 1 : {} : {} ->true : boolean ->1 : number +>true : true +>1 : 1 >{} : {} true ? { a: 2, b: 'string' } : { a: 1 }; >true ? { a: 2, b: 'string' } : { a: 1 } : { a: number; b: string; } | { a: number; } ->true : boolean +>true : true >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number ->2 : number +>2 : 2 >b : string ->'string' : string +>'string' : "string" >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 var result6 = true ? 1 : {}; >result6 : {} >true ? 1 : {} : {} ->true : boolean ->1 : number +>true : true +>1 : 1 >{} : {} var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; >result7 : { a: number; b: string; } | { a: number; } >true ? { a: 2, b: 'string' } : { a: 1 } : { a: number; b: string; } | { a: number; } ->true : boolean +>true : true >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number ->2 : number +>2 : 2 >b : string ->'string' : string +>'string' : "string" >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 //Contextually typed var resultIsX2: X = true ? x : a; >resultIsX2 : X >X : X >true ? x : a : X ->true : boolean +>true : true >x : X >a : A @@ -176,7 +176,7 @@ var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; >t : A >A : A >true ? (m) => m.propertyA : (n) => n.propertyX : (n: A) => any ->true : boolean +>true : true >(m) => m.propertyA : (m: A) => number >m : A >m.propertyA : number @@ -194,7 +194,7 @@ var resultIsX3: X = true ? a : b; >resultIsX3 : X >X : X >true ? a : b : A | B ->true : boolean +>true : true >a : A >b : B @@ -203,7 +203,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; >t : X >X : X >true ? (m) => m.propertyX1 : (n) => n.propertyX2 : ((m: X) => number) | ((n: X) => string) ->true : boolean +>true : true >(m) => m.propertyX1 : (m: X) => number >m : X >m.propertyX1 : number @@ -218,8 +218,8 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; //Expr1 and Expr2 are literals var result11: any = true ? 1 : 'string'; >result11 : any ->true ? 1 : 'string' : string | number ->true : boolean ->1 : number ->'string' : string +>true ? 1 : 'string' : 1 | "string" +>true : true +>1 : 1 +>'string' : "string" diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types index a5a7dd1d0cdff..23e81800264a2 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types @@ -5,14 +5,14 @@ function outer() { >outer : () => void const x = 0; ->x : number ->0 : number +>x : 0 +>0 : 0 function inner() { >inner : () => void var x = "inner"; >x : string ->"inner" : string +>"inner" : "inner" } } diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types index 1271d4ef86999..919a9eb96f229 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types @@ -8,11 +8,11 @@ class Rule { >RegExp : RegExp >new RegExp('') : RegExp >RegExp : RegExpConstructor ->'' : string +>'' : "" public name: string = ''; >name : string ->'' : string +>'' : "" constructor(name: string) { >name : string diff --git a/tests/baselines/reference/constDeclarations-errors.errors.txt b/tests/baselines/reference/constDeclarations-errors.errors.txt index 98b12b616f77c..2c9c17cc102f9 100644 --- a/tests/baselines/reference/constDeclarations-errors.errors.txt +++ b/tests/baselines/reference/constDeclarations-errors.errors.txt @@ -4,12 +4,14 @@ tests/cases/compiler/constDeclarations-errors.ts(5,7): error TS1155: 'const' dec tests/cases/compiler/constDeclarations-errors.ts(5,11): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(5,15): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(5,27): error TS1155: 'const' declarations must be initialized +tests/cases/compiler/constDeclarations-errors.ts(10,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. tests/cases/compiler/constDeclarations-errors.ts(10,27): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. tests/cases/compiler/constDeclarations-errors.ts(13,11): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(16,20): error TS1155: 'const' declarations must be initialized +tests/cases/compiler/constDeclarations-errors.ts(16,25): error TS2365: Operator '<' cannot be applied to types '0' and '1'. -==== tests/cases/compiler/constDeclarations-errors.ts (9 errors) ==== +==== tests/cases/compiler/constDeclarations-errors.ts (11 errors) ==== // error, missing intialicer const c1; @@ -32,6 +34,8 @@ tests/cases/compiler/constDeclarations-errors.ts(16,20): error TS1155: 'const' d // error, assigning to a const for(const c8 = 0; c8 < 1; c8++) { } + ~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. ~~ !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. @@ -43,4 +47,6 @@ tests/cases/compiler/constDeclarations-errors.ts(16,20): error TS1155: 'const' d // error, can not be unintalized for(const c10 = 0, c11; c10 < 1;) { } ~~~ -!!! error TS1155: 'const' declarations must be initialized \ No newline at end of file +!!! error TS1155: 'const' declarations must be initialized + ~~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-es5.types b/tests/baselines/reference/constDeclarations-es5.types index a897c3f9cd0f1..e801607727edb 100644 --- a/tests/baselines/reference/constDeclarations-es5.types +++ b/tests/baselines/reference/constDeclarations-es5.types @@ -1,18 +1,18 @@ === tests/cases/compiler/constDeclarations-es5.ts === const z7 = false; ->z7 : boolean ->false : boolean +>z7 : false +>false : false const z8: number = 23; >z8 : number ->23 : number +>23 : 23 const z9 = 0, z10 :string = "", z11 = null; ->z9 : number ->0 : number +>z9 : 0 +>0 : 0 >z10 : string ->"" : string +>"" : "" >z11 : any >null : null diff --git a/tests/baselines/reference/constDeclarations-scopes2.errors.txt b/tests/baselines/reference/constDeclarations-scopes2.errors.txt new file mode 100644 index 0000000000000..b998f3a99805b --- /dev/null +++ b/tests/baselines/reference/constDeclarations-scopes2.errors.txt @@ -0,0 +1,21 @@ +tests/cases/compiler/constDeclarations-scopes2.ts(9,19): error TS2365: Operator '<' cannot be applied to types '0' and '10'. + + +==== tests/cases/compiler/constDeclarations-scopes2.ts (1 errors) ==== + + // global + const c = "string"; + + var n: number; + var b: boolean; + + // for scope + for (const c = 0; c < 10; n = c ) { + ~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '10'. + // for block + const c = false; + b = c; + } + + \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations.errors.txt b/tests/baselines/reference/constDeclarations.errors.txt new file mode 100644 index 0000000000000..1642610eec250 --- /dev/null +++ b/tests/baselines/reference/constDeclarations.errors.txt @@ -0,0 +1,17 @@ +tests/cases/compiler/constDeclarations.ts(8,19): error TS2365: Operator '<' cannot be applied to types '0' and '9'. + + +==== tests/cases/compiler/constDeclarations.ts (1 errors) ==== + + // No error + const c1 = false; + const c2: number = 23; + const c3 = 0, c4 :string = "", c5 = null; + + + for(const c4 = 0; c4 < 9; ) { break; } + ~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '9'. + + + for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations.js b/tests/baselines/reference/constDeclarations.js index 060c0aba61cd6..7e5902ed5a160 100644 --- a/tests/baselines/reference/constDeclarations.js +++ b/tests/baselines/reference/constDeclarations.js @@ -25,6 +25,6 @@ for (const c5 = 0, c6 = 0; c5 < c6;) { //// [constDeclarations.d.ts] -declare const c1: boolean; +declare const c1: false; declare const c2: number; -declare const c3: number, c4: string, c5: any; +declare const c3: 0, c4: string, c5: any; diff --git a/tests/baselines/reference/constDeclarations2.js b/tests/baselines/reference/constDeclarations2.js index e4ee67ebdcdd0..ea7134d46645a 100644 --- a/tests/baselines/reference/constDeclarations2.js +++ b/tests/baselines/reference/constDeclarations2.js @@ -20,7 +20,7 @@ var M; //// [constDeclarations2.d.ts] declare module M { - const c1: boolean; + const c1: false; const c2: number; - const c3: number, c4: string, c5: any; + const c3: 0, c4: string, c5: any; } diff --git a/tests/baselines/reference/constDeclarations2.types b/tests/baselines/reference/constDeclarations2.types index f8184b8f8e033..54a273dfb4d41 100644 --- a/tests/baselines/reference/constDeclarations2.types +++ b/tests/baselines/reference/constDeclarations2.types @@ -5,18 +5,18 @@ module M { >M : typeof M export const c1 = false; ->c1 : boolean ->false : boolean +>c1 : false +>false : false export const c2: number = 23; >c2 : number ->23 : number +>23 : 23 export const c3 = 0, c4 :string = "", c5 = null; ->c3 : number ->0 : number +>c3 : 0 +>0 : 0 >c4 : string ->"" : string +>"" : "" >c5 : any >null : null } diff --git a/tests/baselines/reference/constEnum1.types b/tests/baselines/reference/constEnum1.types index 9ae959928474a..17f6f5de27875 100644 --- a/tests/baselines/reference/constEnum1.types +++ b/tests/baselines/reference/constEnum1.types @@ -9,7 +9,7 @@ const enum E { a = 10, >a : E ->10 : number +>10 : 10 b = a, >b : E @@ -20,7 +20,7 @@ const enum E { >(a+1) : number >a+1 : number >a : E ->1 : number +>1 : 1 e, >e : E @@ -35,16 +35,16 @@ const enum E { >a << 2 >> 1 : number >a << 2 : number >a : E ->2 : number ->1 : number +>2 : 2 +>1 : 1 g = a << 2 >>> 1, >g : E >a << 2 >>> 1 : number >a << 2 : number >a : E ->2 : number ->1 : number +>2 : 2 +>1 : 1 h = a | b >h : E diff --git a/tests/baselines/reference/constEnumDeclarations.types b/tests/baselines/reference/constEnumDeclarations.types index 481c267366001..1f86028b3850d 100644 --- a/tests/baselines/reference/constEnumDeclarations.types +++ b/tests/baselines/reference/constEnumDeclarations.types @@ -5,11 +5,11 @@ const enum E { A = 1, >A : E ->1 : number +>1 : 1 B = 2, >B : E ->2 : number +>2 : 2 C = A | B >C : E @@ -22,12 +22,12 @@ const enum E2 { >E2 : E2 A = 1, ->A : E2 ->1 : number +>A : E2.A +>1 : 1 B, ->B : E2 +>B : E2.B C ->C : E2 +>C : E2.C } diff --git a/tests/baselines/reference/constEnumExternalModule.types b/tests/baselines/reference/constEnumExternalModule.types index 5d03b77b1b7ad..2bd978a2caf72 100644 --- a/tests/baselines/reference/constEnumExternalModule.types +++ b/tests/baselines/reference/constEnumExternalModule.types @@ -14,7 +14,7 @@ const enum E { V = 100 >V : E ->100 : number +>100 : 100 } export = E diff --git a/tests/baselines/reference/constEnumMergingWithValues4.types b/tests/baselines/reference/constEnumMergingWithValues4.types index 92d04fc10cc7d..8df07d3026d06 100644 --- a/tests/baselines/reference/constEnumMergingWithValues4.types +++ b/tests/baselines/reference/constEnumMergingWithValues4.types @@ -13,7 +13,7 @@ module foo { var x = 1; >x : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/constEnumOnlyModuleMerging.types b/tests/baselines/reference/constEnumOnlyModuleMerging.types index 452c0f46add89..ec78f39e055fa 100644 --- a/tests/baselines/reference/constEnumOnlyModuleMerging.types +++ b/tests/baselines/reference/constEnumOnlyModuleMerging.types @@ -4,7 +4,7 @@ module Outer { export var x = 1; >x : number ->1 : number +>1 : 1 } module Outer { diff --git a/tests/baselines/reference/constEnumPropertyAccess1.types b/tests/baselines/reference/constEnumPropertyAccess1.types index e32ae5a64491f..869a31d5e1f9b 100644 --- a/tests/baselines/reference/constEnumPropertyAccess1.types +++ b/tests/baselines/reference/constEnumPropertyAccess1.types @@ -9,11 +9,11 @@ const enum G { A = 1, >A : G ->1 : number +>1 : 1 B = 2, >B : G ->2 : number +>2 : 2 C = A + B, >C : G @@ -25,7 +25,7 @@ const enum G { >D : G >A * 2 : number >A : G ->2 : number +>2 : 2 } var o: { @@ -52,7 +52,7 @@ var a1 = G["A"]; >a1 : G >G["A"] : G >G : typeof G ->"A" : string +>"A" : "A" var g = o[G.A]; >g : boolean @@ -76,7 +76,7 @@ class C { >B : G return true; ->true : boolean +>true : true } set [G.B](x: number) { } >G.B : G diff --git a/tests/baselines/reference/constEnumPropertyAccess2.errors.txt b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt index a943ee0096236..ef5dd331d327f 100644 --- a/tests/baselines/reference/constEnumPropertyAccess2.errors.txt +++ b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(14,9): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(15,12): error TS2476: A const enum member can only be accessed using a string literal. -tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(17,1): error TS2322: Type 'string' is not assignable to type 'G'. +tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(17,1): error TS2322: Type '"string"' is not assignable to type 'G'. tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. @@ -27,7 +27,7 @@ tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,1): error TS24 var g: G; g = "string"; ~ -!!! error TS2322: Type 'string' is not assignable to type 'G'. +!!! error TS2322: Type '"string"' is not assignable to type 'G'. function foo(x: G) { } G.B = 3; ~~~ diff --git a/tests/baselines/reference/constEnumToStringNoComments.types b/tests/baselines/reference/constEnumToStringNoComments.types index 21c4dc6c70341..eef69de320d01 100644 --- a/tests/baselines/reference/constEnumToStringNoComments.types +++ b/tests/baselines/reference/constEnumToStringNoComments.types @@ -3,138 +3,138 @@ const enum Foo { >Foo : Foo X = 100, ->X : Foo ->100 : number +>X : Foo.X +>100 : 100 Y = 0.5, ->Y : Foo ->0.5 : number +>Y : Foo.Y +>0.5 : 0.5 Z = 2., ->Z : Foo ->2. : number +>Z : Foo.Z +>2. : 2 A = -1, ->A : Foo ->-1 : number ->1 : number +>A : Foo.A +>-1 : -1 +>1 : 1 B = -1.5, ->B : Foo ->-1.5 : number ->1.5 : number +>B : Foo.B +>-1.5 : -1.5 +>1.5 : 1.5 C = -1. ->C : Foo ->-1. : number ->1. : number +>C : Foo.A +>-1. : -1 +>1. : 1 } let x0 = Foo.X.toString(); >x0 : string >Foo.X.toString() : string >Foo.X.toString : (radix?: number) => string ->Foo.X : Foo +>Foo.X : Foo.X >Foo : typeof Foo ->X : Foo +>X : Foo.X >toString : (radix?: number) => string let x1 = Foo["X"].toString(); >x1 : string >Foo["X"].toString() : string >Foo["X"].toString : (radix?: number) => string ->Foo["X"] : Foo +>Foo["X"] : Foo.X >Foo : typeof Foo ->"X" : string +>"X" : "X" >toString : (radix?: number) => string let y0 = Foo.Y.toString(); >y0 : string >Foo.Y.toString() : string >Foo.Y.toString : (radix?: number) => string ->Foo.Y : Foo +>Foo.Y : Foo.Y >Foo : typeof Foo ->Y : Foo +>Y : Foo.Y >toString : (radix?: number) => string let y1 = Foo["Y"].toString(); >y1 : string >Foo["Y"].toString() : string >Foo["Y"].toString : (radix?: number) => string ->Foo["Y"] : Foo +>Foo["Y"] : Foo.Y >Foo : typeof Foo ->"Y" : string +>"Y" : "Y" >toString : (radix?: number) => string let z0 = Foo.Z.toString(); >z0 : string >Foo.Z.toString() : string >Foo.Z.toString : (radix?: number) => string ->Foo.Z : Foo +>Foo.Z : Foo.Z >Foo : typeof Foo ->Z : Foo +>Z : Foo.Z >toString : (radix?: number) => string let z1 = Foo["Z"].toString(); >z1 : string >Foo["Z"].toString() : string >Foo["Z"].toString : (radix?: number) => string ->Foo["Z"] : Foo +>Foo["Z"] : Foo.Z >Foo : typeof Foo ->"Z" : string +>"Z" : "Z" >toString : (radix?: number) => string let a0 = Foo.A.toString(); >a0 : string >Foo.A.toString() : string >Foo.A.toString : (radix?: number) => string ->Foo.A : Foo +>Foo.A : Foo.A >Foo : typeof Foo ->A : Foo +>A : Foo.A >toString : (radix?: number) => string let a1 = Foo["A"].toString(); >a1 : string >Foo["A"].toString() : string >Foo["A"].toString : (radix?: number) => string ->Foo["A"] : Foo +>Foo["A"] : Foo.A >Foo : typeof Foo ->"A" : string +>"A" : "A" >toString : (radix?: number) => string let b0 = Foo.B.toString(); >b0 : string >Foo.B.toString() : string >Foo.B.toString : (radix?: number) => string ->Foo.B : Foo +>Foo.B : Foo.B >Foo : typeof Foo ->B : Foo +>B : Foo.B >toString : (radix?: number) => string let b1 = Foo["B"].toString(); >b1 : string >Foo["B"].toString() : string >Foo["B"].toString : (radix?: number) => string ->Foo["B"] : Foo +>Foo["B"] : Foo.B >Foo : typeof Foo ->"B" : string +>"B" : "B" >toString : (radix?: number) => string let c0 = Foo.C.toString(); >c0 : string >Foo.C.toString() : string >Foo.C.toString : (radix?: number) => string ->Foo.C : Foo +>Foo.C : Foo.A >Foo : typeof Foo ->C : Foo +>C : Foo.A >toString : (radix?: number) => string let c1 = Foo["C"].toString(); >c1 : string >Foo["C"].toString() : string >Foo["C"].toString : (radix?: number) => string ->Foo["C"] : Foo +>Foo["C"] : Foo.A >Foo : typeof Foo ->"C" : string +>"C" : "C" >toString : (radix?: number) => string diff --git a/tests/baselines/reference/constEnumToStringWithComments.types b/tests/baselines/reference/constEnumToStringWithComments.types index 72d7d367f5ddf..ff0e737ec8633 100644 --- a/tests/baselines/reference/constEnumToStringWithComments.types +++ b/tests/baselines/reference/constEnumToStringWithComments.types @@ -3,138 +3,138 @@ const enum Foo { >Foo : Foo X = 100, ->X : Foo ->100 : number +>X : Foo.X +>100 : 100 Y = 0.5, ->Y : Foo ->0.5 : number +>Y : Foo.Y +>0.5 : 0.5 Z = 2., ->Z : Foo ->2. : number +>Z : Foo.Z +>2. : 2 A = -1, ->A : Foo ->-1 : number ->1 : number +>A : Foo.A +>-1 : -1 +>1 : 1 B = -1.5, ->B : Foo ->-1.5 : number ->1.5 : number +>B : Foo.B +>-1.5 : -1.5 +>1.5 : 1.5 C = -1. ->C : Foo ->-1. : number ->1. : number +>C : Foo.A +>-1. : -1 +>1. : 1 } let x0 = Foo.X.toString(); >x0 : string >Foo.X.toString() : string >Foo.X.toString : (radix?: number) => string ->Foo.X : Foo +>Foo.X : Foo.X >Foo : typeof Foo ->X : Foo +>X : Foo.X >toString : (radix?: number) => string let x1 = Foo["X"].toString(); >x1 : string >Foo["X"].toString() : string >Foo["X"].toString : (radix?: number) => string ->Foo["X"] : Foo +>Foo["X"] : Foo.X >Foo : typeof Foo ->"X" : string +>"X" : "X" >toString : (radix?: number) => string let y0 = Foo.Y.toString(); >y0 : string >Foo.Y.toString() : string >Foo.Y.toString : (radix?: number) => string ->Foo.Y : Foo +>Foo.Y : Foo.Y >Foo : typeof Foo ->Y : Foo +>Y : Foo.Y >toString : (radix?: number) => string let y1 = Foo["Y"].toString(); >y1 : string >Foo["Y"].toString() : string >Foo["Y"].toString : (radix?: number) => string ->Foo["Y"] : Foo +>Foo["Y"] : Foo.Y >Foo : typeof Foo ->"Y" : string +>"Y" : "Y" >toString : (radix?: number) => string let z0 = Foo.Z.toString(); >z0 : string >Foo.Z.toString() : string >Foo.Z.toString : (radix?: number) => string ->Foo.Z : Foo +>Foo.Z : Foo.Z >Foo : typeof Foo ->Z : Foo +>Z : Foo.Z >toString : (radix?: number) => string let z1 = Foo["Z"].toString(); >z1 : string >Foo["Z"].toString() : string >Foo["Z"].toString : (radix?: number) => string ->Foo["Z"] : Foo +>Foo["Z"] : Foo.Z >Foo : typeof Foo ->"Z" : string +>"Z" : "Z" >toString : (radix?: number) => string let a0 = Foo.A.toString(); >a0 : string >Foo.A.toString() : string >Foo.A.toString : (radix?: number) => string ->Foo.A : Foo +>Foo.A : Foo.A >Foo : typeof Foo ->A : Foo +>A : Foo.A >toString : (radix?: number) => string let a1 = Foo["A"].toString(); >a1 : string >Foo["A"].toString() : string >Foo["A"].toString : (radix?: number) => string ->Foo["A"] : Foo +>Foo["A"] : Foo.A >Foo : typeof Foo ->"A" : string +>"A" : "A" >toString : (radix?: number) => string let b0 = Foo.B.toString(); >b0 : string >Foo.B.toString() : string >Foo.B.toString : (radix?: number) => string ->Foo.B : Foo +>Foo.B : Foo.B >Foo : typeof Foo ->B : Foo +>B : Foo.B >toString : (radix?: number) => string let b1 = Foo["B"].toString(); >b1 : string >Foo["B"].toString() : string >Foo["B"].toString : (radix?: number) => string ->Foo["B"] : Foo +>Foo["B"] : Foo.B >Foo : typeof Foo ->"B" : string +>"B" : "B" >toString : (radix?: number) => string let c0 = Foo.C.toString(); >c0 : string >Foo.C.toString() : string >Foo.C.toString : (radix?: number) => string ->Foo.C : Foo +>Foo.C : Foo.A >Foo : typeof Foo ->C : Foo +>C : Foo.A >toString : (radix?: number) => string let c1 = Foo["C"].toString(); >c1 : string >Foo["C"].toString() : string >Foo["C"].toString : (radix?: number) => string ->Foo["C"] : Foo +>Foo["C"] : Foo.A >Foo : typeof Foo ->"C" : string +>"C" : "C" >toString : (radix?: number) => string diff --git a/tests/baselines/reference/constEnums.types b/tests/baselines/reference/constEnums.types index 83ee20100e5a2..c0bfef9143484 100644 --- a/tests/baselines/reference/constEnums.types +++ b/tests/baselines/reference/constEnums.types @@ -4,7 +4,7 @@ const enum Enum1 { A0 = 100, >A0 : Enum1 ->100 : number +>100 : 100 } const enum Enum1 { @@ -19,7 +19,7 @@ const enum Enum1 { C = 10, >C : Enum1 ->10 : number +>10 : 10 D = A | B, >D : Enum1 @@ -31,20 +31,20 @@ const enum Enum1 { >E : Enum1 >A | 1 : number >A : Enum1 ->1 : number +>1 : 1 F = 1 | A, >F : Enum1 >1 | A : number ->1 : number +>1 : 1 >A : Enum1 G = (1 & 1), >G : Enum1 >(1 & 1) : number >1 & 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 H = ~(A | B), >H : Enum1 @@ -58,12 +58,12 @@ const enum Enum1 { >I : Enum1 >A >>> 1 : number >A : Enum1 ->1 : number +>1 : 1 J = 1 & A, >J : Enum1 >1 & A : number ->1 : number +>1 : 1 >A : Enum1 K = ~(1 | 5), @@ -71,8 +71,8 @@ const enum Enum1 { >~(1 | 5) : number >(1 | 5) : number >1 | 5 : number ->1 : number ->5 : number +>1 : 1 +>5 : 5 L = ~D, >L : Enum1 @@ -89,7 +89,7 @@ const enum Enum1 { >N : Enum1 >E << 1 : number >E : Enum1 ->1 : number +>1 : 1 O = E >> B, >O : Enum1 @@ -101,7 +101,7 @@ const enum Enum1 { >P : Enum1 >E >> 1 : number >E : Enum1 ->1 : number +>1 : 1 Q = -D, >Q : Enum1 @@ -112,12 +112,12 @@ const enum Enum1 { >R : Enum1 >C & 5 : number >C : Enum1 ->5 : number +>5 : 5 S = 5 & C, >S : Enum1 >5 & C : number ->5 : number +>5 : 5 >C : Enum1 T = C | D, @@ -130,12 +130,12 @@ const enum Enum1 { >U : Enum1 >C | 1 : number >C : Enum1 ->1 : number +>1 : 1 V = 10 | D, >V : Enum1 >10 | D : number ->10 : number +>10 : 10 >D : Enum1 W = Enum1.V, @@ -159,13 +159,13 @@ const enum Enum1 { >W3 : Enum1 >Enum1["A0"] : Enum1 >Enum1 : typeof Enum1 ->"A0" : string +>"A0" : "A0" W4 = Enum1["W"], >W4 : Enum1 >Enum1["W"] : Enum1 >Enum1 : typeof Enum1 ->"W" : string +>"W" : "W" } @@ -183,7 +183,7 @@ module A { V1 = 1, >V1 : E ->1 : number +>1 : 1 V2 = A.B.C.E.V1 | 100 >V2 : E @@ -197,7 +197,7 @@ module A { >C : typeof C >E : typeof E >V1 : E ->100 : number +>100 : 100 } } } @@ -226,8 +226,8 @@ module A { >B : typeof B >C : typeof C >E : typeof E ->"V2" : string ->200 : number +>"V2" : "V2" +>200 : 200 } } } @@ -246,12 +246,12 @@ module A1 { >E : E V1 = 10, ->V1 : E ->10 : number +>V1 : E.V1 +>10 : 10 V2 = 110, ->V2 : E ->110 : number +>V2 : E.V2 +>110 : 110 } } } @@ -270,12 +270,12 @@ module A2 { >E : E V1 = 10, ->V1 : E ->10 : number +>V1 : E.V1 +>10 : 10 V2 = 110, ->V2 : E ->110 : number +>V2 : E.V2 +>110 : 110 } } // module C will be classified as value @@ -284,7 +284,7 @@ module A2 { var x = 1 >x : number ->1 : number +>1 : 1 } } } @@ -496,7 +496,7 @@ function foo(x: Enum1) { case Enum1["T"]: >Enum1["T"] : Enum1 >Enum1 : typeof Enum1 ->"T" : string +>"T" : "T" case Enum1.U: >Enum1.U : Enum1 @@ -558,7 +558,7 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V1 : I ->1 : number +>1 : 1 case A.B.C.E.V2: return 1; >A.B.C.E.V2 : I @@ -570,7 +570,7 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V2 : I ->1 : number +>1 : 1 case A.B.C.E.V3: return 1; >A.B.C.E.V3 : I @@ -582,6 +582,6 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V3 : I ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/constIndexedAccess.types b/tests/baselines/reference/constIndexedAccess.types index eb02c7bde2eeb..0740a6efc67fb 100644 --- a/tests/baselines/reference/constIndexedAccess.types +++ b/tests/baselines/reference/constIndexedAccess.types @@ -4,10 +4,10 @@ const enum numbers { >numbers : numbers zero, ->zero : numbers +>zero : numbers.zero one ->one : numbers +>one : numbers.one } interface indexAccess { @@ -25,69 +25,69 @@ let s = test[0]; >s : string >test[0] : string >test : indexAccess ->0 : number +>0 : 0 let n = test[1]; >n : number >test[1] : number >test : indexAccess ->1 : number +>1 : 1 let s1 = test[numbers.zero]; >s1 : string >test[numbers.zero] : string >test : indexAccess ->numbers.zero : numbers +>numbers.zero : numbers.zero >numbers : typeof numbers ->zero : numbers +>zero : numbers.zero let n1 = test[numbers.one]; >n1 : number >test[numbers.one] : number >test : indexAccess ->numbers.one : numbers +>numbers.one : numbers.one >numbers : typeof numbers ->one : numbers +>one : numbers.one let s2 = test[numbers["zero"]]; >s2 : string >test[numbers["zero"]] : string >test : indexAccess ->numbers["zero"] : numbers +>numbers["zero"] : numbers.zero >numbers : typeof numbers ->"zero" : string +>"zero" : "zero" let n2 = test[numbers["one"]]; >n2 : number >test[numbers["one"]] : number >test : indexAccess ->numbers["one"] : numbers +>numbers["one"] : numbers.one >numbers : typeof numbers ->"one" : string +>"one" : "one" enum numbersNotConst { >numbersNotConst : numbersNotConst zero, ->zero : numbersNotConst +>zero : numbersNotConst.zero one ->one : numbersNotConst +>one : numbersNotConst.one } let s3 = test[numbersNotConst.zero]; >s3 : any >test[numbersNotConst.zero] : any >test : indexAccess ->numbersNotConst.zero : numbersNotConst +>numbersNotConst.zero : numbersNotConst.zero >numbersNotConst : typeof numbersNotConst ->zero : numbersNotConst +>zero : numbersNotConst.zero let n3 = test[numbersNotConst.one]; >n3 : any >test[numbersNotConst.one] : any >test : indexAccess ->numbersNotConst.one : numbersNotConst +>numbersNotConst.one : numbersNotConst.one >numbersNotConst : typeof numbersNotConst ->one : numbersNotConst +>one : numbersNotConst.one diff --git a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types index ca2cb6fefb75c..8ea80c02d19b2 100644 --- a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types +++ b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types @@ -20,8 +20,8 @@ var r1 = new C(1, ''); >r1 : C >new C(1, '') : C >C : typeof C ->1 : number ->'' : string +>1 : 1 +>'' : "" class C2 { >C2 : C2 @@ -46,8 +46,8 @@ var r2 = new C2(1, ''); >r2 : C2 >new C2(1, '') : C2 >C2 : typeof C2 ->1 : number ->'' : string +>1 : 1 +>'' : "" interface I { >I : I @@ -71,8 +71,8 @@ var r3 = new i(1, ''); >r3 : C >new i(1, '') : C >i : I ->1 : number ->'' : string +>1 : 1 +>'' : "" interface I2 { >I2 : I2 @@ -117,8 +117,8 @@ var r4 = new i2(1, ''); >r4 : C2 >new i2(1, '') : C2 >i2 : I2 ->1 : number ->'' : string +>1 : 1 +>'' : "" var a: { >a : { new (x: number, y: string): C; new (x: number, y: string): C; } @@ -138,8 +138,8 @@ var r5 = new a(1, ''); >r5 : C >new a(1, '') : C >a : { new (x: number, y: string): C; new (x: number, y: string): C; } ->1 : number ->'' : string +>1 : 1 +>'' : "" var b: { >b : { new (x: T, y: string): C2; new (x: T, y: string): C2; } @@ -165,6 +165,6 @@ var r6 = new b(1, ''); >r6 : C2 >new b(1, '') : C2 >b : { new (x: T, y: string): C2; new (x: T, y: string): C2; } ->1 : number ->'' : string +>1 : 1 +>'' : "" diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.types b/tests/baselines/reference/constructSignaturesWithOverloads.types index 8ff678c5de8f8..775006e24e08d 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads.types +++ b/tests/baselines/reference/constructSignaturesWithOverloads.types @@ -20,8 +20,8 @@ var r1 = new C(1, ''); >r1 : C >new C(1, '') : C >C : typeof C ->1 : number ->'' : string +>1 : 1 +>'' : "" class C2 { >C2 : C2 @@ -46,8 +46,8 @@ var r2 = new C2(1, ''); >r2 : C2 >new C2(1, '') : C2 >C2 : typeof C2 ->1 : number ->'' : string +>1 : 1 +>'' : "" interface I { >I : I @@ -71,8 +71,8 @@ var r3 = new i(1, ''); >r3 : C >new i(1, '') : C >i : I ->1 : number ->'' : string +>1 : 1 +>'' : "" interface I2 { >I2 : I2 @@ -118,8 +118,8 @@ var r4 = new i2(1, ''); >r4 : C2 >new i2(1, '') : C2 >i2 : I2 ->1 : number ->'' : string +>1 : 1 +>'' : "" var a: { >a : { new (x: number, y?: string): C; new (x: number, y: string): C; } @@ -139,8 +139,8 @@ var r5 = new a(1, ''); >r5 : C >new a(1, '') : C >a : { new (x: number, y?: string): C; new (x: number, y: string): C; } ->1 : number ->'' : string +>1 : 1 +>'' : "" var b: { >b : { new (x: T, y?: string): C2; new (x: T, y: string): C2; } @@ -166,6 +166,6 @@ var r6 = new b(1, ''); >r6 : C2 >new b(1, '') : C2 >b : { new (x: T, y?: string): C2; new (x: T, y: string): C2; } ->1 : number ->'' : string +>1 : 1 +>'' : "" diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types index e0e86df4a2612..6bfac199b2bee 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types @@ -60,6 +60,6 @@ class Derived2 extends Base { >x : any return 1; ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues.types b/tests/baselines/reference/constructorImplementationWithDefaultValues.types index fa99cc17fe03e..fbb78bcb2a92a 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues.types +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues.types @@ -7,7 +7,7 @@ class C { constructor(x = 1) { >x : number ->1 : number +>1 : 1 var y = x; >y : number diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt index 2fb24c0d5d8e7..9cad967dd7727 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(3,17): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,17): error TS2322: Type 'number' is not assignable to type 'T'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(3,17): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,17): error TS2322: Type '1' is not assignable to type 'T'. tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,27): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(17,17): error TS2322: Type 'Date' is not assignable to type 'T'. @@ -9,7 +9,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co constructor(x); constructor(public x: string = 1) { // error ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '1' is not assignable to type 'string'. var y = x; } } @@ -18,7 +18,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co constructor(x: T, y: U); constructor(x: T = 1, public y: U = x) { // error ~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type '1' is not assignable to type 'T'. ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'T' is not assignable to type 'U'. var z = x; diff --git a/tests/baselines/reference/constructorOverloads2.types b/tests/baselines/reference/constructorOverloads2.types index dde032c0fd29e..1b75c54c87fd6 100644 --- a/tests/baselines/reference/constructorOverloads2.types +++ b/tests/baselines/reference/constructorOverloads2.types @@ -45,13 +45,13 @@ var f1 = new Foo("hey"); >f1 : Foo >new Foo("hey") : Foo >Foo : typeof Foo ->"hey" : string +>"hey" : "hey" var f2 = new Foo(0); >f2 : Foo >new Foo(0) : Foo >Foo : typeof Foo ->0 : number +>0 : 0 var f3 = new Foo(f1); >f3 : Foo diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt index 87af1b85f2db7..978681dc5b376 100644 --- a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(8,9): error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'x' declared in the constructor. -tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(10,9): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(10,9): error TS2322: Type '2' is not assignable to type 'string'. tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(16,9): error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'y' declared in the constructor. @@ -17,7 +17,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterS constructor(x: string) { x = 2; // error, x is string ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '2' is not assignable to type 'string'. } } diff --git a/tests/baselines/reference/constructorReturningAPrimitive.types b/tests/baselines/reference/constructorReturningAPrimitive.types index 4b431cfb36b0b..d3732d3b789d6 100644 --- a/tests/baselines/reference/constructorReturningAPrimitive.types +++ b/tests/baselines/reference/constructorReturningAPrimitive.types @@ -7,7 +7,7 @@ class A { constructor() { return 1; ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt index 3b9a84fea98be..a1a5c5e75b98f 100644 --- a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt +++ b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2322: Type 'number' is not assignable to type 'X'. +tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2322: Type '1' is not assignable to type 'X'. tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class @@ -7,7 +7,7 @@ tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2409: Retur constructor() { return 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'X'. +!!! error TS2322: Type '1' is not assignable to type 'X'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt index 421e629c113ff..77c63a217e76e 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,16): error TS2322: Type 'number' is not assignable to type 'D'. +tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,16): error TS2322: Type '1' is not assignable to type 'D'. tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,16): error TS2322: Type '{ x: number; }' is not assignable to type 'F'. Types of property 'x' are incompatible. @@ -20,7 +20,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignabl constructor() { return 1; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'D'. +!!! error TS2322: Type '1' is not assignable to type 'D'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 4011a51f557e9..49d3e3788551f 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -38,9 +38,10 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,30): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,31): error TS2304: Cannot find name 'Property'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(167,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(181,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(182,13): error TS2322: Type 'boolean' is not assignable to type 'number | true'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(184,13): error TS2322: Type 'boolean' is not assignable to type 'number | true'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(192,13): error TS2322: Type 'boolean' is not assignable to type 'number | true'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(182,13): error TS2322: Type 'boolean' is not assignable to type 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(184,13): error TS2322: Type 'boolean' is not assignable to type 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(188,13): error TS2322: Type 'true' is not assignable to type 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(192,13): error TS2322: Type 'boolean' is not assignable to type 'number'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(206,28): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(214,16): error TS2304: Cannot find name 'bool'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(219,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. @@ -86,7 +87,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,55): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS1128: Declaration or statement expected. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (86 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (87 errors) ==== declare module "fs" { export class File { @@ -353,21 +354,23 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS !!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. b = !b;/*!*/ ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'number | true'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. i = ~i;/*~i*/ b = i < (i - 1) && (i + 1) > i;/*< && >*/ ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'number | true'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. var f = true ? 1 : 0;/*? :*/ // YES : i++;/*++*/ i--;/*--*/ b = true && false || true;/*&& ||*/ + ~ +!!! error TS2322: Type 'true' is not assignable to type 'number'. i = i << 5;/*<<*/ i = i >> 5;/*>>*/ var j = i; b = i == j && i != j && i <= j && i >= j;/*= == && != <= >=*/ ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'number | true'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. i += 5.0;/*+=*/ i -= i;/*-=*/ i *= i;/**=*/ diff --git a/tests/baselines/reference/contextualSignatureInstantiation.types b/tests/baselines/reference/contextualSignatureInstantiation.types index 49d6871804c04..6fd318e5ec61e 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.types +++ b/tests/baselines/reference/contextualSignatureInstantiation.types @@ -74,16 +74,16 @@ var a = bar(1, 1, g); // Should be number >a : number >bar(1, 1, g) : number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->1 : number ->1 : number +>1 : 1 +>1 : 1 >g : (x: T, y: T) => T var a = baz(1, 1, g); // Should be number >a : number >baz(1, 1, g) : number >baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->1 : number ->1 : number +>1 : 1 +>1 : 1 >g : (x: T, y: T) => T var b: number | string; @@ -99,16 +99,16 @@ var b = bar(1, "one", g); // Should be number | string >b : string | number >bar(1, "one", g) : string | number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->1 : number ->"one" : string +>1 : 1 +>"one" : "one" >g : (x: T, y: T) => T var b = bar("one", 1, g); // Should be number | string >b : string | number >bar("one", 1, g) : string | number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->"one" : string ->1 : number +>"one" : "one" +>1 : 1 >g : (x: T, y: T) => T var b = baz(b, b, g); // Should be number | string @@ -132,16 +132,16 @@ var d = bar(1, "one", h); // Should be number[] | string[] >d : number[] | string[] >bar(1, "one", h) : number[] | string[] >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->1 : number ->"one" : string +>1 : 1 +>"one" : "one" >h : (x: T, y: U) => T[] | U[] var d = bar("one", 1, h); // Should be number[] | string[] >d : number[] | string[] >bar("one", 1, h) : number[] | string[] >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->"one" : string ->1 : number +>"one" : "one" +>1 : 1 >h : (x: T, y: U) => T[] | U[] var d = baz(d, d, g); // Should be number[] | string[] diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.types b/tests/baselines/reference/contextualSignatureInstantiation3.types index d01b2b1f8e47f..945a4374ad142 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation3.types +++ b/tests/baselines/reference/contextualSignatureInstantiation3.types @@ -43,9 +43,9 @@ function singleton(x: T) { var xs = [1, 2, 3]; >xs : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 // Have compiler check that we get the correct types var v1: number[]; diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types index d0a6d49487b93..ac2ece4c0393b 100644 --- a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types @@ -31,7 +31,7 @@ var x = h("", f()); // Call should succeed and x should be string. All t >x : string >h("", f()) : string >h : (v: V, func: (v: V) => W) => W ->"" : string +>"" : "" >f() : (u: U) => U >f : () => (u: U) => U diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types index 965e4d21d9998..97c5f0fdf9035 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types @@ -91,7 +91,7 @@ var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" >IWithStringIndexSignature1 : IWithStringIndexSignature1 >{ foo: "hello" } : { foo: string; } >foo : string ->"hello" : string +>"hello" : "hello" var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number >x2 : IWithStringIndexSignature1 | IWithStringIndexSignature2 @@ -143,7 +143,7 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" >IWithNoNumberIndexSignature : IWithNoNumberIndexSignature >IWithNumberIndexSignature1 : IWithNumberIndexSignature1 >{ 0: "hello" } : { 0: string; } ->"hello" : string +>"hello" : "hello" var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number >x4 : IWithNumberIndexSignature1 | IWithNumberIndexSignature2 diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types index 8f2abf37e0e79..3d13b94bc5942 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types @@ -80,7 +80,7 @@ var i1Ori2: I1 | I2 = { // Like i1 commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -102,7 +102,7 @@ var i1Ori2: I1 | I2 = { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string ->"Hello" : string +>"Hello" : "Hello" }; var i1Ori2: I1 | I2 = { // Like i2 @@ -113,7 +113,7 @@ var i1Ori2: I1 | I2 = { // Like i2 commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -135,7 +135,7 @@ var i1Ori2: I1 | I2 = { // Like i2 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string ->"Hello" : string +>"Hello" : "Hello" }; var i1Ori2: I1 | I2 = { // Like i1 and i2 both @@ -146,7 +146,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -168,7 +168,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string ->"Hello" : string +>"Hello" : "Hello" methodOnlyInI2: a => a, >methodOnlyInI2 : (a: string) => string @@ -178,7 +178,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string ->"Hello" : string +>"Hello" : "Hello" }; @@ -194,7 +194,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -216,7 +216,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string ->"Hello" : string +>"Hello" : "Hello" }, { // Like i2 @@ -224,7 +224,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -246,14 +246,14 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string ->"Hello" : string +>"Hello" : "Hello" }, { // Like i1 and i2 both >{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -275,7 +275,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string ->"Hello" : string +>"Hello" : "Hello" methodOnlyInI2: a => a, >methodOnlyInI2 : (a: string) => string @@ -285,7 +285,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string ->"Hello" : string +>"Hello" : "Hello" }]; @@ -358,7 +358,7 @@ var i11Ori21: I11 | I21 = { }, commonPropertyDifferentType: "hello", >commonPropertyDifferentType : string ->"hello" : string +>"hello" : "hello" }; var i11Ori21: I11 | I21 = { @@ -388,7 +388,7 @@ var i11Ori21: I11 | I21 = { }, commonPropertyDifferentType: 10, >commonPropertyDifferentType : number ->10 : number +>10 : 10 }; var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { @@ -425,7 +425,7 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { }, commonPropertyDifferentType: "hello", >commonPropertyDifferentType : string ->"hello" : string +>"hello" : "hello" }, { >{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, } : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; } @@ -451,6 +451,6 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { }, commonPropertyDifferentType: 10, >commonPropertyDifferentType : number ->10 : number +>10 : 10 }]; diff --git a/tests/baselines/reference/contextualTyping1.types b/tests/baselines/reference/contextualTyping1.types index 6b2a794f98763..1f300311e944a 100644 --- a/tests/baselines/reference/contextualTyping1.types +++ b/tests/baselines/reference/contextualTyping1.types @@ -4,5 +4,5 @@ var foo: {id:number;} = {id:4}; >id : number >{id:4} : { id: number; } >id : number ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/contextualTyping10.types b/tests/baselines/reference/contextualTyping10.types index 938f2731a3064..6379d6f82aa13 100644 --- a/tests/baselines/reference/contextualTyping10.types +++ b/tests/baselines/reference/contextualTyping10.types @@ -6,8 +6,8 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number ->1 : number +>1 : 1 >{id:2} : { id: number; } >id : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/contextualTyping15.types b/tests/baselines/reference/contextualTyping15.types index ed4fdad3bfcb5..6d726c7064262 100644 --- a/tests/baselines/reference/contextualTyping15.types +++ b/tests/baselines/reference/contextualTyping15.types @@ -4,5 +4,5 @@ class foo { public bar: { (): number; (i: number): number; } = function() { retu >bar : { (): number; (i: number): number; } >i : number >function() { return 1 } : () => number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/contextualTyping16.types b/tests/baselines/reference/contextualTyping16.types index 63f93649208a0..6eded1712c1b0 100644 --- a/tests/baselines/reference/contextualTyping16.types +++ b/tests/baselines/reference/contextualTyping16.types @@ -4,10 +4,10 @@ var foo: {id:number;} = {id:4}; foo = {id:5}; >id : number >{id:4} : { id: number; } >id : number ->4 : number +>4 : 4 >foo = {id:5} : { id: number; } >foo : { id: number; } >{id:5} : { id: number; } >id : number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/contextualTyping18.types b/tests/baselines/reference/contextualTyping18.types index 0bef546022d6e..3d5ee402828a1 100644 --- a/tests/baselines/reference/contextualTyping18.types +++ b/tests/baselines/reference/contextualTyping18.types @@ -10,5 +10,5 @@ var foo: {id:number;} = <{id:number;}>({ }); foo = {id: 5}; >foo : { id: number; } >{id: 5} : { id: number; } >id : number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/contextualTyping19.types b/tests/baselines/reference/contextualTyping19.types index d384a68749a3a..c5ad59fa61bee 100644 --- a/tests/baselines/reference/contextualTyping19.types +++ b/tests/baselines/reference/contextualTyping19.types @@ -5,14 +5,14 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}]; >[{id:1}] : { id: number; }[] >{id:1} : { id: number; } >id : number ->1 : number +>1 : 1 >foo = [{id:1}, {id:2}] : { id: number; }[] >foo : { id: number; }[] >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number ->1 : number +>1 : 1 >{id:2} : { id: number; } >id : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/contextualTyping23.types b/tests/baselines/reference/contextualTyping23.types index 0bb8b7a58e7b1..351ee51c28d4c 100644 --- a/tests/baselines/reference/contextualTyping23.types +++ b/tests/baselines/reference/contextualTyping23.types @@ -7,5 +7,5 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5 >foo : (a: { (): number; (i: number): number; }) => number >function(a){return 5} : (a: { (): number; (i: number): number; }) => number >a : { (): number; (i: number): number; } ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/contextualTyping28.types b/tests/baselines/reference/contextualTyping28.types index e4833fd8838b0..bf246ce5b723b 100644 --- a/tests/baselines/reference/contextualTyping28.types +++ b/tests/baselines/reference/contextualTyping28.types @@ -5,5 +5,5 @@ function foo(param:number[]){}; foo([1]); >foo([1]) : void >foo : (param: number[]) => void >[1] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/contextualTyping29.types b/tests/baselines/reference/contextualTyping29.types index 96695a6d0ba7c..ba96d77393ccb 100644 --- a/tests/baselines/reference/contextualTyping29.types +++ b/tests/baselines/reference/contextualTyping29.types @@ -5,6 +5,6 @@ function foo(param:number[]){}; foo([1, 3]); >foo([1, 3]) : void >foo : (param: number[]) => void >[1, 3] : number[] ->1 : number ->3 : number +>1 : 1 +>3 : 3 diff --git a/tests/baselines/reference/contextualTyping3.types b/tests/baselines/reference/contextualTyping3.types index 81c201ee57250..c582cc0eb07af 100644 --- a/tests/baselines/reference/contextualTyping3.types +++ b/tests/baselines/reference/contextualTyping3.types @@ -5,5 +5,5 @@ class foo { public bar:{id:number;} = {id:5}; } >id : number >{id:5} : { id: number; } >id : number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/contextualTyping31.types b/tests/baselines/reference/contextualTyping31.types index 22a8f08cf908c..3b9da8bd4344f 100644 --- a/tests/baselines/reference/contextualTyping31.types +++ b/tests/baselines/reference/contextualTyping31.types @@ -5,5 +5,5 @@ function foo(param:number[]){}; foo([1]); >foo([1]) : void >foo : (param: number[]) => void >[1] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/contextualTyping32.types b/tests/baselines/reference/contextualTyping32.types index 59f6040cf7fb2..e6c6a72f54683 100644 --- a/tests/baselines/reference/contextualTyping32.types +++ b/tests/baselines/reference/contextualTyping32.types @@ -7,7 +7,7 @@ function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){ret >foo : (param: { (): number; (i: number): number; }[]) => void >[function(){return 1;}, function(){return 4}] : (() => number)[] >function(){return 1;} : () => number ->1 : number +>1 : 1 >function(){return 4} : () => number ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/contextualTyping34.types b/tests/baselines/reference/contextualTyping34.types index 6bc6b622fc8fa..48dd3e41a66e5 100644 --- a/tests/baselines/reference/contextualTyping34.types +++ b/tests/baselines/reference/contextualTyping34.types @@ -6,5 +6,5 @@ var foo = <{ id: number;}> ({id:4}); >({id:4}) : { id: number; } >{id:4} : { id: number; } >id : number ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/contextualTyping35.types b/tests/baselines/reference/contextualTyping35.types index 08bb6b27b8e98..4465e0ca1a957 100644 --- a/tests/baselines/reference/contextualTyping35.types +++ b/tests/baselines/reference/contextualTyping35.types @@ -5,7 +5,7 @@ var foo = <{ id: number;}> {id:4, name: "as"}; >id : number >{id:4, name: "as"} : { id: number; name: string; } >id : number ->4 : number +>4 : 4 >name : string ->"as" : string +>"as" : "as" diff --git a/tests/baselines/reference/contextualTyping36.types b/tests/baselines/reference/contextualTyping36.types index 6c93ed30a9f2a..2cd07e33ee6ef 100644 --- a/tests/baselines/reference/contextualTyping36.types +++ b/tests/baselines/reference/contextualTyping36.types @@ -6,7 +6,7 @@ var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })]; >[{ id: 4 }, <{ id: number; }>({ })] : { id: number; }[] >{ id: 4 } : { id: number; } >id : number ->4 : number +>4 : 4 ><{ id: number; }>({ }) : { id: number; } >id : number >({ }) : {} diff --git a/tests/baselines/reference/contextualTyping37.types b/tests/baselines/reference/contextualTyping37.types index 8acd4aedf0440..2f61262c9d1aa 100644 --- a/tests/baselines/reference/contextualTyping37.types +++ b/tests/baselines/reference/contextualTyping37.types @@ -6,6 +6,6 @@ var foo = <{ id: number; }[]>[{ foo: "s" }, { }]; >[{ foo: "s" }, { }] : ({ foo: string; } | {})[] >{ foo: "s" } : { foo: string; } >foo : string ->"s" : string +>"s" : "s" >{ } : {} diff --git a/tests/baselines/reference/contextualTyping40.types b/tests/baselines/reference/contextualTyping40.types index 1889d79f1396e..44e0c0f0a63a7 100644 --- a/tests/baselines/reference/contextualTyping40.types +++ b/tests/baselines/reference/contextualTyping40.types @@ -4,5 +4,5 @@ var foo = <{():number; (i:number):number; }> function(){return 1;}; ><{():number; (i:number):number; }> function(){return 1;} : { (): number; (i: number): number; } >i : number >function(){return 1;} : () => number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/contextualTyping6.types b/tests/baselines/reference/contextualTyping6.types index b79811a948a2e..222212bdbf465 100644 --- a/tests/baselines/reference/contextualTyping6.types +++ b/tests/baselines/reference/contextualTyping6.types @@ -5,8 +5,8 @@ var foo:{id:number;}[] = [{id:1}, {id:2}]; >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number ->1 : number +>1 : 1 >{id:2} : { id: number; } >id : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.types b/tests/baselines/reference/contextualTypingOfConditionalExpression.types index a2e29a0e66b4f..5712e7d581ed2 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.types +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.types @@ -3,7 +3,7 @@ var x: (a: number) => void = true ? (a) => a.toExponential() : (b) => b.toFixed( >x : (a: number) => void >a : number >true ? (a) => a.toExponential() : (b) => b.toFixed() : (a: number) => string ->true : boolean +>true : true >(a) => a.toExponential() : (a: number) => string >a : number >a.toExponential() : string @@ -43,7 +43,7 @@ var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; >a : A >A : A >true ? (a) => a.foo : (b) => b.foo : (a: A) => number ->true : boolean +>true : true >(a) => a.foo : (a: A) => number >a : A >a.foo : number diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.types b/tests/baselines/reference/contextualTypingOfObjectLiterals.types index a99fb2f39afe8..19189e32245cf 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals.types +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.types @@ -7,7 +7,7 @@ var obj2 = {x: ""}; >obj2 : { x: string; } >{x: ""} : { x: string; } >x : string ->"" : string +>"" : "" obj1 = {}; // Ok >obj1 = {} : {} diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt index 251a3a1bde365..95b3c66c264a9 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(2,22): error TS2339: Property 'foo' does not exist on type 'string'. tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,32): error TS2339: Property 'foo' does not exist on type 'string'. -tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,38): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,38): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts (3 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,38): error TS ~~~ !!! error TS2339: Property 'foo' does not exist on type 'string'. ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.types b/tests/baselines/reference/contextuallyTypeCommaOperator01.types index c3b7b700d640f..0551694921068 100644 --- a/tests/baselines/reference/contextuallyTypeCommaOperator01.types +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.types @@ -9,7 +9,7 @@ x = (100, a => a); >x : (a: string) => string >(100, a => a) : (a: string) => string >100, a => a : (a: string) => string ->100 : number +>100 : 100 >a => a : (a: string) => string >a : string >a : string diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.types b/tests/baselines/reference/contextuallyTypeLogicalAnd01.types index a405888c8a977..e55e1e4b511ef 100644 --- a/tests/baselines/reference/contextuallyTypeLogicalAnd01.types +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.types @@ -6,13 +6,13 @@ let x: (a: string) => string; let y = true; >y : boolean ->true : boolean +>true : true x = y && (a => a); >x = y && (a => a) : (a: string) => string >x : (a: string) => string >y && (a => a) : (a: string) => string ->y : boolean +>y : true >(a => a) : (a: string) => string >a => a : (a: string) => string >a : string diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializer.types b/tests/baselines/reference/contextuallyTypedBindingInitializer.types index 0d4dfcdd5d9e0..e9624b156c714 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializer.types +++ b/tests/baselines/reference/contextuallyTypedBindingInitializer.types @@ -30,7 +30,7 @@ function f2({ "show": showRename = v => v.toString() }: Show) {} function f3({ ["show"]: showRename = v => v.toString() }: Show) {} >f3 : ({["show"]: showRename}: Show) => void ->"show" : string +>"show" : "show" >showRename : (x: number) => string >v => v.toString() : (v: number) => string >v : number @@ -70,8 +70,8 @@ function g({ prop = ["hello", 1234] }: Tuples) {} >g : ({prop}: Tuples) => void >prop : [string, number] >["hello", 1234] : [string, number] ->"hello" : string ->1234 : number +>"hello" : "hello" +>1234 : 1234 >Tuples : Tuples interface StringUnion { diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types index 7e922332055f4..5adc82c3e62d9 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types +++ b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types @@ -25,7 +25,7 @@ function f2({ "show": showRename = v => v }: Show) {} function f3({ ["show"]: showRename = v => v }: Show) {} >f3 : ({["show"]: showRename}: Show) => void ->"show" : string +>"show" : "show" >showRename : ((x: number) => string) | ((v: number) => number) >v => v : (v: number) => number >v : number @@ -82,8 +82,8 @@ function g({ prop = [101, 1234] }: Tuples) {} >g : ({prop}: Tuples) => void >prop : [string, number] | [number, number] >[101, 1234] : [number, number] ->101 : number ->1234 : number +>101 : 101 +>1234 : 1234 >Tuples : Tuples interface StringUnion { diff --git a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types index 94b184f65da25..7fc2f88f32632 100644 --- a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types +++ b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types @@ -19,7 +19,7 @@ foo((y): (y2: number) => void => { >y.charAt : (pos: number) => string >y : string >charAt : (pos: number) => string ->0 : number +>0 : 0 return null; >null : null @@ -44,7 +44,7 @@ foo((y: string) => { >toFixed : (fractionDigits?: number) => string return 0; ->0 : number +>0 : 0 }; }); diff --git a/tests/baselines/reference/contextuallyTypedIife.types b/tests/baselines/reference/contextuallyTypedIife.types index 2f12e543356ff..ca0f7f2a5085a 100644 --- a/tests/baselines/reference/contextuallyTypedIife.types +++ b/tests/baselines/reference/contextuallyTypedIife.types @@ -5,7 +5,7 @@ >(jake => { }) : (jake: string) => void >jake => { } : (jake: string) => void >jake : string ->"build" : string +>"build" : "build" // function expression (function (cats) { })("lol"); @@ -13,7 +13,7 @@ >(function (cats) { }) : (cats: string) => void >function (cats) { } : (cats: string) => void >cats : string ->"lol" : string +>"lol" : "lol" // Lots of Irritating Superfluous Parentheses (function (x) { } ("!")); @@ -21,7 +21,7 @@ >function (x) { } ("!") : void >function (x) { } : (x: string) => void >x : string ->"!" : string +>"!" : "!" ((((function (y) { }))))("-"); >((((function (y) { }))))("-") : void @@ -31,7 +31,7 @@ >(function (y) { }) : (y: string) => void >function (y) { } : (y: string) => void >y : string ->"-" : string +>"-" : "-" // multiple arguments ((a, b, c) => { })("foo", 101, false); @@ -41,8 +41,8 @@ >a : string >b : number >c : boolean ->"foo" : string ->101 : number +>"foo" : "foo" +>101 : 101 >false : false // default parameters @@ -51,21 +51,21 @@ >((m = 10) => m + 1) : (m?: number) => number >(m = 10) => m + 1 : (m?: number) => number >m : number ->10 : number +>10 : 10 >m + 1 : number >m : number ->1 : number ->12 : number +>1 : 1 +>12 : 12 ((n = 10) => n + 1)(); >((n = 10) => n + 1)() : number >((n = 10) => n + 1) : (n?: number) => number >(n = 10) => n + 1 : (n?: number) => number >n : number ->10 : number +>10 : 10 >n + 1 : number >n : number ->1 : number +>1 : 1 // optional parameters ((j?) => j + 1)(12); @@ -75,8 +75,8 @@ >j : number >j + 1 : number >j : number ->1 : number ->12 : number +>1 : 1 +>12 : 12 ((k?) => k + 1)(); >((k?) => k + 1)() : any @@ -85,7 +85,7 @@ >k : any >k + 1 : any >k : any ->1 : number +>1 : 1 ((l, o?) => l + o)(12); // o should be any >((l, o?) => l + o)(12) : any @@ -96,7 +96,7 @@ >l + o : any >l : number >o : any ->12 : number +>12 : 12 // rest parameters ((...numbers) => numbers.every(n => n > 0))(5,6,7); @@ -112,10 +112,10 @@ >n : number >n > 0 : boolean >n : number ->0 : number ->5 : number ->6 : number ->7 : number +>0 : 0 +>5 : 5 +>6 : 6 +>7 : 7 ((...mixed) => mixed.every(n => !!n))(5,'oops','oh no'); >((...mixed) => mixed.every(n => !!n))(5,'oops','oh no') : boolean @@ -131,9 +131,9 @@ >!!n : boolean >!n : boolean >n : string | number ->5 : number ->'oops' : string ->'oh no' : string +>5 : 5 +>'oops' : "oops" +>'oh no' : "oh no" ((...noNumbers) => noNumbers.some(n => n > 0))(); >((...noNumbers) => noNumbers.some(n => n > 0))() : boolean @@ -148,7 +148,7 @@ >n : any >n > 0 : boolean >n : any ->0 : number +>0 : 0 ((first, ...rest) => first ? [] : rest.map(n => n > 0))(8,9,10); >((first, ...rest) => first ? [] : rest.map(n => n > 0))(8,9,10) : boolean[] @@ -167,10 +167,10 @@ >n : number >n > 0 : boolean >n : number ->0 : number ->8 : number ->9 : number ->10 : number +>0 : 0 +>8 : 8 +>9 : 9 +>10 : 10 // destructuring parameters (with defaults too!) (({ q }) => q)({ q : 13 }); @@ -181,42 +181,42 @@ >q : number >{ q : 13 } : { q: number; } >q : number ->13 : number +>13 : 13 (({ p = 14 }) => p)({ p : 15 }); >(({ p = 14 }) => p)({ p : 15 }) : number >(({ p = 14 }) => p) : ({p}: { p: number; }) => number >({ p = 14 }) => p : ({p}: { p: number; }) => number >p : number ->14 : number +>14 : 14 >p : number >{ p : 15 } : { p: number; } >p : number ->15 : number +>15 : 15 (({ r = 17 } = { r: 18 }) => r)({r : 19}); >(({ r = 17 } = { r: 18 }) => r)({r : 19}) : number >(({ r = 17 } = { r: 18 }) => r) : ({r}?: { r: number; }) => number >({ r = 17 } = { r: 18 }) => r : ({r}?: { r: number; }) => number >r : number ->17 : number +>17 : 17 >{ r: 18 } : { r: number; } >r : number ->18 : number +>18 : 18 >r : number >{r : 19} : { r: number; } >r : number ->19 : number +>19 : 19 (({ u = 22 } = { u: 23 }) => u)(); >(({ u = 22 } = { u: 23 }) => u)() : number >(({ u = 22 } = { u: 23 }) => u) : ({u}?: { u?: number; }) => number >({ u = 22 } = { u: 23 }) => u : ({u}?: { u?: number; }) => number >u : number ->22 : number +>22 : 22 >{ u: 23 } : { u?: number; } >u : number ->23 : number +>23 : 23 >u : number // contextually typed parameters. @@ -228,7 +228,7 @@ let twelve = (f => f(12))(i => i); >f : (i: any) => any >f(12) : any >f : (i: any) => any ->12 : number +>12 : 12 >i => i : (i: any) => any >i : any >i : any @@ -243,7 +243,7 @@ let eleven = (o => o.a(11))({ a: function(n) { return n; } }); >o.a : (n: any) => any >o : { a: (n: any) => any; } >a : (n: any) => any ->11 : number +>11 : 11 >{ a: function(n) { return n; } } : { a: (n: any) => any; } >a : (n: any) => any >function(n) { return n; } : (n: any) => any diff --git a/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.types b/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.types index dcb25792fe00c..5335cc4f81f45 100644 --- a/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.types +++ b/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.types @@ -40,11 +40,11 @@ function getFoo1(): Foo { >arg : A arg.numProp = 10; ->arg.numProp = 10 : number +>arg.numProp = 10 : 10 >arg.numProp : number >arg : A >numProp : number ->10 : number +>10 : 10 }, method2(arg) { @@ -52,11 +52,11 @@ function getFoo1(): Foo { >arg : B arg.strProp = "hello"; ->arg.strProp = "hello" : string +>arg.strProp = "hello" : "hello" >arg.strProp : string >arg : B >strProp : string ->"hello" : string +>"hello" : "hello" } } } @@ -74,11 +74,11 @@ function getFoo2(): Foo { >arg : A arg.numProp = 10; ->arg.numProp = 10 : number +>arg.numProp = 10 : 10 >arg.numProp : number >arg : A >numProp : number ->10 : number +>10 : 10 }, method2: (arg) => { @@ -87,11 +87,11 @@ function getFoo2(): Foo { >arg : B arg.strProp = "hello"; ->arg.strProp = "hello" : string +>arg.strProp = "hello" : "hello" >arg.strProp : string >arg : B >strProp : string ->"hello" : string +>"hello" : "hello" } } } @@ -109,11 +109,11 @@ function getFoo3(): Foo { >arg : A arg.numProp = 10; ->arg.numProp = 10 : number +>arg.numProp = 10 : 10 >arg.numProp : number >arg : A >numProp : number ->10 : number +>10 : 10 }, method2: function (arg) { @@ -122,11 +122,11 @@ function getFoo3(): Foo { >arg : B arg.strProp = "hello"; ->arg.strProp = "hello" : string +>arg.strProp = "hello" : "hello" >arg.strProp : string >arg : B >strProp : string ->"hello" : string +>"hello" : "hello" } } } diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.types b/tests/baselines/reference/contextuallyTypingOrOperator.types index 676ad04bfa97f..3ca4ff4ee8f7e 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator.types @@ -15,7 +15,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >a : (s: string) => number >s => 1 : (s: string) => number >s : string ->1 : number +>1 : 1 var v2 = (s: string) => s.length || function (s) { s.length }; >v2 : (s: string) => number | ((s: any) => void) @@ -41,14 +41,14 @@ var v3 = (s: string) => s.length || function (s: number) { return 1 }; >length : number >function (s: number) { return 1 } : (s: number) => number >s : number ->1 : number +>1 : 1 var v4 = (s: number) => 1 || function (s: string) { return s.length }; ->v4 : (s: number) => number | ((s: string) => number) ->(s: number) => 1 || function (s: string) { return s.length } : (s: number) => number | ((s: string) => number) +>v4 : (s: number) => 1 | ((s: string) => number) +>(s: number) => 1 || function (s: string) { return s.length } : (s: number) => 1 | ((s: string) => number) >s : number ->1 || function (s: string) { return s.length } : number | ((s: string) => number) ->1 : number +>1 || function (s: string) { return s.length } : 1 | ((s: string) => number) +>1 : 1 >function (s: string) { return s.length } : (s: string) => number >s : string >s.length : number diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.types b/tests/baselines/reference/contextuallyTypingOrOperator2.types index 2a73ccc9c9d87..f72e6f3e92e5c 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator2.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.types @@ -15,7 +15,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >a : (s: string) => number >s => 1 : (s: string) => number >s : string ->1 : number +>1 : 1 var v2 = (s: string) => s.length || function (s) { s.aaa }; >v2 : (s: string) => number | ((s: any) => void) diff --git a/tests/baselines/reference/continueInIterationStatement1.types b/tests/baselines/reference/continueInIterationStatement1.types index 4fcf37948448b..a61ec004fba85 100644 --- a/tests/baselines/reference/continueInIterationStatement1.types +++ b/tests/baselines/reference/continueInIterationStatement1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/continueInIterationStatement1.ts === while (true) { ->true : boolean +>true : true continue; } diff --git a/tests/baselines/reference/continueInIterationStatement2.types b/tests/baselines/reference/continueInIterationStatement2.types index 4a3d50c750111..59d7b88cc5992 100644 --- a/tests/baselines/reference/continueInIterationStatement2.types +++ b/tests/baselines/reference/continueInIterationStatement2.types @@ -3,5 +3,5 @@ do { continue; } while (true); ->true : boolean +>true : true diff --git a/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types b/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types index 885b67d414046..4ccf96ad6242d 100644 --- a/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types +++ b/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types @@ -5,8 +5,8 @@ function foo() { for (const i of [0, 1]) { >i : number >[0, 1] : number[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 if (i === 0) { >i === 0 : boolean diff --git a/tests/baselines/reference/continueLabel.types b/tests/baselines/reference/continueLabel.types index a25f331160765..788133b337bbf 100644 --- a/tests/baselines/reference/continueLabel.types +++ b/tests/baselines/reference/continueLabel.types @@ -2,10 +2,10 @@ label1: for(var i = 0; i < 1; i++) { >label1 : any >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/continueTarget2.types b/tests/baselines/reference/continueTarget2.types index 1e9a2325642cd..5b8fc5a01d27c 100644 --- a/tests/baselines/reference/continueTarget2.types +++ b/tests/baselines/reference/continueTarget2.types @@ -3,7 +3,7 @@ target: >target : any while (true) { ->true : boolean +>true : true continue target; >target : any diff --git a/tests/baselines/reference/continueTarget3.types b/tests/baselines/reference/continueTarget3.types index d55f1c3f6d223..502c406b05f73 100644 --- a/tests/baselines/reference/continueTarget3.types +++ b/tests/baselines/reference/continueTarget3.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true continue target1; >target1 : any diff --git a/tests/baselines/reference/continueTarget4.types b/tests/baselines/reference/continueTarget4.types index e3e3ae82dfee8..e07208ccc10fe 100644 --- a/tests/baselines/reference/continueTarget4.types +++ b/tests/baselines/reference/continueTarget4.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true continue target2; >target2 : any diff --git a/tests/baselines/reference/controlFlowAssignmentExpression.types b/tests/baselines/reference/controlFlowAssignmentExpression.types index 94e71b1fd2ad3..4cc2c52cc1b53 100644 --- a/tests/baselines/reference/controlFlowAssignmentExpression.types +++ b/tests/baselines/reference/controlFlowAssignmentExpression.types @@ -6,9 +6,9 @@ let obj: any; >obj : any x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" x = x.length; >x = x.length : number @@ -30,9 +30,9 @@ x = true; >(x = "", obj).foo : any >(x = "", obj) : any >x = "", obj : any ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" >obj : any >foo : any >(x = x.length) : number diff --git a/tests/baselines/reference/controlFlowBinaryAndExpression.types b/tests/baselines/reference/controlFlowBinaryAndExpression.types index 8a1924c42eb3b..1e7f4e4484818 100644 --- a/tests/baselines/reference/controlFlowBinaryAndExpression.types +++ b/tests/baselines/reference/controlFlowBinaryAndExpression.types @@ -6,31 +6,31 @@ let cond: boolean; >cond : boolean (x = "") && (x = 0); ->(x = "") && (x = 0) : number ->(x = "") : string ->x = "" : string +>(x = "") && (x = 0) : "" +>(x = "") : "" +>x = "" : "" >x : string | number | boolean ->"" : string ->(x = 0) : number ->x = 0 : number +>"" : "" +>(x = 0) : 0 +>x = 0 : 0 >x : string | number | boolean ->0 : number +>0 : 0 x; // string | number >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" cond && (x = 0); ->cond && (x = 0) : number +>cond && (x = 0) : 0 >cond : boolean ->(x = 0) : number ->x = 0 : number +>(x = 0) : 0 +>x = 0 : 0 >x : string | number | boolean ->0 : number +>0 : 0 x; // string | number >x : string | number diff --git a/tests/baselines/reference/controlFlowBinaryOrExpression.types b/tests/baselines/reference/controlFlowBinaryOrExpression.types index 7e92fcdbbd153..166718b92662c 100644 --- a/tests/baselines/reference/controlFlowBinaryOrExpression.types +++ b/tests/baselines/reference/controlFlowBinaryOrExpression.types @@ -6,31 +6,31 @@ let cond: boolean; >cond : boolean (x = "") || (x = 0); ->(x = "") || (x = 0) : string | number ->(x = "") : string ->x = "" : string +>(x = "") || (x = 0) : 0 +>(x = "") : "" +>x = "" : "" >x : string | number | boolean ->"" : string ->(x = 0) : number ->x = 0 : number +>"" : "" +>(x = 0) : 0 +>x = 0 : 0 >x : string | number | boolean ->0 : number +>0 : 0 x; // string | number >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" cond || (x = 0); ->cond || (x = 0) : number | true +>cond || (x = 0) : true | 0 >cond : boolean ->(x = 0) : number ->x = 0 : number +>(x = 0) : 0 +>x = 0 : 0 >x : string | number | boolean ->0 : number +>0 : 0 x; // string | number >x : string | number diff --git a/tests/baselines/reference/controlFlowCaching.types b/tests/baselines/reference/controlFlowCaching.types index 137fbc3d19c53..4b7df020c9419 100644 --- a/tests/baselines/reference/controlFlowCaching.types +++ b/tests/baselines/reference/controlFlowCaching.types @@ -49,14 +49,14 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >o.rotation : any >o : any >rotation : any ->360 : number +>360 : 360 start, stop, titlePos, titleRotation = 0, titleOffset, axisVector, tickVector, anchorOffset, labelOffset, labelAlign, >start : any >stop : any >titlePos : any >titleRotation : number ->0 : number +>0 : 0 >titleOffset : any >axisVector : any >tickVector : any @@ -151,7 +151,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >ta : any >tick : any >fontColor : any ->"black" : string +>"black" : "black" taTitleFontColor = o.titleFontColor || (ta.title && ta.title.fontColor) || "black", >taTitleFontColor : any @@ -170,7 +170,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >ta : any >title : any >fontColor : any ->"black" : string +>"black" : "black" taTitleGap = (o.titleGap == 0) ? 0 : o.titleGap || (ta.title && ta.title.gap) || 15, >taTitleGap : any @@ -181,7 +181,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >o : any >titleGap : any >0 : 0 ->0 : number +>0 : 0 >o.titleGap || (ta.title && ta.title.gap) || 15 : any >o.titleGap || (ta.title && ta.title.gap) : any >o.titleGap : any @@ -197,7 +197,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >ta : any >title : any >gap : any ->15 : number +>15 : 15 taTitleOrientation = o.titleOrientation || (ta.title && ta.title.orientation) || "axis", >taTitleOrientation : any @@ -216,7 +216,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >ta : any >title : any >orientation : any ->"axis" : string +>"axis" : "axis" taMajorTick = this.chart.theme.getTick("major", o), >taMajorTick : any @@ -228,7 +228,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >chart : any >theme : any >getTick : any ->"major" : string +>"major" : "major" >o : any taMinorTick = this.chart.theme.getTick("minor", o), @@ -241,7 +241,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >chart : any >theme : any >getTick : any ->"minor" : string +>"minor" : "minor" >o : any taMicroTick = this.chart.theme.getTick("micro", o), @@ -254,14 +254,14 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >chart : any >theme : any >getTick : any ->"micro" : string +>"micro" : "micro" >o : any taStroke = "stroke" in o ? o.stroke : ta.stroke, >taStroke : any >"stroke" in o ? o.stroke : ta.stroke : any >"stroke" in o : boolean ->"stroke" : string +>"stroke" : "stroke" >o : any >o.stroke : any >o : any @@ -285,7 +285,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >splitFontString : any >taFont : any >size : any ->0 : number +>0 : 0 cosr = Math.abs(Math.cos(rotation * Math.PI / 180)), >cosr : number @@ -303,7 +303,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >Math.PI : number >Math : Math >PI : number ->180 : number +>180 : 180 sinr = Math.abs(Math.sin(rotation * Math.PI / 180)), >sinr : number @@ -321,7 +321,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >Math.PI : number >Math : Math >PI : number ->180 : number +>180 : 180 tsize = taTitleFont ? g.normalizedLength(g.splitFontString(taTitleFont).size) : 0; >tsize : any @@ -338,17 +338,17 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >splitFontString : any >taTitleFont : any >size : any ->0 : number +>0 : 0 if (rotation < 0) { >rotation < 0 : boolean >rotation : number ->0 : number +>0 : 0 rotation += 360; >rotation += 360 : number >rotation : number ->360 : number +>360 : 360 } var cachedLabelW = this._getMaxLabelSize(); >cachedLabelW : any @@ -381,7 +381,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >(cachedLabelW || 0) : any >cachedLabelW || 0 : any >cachedLabelW : any ->0 : number +>0 : 0 >sinr : number >labelGap : any >Math.max(taMajorTick.length > 0 ? taMajorTick.length : 0, taMinorTick.length > 0 ? taMinorTick.length : 0) : number @@ -393,11 +393,11 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >taMajorTick.length : any >taMajorTick : any >length : any ->0 : number +>0 : 0 >taMajorTick.length : any >taMajorTick : any >length : any ->0 : number +>0 : 0 taMinorTick.length > 0 ? taMinorTick.length : 0) + >taMinorTick.length > 0 ? taMinorTick.length : 0 : any @@ -405,11 +405,11 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >taMinorTick.length : any >taMinorTick : any >length : any ->0 : number +>0 : 0 >taMinorTick.length : any >taMinorTick : any >length : any ->0 : number +>0 : 0 tsize + taTitleGap; >tsize : any @@ -420,13 +420,13 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >axisVector : any >{ x: isRtl ? -1 : 1, y: 0 } : { x: number; y: number; } >x : number ->isRtl ? -1 : 1 : number +>isRtl ? -1 : 1 : 1 | -1 >isRtl : any ->-1 : number ->1 : number ->1 : number +>-1 : -1 +>1 : 1 +>1 : 1 >y : number ->0 : number +>0 : 0 switch (rotation) { >rotation : number @@ -437,7 +437,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >rotation : number >(90 - centerAnchorLimit) : number >90 - centerAnchorLimit : number ->90 : number +>90 : 90 >centerAnchorLimit : any labelOffset.y = leftBottom ? size : 0; @@ -448,14 +448,14 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >leftBottom ? size : 0 : any >leftBottom : boolean >size : any ->0 : number +>0 : 0 } else if (rotation < (90 + centerAnchorLimit)) { >rotation < (90 + centerAnchorLimit) : boolean >rotation : number >(90 + centerAnchorLimit) : any >90 + centerAnchorLimit : any ->90 : number +>90 : 90 >centerAnchorLimit : any labelOffset.x = -size * 0.4; @@ -466,12 +466,12 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >-size * 0.4 : number >-size : number >size : any ->0.4 : number +>0.4 : 0.4 } else if (rotation < 180) { >rotation < 180 : boolean >rotation : number ->180 : number +>180 : 180 labelOffset.y = leftBottom ? 0 : -size; >labelOffset.y = leftBottom ? 0 : -size : number @@ -480,7 +480,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >y : any >leftBottom ? 0 : -size : number >leftBottom : boolean ->0 : number +>0 : 0 >-size : number >size : any @@ -489,7 +489,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >rotation : number >(270 - centerAnchorLimit) : number >270 - centerAnchorLimit : number ->270 : number +>270 : 270 >centerAnchorLimit : any labelOffset.y = leftBottom ? 0 : -size; @@ -499,7 +499,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >y : any >leftBottom ? 0 : -size : number >leftBottom : boolean ->0 : number +>0 : 0 >-size : number >size : any @@ -508,7 +508,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >rotation : number >(270 + centerAnchorLimit) : any >270 + centerAnchorLimit : any ->270 : number +>270 : 270 >centerAnchorLimit : any labelOffset.y = leftBottom ? size * 0.4 : 0; @@ -520,8 +520,8 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >leftBottom : boolean >size * 0.4 : number >size : any ->0.4 : number ->0 : number +>0.4 : 0.4 +>0 : 0 } else { labelOffset.y = leftBottom ? size : 0; @@ -532,22 +532,22 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >leftBottom ? size : 0 : any >leftBottom : boolean >size : any ->0 : number +>0 : 0 } } titleRotation = (taTitleOrientation && taTitleOrientation == "away") ? 180 : 0; ->titleRotation = (taTitleOrientation && taTitleOrientation == "away") ? 180 : 0 : number +>titleRotation = (taTitleOrientation && taTitleOrientation == "away") ? 180 : 0 : 0 | 180 >titleRotation : number ->(taTitleOrientation && taTitleOrientation == "away") ? 180 : 0 : number +>(taTitleOrientation && taTitleOrientation == "away") ? 180 : 0 : 0 | 180 >(taTitleOrientation && taTitleOrientation == "away") : boolean >taTitleOrientation && taTitleOrientation == "away" : boolean >taTitleOrientation : any >taTitleOrientation == "away" : boolean >taTitleOrientation : any >"away" : "away" ->180 : number ->0 : number +>180 : 180 +>0 : 0 titlePos.y = offsets.t - titleOffset + (titleRotation ? 0 : tsize); >titlePos.y = offsets.t - titleOffset + (titleRotation ? 0 : tsize) : any @@ -563,7 +563,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >(titleRotation ? 0 : tsize) : any >titleRotation ? 0 : tsize : any >titleRotation : number ->0 : number +>0 : 0 >tsize : any switch (labelAlign) { @@ -573,18 +573,18 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >"start" : "start" labelAlign = "end"; ->labelAlign = "end" : string +>labelAlign = "end" : "end" >labelAlign : any ->"end" : string +>"end" : "end" break; case "end": >"end" : "end" labelAlign = "start"; ->labelAlign = "start" : string +>labelAlign = "start" : "start" >labelAlign : any ->"start" : string +>"start" : "start" break; case "middle": diff --git a/tests/baselines/reference/controlFlowCommaOperator.types b/tests/baselines/reference/controlFlowCommaOperator.types index 8df5b8e7889a6..52fd3d7b87d62 100644 --- a/tests/baselines/reference/controlFlowCommaOperator.types +++ b/tests/baselines/reference/controlFlowCommaOperator.types @@ -13,9 +13,9 @@ function f(x: string | number | boolean) { if (y = "", typeof x === "string") { >y = "", typeof x === "string" : boolean ->y = "" : string +>y = "" : "" >y : string | number | boolean ->"" : string +>"" : "" >typeof x === "string" : boolean >typeof x : string >x : string | number | boolean @@ -32,9 +32,9 @@ function f(x: string | number | boolean) { } else if (z = 1, typeof x === "number") { >z = 1, typeof x === "number" : boolean ->z = 1 : number +>z = 1 : 1 >z : string | number | boolean ->1 : number +>1 : 1 >typeof x === "number" : boolean >typeof x : string >x : number | boolean diff --git a/tests/baselines/reference/controlFlowConditionalExpression.types b/tests/baselines/reference/controlFlowConditionalExpression.types index c6084e052b172..a648b86e83574 100644 --- a/tests/baselines/reference/controlFlowConditionalExpression.types +++ b/tests/baselines/reference/controlFlowConditionalExpression.types @@ -6,14 +6,14 @@ let cond: boolean; >cond : boolean cond ? x = "" : x = 3; ->cond ? x = "" : x = 3 : string | number +>cond ? x = "" : x = 3 : "" | 3 >cond : boolean ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string ->x = 3 : number +>"" : "" +>x = 3 : 3 >x : string | number | boolean ->3 : number +>3 : 3 x; // string | number >x : string | number diff --git a/tests/baselines/reference/controlFlowDeleteOperator.types b/tests/baselines/reference/controlFlowDeleteOperator.types index b0040f12bc2c2..5715cfc404376 100644 --- a/tests/baselines/reference/controlFlowDeleteOperator.types +++ b/tests/baselines/reference/controlFlowDeleteOperator.types @@ -9,7 +9,7 @@ function f() { >b : string | number >{ b: 1 } : { b: number; } >b : number ->1 : number +>1 : 1 x.a; >x.a : string | number | undefined @@ -22,18 +22,18 @@ function f() { >b : string | number x.a = 1; ->x.a = 1 : number +>x.a = 1 : 1 >x.a : string | number | undefined >x : { a?: string | number | undefined; b: string | number; } >a : string | number | undefined ->1 : number +>1 : 1 x.b = 1; ->x.b = 1 : number +>x.b = 1 : 1 >x.b : string | number >x : { a?: string | number | undefined; b: string | number; } >b : string | number ->1 : number +>1 : 1 x.a; >x.a : number diff --git a/tests/baselines/reference/controlFlowDestructuringDeclaration.types b/tests/baselines/reference/controlFlowDestructuringDeclaration.types index 2e3b1f5647e50..d50b743b74642 100644 --- a/tests/baselines/reference/controlFlowDestructuringDeclaration.types +++ b/tests/baselines/reference/controlFlowDestructuringDeclaration.types @@ -5,14 +5,14 @@ function f1() { let x: string | number = 1; >x : string | number ->1 : number +>1 : 1 x; >x : number let y: string | undefined = ""; >y : string | undefined ->"" : string +>"" : "" y; >y : string @@ -24,7 +24,7 @@ function f2() { let [x]: [string | number] = [1]; >x : string | number >[1] : [number] ->1 : number +>1 : 1 x; >x : number @@ -32,14 +32,14 @@ function f2() { let [y]: [string | undefined] = [""]; >y : string | undefined >[""] : [string] ->"" : string +>"" : "" y; >y : string let [z = ""]: [string | undefined] = [undefined]; >z : string ->"" : string +>"" : "" >[undefined] : [undefined] >undefined : undefined @@ -53,7 +53,7 @@ function f3() { let [x]: (string | number)[] = [1]; >x : string | number >[1] : number[] ->1 : number +>1 : 1 x; >x : number @@ -61,14 +61,14 @@ function f3() { let [y]: (string | undefined)[] = [""]; >y : string | undefined >[""] : string[] ->"" : string +>"" : "" y; >y : string let [z = ""]: (string | undefined)[] = [undefined]; >z : string ->"" : string +>"" : "" >[undefined] : undefined[] >undefined : undefined @@ -84,7 +84,7 @@ function f4() { >x : string | number >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 x; >x : number @@ -94,14 +94,14 @@ function f4() { >y : string | undefined >{ y: "" } : { y: string; } >y : string ->"" : string +>"" : "" y; >y : string let { z = "" }: { z: string | undefined } = { z: undefined }; >z : string ->"" : string +>"" : "" >z : string | undefined >{ z: undefined } : { z: undefined; } >z : undefined @@ -119,7 +119,7 @@ function f5() { >x : string | number | undefined >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 x; >x : number @@ -129,14 +129,14 @@ function f5() { >y : string | undefined >{ y: "" } : { y: string; } >y : string ->"" : string +>"" : "" y; >y : string let { z = "" }: { z?: string | undefined } = { z: undefined }; >z : string ->"" : string +>"" : "" >z : string | undefined >{ z: undefined } : { z: undefined; } >z : undefined @@ -167,7 +167,7 @@ function f6() { let { z = "" }: { z?: string | undefined } = {}; >z : string ->"" : string +>"" : "" >z : string | undefined >{} : {} @@ -183,7 +183,7 @@ function f7() { >x : string >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 let { x }: { [x: string]: string | number } = o; >x : string | number diff --git a/tests/baselines/reference/controlFlowDestructuringParameters.types b/tests/baselines/reference/controlFlowDestructuringParameters.types index 396852bf37a96..d0729e6d7d561 100644 --- a/tests/baselines/reference/controlFlowDestructuringParameters.types +++ b/tests/baselines/reference/controlFlowDestructuringParameters.types @@ -8,7 +8,7 @@ >[{ x: 1 }] : { x: number; }[] >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 >map : (callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any) => U[] ({ x }) => x diff --git a/tests/baselines/reference/controlFlowDoWhileStatement.types b/tests/baselines/reference/controlFlowDoWhileStatement.types index d7916f51dfb2e..24f3e92b144d3 100644 --- a/tests/baselines/reference/controlFlowDoWhileStatement.types +++ b/tests/baselines/reference/controlFlowDoWhileStatement.types @@ -9,9 +9,9 @@ function a() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" do { x; // string @@ -27,18 +27,18 @@ function b() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" do { x; // string >x : string x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 break; } while (cond) @@ -51,9 +51,9 @@ function c() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" do { x; // string @@ -81,18 +81,18 @@ function d() { >x : string | number x = 1000; ->x = 1000 : number +>x = 1000 : 1000 >x : string | number ->1000 : number +>1000 : 1000 do { x; // number >x : number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" } while (x = x.length) >x = x.length : number @@ -111,15 +111,15 @@ function e() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" do { x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 } while (cond) >cond : boolean @@ -136,18 +136,18 @@ function f() { >Function : Function x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | Function | RegExp ->"" : string +>"" : "" do { if (cond) { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | Function | RegExp ->42 : number +>42 : 42 break; } @@ -181,18 +181,18 @@ function g() { >Function : Function x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | Function | RegExp ->"" : string +>"" : "" do { if (cond) { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | Function | RegExp ->42 : number +>42 : 42 break; } @@ -212,7 +212,7 @@ function g() { >/a/ : RegExp } while (true) ->true : boolean +>true : true x; // number >x : number diff --git a/tests/baselines/reference/controlFlowForInStatement.types b/tests/baselines/reference/controlFlowForInStatement.types index 1930071aeb559..e3a4407bff36d 100644 --- a/tests/baselines/reference/controlFlowForInStatement.types +++ b/tests/baselines/reference/controlFlowForInStatement.types @@ -28,9 +28,9 @@ for (let y in obj) { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | Function | RegExp ->42 : number +>42 : 42 continue; } diff --git a/tests/baselines/reference/controlFlowForStatement.types b/tests/baselines/reference/controlFlowForStatement.types index c16ee4f45ec92..d227e87ea1d53 100644 --- a/tests/baselines/reference/controlFlowForStatement.types +++ b/tests/baselines/reference/controlFlowForStatement.types @@ -9,13 +9,13 @@ function a() { >x : string | number | boolean for (x = ""; cond; x = 5) { ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" >cond : boolean ->x = 5 : number +>x = 5 : 5 >x : string | number | boolean ->5 : number +>5 : 5 x; // string | number >x : string | number @@ -28,9 +28,9 @@ function b() { >x : string | number | boolean for (x = 5; cond; x = x.length) { ->x = 5 : number +>x = 5 : 5 >x : string | number | boolean ->5 : number +>5 : 5 >cond : boolean >x = x.length : number >x : string | number | boolean @@ -42,9 +42,9 @@ function b() { >x : number x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" } } function c() { @@ -54,18 +54,18 @@ function c() { >x : string | number | boolean for (x = 5; x = x.toExponential(); x = 5) { ->x = 5 : number +>x = 5 : 5 >x : string | number | boolean ->5 : number +>5 : 5 >x = x.toExponential() : string >x : string | number | boolean >x.toExponential() : string >x.toExponential : (fractionDigits?: number) => string >x : number >toExponential : (fractionDigits?: number) => string ->x = 5 : number +>x = 5 : 5 >x : string | number | boolean ->5 : number +>5 : 5 x; // string >x : string @@ -78,16 +78,16 @@ function d() { >x : string | number | boolean for (x = ""; typeof x === "string"; x = 5) { ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" >typeof x === "string" : boolean >typeof x : string >x : string | number >"string" : "string" ->x = 5 : number +>x = 5 : 5 >x : string | number | boolean ->5 : number +>5 : 5 x; // string >x : string @@ -101,19 +101,19 @@ function e() { >RegExp : RegExp for (x = "" || 0; typeof x !== "string"; x = "" || true) { ->x = "" || 0 : string | number +>x = "" || 0 : 0 >x : string | number | boolean | RegExp ->"" || 0 : string | number ->"" : string ->0 : number +>"" || 0 : 0 +>"" : "" +>0 : 0 >typeof x !== "string" : boolean >typeof x : string ->x : string | number | true +>x : number | true >"string" : "string" ->x = "" || true : string | true +>x = "" || true : true >x : string | number | boolean | RegExp ->"" || true : string | true ->"" : string +>"" || true : true +>"" : "" >true : true x; // number | boolean diff --git a/tests/baselines/reference/controlFlowIIFE.types b/tests/baselines/reference/controlFlowIIFE.types index dd1fbacc42425..6173e79dbbbd7 100644 --- a/tests/baselines/reference/controlFlowIIFE.types +++ b/tests/baselines/reference/controlFlowIIFE.types @@ -90,9 +90,9 @@ function f3() { >length : number >y : number >z : number ->y = 1 : number +>y = 1 : 1 >y : number ->1 : number +>1 : 1 } } @@ -107,9 +107,9 @@ let maybeNumber: number | undefined; >function () { maybeNumber = 1;} : () => void maybeNumber = 1; ->maybeNumber = 1 : number +>maybeNumber = 1 : 1 >maybeNumber : number | undefined ->1 : number +>1 : 1 })(); maybeNumber++; @@ -118,7 +118,7 @@ maybeNumber++; if (maybeNumber !== undefined) { >maybeNumber !== undefined : boolean ->maybeNumber : number +>maybeNumber : number | undefined >undefined : undefined maybeNumber++; @@ -136,7 +136,7 @@ if (!test) { throw new Error('Test is not defined'); >new Error('Test is not defined') : Error >Error : ErrorConstructor ->'Test is not defined' : string +>'Test is not defined' : "Test is not defined" } (() => { >(() => { test.slice(1); // No error})() : void @@ -148,6 +148,6 @@ if (!test) { >test.slice : (start?: number | undefined, end?: number | undefined) => string >test : string >slice : (start?: number | undefined, end?: number | undefined) => string ->1 : number +>1 : 1 })(); diff --git a/tests/baselines/reference/controlFlowIfStatement.types b/tests/baselines/reference/controlFlowIfStatement.types index fe609d98fb459..0507b82e60a02 100644 --- a/tests/baselines/reference/controlFlowIfStatement.types +++ b/tests/baselines/reference/controlFlowIfStatement.types @@ -23,18 +23,18 @@ if (x /* RegExp */, (x = true)) { >x : true x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | RegExp ->"" : string +>"" : "" } else { x; // boolean >x : true x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | RegExp ->42 : number +>42 : 42 } x; // string | number >x : string | number @@ -49,15 +49,15 @@ function a() { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 } else { x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" return; } @@ -74,18 +74,18 @@ function b() { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 throw ""; ->"" : string +>"" : "" } else { x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" } x; // string >x : string @@ -130,7 +130,7 @@ function d(data: string | T): never { throw new Error('will always happen'); >new Error('will always happen') : Error >Error : ErrorConstructor ->'will always happen' : string +>'will always happen' : "will always happen" } else { return data; diff --git a/tests/baselines/reference/controlFlowInstanceof.types b/tests/baselines/reference/controlFlowInstanceof.types index e52d1a25b1d0d..3dc9fff8b0456 100644 --- a/tests/baselines/reference/controlFlowInstanceof.types +++ b/tests/baselines/reference/controlFlowInstanceof.types @@ -33,7 +33,7 @@ function f1(s: Set | Set) { >s.add : (value: number) => Set >s : Set >add : (value: number) => Set ->42 : number +>42 : 42 } function f2(s: Set | Set) { @@ -67,7 +67,7 @@ function f2(s: Set | Set) { >s.add : (value: number) => Set >s : Set >add : (value: number) => Set ->42 : number +>42 : 42 } function f3(s: Set | Set) { diff --git a/tests/baselines/reference/controlFlowIteration.types b/tests/baselines/reference/controlFlowIteration.types index 52be501d68e8d..a8c05b9732fa9 100644 --- a/tests/baselines/reference/controlFlowIteration.types +++ b/tests/baselines/reference/controlFlowIteration.types @@ -10,15 +10,15 @@ function ff() { >x : string | undefined while (true) { ->true : boolean +>true : true if (cond) { >cond : boolean x = ""; ->x = "" : string +>x = "" : "" >x : string | undefined ->"" : string +>"" : "" } else { if (x) { diff --git a/tests/baselines/reference/controlFlowOuterVariable.types b/tests/baselines/reference/controlFlowOuterVariable.types index 602776dd54d89..859542e70e197 100644 --- a/tests/baselines/reference/controlFlowOuterVariable.types +++ b/tests/baselines/reference/controlFlowOuterVariable.types @@ -8,7 +8,7 @@ const CONFIG = { foo: '', >foo : string ->'' : string +>'' : "" setFoo: function(foo: string) { >setFoo : (foo: string) => void @@ -38,5 +38,5 @@ const helper = function(t: T[]) { >t.slice : (start?: number | undefined, end?: number | undefined) => T[] >t : T[] >slice : (start?: number | undefined, end?: number | undefined) => T[] ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/controlFlowPropertyDeclarations.types b/tests/baselines/reference/controlFlowPropertyDeclarations.types index 030f22a1ffb0d..fae5ed27da288 100644 --- a/tests/baselines/reference/controlFlowPropertyDeclarations.types +++ b/tests/baselines/reference/controlFlowPropertyDeclarations.types @@ -8,7 +8,7 @@ var HTMLDOMPropertyConfig = require('react/lib/HTMLDOMPropertyConfig'); >HTMLDOMPropertyConfig : any >require('react/lib/HTMLDOMPropertyConfig') : any >require : any ->'react/lib/HTMLDOMPropertyConfig' : string +>'react/lib/HTMLDOMPropertyConfig' : "react/lib/HTMLDOMPropertyConfig" // Populate property map with ReactJS's attribute and property mappings // TODO handle/use .Properties value eg: MUST_USE_PROPERTY is not HTML attr @@ -70,13 +70,13 @@ function repeatString(string, times) { if (times < 0) { throw new Error(); } >times < 0 : boolean >times : any ->0 : number +>0 : 0 >new Error() : Error >Error : ErrorConstructor var repeated = ''; >repeated : string ->'' : string +>'' : "" while (times) { >times : any @@ -84,7 +84,7 @@ function repeatString(string, times) { if (times & 1) { >times & 1 : number >times : any ->1 : number +>1 : 1 repeated += string; >repeated += string : string @@ -94,7 +94,7 @@ function repeatString(string, times) { if (times >>= 1) { >times >>= 1 : number >times : any ->1 : number +>1 : 1 string += string; >string += string : any @@ -156,7 +156,7 @@ function trimEnd(haystack, needle) { >haystack.slice : any >haystack : any >slice : any ->0 : number +>0 : 0 >-needle.length : number >needle.length : any >needle : any @@ -281,7 +281,7 @@ export class HTMLtoJSX { var text = '' >text : string ->'' : string +>'' : "" if (this._inPreTag) { >this._inPreTag : boolean @@ -303,7 +303,7 @@ export class HTMLtoJSX { .replace(/\r/g, '') >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >/\r/g : RegExp ->'' : string +>'' : "" .replace(/( {2,}|\n|\t|\{|\})/g, function(whitespace) { >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } @@ -314,13 +314,13 @@ export class HTMLtoJSX { return '{' + JSON.stringify(whitespace) + '}'; >'{' + JSON.stringify(whitespace) + '}' : string >'{' + JSON.stringify(whitespace) : string ->'{' : string +>'{' : "{" >JSON.stringify(whitespace) : string >JSON.stringify : { (value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; (value: any, replacer?: (string | number)[], space?: string | number): string; } >JSON : JSON >stringify : { (value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; (value: any, replacer?: (string | number)[], space?: string | number): string; } >whitespace : string ->'}' : string +>'}' : "}" }); } else { @@ -331,9 +331,9 @@ export class HTMLtoJSX { >text.indexOf : (searchString: string, position?: number) => number >text : string >indexOf : (searchString: string, position?: number) => number ->'\n' : string ->-1 : number ->1 : number +>'\n' : "\n" +>-1 : -1 +>1 : 1 } } this.output += text; diff --git a/tests/baselines/reference/controlFlowPropertyInitializer.types b/tests/baselines/reference/controlFlowPropertyInitializer.types index d35a4c136981b..7da8fefe958b6 100644 --- a/tests/baselines/reference/controlFlowPropertyInitializer.types +++ b/tests/baselines/reference/controlFlowPropertyInitializer.types @@ -3,13 +3,13 @@ // Repro from #8967 const LANG = "Turbo Pascal" ->LANG : string ->"Turbo Pascal" : string +>LANG : "Turbo Pascal" +>"Turbo Pascal" : "Turbo Pascal" class BestLanguage { >BestLanguage : BestLanguage name = LANG; >name : string ->LANG : string +>LANG : "Turbo Pascal" } diff --git a/tests/baselines/reference/controlFlowWhileStatement.types b/tests/baselines/reference/controlFlowWhileStatement.types index 09a127ab51ea5..19f7fc49d02fc 100644 --- a/tests/baselines/reference/controlFlowWhileStatement.types +++ b/tests/baselines/reference/controlFlowWhileStatement.types @@ -9,9 +9,9 @@ function a() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -27,9 +27,9 @@ function b() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -38,9 +38,9 @@ function b() { >x : string x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 break; } @@ -52,9 +52,9 @@ function c() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -83,9 +83,9 @@ function d() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" while (x = x.length) { >x = x.length : number @@ -98,9 +98,9 @@ function d() { >x : number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" } } function e() { @@ -110,9 +110,9 @@ function e() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -121,9 +121,9 @@ function e() { >x : string | number x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 x; // number >x : number @@ -140,9 +140,9 @@ function f() { >Function : Function x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | Function | RegExp ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -151,9 +151,9 @@ function f() { >cond : true x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | Function | RegExp ->42 : number +>42 : 42 break; } @@ -184,20 +184,20 @@ function g() { >Function : Function x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | Function | RegExp ->"" : string +>"" : "" while (true) { ->true : boolean +>true : true if (cond) { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | Function | RegExp ->42 : number +>42 : 42 break; } @@ -226,22 +226,22 @@ function h1() { >x : string | number | boolean x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" while (x > 1) { >x > 1 : boolean >x : string | number ->1 : number +>1 : 1 x; // string | number >x : string | number x = 1; ->x = 1 : number +>x = 1 : 1 >x : string | number | boolean ->1 : number +>1 : 1 x; // number >x : number @@ -260,9 +260,9 @@ function h2() { >x : string | number | boolean x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -287,9 +287,9 @@ function h3() { >x : string | number | boolean x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" while (cond) { >cond : boolean diff --git a/tests/baselines/reference/declFileAccessors.types b/tests/baselines/reference/declFileAccessors.types index 00b10f7bf4037..a038c66b271bc 100644 --- a/tests/baselines/reference/declFileAccessors.types +++ b/tests/baselines/reference/declFileAccessors.types @@ -9,7 +9,7 @@ export class c1 { >p3 : number return 10; ->10 : number +>10 : 10 } /** setter property*/ public set p3(/** this is value*/value: number) { @@ -21,7 +21,7 @@ export class c1 { >pp3 : number return 10; ->10 : number +>10 : 10 } /** private setter property*/ private set pp3(/** this is value*/value: number) { @@ -33,7 +33,7 @@ export class c1 { >s3 : number return 10; ->10 : number +>10 : 10 } /** setter property*/ static set s3( /** this is value*/value: number) { @@ -44,7 +44,7 @@ export class c1 { >nc_p3 : number return 10; ->10 : number +>10 : 10 } public set nc_p3(value: number) { >nc_p3 : number @@ -54,7 +54,7 @@ export class c1 { >nc_pp3 : number return 10; ->10 : number +>10 : 10 } private set nc_pp3(value: number) { >nc_pp3 : number @@ -64,7 +64,7 @@ export class c1 { >nc_s3 : string return ""; ->"" : string +>"" : "" } static set nc_s3(value: string) { >nc_s3 : string @@ -76,7 +76,7 @@ export class c1 { >onlyGetter : number return 10; ->10 : number +>10 : 10 } // Only setter property @@ -96,7 +96,7 @@ class c2 { >p3 : number return 10; ->10 : number +>10 : 10 } /** setter property*/ public set p3(/** this is value*/value: number) { @@ -108,7 +108,7 @@ class c2 { >pp3 : number return 10; ->10 : number +>10 : 10 } /** private setter property*/ private set pp3(/** this is value*/value: number) { @@ -120,7 +120,7 @@ class c2 { >s3 : number return 10; ->10 : number +>10 : 10 } /** setter property*/ static set s3( /** this is value*/value: number) { @@ -131,7 +131,7 @@ class c2 { >nc_p3 : number return 10; ->10 : number +>10 : 10 } public set nc_p3(value: number) { >nc_p3 : number @@ -141,7 +141,7 @@ class c2 { >nc_pp3 : number return 10; ->10 : number +>10 : 10 } private set nc_pp3(value: number) { >nc_pp3 : number @@ -151,7 +151,7 @@ class c2 { >nc_s3 : string return ""; ->"" : string +>"" : "" } static set nc_s3(value: string) { >nc_s3 : string @@ -163,7 +163,7 @@ class c2 { >onlyGetter : number return 10; ->10 : number +>10 : 10 } // Only setter property diff --git a/tests/baselines/reference/declFileConstructors.types b/tests/baselines/reference/declFileConstructors.types index 68782eb3617cf..733a624e776be 100644 --- a/tests/baselines/reference/declFileConstructors.types +++ b/tests/baselines/reference/declFileConstructors.types @@ -38,7 +38,7 @@ export class ConstructorWithRestParamters { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } } @@ -85,7 +85,7 @@ export class ConstructorWithParameterInitializer { constructor(public x = "hello") { >x : string ->"hello" : string +>"hello" : "hello" } } @@ -128,7 +128,7 @@ class GlobalConstructorWithRestParamters { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } } @@ -175,6 +175,6 @@ class GlobalConstructorWithParameterInitializer { constructor(public x = "hello") { >x : string ->"hello" : string +>"hello" : "hello" } } diff --git a/tests/baselines/reference/declFileEnumUsedAsValue.types b/tests/baselines/reference/declFileEnumUsedAsValue.types index 19aa3de4331fe..fe32309592292 100644 --- a/tests/baselines/reference/declFileEnumUsedAsValue.types +++ b/tests/baselines/reference/declFileEnumUsedAsValue.types @@ -4,13 +4,13 @@ enum e { >e : e a, ->a : e +>a : e.a b, ->b : e +>b : e.b c ->c : e +>c : e.c } var x = e; >x : typeof e diff --git a/tests/baselines/reference/declFileEnums.types b/tests/baselines/reference/declFileEnums.types index 5fb0d0736be7d..5b0bfff5beda7 100644 --- a/tests/baselines/reference/declFileEnums.types +++ b/tests/baselines/reference/declFileEnums.types @@ -4,13 +4,13 @@ enum e1 { >e1 : e1 a, ->a : e1 +>a : e1.a b, ->b : e1 +>b : e1.b c ->c : e1 +>c : e1.c } enum e2 { @@ -18,17 +18,17 @@ enum e2 { a = 10, >a : e2 ->10 : number +>10 : 10 b = a + 2, >b : e2 >a + 2 : number >a : e2 ->2 : number +>2 : 2 c = 10, >c : e2 ->10 : number +>10 : 10 } enum e3 { @@ -36,7 +36,7 @@ enum e3 { a = 10, >a : e3 ->10 : number +>10 : 10 b = Math.PI, >b : e3 @@ -48,27 +48,27 @@ enum e3 { >c : e3 >a + 3 : number >a : e3 ->3 : number +>3 : 3 } enum e4 { >e4 : e4 a, ->a : e4 +>a : e4.a b, ->b : e4 +>b : e4.b c, ->c : e4 +>c : e4.c d = 10, ->d : e4 ->10 : number +>d : e4.d +>10 : 10 e ->e : e4 +>e : e4.e } enum e5 { diff --git a/tests/baselines/reference/declFileForVarList.types b/tests/baselines/reference/declFileForVarList.types index 5e55104666b4c..d4c401d238343 100644 --- a/tests/baselines/reference/declFileForVarList.types +++ b/tests/baselines/reference/declFileForVarList.types @@ -4,13 +4,13 @@ var x, y, z = 1; >x : any >y : any >z : number ->1 : number +>1 : 1 var x1 = 1, y2 = 2, z2 = 3; >x1 : number ->1 : number +>1 : 1 >y2 : number ->2 : number +>2 : 2 >z2 : number ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/declFileFunctions.types b/tests/baselines/reference/declFileFunctions.types index 87840f39430a0..ee35577ce3ebc 100644 --- a/tests/baselines/reference/declFileFunctions.types +++ b/tests/baselines/reference/declFileFunctions.types @@ -29,7 +29,7 @@ export function fooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } export function fooWithOverloads(a: string): string; @@ -127,7 +127,7 @@ function nonExportedFooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } function nonExportedFooWithOverloads(a: string): string; @@ -176,7 +176,7 @@ function globalfooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } function globalfooWithOverloads(a: string): string; >globalfooWithOverloads : { (a: string): string; (a: number): number; } diff --git a/tests/baselines/reference/declFileMethods.types b/tests/baselines/reference/declFileMethods.types index ecd7b8e0cff90..44c08117e9391 100644 --- a/tests/baselines/reference/declFileMethods.types +++ b/tests/baselines/reference/declFileMethods.types @@ -32,7 +32,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } public fooWithOverloads(a: string): string; @@ -81,7 +81,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } private privateFooWithOverloads(a: string): string; >privateFooWithOverloads : { (a: string): string; (a: number): number; } @@ -129,7 +129,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } static staticFooWithOverloads(a: string): string; >staticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -177,7 +177,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } private static privateStaticFooWithOverloads(a: string): string; >privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -259,7 +259,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } public fooWithOverloads(a: string): string; @@ -308,7 +308,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } private privateFooWithOverloads(a: string): string; >privateFooWithOverloads : { (a: string): string; (a: number): number; } @@ -356,7 +356,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } static staticFooWithOverloads(a: string): string; >staticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -404,7 +404,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } private static privateStaticFooWithOverloads(a: string): string; >privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } diff --git a/tests/baselines/reference/declFileObjectLiteralWithAccessors.types b/tests/baselines/reference/declFileObjectLiteralWithAccessors.types index f7bb57b0e1e7d..389b88de565c7 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithAccessors.types +++ b/tests/baselines/reference/declFileObjectLiteralWithAccessors.types @@ -9,7 +9,7 @@ function /*1*/makePoint(x: number) { b: 10, >b : number ->10 : number +>10 : 10 get x() { return x; }, >x : number @@ -30,7 +30,7 @@ var /*4*/point = makePoint(2); >point : { b: number; x: number; } >makePoint(2) : { b: number; x: number; } >makePoint : (x: number) => { b: number; x: number; } ->2 : number +>2 : 2 var /*2*/x = point.x; >x : number @@ -39,9 +39,9 @@ var /*2*/x = point.x; >x : number point./*3*/x = 30; ->point./*3*/x = 30 : number +>point./*3*/x = 30 : 30 >point./*3*/x : number >point : { b: number; x: number; } >x : number ->30 : number +>30 : 30 diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types index dd3cbe20983ad..c4e563f5a0367 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types @@ -17,7 +17,7 @@ var /*4*/point = makePoint(2); >point : { readonly x: number; } >makePoint(2) : { readonly x: number; } >makePoint : (x: number) => { readonly x: number; } ->2 : number +>2 : 2 var /*2*/x = point./*3*/x; >x : number diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types index 2b9b98a896398..2f15818e0f2e5 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types @@ -9,7 +9,7 @@ function /*1*/makePoint(x: number) { b: 10, >b : number ->10 : number +>10 : 10 set x(a: number) { this.b = a; } >x : number @@ -26,12 +26,12 @@ var /*3*/point = makePoint(2); >point : { b: number; x: number; } >makePoint(2) : { b: number; x: number; } >makePoint : (x: number) => { b: number; x: number; } ->2 : number +>2 : 2 point./*2*/x = 30; ->point./*2*/x = 30 : number +>point./*2*/x = 30 : 30 >point./*2*/x : number >point : { b: number; x: number; } >x : number ->30 : number +>30 : 30 diff --git a/tests/baselines/reference/declFilePrivateStatic.types b/tests/baselines/reference/declFilePrivateStatic.types index 35aaa3acdeb44..29f8f1a9aab8a 100644 --- a/tests/baselines/reference/declFilePrivateStatic.types +++ b/tests/baselines/reference/declFilePrivateStatic.types @@ -5,11 +5,11 @@ class C { private static x = 1; >x : number ->1 : number +>1 : 1 static y = 1; >y : number ->1 : number +>1 : 1 private static a() { } >a : () => void @@ -19,11 +19,11 @@ class C { private static get c() { return 1; } >c : number ->1 : number +>1 : 1 static get d() { return 1; } >d : number ->1 : number +>1 : 1 private static set e(v) { } >e : any diff --git a/tests/baselines/reference/declFileRegressionTests.types b/tests/baselines/reference/declFileRegressionTests.types index 7b8933e1def24..721f5b1e70a32 100644 --- a/tests/baselines/reference/declFileRegressionTests.types +++ b/tests/baselines/reference/declFileRegressionTests.types @@ -7,10 +7,10 @@ var n = { w: null, x: '', y: () => { }, z: 32 }; >w : null >null : null >x : string ->'' : string +>'' : "" >y : () => void >() => { } : () => void >z : number ->32 : number +>32 : 32 diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types index 0bfa5b6312c2e..8e0cdd8d40966 100644 --- a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types @@ -29,7 +29,7 @@ var f6 = () => { return [10]; } >() => { return [10]; } : () => any[] >[10] : any[] >10 : any ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types index 2e187f0ec837e..87776b3b41793 100644 --- a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types @@ -5,13 +5,13 @@ function foo(): string { >foo : () => string return ""; ->"" : string +>"" : "" } function foo2() { >foo2 : () => string return ""; ->"" : string +>"" : "" } // number @@ -19,13 +19,13 @@ function foo3(): number { >foo3 : () => number return 10; ->10 : number +>10 : 10 } function foo4() { >foo4 : () => number return 10; ->10 : number +>10 : 10 } // boolean @@ -39,7 +39,7 @@ function foo6() { >foo6 : () => boolean return false; ->false : boolean +>false : false } // void diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.types b/tests/baselines/reference/declFileTypeAnnotationParenType.types index 31b6ad037513d..f3c8db5533a94 100644 --- a/tests/baselines/reference/declFileTypeAnnotationParenType.types +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.types @@ -25,19 +25,19 @@ var y = [() => new c()]; var k: (() => c) | string = (() => new c()) || ""; >k : string | (() => c) >c : c ->(() => new c()) || "" : string | (() => c) +>(() => new c()) || "" : "" | (() => c) >(() => new c()) : () => c >() => new c() : () => c >new c() : c >c : typeof c ->"" : string +>"" : "" var l = (() => new c()) || ""; >l : string | (() => c) ->(() => new c()) || "" : string | (() => c) +>(() => new c()) || "" : "" | (() => c) >(() => new c()) : () => c >() => new c() : () => c >new c() : c >c : typeof c ->"" : string +>"" : "" diff --git a/tests/baselines/reference/declFileTypeofEnum.types b/tests/baselines/reference/declFileTypeofEnum.types index 1c900a453b765..1d69d0594c8ba 100644 --- a/tests/baselines/reference/declFileTypeofEnum.types +++ b/tests/baselines/reference/declFileTypeofEnum.types @@ -4,32 +4,32 @@ enum days { >days : days monday, ->monday : days +>monday : days.monday tuesday, ->tuesday : days +>tuesday : days.tuesday wednesday, ->wednesday : days +>wednesday : days.wednesday thursday, ->thursday : days +>thursday : days.thursday friday, ->friday : days +>friday : days.friday saturday, ->saturday : days +>saturday : days.saturday sunday ->sunday : days +>sunday : days.sunday } var weekendDay = days.saturday; >weekendDay : days ->days.saturday : days +>days.saturday : days.saturday >days : typeof days ->saturday : days +>saturday : days.saturday var daysOfMonth = days; >daysOfMonth : typeof days diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.types b/tests/baselines/reference/declFileTypeofInAnonymousType.types index fa9d0bcbd17ba..2ab5e673fb244 100644 --- a/tests/baselines/reference/declFileTypeofInAnonymousType.types +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.types @@ -10,13 +10,13 @@ module m1 { >e : e weekday, ->weekday : e +>weekday : e.weekday weekend, ->weekend : e +>weekend : e.weekend holiday ->holiday : e +>holiday : e.holiday } } var a: { c: m1.c; }; @@ -74,10 +74,10 @@ var d = { mh: m1.e.holiday >mh : m1.e ->m1.e.holiday : m1.e +>m1.e.holiday : m1.e.holiday >m1.e : typeof m1.e >m1 : typeof m1 >e : typeof m1.e ->holiday : m1.e +>holiday : m1.e.holiday }; diff --git a/tests/baselines/reference/declInput.types b/tests/baselines/reference/declInput.types index e59e3811fdf81..edca1b9a9433f 100644 --- a/tests/baselines/reference/declInput.types +++ b/tests/baselines/reference/declInput.types @@ -9,7 +9,7 @@ class bar { public f() { return ''; } >f : () => string ->'' : string +>'' : "" public g() { return {a: null, b: undefined, c: void 4 }; } >g : () => { a: bar; b: any; c: any; } @@ -22,16 +22,16 @@ class bar { >undefined : undefined >c : undefined >void 4 : undefined ->4 : number +>4 : 4 public h(x = 4, y = null, z = '') { x++; } >h : (x?: number, y?: any, z?: string) => void >x : number ->4 : number +>4 : 4 >y : any >null : null >z : string ->'' : string +>'' : "" >x++ : number >x : number } diff --git a/tests/baselines/reference/declInput3.types b/tests/baselines/reference/declInput3.types index 0dcbc6bd3cdad..aaa947cdca9de 100644 --- a/tests/baselines/reference/declInput3.types +++ b/tests/baselines/reference/declInput3.types @@ -9,7 +9,7 @@ class bar { public f() { return ''; } >f : () => string ->'' : string +>'' : "" public g() { return {a: null, b: undefined, c: void 4 }; } >g : () => { a: bar; b: any; c: any; } @@ -22,16 +22,16 @@ class bar { >undefined : undefined >c : undefined >void 4 : undefined ->4 : number +>4 : 4 public h(x = 4, y = null, z = '') { x++; } >h : (x?: number, y?: any, z?: string) => void >x : number ->4 : number +>4 : 4 >y : any >null : null >z : string ->'' : string +>'' : "" >x++ : number >x : number } diff --git a/tests/baselines/reference/declarationEmitDefaultExport3.types b/tests/baselines/reference/declarationEmitDefaultExport3.types index 91ee71f61ac39..2717e248784b0 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport3.types +++ b/tests/baselines/reference/declarationEmitDefaultExport3.types @@ -3,5 +3,5 @@ export default function foo() { >foo : () => string return "" ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/declarationEmitDefaultExport4.types b/tests/baselines/reference/declarationEmitDefaultExport4.types index ab97484176dbb..db47735b1edb1 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport4.types +++ b/tests/baselines/reference/declarationEmitDefaultExport4.types @@ -1,5 +1,5 @@ === tests/cases/compiler/declarationEmitDefaultExport4.ts === export default function () { return 1; ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/declarationEmitDefaultExport5.types b/tests/baselines/reference/declarationEmitDefaultExport5.types index d2b177cc084c5..71f0cbde69747 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport5.types +++ b/tests/baselines/reference/declarationEmitDefaultExport5.types @@ -1,6 +1,6 @@ === tests/cases/compiler/declarationEmitDefaultExport5.ts === export default 1 + 2; >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/declarationEmitDefaultExport8.types b/tests/baselines/reference/declarationEmitDefaultExport8.types index bd99ee14530e3..ed66a0fcb6f93 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport8.types +++ b/tests/baselines/reference/declarationEmitDefaultExport8.types @@ -2,7 +2,7 @@ var _default = 1; >_default : number ->1 : number +>1 : 1 export {_default as d} >_default : number @@ -10,6 +10,6 @@ export {_default as d} export default 1 + 2; >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/declarationEmitDefaultExportWithTempVarName.js b/tests/baselines/reference/declarationEmitDefaultExportWithTempVarName.js index 643f9a8c88969..44e0560132ffa 100644 --- a/tests/baselines/reference/declarationEmitDefaultExportWithTempVarName.js +++ b/tests/baselines/reference/declarationEmitDefaultExportWithTempVarName.js @@ -15,5 +15,5 @@ System.register([], function (exports_1, context_1) { //// [pi.d.ts] -declare var _default: number; +declare var _default: 3.14159; export default _default; diff --git a/tests/baselines/reference/declarationEmitDefaultExportWithTempVarNameWithBundling.js b/tests/baselines/reference/declarationEmitDefaultExportWithTempVarNameWithBundling.js index 35bdf2f9eccb9..6b16d06cb8449 100644 --- a/tests/baselines/reference/declarationEmitDefaultExportWithTempVarNameWithBundling.js +++ b/tests/baselines/reference/declarationEmitDefaultExportWithTempVarNameWithBundling.js @@ -17,6 +17,6 @@ System.register("pi", [], function (exports_1, context_1) { //// [app.d.ts] declare module "pi" { - var _default: number; + var _default: 3.14159; export default _default; } diff --git a/tests/baselines/reference/declarationEmitDestructuring3.types b/tests/baselines/reference/declarationEmitDestructuring3.types index da9fc6d66061b..8e15071c9792f 100644 --- a/tests/baselines/reference/declarationEmitDestructuring3.types +++ b/tests/baselines/reference/declarationEmitDestructuring3.types @@ -10,8 +10,8 @@ function foo([x, ...y] = [1, "string", true]) { } >x : string | number | boolean >y : (string | number | boolean)[] >[1, "string", true] : (string | number | boolean)[] ->1 : number ->"string" : string ->true : boolean +>1 : 1 +>"string" : "string" +>true : true diff --git a/tests/baselines/reference/declarationEmitDestructuring5.types b/tests/baselines/reference/declarationEmitDestructuring5.types index 961dea62bcbcc..c0223a0f061dd 100644 --- a/tests/baselines/reference/declarationEmitDestructuring5.types +++ b/tests/baselines/reference/declarationEmitDestructuring5.types @@ -22,11 +22,11 @@ function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } > : undefined > : undefined >[1, 3, 4, 6, 7] : [number, number, number, number, number] ->1 : number ->3 : number ->4 : number ->6 : number ->7 : number +>1 : 1 +>3 : 3 +>4 : 4 +>6 : 6 +>7 : 7 function bar2([,,z, , , ]) { } >bar2 : ([, , z, , ,]: [any, any, any, any, any]) => void diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types index 0feeaf2db1ad0..640062c07856d 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types @@ -2,36 +2,36 @@ var [] = [1, "hello"]; // Dont emit anything >[1, "hello"] : (string | number)[] ->1 : number ->"hello" : string +>1 : 1 +>"hello" : "hello" var [x] = [1, "hello"]; // emit x: number >x : number >[1, "hello"] : [number, string] ->1 : number ->"hello" : string +>1 : 1 +>"hello" : "hello" var [x1, y1] = [1, "hello"]; // emit x1: number, y1: string >x1 : number >y1 : string >[1, "hello"] : [number, string] ->1 : number ->"hello" : string +>1 : 1 +>"hello" : "hello" var [, , z1] = [0, 1, 2]; // emit z1: number > : undefined > : undefined >z1 : number >[0, 1, 2] : [number, number, number] ->0 : number ->1 : number ->2 : number +>0 : 0 +>1 : 1 +>2 : 2 var a = [1, "hello"]; >a : (string | number)[] >[1, "hello"] : (string | number)[] ->1 : number ->"hello" : string +>1 : 1 +>"hello" : "hello" var [x2] = a; // emit x2: number | string >x2 : string | number diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types index 406494aa13bea..3bd324a1c2624 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types @@ -6,6 +6,6 @@ module M { >a : number >b : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 } diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types index 2cc56abcb05b5..0141b3f79e709 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types @@ -2,26 +2,26 @@ var [...a5] = [1, 2, 3]; >a5 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [x14, ...a6] = [1, 2, 3]; >x14 : number >a6 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [x15, y15, ...a7] = [1, 2, 3]; >x15 : number >y15 : number >a7 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [x16, y16, z16, ...a8] = [1, 2, 3]; >x16 : number @@ -29,33 +29,33 @@ var [x16, y16, z16, ...a8] = [1, 2, 3]; >z16 : number >a8 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [...a9] = [1, "hello", true]; >a9 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] ->1 : number ->"hello" : string ->true : boolean +>1 : 1 +>"hello" : "hello" +>true : true var [x17, ...a10] = [1, "hello", true]; >x17 : string | number | boolean >a10 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] ->1 : number ->"hello" : string ->true : boolean +>1 : 1 +>"hello" : "hello" +>true : true var [x18, y18, ...a12] = [1, "hello", true]; >x18 : string | number | boolean >y18 : string | number | boolean >a12 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] ->1 : number ->"hello" : string ->true : boolean +>1 : 1 +>"hello" : "hello" +>true : true var [x19, y19, z19, ...a13] = [1, "hello", true]; >x19 : string | number | boolean @@ -63,7 +63,7 @@ var [x19, y19, z19, ...a13] = [1, "hello", true]; >z19 : string | number | boolean >a13 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] ->1 : number ->"hello" : string ->true : boolean +>1 : 1 +>"hello" : "hello" +>true : true diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types index fa5720f4da73c..41f4660bf29d1 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types @@ -4,18 +4,18 @@ var [, , z] = [1, 2, 4]; > : undefined >z : number >[1, 2, 4] : [number, number, number] ->1 : number ->2 : number ->4 : number +>1 : 1 +>2 : 2 +>4 : 4 var [, a, , ] = [3, 4, 5]; > : undefined >a : number > : undefined >[3, 4, 5] : [number, number, number] ->3 : number ->4 : number ->5 : number +>3 : 3 +>4 : 4 +>5 : 5 var [, , [, b, ]] = [3,5,[0, 1]]; > : undefined @@ -23,9 +23,9 @@ var [, , [, b, ]] = [3,5,[0, 1]]; > : undefined >b : number >[3,5,[0, 1]] : [number, number, [number, number]] ->3 : number ->5 : number +>3 : 3 +>5 : 5 >[0, 1] : [number, number] ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types index 49d4e2e837cbd..f8f9a6a319cb9 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types @@ -11,36 +11,36 @@ var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: tr >z11 : boolean >{ a: 1, b: { a: "hello", b: { a: true } } } : { a: number; b: { a: string; b: { a: boolean; }; }; } >a : number ->1 : number +>1 : 1 >b : { a: string; b: { a: boolean; }; } >{ a: "hello", b: { a: true } } : { a: string; b: { a: boolean; }; } >a : string ->"hello" : string +>"hello" : "hello" >b : { a: boolean; } >{ a: true } : { a: boolean; } >a : boolean ->true : boolean +>true : true function f15() { >f15 : () => { a4: string; b4: number; c4: boolean; } var a4 = "hello"; >a4 : string ->"hello" : string +>"hello" : "hello" var b4 = 1; >b4 : number ->1 : number +>1 : 1 var c4 = true; >c4 : boolean ->true : boolean +>true : true return { a4, b4, c4 }; >{ a4, b4, c4 } : { a4: string; b4: number; c4: boolean; } >a4 : string >b4 : number ->c4 : boolean +>c4 : true } var { a4, b4, c4 } = f15(); >a4 : string diff --git a/tests/baselines/reference/declarationEmit_bindingPatterns.types b/tests/baselines/reference/declarationEmit_bindingPatterns.types index eff2d4bd4a3d6..b3da24a2b9544 100644 --- a/tests/baselines/reference/declarationEmit_bindingPatterns.types +++ b/tests/baselines/reference/declarationEmit_bindingPatterns.types @@ -5,7 +5,7 @@ const k = ({x: z = 'y'}) => { } >({x: z = 'y'}) => { } : ({x: z}: { x?: string; }) => void >x : any >z : string ->'y' : string +>'y' : "y" var a; >a : any diff --git a/tests/baselines/reference/declarationEmit_classMemberNameConflict.types b/tests/baselines/reference/declarationEmit_classMemberNameConflict.types index c76072413e5e1..66bc493b2ee29 100644 --- a/tests/baselines/reference/declarationEmit_classMemberNameConflict.types +++ b/tests/baselines/reference/declarationEmit_classMemberNameConflict.types @@ -41,7 +41,7 @@ export class C3 { get C3() { return 0; } // has to be the same as the class name >C3 : number ->0 : number +>0 : 0 bar() { >bar : () => (t: typeof C3) => void diff --git a/tests/baselines/reference/declarationEmit_classMemberNameConflict2.js b/tests/baselines/reference/declarationEmit_classMemberNameConflict2.js index 03dc5cdbafd40..d3ebddc8d17c0 100644 --- a/tests/baselines/reference/declarationEmit_classMemberNameConflict2.js +++ b/tests/baselines/reference/declarationEmit_classMemberNameConflict2.js @@ -45,7 +45,7 @@ var Foo = (function () { //// [declarationEmit_classMemberNameConflict2.d.ts] -declare const Bar: string; +declare const Bar: "bar"; declare enum Hello { World = 0, } diff --git a/tests/baselines/reference/declarationEmit_classMemberNameConflict2.types b/tests/baselines/reference/declarationEmit_classMemberNameConflict2.types index 9f8ddd8a2d5e8..dd184f7ba343a 100644 --- a/tests/baselines/reference/declarationEmit_classMemberNameConflict2.types +++ b/tests/baselines/reference/declarationEmit_classMemberNameConflict2.types @@ -1,8 +1,8 @@ === tests/cases/compiler/declarationEmit_classMemberNameConflict2.ts === const Bar = 'bar'; ->Bar : string ->'bar' : string +>Bar : "bar" +>'bar' : "bar" enum Hello { >Hello : Hello @@ -24,7 +24,7 @@ class Foo { // Same names + string => OK Bar = Bar; >Bar : string ->Bar : string +>Bar : "bar" // Same names + enum => OK Hello = Hello; diff --git a/tests/baselines/reference/declarationEmit_expressionInExtends2.types b/tests/baselines/reference/declarationEmit_expressionInExtends2.types index 77a1539267dd6..3f2b8964a2dec 100644 --- a/tests/baselines/reference/declarationEmit_expressionInExtends2.types +++ b/tests/baselines/reference/declarationEmit_expressionInExtends2.types @@ -28,5 +28,5 @@ class MyClass extends getClass(2) { >MyClass : MyClass >getClass(2) : C >getClass : (c: T) => typeof C ->2 : number +>2 : 2 } diff --git a/tests/baselines/reference/declarationEmit_invalidReference.types b/tests/baselines/reference/declarationEmit_invalidReference.types index 35d623c3c05b8..942f2088fc02b 100644 --- a/tests/baselines/reference/declarationEmit_invalidReference.types +++ b/tests/baselines/reference/declarationEmit_invalidReference.types @@ -2,5 +2,5 @@ /// var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.types b/tests/baselines/reference/declarationEmit_protectedMembers.types index d541e1d14d298..dd2f0012bf9e0 100644 --- a/tests/baselines/reference/declarationEmit_protectedMembers.types +++ b/tests/baselines/reference/declarationEmit_protectedMembers.types @@ -22,7 +22,7 @@ class C1 { protected get accessor() { return 0; } >accessor : number ->0 : number +>0 : 0 protected static sx: number; >sx : number @@ -42,7 +42,7 @@ class C1 { protected static get staticGetter() { return 0; } >staticGetter : number ->0 : number +>0 : 0 } // Derived class overriding protected members @@ -110,7 +110,7 @@ class C3 extends C2 { static get staticGetter() { return 1; } >staticGetter : number ->1 : number +>1 : 1 } // Protected properties in constructors diff --git a/tests/baselines/reference/declarationsAndAssignments.errors.txt b/tests/baselines/reference/declarationsAndAssignments.errors.txt index 4aa81dce7ae20..64bd8d7e57825 100644 --- a/tests/baselines/reference/declarationsAndAssignments.errors.txt +++ b/tests/baselines/reference/declarationsAndAssignments.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(23,25): tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(24,19): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(28,28): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: any; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(29,22): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | number', but here has type 'string'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | 1', but here has type 'string'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,10): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,13): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. @@ -99,7 +99,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): var x: number; var y: string; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | number', but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | 1', but here has type 'string'. } function f8() { diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types index c33ed5219a86c..db7096752c572 100644 --- a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types +++ b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types @@ -28,7 +28,7 @@ module m2 { var x = 10, m2: { >x : number ->10 : number +>10 : 10 >m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; diff --git a/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types b/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types index 17b37c7937805..d768f3c6c7ab7 100644 --- a/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types +++ b/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types @@ -3,7 +3,7 @@ // from #3108 export var test = 'abc'; >test : string ->'abc' : string +>'abc' : "abc" === tests/cases/conformance/decorators/class/b.ts === import { test } from './a'; diff --git a/tests/baselines/reference/decoratorMetadataOnInferredType.types b/tests/baselines/reference/decoratorMetadataOnInferredType.types index 41c9334244f67..41ac7f060d2f2 100644 --- a/tests/baselines/reference/decoratorMetadataOnInferredType.types +++ b/tests/baselines/reference/decoratorMetadataOnInferredType.types @@ -17,7 +17,7 @@ class A { >console.log : (msg: string) => void >console : { log(msg: string): void; } >log : (msg: string) => void ->'new A' : string +>'new A' : "new A" } function decorator(target: Object, propertyKey: string) { diff --git a/tests/baselines/reference/decoratorMetadataPromise.types b/tests/baselines/reference/decoratorMetadataPromise.types index dc07cdc1fe634..eff5fe92c1273 100644 --- a/tests/baselines/reference/decoratorMetadataPromise.types +++ b/tests/baselines/reference/decoratorMetadataPromise.types @@ -19,7 +19,7 @@ class A { async bar(): Promise { return 0; } >bar : () => Promise >Promise : Promise ->0 : number +>0 : 0 @decorator >decorator : MethodDecorator diff --git a/tests/baselines/reference/decoratorMetadataWithConstructorType.types b/tests/baselines/reference/decoratorMetadataWithConstructorType.types index ad83706f4f997..4ca404c81166a 100644 --- a/tests/baselines/reference/decoratorMetadataWithConstructorType.types +++ b/tests/baselines/reference/decoratorMetadataWithConstructorType.types @@ -17,7 +17,7 @@ class A { >console.log : (msg: string) => void >console : { log(msg: string): void; } >log : (msg: string) => void ->'new A' : string +>'new A' : "new A" } function decorator(target: Object, propertyKey: string) { diff --git a/tests/baselines/reference/decoratorOnClass5.es6.types b/tests/baselines/reference/decoratorOnClass5.es6.types index 5532c50fe5255..891126c9ba6d7 100644 --- a/tests/baselines/reference/decoratorOnClass5.es6.types +++ b/tests/baselines/reference/decoratorOnClass5.es6.types @@ -20,7 +20,7 @@ class C { static y = 1; >y : number ->1 : number +>1 : 1 } let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass6.es6.types b/tests/baselines/reference/decoratorOnClass6.es6.types index 0b335558400b4..89c4ebfc1014e 100644 --- a/tests/baselines/reference/decoratorOnClass6.es6.types +++ b/tests/baselines/reference/decoratorOnClass6.es6.types @@ -20,7 +20,7 @@ export class C { static y = 1; >y : number ->1 : number +>1 : 1 } let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass7.es6.types b/tests/baselines/reference/decoratorOnClass7.es6.types index af7ae0516e398..d2d54175bf9d9 100644 --- a/tests/baselines/reference/decoratorOnClass7.es6.types +++ b/tests/baselines/reference/decoratorOnClass7.es6.types @@ -20,7 +20,7 @@ export default class C { static y = 1; >y : number ->1 : number +>1 : 1 } let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass8.es6.types b/tests/baselines/reference/decoratorOnClass8.es6.types index 045b036e33545..4116a8b20d610 100644 --- a/tests/baselines/reference/decoratorOnClass8.es6.types +++ b/tests/baselines/reference/decoratorOnClass8.es6.types @@ -12,5 +12,5 @@ declare function dec(target: T): T; export default class { static y = 1; >y : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.types b/tests/baselines/reference/decoratorOnClassAccessor1.types index e5ba5149d7aaa..8d46fad586fc0 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.types +++ b/tests/baselines/reference/decoratorOnClassAccessor1.types @@ -16,5 +16,5 @@ class C { @dec get accessor() { return 1; } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.types b/tests/baselines/reference/decoratorOnClassAccessor2.types index 32902ce7ca08f..b71e5943e0f1c 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor2.types +++ b/tests/baselines/reference/decoratorOnClassAccessor2.types @@ -16,5 +16,5 @@ class C { @dec public get accessor() { return 1; } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/decoratorOnClassMethod13.types b/tests/baselines/reference/decoratorOnClassMethod13.types index 5fdbe07182829..eba738d5ef529 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.types +++ b/tests/baselines/reference/decoratorOnClassMethod13.types @@ -15,9 +15,9 @@ class C { @dec ["1"]() { } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor ->"1" : string +>"1" : "1" @dec ["b"]() { } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor ->"b" : string +>"b" : "b" } diff --git a/tests/baselines/reference/decoratorOnClassMethod4.types b/tests/baselines/reference/decoratorOnClassMethod4.types index 026508257a5f5..5c47dc8a4ca4f 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.types +++ b/tests/baselines/reference/decoratorOnClassMethod4.types @@ -15,5 +15,5 @@ class C { @dec ["method"]() {} >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor ->"method" : string +>"method" : "method" } diff --git a/tests/baselines/reference/decoratorOnClassMethod5.types b/tests/baselines/reference/decoratorOnClassMethod5.types index d55ddd832b9fa..749eb6b3b9c20 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.types +++ b/tests/baselines/reference/decoratorOnClassMethod5.types @@ -16,5 +16,5 @@ class C { @dec() ["method"]() {} >dec() : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor ->"method" : string +>"method" : "method" } diff --git a/tests/baselines/reference/decoratorOnClassMethod7.types b/tests/baselines/reference/decoratorOnClassMethod7.types index 8a72e24bd5b49..c8d21157fe942 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.types +++ b/tests/baselines/reference/decoratorOnClassMethod7.types @@ -15,5 +15,5 @@ class C { @dec public ["method"]() {} >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor ->"method" : string +>"method" : "method" } diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types index 65eea6d1a7137..c8b8852e4d27d 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types @@ -10,14 +10,14 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] ->"" : string ->"" : string +>"" : "" +>"" : "" var obj = {x:1,y:null}; >obj : { x: number; y: any; } >{x:1,y:null} : { x: number; y: null; } >x : number ->1 : number +>1 : 1 >y : null >null : null @@ -65,7 +65,7 @@ var ResultIsNumber5 = --ANY2[0]; >--ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 var ResultIsNumber6 = --obj.x; >ResultIsNumber6 : number @@ -100,7 +100,7 @@ var ResultIsNumber9 = ANY2[0]--; >ANY2[0]-- : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 var ResultIsNumber10 = obj.x--; >ResultIsNumber10 : number @@ -143,7 +143,7 @@ var ResultIsNumber13 = M.n--; >--ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 --ANY, --ANY1; >--ANY, --ANY1 : number @@ -176,7 +176,7 @@ ANY2[0]--; >ANY2[0]-- : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 ANY--, ANY1--; >ANY--, ANY1-- : number diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.types b/tests/baselines/reference/decrementOperatorWithNumberType.types index f990ad18fc760..c81dc0660ecb2 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberType.types +++ b/tests/baselines/reference/decrementOperatorWithNumberType.types @@ -6,8 +6,8 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 class A { >A : A @@ -72,7 +72,7 @@ var ResultIsNumber7 = NUMBER1[0]--; >NUMBER1[0]-- : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 // miss assignment operators --NUMBER; @@ -83,7 +83,7 @@ var ResultIsNumber7 = NUMBER1[0]--; >--NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 --objA.a; >--objA.a : number @@ -115,7 +115,7 @@ NUMBER1[0]--; >NUMBER1[0]-- : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 objA.a--; >objA.a-- : number diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt index 60a9e92bc950e..b0b0f876be4af 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(4,19): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(4,19): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(5,1): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(8,20): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(8,20): error TS2322: Type '3' is not assignable to type 'string'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(11,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(14,51): error TS2352: Type 'string' cannot be converted to type 'number'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(20,62): error TS2352: Type 'string' cannot be converted to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: Cannot find name 'T'. @@ -14,7 +14,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C n = f(); var s: string = f(''); ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. s = f(); ~ !!! error TS2322: Type 'number' is not assignable to type 'string'. @@ -22,7 +22,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C // Type check the default argument with the type annotation var f2 = function (a: string = 3) { return a; }; // Should error, but be of type (a: string) => string; ~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '3' is not assignable to type 'string'. s = f2(''); s = f2(); n = f2(); @@ -37,7 +37,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C // Type check using the function's contextual type var f4: (a: number) => void = function (a = "") { }; ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. // Contextually type the default arg using the function's contextual type var f5: (a: (s: string) => any) => void = function (a = s => s) { }; diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt index 5000ae05cc372..3b81fe0864ec7 100644 --- a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(2,6): error TS2339: Property 'length' does not exist on type '{}'. tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(5,6): error TS2339: Property 'length' does not exist on type 'Object'. tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. ==== tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts (3 errors) ==== @@ -19,7 +19,7 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2453: The var result = concat(1, ""); // error ~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. var elementCount = result.length; function concat2(x: T, y: U) { return null; } diff --git a/tests/baselines/reference/defaultIndexProps1.types b/tests/baselines/reference/defaultIndexProps1.types index 0b188a40c205c..d79685da38758 100644 --- a/tests/baselines/reference/defaultIndexProps1.types +++ b/tests/baselines/reference/defaultIndexProps1.types @@ -4,7 +4,7 @@ class Foo { public v = "Yo"; >v : string ->"Yo" : string +>"Yo" : "Yo" } var f = new Foo(); @@ -16,17 +16,17 @@ var q = f["v"]; >q : string >f["v"] : string >f : Foo ->"v" : string +>"v" : "v" var o = {v:"Yo2"}; >o : { v: string; } >{v:"Yo2"} : { v: string; } >v : string ->"Yo2" : string +>"Yo2" : "Yo2" var q2 = o["v"]; >q2 : string >o["v"] : string >o : { v: string; } ->"v" : string +>"v" : "v" diff --git a/tests/baselines/reference/defaultIndexProps2.types b/tests/baselines/reference/defaultIndexProps2.types index 3b0d8278966e1..a50e4af450e56 100644 --- a/tests/baselines/reference/defaultIndexProps2.types +++ b/tests/baselines/reference/defaultIndexProps2.types @@ -4,7 +4,7 @@ class Foo { public v = "Yo"; >v : string ->"Yo" : string +>"Yo" : "Yo" } var f = new Foo(); @@ -18,18 +18,18 @@ var o = {v:"Yo2"}; >o : { v: string; } >{v:"Yo2"} : { v: string; } >v : string ->"Yo2" : string +>"Yo2" : "Yo2" // WScript.Echo(o[0]); 1[0]; >1[0] : any ->1 : number ->0 : number +>1 : 1 +>0 : 0 var q = "s"[0]; >q : string >"s"[0] : string ->"s" : string ->0 : number +>"s" : "s" +>0 : 0 diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.types b/tests/baselines/reference/deleteOperatorWithBooleanType.types index 81c12ad618228..664a2530f33e3 100644 --- a/tests/baselines/reference/deleteOperatorWithBooleanType.types +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.types @@ -15,7 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -39,16 +39,16 @@ var ResultIsBoolean1 = delete BOOLEAN; var ResultIsBoolean2 = delete true; >ResultIsBoolean2 : boolean >delete true : boolean ->true : boolean +>true : true var ResultIsBoolean3 = delete { x: true, y: false }; >ResultIsBoolean3 : boolean >delete { x: true, y: false } : boolean >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsBoolean4 = delete objA.a; @@ -89,7 +89,7 @@ var ResultIsBoolean8 = delete delete BOOLEAN; // miss assignment operators delete true; >delete true : boolean ->true : boolean +>true : true delete BOOLEAN; >delete BOOLEAN : boolean @@ -101,10 +101,10 @@ delete foo(); >foo : () => boolean delete true, false; ->delete true, false : boolean +>delete true, false : false >delete true : boolean ->true : boolean ->false : boolean +>true : true +>false : false delete objA.a; >delete objA.a : boolean diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.types b/tests/baselines/reference/deleteOperatorWithEnumType.types index d3266a6aa6c1f..5248ef6d46ef2 100644 --- a/tests/baselines/reference/deleteOperatorWithEnumType.types +++ b/tests/baselines/reference/deleteOperatorWithEnumType.types @@ -6,8 +6,8 @@ enum ENUM { }; enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 +>A : ENUM1.A +>B : ENUM1.B // enum type var var ResultIsBoolean1 = delete ENUM; @@ -24,9 +24,9 @@ var ResultIsBoolean2 = delete ENUM1; var ResultIsBoolean3 = delete ENUM1["A"]; >ResultIsBoolean3 : boolean >delete ENUM1["A"] : boolean ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string +>"A" : "A" var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); >ResultIsBoolean4 : boolean @@ -35,10 +35,10 @@ var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM ->0 : number ->ENUM1["B"] : ENUM1 +>0 : 0 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" // multiple delete operators var ResultIsBoolean5 = delete delete ENUM; @@ -56,10 +56,10 @@ var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM ->0 : number ->ENUM1["B"] : ENUM1 +>0 : 0 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" // miss assignment operators delete ENUM; @@ -72,9 +72,9 @@ delete ENUM1; delete ENUM1.B; >delete ENUM1.B : boolean ->ENUM1.B : ENUM1 +>ENUM1.B : ENUM1.B >ENUM1 : typeof ENUM1 ->B : ENUM1 +>B : ENUM1.B delete ENUM, ENUM1; >delete ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.types b/tests/baselines/reference/deleteOperatorWithNumberType.types index e631745d089ca..e3a26b618e1fd 100644 --- a/tests/baselines/reference/deleteOperatorWithNumberType.types +++ b/tests/baselines/reference/deleteOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsBoolean2 = delete NUMBER1; var ResultIsBoolean3 = delete 1; >ResultIsBoolean3 : boolean >delete 1 : boolean ->1 : number +>1 : 1 var ResultIsBoolean4 = delete { x: 1, y: 2}; >ResultIsBoolean4 : boolean >delete { x: 1, y: 2} : boolean >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsBoolean5 = delete { x: 1, y: (n: number) => { return n; } }; >ResultIsBoolean5 : boolean >delete { x: 1, y: (n: number) => { return n; } } : boolean >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsBoolean8 = delete NUMBER1[0]; >delete NUMBER1[0] : boolean >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsBoolean9 = delete foo(); >ResultIsBoolean9 : boolean @@ -136,7 +136,7 @@ var ResultIsBoolean13 = delete delete delete (NUMBER + NUMBER); // miss assignment operators delete 1; >delete 1 : boolean ->1 : number +>1 : 1 delete NUMBER; >delete NUMBER : boolean diff --git a/tests/baselines/reference/deleteOperatorWithStringType.types b/tests/baselines/reference/deleteOperatorWithStringType.types index 0492aeff1760b..842ad281ef77d 100644 --- a/tests/baselines/reference/deleteOperatorWithStringType.types +++ b/tests/baselines/reference/deleteOperatorWithStringType.types @@ -6,12 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] ->"" : string ->"abc" : string +>"" : "" +>"abc" : "abc" function foo(): string { return "abc"; } >foo : () => string ->"abc" : string +>"abc" : "abc" class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return ""; } >foo : () => string ->"" : string +>"" : "" } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsBoolean2 = delete STRING1; var ResultIsBoolean3 = delete ""; >ResultIsBoolean3 : boolean >delete "" : boolean ->"" : string +>"" : "" var ResultIsBoolean4 = delete { x: "", y: "" }; >ResultIsBoolean4 : boolean >delete { x: "", y: "" } : boolean >{ x: "", y: "" } : { x: string; y: string; } >x : string ->"" : string +>"" : "" >y : string ->"" : string +>"" : "" var ResultIsBoolean5 = delete { x: "", y: (s: string) => { return s; } }; >ResultIsBoolean5 : boolean >delete { x: "", y: (s: string) => { return s; } } : boolean >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string ->"" : string +>"" : "" >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -92,7 +92,7 @@ var ResultIsBoolean8 = delete STRING1[0]; >delete STRING1[0] : boolean >STRING1[0] : string >STRING1 : string[] ->0 : number +>0 : 0 var ResultIsBoolean9 = delete foo(); >ResultIsBoolean9 : boolean @@ -123,7 +123,7 @@ var ResultIsBoolean12 = delete STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 // multiple delete operator var ResultIsBoolean13 = delete delete STRING; @@ -145,7 +145,7 @@ var ResultIsBoolean14 = delete delete delete (STRING + STRING); // miss assignment operators delete ""; >delete "" : boolean ->"" : string +>"" : "" delete STRING; >delete STRING : boolean diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types index 2799555a3a2b6..5d98125069860 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types @@ -227,12 +227,12 @@ var r7 = d2['']; >r7 : { foo: string; } >d2[''] : { foo: string; } >d2 : Derived2 ->'' : string +>'' : "" var r8 = d2[1]; >r8 : { foo: string; bar: string; } >d2[1] : { foo: string; bar: string; } >d2 : Derived2 ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/destructureOptionalParameter.types b/tests/baselines/reference/destructureOptionalParameter.types index 9baffd5f8faa5..a72b03f59397f 100644 --- a/tests/baselines/reference/destructureOptionalParameter.types +++ b/tests/baselines/reference/destructureOptionalParameter.types @@ -15,9 +15,9 @@ function f2({ a, b }: { a: number, b: number } = { a: 0, b: 0 }) { >b : number >{ a: 0, b: 0 } : { a: number; b: number; } >a : number ->0 : number +>0 : 0 >b : number ->0 : number +>0 : 0 a; >a : number diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt index 610167a1bc0c7..7fba74522e2e2 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(4,5): error TS2461: Type 'undefined' is not an array type. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,5): error TS2322: Type '[number, number, string]' is not assignable to type '[number, boolean, string]'. - Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,5): error TS2322: Type '[number, 2, string]' is not assignable to type '[number, boolean, string]'. + Type '2' is not assignable to type 'boolean'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(22,5): error TS2322: Type 'number[]' is not assignable to type '[number, number]'. Property '0' is missing in type 'number[]'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(23,5): error TS2322: Type 'number[]' is not assignable to type '[string, string]'. @@ -27,8 +27,8 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss // where N is the numeric index of E in the array assignment pattern, or var [b0, b1, b2]: [number, boolean, string] = [1, 2, "string"]; // Error ~~~~~~~~~~~~ -!!! error TS2322: Type '[number, number, string]' is not assignable to type '[number, boolean, string]'. -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type '[number, 2, string]' is not assignable to type '[number, boolean, string]'. +!!! error TS2322: Type '2' is not assignable to type 'boolean'. interface J extends Array { 2: number; } diff --git a/tests/baselines/reference/destructuringAssignmentWithDefault.types b/tests/baselines/reference/destructuringAssignmentWithDefault.types index 1dc1fe2353343..658816a36e4e9 100644 --- a/tests/baselines/reference/destructuringAssignmentWithDefault.types +++ b/tests/baselines/reference/destructuringAssignmentWithDefault.types @@ -6,7 +6,7 @@ const a: { x?: number } = { }; let x = 0; >x : number ->0 : number +>0 : 0 ({x = 1} = a); >({x = 1} = a) : { x?: number | undefined; } diff --git a/tests/baselines/reference/destructuringInFunctionType.types b/tests/baselines/reference/destructuringInFunctionType.types index 5292ea989ddc1..3f635d44568d6 100644 --- a/tests/baselines/reference/destructuringInFunctionType.types +++ b/tests/baselines/reference/destructuringInFunctionType.types @@ -70,7 +70,7 @@ var v1 = ([a, b, c]) => "hello"; >a : any >b : any >c : any ->"hello" : string +>"hello" : "hello" var v2: ([a, b, c]) => string; >v2 : ([a, b, c]: [any, any, any]) => string diff --git a/tests/baselines/reference/destructuringInVariableDeclarations1.types b/tests/baselines/reference/destructuringInVariableDeclarations1.types index 84a60c844a36d..4da295f5dd012 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations1.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations1.types @@ -1,10 +1,10 @@ === tests/cases/compiler/destructuringInVariableDeclarations1.ts === export let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/destructuringInVariableDeclarations2.types b/tests/baselines/reference/destructuringInVariableDeclarations2.types index b7456d3028509..7bda9c52ef2cb 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations2.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations2.types @@ -1,11 +1,11 @@ === tests/cases/compiler/destructuringInVariableDeclarations2.ts === let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } export {}; diff --git a/tests/baselines/reference/destructuringInVariableDeclarations3.types b/tests/baselines/reference/destructuringInVariableDeclarations3.types index 970d6deb1edac..222d4c761304b 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations3.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations3.types @@ -1,10 +1,10 @@ === tests/cases/compiler/destructuringInVariableDeclarations3.ts === export let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/destructuringInVariableDeclarations4.types b/tests/baselines/reference/destructuringInVariableDeclarations4.types index 628fe7a95620a..7714b78eeec98 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations4.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations4.types @@ -1,11 +1,11 @@ === tests/cases/compiler/destructuringInVariableDeclarations4.ts === let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } export {}; diff --git a/tests/baselines/reference/destructuringInVariableDeclarations5.types b/tests/baselines/reference/destructuringInVariableDeclarations5.types index 9a890916d1772..d6c4b3dee7a5f 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations5.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations5.types @@ -1,10 +1,10 @@ === tests/cases/compiler/destructuringInVariableDeclarations5.ts === export let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/destructuringInVariableDeclarations6.types b/tests/baselines/reference/destructuringInVariableDeclarations6.types index cf1105b575a48..d4f94ffcd03d8 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations6.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations6.types @@ -1,11 +1,11 @@ === tests/cases/compiler/destructuringInVariableDeclarations6.ts === let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } export {}; diff --git a/tests/baselines/reference/destructuringInVariableDeclarations7.types b/tests/baselines/reference/destructuringInVariableDeclarations7.types index c0c1b5712152d..e4f4603567bea 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations7.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations7.types @@ -1,10 +1,10 @@ === tests/cases/compiler/destructuringInVariableDeclarations7.ts === export let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/destructuringInVariableDeclarations8.types b/tests/baselines/reference/destructuringInVariableDeclarations8.types index ef376563551b4..c79650d57249d 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations8.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations8.types @@ -1,11 +1,11 @@ === tests/cases/compiler/destructuringInVariableDeclarations8.ts === let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } export {}; diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types index 2301902bf648a..e0aedcbb16709 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types @@ -19,31 +19,31 @@ var { b1, } = { b1:1, }; >b1 : number >{ b1:1, } : { b1: number; } >b1 : number ->1 : number +>1 : 1 var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; >b2 : any >b21 : string >{ b21: "string" } : { b21: string; } >b21 : string ->"string" : string +>"string" : "string" >{ b2: { b21: "world" } } : { b2?: { b21: string; }; } >b2 : { b21: string; } >{ b21: "world" } : { b21: string; } >b21 : string ->"world" : string +>"world" : "world" var {1: b3} = { 1: "string" }; >b3 : string >{ 1: "string" } : { 1: string; } ->"string" : string +>"string" : "string" var {b4 = 1}: any = { b4: 100000 }; >b4 : number ->1 : number +>1 : 1 >{ b4: 100000 } : { b4: number; } >b4 : number ->100000 : number +>100000 : 100000 var {b5: { b52 } } = { b5: { b52 } }; >b5 : any @@ -117,7 +117,7 @@ function foo1(): F1 { >{ "prop1": 2 } : { "prop1": number; } "prop1": 2 ->2 : number +>2 : 2 } } diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types index 48428881290c4..7d68d32ac514d 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types @@ -19,31 +19,31 @@ var { b1, } = { b1:1, }; >b1 : number >{ b1:1, } : { b1: number; } >b1 : number ->1 : number +>1 : 1 var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; >b2 : any >b21 : string >{ b21: "string" } : { b21: string; } >b21 : string ->"string" : string +>"string" : "string" >{ b2: { b21: "world" } } : { b2?: { b21: string; }; } >b2 : { b21: string; } >{ b21: "world" } : { b21: string; } >b21 : string ->"world" : string +>"world" : "world" var {1: b3} = { 1: "string" }; >b3 : string >{ 1: "string" } : { 1: string; } ->"string" : string +>"string" : "string" var {b4 = 1}: any = { b4: 100000 }; >b4 : number ->1 : number +>1 : 1 >{ b4: 100000 } : { b4: number; } >b4 : number ->100000 : number +>100000 : 100000 var {b5: { b52 } } = { b5: { b52 } }; >b5 : any @@ -117,7 +117,7 @@ function foo1(): F1 { >{ "prop1": 2 } : { "prop1": number; } "prop1": 2 ->2 : number +>2 : 2 } } diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types index 2ab9c9330d6db..7d4662100ed8f 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types @@ -70,16 +70,16 @@ function a11([a, b, c, ...x]: number[]) { } var array = [1, 2, 3]; >array : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var array2 = [true, false, "hello"]; >array2 : (string | boolean)[] >[true, false, "hello"] : (string | boolean)[] ->true : boolean ->false : boolean ->"hello" : string +>true : true +>false : false +>"hello" : "hello" a2([...array]); >a2([...array]) : void @@ -98,49 +98,49 @@ a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]] >a9([1, 2, [["string"]], false, true]) : void >a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void >[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >[["string"]] : [[string]] >["string"] : [string] ->"string" : string ->false : boolean ->true : boolean +>"string" : "string" +>false : false +>true : true a10([1, 2, [["string"]], false, true]); // Parameter type is any[] >a10([1, 2, [["string"]], false, true]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >[["string"]] : string[][] >["string"] : string[] ->"string" : string ->false : boolean ->true : boolean +>"string" : "string" +>false : false +>true : true a10([1, 2, 3, false, true]); // Parameter type is any[] >a10([1, 2, 3, false, true]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2, 3, false, true] : (number | boolean)[] ->1 : number ->2 : number ->3 : number ->false : boolean ->true : boolean +>1 : 1 +>2 : 2 +>3 : 3 +>false : false +>true : true a10([1, 2]); // Parameter type is any[] >a10([1, 2]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 a11([1, 2]); // Parameter type is number[] >a11([1, 2]) : void >a11 : ([a, b, c, ...x]: number[]) => void >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 // Rest parameter with generic function foo(...a: T[]) { } @@ -152,25 +152,25 @@ function foo(...a: T[]) { } foo("hello", 1, 2); >foo("hello", 1, 2) : void >foo : (...a: T[]) => void ->"hello" : string ->1 : number ->2 : number +>"hello" : "hello" +>1 : 1 +>2 : 2 foo("hello", "world"); >foo("hello", "world") : void >foo : (...a: T[]) => void ->"hello" : string ->"world" : string +>"hello" : "hello" +>"world" : "world" enum E { a, b } >E : E ->a : E ->b : E +>a : E.a +>b : E.b const enum E1 { a, b } >E1 : E1 ->a : E1 ->b : E1 +>a : E1.a +>b : E1.b function foo1(...a: T[]) { } >foo1 : (...a: T[]) => void @@ -182,25 +182,25 @@ function foo1(...a: T[]) { } foo1(1, 2, 3, E.a); >foo1(1, 2, 3, E.a) : void >foo1 : (...a: T[]) => void ->1 : number ->2 : number ->3 : number ->E.a : E +>1 : 1 +>2 : 2 +>3 : 3 +>E.a : E.a >E : typeof E ->a : E +>a : E.a foo1(1, 2, 3, E1.a, E.b); >foo1(1, 2, 3, E1.a, E.b) : void >foo1 : (...a: T[]) => void ->1 : number ->2 : number ->3 : number ->E1.a : E1 +>1 : 1 +>2 : 2 +>3 : 3 +>E1.a : E1.a >E1 : typeof E1 ->a : E1 ->E.b : E +>a : E1.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types index 55a26cfe58e34..8ec0a27850ba5 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types @@ -70,16 +70,16 @@ function a11([a, b, c, ...x]: number[]) { } var array = [1, 2, 3]; >array : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var array2 = [true, false, "hello"]; >array2 : (string | boolean)[] >[true, false, "hello"] : (string | boolean)[] ->true : boolean ->false : boolean ->"hello" : string +>true : true +>false : false +>"hello" : "hello" a2([...array]); >a2([...array]) : void @@ -98,49 +98,49 @@ a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]] >a9([1, 2, [["string"]], false, true]) : void >a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void >[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >[["string"]] : [[string]] >["string"] : [string] ->"string" : string ->false : boolean ->true : boolean +>"string" : "string" +>false : false +>true : true a10([1, 2, [["string"]], false, true]); // Parameter type is any[] >a10([1, 2, [["string"]], false, true]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >[["string"]] : string[][] >["string"] : string[] ->"string" : string ->false : boolean ->true : boolean +>"string" : "string" +>false : false +>true : true a10([1, 2, 3, false, true]); // Parameter type is any[] >a10([1, 2, 3, false, true]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2, 3, false, true] : (number | boolean)[] ->1 : number ->2 : number ->3 : number ->false : boolean ->true : boolean +>1 : 1 +>2 : 2 +>3 : 3 +>false : false +>true : true a10([1, 2]); // Parameter type is any[] >a10([1, 2]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 a11([1, 2]); // Parameter type is number[] >a11([1, 2]) : void >a11 : ([a, b, c, ...x]: number[]) => void >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 // Rest parameter with generic function foo(...a: T[]) { } @@ -152,25 +152,25 @@ function foo(...a: T[]) { } foo("hello", 1, 2); >foo("hello", 1, 2) : void >foo : (...a: T[]) => void ->"hello" : string ->1 : number ->2 : number +>"hello" : "hello" +>1 : 1 +>2 : 2 foo("hello", "world"); >foo("hello", "world") : void >foo : (...a: T[]) => void ->"hello" : string ->"world" : string +>"hello" : "hello" +>"world" : "world" enum E { a, b } >E : E ->a : E ->b : E +>a : E.a +>b : E.b const enum E1 { a, b } >E1 : E1 ->a : E1 ->b : E1 +>a : E1.a +>b : E1.b function foo1(...a: T[]) { } >foo1 : (...a: T[]) => void @@ -182,25 +182,25 @@ function foo1(...a: T[]) { } foo1(1, 2, 3, E.a); >foo1(1, 2, 3, E.a) : void >foo1 : (...a: T[]) => void ->1 : number ->2 : number ->3 : number ->E.a : E +>1 : 1 +>2 : 2 +>3 : 3 +>E.a : E.a >E : typeof E ->a : E +>a : E.a foo1(1, 2, 3, E1.a, E.b); >foo1(1, 2, 3, E1.a, E.b) : void >foo1 : (...a: T[]) => void ->1 : number ->2 : number ->3 : number ->E1.a : E1 +>1 : 1 +>2 : 2 +>3 : 3 +>E1.a : E1.a >E1 : typeof E1 ->a : E1 ->E.b : E +>a : E1.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index c89fa97b4cdc9..8db71591f4710 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(13,13): error TS2370: A rest parameter must be of an array type. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(14,17): error TS1047: A rest parameter cannot be optional. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(15,16): error TS1048: A rest parameter cannot have an initializer. -tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(20,19): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string | number'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(20,19): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string | number'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(21,7): error TS2304: Cannot find name 'array2'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(22,4): error TS2345: Argument of type '[number, number, string, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. Types of property '2' are incompatible. @@ -47,7 +47,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( a1(1, 2, "hello", true); // Error, parameter type is (number|string)[] ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string | number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string | number'. a1(...array2); // Error parameter type is (number|string)[] ~~~~~~ !!! error TS2304: Cannot find name 'array2'. diff --git a/tests/baselines/reference/destructuringParameterProperties2.errors.txt b/tests/baselines/reference/destructuringParameterProperties2.errors.txt index deb039aa67db5..d47e50db85384 100644 --- a/tests/baselines/reference/destructuringParameterProperties2.errors.txt +++ b/tests/baselines/reference/destructuringParameterProperties2.errors.txt @@ -5,8 +5,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(4 tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(9,21): error TS2339: Property 'a' does not exist on type 'C1'. tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(13,21): error TS2339: Property 'b' does not exist on type 'C1'. tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(17,21): error TS2339: Property 'c' does not exist on type 'C1'. -tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(21,27): error TS2345: Argument of type '[number, undefined, string]' is not assignable to parameter of type '[number, string, boolean]'. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(21,27): error TS2345: Argument of type '[number, undefined, ""]' is not assignable to parameter of type '[number, string, boolean]'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts (8 errors) ==== @@ -46,8 +46,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(2 var x = new C1(undefined, [0, undefined, ""]); ~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, undefined, string]' is not assignable to parameter of type '[number, string, boolean]'. -!!! error TS2345: Type 'string' is not assignable to type 'boolean'. +!!! error TS2345: Argument of type '[number, undefined, ""]' is not assignable to parameter of type '[number, string, boolean]'. +!!! error TS2345: Type '""' is not assignable to type 'boolean'. var [x_a, x_b, x_c] = [x.getA(), x.getB(), x.getC()]; var y = new C1(10, [0, "", true]); diff --git a/tests/baselines/reference/destructuringTypeAssertionsES5_5.types b/tests/baselines/reference/destructuringTypeAssertionsES5_5.types index a7111cc436160..87c38ef7108d0 100644 --- a/tests/baselines/reference/destructuringTypeAssertionsES5_5.types +++ b/tests/baselines/reference/destructuringTypeAssertionsES5_5.types @@ -2,5 +2,5 @@ var { x } = 0; >x : any >0 : any ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types index 191cdc169b1f3..6f95b19843409 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types @@ -8,19 +8,19 @@ var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } >a2 : string >{ a1: 10, a2: "world" } : { a1: number; a2: string; } >a1 : number ->10 : number +>10 : 10 >a2 : string ->"world" : string +>"world" : "world" var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; >a3 : number >a4 : string >a5 : boolean >[1, [["hello"]], true] : [number, [[string]], true] ->1 : number +>1 : 1 >[["hello"]] : [[string]] >["hello"] : [string] ->"hello" : string +>"hello" : "hello" >true : true // The type T associated with a destructuring variable declaration is determined as follows: @@ -30,42 +30,42 @@ var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; >b11 : string >{ b11: "string" } : { b11: string; } >b11 : string ->"string" : string +>"string" : "string" >{ b1: { b11: "world" } } : { b1?: { b11: string; }; } >b1 : { b11: string; } >{ b11: "world" } : { b11: string; } >b11 : string ->"world" : string +>"world" : "world" var temp = { t1: true, t2: "false" }; >temp : { t1: boolean; t2: string; } >{ t1: true, t2: "false" } : { t1: boolean; t2: string; } >t1 : boolean ->true : boolean +>true : true >t2 : string ->"false" : string +>"false" : "false" var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >b2 : number ->3 : number +>3 : 3 >b3 : boolean ->true : boolean +>true : true >b4 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } >[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] ->3 : number +>3 : 3 >false : false >{ t1: false, t2: "hello" } : { t1: false; t2: string; } ->t1 : false +>t1 : boolean >false : false >t2 : string ->"hello" : string +>"hello" : "hello" var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : number ->3 : number ->b6 : boolean ->true : boolean +>b5 : 3 +>3 : 3 +>b6 : true +>true : true >b7 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } >[undefined, undefined, undefined] : [undefined, undefined, undefined] @@ -79,17 +79,17 @@ var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; var [...c1] = [1,2,3]; >c1 : number[] >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [...c2] = [1,2,3, "string"]; >c2 : (string | number)[] >[1,2,3, "string"] : (string | number)[] ->1 : number ->2 : number ->3 : number ->"string" : string +>1 : 1 +>2 : 2 +>3 : 3 +>"string" : "string" // The type T associated with a binding element is determined as follows: // Otherwise, if S is a tuple- like type (section 3.3.3): @@ -99,8 +99,8 @@ var [d1,d2] = [1,"string"] >d1 : number >d2 : string >[1,"string"] : [number, string] ->1 : number ->"string" : string +>1 : 1 +>"string" : "string" // The type T associated with a binding element is determined as follows: // Otherwise, if S is a tuple- like type (section 3.3.3): @@ -108,16 +108,16 @@ var [d1,d2] = [1,"string"] var temp1 = [true, false, true] >temp1 : boolean[] >[true, false, true] : boolean[] ->true : boolean ->false : boolean ->true : boolean +>true : true +>false : false +>true : true var [d3, d4] = [1, "string", ...temp1]; >d3 : string | number | boolean >d4 : string | number | boolean >[1, "string", ...temp1] : (string | number | boolean)[] ->1 : number ->"string" : string +>1 : 1 +>"string" : "string" >...temp1 : boolean >temp1 : boolean[] @@ -129,19 +129,19 @@ var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; >e3 : { b1: number; b4: number; } >{ b1: 1000, b4: 200 } : { b1: number; b4: number; } >b1 : number ->1000 : number +>1000 : 1000 >b4 : number ->200 : number +>200 : 200 >{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } >e : [number, number, { b1: number; b4: number; }] >[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >{ b1: 4, b4: 0 } : { b1: number; b4: number; } >b1 : number ->4 : number +>4 : 4 >b4 : number ->0 : number +>0 : 0 var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >f : any @@ -154,13 +154,13 @@ var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }, any]; } >f : [number, number, { f3: number; f5: number; }, any] >[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }, any] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >{ f3: 4, f5: 0 } : { f3: number; f5: number; } >f3 : number ->4 : number +>4 : 4 >f5 : number ->0 : number +>0 : 0 // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable @@ -178,8 +178,8 @@ var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; >{ g1: [1, 2] } : { g1: number[]; } >g1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; >h : any @@ -194,7 +194,7 @@ var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } >{ h1: [1, 2] } : { h1: number[]; } >h1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types index 50f5cfc8a5a7d..d01326991c0d4 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types @@ -8,19 +8,19 @@ var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } >a2 : string >{ a1: 10, a2: "world" } : { a1: number; a2: string; } >a1 : number ->10 : number +>10 : 10 >a2 : string ->"world" : string +>"world" : "world" var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; >a3 : number >a4 : string >a5 : boolean >[1, [["hello"]], true] : [number, [[string]], true] ->1 : number +>1 : 1 >[["hello"]] : [[string]] >["hello"] : [string] ->"hello" : string +>"hello" : "hello" >true : true // The type T associated with a destructuring variable declaration is determined as follows: @@ -30,42 +30,42 @@ var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; >b11 : string >{ b11: "string" } : { b11: string; } >b11 : string ->"string" : string +>"string" : "string" >{ b1: { b11: "world" } } : { b1?: { b11: string; }; } >b1 : { b11: string; } >{ b11: "world" } : { b11: string; } >b11 : string ->"world" : string +>"world" : "world" var temp = { t1: true, t2: "false" }; >temp : { t1: boolean; t2: string; } >{ t1: true, t2: "false" } : { t1: boolean; t2: string; } >t1 : boolean ->true : boolean +>true : true >t2 : string ->"false" : string +>"false" : "false" var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >b2 : number ->3 : number +>3 : 3 >b3 : boolean ->true : boolean +>true : true >b4 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } >[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] ->3 : number +>3 : 3 >false : false >{ t1: false, t2: "hello" } : { t1: false; t2: string; } ->t1 : false +>t1 : boolean >false : false >t2 : string ->"hello" : string +>"hello" : "hello" var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : number ->3 : number ->b6 : boolean ->true : boolean +>b5 : 3 +>3 : 3 +>b6 : true +>true : true >b7 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } >[undefined, undefined, undefined] : [undefined, undefined, undefined] @@ -79,17 +79,17 @@ var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; var [...c1] = [1,2,3]; >c1 : number[] >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [...c2] = [1,2,3, "string"]; >c2 : (string | number)[] >[1,2,3, "string"] : (string | number)[] ->1 : number ->2 : number ->3 : number ->"string" : string +>1 : 1 +>2 : 2 +>3 : 3 +>"string" : "string" // The type T associated with a binding element is determined as follows: // Otherwise, if S is a tuple- like type (section 3.3.3): @@ -99,8 +99,8 @@ var [d1,d2] = [1,"string"] >d1 : number >d2 : string >[1,"string"] : [number, string] ->1 : number ->"string" : string +>1 : 1 +>"string" : "string" // The type T associated with a binding element is determined as follows: // Otherwise, if S is a tuple- like type (section 3.3.3): @@ -108,16 +108,16 @@ var [d1,d2] = [1,"string"] var temp1 = [true, false, true] >temp1 : boolean[] >[true, false, true] : boolean[] ->true : boolean ->false : boolean ->true : boolean +>true : true +>false : false +>true : true var [d3, d4] = [1, "string", ...temp1]; >d3 : string | number | boolean >d4 : string | number | boolean >[1, "string", ...temp1] : (string | number | boolean)[] ->1 : number ->"string" : string +>1 : 1 +>"string" : "string" >...temp1 : boolean >temp1 : boolean[] @@ -129,19 +129,19 @@ var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; >e3 : { b1: number; b4: number; } >{ b1: 1000, b4: 200 } : { b1: number; b4: number; } >b1 : number ->1000 : number +>1000 : 1000 >b4 : number ->200 : number +>200 : 200 >{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } >e : [number, number, { b1: number; b4: number; }] >[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >{ b1: 4, b4: 0 } : { b1: number; b4: number; } >b1 : number ->4 : number +>4 : 4 >b4 : number ->0 : number +>0 : 0 var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >f : any @@ -154,13 +154,13 @@ var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }, any]; } >f : [number, number, { f3: number; f5: number; }, any] >[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }, any] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >{ f3: 4, f5: 0 } : { f3: number; f5: number; } >f3 : number ->4 : number +>4 : 4 >f5 : number ->0 : number +>0 : 0 // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable @@ -178,8 +178,8 @@ var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; >{ g1: [1, 2] } : { g1: number[]; } >g1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; >h : any @@ -194,7 +194,7 @@ var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } >{ h1: [1, 2] } : { h1: number[]; } >h1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/destructuringWithLiteralInitializers.types b/tests/baselines/reference/destructuringWithLiteralInitializers.types index 9b970679f7461..433915150147e 100644 --- a/tests/baselines/reference/destructuringWithLiteralInitializers.types +++ b/tests/baselines/reference/destructuringWithLiteralInitializers.types @@ -10,40 +10,40 @@ f1({ x: 1, y: 1 }); >f1 : ({x, y}: { x: any; y: any; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg: { x: any, y?: number }) => void function f2({ x, y = 0 }) { } >f2 : ({x, y}: { x: any; y?: number; }) => void >x : any >y : number ->0 : number +>0 : 0 f2({ x: 1 }); >f2({ x: 1 }) : void >f2 : ({x, y}: { x: any; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 f2({ x: 1, y: 1 }); >f2({ x: 1, y: 1 }) : void >f2 : ({x, y}: { x: any; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg: { x?: number, y?: number }) => void function f3({ x = 0, y = 0 }) { } >f3 : ({x, y}: { x?: number; y?: number; }) => void >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 f3({}); >f3({}) : void @@ -55,23 +55,23 @@ f3({ x: 1 }); >f3 : ({x, y}: { x?: number; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 f3({ y: 1 }); >f3({ y: 1 }) : void >f3 : ({x, y}: { x?: number; y?: number; }) => void >{ y: 1 } : { y: number; } >y : number ->1 : number +>1 : 1 f3({ x: 1, y: 1 }); >f3({ x: 1, y: 1 }) : void >f3 : ({x, y}: { x?: number; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg?: { x: number, y: number }) => void function f4({ x, y } = { x: 0, y: 0 }) { } @@ -80,9 +80,9 @@ function f4({ x, y } = { x: 0, y: 0 }) { } >y : number >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 f4(); >f4() : void @@ -93,19 +93,19 @@ f4({ x: 1, y: 1 }); >f4 : ({x, y}?: { x: number; y: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg?: { x: number, y?: number }) => void function f5({ x, y = 0 } = { x: 0 }) { } >f5 : ({x, y}?: { x: number; y?: number; }) => void >x : number >y : number ->0 : number +>0 : 0 >{ x: 0 } : { x: number; y?: number; } >x : number ->0 : number +>0 : 0 f5(); >f5() : void @@ -116,24 +116,24 @@ f5({ x: 1 }); >f5 : ({x, y}?: { x: number; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 f5({ x: 1, y: 1 }); >f5({ x: 1, y: 1 }) : void >f5 : ({x, y}?: { x: number; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg?: { x?: number, y?: number }) => void function f6({ x = 0, y = 0 } = {}) { } >f6 : ({x, y}?: { x?: number; y?: number; }) => void >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >{} : { x?: number; y?: number; } f6(); @@ -150,32 +150,32 @@ f6({ x: 1 }); >f6 : ({x, y}?: { x?: number; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 f6({ y: 1 }); >f6({ y: 1 }) : void >f6 : ({x, y}?: { x?: number; y?: number; }) => void >{ y: 1 } : { y: number; } >y : number ->1 : number +>1 : 1 f6({ x: 1, y: 1 }); >f6({ x: 1, y: 1 }) : void >f6 : ({x, y}?: { x?: number; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg?: { a: { x?: number, y?: number } }) => void function f7({ a: { x = 0, y = 0 } } = { a: {} }) { } >f7 : ({a: {x, y}}?: { a: { x?: number; y?: number; }; }) => void >a : any >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >{ a: {} } : { a: { x?: number; y?: number; }; } >a : { x?: number; y?: number; } >{} : { x?: number; y?: number; } @@ -198,7 +198,7 @@ f7({ a: { x: 1 } }); >a : { x: number; } >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 f7({ a: { y: 1 } }); >f7({ a: { y: 1 } }) : void @@ -207,7 +207,7 @@ f7({ a: { y: 1 } }); >a : { y: number; } >{ y: 1 } : { y: number; } >y : number ->1 : number +>1 : 1 f7({ a: { x: 1, y: 1 } }); >f7({ a: { x: 1, y: 1 } }) : void @@ -216,9 +216,9 @@ f7({ a: { x: 1, y: 1 } }); >a : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg: [any, any]) => void function g1([x, y]) { } @@ -230,23 +230,23 @@ g1([1, 1]); >g1([1, 1]) : void >g1 : ([x, y]: [any, any]) => void >[1, 1] : [number, number] ->1 : number ->1 : number +>1 : 1 +>1 : 1 // (arg: [number, number]) => void function g2([x = 0, y = 0]) { } >g2 : ([x, y]: [number, number]) => void >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 g2([1, 1]); >g2([1, 1]) : void >g2 : ([x, y]: [number, number]) => void >[1, 1] : [number, number] ->1 : number ->1 : number +>1 : 1 +>1 : 1 // (arg?: [number, number]) => void function g3([x, y] = [0, 0]) { } @@ -254,8 +254,8 @@ function g3([x, y] = [0, 0]) { } >x : number >y : number >[0, 0] : [number, number] ->0 : number ->0 : number +>0 : 0 +>0 : 0 g3(); >g3() : void @@ -265,17 +265,17 @@ g3([1, 1]); >g3([1, 1]) : void >g3 : ([x, y]?: [number, number]) => void >[1, 1] : [number, number] ->1 : number ->1 : number +>1 : 1 +>1 : 1 // (arg?: [number, number]) => void function g4([x, y = 0] = [0]) { } >g4 : ([x, y]?: [number, number]) => void >x : number >y : number ->0 : number +>0 : 0 >[0] : [number, number] ->0 : number +>0 : 0 g4(); >g4() : void @@ -285,16 +285,16 @@ g4([1, 1]); >g4([1, 1]) : void >g4 : ([x, y]?: [number, number]) => void >[1, 1] : [number, number] ->1 : number ->1 : number +>1 : 1 +>1 : 1 // (arg?: [number, number]) => void function g5([x = 0, y = 0] = []) { } >g5 : ([x, y]?: [number, number]) => void >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >[] : [number, number] g5(); @@ -305,6 +305,6 @@ g5([1, 1]); >g5([1, 1]) : void >g5 : ([x, y]?: [number, number]) => void >[1, 1] : [number, number] ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/destructuringWithNewExpression.types b/tests/baselines/reference/destructuringWithNewExpression.types index 1d36746a44dfe..2803dfd802fd4 100644 --- a/tests/baselines/reference/destructuringWithNewExpression.types +++ b/tests/baselines/reference/destructuringWithNewExpression.types @@ -4,7 +4,7 @@ class C { x = 0; >x : number ->0 : number +>0 : 0 } var { x } = new C; diff --git a/tests/baselines/reference/destructuringWithNumberLiteral.types b/tests/baselines/reference/destructuringWithNumberLiteral.types index 7fe902c622efc..226c3fd49231f 100644 --- a/tests/baselines/reference/destructuringWithNumberLiteral.types +++ b/tests/baselines/reference/destructuringWithNumberLiteral.types @@ -1,5 +1,5 @@ === tests/cases/compiler/destructuringWithNumberLiteral.ts === var { toExponential } = 0; >toExponential : (fractionDigits?: number) => string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/doNotEmitDetachedComments.types b/tests/baselines/reference/doNotEmitDetachedComments.types index d9b5f0634c243..ee3612235609b 100644 --- a/tests/baselines/reference/doNotEmitDetachedComments.types +++ b/tests/baselines/reference/doNotEmitDetachedComments.types @@ -7,7 +7,7 @@ var x = 10; >x : number ->10 : number +>10 : 10 // Single Line comment diff --git a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfConstructor.types b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfConstructor.types index c316c6403c024..b8879c4236e08 100644 --- a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfConstructor.types +++ b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfConstructor.types @@ -7,7 +7,7 @@ class A { var x = 10; >x : number ->10 : number +>10 : 10 } } @@ -21,7 +21,7 @@ class B { var y = 10; >y : number ->10 : number +>10 : 10 } } @@ -34,7 +34,7 @@ class C { var x = 10; >x : number ->10 : number +>10 : 10 } } @@ -49,6 +49,6 @@ class D { var y = 10; >y : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfFunctionBody.types b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfFunctionBody.types index 3b4814bbbb25f..78c3d946f1df2 100644 --- a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfFunctionBody.types +++ b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfFunctionBody.types @@ -5,7 +5,7 @@ function foo1() { // Single line comment return 42; ->42 : number +>42 : 42 } function foo2() { @@ -18,7 +18,7 @@ function foo2() { */ return 42; ->42 : number +>42 : 42 } function foo3() { @@ -28,7 +28,7 @@ function foo3() { return 42; ->42 : number +>42 : 42 } function foo4() { @@ -40,7 +40,7 @@ function foo4() { */ return 42; ->42 : number +>42 : 42 } diff --git a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfLambdaFunction.types b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfLambdaFunction.types index d90e93d84c5c8..cca2ff8646901 100644 --- a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfLambdaFunction.types +++ b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfLambdaFunction.types @@ -5,7 +5,7 @@ // Single line comment return 0; ->0 : number +>0 : 0 } () => { @@ -16,7 +16,7 @@ */ return 0; ->0 : number +>0 : 0 } () => { @@ -26,7 +26,7 @@ return 0; ->0 : number +>0 : 0 } () => { @@ -38,6 +38,6 @@ return 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/doNotEmitPinnedCommentNotOnTopOfFile.types b/tests/baselines/reference/doNotEmitPinnedCommentNotOnTopOfFile.types index 3426c70dfb954..e76d9e6b8e11c 100644 --- a/tests/baselines/reference/doNotEmitPinnedCommentNotOnTopOfFile.types +++ b/tests/baselines/reference/doNotEmitPinnedCommentNotOnTopOfFile.types @@ -1,7 +1,7 @@ === tests/cases/compiler/doNotEmitPinnedCommentNotOnTopOfFile.ts === var x = 10; >x : number ->10 : number +>10 : 10 /*! @@ -11,5 +11,5 @@ var x = 10; var x = 10; >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types b/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types index 49fb8e378ba14..491ccdbd0d0d9 100644 --- a/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types +++ b/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types @@ -17,7 +17,7 @@ class C { var x = 10; >x : number ->10 : number +>10 : 10 /*! remove pinned comment anywhere else */ declare var OData: any; diff --git a/tests/baselines/reference/doNotEmitPinnedDetachedComments.types b/tests/baselines/reference/doNotEmitPinnedDetachedComments.types index d9e78e2f9808b..f953b81a71388 100644 --- a/tests/baselines/reference/doNotEmitPinnedDetachedComments.types +++ b/tests/baselines/reference/doNotEmitPinnedDetachedComments.types @@ -1,7 +1,7 @@ === tests/cases/compiler/doNotEmitPinnedDetachedComments.ts === var x = 10; >x : number ->10 : number +>10 : 10 /*! Single Line comment */ @@ -33,7 +33,7 @@ function foo() { /*! Remove this */ return 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types index f151b5841c0a0..d61bd343c64e6 100644 --- a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types @@ -26,7 +26,7 @@ var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // >interval : { begin: number; } >{ begin: 0 } : { begin: number; } >begin : number ->0 : number +>0 : 0 >children : null >null : null diff --git a/tests/baselines/reference/doNotemitTripleSlashComments.types b/tests/baselines/reference/doNotemitTripleSlashComments.types index edebe5687f64c..8bad6e601de68 100644 --- a/tests/baselines/reference/doNotemitTripleSlashComments.types +++ b/tests/baselines/reference/doNotemitTripleSlashComments.types @@ -17,12 +17,12 @@ function bar() { } /// var x = 10; >x : number ->10 : number +>10 : 10 /// var y = "hello"; >y : string ->"hello" : string +>"hello" : "hello" /// @@ -39,5 +39,5 @@ function foo() { } var z = "world"; >z : string ->"world" : string +>"world" : "world" diff --git a/tests/baselines/reference/doWhileBreakStatements.types b/tests/baselines/reference/doWhileBreakStatements.types index f143cb17d0884..bc5102dc330fa 100644 --- a/tests/baselines/reference/doWhileBreakStatements.types +++ b/tests/baselines/reference/doWhileBreakStatements.types @@ -3,7 +3,7 @@ do { break; } while(true) ->true : boolean +>true : true ONE: >ONE : any @@ -13,7 +13,7 @@ do { >ONE : any } while (true) ->true : boolean +>true : true TWO: >TWO : any @@ -26,7 +26,7 @@ do { >THREE : any }while (true) ->true : boolean +>true : true FOUR: >FOUR : any @@ -40,10 +40,10 @@ do { >FOUR : any }while (true) ->true : boolean +>true : true }while (true) ->true : boolean +>true : true do { SIX: @@ -51,19 +51,19 @@ do { do break SIX; while(true) >SIX : any ->true : boolean +>true : true }while (true) ->true : boolean +>true : true SEVEN: >SEVEN : any do do do break SEVEN; while (true) while (true) while (true) >SEVEN : any ->true : boolean ->true : boolean ->true : boolean +>true : true +>true : true +>true : true EIGHT: >EIGHT : any @@ -77,5 +77,5 @@ do{ >EIGHT : any }while(true) ->true : boolean +>true : true diff --git a/tests/baselines/reference/doWhileContinueStatements.types b/tests/baselines/reference/doWhileContinueStatements.types index e4d3191d040d6..66ff052a3cd6f 100644 --- a/tests/baselines/reference/doWhileContinueStatements.types +++ b/tests/baselines/reference/doWhileContinueStatements.types @@ -3,7 +3,7 @@ do { continue; } while(true) ->true : boolean +>true : true ONE: >ONE : any @@ -13,7 +13,7 @@ do { >ONE : any } while (true) ->true : boolean +>true : true TWO: >TWO : any @@ -26,7 +26,7 @@ do { >THREE : any }while (true) ->true : boolean +>true : true FOUR: >FOUR : any @@ -40,10 +40,10 @@ do { >FOUR : any }while (true) ->true : boolean +>true : true }while (true) ->true : boolean +>true : true do { SIX: @@ -51,19 +51,19 @@ do { do continue SIX; while(true) >SIX : any ->true : boolean +>true : true }while (true) ->true : boolean +>true : true SEVEN: >SEVEN : any do do do continue SEVEN; while (true) while (true) while (true) >SEVEN : any ->true : boolean ->true : boolean ->true : boolean +>true : true +>true : true +>true : true EIGHT: >EIGHT : any @@ -77,5 +77,5 @@ do{ >EIGHT : any }while(true) ->true : boolean +>true : true diff --git a/tests/baselines/reference/doWhileLoop.types b/tests/baselines/reference/doWhileLoop.types index 9d1767b45aafd..24d24ae4dca13 100644 --- a/tests/baselines/reference/doWhileLoop.types +++ b/tests/baselines/reference/doWhileLoop.types @@ -1,6 +1,6 @@ === tests/cases/compiler/doWhileLoop.ts === do { } while (false); ->false : boolean +>false : false var n; >n : any diff --git a/tests/baselines/reference/dottedModuleName2.types b/tests/baselines/reference/dottedModuleName2.types index 869bbfb4cfc91..6e58412481ddf 100644 --- a/tests/baselines/reference/dottedModuleName2.types +++ b/tests/baselines/reference/dottedModuleName2.types @@ -5,7 +5,7 @@ module A.B { export var x = 1; >x : number ->1 : number +>1 : 1 } @@ -17,7 +17,7 @@ module AA { export module B { export var x = 1; >x : number ->1 : number +>1 : 1 } } @@ -49,7 +49,7 @@ module A.B.C export var x = 1; >x : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/dottedSymbolResolution1.types b/tests/baselines/reference/dottedSymbolResolution1.types index cf5a5e3ba9d7a..3cc8e0db51317 100644 --- a/tests/baselines/reference/dottedSymbolResolution1.types +++ b/tests/baselines/reference/dottedSymbolResolution1.types @@ -68,7 +68,7 @@ function _setBarAndText(): void { >x.find : (selector: string) => JQuery >x : JQuery >find : (selector: string) => JQuery ->" " : string +>" " : " " >function () { var $this: JQuery = $(''), thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here } : () => void var $this: JQuery = $(''), @@ -76,7 +76,7 @@ function _setBarAndText(): void { >JQuery : JQuery >$('') : JQuery >$ : JQueryStatic ->'' : string +>'' : "" thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here >thisBar : JQuery @@ -84,7 +84,7 @@ function _setBarAndText(): void { >$this.find : (selector: string) => JQuery >$this : JQuery >find : (selector: string) => JQuery ->".fx-usagebars-calloutbar-this" : string +>".fx-usagebars-calloutbar-this" : ".fx-usagebars-calloutbar-this" } ); } diff --git a/tests/baselines/reference/downlevelLetConst10.types b/tests/baselines/reference/downlevelLetConst10.types index 3d700b0694d24..e94ed7e11783b 100644 --- a/tests/baselines/reference/downlevelLetConst10.types +++ b/tests/baselines/reference/downlevelLetConst10.types @@ -1,5 +1,5 @@ === tests/cases/compiler/downlevelLetConst10.ts === let a: number = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/downlevelLetConst13.types b/tests/baselines/reference/downlevelLetConst13.types index 0453d3a6ad376..92bb3226f94d5 100644 --- a/tests/baselines/reference/downlevelLetConst13.types +++ b/tests/baselines/reference/downlevelLetConst13.types @@ -1,74 +1,74 @@ === tests/cases/compiler/downlevelLetConst13.ts === 'use strict' ->'use strict' : string +>'use strict' : "use strict" // exported let\const bindings should not be renamed export let foo = 10; >foo : number ->10 : number +>10 : 10 export const bar = "123" ->bar : string ->"123" : string +>bar : "123" +>"123" : "123" export let [bar1] = [1]; >bar1 : number >[1] : [number] ->1 : number +>1 : 1 export const [bar2] = [2]; >bar2 : number >[2] : [number] ->2 : number +>2 : 2 export let {a: bar3} = { a: 1 }; >a : any >bar3 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 export const {a: bar4} = { a: 1 }; >a : any >bar4 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 export module M { >M : typeof M export let baz = 100; >baz : number ->100 : number +>100 : 100 export const baz2 = true; ->baz2 : boolean ->true : boolean +>baz2 : true +>true : true export let [bar5] = [1]; >bar5 : number >[1] : [number] ->1 : number +>1 : 1 export const [bar6] = [2]; >bar6 : number >[2] : [number] ->2 : number +>2 : 2 export let {a: bar7} = { a: 1 }; >a : any >bar7 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 export const {a: bar8} = { a: 1 }; >a : any >bar8 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/downlevelLetConst14.types b/tests/baselines/reference/downlevelLetConst14.types index ea6aadfe2a807..29c87e76cce5c 100644 --- a/tests/baselines/reference/downlevelLetConst14.types +++ b/tests/baselines/reference/downlevelLetConst14.types @@ -1,6 +1,6 @@ === tests/cases/compiler/downlevelLetConst14.ts === 'use strict' ->'use strict' : string +>'use strict' : "use strict" declare function use(a: any); >use : (a: any) => any @@ -8,7 +8,7 @@ declare function use(a: any); var x = 10; >x : number ->10 : number +>10 : 10 var z0, z1, z2, z3; >z0 : any @@ -18,7 +18,7 @@ var z0, z1, z2, z3; { let x = 20; >x : number ->20 : number +>20 : 20 use(x); >use(x) : any @@ -28,7 +28,7 @@ var z0, z1, z2, z3; let [z0] = [1]; >z0 : number >[1] : [number] ->1 : number +>1 : 1 use(z0); >use(z0) : any @@ -38,7 +38,7 @@ var z0, z1, z2, z3; let [z1] = [1] >z1 : number >[1] : [number] ->1 : number +>1 : 1 use(z1); >use(z1) : any @@ -50,7 +50,7 @@ var z0, z1, z2, z3; >z2 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 use(z2); >use(z2) : any @@ -62,7 +62,7 @@ var z0, z1, z2, z3; >z3 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 use(z3); >use(z3) : any @@ -99,27 +99,27 @@ var z6; var y = true; >y : boolean ->true : boolean +>true : true { let y = ""; >y : string ->"" : string +>"" : "" let [z6] = [true] >z6 : boolean >[true] : [boolean] ->true : boolean +>true : true { let y = 1; >y : number ->1 : number +>1 : 1 let {a: z6} = {a: 1} >a : any >z6 : number >{a: 1} : { a: number; } >a : number ->1 : number +>1 : 1 use(y); >use(y) : any @@ -144,7 +144,7 @@ var y = true; use(y); >use(y) : any >use : (a: any) => any ->y : boolean +>y : true use(z6); >use(z6) : any @@ -153,31 +153,31 @@ use(z6); var z = false; >z : boolean ->false : boolean +>false : false var z5 = 1; >z5 : number ->1 : number +>1 : 1 { let z = ""; >z : string ->"" : string +>"" : "" let [z5] = [5]; >z5 : number >[5] : [number] ->5 : number +>5 : 5 { let _z = 1; >_z : number ->1 : number +>1 : 1 let {a: _z5} = { a: 1 }; >a : any >_z5 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 // try to step on generated name use(_z); @@ -193,5 +193,5 @@ var z5 = 1; use(y); >use(y) : any >use : (a: any) => any ->y : boolean +>y : true diff --git a/tests/baselines/reference/downlevelLetConst15.types b/tests/baselines/reference/downlevelLetConst15.types index 72b29e3fe6680..9e58c6488214a 100644 --- a/tests/baselines/reference/downlevelLetConst15.types +++ b/tests/baselines/reference/downlevelLetConst15.types @@ -1,6 +1,6 @@ === tests/cases/compiler/downlevelLetConst15.ts === 'use strict' ->'use strict' : string +>'use strict' : "use strict" declare function use(a: any); >use : (a: any) => any @@ -8,7 +8,7 @@ declare function use(a: any); var x = 10; >x : number ->10 : number +>10 : 10 var z0, z1, z2, z3; >z0 : any @@ -17,18 +17,18 @@ var z0, z1, z2, z3; >z3 : any { const x = 20; ->x : number ->20 : number +>x : 20 +>20 : 20 use(x); >use(x) : any >use : (a: any) => any ->x : number +>x : 20 const [z0] = [1]; >z0 : number >[1] : [number] ->1 : number +>1 : 1 use(z0); >use(z0) : any @@ -41,7 +41,7 @@ var z0, z1, z2, z3; >[{a: 1}] : [{ a: number; }] >{a: 1} : { a: number; } >a : number ->1 : number +>1 : 1 use(z1); >use(z1) : any @@ -53,7 +53,7 @@ var z0, z1, z2, z3; >z2 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 use(z2); >use(z2) : any @@ -68,7 +68,7 @@ var z0, z1, z2, z3; >a : { b: number; } >{b: 1} : { b: number; } >b : number ->1 : number +>1 : 1 use(z3); >use(z3) : any @@ -105,32 +105,32 @@ var z6; var y = true; >y : boolean ->true : boolean +>true : true { const y = ""; ->y : string ->"" : string +>y : "" +>"" : "" const [z6] = [true] >z6 : boolean >[true] : [boolean] ->true : boolean +>true : true { const y = 1; ->y : number ->1 : number +>y : 1 +>1 : 1 const {a: z6} = { a: 1 } >a : any >z6 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 use(y); >use(y) : any >use : (a: any) => any ->y : number +>y : 1 use(z6); >use(z6) : any @@ -140,7 +140,7 @@ var y = true; use(y); >use(y) : any >use : (a: any) => any ->y : string +>y : "" use(z6); >use(z6) : any @@ -150,7 +150,7 @@ var y = true; use(y); >use(y) : any >use : (a: any) => any ->y : boolean +>y : true use(z6); >use(z6) : any @@ -159,45 +159,45 @@ use(z6); var z = false; >z : boolean ->false : boolean +>false : false var z5 = 1; >z5 : number ->1 : number +>1 : 1 { const z = ""; ->z : string ->"" : string +>z : "" +>"" : "" const [z5] = [5]; >z5 : number >[5] : [number] ->5 : number +>5 : 5 { const _z = 1; ->_z : number ->1 : number +>_z : 1 +>1 : 1 const {a: _z5} = { a: 1 }; >a : any >_z5 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 // try to step on generated name use(_z); >use(_z) : any >use : (a: any) => any ->_z : number +>_z : 1 } use(z); >use(z) : any >use : (a: any) => any ->z : string +>z : "" } use(y); >use(y) : any >use : (a: any) => any ->y : boolean +>y : true diff --git a/tests/baselines/reference/downlevelLetConst17.types b/tests/baselines/reference/downlevelLetConst17.types index 4f539835ada42..56e9356556e98 100644 --- a/tests/baselines/reference/downlevelLetConst17.types +++ b/tests/baselines/reference/downlevelLetConst17.types @@ -1,6 +1,6 @@ === tests/cases/compiler/downlevelLetConst17.ts === 'use strict' ->'use strict' : string +>'use strict' : "use strict" declare function use(a: any); >use : (a: any) => any @@ -11,7 +11,7 @@ var x; for (let x = 10; ;) { >x : number ->10 : number +>10 : 10 use(x); >use(x) : any @@ -24,19 +24,19 @@ use(x); >x : any for (const x = 10; ;) { ->x : number ->10 : number +>x : 10 +>10 : 10 use(x); >use(x) : any >use : (a: any) => any ->x : number +>x : 10 } for (; ;) { let x = 10; >x : number ->10 : number +>10 : 10 use(x); >use(x) : any @@ -44,20 +44,20 @@ for (; ;) { >x : number x = 1; ->x = 1 : number +>x = 1 : 1 >x : number ->1 : number +>1 : 1 } for (; ;) { const x = 10; ->x : number ->10 : number +>x : 10 +>10 : 10 use(x); >use(x) : any >use : (a: any) => any ->x : number +>x : 10 } for (let x; ;) { @@ -69,9 +69,9 @@ for (let x; ;) { >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 } for (; ;) { @@ -84,13 +84,13 @@ for (; ;) { >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 } while (true) { ->true : boolean +>true : true let x; >x : any @@ -102,16 +102,16 @@ while (true) { } while (true) { ->true : boolean +>true : true const x = true; ->x : boolean ->true : boolean +>x : true +>true : true use(x); >use(x) : any >use : (a: any) => any ->x : boolean +>x : true } do { @@ -124,7 +124,7 @@ do { >x : any } while (true); ->true : boolean +>true : true do { let x; @@ -136,7 +136,7 @@ do { >x : any } while (true); ->true : boolean +>true : true for (let x in []) { >x : string diff --git a/tests/baselines/reference/downlevelLetConst3.types b/tests/baselines/reference/downlevelLetConst3.types index cf8def45e3cd7..7be4e55849d02 100644 --- a/tests/baselines/reference/downlevelLetConst3.types +++ b/tests/baselines/reference/downlevelLetConst3.types @@ -1,5 +1,5 @@ === tests/cases/compiler/downlevelLetConst3.ts === const a = 1 ->a : number ->1 : number +>a : 1 +>1 : 1 diff --git a/tests/baselines/reference/downlevelLetConst5.types b/tests/baselines/reference/downlevelLetConst5.types index 2cdf6ff53cc85..ebb36072415d7 100644 --- a/tests/baselines/reference/downlevelLetConst5.types +++ b/tests/baselines/reference/downlevelLetConst5.types @@ -1,5 +1,5 @@ === tests/cases/compiler/downlevelLetConst5.ts === const a: number = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/downlevelLetConst8.types b/tests/baselines/reference/downlevelLetConst8.types index c941d67350374..01acafd1785e4 100644 --- a/tests/baselines/reference/downlevelLetConst8.types +++ b/tests/baselines/reference/downlevelLetConst8.types @@ -1,5 +1,5 @@ === tests/cases/compiler/downlevelLetConst8.ts === let a = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/duplicateAnonymousInners1.types b/tests/baselines/reference/duplicateAnonymousInners1.types index 6840e5a14f6b4..01c2f7984cc3c 100644 --- a/tests/baselines/reference/duplicateAnonymousInners1.types +++ b/tests/baselines/reference/duplicateAnonymousInners1.types @@ -14,7 +14,7 @@ module Foo { export var Outer=0; >Outer : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/duplicateLabel3.types b/tests/baselines/reference/duplicateLabel3.types index 920a077aa9ef2..56af6f24088c3 100644 --- a/tests/baselines/reference/duplicateLabel3.types +++ b/tests/baselines/reference/duplicateLabel3.types @@ -4,7 +4,7 @@ target: >target : any while (true) { ->true : boolean +>true : true function f() { >f : () => void @@ -13,7 +13,7 @@ while (true) { >target : any while (true) { ->true : boolean +>true : true } } } diff --git a/tests/baselines/reference/duplicateLabel4.types b/tests/baselines/reference/duplicateLabel4.types index a10a06fe7a2fe..2f5890ae9a42f 100644 --- a/tests/baselines/reference/duplicateLabel4.types +++ b/tests/baselines/reference/duplicateLabel4.types @@ -4,12 +4,12 @@ target: >target : any while (true) { ->true : boolean +>true : true } target: >target : any while (true) { ->true : boolean +>true : true } diff --git a/tests/baselines/reference/duplicateLocalVariable1.errors.txt b/tests/baselines/reference/duplicateLocalVariable1.errors.txt index b264574ea0983..87bcc71cdfca7 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable1.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(2,4): error TS1005: ';' expected tests/cases/compiler/duplicateLocalVariable1.ts(2,11): error TS1146: Declaration expected. tests/cases/compiler/duplicateLocalVariable1.ts(2,13): error TS2304: Cannot find name 'commonjs'. tests/cases/compiler/duplicateLocalVariable1.ts(187,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. -tests/cases/compiler/duplicateLocalVariable1.ts(187,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +tests/cases/compiler/duplicateLocalVariable1.ts(187,29): error TS2365: Operator '<' cannot be applied to types 'string' and '14'. tests/cases/compiler/duplicateLocalVariable1.ts(187,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. @@ -203,7 +203,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(187,37): error TS2356: An arithm ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. ~~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and '14'. ~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. bytes.push(fb.readByte()); diff --git a/tests/baselines/reference/duplicateLocalVariable2.errors.txt b/tests/baselines/reference/duplicateLocalVariable2.errors.txt index 5e89cc422cce9..466e145d28d77 100644 --- a/tests/baselines/reference/duplicateLocalVariable2.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. -tests/cases/compiler/duplicateLocalVariable2.ts(27,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +tests/cases/compiler/duplicateLocalVariable2.ts(27,29): error TS2365: Operator '<' cannot be applied to types 'string' and '14'. tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. @@ -34,7 +34,7 @@ tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithme ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. ~~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and '14'. ~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. bytes.push(fb.readByte()); diff --git a/tests/baselines/reference/duplicateVariablesByScope.types b/tests/baselines/reference/duplicateVariablesByScope.types index 30e68d921caff..4eec3a2054f3f 100644 --- a/tests/baselines/reference/duplicateVariablesByScope.types +++ b/tests/baselines/reference/duplicateVariablesByScope.types @@ -7,20 +7,20 @@ module M { for (var j = 0; j < 10; j++) { >j : number ->0 : number +>0 : 0 >j < 10 : boolean >j : number ->10 : number +>10 : 10 >j++ : number >j : number } for (var j = 0; j < 10; j++) { >j : number ->0 : number +>0 : 0 >j < 10 : boolean >j : number ->10 : number +>10 : 10 >j++ : number >j : number } @@ -31,23 +31,23 @@ function foo() { var x = 2; >x : number ->2 : number +>2 : 2 var x = 1; >x : number ->1 : number +>1 : 1 if (true) { ->true : boolean +>true : true var result = 1; >result : number ->1 : number +>1 : 1 } else { var result = 2; >result : number ->2 : number +>2 : 2 } } @@ -60,14 +60,14 @@ class C { try { var x = 1; >x : number ->1 : number +>1 : 1 } catch (e) { >e : any var x = 2; >x : number ->2 : number +>2 : 2 } } } diff --git a/tests/baselines/reference/dynamicModuleTypecheckError.types b/tests/baselines/reference/dynamicModuleTypecheckError.types index e50107f328b90..d2dbc1a71d93b 100644 --- a/tests/baselines/reference/dynamicModuleTypecheckError.types +++ b/tests/baselines/reference/dynamicModuleTypecheckError.types @@ -1,14 +1,14 @@ === tests/cases/compiler/dynamicModuleTypecheckError.ts === export var x = 1; >x : number ->1 : number +>1 : 1 for(var i = 0; i < 30; i++) { >i : number ->0 : number +>0 : 0 >i < 30 : boolean >i : number ->30 : number +>30 : 30 >i++ : number >i : number @@ -17,7 +17,7 @@ for(var i = 0; i < 30; i++) { >x : number >i * 1000 : number >i : number ->1000 : number +>1000 : 1000 } diff --git a/tests/baselines/reference/dynamicRequire.types b/tests/baselines/reference/dynamicRequire.types index 43eea88a05b26..9b7a6c359d53d 100644 --- a/tests/baselines/reference/dynamicRequire.types +++ b/tests/baselines/reference/dynamicRequire.types @@ -9,6 +9,6 @@ function foo(name) { >require("t/" + name) : any >require : any >"t/" + name : string ->"t/" : string +>"t/" : "t/" >name : any } diff --git a/tests/baselines/reference/elidingImportNames.types b/tests/baselines/reference/elidingImportNames.types index 947cd38f6d470..8dd6b31513747 100644 --- a/tests/baselines/reference/elidingImportNames.types +++ b/tests/baselines/reference/elidingImportNames.types @@ -22,10 +22,10 @@ var b2 = a2; === tests/cases/compiler/elidingImportNames_main.ts === export var main = 10; >main : number ->10 : number +>10 : 10 === tests/cases/compiler/elidingImportNames_main1.ts === export var main = 10; >main : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/emitArrowFunction.types b/tests/baselines/reference/emitArrowFunction.types index a4671ea5a31bd..aa0627632c88e 100644 --- a/tests/baselines/reference/emitArrowFunction.types +++ b/tests/baselines/reference/emitArrowFunction.types @@ -22,7 +22,7 @@ var f4 = (x: string, y: number, z = 10) => { } >x : string >y : number >z : number ->10 : number +>10 : 10 function foo(func: () => boolean) { } >foo : (func: () => boolean) => void diff --git a/tests/baselines/reference/emitArrowFunctionES6.types b/tests/baselines/reference/emitArrowFunctionES6.types index 2cadcf2cac9ff..c434e4b285ae7 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.types +++ b/tests/baselines/reference/emitArrowFunctionES6.types @@ -22,7 +22,7 @@ var f4 = (x: string, y: number, z=10) => { } >x : string >y : number >z : number ->10 : number +>10 : 10 function foo(func: () => boolean) { } >foo : (func: () => boolean) => void @@ -67,7 +67,7 @@ var p5 = ([a = 1]) => { }; >p5 : ([a]: [number]) => void >([a = 1]) => { } : ([a]: [number]) => void >a : number ->1 : number +>1 : 1 var p6 = ({ a }) => { }; >p6 : ({a}: { a: any; }) => void @@ -84,17 +84,17 @@ var p8 = ({ a = 1 }) => { }; >p8 : ({a}: { a?: number; }) => void >({ a = 1 }) => { } : ({a}: { a?: number; }) => void >a : number ->1 : number +>1 : 1 var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; >p9 : ({a: {b}}: { a?: { b?: number; }; }) => void >({ a: { b = 1 } = { b: 1 } }) => { } : ({a: {b}}: { a?: { b?: number; }; }) => void >a : any >b : number ->1 : number +>1 : 1 >{ b: 1 } : { b?: number; } >b : number ->1 : number +>1 : 1 var p10 = ([{ value, done }]) => { }; >p10 : ([{value, done}]: [{ value: any; done: any; }]) => void diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturing.types b/tests/baselines/reference/emitArrowFunctionThisCapturing.types index 81dc5d83f0dbb..0ef27791d1765 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturing.types +++ b/tests/baselines/reference/emitArrowFunctionThisCapturing.types @@ -4,11 +4,11 @@ var f1 = () => { >() => { this.age = 10} : () => void this.age = 10 ->this.age = 10 : number +>this.age = 10 : 10 >this.age : any >this : any >age : any ->10 : number +>10 : 10 }; @@ -35,11 +35,11 @@ foo(() => { >() => { this.age = 100; return true;} : () => true this.age = 100; ->this.age = 100 : number +>this.age = 100 : 100 >this.age : any >this : any >age : any ->100 : number +>100 : 100 return true; >true : true diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types index a16b6391f020a..3c20bfd195cd2 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types @@ -4,11 +4,11 @@ var f1 = () => { >() => { this.age = 10} : () => void this.age = 10 ->this.age = 10 : number +>this.age = 10 : 10 >this.age : any >this : any >age : any ->10 : number +>10 : 10 }; @@ -35,11 +35,11 @@ foo(() => { >() => { this.age = 100; return true;} : () => true this.age = 100; ->this.age = 100 : number +>this.age = 100 : 100 >this.age : any >this : any >age : any ->100 : number +>100 : 100 return true; >true : true diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types index 669bf411e631d..6da6a224a6c9a 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types @@ -7,7 +7,7 @@ var a = () => { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } var b = function () { @@ -22,7 +22,7 @@ var b = function () { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } } @@ -36,7 +36,7 @@ function baz() { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } } @@ -53,7 +53,7 @@ foo(() => { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 }); @@ -64,7 +64,7 @@ function bar() { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } @@ -78,6 +78,6 @@ function bar() { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types index dd567d3bdcab7..cca819952534e 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types @@ -5,7 +5,7 @@ function f() { var _arguments = 10; >_arguments : number ->10 : number +>10 : 10 var a = () => () => arguments; >a : () => () => IArguments diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types index b977a77010ca0..5dddd8fba7ae4 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types @@ -6,7 +6,7 @@ function f(arguments) { var _arguments = 10; >_arguments : number ->10 : number +>10 : 10 var a = () => () => arguments; >a : () => () => IArguments diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types index 6e5a75553154e..82a027d2dc893 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types @@ -5,7 +5,7 @@ function f() { var _arguments = 10; >_arguments : number ->10 : number +>10 : 10 var a = (arguments) => () => _arguments; >a : (arguments: any) => () => number diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types index 294f5c692e43b..59b39a444e109 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types @@ -5,7 +5,7 @@ function f() { var _arguments = 10; >_arguments : number ->10 : number +>10 : 10 var a = (arguments) => () => _arguments; >a : (arguments: any) => () => number diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types index 29989ea0f9c4e..df47ed1789082 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types @@ -11,7 +11,7 @@ function f() { let arguments = 100; >arguments : number ->100 : number +>100 : 100 return () => arguments; >() => arguments : () => IArguments diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types index 0bb34b22eef2b..558aada282696 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types @@ -5,7 +5,7 @@ function f() { var arguments = "hello"; >arguments : string ->"hello" : string +>"hello" : "hello" if (Math.random()) { >Math.random() : number @@ -14,8 +14,8 @@ function f() { >random : () => number const arguments = 100; ->arguments : number ->100 : number +>arguments : 100 +>100 : 100 return () => arguments; >() => arguments : () => IArguments diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types index 41c6b87fb4262..bedbe3dc8b60a 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types @@ -5,7 +5,7 @@ function f() { var arguments = "hello"; >arguments : string ->"hello" : string +>"hello" : "hello" if (Math.random()) { >Math.random() : number @@ -17,9 +17,9 @@ function f() { >() => arguments[0] : () => any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } var arguments = "world"; >arguments : string ->"world" : string +>"world" : "world" } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types index f62a2dce84cea..223663bdb1b4e 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types @@ -7,7 +7,7 @@ function f() { >arguments : string >{ arguments: "hello" } : { arguments: string; } >arguments : string ->"hello" : string +>"hello" : "hello" if (Math.random()) { >Math.random() : number @@ -19,9 +19,9 @@ function f() { >() => arguments[0] : () => any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } var arguments = "world"; >arguments : string ->"world" : string +>"world" : "world" } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types index a672389720ae8..48d6f2e2935c1 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types @@ -8,7 +8,7 @@ function f() { var _arguments = 10; // No capture in 'g', so no conflict. >_arguments : number ->10 : number +>10 : 10 function h() { >h : () => void @@ -30,6 +30,6 @@ function f() { >x : any return 100; ->100 : number +>100 : 100 } } diff --git a/tests/baselines/reference/emitClassDeclarationOverloadInES6.types b/tests/baselines/reference/emitClassDeclarationOverloadInES6.types index 94cc2c88ddc31..1b5397eaf6349 100644 --- a/tests/baselines/reference/emitClassDeclarationOverloadInES6.types +++ b/tests/baselines/reference/emitClassDeclarationOverloadInES6.types @@ -19,5 +19,5 @@ class D { constructor(x: number, z="hello") {} >x : number >z : string ->"hello" : string +>"hello" : "hello" } diff --git a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types index 3bdf5af2ba553..f244efc274d3b 100644 --- a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types @@ -24,7 +24,7 @@ class B { x: string = "hello"; >x : string ->"hello" : string +>"hello" : "hello" _bar: string; >_bar : string @@ -32,15 +32,15 @@ class B { constructor(x: number, z = "hello", ...args) { >x : number >z : string ->"hello" : string +>"hello" : "hello" >args : any[] this.y = 10; ->this.y = 10 : number +>this.y = 10 : 10 >this.y : number >this : this >y : number ->10 : number +>10 : 10 } baz(...args): string; >baz : (...args: any[]) => string diff --git a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types index 7267af2fde057..7c95ac9b40ee5 100644 --- a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types @@ -6,7 +6,7 @@ class B { >baz : (a: string, y?: number) => void >a : string >y : number ->10 : number +>10 : 10 } class C extends B { >C : C @@ -57,8 +57,8 @@ class D extends C { >super.baz : (a: string, y: number) => void >super : C >baz : (a: string, y: number) => void ->"hello" : string ->10 : number +>"hello" : "hello" +>10 : 10 } } diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types index e4f7d6c00b47b..f251429937d9e 100644 --- a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types @@ -17,33 +17,33 @@ class C { >name2 : string return "BYE"; ->"BYE" : string +>"BYE" : "BYE" } static get ["computedname"]() { ->"computedname" : string +>"computedname" : "computedname" return ""; ->"" : string +>"" : "" } get ["computedname1"]() { ->"computedname1" : string +>"computedname1" : "computedname1" return ""; ->"" : string +>"" : "" } get ["computedname2"]() { ->"computedname2" : string +>"computedname2" : "computedname2" return ""; ->"" : string +>"" : "" } set ["computedname3"](x: any) { ->"computedname3" : string +>"computedname3" : "computedname3" >x : any } set ["computedname4"](y: string) { ->"computedname4" : string +>"computedname4" : "computedname4" >y : string } @@ -56,6 +56,6 @@ class C { >b : number static set ["computedname"](b: string) { } ->"computedname" : string +>"computedname" : "computedname" >b : string } diff --git a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types index d4bc18539ddcf..203d5071a155b 100644 --- a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types @@ -3,16 +3,16 @@ class B { >B : B "hello" = 10; ->10 : number +>10 : 10 0b110 = "world"; ->"world" : string +>"world" : "world" 0o23534 = "WORLD"; ->"WORLD" : string +>"WORLD" : "WORLD" 20 = "twenty"; ->"twenty" : string +>"twenty" : "twenty" "foo"() { } 0b1110() {} @@ -21,14 +21,14 @@ class B { >interface : () => void static "hi" = 10000; ->10000 : number +>10000 : 10000 static 22 = "twenty-two"; ->"twenty-two" : string +>"twenty-two" : "twenty-two" static 0b101 = "binary"; ->"binary" : string +>"binary" : "binary" static 0o3235 = "octal"; ->"octal" : string +>"octal" : "octal" } diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types index a42c019cd408c..10f0d4d2eef1c 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types @@ -9,16 +9,16 @@ class D { >foo : () => void ["computedName1"]() { } ->"computedName1" : string +>"computedName1" : "computedName1" ["computedName2"](a: string) { } ->"computedName2" : string +>"computedName2" : "computedName2" >a : string ["computedName3"](a: string): number { return 1; } ->"computedName3" : string +>"computedName3" : "computedName3" >a : string ->1 : number +>1 : 1 bar(): string { >bar : () => string @@ -34,17 +34,17 @@ class D { >x : string return "HELLO"; ->"HELLO" : string +>"HELLO" : "HELLO" } static ["computedname4"]() { } ->"computedname4" : string +>"computedname4" : "computedname4" static ["computedname5"](a: string) { } ->"computedname5" : string +>"computedname5" : "computedname5" >a : string static ["computedname6"](a: string): boolean { return true; } ->"computedname6" : string +>"computedname6" : "computedname6" >a : string >true : true @@ -54,8 +54,8 @@ class D { var x = 1 + 2; >x : number >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 return x >x : number @@ -67,5 +67,5 @@ class D { static bar(a: string): number { return 1; } >bar : (a: string) => number >a : string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types index 79899e77bee72..3455e3e5c5da3 100644 --- a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types @@ -4,7 +4,7 @@ class C { x: string = "Hello world"; >x : string ->"Hello world" : string +>"Hello world" : "Hello world" } class D { @@ -12,18 +12,18 @@ class D { x: string = "Hello world"; >x : string ->"Hello world" : string +>"Hello world" : "Hello world" y: number; >y : number constructor() { this.y = 10; ->this.y = 10 : number +>this.y = 10 : 10 >this.y : number >this : this >y : number ->10 : number +>10 : 10 } } @@ -53,10 +53,10 @@ class F extends D{ >super : typeof D this.j = "HI"; ->this.j = "HI" : string +>this.j = "HI" : "HI" >this.j : string >this : this >j : string ->"HI" : string +>"HI" : "HI" } } diff --git a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types index 58d328e3e5d76..cd28711990975 100644 --- a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types @@ -4,7 +4,7 @@ class C { static z: string = "Foo"; >z : string ->"Foo" : string +>"Foo" : "Foo" } class D { @@ -12,10 +12,10 @@ class D { x = 20000; >x : number ->20000 : number +>20000 : 20000 static b = true; >b : boolean ->true : boolean +>true : true } diff --git a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types index 7c0159fbd6323..bdf57efcb0f5f 100644 --- a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types @@ -4,15 +4,15 @@ class B { x = 10; >x : number ->10 : number +>10 : 10 constructor() { this.x = 10; ->this.x = 10 : number +>this.x = 10 : 10 >this.x : number >this : this >x : number ->10 : number +>10 : 10 } static log(a: number) { } >log : (a: number) => void diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types index 393499a931f7d..ddb10cc9447f9 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types @@ -3,13 +3,13 @@ var array0 = [1, 2, 3] >array0 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var i0 = 0; >i0 : number ->0 : number +>0 : 0 array0[++i0] **= 2; >array0[++i0] **= 2 : number @@ -17,18 +17,18 @@ array0[++i0] **= 2; >array0 : number[] >++i0 : number >i0 : number ->2 : number +>2 : 2 var array1 = [1, 2, 3] >array1 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var i1 = 0; >i1 : number ->0 : number +>0 : 0 array1[++i1] **= array1[++i1] **= 2; >array1[++i1] **= array1[++i1] **= 2 : number @@ -41,18 +41,18 @@ array1[++i1] **= array1[++i1] **= 2; >array1 : number[] >++i1 : number >i1 : number ->2 : number +>2 : 2 var array2 = [1, 2, 3] >array2 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var i2 = 0; >i2 : number ->0 : number +>0 : 0 array2[++i2] **= array2[++i2] ** 2; >array2[++i2] **= array2[++i2] ** 2 : number @@ -65,20 +65,20 @@ array2[++i2] **= array2[++i2] ** 2; >array2 : number[] >++i2 : number >i2 : number ->2 : number +>2 : 2 var array3 = [2, 2, 3]; >array3 : number[] >[2, 2, 3] : number[] ->2 : number ->2 : number ->3 : number +>2 : 2 +>2 : 2 +>3 : 3 var j0 = 0, j1 = 1; >j0 : number ->0 : number +>0 : 0 >j1 : number ->1 : number +>1 : 1 array3[j0++] **= array3[j1++] **= array3[j0++] **= 1; >array3[j0++] **= array3[j1++] **= array3[j0++] **= 1 : number @@ -96,5 +96,5 @@ array3[j0++] **= array3[j1++] **= array3[j0++] **= 1; >array3 : number[] >j0++ : number >j0 : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types index c47f539baf203..cd057d31390c3 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts === var globalCounter = 0; >globalCounter : number ->0 : number +>0 : 0 function foo() { >foo : () => { 0: number; } @@ -9,22 +9,22 @@ function foo() { globalCounter += 1; >globalCounter += 1 : number >globalCounter : number ->1 : number +>1 : 1 return { 0: 2 }; >{ 0: 2 } : { 0: number; } ->2 : number +>2 : 2 } foo()[0] **= foo()[0]; >foo()[0] **= foo()[0] : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 var result_foo1 = foo()[0] **= foo()[0]; >result_foo1 : number @@ -32,24 +32,24 @@ var result_foo1 = foo()[0] **= foo()[0]; >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 foo()[0] **= foo()[0] **= 2; >foo()[0] **= foo()[0] **= 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] **= 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 var result_foo2 = foo()[0] **= foo()[0] **= 2; >result_foo2 : number @@ -57,26 +57,26 @@ var result_foo2 = foo()[0] **= foo()[0] **= 2; >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] **= 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 foo()[0] **= foo()[0] ** 2; >foo()[0] **= foo()[0] ** 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] ** 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 var result_foo3 = foo()[0] **= foo()[0] ** 2; >result_foo3 : number @@ -84,11 +84,11 @@ var result_foo3 = foo()[0] **= foo()[0] ** 2; >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] ** 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types index 1877f3912070c..94a5f2173aa24 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types @@ -6,7 +6,7 @@ var object = { _0: 2, >_0 : number ->2 : number +>2 : 2 get 0() { return this._0; @@ -31,30 +31,30 @@ object[0] **= object[0]; >object[0] **= object[0] : number >object[0] : number >object : { 0: number; _0: number; } ->0 : number +>0 : 0 >object[0] : number >object : { 0: number; _0: number; } ->0 : number +>0 : 0 object[0] **= object[0] **= 2; >object[0] **= object[0] **= 2 : number >object[0] : number >object : { 0: number; _0: number; } ->0 : number +>0 : 0 >object[0] **= 2 : number >object[0] : number >object : { 0: number; _0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 object[0] **= object[0] ** 2; >object[0] **= object[0] ** 2 : number >object[0] : number >object : { 0: number; _0: number; } ->0 : number +>0 : 0 >object[0] ** 2 : number >object[0] : number >object : { 0: number; _0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types index abfc69d7ca61c..fec095dc6964e 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types @@ -2,7 +2,7 @@ var globalCounter = 0; >globalCounter : number ->0 : number +>0 : 0 function incrementIdx(max: number) { >incrementIdx : (max: number) => number @@ -11,7 +11,7 @@ function incrementIdx(max: number) { globalCounter += 1; >globalCounter += 1 : number >globalCounter : number ->1 : number +>1 : 1 let idx = Math.floor(Math.random() * max); >idx : number @@ -33,11 +33,11 @@ function incrementIdx(max: number) { var array1 = [1, 2, 3, 4, 5]; >array1 : number[] >[1, 2, 3, 4, 5] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 array1[incrementIdx(array1.length)] **= 3; >array1[incrementIdx(array1.length)] **= 3 : number @@ -48,7 +48,7 @@ array1[incrementIdx(array1.length)] **= 3; >array1.length : number >array1 : number[] >length : number ->3 : number +>3 : 3 array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2; >array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2 : number @@ -67,7 +67,7 @@ array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= >array1.length : number >array1 : number[] >length : number ->2 : number +>2 : 2 array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2; >array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2 : number @@ -86,5 +86,5 @@ array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2 >array1.length : number >array1 : number[] >length : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types index b57878e9443e0..1a8a29bae9b2b 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types @@ -2,7 +2,7 @@ var globalCounter = 0; >globalCounter : number ->0 : number +>0 : 0 function foo() { >foo : () => { prop: number; } @@ -10,12 +10,12 @@ function foo() { globalCounter += 1; >globalCounter += 1 : number >globalCounter : number ->1 : number +>1 : 1 return { prop: 2 }; >{ prop: 2 } : { prop: number; } >prop : number ->2 : number +>2 : 2 } foo().prop **= 2; >foo().prop **= 2 : number @@ -23,7 +23,7 @@ foo().prop **= 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 var result0 = foo().prop **= 2; >result0 : number @@ -32,7 +32,7 @@ var result0 = foo().prop **= 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 foo().prop **= foo().prop **= 2; >foo().prop **= foo().prop **= 2 : number @@ -45,7 +45,7 @@ foo().prop **= foo().prop **= 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 var result1 = foo().prop **= foo().prop **= 2; >result1 : number @@ -59,7 +59,7 @@ var result1 = foo().prop **= foo().prop **= 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 foo().prop **= foo().prop ** 2; >foo().prop **= foo().prop ** 2 : number @@ -72,7 +72,7 @@ foo().prop **= foo().prop ** 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 var result2 = foo().prop **= foo().prop ** 2; >result2 : number @@ -86,5 +86,5 @@ var result2 = foo().prop **= foo().prop ** 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1.types b/tests/baselines/reference/emitCompoundExponentiationOperator1.types index a1c986dbb7837..6a4a5b5bab92f 100644 --- a/tests/baselines/reference/emitCompoundExponentiationOperator1.types +++ b/tests/baselines/reference/emitCompoundExponentiationOperator1.types @@ -6,7 +6,7 @@ var comp: number; comp **= 1; >comp **= 1 : number >comp : number ->1 : number +>1 : 1 comp **= comp ** comp; >comp **= comp ** comp : number @@ -22,7 +22,7 @@ comp **= comp ** comp ** 2; >comp : number >comp ** 2 : number >comp : number ->2 : number +>2 : 2 comp **= comp ** comp + 2; >comp **= comp ** comp + 2 : number @@ -31,7 +31,7 @@ comp **= comp ** comp + 2; >comp ** comp : number >comp : number >comp : number ->2 : number +>2 : 2 comp **= comp ** comp - 2; >comp **= comp ** comp - 2 : number @@ -40,7 +40,7 @@ comp **= comp ** comp - 2; >comp ** comp : number >comp : number >comp : number ->2 : number +>2 : 2 comp **= comp ** comp * 2; >comp **= comp ** comp * 2 : number @@ -49,7 +49,7 @@ comp **= comp ** comp * 2; >comp ** comp : number >comp : number >comp : number ->2 : number +>2 : 2 comp **= comp ** comp / 2; >comp **= comp ** comp / 2 : number @@ -58,7 +58,7 @@ comp **= comp ** comp / 2; >comp ** comp : number >comp : number >comp : number ->2 : number +>2 : 2 comp **= comp ** comp % 2; >comp **= comp ** comp % 2 : number @@ -67,7 +67,7 @@ comp **= comp ** comp % 2; >comp ** comp : number >comp : number >comp : number ->2 : number +>2 : 2 comp **= (comp - 2) ** 5; >comp **= (comp - 2) ** 5 : number @@ -76,8 +76,8 @@ comp **= (comp - 2) ** 5; >(comp - 2) : number >comp - 2 : number >comp : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= (comp + 2) ** 5; >comp **= (comp + 2) ** 5 : number @@ -86,8 +86,8 @@ comp **= (comp + 2) ** 5; >(comp + 2) : number >comp + 2 : number >comp : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= (comp * 2) ** 5; >comp **= (comp * 2) ** 5 : number @@ -96,8 +96,8 @@ comp **= (comp * 2) ** 5; >(comp * 2) : number >comp * 2 : number >comp : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= (comp / 2) ** 5; >comp **= (comp / 2) ** 5 : number @@ -106,8 +106,8 @@ comp **= (comp / 2) ** 5; >(comp / 2) : number >comp / 2 : number >comp : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= (comp % 2) ** 5; >comp **= (comp % 2) ** 5 : number @@ -116,8 +116,8 @@ comp **= (comp % 2) ** 5; >(comp % 2) : number >comp % 2 : number >comp : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= comp ** (5 + 2); >comp **= comp ** (5 + 2) : number @@ -126,8 +126,8 @@ comp **= comp ** (5 + 2); >comp : number >(5 + 2) : number >5 + 2 : number ->5 : number ->2 : number +>5 : 5 +>2 : 2 comp **= comp ** (5 - 2); >comp **= comp ** (5 - 2) : number @@ -136,8 +136,8 @@ comp **= comp ** (5 - 2); >comp : number >(5 - 2) : number >5 - 2 : number ->5 : number ->2 : number +>5 : 5 +>2 : 2 comp **= comp ** (5 * 2); >comp **= comp ** (5 * 2) : number @@ -146,8 +146,8 @@ comp **= comp ** (5 * 2); >comp : number >(5 * 2) : number >5 * 2 : number ->5 : number ->2 : number +>5 : 5 +>2 : 2 comp **= comp ** (5 / 2); >comp **= comp ** (5 / 2) : number @@ -156,8 +156,8 @@ comp **= comp ** (5 / 2); >comp : number >(5 / 2) : number >5 / 2 : number ->5 : number ->2 : number +>5 : 5 +>2 : 2 comp **= comp ** (5 % 2); >comp **= comp ** (5 % 2) : number @@ -166,6 +166,6 @@ comp **= comp ** (5 % 2); >comp : number >(5 % 2) : number >5 % 2 : number ->5 : number ->2 : number +>5 : 5 +>2 : 2 diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2.types b/tests/baselines/reference/emitCompoundExponentiationOperator2.types index 03ca9b0662612..f715a9593f204 100644 --- a/tests/baselines/reference/emitCompoundExponentiationOperator2.types +++ b/tests/baselines/reference/emitCompoundExponentiationOperator2.types @@ -6,14 +6,14 @@ var comp: number; comp **= 1; >comp **= 1 : number >comp : number ->1 : number +>1 : 1 comp **= comp **= 1; >comp **= comp **= 1 : number >comp : number >comp **= 1 : number >comp : number ->1 : number +>1 : 1 comp **= comp **= 1 + 2; >comp **= comp **= 1 + 2 : number @@ -21,8 +21,8 @@ comp **= comp **= 1 + 2; >comp **= 1 + 2 : number >comp : number >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= 1 - 2; >comp **= comp **= 1 - 2 : number @@ -30,8 +30,8 @@ comp **= comp **= 1 - 2; >comp **= 1 - 2 : number >comp : number >1 - 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= 1 * 2; >comp **= comp **= 1 * 2 : number @@ -39,8 +39,8 @@ comp **= comp **= 1 * 2; >comp **= 1 * 2 : number >comp : number >1 * 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= 1 / 2; >comp **= comp **= 1 / 2 : number @@ -48,8 +48,8 @@ comp **= comp **= 1 / 2; >comp **= 1 / 2 : number >comp : number >1 / 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= (1 + 2); >comp **= comp **= (1 + 2) : number @@ -58,8 +58,8 @@ comp **= comp **= (1 + 2); >comp : number >(1 + 2) : number >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= (1 - 2); >comp **= comp **= (1 - 2) : number @@ -68,8 +68,8 @@ comp **= comp **= (1 - 2); >comp : number >(1 - 2) : number >1 - 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= (1 * 2); >comp **= comp **= (1 * 2) : number @@ -78,8 +78,8 @@ comp **= comp **= (1 * 2); >comp : number >(1 * 2) : number >1 * 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= (1 / 2); >comp **= comp **= (1 / 2) : number @@ -88,8 +88,8 @@ comp **= comp **= (1 / 2); >comp : number >(1 / 2) : number >1 / 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= 1 + 2 ** 3; >comp **= comp **= 1 + 2 ** 3 : number @@ -97,10 +97,10 @@ comp **= comp **= 1 + 2 ** 3; >comp **= 1 + 2 ** 3 : number >comp : number >1 + 2 ** 3 : number ->1 : number +>1 : 1 >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 comp **= comp **= 1 - 2 ** 4; >comp **= comp **= 1 - 2 ** 4 : number @@ -108,10 +108,10 @@ comp **= comp **= 1 - 2 ** 4; >comp **= 1 - 2 ** 4 : number >comp : number >1 - 2 ** 4 : number ->1 : number +>1 : 1 >2 ** 4 : number ->2 : number ->4 : number +>2 : 2 +>4 : 4 comp **= comp **= 1 * 2 ** 5; >comp **= comp **= 1 * 2 ** 5 : number @@ -119,10 +119,10 @@ comp **= comp **= 1 * 2 ** 5; >comp **= 1 * 2 ** 5 : number >comp : number >1 * 2 ** 5 : number ->1 : number +>1 : 1 >2 ** 5 : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= comp **= 1 / 2 ** 6; >comp **= comp **= 1 / 2 ** 6 : number @@ -130,10 +130,10 @@ comp **= comp **= 1 / 2 ** 6; >comp **= 1 / 2 ** 6 : number >comp : number >1 / 2 ** 6 : number ->1 : number +>1 : 1 >2 ** 6 : number ->2 : number ->6 : number +>2 : 2 +>6 : 6 comp **= comp **= (1 + 2) ** 3; >comp **= comp **= (1 + 2) ** 3 : number @@ -143,9 +143,9 @@ comp **= comp **= (1 + 2) ** 3; >(1 + 2) ** 3 : number >(1 + 2) : number >1 + 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 comp **= comp **= (1 - 2) ** 4; >comp **= comp **= (1 - 2) ** 4 : number @@ -155,9 +155,9 @@ comp **= comp **= (1 - 2) ** 4; >(1 - 2) ** 4 : number >(1 - 2) : number >1 - 2 : number ->1 : number ->2 : number ->4 : number +>1 : 1 +>2 : 2 +>4 : 4 comp **= comp **= (1 * 2) ** 5; >comp **= comp **= (1 * 2) ** 5 : number @@ -167,9 +167,9 @@ comp **= comp **= (1 * 2) ** 5; >(1 * 2) ** 5 : number >(1 * 2) : number >1 * 2 : number ->1 : number ->2 : number ->5 : number +>1 : 1 +>2 : 2 +>5 : 5 comp **= comp **= (1 / 2) ** 6; >comp **= comp **= (1 / 2) ** 6 : number @@ -179,7 +179,7 @@ comp **= comp **= (1 / 2) ** 6; >(1 / 2) ** 6 : number >(1 / 2) : number >1 / 2 : number ->1 : number ->2 : number ->6 : number +>1 : 1 +>2 : 2 +>6 : 6 diff --git a/tests/baselines/reference/emitDefaultParametersFunction.types b/tests/baselines/reference/emitDefaultParametersFunction.types index 5c27d3ddf3d88..d043a6c2b2f85 100644 --- a/tests/baselines/reference/emitDefaultParametersFunction.types +++ b/tests/baselines/reference/emitDefaultParametersFunction.types @@ -3,23 +3,23 @@ function foo(x: string, y = 10) { } >foo : (x: string, y?: number) => void >x : string >y : number ->10 : number +>10 : 10 function baz(x: string, y = 5, ...rest) { } >baz : (x: string, y?: number, ...rest: any[]) => void >x : string >y : number ->5 : number +>5 : 5 >rest : any[] function bar(y = 10) { } >bar : (y?: number) => void >y : number ->10 : number +>10 : 10 function bar1(y = 10, ...rest) { } >bar1 : (y?: number, ...rest: any[]) => void >y : number ->10 : number +>10 : 10 >rest : any[] diff --git a/tests/baselines/reference/emitDefaultParametersFunctionES6.types b/tests/baselines/reference/emitDefaultParametersFunctionES6.types index e3124c75333bb..c5a3b8d2d3fe2 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionES6.types @@ -3,23 +3,23 @@ function foo(x: string, y = 10) { } >foo : (x: string, y?: number) => void >x : string >y : number ->10 : number +>10 : 10 function baz(x: string, y = 5, ...rest) { } >baz : (x: string, y?: number, ...rest: any[]) => void >x : string >y : number ->5 : number +>5 : 5 >rest : any[] function bar(y = 10) { } >bar : (y?: number) => void >y : number ->10 : number +>10 : 10 function bar1(y = 10, ...rest) { } >bar1 : (y?: number, ...rest: any[]) => void >y : number ->10 : number +>10 : 10 >rest : any[] diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpression.types b/tests/baselines/reference/emitDefaultParametersFunctionExpression.types index 61ba3200e36a0..7546bda0d4169 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionExpression.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpression.types @@ -3,35 +3,35 @@ var lambda1 = (y = "hello") => { } >lambda1 : (y?: string) => void >(y = "hello") => { } : (y?: string) => void >y : string ->"hello" : string +>"hello" : "hello" var lambda2 = (x: number, y = "hello") => { } >lambda2 : (x: number, y?: string) => void >(x: number, y = "hello") => { } : (x: number, y?: string) => void >x : number >y : string ->"hello" : string +>"hello" : "hello" var lambda3 = (x: number, y = "hello", ...rest) => { } >lambda3 : (x: number, y?: string, ...rest: any[]) => void >(x: number, y = "hello", ...rest) => { } : (x: number, y?: string, ...rest: any[]) => void >x : number >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] var lambda4 = (y = "hello", ...rest) => { } >lambda4 : (y?: string, ...rest: any[]) => void >(y = "hello", ...rest) => { } : (y?: string, ...rest: any[]) => void >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] var x = function (str = "hello", ...rest) { } >x : (str?: string, ...rest: any[]) => void >function (str = "hello", ...rest) { } : (str?: string, ...rest: any[]) => void >str : string ->"hello" : string +>"hello" : "hello" >rest : any[] var y = (function (num = 10, boo = false, ...rest) { })() @@ -40,9 +40,9 @@ var y = (function (num = 10, boo = false, ...rest) { })() >(function (num = 10, boo = false, ...rest) { }) : (num?: number, boo?: boolean, ...rest: any[]) => void >function (num = 10, boo = false, ...rest) { } : (num?: number, boo?: boolean, ...rest: any[]) => void >num : number ->10 : number +>10 : 10 >boo : boolean ->false : boolean +>false : false >rest : any[] var z = (function (num: number, boo = false, ...rest) { })(10) @@ -52,7 +52,7 @@ var z = (function (num: number, boo = false, ...rest) { })(10) >function (num: number, boo = false, ...rest) { } : (num: number, boo?: boolean, ...rest: any[]) => void >num : number >boo : boolean ->false : boolean +>false : false >rest : any[] ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types index 76f2c863a26e8..99ab6a481378c 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types @@ -3,35 +3,35 @@ var lambda1 = (y = "hello") => { } >lambda1 : (y?: string) => void >(y = "hello") => { } : (y?: string) => void >y : string ->"hello" : string +>"hello" : "hello" var lambda2 = (x: number, y = "hello") => { } >lambda2 : (x: number, y?: string) => void >(x: number, y = "hello") => { } : (x: number, y?: string) => void >x : number >y : string ->"hello" : string +>"hello" : "hello" var lambda3 = (x: number, y = "hello", ...rest) => { } >lambda3 : (x: number, y?: string, ...rest: any[]) => void >(x: number, y = "hello", ...rest) => { } : (x: number, y?: string, ...rest: any[]) => void >x : number >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] var lambda4 = (y = "hello", ...rest) => { } >lambda4 : (y?: string, ...rest: any[]) => void >(y = "hello", ...rest) => { } : (y?: string, ...rest: any[]) => void >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] var x = function (str = "hello", ...rest) { } >x : (str?: string, ...rest: any[]) => void >function (str = "hello", ...rest) { } : (str?: string, ...rest: any[]) => void >str : string ->"hello" : string +>"hello" : "hello" >rest : any[] var y = (function (num = 10, boo = false, ...rest) { })() @@ -40,9 +40,9 @@ var y = (function (num = 10, boo = false, ...rest) { })() >(function (num = 10, boo = false, ...rest) { }) : (num?: number, boo?: boolean, ...rest: any[]) => void >function (num = 10, boo = false, ...rest) { } : (num?: number, boo?: boolean, ...rest: any[]) => void >num : number ->10 : number +>10 : 10 >boo : boolean ->false : boolean +>false : false >rest : any[] var z = (function (num: number, boo = false, ...rest) { })(10) @@ -52,7 +52,7 @@ var z = (function (num: number, boo = false, ...rest) { })(10) >function (num: number, boo = false, ...rest) { } : (num: number, boo?: boolean, ...rest: any[]) => void >num : number >boo : boolean ->false : boolean +>false : false >rest : any[] ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/emitDefaultParametersFunctionProperty.types b/tests/baselines/reference/emitDefaultParametersFunctionProperty.types index 8a703fd114feb..d26281d8eb6fb 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionProperty.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionProperty.types @@ -6,27 +6,27 @@ var obj2 = { func1(y = 10, ...rest) { }, >func1 : (y?: number, ...rest: any[]) => void >y : number ->10 : number +>10 : 10 >rest : any[] func2(x = "hello") { }, >func2 : (x?: string) => void >x : string ->"hello" : string +>"hello" : "hello" func3(x: string, z: number, y = "hello") { }, >func3 : (x: string, z: number, y?: string) => void >x : string >z : number >y : string ->"hello" : string +>"hello" : "hello" func4(x: string, z: number, y = "hello", ...rest) { }, >func4 : (x: string, z: number, y?: string, ...rest: any[]) => void >x : string >z : number >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types index 1edd505c0b51b..5f693b65ac594 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types @@ -6,26 +6,26 @@ var obj2 = { func1(y = 10, ...rest) { }, >func1 : (y?: number, ...rest: any[]) => void >y : number ->10 : number +>10 : 10 >rest : any[] func2(x = "hello") { }, >func2 : (x?: string) => void >x : string ->"hello" : string +>"hello" : "hello" func3(x: string, z: number, y = "hello") { }, >func3 : (x: string, z: number, y?: string) => void >x : string >z : number >y : string ->"hello" : string +>"hello" : "hello" func4(x: string, z: number, y = "hello", ...rest) { }, >func4 : (x: string, z: number, y?: string, ...rest: any[]) => void >x : string >z : number >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersMethod.types b/tests/baselines/reference/emitDefaultParametersMethod.types index ce7dd2542fa7e..03193baa528a0 100644 --- a/tests/baselines/reference/emitDefaultParametersMethod.types +++ b/tests/baselines/reference/emitDefaultParametersMethod.types @@ -7,30 +7,30 @@ class C { >z : string >x : number >y : string ->"hello" : string +>"hello" : "hello" public foo(x: string, t = false) { } >foo : (x: string, t?: boolean) => void >x : string >t : boolean ->false : boolean +>false : false public foo1(x: string, t = false, ...rest) { } >foo1 : (x: string, t?: boolean, ...rest: any[]) => void >x : string >t : boolean ->false : boolean +>false : false >rest : any[] public bar(t = false) { } >bar : (t?: boolean) => void >t : boolean ->false : boolean +>false : false public boo(t = false, ...rest) { } >boo : (t?: boolean, ...rest: any[]) => void >t : boolean ->false : boolean +>false : false >rest : any[] } @@ -39,7 +39,7 @@ class D { constructor(y = "hello") { } >y : string ->"hello" : string +>"hello" : "hello" } class E { @@ -47,7 +47,7 @@ class E { constructor(y = "hello", ...rest) { } >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersMethodES6.types b/tests/baselines/reference/emitDefaultParametersMethodES6.types index 09096d153bf19..be54cd9b27c3c 100644 --- a/tests/baselines/reference/emitDefaultParametersMethodES6.types +++ b/tests/baselines/reference/emitDefaultParametersMethodES6.types @@ -7,30 +7,30 @@ class C { >z : string >x : number >y : string ->"hello" : string +>"hello" : "hello" public foo(x: string, t = false) { } >foo : (x: string, t?: boolean) => void >x : string >t : boolean ->false : boolean +>false : false public foo1(x: string, t = false, ...rest) { } >foo1 : (x: string, t?: boolean, ...rest: any[]) => void >x : string >t : boolean ->false : boolean +>false : false >rest : any[] public bar(t = false) { } >bar : (t?: boolean) => void >t : boolean ->false : boolean +>false : false public boo(t = false, ...rest) { } >boo : (t?: boolean, ...rest: any[]) => void >t : boolean ->false : boolean +>false : false >rest : any[] } @@ -39,7 +39,7 @@ class D { constructor(y = "hello") { } >y : string ->"hello" : string +>"hello" : "hello" } class E { @@ -47,6 +47,6 @@ class E { constructor(y = "hello", ...rest) { } >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] } diff --git a/tests/baselines/reference/emitExponentiationOperator1.types b/tests/baselines/reference/emitExponentiationOperator1.types index a2dc4f1690133..9db01d34f2267 100644 --- a/tests/baselines/reference/emitExponentiationOperator1.types +++ b/tests/baselines/reference/emitExponentiationOperator1.types @@ -2,45 +2,45 @@ 1 ** -2; >1 ** -2 : number ->1 : number ->-2 : number ->2 : number +>1 : 1 +>-2 : -2 +>2 : 2 1 ** 2; >1 ** 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 (-1) ** 2 >(-1) ** 2 : number ->(-1) : number ->-1 : number ->1 : number ->2 : number +>(-1) : -1 +>-1 : -1 +>1 : 1 +>2 : 2 1 ** 2 ** 3; >1 ** 2 ** 3 : number ->1 : number +>1 : 1 >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 1 ** 2 ** -3; >1 ** 2 ** -3 : number ->1 : number +>1 : 1 >2 ** -3 : number ->2 : number ->-3 : number ->3 : number +>2 : 2 +>-3 : -3 +>3 : 3 1 ** -(2 ** 3); >1 ** -(2 ** 3) : number ->1 : number +>1 : 1 >-(2 ** 3) : number >(2 ** 3) : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 (-(1 ** 2)) ** 3; >(-(1 ** 2)) ** 3 : number @@ -48,9 +48,9 @@ >-(1 ** 2) : number >(1 ** 2) : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 (-(1 ** 2)) ** -3; >(-(1 ** 2)) ** -3 : number @@ -58,150 +58,150 @@ >-(1 ** 2) : number >(1 ** 2) : number >1 ** 2 : number ->1 : number ->2 : number ->-3 : number ->3 : number +>1 : 1 +>2 : 2 +>-3 : -3 +>3 : 3 1 ** 2 + 3; >1 ** 2 + 3 : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 ** 2 - 3; >1 ** 2 - 3 : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 ** 2 * 3; >1 ** 2 * 3 : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 ** 2 / 3; >1 ** 2 / 3 : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 ** 2 % 3; >1 ** 2 % 3 : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 ** -2 + 3; >1 ** -2 + 3 : number >1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number +>1 : 1 +>-2 : -2 +>2 : 2 +>3 : 3 1 ** -2 - 3; >1 ** -2 - 3 : number >1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number +>1 : 1 +>-2 : -2 +>2 : 2 +>3 : 3 1 ** -2 * 3; >1 ** -2 * 3 : number >1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number +>1 : 1 +>-2 : -2 +>2 : 2 +>3 : 3 1 ** -2 / 3; >1 ** -2 / 3 : number >1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number +>1 : 1 +>-2 : -2 +>2 : 2 +>3 : 3 1 ** -2 % 3; >1 ** -2 % 3 : number >1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number +>1 : 1 +>-2 : -2 +>2 : 2 +>3 : 3 2 + 3 ** 3; >2 + 3 ** 3 : number ->2 : number +>2 : 2 >3 ** 3 : number ->3 : number ->3 : number +>3 : 3 +>3 : 3 2 - 3 ** 3; >2 - 3 ** 3 : number ->2 : number +>2 : 2 >3 ** 3 : number ->3 : number ->3 : number +>3 : 3 +>3 : 3 2 * 3 ** 3; >2 * 3 ** 3 : number ->2 : number +>2 : 2 >3 ** 3 : number ->3 : number ->3 : number +>3 : 3 +>3 : 3 2 / 3 ** 3; >2 / 3 ** 3 : number ->2 : number +>2 : 2 >3 ** 3 : number ->3 : number ->3 : number +>3 : 3 +>3 : 3 2 % 3 ** 3; >2 % 3 ** 3 : number ->2 : number +>2 : 2 >3 ** 3 : number ->3 : number ->3 : number +>3 : 3 +>3 : 3 (2 + 3) ** 4; >(2 + 3) ** 4 : number >(2 + 3) : number >2 + 3 : number ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 (2 - 3) ** 4; >(2 - 3) ** 4 : number >(2 - 3) : number >2 - 3 : number ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 (2 * 3) ** 4; >(2 * 3) ** 4 : number >(2 * 3) : number >2 * 3 : number ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 (2 / 3) ** 4; >(2 / 3) ** 4 : number >(2 / 3) : number >2 / 3 : number ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 diff --git a/tests/baselines/reference/emitExponentiationOperator2.types b/tests/baselines/reference/emitExponentiationOperator2.types index cd8773624a7b7..b2936f6acef64 100644 --- a/tests/baselines/reference/emitExponentiationOperator2.types +++ b/tests/baselines/reference/emitExponentiationOperator2.types @@ -2,31 +2,31 @@ var temp = 10; >temp : number ->10 : number +>10 : 10 ++temp ** 3; >++temp ** 3 : number >++temp : number >temp : number ->3 : number +>3 : 3 --temp ** 3; >--temp ** 3 : number >--temp : number >temp : number ->3 : number +>3 : 3 temp++ ** 3; >temp++ ** 3 : number >temp++ : number >temp : number ->3 : number +>3 : 3 temp-- ** 3; >temp-- ** 3 : number >temp-- : number >temp : number ->3 : number +>3 : 3 --temp + temp ** 3; >--temp + temp ** 3 : number @@ -34,7 +34,7 @@ temp-- ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 --temp - temp ** 3; >--temp - temp ** 3 : number @@ -42,7 +42,7 @@ temp-- ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 --temp * temp ** 3; >--temp * temp ** 3 : number @@ -50,7 +50,7 @@ temp-- ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 --temp / temp ** 3; >--temp / temp ** 3 : number @@ -58,7 +58,7 @@ temp-- ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 --temp % temp ** 3; >--temp % temp ** 3 : number @@ -66,19 +66,19 @@ temp-- ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 temp-- ** 3; >temp-- ** 3 : number >temp-- : number >temp : number ->3 : number +>3 : 3 temp++ ** 3; >temp++ ** 3 : number >temp++ : number >temp : number ->3 : number +>3 : 3 temp-- ** -temp; >temp-- ** -temp : number @@ -100,7 +100,7 @@ temp-- + temp ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 temp-- - temp ** 3; >temp-- - temp ** 3 : number @@ -108,7 +108,7 @@ temp-- - temp ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 temp-- * temp ** 3; >temp-- * temp ** 3 : number @@ -116,7 +116,7 @@ temp-- * temp ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 temp-- / temp ** 3; >temp-- / temp ** 3 : number @@ -124,7 +124,7 @@ temp-- / temp ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 temp-- % temp ** 3; >temp-- % temp ** 3 : number @@ -132,213 +132,213 @@ temp-- % temp ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 --temp + 2 ** 3; >--temp + 2 ** 3 : number >--temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 --temp - 2 ** 3; >--temp - 2 ** 3 : number >--temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 --temp * 2 ** 3; >--temp * 2 ** 3 : number >--temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 --temp / 2 ** 3; >--temp / 2 ** 3 : number >--temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 --temp % 2 ** 3; >--temp % 2 ** 3 : number >--temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 ++temp + 2 ** 3; >++temp + 2 ** 3 : number >++temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 ++temp - 2 ** 3; >++temp - 2 ** 3 : number >++temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 ++temp * 2 ** 3; >++temp * 2 ** 3 : number >++temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 ++temp / 2 ** 3; >++temp / 2 ** 3 : number >++temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 3 ** ++temp; >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number 3 ** --temp; >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number 3 ** temp++; >3 ** temp++ : number ->3 : number +>3 : 3 >temp++ : number >temp : number 3 ** temp--; >3 ** temp-- : number ->3 : number +>3 : 3 >temp-- : number >temp : number 3 ** ++temp ** 2; >3 ** ++temp ** 2 : number ->3 : number +>3 : 3 >++temp ** 2 : number >++temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp ** 2; >3 ** --temp ** 2 : number ->3 : number +>3 : 3 >--temp ** 2 : number >--temp : number >temp : number ->2 : number +>2 : 2 3 ** temp++ ** 2; >3 ** temp++ ** 2 : number ->3 : number +>3 : 3 >temp++ ** 2 : number >temp++ : number >temp : number ->2 : number +>2 : 2 3 ** temp-- ** 2; >3 ** temp-- ** 2 : number ->3 : number +>3 : 3 >temp-- ** 2 : number >temp-- : number >temp : number ->2 : number +>2 : 2 3 ** ++temp + 2; >3 ** ++temp + 2 : number >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number ->2 : number +>2 : 2 3 ** ++temp - 2; >3 ** ++temp - 2 : number >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number ->2 : number +>2 : 2 3 ** ++temp * 2; >3 ** ++temp * 2 : number >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number ->2 : number +>2 : 2 3 ** ++temp / 2; >3 ** ++temp / 2 : number >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number ->2 : number +>2 : 2 3 ** ++temp % 2; >3 ** ++temp % 2 : number >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp + 2; >3 ** --temp + 2 : number >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp - 2; >3 ** --temp - 2 : number >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp * 2; >3 ** --temp * 2 : number >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp / 2; >3 ** --temp / 2 : number >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp % 2; >3 ** --temp % 2 : number >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/emitExponentiationOperator3.types b/tests/baselines/reference/emitExponentiationOperator3.types index cc4c5374d05ee..38bb5a0895c56 100644 --- a/tests/baselines/reference/emitExponentiationOperator3.types +++ b/tests/baselines/reference/emitExponentiationOperator3.types @@ -2,7 +2,7 @@ var temp = 10; >temp : number ->10 : number +>10 : 10 (-++temp) ** 3; >(-++temp) ** 3 : number @@ -10,7 +10,7 @@ var temp = 10; >-++temp : number >++temp : number >temp : number ->3 : number +>3 : 3 (+--temp) ** 3; >(+--temp) ** 3 : number @@ -18,7 +18,7 @@ var temp = 10; >+--temp : number >--temp : number >temp : number ->3 : number +>3 : 3 (-temp++) ** 3; >(-temp++) ** 3 : number @@ -26,7 +26,7 @@ var temp = 10; >-temp++ : number >temp++ : number >temp : number ->3 : number +>3 : 3 (+temp--) ** 3; >(+temp--) ** 3 : number @@ -34,7 +34,7 @@ var temp = 10; >+temp-- : number >temp-- : number >temp : number ->3 : number +>3 : 3 (-(1 ** ++temp)) ** 3; >(-(1 ** ++temp)) ** 3 : number @@ -42,10 +42,10 @@ var temp = 10; >-(1 ** ++temp) : number >(1 ** ++temp) : number >1 ** ++temp : number ->1 : number +>1 : 1 >++temp : number >temp : number ->3 : number +>3 : 3 (-(1 ** --temp)) ** 3; >(-(1 ** --temp)) ** 3 : number @@ -53,10 +53,10 @@ var temp = 10; >-(1 ** --temp) : number >(1 ** --temp) : number >1 ** --temp : number ->1 : number +>1 : 1 >--temp : number >temp : number ->3 : number +>3 : 3 (-(1 ** temp++)) ** 3; >(-(1 ** temp++)) ** 3 : number @@ -64,10 +64,10 @@ var temp = 10; >-(1 ** temp++) : number >(1 ** temp++) : number >1 ** temp++ : number ->1 : number +>1 : 1 >temp++ : number >temp : number ->3 : number +>3 : 3 (-(1 ** temp--)) ** 3; >(-(1 ** temp--)) ** 3 : number @@ -75,40 +75,40 @@ var temp = 10; >-(1 ** temp--) : number >(1 ** temp--) : number >1 ** temp-- : number ->1 : number +>1 : 1 >temp-- : number >temp : number ->3 : number +>3 : 3 (-3) ** temp++; >(-3) ** temp++ : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >temp++ : number >temp : number (-3) ** temp--; >(-3) ** temp-- : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >temp-- : number >temp : number (-3) ** ++temp; >(-3) ** ++temp : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >++temp : number >temp : number (-3) ** --temp; >(-3) ** --temp : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >--temp : number >temp : number @@ -116,7 +116,7 @@ var temp = 10; >(+3) ** temp++ : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >temp++ : number >temp : number @@ -124,7 +124,7 @@ var temp = 10; >(+3) ** temp-- : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >temp-- : number >temp : number @@ -132,7 +132,7 @@ var temp = 10; >(+3) ** ++temp : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >++temp : number >temp : number @@ -140,175 +140,175 @@ var temp = 10; >(+3) ** --temp : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >--temp : number >temp : number (-3) ** temp++ ** 2; >(-3) ** temp++ ** 2 : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >temp++ ** 2 : number >temp++ : number >temp : number ->2 : number +>2 : 2 (-3) ** temp-- ** 2; >(-3) ** temp-- ** 2 : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >temp-- ** 2 : number >temp-- : number >temp : number ->2 : number +>2 : 2 (-3) ** ++temp ** 2; >(-3) ** ++temp ** 2 : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >++temp ** 2 : number >++temp : number >temp : number ->2 : number +>2 : 2 (-3) ** --temp ** 2; >(-3) ** --temp ** 2 : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >--temp ** 2 : number >--temp : number >temp : number ->2 : number +>2 : 2 (+3) ** temp++ ** 2; >(+3) ** temp++ ** 2 : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >temp++ ** 2 : number >temp++ : number >temp : number ->2 : number +>2 : 2 (+3) ** temp-- ** 2; >(+3) ** temp-- ** 2 : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >temp-- ** 2 : number >temp-- : number >temp : number ->2 : number +>2 : 2 (+3) ** ++temp ** 2; >(+3) ** ++temp ** 2 : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >++temp ** 2 : number >++temp : number >temp : number ->2 : number +>2 : 2 (+3) ** --temp ** 2; >(+3) ** --temp ** 2 : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >--temp ** 2 : number >--temp : number >temp : number ->2 : number +>2 : 2 3 ** -temp++; >3 ** -temp++ : number ->3 : number +>3 : 3 >-temp++ : number >temp++ : number >temp : number 3 ** -temp--; >3 ** -temp-- : number ->3 : number +>3 : 3 >-temp-- : number >temp-- : number >temp : number 3 ** -++temp; >3 ** -++temp : number ->3 : number +>3 : 3 >-++temp : number >++temp : number >temp : number 3 ** +--temp; >3 ** +--temp : number ->3 : number +>3 : 3 >+--temp : number >--temp : number >temp : number 3 ** (-temp++) ** 2; >3 ** (-temp++) ** 2 : number ->3 : number +>3 : 3 >(-temp++) ** 2 : number >(-temp++) : number >-temp++ : number >temp++ : number >temp : number ->2 : number +>2 : 2 3 ** (-temp--) ** 2; >3 ** (-temp--) ** 2 : number ->3 : number +>3 : 3 >(-temp--) ** 2 : number >(-temp--) : number >-temp-- : number >temp-- : number >temp : number ->2 : number +>2 : 2 3 ** (+temp++) ** 2; >3 ** (+temp++) ** 2 : number ->3 : number +>3 : 3 >(+temp++) ** 2 : number >(+temp++) : number >+temp++ : number >temp++ : number >temp : number ->2 : number +>2 : 2 3 ** (+temp--) ** 2; >3 ** (+temp--) ** 2 : number ->3 : number +>3 : 3 >(+temp--) ** 2 : number >(+temp--) : number >+temp-- : number >temp-- : number >temp : number ->2 : number +>2 : 2 3 ** (-++temp) ** 2; >3 ** (-++temp) ** 2 : number ->3 : number +>3 : 3 >(-++temp) ** 2 : number >(-++temp) : number >-++temp : number >++temp : number >temp : number ->2 : number +>2 : 2 3 ** (+--temp) ** 2; >3 ** (+--temp) ** 2 : number ->3 : number +>3 : 3 >(+--temp) ** 2 : number >(+--temp) : number >+--temp : number >--temp : number >temp : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/emitExponentiationOperator4.types b/tests/baselines/reference/emitExponentiationOperator4.types index 36da1c32b4c3e..0049671228ee2 100644 --- a/tests/baselines/reference/emitExponentiationOperator4.types +++ b/tests/baselines/reference/emitExponentiationOperator4.types @@ -7,7 +7,7 @@ var temp: any; >(temp) : number >temp : number >temp : any ->3 : number +>3 : 3 (--temp) ** 3; >(--temp) ** 3 : number @@ -15,7 +15,7 @@ var temp: any; >--temp : number >--temp : number >temp : any ->3 : number +>3 : 3 (++temp) ** 3; >(++temp) ** 3 : number @@ -23,7 +23,7 @@ var temp: any; >++temp : number >++temp : number >temp : any ->3 : number +>3 : 3 (temp--) ** 3; >(temp--) ** 3 : number @@ -31,7 +31,7 @@ var temp: any; >temp-- : number >temp-- : number >temp : any ->3 : number +>3 : 3 (temp++) ** 3; >(temp++) ** 3 : number @@ -39,47 +39,47 @@ var temp: any; >temp++ : number >temp++ : number >temp : any ->3 : number +>3 : 3 1 ** (--temp) ** 3; >1 ** (--temp) ** 3 : number ->1 : number +>1 : 1 >(--temp) ** 3 : number >(--temp) : number >--temp : number >--temp : number >temp : any ->3 : number +>3 : 3 1 ** (++temp) ** 3; >1 ** (++temp) ** 3 : number ->1 : number +>1 : 1 >(++temp) ** 3 : number >(++temp) : number >++temp : number >++temp : number >temp : any ->3 : number +>3 : 3 1 ** (temp--) ** 3; >1 ** (temp--) ** 3 : number ->1 : number +>1 : 1 >(temp--) ** 3 : number >(temp--) : number >temp-- : number >temp-- : number >temp : any ->3 : number +>3 : 3 1 ** (temp++) ** 3; >1 ** (temp++) ** 3 : number ->1 : number +>1 : 1 >(temp++) ** 3 : number >(temp++) : number >temp++ : number >temp++ : number >temp : any ->3 : number +>3 : 3 (void --temp) ** 3; >(void --temp) ** 3 : number @@ -87,7 +87,7 @@ var temp: any; >void --temp : undefined >--temp : number >temp : any ->3 : number +>3 : 3 (void temp--) ** 3; >(void temp--) ** 3 : number @@ -95,14 +95,14 @@ var temp: any; >void temp-- : undefined >temp-- : number >temp : any ->3 : number +>3 : 3 (void 3) ** 4; >(void 3) ** 4 : number >(void 3) : undefined >void 3 : undefined ->3 : number ->4 : number +>3 : 3 +>4 : 4 (void temp++) ** 4; >(void temp++) ** 4 : number @@ -110,7 +110,7 @@ var temp: any; >void temp++ : undefined >temp++ : number >temp : any ->4 : number +>4 : 4 (void temp--) ** 4; >(void temp--) ** 4 : number @@ -118,57 +118,57 @@ var temp: any; >void temp-- : undefined >temp-- : number >temp : any ->4 : number +>4 : 4 1 ** (void --temp) ** 3; >1 ** (void --temp) ** 3 : number ->1 : number +>1 : 1 >(void --temp) ** 3 : number >(void --temp) : undefined >void --temp : undefined >--temp : number >temp : any ->3 : number +>3 : 3 1 ** (void temp--) ** 3; >1 ** (void temp--) ** 3 : number ->1 : number +>1 : 1 >(void temp--) ** 3 : number >(void temp--) : undefined >void temp-- : undefined >temp-- : number >temp : any ->3 : number +>3 : 3 1 ** (void 3) ** 4; >1 ** (void 3) ** 4 : number ->1 : number +>1 : 1 >(void 3) ** 4 : number >(void 3) : undefined >void 3 : undefined ->3 : number ->4 : number +>3 : 3 +>4 : 4 1 ** (void temp++) ** 4; >1 ** (void temp++) ** 4 : number ->1 : number +>1 : 1 >(void temp++) ** 4 : number >(void temp++) : undefined >void temp++ : undefined >temp++ : number >temp : any ->4 : number +>4 : 4 1 ** (void temp--) ** 4; >1 ** (void temp--) ** 4 : number ->1 : number +>1 : 1 >(void temp--) ** 4 : number >(void temp--) : undefined >void temp-- : undefined >temp-- : number >temp : any ->4 : number +>4 : 4 (~ --temp) ** 3; >(~ --temp) ** 3 : number @@ -176,7 +176,7 @@ var temp: any; >~ --temp : number >--temp : number >temp : any ->3 : number +>3 : 3 (~ temp--) ** 3; >(~ temp--) ** 3 : number @@ -184,14 +184,14 @@ var temp: any; >~ temp-- : number >temp-- : number >temp : any ->3 : number +>3 : 3 (~ 3) ** 4; >(~ 3) ** 4 : number >(~ 3) : number >~ 3 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 (~ temp++) ** 4; >(~ temp++) ** 4 : number @@ -199,7 +199,7 @@ var temp: any; >~ temp++ : number >temp++ : number >temp : any ->4 : number +>4 : 4 (~ temp--) ** 4; >(~ temp--) ** 4 : number @@ -207,54 +207,54 @@ var temp: any; >~ temp-- : number >temp-- : number >temp : any ->4 : number +>4 : 4 1 ** (~ --temp) ** 3; >1 ** (~ --temp) ** 3 : number ->1 : number +>1 : 1 >(~ --temp) ** 3 : number >(~ --temp) : number >~ --temp : number >--temp : number >temp : any ->3 : number +>3 : 3 1 ** (~ temp--) ** 3; >1 ** (~ temp--) ** 3 : number ->1 : number +>1 : 1 >(~ temp--) ** 3 : number >(~ temp--) : number >~ temp-- : number >temp-- : number >temp : any ->3 : number +>3 : 3 1 ** (~ 3) ** 4; >1 ** (~ 3) ** 4 : number ->1 : number +>1 : 1 >(~ 3) ** 4 : number >(~ 3) : number >~ 3 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 1 ** (~ temp++) ** 4; >1 ** (~ temp++) ** 4 : number ->1 : number +>1 : 1 >(~ temp++) ** 4 : number >(~ temp++) : number >~ temp++ : number >temp++ : number >temp : any ->4 : number +>4 : 4 1 ** (~ temp--) ** 4; >1 ** (~ temp--) ** 4 : number ->1 : number +>1 : 1 >(~ temp--) ** 4 : number >(~ temp--) : number >~ temp-- : number >temp-- : number >temp : any ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types index b4d1aebd4f687..7991ef224f0f0 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types index ed2f4b522e965..981829dd42b9d 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types index 02ae523c168e3..bbfb5b88e04c4 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `${1 + typeof (t1 ** t2 ** t1) }`; >`${1 + typeof (t1 ** t2 ** t1) }` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types index c2ee01ff23fa0..a005dd074630c 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `${1 + typeof (t1 ** t2 ** t1) }`; >`${1 + typeof (t1 ** t2 ** t1) }` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types index 05816e94c6c62..156851b60b946 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `hello ${1 + typeof (t1 ** t2 ** t1) }`; >`hello ${1 + typeof (t1 ** t2 ** t1) }` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types index b77e38587c2cd..dbeee05554eb0 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `hello ${1 + typeof (t1 ** t2 ** t1) }`; >`hello ${1 + typeof (t1 ** t2 ** t1) }` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types index 88c23ee8a0b47..d3472beac1254 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `${1 + typeof (t1 ** t2 ** t1) } world`; >`${1 + typeof (t1 ** t2 ** t1) } world` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types index e0d59cc1319ab..239ef02a52953 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `${1 + typeof (t1 ** t2 ** t1) } world`; >`${1 + typeof (t1 ** t2 ** t1) } world` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitMemberAccessExpression.types b/tests/baselines/reference/emitMemberAccessExpression.types index 7a32e452aec1c..c3f93e98df98e 100644 --- a/tests/baselines/reference/emitMemberAccessExpression.types +++ b/tests/baselines/reference/emitMemberAccessExpression.types @@ -16,12 +16,12 @@ module Microsoft.PeopleAtWork.Model { === tests/cases/compiler/emitMemberAccessExpression_file1.ts === /// "use strict"; ->"use strict" : string +>"use strict" : "use strict" === tests/cases/compiler/emitMemberAccessExpression_file2.ts === /// "use strict"; ->"use strict" : string +>"use strict" : "use strict" module Microsoft.PeopleAtWork.Model { >Microsoft : typeof Microsoft diff --git a/tests/baselines/reference/emitPinnedCommentsOnTopOfFile.types b/tests/baselines/reference/emitPinnedCommentsOnTopOfFile.types index 0ada89e280292..5ca6aa0ead05f 100644 --- a/tests/baselines/reference/emitPinnedCommentsOnTopOfFile.types +++ b/tests/baselines/reference/emitPinnedCommentsOnTopOfFile.types @@ -7,5 +7,5 @@ var x = 10; >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/emitPostComments.types b/tests/baselines/reference/emitPostComments.types index 5b5a05931d49f..dd73d8524236a 100644 --- a/tests/baselines/reference/emitPostComments.types +++ b/tests/baselines/reference/emitPostComments.types @@ -2,7 +2,7 @@ var y = 10; >y : number ->10 : number +>10 : 10 /** * @name Foo diff --git a/tests/baselines/reference/emitPreComments.types b/tests/baselines/reference/emitPreComments.types index c0378350de3d3..5ba8e45f721f2 100644 --- a/tests/baselines/reference/emitPreComments.types +++ b/tests/baselines/reference/emitPreComments.types @@ -3,7 +3,7 @@ // This is pre comment var y = 10; >y : number ->10 : number +>10 : 10 /** * @name Foo diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.types b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.types index cfdf0af030078..c8459efaa7c20 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -16,10 +16,10 @@ class B extends A { >x : number "use strict"; ->"use strict" : string +>"use strict" : "use strict" 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.types b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.types index 4424042c2417a..5d27896c940dd 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -16,10 +16,10 @@ class B extends A { >x : number "use strict"; ->"use strict" : string +>"use strict" : "use strict" 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.types b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.types index 2d16fed121db6..c96fd01740e71 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -14,14 +14,14 @@ class B extends A { blub = 12; >blub : number ->12 : number +>12 : 12 constructor() { "use strict"; ->"use strict" : string +>"use strict" : "use strict" 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1ES6.types b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1ES6.types index 39e8f8857772d..28b8c2d210a9d 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1ES6.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1ES6.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -14,11 +14,11 @@ class B extends A { blub = 12; >blub : number ->12 : number +>12 : 12 constructor() { 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.types b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.types index acb5703581ae8..8604f5d94bb75 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -14,16 +14,16 @@ class B extends A { blah = 2; >blah : number ->2 : number +>2 : 2 constructor(public x: number) { >x : number "use strict"; ->"use strict" : string +>"use strict" : "use strict" 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.types b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.types index 96fc1fc2dc3ff..585ba8a9df9db 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -14,16 +14,16 @@ class B extends A { blah = 2; >blah : number ->2 : number +>2 : 2 constructor(public x: number) { >x : number "use strict"; ->"use strict" : string +>"use strict" : "use strict" 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitTopOfFileTripleSlashCommentOnNotEmittedNodeIfRemoveCommentsIsFalse.types b/tests/baselines/reference/emitTopOfFileTripleSlashCommentOnNotEmittedNodeIfRemoveCommentsIsFalse.types index 637196fdc226c..b5c1cd2b346fb 100644 --- a/tests/baselines/reference/emitTopOfFileTripleSlashCommentOnNotEmittedNodeIfRemoveCommentsIsFalse.types +++ b/tests/baselines/reference/emitTopOfFileTripleSlashCommentOnNotEmittedNodeIfRemoveCommentsIsFalse.types @@ -13,5 +13,5 @@ interface F { } var x = 10 >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/emptyArrayBindingPatternParameter04.types b/tests/baselines/reference/emptyArrayBindingPatternParameter04.types index 834eb41b34de9..f6035a6ba94da 100644 --- a/tests/baselines/reference/emptyArrayBindingPatternParameter04.types +++ b/tests/baselines/reference/emptyArrayBindingPatternParameter04.types @@ -3,10 +3,10 @@ function f([] = [1,2,3,4]) { >f : ([]?: number[]) => void >[1,2,3,4] : number[] ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 var x, y, z; >x : any diff --git a/tests/baselines/reference/emptyIndexer.types b/tests/baselines/reference/emptyIndexer.types index 5361ed4d7f4e3..7c7fb160b9804 100644 --- a/tests/baselines/reference/emptyIndexer.types +++ b/tests/baselines/reference/emptyIndexer.types @@ -25,6 +25,6 @@ var n = x[''].m(); // should not crash compiler >x[''].m : () => number >x[''] : I1 >x : I2 ->'' : string +>'' : "" >m : () => number diff --git a/tests/baselines/reference/emptyThenWithoutWarning.types b/tests/baselines/reference/emptyThenWithoutWarning.types index 5da827deb2ca6..0632001736b73 100644 --- a/tests/baselines/reference/emptyThenWithoutWarning.types +++ b/tests/baselines/reference/emptyThenWithoutWarning.types @@ -1,7 +1,7 @@ === tests/cases/compiler/emptyThenWithoutWarning.ts === let a = 4; >a : number ->4 : number +>4 : 4 if(a === 1 || a === 2 || a === 3) { >a === 1 || a === 2 || a === 3 : boolean @@ -19,5 +19,5 @@ if(a === 1 || a === 2 || a === 3) { else { let message = "Ooops"; >message : string ->"Ooops" : string +>"Ooops" : "Ooops" } diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types index 3640d468a592f..9b6112365fdb8 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types @@ -56,9 +56,9 @@ for (var {} = {}, {} = {}; false; void 0) { >{} : {} >{} : {} ->false : boolean +>false : false >void 0 : undefined ->0 : number +>0 : 0 } function f({} = a, [] = a, { p: {} = a} = a) { diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types index 20b7d5ec2b628..ac79fe0b1b738 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types @@ -56,9 +56,9 @@ for (var {} = {}, {} = {}; false; void 0) { >{} : {} >{} : {} ->false : boolean +>false : false >void 0 : undefined ->0 : number +>0 : 0 } function f({} = a, [] = a, { p: {} = a} = a) { diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index f1a01247146c0..11f2d02626194 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,11 +1,12 @@ tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. -tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W.a' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type '3' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(31,5): error TS2322: Type '4' is not assignable to type 'W.a'. +tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W.a' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type '5' is not assignable to type 'WStatic'. -==== tests/cases/compiler/enumAssignmentCompat.ts (5 errors) ==== +==== tests/cases/compiler/enumAssignmentCompat.ts (6 errors) ==== module W { export class D { } } @@ -37,18 +38,20 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'typeof W'. +!!! error TS2322: Type 'W.a' is not assignable to type 'typeof W'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'typeof W'. +!!! error TS2322: Type '3' is not assignable to type 'typeof W'. var e: typeof W.a = 4; + ~ +!!! error TS2322: Type '4' is not assignable to type 'W.a'. var f: WStatic = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'WStatic'. +!!! error TS2322: Type 'W.a' is not assignable to type 'WStatic'. var g: WStatic = 5; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'WStatic'. +!!! error TS2322: Type '5' is not assignable to type 'WStatic'. var h: W = 3; var i: W = W.a; i = W.a; diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt index 4e0660eaae3b5..9cda63254348b 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,11 +1,12 @@ tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. -tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W.a' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type '3' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(30,5): error TS2322: Type '4' is not assignable to type 'W.a'. +tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W.a' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type '5' is not assignable to type 'WStatic'. -==== tests/cases/compiler/enumAssignmentCompat2.ts (5 errors) ==== +==== tests/cases/compiler/enumAssignmentCompat2.ts (6 errors) ==== enum W { a, b, c, @@ -36,18 +37,20 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'typeof W'. +!!! error TS2322: Type 'W.a' is not assignable to type 'typeof W'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'typeof W'. +!!! error TS2322: Type '3' is not assignable to type 'typeof W'. var e: typeof W.a = 4; + ~ +!!! error TS2322: Type '4' is not assignable to type 'W.a'. var f: WStatic = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'WStatic'. +!!! error TS2322: Type 'W.a' is not assignable to type 'WStatic'. var g: WStatic = 5; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'WStatic'. +!!! error TS2322: Type '5' is not assignable to type 'WStatic'. var h: W = 3; var i: W = W.a; i = W.a; diff --git a/tests/baselines/reference/enumBasics.errors.txt b/tests/baselines/reference/enumBasics.errors.txt new file mode 100644 index 0000000000000..4d82402b8eec2 --- /dev/null +++ b/tests/baselines/reference/enumBasics.errors.txt @@ -0,0 +1,86 @@ +tests/cases/conformance/enums/enumBasics.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'e' must be of type 'typeof E1', but here has type '{ readonly [n: number]: string; readonly A: E1; readonly B: E1; readonly C: E1; }'. + + +==== tests/cases/conformance/enums/enumBasics.ts (1 errors) ==== + // Enum without initializers have first member = 0 and successive members = N + 1 + enum E1 { + A, + B, + C + } + + // Enum type is a subtype of Number + var x: number = E1.A; + + // Enum object type is anonymous with properties of the enum type and numeric indexer + var e = E1; + var e: { + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'e' must be of type 'typeof E1', but here has type '{ readonly [n: number]: string; readonly A: E1; readonly B: E1; readonly C: E1; }'. + readonly A: E1; + readonly B: E1; + readonly C: E1; + readonly [n: number]: string; + }; + var e: typeof E1; + + // Reverse mapping of enum returns string name of property + var s = E1[e.A]; + var s: string; + + + // Enum with only constant members + enum E2 { + A = 1, B = 2, C = 3 + } + + // Enum with only computed members + enum E3 { + X = 'foo'.length, Y = 4 + 3, Z = +'foo' + } + + // Enum with constant members followed by computed members + enum E4 { + X = 0, Y, Z = 'foo'.length + } + + // Enum with > 2 constant members with no initializer for first member, non zero initializer for second element + enum E5 { + A, + B = 3, + C // 4 + } + + enum E6 { + A, + B = 0, + C // 1 + } + + // Enum with computed member initializer of type 'any' + enum E7 { + A = 'foo'['foo'] + } + + // Enum with computed member initializer of type number + enum E8 { + B = 'foo'['foo'] + } + + //Enum with computed member intializer of same enum type + enum E9 { + A, + B = A + } + + // (refer to .js to validate) + // Enum constant members are propagated + var doNotPropagate = [ + E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z + ]; + // Enum computed members are not propagated + var doPropagate = [ + E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C + ]; + + \ No newline at end of file diff --git a/tests/baselines/reference/enumBasics1.errors.txt b/tests/baselines/reference/enumBasics1.errors.txt index fddca60bd99e2..352303def5bab 100644 --- a/tests/baselines/reference/enumBasics1.errors.txt +++ b/tests/baselines/reference/enumBasics1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/enumBasics1.ts(26,5): error TS2339: Property 'A' does not exist on type 'E'. +tests/cases/compiler/enumBasics1.ts(26,5): error TS2339: Property 'A' does not exist on type 'E.A'. tests/cases/compiler/enumBasics1.ts(35,2): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. @@ -30,7 +30,7 @@ tests/cases/compiler/enumBasics1.ts(35,2): error TS2432: In an enum with multipl */ E.A.A; // should error ~ -!!! error TS2339: Property 'A' does not exist on type 'E'. +!!! error TS2339: Property 'A' does not exist on type 'E.A'. enum E2 { diff --git a/tests/baselines/reference/enumCodeGenNewLines1.types b/tests/baselines/reference/enumCodeGenNewLines1.types index 6321511ef2dac..ec4f610df11aa 100644 --- a/tests/baselines/reference/enumCodeGenNewLines1.types +++ b/tests/baselines/reference/enumCodeGenNewLines1.types @@ -3,15 +3,15 @@ enum foo { >foo : foo b = 1, ->b : foo ->1 : number +>b : foo.b +>1 : 1 c = 2, ->c : foo ->2 : number +>c : foo.c +>2 : 2 d = 3 ->d : foo ->3 : number +>d : foo.d +>3 : 3 } diff --git a/tests/baselines/reference/enumConstantMembers.types b/tests/baselines/reference/enumConstantMembers.types index c99b5eeb62f1c..bfbf71a6c1738 100644 --- a/tests/baselines/reference/enumConstantMembers.types +++ b/tests/baselines/reference/enumConstantMembers.types @@ -4,47 +4,47 @@ enum E1 { >E1 : E1 a = 1, ->a : E1 ->1 : number +>a : E1.a +>1 : 1 b ->b : E1 +>b : E1.b } enum E2 { >E2 : E2 a = - 1, ->a : E2 ->- 1 : number ->1 : number +>a : E2.a +>- 1 : -1 +>1 : 1 b ->b : E2 +>b : E2.b } enum E3 { >E3 : E3 a = 0.1, ->a : E3 ->0.1 : number +>a : E3.a +>0.1 : 0.1 b // Error because 0.1 is not a constant ->b : E3 +>b : E3.b } declare enum E4 { >E4 : E4 a = 1, ->a : E4 ->1 : number +>a : E4.a +>1 : 1 b = -1, ->b : E4 ->-1 : number ->1 : number +>b : E4.b +>-1 : -1 +>1 : 1 c = 0.1 // Not a constant ->c : E4 ->0.1 : number +>c : E4.c +>0.1 : 0.1 } diff --git a/tests/baselines/reference/enumErrors.errors.txt b/tests/baselines/reference/enumErrors.errors.txt index 14cad3cb53b06..f0978df709c3c 100644 --- a/tests/baselines/reference/enumErrors.errors.txt +++ b/tests/baselines/reference/enumErrors.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/enums/enumErrors.ts(3,6): error TS2431: Enum name cannot tests/cases/conformance/enums/enumErrors.ts(4,6): error TS2431: Enum name cannot be 'string' tests/cases/conformance/enums/enumErrors.ts(5,6): error TS2431: Enum name cannot be 'boolean' tests/cases/conformance/enums/enumErrors.ts(9,9): error TS2322: Type 'Number' is not assignable to type 'E5'. -tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type 'string' is not assignable to type 'E11'. +tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type '""' is not assignable to type 'E11'. tests/cases/conformance/enums/enumErrors.ts(27,9): error TS2322: Type 'Date' is not assignable to type 'E11'. tests/cases/conformance/enums/enumErrors.ts(28,9): error TS2304: Cannot find name 'window'. tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is not assignable to type 'E11'. @@ -47,7 +47,7 @@ tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is no enum E11 { A = '', ~~ -!!! error TS2322: Type 'string' is not assignable to type 'E11'. +!!! error TS2322: Type '""' is not assignable to type 'E11'. B = new Date(), ~~~~~~~~~~ !!! error TS2322: Type 'Date' is not assignable to type 'E11'. diff --git a/tests/baselines/reference/enumExportMergingES6.types b/tests/baselines/reference/enumExportMergingES6.types index da2fc22cb8acd..6ede07d92a0dd 100644 --- a/tests/baselines/reference/enumExportMergingES6.types +++ b/tests/baselines/reference/enumExportMergingES6.types @@ -4,14 +4,14 @@ export enum Animals { Cat = 1 >Cat : Animals ->1 : number +>1 : 1 } export enum Animals { >Animals : Animals Dog = 2 >Dog : Animals ->2 : number +>2 : 2 } export enum Animals { >Animals : Animals diff --git a/tests/baselines/reference/enumIndexer.types b/tests/baselines/reference/enumIndexer.types index cbc43176b01be..6c6e50822b517 100644 --- a/tests/baselines/reference/enumIndexer.types +++ b/tests/baselines/reference/enumIndexer.types @@ -3,24 +3,24 @@ enum MyEnumType { >MyEnumType : MyEnumType foo, bar ->foo : MyEnumType ->bar : MyEnumType +>foo : MyEnumType.foo +>bar : MyEnumType.bar } var _arr = [{ key: 'foo' }, { key: 'bar' }] >_arr : { key: string; }[] >[{ key: 'foo' }, { key: 'bar' }] : { key: string; }[] >{ key: 'foo' } : { key: string; } >key : string ->'foo' : string +>'foo' : "foo" >{ key: 'bar' } : { key: string; } >key : string ->'bar' : string +>'bar' : "bar" var enumValue = MyEnumType.foo; >enumValue : MyEnumType ->MyEnumType.foo : MyEnumType +>MyEnumType.foo : MyEnumType.foo >MyEnumType : typeof MyEnumType ->foo : MyEnumType +>foo : MyEnumType.foo var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type >x : boolean[] diff --git a/tests/baselines/reference/enumInitializersWithExponents.types b/tests/baselines/reference/enumInitializersWithExponents.types index 8da208e5f871f..25a36ffc5e339 100644 --- a/tests/baselines/reference/enumInitializersWithExponents.types +++ b/tests/baselines/reference/enumInitializersWithExponents.types @@ -4,26 +4,26 @@ declare enum E { >E : E a = 1e3, // ok ->a : E ->1e3 : number +>a : E.a +>1e3 : 1000 b = 1e25, // ok ->b : E ->1e25 : number +>b : E.b +>1e25 : 1e+25 c = 1e-3, // error ->c : E ->1e-3 : number +>c : E.c +>1e-3 : 0.001 d = 1e-9, // error ->d : E ->1e-9 : number +>d : E.d +>1e-9 : 1e-9 e = 1e0, // ok ->e : E ->1e0 : number +>e : E.e +>1e0 : 1 f = 1e+25 // ok ->f : E ->1e+25 : number +>f : E.b +>1e+25 : 1e+25 } diff --git a/tests/baselines/reference/enumLiteralTypes1.types b/tests/baselines/reference/enumLiteralTypes1.types index 1fe3c8dd637a9..754574f547cd2 100644 --- a/tests/baselines/reference/enumLiteralTypes1.types +++ b/tests/baselines/reference/enumLiteralTypes1.types @@ -1,9 +1,9 @@ === tests/cases/conformance/types/literal/enumLiteralTypes1.ts === const enum Choice { Unknown, Yes, No }; >Choice : Choice ->Unknown : Choice ->Yes : Choice ->No : Choice +>Unknown : Choice.Unknown +>Yes : Choice.Yes +>No : Choice.No type YesNo = Choice.Yes | Choice.No; >YesNo : YesNo @@ -284,11 +284,11 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } function f10(x: YesNo) { ->f10 : (x: YesNo) => string +>f10 : (x: YesNo) => "true" | "false" >x : YesNo >YesNo : YesNo @@ -299,18 +299,18 @@ function f10(x: YesNo) { >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes ->"true" : string +>"true" : "true" case Choice.No: return "false"; >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No ->"false" : string +>"false" : "false" } } function f11(x: YesNo) { ->f11 : (x: YesNo) => string +>f11 : (x: YesNo) => "true" | "false" >x : YesNo >YesNo : YesNo @@ -321,13 +321,13 @@ function f11(x: YesNo) { >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes ->"true" : string +>"true" : "true" case Choice.No: return "false"; >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No ->"false" : string +>"false" : "false" } return assertNever(x); >assertNever(x) : never diff --git a/tests/baselines/reference/enumLiteralTypes2.types b/tests/baselines/reference/enumLiteralTypes2.types index 36390865aec4d..e27410a4dc710 100644 --- a/tests/baselines/reference/enumLiteralTypes2.types +++ b/tests/baselines/reference/enumLiteralTypes2.types @@ -2,9 +2,9 @@ const enum Choice { Unknown, Yes, No }; >Choice : Choice ->Unknown : Choice ->Yes : Choice ->No : Choice +>Unknown : Choice.Unknown +>Yes : Choice.Yes +>No : Choice.No type YesNo = Choice.Yes | Choice.No; >YesNo : YesNo @@ -285,11 +285,11 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } function f10(x: YesNo) { ->f10 : (x: YesNo) => string +>f10 : (x: YesNo) => "true" | "false" >x : YesNo >YesNo : YesNo @@ -300,18 +300,18 @@ function f10(x: YesNo) { >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes ->"true" : string +>"true" : "true" case Choice.No: return "false"; >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No ->"false" : string +>"false" : "false" } } function f11(x: YesNo) { ->f11 : (x: YesNo) => string +>f11 : (x: YesNo) => "true" | "false" >x : YesNo >YesNo : YesNo @@ -322,13 +322,13 @@ function f11(x: YesNo) { >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes ->"true" : string +>"true" : "true" case Choice.No: return "false"; >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No ->"false" : string +>"false" : "false" } return assertNever(x); >assertNever(x) : never diff --git a/tests/baselines/reference/enumMapBackIntoItself.types b/tests/baselines/reference/enumMapBackIntoItself.types index ab26094512b06..964f97061a1da 100644 --- a/tests/baselines/reference/enumMapBackIntoItself.types +++ b/tests/baselines/reference/enumMapBackIntoItself.types @@ -3,29 +3,29 @@ enum TShirtSize { >TShirtSize : TShirtSize Small, ->Small : TShirtSize +>Small : TShirtSize.Small Medium, ->Medium : TShirtSize +>Medium : TShirtSize.Medium Large ->Large : TShirtSize +>Large : TShirtSize.Large } var mySize = TShirtSize.Large; >mySize : TShirtSize ->TShirtSize.Large : TShirtSize +>TShirtSize.Large : TShirtSize.Large >TShirtSize : typeof TShirtSize ->Large : TShirtSize +>Large : TShirtSize.Large var test = TShirtSize[mySize]; >test : string >TShirtSize[mySize] : string >TShirtSize : typeof TShirtSize ->mySize : TShirtSize +>mySize : TShirtSize.Large // specifically checking output here, bug was that test used to be undefined at runtime test + '' >test + '' : string >test : string ->'' : string +>'' : "" diff --git a/tests/baselines/reference/enumMerging.types b/tests/baselines/reference/enumMerging.types index 1ca284702c525..a70284c80ea1d 100644 --- a/tests/baselines/reference/enumMerging.types +++ b/tests/baselines/reference/enumMerging.types @@ -8,66 +8,66 @@ module M1 { >EImpl1 : EImpl1 A, B, C ->A : EImpl1 ->B : EImpl1 ->C : EImpl1 +>A : EImpl1.A +>B : EImpl1.B +>C : EImpl1.C } enum EImpl1 { >EImpl1 : EImpl1 D = 1, E, F ->D : EImpl1 ->1 : number ->E : EImpl1 ->F : EImpl1 +>D : EImpl1.B +>1 : 1 +>E : EImpl1.C +>F : EImpl1.F } export enum EConst1 { >EConst1 : EConst1 A = 3, B = 2, C = 1 ->A : EConst1 ->3 : number ->B : EConst1 ->2 : number ->C : EConst1 ->1 : number +>A : EConst1.A +>3 : 3 +>B : EConst1.B +>2 : 2 +>C : EConst1.C +>1 : 1 } export enum EConst1 { >EConst1 : EConst1 D = 7, E = 9, F = 8 ->D : EConst1 ->7 : number ->E : EConst1 ->9 : number ->F : EConst1 ->8 : number +>D : EConst1.D +>7 : 7 +>E : EConst1.E +>9 : 9 +>F : EConst1.F +>8 : 8 } var x = [EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F]; >x : EConst1[] >[EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F] : EConst1[] ->EConst1.A : EConst1 +>EConst1.A : EConst1.A >EConst1 : typeof EConst1 ->A : EConst1 ->EConst1.B : EConst1 +>A : EConst1.A +>EConst1.B : EConst1.B >EConst1 : typeof EConst1 ->B : EConst1 ->EConst1.C : EConst1 +>B : EConst1.B +>EConst1.C : EConst1.C >EConst1 : typeof EConst1 ->C : EConst1 ->EConst1.D : EConst1 +>C : EConst1.C +>EConst1.D : EConst1.D >EConst1 : typeof EConst1 ->D : EConst1 ->EConst1.E : EConst1 +>D : EConst1.D +>EConst1.E : EConst1.E >EConst1 : typeof EConst1 ->E : EConst1 ->EConst1.F : EConst1 +>E : EConst1.E +>EConst1.F : EConst1.F >EConst1 : typeof EConst1 ->F : EConst1 +>F : EConst1.F } // Enum with only computed members across 2 declarations with the same root module @@ -80,15 +80,15 @@ module M2 { A = 'foo'.length, B = 'foo'.length, C = 'foo'.length >A : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number >B : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number >C : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number } @@ -98,15 +98,15 @@ module M2 { D = 'foo'.length, E = 'foo'.length, F = 'foo'.length >D : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number >E : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number >F : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number } @@ -141,20 +141,20 @@ module M3 { >EInit : EInit A, ->A : EInit +>A : EInit.A B ->B : EInit +>B : EInit.B } enum EInit { >EInit : EInit C = 1, D, E ->C : EInit ->1 : number ->D : EInit ->E : EInit +>C : EInit.B +>1 : 1 +>D : EInit.D +>E : EInit.E } } @@ -164,18 +164,18 @@ module M4 { export enum Color { Red, Green, Blue } >Color : Color ->Red : Color ->Green : Color ->Blue : Color +>Red : Color.Red +>Green : Color.Green +>Blue : Color.Blue } module M5 { >M5 : typeof M5 export enum Color { Red, Green, Blue } >Color : Color ->Red : Color ->Green : Color ->Blue : Color +>Red : Color.Red +>Green : Color.Green +>Blue : Color.Blue } module M6.A { @@ -184,9 +184,9 @@ module M6.A { export enum Color { Red, Green, Blue } >Color : Color ->Red : Color ->Green : Color ->Blue : Color +>Red : Color.Red +>Green : Color.Green +>Blue : Color.Blue } module M6 { >M6 : typeof M6 @@ -196,16 +196,16 @@ module M6 { export enum Color { Yellow = 1 } >Color : Color ->Yellow : Color ->1 : number +>Yellow : Color.Green +>1 : 1 } var t = A.Color.Yellow; >t : A.Color ->A.Color.Yellow : A.Color +>A.Color.Yellow : A.Color.Green >A.Color : typeof A.Color >A : typeof A >Color : typeof A.Color ->Yellow : A.Color +>Yellow : A.Color.Green t = A.Color.Red; >t = A.Color.Red : A.Color.Red diff --git a/tests/baselines/reference/enumNegativeLiteral1.types b/tests/baselines/reference/enumNegativeLiteral1.types index 31ecbc11aa2b1..491e5b4b088ea 100644 --- a/tests/baselines/reference/enumNegativeLiteral1.types +++ b/tests/baselines/reference/enumNegativeLiteral1.types @@ -3,10 +3,10 @@ enum E { >E : E a = -5, b, c ->a : E ->-5 : number ->5 : number ->b : E ->c : E +>a : E.a +>-5 : -5 +>5 : 5 +>b : E.b +>c : E.c } diff --git a/tests/baselines/reference/enumNumbering1.types b/tests/baselines/reference/enumNumbering1.types index 81bb0325b7a7e..25f7225b96db0 100644 --- a/tests/baselines/reference/enumNumbering1.types +++ b/tests/baselines/reference/enumNumbering1.types @@ -19,11 +19,11 @@ enum Test { >Math.random : () => number >Math : Math >random : () => number ->1000 : number +>1000 : 1000 D = 10, >D : Test ->10 : number +>10 : 10 E // Error but shouldn't be >E : Test diff --git a/tests/baselines/reference/enumOperations.types b/tests/baselines/reference/enumOperations.types index 232ecc5e71b29..136d76558b2c7 100644 --- a/tests/baselines/reference/enumOperations.types +++ b/tests/baselines/reference/enumOperations.types @@ -2,7 +2,7 @@ enum Enum { None = 0 } >Enum : Enum >None : Enum ->0 : number +>0 : 0 var enumType: Enum = Enum.None; >enumType : Enum @@ -13,11 +13,11 @@ var enumType: Enum = Enum.None; var numberType: number = 0; >numberType : number ->0 : number +>0 : 0 var anyType: any = 0; >anyType : any ->0 : number +>0 : 0 enumType ^ numberType; >enumType ^ numberType : number diff --git a/tests/baselines/reference/enumPropertyAccess.errors.txt b/tests/baselines/reference/enumPropertyAccess.errors.txt index 666e929712061..fe670a3ef3105 100644 --- a/tests/baselines/reference/enumPropertyAccess.errors.txt +++ b/tests/baselines/reference/enumPropertyAccess.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/enumPropertyAccess.ts(7,11): error TS2339: Property 'Green' does not exist on type 'Colors'. +tests/cases/compiler/enumPropertyAccess.ts(7,11): error TS2339: Property 'Green' does not exist on type 'Colors.Red'. tests/cases/compiler/enumPropertyAccess.ts(12,7): error TS2339: Property 'Green' does not exist on type 'B'. @@ -11,7 +11,7 @@ tests/cases/compiler/enumPropertyAccess.ts(12,7): error TS2339: Property 'Green' var x = Colors.Red; // type of 'x' should be 'Colors' var p = x.Green; // error ~~~~~ -!!! error TS2339: Property 'Green' does not exist on type 'Colors'. +!!! error TS2339: Property 'Green' does not exist on type 'Colors.Red'. x.toFixed(); // ok // Now with generics diff --git a/tests/baselines/reference/enumWithInfinityProperty.types b/tests/baselines/reference/enumWithInfinityProperty.types index 1f872916c15a3..664aa5ea2d5e3 100644 --- a/tests/baselines/reference/enumWithInfinityProperty.types +++ b/tests/baselines/reference/enumWithInfinityProperty.types @@ -4,6 +4,6 @@ enum A { Infinity = 1 >Infinity : A ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/enumWithNaNProperty.types b/tests/baselines/reference/enumWithNaNProperty.types index 0d825a55eedc6..710c7554a3127 100644 --- a/tests/baselines/reference/enumWithNaNProperty.types +++ b/tests/baselines/reference/enumWithNaNProperty.types @@ -4,6 +4,6 @@ enum A { NaN = 1 >NaN : A ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/enumWithNegativeInfinityProperty.types b/tests/baselines/reference/enumWithNegativeInfinityProperty.types index bc09333075d22..dad61ad87cc49 100644 --- a/tests/baselines/reference/enumWithNegativeInfinityProperty.types +++ b/tests/baselines/reference/enumWithNegativeInfinityProperty.types @@ -3,6 +3,6 @@ enum A { >A : A "-Infinity" = 1 ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.types b/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.types index 0ece7b76f1e3a..c558000f75633 100644 --- a/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.types +++ b/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.types @@ -3,12 +3,12 @@ enum E { >E : E a, ->a : E +>a : E.a b = a, ->b : E ->a : E +>b : E.a +>a : E.a c ->c : E +>c : E.c } diff --git a/tests/baselines/reference/equalityWithUnionTypes01.types b/tests/baselines/reference/equalityWithUnionTypes01.types index 61e3803094903..acec449dc42da 100644 --- a/tests/baselines/reference/equalityWithUnionTypes01.types +++ b/tests/baselines/reference/equalityWithUnionTypes01.types @@ -18,9 +18,9 @@ var x = { p1: 10, p2: 20 }; >x : { p1: number; p2: number; } >{ p1: 10, p2: 20 } : { p1: number; p2: number; } >p1 : number ->10 : number +>10 : 10 >p2 : number ->20 : number +>20 : 20 var y: number | I2 = x; >y : number | I2 diff --git a/tests/baselines/reference/es2015modulekind.types b/tests/baselines/reference/es2015modulekind.types index e77cf095aedb4..1b09ecb0a88ba 100644 --- a/tests/baselines/reference/es2015modulekind.types +++ b/tests/baselines/reference/es2015modulekind.types @@ -12,6 +12,6 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es2015modulekindWithES6Target.types b/tests/baselines/reference/es2015modulekindWithES6Target.types index 50b85921b0e7b..4872566b1c284 100644 --- a/tests/baselines/reference/es2015modulekindWithES6Target.types +++ b/tests/baselines/reference/es2015modulekindWithES6Target.types @@ -12,6 +12,6 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es3-amd.types b/tests/baselines/reference/es3-amd.types index 1e9fdbd582f83..420354f364ab4 100644 --- a/tests/baselines/reference/es3-amd.types +++ b/tests/baselines/reference/es3-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es3-declaration-amd.types b/tests/baselines/reference/es3-declaration-amd.types index daf0bb5d74e37..c174d8d02557f 100644 --- a/tests/baselines/reference/es3-declaration-amd.types +++ b/tests/baselines/reference/es3-declaration-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es3-sourcemap-amd.types b/tests/baselines/reference/es3-sourcemap-amd.types index d3f712211e4d3..351cbe5ded949 100644 --- a/tests/baselines/reference/es3-sourcemap-amd.types +++ b/tests/baselines/reference/es3-sourcemap-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es3defaultAliasIsQuoted.types b/tests/baselines/reference/es3defaultAliasIsQuoted.types index 59ce62dff1e75..b041235966098 100644 --- a/tests/baselines/reference/es3defaultAliasIsQuoted.types +++ b/tests/baselines/reference/es3defaultAliasIsQuoted.types @@ -5,7 +5,7 @@ export class Foo { static CONSTANT = "Foo"; >CONSTANT : string ->"Foo" : string +>"Foo" : "Foo" } export default function assert(value: boolean) { @@ -17,7 +17,7 @@ export default function assert(value: boolean) { >value : boolean >new Error("Assertion failed!") : Error >Error : ErrorConstructor ->"Assertion failed!" : string +>"Assertion failed!" : "Assertion failed!" } === tests/cases/compiler/es3defaultAliasQuoted_file1.ts === diff --git a/tests/baselines/reference/es5-amd.types b/tests/baselines/reference/es5-amd.types index 7dd9e8b281a1b..62e47b91d1079 100644 --- a/tests/baselines/reference/es5-amd.types +++ b/tests/baselines/reference/es5-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-asyncFunctionDoStatements.types b/tests/baselines/reference/es5-asyncFunctionDoStatements.types index cfec3eebcfb0b..811c3cae02a0b 100644 --- a/tests/baselines/reference/es5-asyncFunctionDoStatements.types +++ b/tests/baselines/reference/es5-asyncFunctionDoStatements.types @@ -53,7 +53,7 @@ async function doStatement5() { >doStatement5 : () => Promise do { if (1) continue; await x; } while (y); ->1 : number +>1 : 1 >await x : any >x : any >y : any @@ -92,7 +92,7 @@ async function doStatement9() { C: do { if (1) continue C; await x; } while (y); >C : any ->1 : number +>1 : 1 >C : any >await x : any >x : any @@ -129,7 +129,7 @@ async function doStatement13() { >doStatement13 : () => Promise do { if (1) break; await x; } while (y); ->1 : number +>1 : 1 >await x : any >x : any >y : any @@ -168,7 +168,7 @@ async function doStatement17() { G: do { if (1) break G; await x; } while (y); >G : any ->1 : number +>1 : 1 >G : any >await x : any >x : any diff --git a/tests/baselines/reference/es5-asyncFunctionHoisting.types b/tests/baselines/reference/es5-asyncFunctionHoisting.types index 04b968c571df5..933f4fc5c305d 100644 --- a/tests/baselines/reference/es5-asyncFunctionHoisting.types +++ b/tests/baselines/reference/es5-asyncFunctionHoisting.types @@ -8,7 +8,7 @@ async function hoisting() { var a0, a1 = 1; >a0 : any >a1 : number ->1 : number +>1 : 1 function z() { >z : () => void @@ -16,21 +16,21 @@ async function hoisting() { var b0, b1 = 1; >b0 : any >b1 : number ->1 : number +>1 : 1 } if (true) { ->true : boolean +>true : true var c0, c1 = 1; >c0 : any >c1 : number ->1 : number +>1 : 1 } for (var a = 0; y;) { >a : number ->0 : number +>0 : 0 >y : any } @@ -54,7 +54,7 @@ async function hoistingWithAwait() { var a0, a1 = 1; >a0 : any >a1 : number ->1 : number +>1 : 1 function z() { >z : () => void @@ -62,25 +62,25 @@ async function hoistingWithAwait() { var b0, b1 = 1; >b0 : any >b1 : number ->1 : number +>1 : 1 } await 0; ->await 0 : number ->0 : number +>await 0 : 0 +>0 : 0 if (true) { ->true : boolean +>true : true var c0, c1 = 1; >c0 : any >c1 : number ->1 : number +>1 : 1 } for (var a = 0; y;) { >a : number ->0 : number +>0 : 0 >y : any } diff --git a/tests/baselines/reference/es5-asyncFunctionWhileStatements.types b/tests/baselines/reference/es5-asyncFunctionWhileStatements.types index 2410befa043f9..5148543bf34eb 100644 --- a/tests/baselines/reference/es5-asyncFunctionWhileStatements.types +++ b/tests/baselines/reference/es5-asyncFunctionWhileStatements.types @@ -62,7 +62,7 @@ async function whileStatement6() { while (x) { if (1) continue; await y; } >x : any ->1 : number +>1 : 1 >await y : any >y : any } @@ -103,7 +103,7 @@ async function whileStatement10() { D: while (x) { if (1) continue D; await y; } >D : any >x : any ->1 : number +>1 : 1 >D : any >await y : any >y : any @@ -138,7 +138,7 @@ async function whileStatement14() { while (x) { if (1) break; await y; } >x : any ->1 : number +>1 : 1 >await y : any >y : any } @@ -179,7 +179,7 @@ async function whileStatement18() { H: while (x) { if (1) break H; await y; } >H : any >x : any ->1 : number +>1 : 1 >H : any >await y : any >y : any diff --git a/tests/baselines/reference/es5-commonjs.types b/tests/baselines/reference/es5-commonjs.types index 4c1bc9229177f..06a14af7f4fb4 100644 --- a/tests/baselines/reference/es5-commonjs.types +++ b/tests/baselines/reference/es5-commonjs.types @@ -12,7 +12,7 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-commonjs3.types b/tests/baselines/reference/es5-commonjs3.types index facdfae00ce94..6f6b9c3e4990e 100644 --- a/tests/baselines/reference/es5-commonjs3.types +++ b/tests/baselines/reference/es5-commonjs3.types @@ -3,5 +3,5 @@ export default "test"; export var __esModule = 1; >__esModule : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/es5-commonjs4.types b/tests/baselines/reference/es5-commonjs4.types index d3471afbfeb52..fedfe9390a2fe 100644 --- a/tests/baselines/reference/es5-commonjs4.types +++ b/tests/baselines/reference/es5-commonjs4.types @@ -12,10 +12,10 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } export var __esModule = 1; >__esModule : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/es5-commonjs5.types b/tests/baselines/reference/es5-commonjs5.types index d8094e1e0ea1b..fb72fda8c11db 100644 --- a/tests/baselines/reference/es5-commonjs5.types +++ b/tests/baselines/reference/es5-commonjs5.types @@ -2,6 +2,6 @@ export default function () { return "test"; ->"test" : string +>"test" : "test" } diff --git a/tests/baselines/reference/es5-commonjs6.types b/tests/baselines/reference/es5-commonjs6.types index 904b69dec2244..cabe84e8a6974 100644 --- a/tests/baselines/reference/es5-commonjs6.types +++ b/tests/baselines/reference/es5-commonjs6.types @@ -3,5 +3,5 @@ export default "test"; var __esModule = 1; >__esModule : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/es5-declaration-amd.types b/tests/baselines/reference/es5-declaration-amd.types index ead96c35de169..ca5422fd739b0 100644 --- a/tests/baselines/reference/es5-declaration-amd.types +++ b/tests/baselines/reference/es5-declaration-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-souremap-amd.types b/tests/baselines/reference/es5-souremap-amd.types index 67606d7f1ff4c..d96f15b8d0e92 100644 --- a/tests/baselines/reference/es5-souremap-amd.types +++ b/tests/baselines/reference/es5-souremap-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-system.types b/tests/baselines/reference/es5-system.types index eae884a78b45d..fa6d471dbf799 100644 --- a/tests/baselines/reference/es5-system.types +++ b/tests/baselines/reference/es5-system.types @@ -12,7 +12,7 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-umd.types b/tests/baselines/reference/es5-umd.types index 60987d429e027..dcee52664cce9 100644 --- a/tests/baselines/reference/es5-umd.types +++ b/tests/baselines/reference/es5-umd.types @@ -12,7 +12,7 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-umd2.types b/tests/baselines/reference/es5-umd2.types index fab4e9dfc0197..2c24088c4a046 100644 --- a/tests/baselines/reference/es5-umd2.types +++ b/tests/baselines/reference/es5-umd2.types @@ -12,7 +12,7 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-umd3.types b/tests/baselines/reference/es5-umd3.types index b4b5f0dc36642..bb4cc91af5012 100644 --- a/tests/baselines/reference/es5-umd3.types +++ b/tests/baselines/reference/es5-umd3.types @@ -12,7 +12,7 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-umd4.types b/tests/baselines/reference/es5-umd4.types index 59d23e6bd8d05..4ce47c9e4def1 100644 --- a/tests/baselines/reference/es5-umd4.types +++ b/tests/baselines/reference/es5-umd4.types @@ -12,7 +12,7 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5ExportDefaultExpression.types b/tests/baselines/reference/es5ExportDefaultExpression.types index 6b371a2fc7365..db4d3a3abfd8c 100644 --- a/tests/baselines/reference/es5ExportDefaultExpression.types +++ b/tests/baselines/reference/es5ExportDefaultExpression.types @@ -3,6 +3,6 @@ export default (1 + 2); >(1 + 2) : number >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/es5ModuleWithModuleGenAmd.types b/tests/baselines/reference/es5ModuleWithModuleGenAmd.types index 4ae6698d06aa8..3d648a7777f11 100644 --- a/tests/baselines/reference/es5ModuleWithModuleGenAmd.types +++ b/tests/baselines/reference/es5ModuleWithModuleGenAmd.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types index 425afed82d28e..d2dc36fdd8ebc 100644 --- a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types +++ b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.types b/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.types index 251e2be25a976..349ab719d781a 100644 --- a/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.types +++ b/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5andes6module.types b/tests/baselines/reference/es5andes6module.types index 14423d87cea09..44dba0eb28e9d 100644 --- a/tests/baselines/reference/es5andes6module.types +++ b/tests/baselines/reference/es5andes6module.types @@ -12,7 +12,7 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6-amd.types b/tests/baselines/reference/es6-amd.types index 7a6fb6e32f559..5ba0315362742 100644 --- a/tests/baselines/reference/es6-amd.types +++ b/tests/baselines/reference/es6-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6-declaration-amd.types b/tests/baselines/reference/es6-declaration-amd.types index a46d22c82c58d..9568cedc0bde6 100644 --- a/tests/baselines/reference/es6-declaration-amd.types +++ b/tests/baselines/reference/es6-declaration-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6-sourcemap-amd.types b/tests/baselines/reference/es6-sourcemap-amd.types index 580a688afab44..6cbdc98df6fc0 100644 --- a/tests/baselines/reference/es6-sourcemap-amd.types +++ b/tests/baselines/reference/es6-sourcemap-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6-umd.types b/tests/baselines/reference/es6-umd.types index f43c491e003a5..ed3932d2e2a18 100644 --- a/tests/baselines/reference/es6-umd.types +++ b/tests/baselines/reference/es6-umd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6-umd2.types b/tests/baselines/reference/es6-umd2.types index eb66523c6ecec..395f136add828 100644 --- a/tests/baselines/reference/es6-umd2.types +++ b/tests/baselines/reference/es6-umd2.types @@ -12,6 +12,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.types b/tests/baselines/reference/es6ClassSuperCodegenBug.types index 65269c99997ae..d98b1fea451c7 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.types +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.types @@ -13,20 +13,20 @@ class B extends A { constructor() { if (true) { ->true : boolean +>true : true super('a1', 'b1'); >super('a1', 'b1') : void >super : typeof A ->'a1' : string ->'b1' : string +>'a1' : "a1" +>'b1' : "b1" } else { super('a2', 'b2'); >super('a2', 'b2') : void >super : typeof A ->'a2' : string ->'b2' : string +>'a2' : "a2" +>'b2' : "b2" } } } diff --git a/tests/baselines/reference/es6ClassTest3.types b/tests/baselines/reference/es6ClassTest3.types index 208d8cdf4d9dc..328589d76d6f4 100644 --- a/tests/baselines/reference/es6ClassTest3.types +++ b/tests/baselines/reference/es6ClassTest3.types @@ -22,18 +22,18 @@ module M { constructor() { this.x = 1; ->this.x = 1 : number +>this.x = 1 : 1 >this.x : number >this : this >x : number ->1 : number +>1 : 1 this.y = 2; ->this.y = 2 : number +>this.y = 2 : 2 >this.y : number >this : this >y : number ->2 : number +>2 : 2 } } } diff --git a/tests/baselines/reference/es6ClassTest5.types b/tests/baselines/reference/es6ClassTest5.types index 087a80170ede6..7b3b69512f5e9 100644 --- a/tests/baselines/reference/es6ClassTest5.types +++ b/tests/baselines/reference/es6ClassTest5.types @@ -23,6 +23,6 @@ class bigClass { public break = 1; >break : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/es6ClassTest8.types b/tests/baselines/reference/es6ClassTest8.types index b12d65e595f55..4dcfde5367128 100644 --- a/tests/baselines/reference/es6ClassTest8.types +++ b/tests/baselines/reference/es6ClassTest8.types @@ -111,10 +111,10 @@ class Camera { >down : Vector >new Vector(0.0, -1.0, 0.0) : Vector >Vector : typeof Vector ->0.0 : number ->-1.0 : number ->1.0 : number ->0.0 : number +>0.0 : 0 +>-1.0 : -1 +>1.0 : 1 +>0.0 : 0 this.forward = Vector.norm(Vector.minus(lookAt,this.pos)); >this.forward = Vector.norm(Vector.minus(lookAt,this.pos)) : Vector diff --git a/tests/baselines/reference/es6ExportAll.types b/tests/baselines/reference/es6ExportAll.types index 876ff152e2ce4..b6a7056fd4add 100644 --- a/tests/baselines/reference/es6ExportAll.types +++ b/tests/baselines/reference/es6ExportAll.types @@ -11,11 +11,11 @@ export module m { export var x = 10; >x : number ->10 : number +>10 : 10 } export var x = 10; >x : number ->10 : number +>10 : 10 export module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportAllInEs5.types b/tests/baselines/reference/es6ExportAllInEs5.types index 681873846025c..fc3daf6685c3f 100644 --- a/tests/baselines/reference/es6ExportAllInEs5.types +++ b/tests/baselines/reference/es6ExportAllInEs5.types @@ -11,11 +11,11 @@ export module m { export var x = 10; >x : number ->10 : number +>10 : 10 } export var x = 10; >x : number ->10 : number +>10 : 10 export module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportClause.types b/tests/baselines/reference/es6ExportClause.types index 5cab90d6a7f86..22e5f9c0e0d9c 100644 --- a/tests/baselines/reference/es6ExportClause.types +++ b/tests/baselines/reference/es6ExportClause.types @@ -11,11 +11,11 @@ module m { export var x = 10; >x : number ->10 : number +>10 : 10 } var x = 10; >x : number ->10 : number +>10 : 10 module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportClauseInEs5.types b/tests/baselines/reference/es6ExportClauseInEs5.types index 5cab90d6a7f86..22e5f9c0e0d9c 100644 --- a/tests/baselines/reference/es6ExportClauseInEs5.types +++ b/tests/baselines/reference/es6ExportClauseInEs5.types @@ -11,11 +11,11 @@ module m { export var x = 10; >x : number ->10 : number +>10 : 10 } var x = 10; >x : number ->10 : number +>10 : 10 module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportClauseWithAssignmentInEs5.types b/tests/baselines/reference/es6ExportClauseWithAssignmentInEs5.types index 3b6752d89db22..f846063c7efa6 100644 --- a/tests/baselines/reference/es6ExportClauseWithAssignmentInEs5.types +++ b/tests/baselines/reference/es6ExportClauseWithAssignmentInEs5.types @@ -2,34 +2,34 @@ var foo = 2; >foo : number ->2 : number +>2 : 2 foo = 3; ->foo = 3 : number +>foo = 3 : 3 >foo : number ->3 : number +>3 : 3 var baz = 3; >baz : number ->3 : number +>3 : 3 baz = 4; ->baz = 4 : number +>baz = 4 : 4 >baz : number ->4 : number +>4 : 4 var buzz = 10; >buzz : number ->10 : number +>10 : 10 buzz += 3; >buzz += 3 : number >buzz : number ->3 : number +>3 : 3 var bizz = 8; >bizz : number ->8 : number +>8 : 8 bizz++; // compiles to exports.bizz = bizz += 1 >bizz++ : number diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types index 6b621f4c777b9..748f731f91822 100644 --- a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types @@ -11,11 +11,11 @@ export module m { export var x = 10; >x : number ->10 : number +>10 : 10 } export var x = 10; >x : number ->10 : number +>10 : 10 export module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types index 4bd93b39031fc..496717c3a85d7 100644 --- a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types @@ -11,11 +11,11 @@ export module m { export var x = 10; >x : number ->10 : number +>10 : 10 } export var x = 10; >x : number ->10 : number +>10 : 10 export module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportDefaultExpression.types b/tests/baselines/reference/es6ExportDefaultExpression.types index 6f7665c280051..1e6a38482b692 100644 --- a/tests/baselines/reference/es6ExportDefaultExpression.types +++ b/tests/baselines/reference/es6ExportDefaultExpression.types @@ -3,6 +3,6 @@ export default (1 + 2); >(1 + 2) : number >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/es6ImportDefaultBinding.types b/tests/baselines/reference/es6ImportDefaultBinding.types index 6aa71ddf6ff24..f538ee8127bae 100644 --- a/tests/baselines/reference/es6ImportDefaultBinding.types +++ b/tests/baselines/reference/es6ImportDefaultBinding.types @@ -2,7 +2,7 @@ var a = 10; >a : number ->10 : number +>10 : 10 export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingAmd.types b/tests/baselines/reference/es6ImportDefaultBindingAmd.types index 740ff2c0e14e1..824c5568b17c2 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingAmd.types +++ b/tests/baselines/reference/es6ImportDefaultBindingAmd.types @@ -2,7 +2,7 @@ var a = 10; >a : number ->10 : number +>10 : 10 export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types index fe0137403a982..0fba9c6390c7d 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 export var x = a; >x : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types index 6d3f015c783df..a97100c662c7e 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types @@ -2,7 +2,7 @@ var a = 10; >a : number ->10 : number +>10 : 10 export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types index 4f9c618f10c85..18dc5efe22664 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types @@ -2,7 +2,7 @@ var a = 10; >a : number ->10 : number +>10 : 10 export default a; >a : number diff --git a/tests/baselines/reference/es6ImportNameSpaceImport.types b/tests/baselines/reference/es6ImportNameSpaceImport.types index 56ee0c4d87a99..6b73fb90bce99 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImport.types +++ b/tests/baselines/reference/es6ImportNameSpaceImport.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNameSpaceImport_1.ts === import * as nameSpaceBinding from "./es6ImportNameSpaceImport_0"; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportAmd.types b/tests/baselines/reference/es6ImportNameSpaceImportAmd.types index beb6860c73eeb..96cd4e603eaa3 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportAmd.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportAmd.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNameSpaceImportAmd_1.ts === import * as nameSpaceBinding from "es6ImportNameSpaceImportAmd_0"; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types index 136310608132f..81971078849a1 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNameSpaceImportInEs5_1.ts === import * as nameSpaceBinding from "./es6ImportNameSpaceImportInEs5_0"; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types index 4aaf33d593022..041100c76782c 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types @@ -2,7 +2,7 @@ var a = 10; >a : number ->10 : number +>10 : 10 export = a; >a : number diff --git a/tests/baselines/reference/es6ImportNamedImport.types b/tests/baselines/reference/es6ImportNamedImport.types index bd7c43d70319b..0ac3789c5e0a7 100644 --- a/tests/baselines/reference/es6ImportNamedImport.types +++ b/tests/baselines/reference/es6ImportNamedImport.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 export var x = a; >x : number @@ -14,23 +14,23 @@ export var m = a; export var a1 = 10; >a1 : number ->10 : number +>10 : 10 export var x1 = 10; >x1 : number ->10 : number +>10 : 10 export var z1 = 10; >z1 : number ->10 : number +>10 : 10 export var z2 = 10; >z2 : number ->10 : number +>10 : 10 export var aaaa = 10; >aaaa : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNamedImport_1.ts === import { } from "./es6ImportNamedImport_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportAmd.types b/tests/baselines/reference/es6ImportNamedImportAmd.types index 45ca9c085470e..897187a5a0db0 100644 --- a/tests/baselines/reference/es6ImportNamedImportAmd.types +++ b/tests/baselines/reference/es6ImportNamedImportAmd.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 export var x = a; >x : number @@ -14,23 +14,23 @@ export var m = a; export var a1 = 10; >a1 : number ->10 : number +>10 : 10 export var x1 = 10; >x1 : number ->10 : number +>10 : 10 export var z1 = 10; >z1 : number ->10 : number +>10 : 10 export var z2 = 10; >z2 : number ->10 : number +>10 : 10 export var aaaa = 10; >aaaa : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNamedImportAmd_1.ts === import { } from "es6ImportNamedImportAmd_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportInEs5.types b/tests/baselines/reference/es6ImportNamedImportInEs5.types index 1d55b4bf51eab..f2af5280fc2e2 100644 --- a/tests/baselines/reference/es6ImportNamedImportInEs5.types +++ b/tests/baselines/reference/es6ImportNamedImportInEs5.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 export var x = a; >x : number @@ -14,23 +14,23 @@ export var m = a; export var a1 = 10; >a1 : number ->10 : number +>10 : 10 export var x1 = 10; >x1 : number ->10 : number +>10 : 10 export var z1 = 10; >z1 : number ->10 : number +>10 : 10 export var z2 = 10; >z2 : number ->10 : number +>10 : 10 export var aaaa = 10; >aaaa : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNamedImportInEs5_1.ts === import { } from "./es6ImportNamedImportInEs5_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportInExportAssignment.types b/tests/baselines/reference/es6ImportNamedImportInExportAssignment.types index 09023b6dd8097..5b550c77a00c4 100644 --- a/tests/baselines/reference/es6ImportNamedImportInExportAssignment.types +++ b/tests/baselines/reference/es6ImportNamedImportInExportAssignment.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNamedImportInExportAssignment_1.ts === import { a } from "./es6ImportNamedImportInExportAssignment_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types index a65a2978e1b04..11c6caf3dbe8f 100644 --- a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types +++ b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types @@ -18,7 +18,7 @@ export class C implements I { prop = "hello"; >prop : string ->"hello" : string +>"hello" : "hello" } export class C2 implements I2 { >C2 : C2 @@ -26,7 +26,7 @@ export class C2 implements I2 { prop2 = "world"; >prop2 : string ->"world" : string +>"world" : "world" } === tests/cases/compiler/client.ts === diff --git a/tests/baselines/reference/es6ImportWithoutFromClause.types b/tests/baselines/reference/es6ImportWithoutFromClause.types index d46a4a7487c95..cd49acbcd0f70 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClause.types +++ b/tests/baselines/reference/es6ImportWithoutFromClause.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportWithoutFromClause_1.ts === import "es6ImportWithoutFromClause_0"; diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types index 3314b12d18925..5099dee908b78 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types +++ b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types @@ -2,21 +2,21 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportWithoutFromClauseAmd_1.ts === export var b = 10; >b : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportWithoutFromClauseAmd_2.ts === import "es6ImportWithoutFromClauseAmd_0"; import "es6ImportWithoutFromClauseAmd_2"; var _a = 10; >_a : number ->10 : number +>10 : 10 var _b = 10; >_b : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types index ee95c07bb751e..1e90de3223f66 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types +++ b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportWithoutFromClauseInEs5_1.ts === import "es6ImportWithoutFromClauseInEs5_0"; diff --git a/tests/baselines/reference/es6Module.types b/tests/baselines/reference/es6Module.types index b55b58e8883e0..709dcef0e89b2 100644 --- a/tests/baselines/reference/es6Module.types +++ b/tests/baselines/reference/es6Module.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6ModuleClassDeclaration.types b/tests/baselines/reference/es6ModuleClassDeclaration.types index e354d266abe70..7b8e2ba26df23 100644 --- a/tests/baselines/reference/es6ModuleClassDeclaration.types +++ b/tests/baselines/reference/es6ModuleClassDeclaration.types @@ -6,19 +6,19 @@ export class c { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void @@ -40,19 +40,19 @@ class c2 { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void @@ -85,19 +85,19 @@ export module m1 { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void @@ -119,19 +119,19 @@ export module m1 { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void @@ -172,19 +172,19 @@ module m2 { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void @@ -206,19 +206,19 @@ module m2 { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void diff --git a/tests/baselines/reference/es6ModuleConst.types b/tests/baselines/reference/es6ModuleConst.types index 99b9f7c298046..b83e39e61ad1f 100644 --- a/tests/baselines/reference/es6ModuleConst.types +++ b/tests/baselines/reference/es6ModuleConst.types @@ -1,11 +1,11 @@ === tests/cases/compiler/es6ModuleConst.ts === export const a = "hello"; ->a : string ->"hello" : string +>a : "hello" +>"hello" : "hello" export const x: string = a, y = x; >x : string ->a : string +>a : "hello" >y : string >x : string @@ -23,49 +23,49 @@ export module m1 { >m1 : typeof m1 export const k = a; ->k : string ->a : string +>k : "hello" +>a : "hello" export const l: string = b, m = k; >l : string >b : string ->m : string ->k : string +>m : "hello" +>k : "hello" const n = m1.k; ->n : string ->m1.k : string +>n : "hello" +>m1.k : "hello" >m1 : typeof m1 ->k : string +>k : "hello" const o: string = n, p = k; >o : string ->n : string ->p : string ->k : string +>n : "hello" +>p : "hello" +>k : "hello" } module m2 { >m2 : typeof m2 export const k = a; ->k : string ->a : string +>k : "hello" +>a : "hello" export const l: string = b, m = k; >l : string >b : string ->m : string ->k : string +>m : "hello" +>k : "hello" const n = m1.k; ->n : string ->m1.k : string +>n : "hello" +>m1.k : "hello" >m1 : typeof m1 ->k : string +>k : "hello" const o: string = n, p = k; >o : string ->n : string ->p : string ->k : string +>n : "hello" +>p : "hello" +>k : "hello" } diff --git a/tests/baselines/reference/es6ModuleConstEnumDeclaration.types b/tests/baselines/reference/es6ModuleConstEnumDeclaration.types index fae819f93b06f..1ad8f9c461517 100644 --- a/tests/baselines/reference/es6ModuleConstEnumDeclaration.types +++ b/tests/baselines/reference/es6ModuleConstEnumDeclaration.types @@ -3,37 +3,37 @@ export const enum e1 { >e1 : e1 a, ->a : e1 +>a : e1.a b, ->b : e1 +>b : e1.b c ->c : e1 +>c : e1.c } const enum e2 { >e2 : e2 x, ->x : e2 +>x : e2.x y, ->y : e2 +>y : e2.y z ->z : e2 +>z : e2.z } var x = e1.a; >x : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y = e2.x; >y : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x export module m1 { >m1 : typeof m1 @@ -42,49 +42,49 @@ export module m1 { >e3 : e3 a, ->a : e3 +>a : e3.a b, ->b : e3 +>b : e3.b c ->c : e3 +>c : e3.c } const enum e4 { >e4 : e4 x, ->x : e4 +>x : e4.x y, ->y : e4 +>y : e4.y z ->z : e4 +>z : e4.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e3.a; >x2 : e3 ->e3.a : e3 +>e3.a : e3.a >e3 : typeof e3 ->a : e3 +>a : e3.a var y2 = e4.x; >y2 : e4 ->e4.x : e4 +>e4.x : e4.x >e4 : typeof e4 ->x : e4 +>x : e4.x } module m2 { >m2 : typeof m2 @@ -93,55 +93,55 @@ module m2 { >e5 : e5 a, ->a : e5 +>a : e5.a b, ->b : e5 +>b : e5.b c ->c : e5 +>c : e5.c } const enum e6 { >e6 : e6 x, ->x : e6 +>x : e6.x y, ->y : e6 +>y : e6.y z ->z : e6 +>z : e6.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e5.a; >x2 : e5 ->e5.a : e5 +>e5.a : e5.a >e5 : typeof e5 ->a : e5 +>a : e5.a var y2 = e6.x; >y2 : e6 ->e6.x : e6 +>e6.x : e6.x >e6 : typeof e6 ->x : e6 +>x : e6.x var x3 = m1.e3.a; >x3 : m1.e3 ->m1.e3.a : m1.e3 +>m1.e3.a : m1.e3.a >m1.e3 : typeof m1.e3 >m1 : typeof m1 >e3 : typeof m1.e3 ->a : m1.e3 +>a : m1.e3.a } diff --git a/tests/baselines/reference/es6ModuleConstEnumDeclaration2.types b/tests/baselines/reference/es6ModuleConstEnumDeclaration2.types index c43a938c9b6a8..ee0cb195a1aed 100644 --- a/tests/baselines/reference/es6ModuleConstEnumDeclaration2.types +++ b/tests/baselines/reference/es6ModuleConstEnumDeclaration2.types @@ -4,37 +4,37 @@ export const enum e1 { >e1 : e1 a, ->a : e1 +>a : e1.a b, ->b : e1 +>b : e1.b c ->c : e1 +>c : e1.c } const enum e2 { >e2 : e2 x, ->x : e2 +>x : e2.x y, ->y : e2 +>y : e2.y z ->z : e2 +>z : e2.z } var x = e1.a; >x : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y = e2.x; >y : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x export module m1 { >m1 : typeof m1 @@ -43,49 +43,49 @@ export module m1 { >e3 : e3 a, ->a : e3 +>a : e3.a b, ->b : e3 +>b : e3.b c ->c : e3 +>c : e3.c } const enum e4 { >e4 : e4 x, ->x : e4 +>x : e4.x y, ->y : e4 +>y : e4.y z ->z : e4 +>z : e4.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e3.a; >x2 : e3 ->e3.a : e3 +>e3.a : e3.a >e3 : typeof e3 ->a : e3 +>a : e3.a var y2 = e4.x; >y2 : e4 ->e4.x : e4 +>e4.x : e4.x >e4 : typeof e4 ->x : e4 +>x : e4.x } module m2 { >m2 : typeof m2 @@ -94,55 +94,55 @@ module m2 { >e5 : e5 a, ->a : e5 +>a : e5.a b, ->b : e5 +>b : e5.b c ->c : e5 +>c : e5.c } const enum e6 { >e6 : e6 x, ->x : e6 +>x : e6.x y, ->y : e6 +>y : e6.y z ->z : e6 +>z : e6.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e5.a; >x2 : e5 ->e5.a : e5 +>e5.a : e5.a >e5 : typeof e5 ->a : e5 +>a : e5.a var y2 = e6.x; >y2 : e6 ->e6.x : e6 +>e6.x : e6.x >e6 : typeof e6 ->x : e6 +>x : e6.x var x3 = m1.e3.a; >x3 : m1.e3 ->m1.e3.a : m1.e3 +>m1.e3.a : m1.e3.a >m1.e3 : typeof m1.e3 >m1 : typeof m1 >e3 : typeof m1.e3 ->a : m1.e3 +>a : m1.e3.a } diff --git a/tests/baselines/reference/es6ModuleEnumDeclaration.types b/tests/baselines/reference/es6ModuleEnumDeclaration.types index 4b856fee00902..1088051075846 100644 --- a/tests/baselines/reference/es6ModuleEnumDeclaration.types +++ b/tests/baselines/reference/es6ModuleEnumDeclaration.types @@ -3,37 +3,37 @@ export enum e1 { >e1 : e1 a, ->a : e1 +>a : e1.a b, ->b : e1 +>b : e1.b c ->c : e1 +>c : e1.c } enum e2 { >e2 : e2 x, ->x : e2 +>x : e2.x y, ->y : e2 +>y : e2.y z ->z : e2 +>z : e2.z } var x = e1.a; >x : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y = e2.x; >y : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x export module m1 { >m1 : typeof m1 @@ -42,49 +42,49 @@ export module m1 { >e3 : e3 a, ->a : e3 +>a : e3.a b, ->b : e3 +>b : e3.b c ->c : e3 +>c : e3.c } enum e4 { >e4 : e4 x, ->x : e4 +>x : e4.x y, ->y : e4 +>y : e4.y z ->z : e4 +>z : e4.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e3.a; >x2 : e3 ->e3.a : e3 +>e3.a : e3.a >e3 : typeof e3 ->a : e3 +>a : e3.a var y2 = e4.x; >y2 : e4 ->e4.x : e4 +>e4.x : e4.x >e4 : typeof e4 ->x : e4 +>x : e4.x } module m2 { >m2 : typeof m2 @@ -93,55 +93,55 @@ module m2 { >e5 : e5 a, ->a : e5 +>a : e5.a b, ->b : e5 +>b : e5.b c ->c : e5 +>c : e5.c } enum e6 { >e6 : e6 x, ->x : e6 +>x : e6.x y, ->y : e6 +>y : e6.y z ->z : e6 +>z : e6.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e5.a; >x2 : e5 ->e5.a : e5 +>e5.a : e5.a >e5 : typeof e5 ->a : e5 +>a : e5.a var y2 = e6.x; >y2 : e6 ->e6.x : e6 +>e6.x : e6.x >e6 : typeof e6 ->x : e6 +>x : e6.x var x3 = m1.e3.a; >x3 : m1.e3 ->m1.e3.a : m1.e3 +>m1.e3.a : m1.e3.a >m1.e3 : typeof m1.e3 >m1 : typeof m1 >e3 : typeof m1.e3 ->a : m1.e3 +>a : m1.e3.a } diff --git a/tests/baselines/reference/es6ModuleInternalImport.types b/tests/baselines/reference/es6ModuleInternalImport.types index 5d7fd527afd31..08dc2a9bcbe42 100644 --- a/tests/baselines/reference/es6ModuleInternalImport.types +++ b/tests/baselines/reference/es6ModuleInternalImport.types @@ -4,7 +4,7 @@ export module m { export var a = 10; >a : number ->10 : number +>10 : 10 } export import a1 = m.a; >a1 : number diff --git a/tests/baselines/reference/es6ModuleLet.types b/tests/baselines/reference/es6ModuleLet.types index 9e670c0a1e17b..a8bfb89dd6ee7 100644 --- a/tests/baselines/reference/es6ModuleLet.types +++ b/tests/baselines/reference/es6ModuleLet.types @@ -1,7 +1,7 @@ === tests/cases/compiler/es6ModuleLet.ts === export let a = "hello"; >a : string ->"hello" : string +>"hello" : "hello" export let x: string = a, y = x; >x : string diff --git a/tests/baselines/reference/es6ModuleModuleDeclaration.types b/tests/baselines/reference/es6ModuleModuleDeclaration.types index 6fb5a7c98f5cd..4e0f309457b09 100644 --- a/tests/baselines/reference/es6ModuleModuleDeclaration.types +++ b/tests/baselines/reference/es6ModuleModuleDeclaration.types @@ -4,33 +4,33 @@ export module m1 { export var a = 10; >a : number ->10 : number +>10 : 10 var b = 10; >b : number ->10 : number +>10 : 10 export module innerExportedModule { >innerExportedModule : typeof innerExportedModule export var k = 10; >k : number ->10 : number +>10 : 10 var l = 10; >l : number ->10 : number +>10 : 10 } export module innerNonExportedModule { >innerNonExportedModule : typeof innerNonExportedModule export var x = 10; >x : number ->10 : number +>10 : 10 var y = 10; >y : number ->10 : number +>10 : 10 } } module m2 { @@ -38,32 +38,32 @@ module m2 { export var a = 10; >a : number ->10 : number +>10 : 10 var b = 10; >b : number ->10 : number +>10 : 10 export module innerExportedModule { >innerExportedModule : typeof innerExportedModule export var k = 10; >k : number ->10 : number +>10 : 10 var l = 10; >l : number ->10 : number +>10 : 10 } export module innerNonExportedModule { >innerNonExportedModule : typeof innerNonExportedModule export var x = 10; >x : number ->10 : number +>10 : 10 var y = 10; >y : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/es6ModuleVariableStatement.types b/tests/baselines/reference/es6ModuleVariableStatement.types index 520430199e4d7..00278b6511c7f 100644 --- a/tests/baselines/reference/es6ModuleVariableStatement.types +++ b/tests/baselines/reference/es6ModuleVariableStatement.types @@ -1,7 +1,7 @@ === tests/cases/compiler/es6ModuleVariableStatement.ts === export var a = "hello"; >a : string ->"hello" : string +>"hello" : "hello" export var x: string = a, y = x; >x : string diff --git a/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.types b/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.types index 067ceb005e8e2..90b9afbe02e3e 100644 --- a/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.types +++ b/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.types b/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.types index 58f0f89f955d8..31fc40eeabd35 100644 --- a/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.types +++ b/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6modulekind.types b/tests/baselines/reference/es6modulekind.types index d7fde0c7d4426..8994eb6657a4f 100644 --- a/tests/baselines/reference/es6modulekind.types +++ b/tests/baselines/reference/es6modulekind.types @@ -12,6 +12,6 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6modulekindWithES2015Target.types b/tests/baselines/reference/es6modulekindWithES2015Target.types index 63acdae43d185..313fb612d8e51 100644 --- a/tests/baselines/reference/es6modulekindWithES2015Target.types +++ b/tests/baselines/reference/es6modulekindWithES2015Target.types @@ -12,6 +12,6 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6modulekindWithES5Target.types b/tests/baselines/reference/es6modulekindWithES5Target.types index f7232f2049481..4b620fb9e17b0 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target.types +++ b/tests/baselines/reference/es6modulekindWithES5Target.types @@ -5,11 +5,11 @@ export class C { static s = 0; >s : number ->0 : number +>0 : 0 p = 1; >p : number ->1 : number +>1 : 1 method() { } >method : () => void @@ -30,11 +30,11 @@ export class D { static s = 0; >s : number ->0 : number +>0 : 0 p = 1; >p : number ->1 : number +>1 : 1 method() { } >method : () => void diff --git a/tests/baselines/reference/es6modulekindWithES5Target11.types b/tests/baselines/reference/es6modulekindWithES5Target11.types index 51fbe3710171c..e3d922c044334 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target11.types +++ b/tests/baselines/reference/es6modulekindWithES5Target11.types @@ -18,11 +18,11 @@ export default class C { static y = 1 >y : number ->1 : number +>1 : 1 p = 1; >p : number ->1 : number +>1 : 1 method() { } >method : () => void diff --git a/tests/baselines/reference/es6modulekindWithES5Target2.types b/tests/baselines/reference/es6modulekindWithES5Target2.types index 04b5e5b990516..6ad697e0c25ad 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target2.types +++ b/tests/baselines/reference/es6modulekindWithES5Target2.types @@ -5,11 +5,11 @@ export default class C { static s = 0; >s : number ->0 : number +>0 : 0 p = 1; >p : number ->1 : number +>1 : 1 method() { } >method : () => void diff --git a/tests/baselines/reference/es6modulekindWithES5Target3.types b/tests/baselines/reference/es6modulekindWithES5Target3.types index 5bc8c69c01a40..78928f56dddc0 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target3.types +++ b/tests/baselines/reference/es6modulekindWithES5Target3.types @@ -13,11 +13,11 @@ export default class D { static s = 0; >s : number ->0 : number +>0 : 0 p = 1; >p : number ->1 : number +>1 : 1 method() { } >method : () => void diff --git a/tests/baselines/reference/es6modulekindWithES5Target6.types b/tests/baselines/reference/es6modulekindWithES5Target6.types index 932493ef06339..de43a987d4d50 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target6.types +++ b/tests/baselines/reference/es6modulekindWithES5Target6.types @@ -3,7 +3,7 @@ export function f1(d = 0) { >f1 : (d?: number) => void >d : number ->0 : number +>0 : 0 } export function f2(...arg) { @@ -14,6 +14,6 @@ export function f2(...arg) { export default function f3(d = 0) { >f3 : (d?: number) => void >d : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/es6modulekindWithES5Target7.types b/tests/baselines/reference/es6modulekindWithES5Target7.types index f1404c7883aa2..1c3add3b03110 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target7.types +++ b/tests/baselines/reference/es6modulekindWithES5Target7.types @@ -5,7 +5,7 @@ export namespace N { var x = 0; >x : number ->0 : number +>0 : 0 } export namespace N2 { diff --git a/tests/baselines/reference/es6modulekindWithES5Target8.types b/tests/baselines/reference/es6modulekindWithES5Target8.types index 4017b02a471f8..754decea3125a 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target8.types +++ b/tests/baselines/reference/es6modulekindWithES5Target8.types @@ -1,10 +1,10 @@ === tests/cases/compiler/es6modulekindWithES5Target8.ts === export const c = 0; ->c : number ->0 : number +>c : 0 +>0 : 0 export let l = 1; >l : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/escapedIdentifiers.types b/tests/baselines/reference/escapedIdentifiers.types index 151408de30892..e7f19d7144c3d 100644 --- a/tests/baselines/reference/escapedIdentifiers.types +++ b/tests/baselines/reference/escapedIdentifiers.types @@ -14,7 +14,7 @@ // var decl var \u0061 = 1; >\u0061 : number ->1 : number +>1 : 1 a ++; >a ++ : number @@ -26,7 +26,7 @@ a ++; var b = 1; >b : number ->1 : number +>1 : 1 b ++; >b ++ : number @@ -51,32 +51,32 @@ module moduleType\u0032 { } moduleType1.baz1 = 3; ->moduleType1.baz1 = 3 : number +>moduleType1.baz1 = 3 : 3 >moduleType1.baz1 : number >moduleType1 : typeof moduleType1 >baz1 : number ->3 : number +>3 : 3 moduleType\u0031.baz1 = 3; ->moduleType\u0031.baz1 = 3 : number +>moduleType\u0031.baz1 = 3 : 3 >moduleType\u0031.baz1 : number >moduleType\u0031 : typeof moduleType1 >baz1 : number ->3 : number +>3 : 3 moduleType2.baz2 = 3; ->moduleType2.baz2 = 3 : number +>moduleType2.baz2 = 3 : 3 >moduleType2.baz2 : number >moduleType2 : typeof moduleType\u0032 >baz2 : number ->3 : number +>3 : 3 moduleType\u0032.baz2 = 3; ->moduleType\u0032.baz2 = 3 : number +>moduleType\u0032.baz2 = 3 : 3 >moduleType\u0032.baz2 : number >moduleType\u0032 : typeof moduleType\u0032 >baz2 : number ->3 : number +>3 : 3 // classes @@ -99,11 +99,11 @@ var classType1Object1 = new classType1(); >classType1 : typeof classType1 classType1Object1.foo1 = 2; ->classType1Object1.foo1 = 2 : number +>classType1Object1.foo1 = 2 : 2 >classType1Object1.foo1 : number >classType1Object1 : classType1 >foo1 : number ->2 : number +>2 : 2 var classType1Object2 = new classType\u0031(); >classType1Object2 : classType1 @@ -111,11 +111,11 @@ var classType1Object2 = new classType\u0031(); >classType\u0031 : typeof classType1 classType1Object2.foo1 = 2; ->classType1Object2.foo1 = 2 : number +>classType1Object2.foo1 = 2 : 2 >classType1Object2.foo1 : number >classType1Object2 : classType1 >foo1 : number ->2 : number +>2 : 2 var classType2Object1 = new classType2(); >classType2Object1 : classType\u0032 @@ -123,11 +123,11 @@ var classType2Object1 = new classType2(); >classType2 : typeof classType\u0032 classType2Object1.foo2 = 2; ->classType2Object1.foo2 = 2 : number +>classType2Object1.foo2 = 2 : 2 >classType2Object1.foo2 : number >classType2Object1 : classType\u0032 >foo2 : number ->2 : number +>2 : 2 var classType2Object2 = new classType\u0032(); >classType2Object2 : classType\u0032 @@ -135,11 +135,11 @@ var classType2Object2 = new classType\u0032(); >classType\u0032 : typeof classType\u0032 classType2Object2.foo2 = 2; ->classType2Object2.foo2 = 2 : number +>classType2Object2.foo2 = 2 : 2 >classType2Object2.foo2 : number >classType2Object2 : classType\u0032 >foo2 : number ->2 : number +>2 : 2 // interfaces interface interfaceType1 { @@ -161,14 +161,14 @@ var interfaceType1Object1 = { bar1: 0 }; >interfaceType1 : interfaceType1 >{ bar1: 0 } : { bar1: number; } >bar1 : number ->0 : number +>0 : 0 interfaceType1Object1.bar1 = 2; ->interfaceType1Object1.bar1 = 2 : number +>interfaceType1Object1.bar1 = 2 : 2 >interfaceType1Object1.bar1 : number >interfaceType1Object1 : interfaceType1 >bar1 : number ->2 : number +>2 : 2 var interfaceType1Object2 = { bar1: 0 }; >interfaceType1Object2 : interfaceType1 @@ -176,14 +176,14 @@ var interfaceType1Object2 = { bar1: 0 }; >interfaceType\u0031 : interfaceType1 >{ bar1: 0 } : { bar1: number; } >bar1 : number ->0 : number +>0 : 0 interfaceType1Object2.bar1 = 2; ->interfaceType1Object2.bar1 = 2 : number +>interfaceType1Object2.bar1 = 2 : 2 >interfaceType1Object2.bar1 : number >interfaceType1Object2 : interfaceType1 >bar1 : number ->2 : number +>2 : 2 var interfaceType2Object1 = { bar2: 0 }; >interfaceType2Object1 : interfaceType\u0032 @@ -191,14 +191,14 @@ var interfaceType2Object1 = { bar2: 0 }; >interfaceType2 : interfaceType\u0032 >{ bar2: 0 } : { bar2: number; } >bar2 : number ->0 : number +>0 : 0 interfaceType2Object1.bar2 = 2; ->interfaceType2Object1.bar2 = 2 : number +>interfaceType2Object1.bar2 = 2 : 2 >interfaceType2Object1.bar2 : number >interfaceType2Object1 : interfaceType\u0032 >bar2 : number ->2 : number +>2 : 2 var interfaceType2Object2 = { bar2: 0 }; >interfaceType2Object2 : interfaceType\u0032 @@ -206,14 +206,14 @@ var interfaceType2Object2 = { bar2: 0 }; >interfaceType\u0032 : interfaceType\u0032 >{ bar2: 0 } : { bar2: number; } >bar2 : number ->0 : number +>0 : 0 interfaceType2Object2.bar2 = 2; ->interfaceType2Object2.bar2 = 2 : number +>interfaceType2Object2.bar2 = 2 : 2 >interfaceType2Object2.bar2 : number >interfaceType2Object2 : interfaceType\u0032 >bar2 : number ->2 : number +>2 : 2 // arguments @@ -228,14 +228,14 @@ class testClass { >arg4 : number arg\u0031 = 1; ->arg\u0031 = 1 : number +>arg\u0031 = 1 : 1 >arg\u0031 : number ->1 : number +>1 : 1 arg2 = 'string'; ->arg2 = 'string' : string +>arg2 = 'string' : "string" >arg2 : string ->'string' : string +>'string' : "string" arg\u0033 = true; >arg\u0033 = true : true @@ -243,9 +243,9 @@ class testClass { >true : true arg4 = 2; ->arg4 = 2 : number +>arg4 = 2 : 2 >arg4 : number ->2 : number +>2 : 2 } } @@ -264,24 +264,24 @@ var constructorTestObject = new constructorTestClass(1, 'string', true, 2); >constructorTestObject : constructorTestClass >new constructorTestClass(1, 'string', true, 2) : constructorTestClass >constructorTestClass : typeof constructorTestClass ->1 : number ->'string' : string +>1 : 1 +>'string' : "string" >true : true ->2 : number +>2 : 2 constructorTestObject.arg\u0031 = 1; ->constructorTestObject.arg\u0031 = 1 : number +>constructorTestObject.arg\u0031 = 1 : 1 >constructorTestObject.arg\u0031 : number >constructorTestObject : constructorTestClass >arg\u0031 : number ->1 : number +>1 : 1 constructorTestObject.arg2 = 'string'; ->constructorTestObject.arg2 = 'string' : string +>constructorTestObject.arg2 = 'string' : "string" >constructorTestObject.arg2 : string >constructorTestObject : constructorTestClass >arg2 : string ->'string' : string +>'string' : "string" constructorTestObject.arg\u0033 = true; >constructorTestObject.arg\u0033 = true : true @@ -291,11 +291,11 @@ constructorTestObject.arg\u0033 = true; >true : true constructorTestObject.arg4 = 2; ->constructorTestObject.arg4 = 2 : number +>constructorTestObject.arg4 = 2 : 2 >constructorTestObject.arg4 : number >constructorTestObject : constructorTestClass >arg4 : number ->2 : number +>2 : 2 // Lables @@ -303,10 +303,10 @@ l\u0061bel1: >l\u0061bel1 : any while (false) ->false : boolean +>false : false { while(false) ->false : boolean +>false : false continue label1; // it will go to next iteration of outer loop >label1 : any @@ -316,10 +316,10 @@ label2: >label2 : any while (false) ->false : boolean +>false : false { while(false) ->false : boolean +>false : false continue l\u0061bel2; // it will go to next iteration of outer loop >l\u0061bel2 : any @@ -329,10 +329,10 @@ label3: >label3 : any while (false) ->false : boolean +>false : false { while(false) ->false : boolean +>false : false continue label3; // it will go to next iteration of outer loop >label3 : any @@ -342,10 +342,10 @@ l\u0061bel4: >l\u0061bel4 : any while (false) ->false : boolean +>false : false { while(false) ->false : boolean +>false : false continue l\u0061bel4; // it will go to next iteration of outer loop >l\u0061bel4 : any diff --git a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types index 1ebbf8aedb2b5..1cecaaa74f0f4 100644 --- a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types +++ b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types @@ -2,21 +2,21 @@ // double underscores var __proto__ = 10; >__proto__ : number ->10 : number +>10 : 10 var o = { >o : { "__proto__": number; } >{ "__proto__": 0} : { "__proto__": number; } "__proto__": 0 ->0 : number +>0 : 0 }; var b = o["__proto__"]; >b : number >o["__proto__"] : number >o : { "__proto__": number; } ->"__proto__" : string +>"__proto__" : "___proto__" var o1 = { >o1 : { __proto__: number; } @@ -24,33 +24,33 @@ var o1 = { __proto__: 0 >__proto__ : number ->0 : number +>0 : 0 }; var b1 = o1["__proto__"]; >b1 : number >o1["__proto__"] : number >o1 : { __proto__: number; } ->"__proto__" : string +>"__proto__" : "___proto__" // Triple underscores var ___proto__ = 10; >___proto__ : number ->10 : number +>10 : 10 var o2 = { >o2 : { "___proto__": number; } >{ "___proto__": 0} : { "___proto__": number; } "___proto__": 0 ->0 : number +>0 : 0 }; var b2 = o2["___proto__"]; >b2 : number >o2["___proto__"] : number >o2 : { "___proto__": number; } ->"___proto__" : string +>"___proto__" : "____proto__" var o3 = { >o3 : { ___proto__: number; } @@ -58,33 +58,33 @@ var o3 = { ___proto__: 0 >___proto__ : number ->0 : number +>0 : 0 }; var b3 = o3["___proto__"]; >b3 : number >o3["___proto__"] : number >o3 : { ___proto__: number; } ->"___proto__" : string +>"___proto__" : "____proto__" // One underscore var _proto__ = 10; >_proto__ : number ->10 : number +>10 : 10 var o4 = { >o4 : { "_proto__": number; } >{ "_proto__": 0} : { "_proto__": number; } "_proto__": 0 ->0 : number +>0 : 0 }; var b4 = o4["_proto__"]; >b4 : number >o4["_proto__"] : number >o4 : { "_proto__": number; } ->"_proto__" : string +>"_proto__" : "_proto__" var o5 = { >o5 : { _proto__: number; } @@ -92,12 +92,12 @@ var o5 = { _proto__: 0 >_proto__ : number ->0 : number +>0 : 0 }; var b5 = o5["_proto__"]; >b5 : number >o5["_proto__"] : number >o5 : { _proto__: number; } ->"_proto__" : string +>"_proto__" : "_proto__" diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types index 0e7059f4eed3c..d1843aebb1ab0 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types @@ -37,7 +37,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string ->42 : number +>42 : 42 module M { >M : typeof M @@ -60,18 +60,18 @@ module M { var aNumber: number = 9.9; >aNumber : number ->9.9 : number +>9.9 : 9.9 var aString: string = 'this is a string'; >aString : string ->'this is a string' : string +>'this is a string' : "this is a string" var aDate: Date = new Date(12); >aDate : Date >Date : Date >new Date(12) : Date >Date : DateConstructor ->12 : number +>12 : 12 var anObject: Object = new Object(); >anObject : Object @@ -114,7 +114,7 @@ var anObjectLiteral: I = { id: 12 }; >I : I >{ id: 12 } : { id: number; } >id : number ->12 : number +>12 : 12 var anOtherObjectLiteral: { id: number } = new C(); >anOtherObjectLiteral : { id: number; } @@ -137,7 +137,7 @@ var aLambda: typeof F = (x) => 2; >F : (x: string) => number >(x) => 2 : (x: string) => number >x : string ->2 : number +>2 : 2 var aModule: typeof M = M; >aModule : typeof M @@ -160,6 +160,6 @@ var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; >F2 : (x: number) => string >(x) => 'this is a string' : (x: number) => string >x : number ->'this is a string' : string +>'this is a string' : "this is a string" diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 13c2058b65774..5302f856c6f29 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type 'number' is not assignable to type 'Date'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2322: Type '"this is a string"' is not assignable to type 'number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2322: Type '9.9' is not assignable to type 'string'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type '9.9' is not assignable to type 'Date'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2322: Type '9.9' is not assignable to type 'void'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2322: Type 'D<{}>' is not assignable to type 'I'. Property 'id' is missing in type 'D<{}>'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(41,5): error TS2322: Type 'D<{}>' is not assignable to type 'C'. @@ -68,17 +68,17 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd var aNumber: number = 'this is a string'; ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"this is a string"' is not assignable to type 'number'. var aString: string = 9.9; ~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '9.9' is not assignable to type 'string'. var aDate: Date = 9.9; ~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'Date'. +!!! error TS2322: Type '9.9' is not assignable to type 'Date'. var aVoid: void = 9.9; ~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type '9.9' is not assignable to type 'void'. var anInterface: I = new D(); ~~~~~~~~~~~ diff --git a/tests/baselines/reference/everyTypeWithInitializer.types b/tests/baselines/reference/everyTypeWithInitializer.types index abc0e770e3505..947eff14f7fc8 100644 --- a/tests/baselines/reference/everyTypeWithInitializer.types +++ b/tests/baselines/reference/everyTypeWithInitializer.types @@ -37,7 +37,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string ->42 : number +>42 : 42 module M { >M : typeof M @@ -60,17 +60,17 @@ module M { var aNumber = 9.9; >aNumber : number ->9.9 : number +>9.9 : 9.9 var aString = 'this is a string'; >aString : string ->'this is a string' : string +>'this is a string' : "this is a string" var aDate = new Date(12); >aDate : Date >new Date(12) : Date >Date : DateConstructor ->12 : number +>12 : 12 var anObject = new Object(); >anObject : Object @@ -106,7 +106,7 @@ var anObjectLiteral = { id: 12 }; >anObjectLiteral : { id: number; } >{ id: 12 } : { id: number; } >id : number ->12 : number +>12 : 12 var aFunction = F; >aFunction : (x: string) => number @@ -116,7 +116,7 @@ var aLambda = (x) => 2; >aLambda : (x: any) => number >(x) => 2 : (x: any) => number >x : any ->2 : number +>2 : 2 var aModule = M; >aModule : typeof M diff --git a/tests/baselines/reference/excessPropertyErrorsSuppressed.types b/tests/baselines/reference/excessPropertyErrorsSuppressed.types index 47a4dbf92a970..c0b8f66d84048 100644 --- a/tests/baselines/reference/excessPropertyErrorsSuppressed.types +++ b/tests/baselines/reference/excessPropertyErrorsSuppressed.types @@ -5,7 +5,7 @@ var x: { a: string } = { a: "hello", b: 42 }; // No error >a : string >{ a: "hello", b: 42 } : { a: string; b: number; } >a : string ->"hello" : string +>"hello" : "hello" >b : number ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types b/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types index ec48b80f192f5..6e8b3cb3d2bdf 100644 --- a/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types +++ b/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types @@ -22,30 +22,30 @@ var r3 = a ** 0; >r3 : number >a ** 0 : number >a : any ->0 : number +>0 : 0 var r4 = 0 ** a; >r4 : number >0 ** a : number ->0 : number +>0 : 0 >a : any var r5 = 0 ** 0; >r5 : number >0 ** 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var r6 = b ** 0; >r6 : number >b ** 0 : number >b : number ->0 : number +>0 : 0 var r7 = 0 ** b; >r7 : number >0 ** b : number ->0 : number +>0 : 0 >b : number var r8 = b ** b; diff --git a/tests/baselines/reference/exponentiationOperatorWithEnum.types b/tests/baselines/reference/exponentiationOperatorWithEnum.types index 037ff9d126118..9609e13000bed 100644 --- a/tests/baselines/reference/exponentiationOperatorWithEnum.types +++ b/tests/baselines/reference/exponentiationOperatorWithEnum.types @@ -5,10 +5,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -55,58 +55,58 @@ var r5 = b ** c; var r6 = E.a ** a; >r6 : number >E.a ** a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var r7 = E.a ** b; >r7 : number >E.a ** b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var r8 = E.a ** E.b; >r8 : number >E.a ** E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r9 = E.a ** 1; >r9 : number >E.a ** 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var r10 = a ** E.b; >r10 : number >a ** E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r11 = b ** E.b; >r11 : number >b ** E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r12 = 1 ** E.b; >r12 : number >1 ** E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types b/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types index 5be479b9e6373..52b714d951fd8 100644 --- a/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types +++ b/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types @@ -5,19 +5,19 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } enum F { >F : F c, ->c : F +>c : F.c d ->d : F +>d : F.d } var a: any; @@ -65,58 +65,58 @@ var r5 = b ** c; var r6 = E.a ** a; >r6 : number >E.a ** a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var r7 = E.a ** b; >r7 : number >E.a ** b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var r8 = E.a ** E.b; >r8 : number >E.a ** E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r9 = E.a ** 1; >r9 : number >E.a ** 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var r10 = a ** E.b; >r10 : number >a ** E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r11 = b ** E.b; >r11 : number >b ** E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r12 = 1 ** E.b; >r12 : number >1 ** E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types b/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types index 2a3c48077636d..3d9841a18ef42 100644 --- a/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types +++ b/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types @@ -6,10 +6,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -35,15 +35,15 @@ var r3 = null ** 1; >r3 : number >null ** 1 : number >null : null ->1 : number +>1 : 1 var r4 = null ** E.a; >r4 : number >null ** E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var r5 = a ** null; >r5 : number @@ -60,14 +60,14 @@ var r6 = b ** null; var r7 = 0 ** null; >r7 : number >0 ** null : number ->0 : number +>0 : 0 >null : null var r8 = E.b ** null; >r8 : number >E.b ** null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null diff --git a/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types index 4e44144511e35..7ccc43df30c9c 100644 --- a/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types +++ b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types @@ -6,10 +6,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -35,15 +35,15 @@ var rk3 = undefined ** 1; >rk3 : number >undefined ** 1 : number >undefined : undefined ->1 : number +>1 : 1 var rk4 = undefined ** E.a; >rk4 : number >undefined ** E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rk5 = a ** undefined; >rk5 : number @@ -60,14 +60,14 @@ var rk6 = b ** undefined; var rk7 = 0 ** undefined; >rk7 : number >0 ** undefined : number ->0 : number +>0 : 0 >undefined : undefined var rk8 = E.b ** undefined; >rk8 : number >E.b ** undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined diff --git a/tests/baselines/reference/exportArrayBindingPattern.types b/tests/baselines/reference/exportArrayBindingPattern.types index bfc1e461dd5fa..f3ea5b2592bc8 100644 --- a/tests/baselines/reference/exportArrayBindingPattern.types +++ b/tests/baselines/reference/exportArrayBindingPattern.types @@ -5,9 +5,9 @@ const [a, , b] = [1, 2, 3]; > : undefined >b : number >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 export { a, b }; >a : number diff --git a/tests/baselines/reference/exportAssignDottedName.types b/tests/baselines/reference/exportAssignDottedName.types index 6fceb21231cba..a2dd681ed8a1f 100644 --- a/tests/baselines/reference/exportAssignDottedName.types +++ b/tests/baselines/reference/exportAssignDottedName.types @@ -12,6 +12,6 @@ export function x(){ >x : () => boolean return true; ->true : boolean +>true : true } diff --git a/tests/baselines/reference/exportAssignImportedIdentifier.types b/tests/baselines/reference/exportAssignImportedIdentifier.types index e70de6936241c..f07e908695e07 100644 --- a/tests/baselines/reference/exportAssignImportedIdentifier.types +++ b/tests/baselines/reference/exportAssignImportedIdentifier.types @@ -12,7 +12,7 @@ export function x(){ >x : () => boolean return true; ->true : boolean +>true : true } === tests/cases/conformance/externalModules/foo2.ts === diff --git a/tests/baselines/reference/exportAssignTypes.types b/tests/baselines/reference/exportAssignTypes.types index dc99d1512f1b3..a25a55bfd41e1 100644 --- a/tests/baselines/reference/exportAssignTypes.types +++ b/tests/baselines/reference/exportAssignTypes.types @@ -57,7 +57,7 @@ var v7: {(p1: x): x} = iGeneric; === tests/cases/conformance/externalModules/expString.ts === var x = "test"; >x : string ->"test" : string +>"test" : "test" export = x; >x : string @@ -65,7 +65,7 @@ export = x; === tests/cases/conformance/externalModules/expNumber.ts === var x = 42; >x : number ->42 : number +>42 : 42 export = x; >x : number @@ -73,7 +73,7 @@ export = x; === tests/cases/conformance/externalModules/expBoolean.ts === var x = true; >x : boolean ->true : boolean +>true : true export = x; >x : boolean @@ -82,8 +82,8 @@ export = x; var x = [1,2]; >x : number[] >[1,2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 export = x; >x : number[] @@ -93,9 +93,9 @@ var x = { answer: 42, when: 1776}; >x : { answer: number; when: number; } >{ answer: 42, when: 1776} : { answer: number; when: number; } >answer : number ->42 : number +>42 : 42 >when : number ->1776 : number +>1776 : 1776 export = x; >x : { answer: number; when: number; } diff --git a/tests/baselines/reference/exportAssignValueAndType.types b/tests/baselines/reference/exportAssignValueAndType.types index 2dc7442b9aca8..221033220f5b2 100644 --- a/tests/baselines/reference/exportAssignValueAndType.types +++ b/tests/baselines/reference/exportAssignValueAndType.types @@ -21,7 +21,7 @@ interface server { var x = 5; >x : number ->5 : number +>5 : 5 var server = new Date(); >server : Date diff --git a/tests/baselines/reference/exportAssignmentClass.types b/tests/baselines/reference/exportAssignmentClass.types index b724c837244d4..6081d96558416 100644 --- a/tests/baselines/reference/exportAssignmentClass.types +++ b/tests/baselines/reference/exportAssignmentClass.types @@ -17,7 +17,7 @@ var x = d.p; class C { public p = 0; } >C : C >p : number ->0 : number +>0 : 0 export = C; >C : C diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt index cf63c48925fde..5ba27334f5ea8 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/externalModules/foo_1.ts(2,17): error TS2345: Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'. +tests/cases/conformance/externalModules/foo_1.ts(2,17): error TS2345: Argument of type 'true' is not assignable to parameter of type '{ a: string; b: number; }'. ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require("./foo_0"); var x = new foo(true); // Should error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type '{ a: string; b: number; }'. var y = new foo({a: "test", b: 42}); // Should be OK var z: number = y.test.b; ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/exportAssignmentEnum.types b/tests/baselines/reference/exportAssignmentEnum.types index a186cf6f2559a..23a3fd4d14148 100644 --- a/tests/baselines/reference/exportAssignmentEnum.types +++ b/tests/baselines/reference/exportAssignmentEnum.types @@ -4,34 +4,34 @@ import EnumE = require("./exportAssignmentEnum_A"); var a = EnumE.A; >a : EnumE ->EnumE.A : EnumE +>EnumE.A : EnumE.A >EnumE : typeof EnumE ->A : EnumE +>A : EnumE.A var b = EnumE.B; >b : EnumE ->EnumE.B : EnumE +>EnumE.B : EnumE.B >EnumE : typeof EnumE ->B : EnumE +>B : EnumE.B var c = EnumE.C; >c : EnumE ->EnumE.C : EnumE +>EnumE.C : EnumE.C >EnumE : typeof EnumE ->C : EnumE +>C : EnumE.C === tests/cases/compiler/exportAssignmentEnum_A.ts === enum E { >E : E A, ->A : E +>A : E.A B, ->B : E +>B : E.B C, ->C : E +>C : E.C } export = E; diff --git a/tests/baselines/reference/exportAssignmentFunction.types b/tests/baselines/reference/exportAssignmentFunction.types index bd10465d2219b..e22cb0617391c 100644 --- a/tests/baselines/reference/exportAssignmentFunction.types +++ b/tests/baselines/reference/exportAssignmentFunction.types @@ -10,7 +10,7 @@ var n: number = fooFunc(); === tests/cases/compiler/exportAssignmentFunction_A.ts === function foo() { return 0; } >foo : () => number ->0 : number +>0 : 0 export = foo; >foo : () => number diff --git a/tests/baselines/reference/exportAssignmentMergedInterface.types b/tests/baselines/reference/exportAssignmentMergedInterface.types index 52978783f6d7c..2a7449a60fb91 100644 --- a/tests/baselines/reference/exportAssignmentMergedInterface.types +++ b/tests/baselines/reference/exportAssignmentMergedInterface.types @@ -9,12 +9,12 @@ var x: foo; x("test"); >x("test") : void >x : foo ->"test" : string +>"test" : "test" x(42); >x(42) : number >x : foo ->42 : number +>42 : 42 var y: string = x.b; >y : string @@ -33,9 +33,9 @@ var z = {x: 1, y: 2}; >z : { x: number; y: number; } >{x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 z = x.d; >z = x.d : { x: number; y: number; } diff --git a/tests/baselines/reference/exportAssignmentMergedModule.types b/tests/baselines/reference/exportAssignmentMergedModule.types index 39f0d8d859ef8..239b65e08adfe 100644 --- a/tests/baselines/reference/exportAssignmentMergedModule.types +++ b/tests/baselines/reference/exportAssignmentMergedModule.types @@ -27,7 +27,7 @@ if(!!foo.b){ >foo.c : (a: number) => number >foo : typeof foo >c : (a: number) => number ->42 : number +>42 : 42 } === tests/cases/conformance/externalModules/foo_0.ts === module Foo { @@ -37,11 +37,11 @@ module Foo { >a : () => number return 5; ->5 : number +>5 : 5 } export var b = true; >b : boolean ->true : boolean +>true : true } module Foo { >Foo : typeof Foo @@ -58,7 +58,7 @@ module Foo { export var answer = 42; >answer : number ->42 : number +>42 : 42 } } export = Foo; diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.types b/tests/baselines/reference/exportAssignmentTopLevelClodule.types index a8a827ba9c3f6..559514129b779 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelClodule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.types @@ -21,14 +21,14 @@ class Foo { test = "test"; >test : string ->"test" : string +>"test" : "test" } module Foo { >Foo : typeof Foo export var answer = 42; >answer : number ->42 : number +>42 : 42 } export = Foo; >Foo : Foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types index fba15dc3ca848..f67a691d020a2 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types @@ -26,16 +26,16 @@ enum foo { >foo : foo red, green, blue ->red : foo ->green : foo ->blue : foo +>red : foo.red +>green : foo.green +>blue : foo.blue } module foo { >foo : typeof foo export var answer = 42; >answer : number ->42 : number +>42 : 42 } export = foo; >foo : foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelFundule.types b/tests/baselines/reference/exportAssignmentTopLevelFundule.types index 950693dcc62b5..644fc086dbcec 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelFundule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelFundule.types @@ -20,14 +20,14 @@ function foo() { >foo : typeof foo return "test"; ->"test" : string +>"test" : "test" } module foo { >foo : typeof foo export var answer = 42; >answer : number ->42 : number +>42 : 42 } export = foo; >foo : typeof foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types index 9851eab189808..e7a35a9a69c31 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types +++ b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types @@ -17,7 +17,7 @@ module Foo { export var answer = 42; >answer : number ->42 : number +>42 : 42 } export = Foo; >Foo : typeof Foo diff --git a/tests/baselines/reference/exportAssignmentVariable.types b/tests/baselines/reference/exportAssignmentVariable.types index 7c6d9b45cce10..219a2f9f9a1ad 100644 --- a/tests/baselines/reference/exportAssignmentVariable.types +++ b/tests/baselines/reference/exportAssignmentVariable.types @@ -9,7 +9,7 @@ var n: number = y; === tests/cases/compiler/exportAssignmentVariable_A.ts === var x = 0; >x : number ->0 : number +>0 : 0 export = x; >x : number diff --git a/tests/baselines/reference/exportCodeGen.types b/tests/baselines/reference/exportCodeGen.types index e08678a76daa1..03d4ea0d97709 100644 --- a/tests/baselines/reference/exportCodeGen.types +++ b/tests/baselines/reference/exportCodeGen.types @@ -7,7 +7,7 @@ module A { export var x = 12; >x : number ->12 : number +>12 : 12 function lt12() { >lt12 : () => boolean @@ -15,7 +15,7 @@ module A { return x < 12; >x < 12 : boolean >x : number ->12 : number +>12 : 12 } } @@ -25,7 +25,7 @@ module B { var x = 12; >x : number ->12 : number +>12 : 12 function lt12() { >lt12 : () => boolean @@ -33,7 +33,7 @@ module B { return x < 12; >x < 12 : boolean >x : number ->12 : number +>12 : 12 } } @@ -45,7 +45,7 @@ module C { >no : () => boolean return false; ->false : boolean +>false : false } } @@ -57,7 +57,7 @@ module D { >yes : () => boolean return true; ->true : boolean +>true : true } } @@ -85,7 +85,7 @@ module E { export var x = 42; >x : number ->42 : number +>42 : 42 } } @@ -114,6 +114,6 @@ module F { var x = 42; >x : number ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/exportDeclarationWithModuleSpecifierNameOnNextLine1.types b/tests/baselines/reference/exportDeclarationWithModuleSpecifierNameOnNextLine1.types index 1ad841fe94761..ec22904750181 100644 --- a/tests/baselines/reference/exportDeclarationWithModuleSpecifierNameOnNextLine1.types +++ b/tests/baselines/reference/exportDeclarationWithModuleSpecifierNameOnNextLine1.types @@ -2,7 +2,7 @@ export var x = "x"; >x : string ->"x" : string +>"x" : "x" === tests/cases/compiler/t2.ts === export { x } from diff --git a/tests/baselines/reference/exportDefaultAsyncFunction2.types b/tests/baselines/reference/exportDefaultAsyncFunction2.types index ae66620159df7..a9ff903e53aed 100644 --- a/tests/baselines/reference/exportDefaultAsyncFunction2.types +++ b/tests/baselines/reference/exportDefaultAsyncFunction2.types @@ -24,12 +24,12 @@ export default async(() => await(Promise.resolve(1))); >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->1 : number +>1 : 1 === tests/cases/compiler/b.ts === export default async () => { return 0; }; >async () => { return 0; } : () => Promise ->0 : number +>0 : 0 === tests/cases/compiler/c.ts === import { async, await } from 'asyncawait'; diff --git a/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.types b/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.types index 657e0301f83e1..47e83523da170 100644 --- a/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.types +++ b/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.types @@ -2,5 +2,5 @@ export default class { static z: string = "Foo"; >z : string ->"Foo" : string +>"Foo" : "Foo" } diff --git a/tests/baselines/reference/exportDefaultProperty.types b/tests/baselines/reference/exportDefaultProperty.types index 47cfabfbc165e..67de741fde40d 100644 --- a/tests/baselines/reference/exportDefaultProperty.types +++ b/tests/baselines/reference/exportDefaultProperty.types @@ -39,7 +39,7 @@ import fooLength from "./b"; fooLength + 1; >fooLength + 1 : number >fooLength : number ->1 : number +>1 : 1 === tests/cases/compiler/declarations.d.ts === // This test is just like exportEqualsProperty, but with `export default`. @@ -82,7 +82,7 @@ namespace A { export namespace B { export const b: number = 0; } >B : typeof B >b : number ->0 : number +>0 : 0 } export default A.B; >A.B : typeof default @@ -92,6 +92,6 @@ export default A.B; === tests/cases/compiler/b.ts === export default "foo".length; >"foo".length : number ->"foo" : string +>"foo" : "foo" >length : number diff --git a/tests/baselines/reference/exportEqualNamespaces.types b/tests/baselines/reference/exportEqualNamespaces.types index 0e27102c015c2..46c6e2a5533cf 100644 --- a/tests/baselines/reference/exportEqualNamespaces.types +++ b/tests/baselines/reference/exportEqualNamespaces.types @@ -21,7 +21,7 @@ interface server { var x = 5; >x : number ->5 : number +>5 : 5 var server = new Date(); >server : Date diff --git a/tests/baselines/reference/exportEqualsAmd.types b/tests/baselines/reference/exportEqualsAmd.types index f5b1bb49910e7..e6f76b411cbcb 100644 --- a/tests/baselines/reference/exportEqualsAmd.types +++ b/tests/baselines/reference/exportEqualsAmd.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportEqualsAmd.ts === export = { ["hi"]: "there" }; >{ ["hi"]: "there" } : { ["hi"]: string; } ->"hi" : string ->"there" : string +>"hi" : "hi" +>"there" : "there" diff --git a/tests/baselines/reference/exportEqualsCommonJs.types b/tests/baselines/reference/exportEqualsCommonJs.types index 13b968595bed6..ea0c082edff12 100644 --- a/tests/baselines/reference/exportEqualsCommonJs.types +++ b/tests/baselines/reference/exportEqualsCommonJs.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportEqualsCommonJs.ts === export = { ["hi"]: "there" }; >{ ["hi"]: "there" } : { ["hi"]: string; } ->"hi" : string ->"there" : string +>"hi" : "hi" +>"there" : "there" diff --git a/tests/baselines/reference/exportEqualsDefaultProperty.types b/tests/baselines/reference/exportEqualsDefaultProperty.types index 31a6c8052f952..b6e3be008a1c8 100644 --- a/tests/baselines/reference/exportEqualsDefaultProperty.types +++ b/tests/baselines/reference/exportEqualsDefaultProperty.types @@ -5,10 +5,10 @@ var x = { >{ "greeting": "hello, world", "default": 42} : { "greeting": string; "default": number; } "greeting": "hello, world", ->"hello, world" : string +>"hello, world" : "hello, world" "default": 42 ->42 : number +>42 : 42 }; @@ -24,5 +24,5 @@ foo.toExponential(2); >foo.toExponential : (fractionDigits?: number) => string >foo : number >toExponential : (fractionDigits?: number) => string ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/exportEqualsProperty.types b/tests/baselines/reference/exportEqualsProperty.types index a92af53b12bd4..9386a60a7f93d 100644 --- a/tests/baselines/reference/exportEqualsProperty.types +++ b/tests/baselines/reference/exportEqualsProperty.types @@ -34,7 +34,7 @@ import fooLength = require("./b"); fooLength + 1; >fooLength + 1 : number >fooLength : number ->1 : number +>1 : 1 === tests/cases/compiler/declarations.d.ts === // This test is just like exportDefaultProperty, but with `export =`. @@ -77,7 +77,7 @@ namespace A { export namespace B { export const b: number = 0; } >B : typeof B >b : number ->0 : number +>0 : 0 } export = A.B; >A.B : typeof A.B @@ -87,6 +87,6 @@ export = A.B; === tests/cases/compiler/b.ts === export = "foo".length; >"foo".length : number ->"foo" : string +>"foo" : "foo" >length : number diff --git a/tests/baselines/reference/exportEqualsUmd.types b/tests/baselines/reference/exportEqualsUmd.types index ab456f0ae48b6..6b3110dc2a415 100644 --- a/tests/baselines/reference/exportEqualsUmd.types +++ b/tests/baselines/reference/exportEqualsUmd.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportEqualsUmd.ts === export = { ["hi"]: "there" }; >{ ["hi"]: "there" } : { ["hi"]: string; } ->"hi" : string ->"there" : string +>"hi" : "hi" +>"there" : "there" diff --git a/tests/baselines/reference/exportImport.types b/tests/baselines/reference/exportImport.types index a6361d3cbac6c..decfe97a594da 100644 --- a/tests/baselines/reference/exportImport.types +++ b/tests/baselines/reference/exportImport.types @@ -21,7 +21,7 @@ export = Widget1 class Widget1 { name = 'one'; } >Widget1 : Widget1 >name : string ->'one' : string +>'one' : "one" === tests/cases/compiler/exporter.ts === export import w = require('./w1'); diff --git a/tests/baselines/reference/exportImportAlias.types b/tests/baselines/reference/exportImportAlias.types index f0c21d461bc4c..4d79214f9b826 100644 --- a/tests/baselines/reference/exportImportAlias.types +++ b/tests/baselines/reference/exportImportAlias.types @@ -6,7 +6,7 @@ module A { export var x = 'hello world' >x : string ->'hello world' : string +>'hello world' : "hello world" export class Point { >Point : Point @@ -53,8 +53,8 @@ var b: { x: number; y: number; } = new C.a.Point(0, 0); >C : typeof C >a : typeof A >Point : typeof A.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 var c: { name: string }; >c : { name: string; } @@ -74,7 +74,7 @@ module X { >Y : typeof Y return 42; ->42 : number +>42 : 42 } export module Y { @@ -117,8 +117,8 @@ var n: { x: number; y: number; } = new Z.y.Point(0, 0); >Z : typeof Z >y : typeof X.Y >Point : typeof X.Y.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 module K { >K : typeof K @@ -135,7 +135,7 @@ module K { export var y = 12; >y : number ->12 : number +>12 : 12 export interface Point { >Point : Point @@ -168,7 +168,7 @@ var o = new M.D('Hello'); >M.D : typeof K.L >M : typeof M >D : typeof K.L ->'Hello' : string +>'Hello' : "Hello" var p: { x: number; y: number; } >p : { x: number; y: number; } diff --git a/tests/baselines/reference/exportImportAndClodule.types b/tests/baselines/reference/exportImportAndClodule.types index 36ca259666ca3..8f0150b0e171d 100644 --- a/tests/baselines/reference/exportImportAndClodule.types +++ b/tests/baselines/reference/exportImportAndClodule.types @@ -13,7 +13,7 @@ module K { export var y = 12; >y : number ->12 : number +>12 : 12 export interface Point { >Point : Point @@ -44,7 +44,7 @@ var o = new M.D('Hello'); >M.D : typeof K.L >M : typeof M >D : typeof K.L ->'Hello' : string +>'Hello' : "Hello" var p: { x: number; y: number; } >p : { x: number; y: number; } diff --git a/tests/baselines/reference/exportImportMultipleFiles.types b/tests/baselines/reference/exportImportMultipleFiles.types index 6ac5e7641ea0e..c4bdce56bf0bc 100644 --- a/tests/baselines/reference/exportImportMultipleFiles.types +++ b/tests/baselines/reference/exportImportMultipleFiles.types @@ -9,8 +9,8 @@ lib.math.add(3, 4); // Shouldnt be error >lib : typeof lib >math : typeof lib.math >add : (a: any, b: any) => any ->3 : number ->4 : number +>3 : 3 +>4 : 4 === tests/cases/compiler/exportImportMultipleFiles_math.ts === export function add(a, b) { return a + b; } @@ -30,6 +30,6 @@ math.add(3, 4); // OK >math.add : (a: any, b: any) => any >math : typeof math >add : (a: any, b: any) => any ->3 : number ->4 : number +>3 : 3 +>4 : 4 diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.types b/tests/baselines/reference/exportImportNonInstantiatedModule.types index 0b1da72dad833..d43cd69dac703 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.types @@ -23,5 +23,5 @@ var x: B.A1.I = { x: 1 }; >I : A.I >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule2.types b/tests/baselines/reference/exportImportNonInstantiatedModule2.types index 34f0810c12d2f..01016fcc4eced 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule2.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule2.types @@ -10,7 +10,7 @@ export function w(): e.w { // Should be OK return {name: 'value' }; >{name: 'value' } : { name: string; } >name : string ->'value' : string +>'value' : "value" } === tests/cases/compiler/w1.ts === diff --git a/tests/baselines/reference/exportNonVisibleType.types b/tests/baselines/reference/exportNonVisibleType.types index 2ad420ac531c9..2bb65cf05f06f 100644 --- a/tests/baselines/reference/exportNonVisibleType.types +++ b/tests/baselines/reference/exportNonVisibleType.types @@ -14,9 +14,9 @@ var x: I1 = {a: "test", b: 42}; >I1 : I1 >{a: "test", b: 42} : { a: string; b: number; } >a : string ->"test" : string +>"test" : "test" >b : number ->42 : number +>42 : 42 export = x; // Should fail, I1 not exported. >x : I1 diff --git a/tests/baselines/reference/exportPrivateType.types b/tests/baselines/reference/exportPrivateType.types index a91577c2b9c26..5a986f94f6386 100644 --- a/tests/baselines/reference/exportPrivateType.types +++ b/tests/baselines/reference/exportPrivateType.types @@ -18,7 +18,7 @@ module foo { test() { return true; } >test : () => boolean ->true : boolean +>true : true } interface I1 { diff --git a/tests/baselines/reference/exportStarForValues10.types b/tests/baselines/reference/exportStarForValues10.types index 370f02318c165..2be6b0c7bfe6f 100644 --- a/tests/baselines/reference/exportStarForValues10.types +++ b/tests/baselines/reference/exportStarForValues10.types @@ -2,7 +2,7 @@ export var v = 1; >v : number ->1 : number +>1 : 1 === tests/cases/compiler/file1.ts === export interface Foo { x } @@ -14,5 +14,5 @@ export * from "file0"; export * from "file1"; var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues2.types b/tests/baselines/reference/exportStarForValues2.types index f1de53bd7cfa6..3a92d860ef8a3 100644 --- a/tests/baselines/reference/exportStarForValues2.types +++ b/tests/baselines/reference/exportStarForValues2.types @@ -8,11 +8,11 @@ export interface Foo { x } export * from "file1" var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export * from "file2" var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues3.types b/tests/baselines/reference/exportStarForValues3.types index d2ee5ebb1d469..90d38d867036a 100644 --- a/tests/baselines/reference/exportStarForValues3.types +++ b/tests/baselines/reference/exportStarForValues3.types @@ -12,7 +12,7 @@ export interface A { x } export * from "file1" var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export interface B { x } @@ -22,7 +22,7 @@ export interface B { x } export * from "file1" var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file4.ts === export interface C { x } @@ -33,11 +33,11 @@ export * from "file2" export * from "file3" var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file5.ts === export * from "file4" var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues4.types b/tests/baselines/reference/exportStarForValues4.types index b381f9461e81c..b00dd126a9cb7 100644 --- a/tests/baselines/reference/exportStarForValues4.types +++ b/tests/baselines/reference/exportStarForValues4.types @@ -13,7 +13,7 @@ export * from "file1" export * from "file3" var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export interface B { x } @@ -23,5 +23,5 @@ export interface B { x } export * from "file2" var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues6.types b/tests/baselines/reference/exportStarForValues6.types index 4fe38a45d027e..3d418e2dc2468 100644 --- a/tests/baselines/reference/exportStarForValues6.types +++ b/tests/baselines/reference/exportStarForValues6.types @@ -8,5 +8,5 @@ export interface Foo { x } export * from "file1" export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues7.types b/tests/baselines/reference/exportStarForValues7.types index d37661320d6d4..41927bab512e8 100644 --- a/tests/baselines/reference/exportStarForValues7.types +++ b/tests/baselines/reference/exportStarForValues7.types @@ -8,11 +8,11 @@ export interface Foo { x } export * from "file1" export var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export * from "file2" export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues8.types b/tests/baselines/reference/exportStarForValues8.types index 9cc1484eecbc0..7d06bd0d1f53b 100644 --- a/tests/baselines/reference/exportStarForValues8.types +++ b/tests/baselines/reference/exportStarForValues8.types @@ -12,7 +12,7 @@ export interface A { x } export * from "file1" export var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export interface B { x } @@ -22,7 +22,7 @@ export interface B { x } export * from "file1" export var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file4.ts === export interface C { x } @@ -33,11 +33,11 @@ export * from "file2" export * from "file3" export var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file5.ts === export * from "file4" export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues9.types b/tests/baselines/reference/exportStarForValues9.types index 3cf250ec50b28..aa09e1f12cfb7 100644 --- a/tests/baselines/reference/exportStarForValues9.types +++ b/tests/baselines/reference/exportStarForValues9.types @@ -13,7 +13,7 @@ export * from "file1" export * from "file3" export var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export interface B { x } @@ -23,5 +23,5 @@ export interface B { x } export * from "file2" export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValuesInSystem.types b/tests/baselines/reference/exportStarForValuesInSystem.types index 36d07741e108a..bbb9a5a6b15f5 100644 --- a/tests/baselines/reference/exportStarForValuesInSystem.types +++ b/tests/baselines/reference/exportStarForValuesInSystem.types @@ -8,5 +8,5 @@ export interface Foo { x } export * from "file1" var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportToString.types b/tests/baselines/reference/exportToString.types index 17037852f3b13..8c3aa782e295e 100644 --- a/tests/baselines/reference/exportToString.types +++ b/tests/baselines/reference/exportToString.types @@ -1,8 +1,8 @@ === tests/cases/compiler/exportToString.ts === const toString = 0; ->toString : number ->0 : number +>toString : 0 +>0 : 0 export { toString }; ->toString : number +>toString : 0 diff --git a/tests/baselines/reference/exportVisibility.types b/tests/baselines/reference/exportVisibility.types index cf1e092473e38..0249661834bb2 100644 --- a/tests/baselines/reference/exportVisibility.types +++ b/tests/baselines/reference/exportVisibility.types @@ -14,6 +14,6 @@ export function test(foo: Foo) { >Foo : Foo return true; ->true : boolean +>true : true } diff --git a/tests/baselines/reference/exportedVariable1.types b/tests/baselines/reference/exportedVariable1.types index fa7017fefa8c9..1d30c50ca3bd2 100644 --- a/tests/baselines/reference/exportedVariable1.types +++ b/tests/baselines/reference/exportedVariable1.types @@ -3,7 +3,7 @@ export var foo = {name: "Bill"}; >foo : { name: string; } >{name: "Bill"} : { name: string; } >name : string ->"Bill" : string +>"Bill" : "Bill" var upper = foo.name.toUpperCase(); >upper : string diff --git a/tests/baselines/reference/exportsAndImports1-amd.types b/tests/baselines/reference/exportsAndImports1-amd.types index 4ba83121541db..05c8b6d7af5fb 100644 --- a/tests/baselines/reference/exportsAndImports1-amd.types +++ b/tests/baselines/reference/exportsAndImports1-amd.types @@ -2,7 +2,7 @@ var v = 1; >v : number ->1 : number +>1 : 1 function f() { } >f : () => void @@ -17,17 +17,17 @@ enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports1-es6.types b/tests/baselines/reference/exportsAndImports1-es6.types index 4ba83121541db..05c8b6d7af5fb 100644 --- a/tests/baselines/reference/exportsAndImports1-es6.types +++ b/tests/baselines/reference/exportsAndImports1-es6.types @@ -2,7 +2,7 @@ var v = 1; >v : number ->1 : number +>1 : 1 function f() { } >f : () => void @@ -17,17 +17,17 @@ enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports1.types b/tests/baselines/reference/exportsAndImports1.types index 4ba83121541db..05c8b6d7af5fb 100644 --- a/tests/baselines/reference/exportsAndImports1.types +++ b/tests/baselines/reference/exportsAndImports1.types @@ -2,7 +2,7 @@ var v = 1; >v : number ->1 : number +>1 : 1 function f() { } >f : () => void @@ -17,17 +17,17 @@ enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports2-amd.types b/tests/baselines/reference/exportsAndImports2-amd.types index 32de763c5673e..46e42174a7710 100644 --- a/tests/baselines/reference/exportsAndImports2-amd.types +++ b/tests/baselines/reference/exportsAndImports2-amd.types @@ -2,11 +2,11 @@ export var x = "x"; >x : string ->"x" : string +>"x" : "x" export var y = "y"; >y : string ->"y" : string +>"y" : "y" === tests/cases/conformance/es6/modules/t2.ts === export { x as y, y as x } from "./t1"; diff --git a/tests/baselines/reference/exportsAndImports2-es6.types b/tests/baselines/reference/exportsAndImports2-es6.types index 32de763c5673e..46e42174a7710 100644 --- a/tests/baselines/reference/exportsAndImports2-es6.types +++ b/tests/baselines/reference/exportsAndImports2-es6.types @@ -2,11 +2,11 @@ export var x = "x"; >x : string ->"x" : string +>"x" : "x" export var y = "y"; >y : string ->"y" : string +>"y" : "y" === tests/cases/conformance/es6/modules/t2.ts === export { x as y, y as x } from "./t1"; diff --git a/tests/baselines/reference/exportsAndImports2.types b/tests/baselines/reference/exportsAndImports2.types index 32de763c5673e..46e42174a7710 100644 --- a/tests/baselines/reference/exportsAndImports2.types +++ b/tests/baselines/reference/exportsAndImports2.types @@ -2,11 +2,11 @@ export var x = "x"; >x : string ->"x" : string +>"x" : "x" export var y = "y"; >y : string ->"y" : string +>"y" : "y" === tests/cases/conformance/es6/modules/t2.ts === export { x as y, y as x } from "./t1"; diff --git a/tests/baselines/reference/exportsAndImports3-amd.types b/tests/baselines/reference/exportsAndImports3-amd.types index 0b8235d969c02..5292f01af0de3 100644 --- a/tests/baselines/reference/exportsAndImports3-amd.types +++ b/tests/baselines/reference/exportsAndImports3-amd.types @@ -2,7 +2,7 @@ export var v = 1; >v : number ->1 : number +>1 : 1 export function f() { } >f : () => void @@ -17,17 +17,17 @@ export enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } export const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } export module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports3-es6.types b/tests/baselines/reference/exportsAndImports3-es6.types index 0b8235d969c02..5292f01af0de3 100644 --- a/tests/baselines/reference/exportsAndImports3-es6.types +++ b/tests/baselines/reference/exportsAndImports3-es6.types @@ -2,7 +2,7 @@ export var v = 1; >v : number ->1 : number +>1 : 1 export function f() { } >f : () => void @@ -17,17 +17,17 @@ export enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } export const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } export module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports3.types b/tests/baselines/reference/exportsAndImports3.types index 0b8235d969c02..5292f01af0de3 100644 --- a/tests/baselines/reference/exportsAndImports3.types +++ b/tests/baselines/reference/exportsAndImports3.types @@ -2,7 +2,7 @@ export var v = 1; >v : number ->1 : number +>1 : 1 export function f() { } >f : () => void @@ -17,17 +17,17 @@ export enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } export const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } export module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports4-amd.types b/tests/baselines/reference/exportsAndImports4-amd.types index 4bd6f8c0e1eee..dfddd897e5918 100644 --- a/tests/baselines/reference/exportsAndImports4-amd.types +++ b/tests/baselines/reference/exportsAndImports4-amd.types @@ -3,63 +3,63 @@ import a = require("./t1"); >a : typeof a a.default; ->a.default : string +>a.default : "hello" >a : typeof a ->default : string +>default : "hello" import b from "./t1"; ->b : string +>b : "hello" b; ->b : string +>b : "hello" import * as c from "./t1"; >c : typeof a c.default; ->c.default : string +>c.default : "hello" >c : typeof a ->default : string +>default : "hello" import { default as d } from "./t1"; ->default : string ->d : string +>default : "hello" +>d : "hello" d; ->d : string +>d : "hello" import e1, * as e2 from "./t1"; ->e1 : string +>e1 : "hello" >e2 : typeof a e1; ->e1 : string +>e1 : "hello" e2.default; ->e2.default : string +>e2.default : "hello" >e2 : typeof a ->default : string +>default : "hello" import f1, { default as f2 } from "./t1"; ->f1 : string ->default : string ->f2 : string +>f1 : "hello" +>default : "hello" +>f2 : "hello" f1; ->f1 : string +>f1 : "hello" f2; ->f2 : string +>f2 : "hello" export { a, b, c, d, e1, e2, f1, f2 }; >a : typeof a ->b : string +>b : "hello" >c : typeof a ->d : string ->e1 : string +>d : "hello" +>e1 : "hello" >e2 : typeof a ->f1 : string ->f2 : string +>f1 : "hello" +>f2 : "hello" === tests/cases/conformance/es6/modules/t1.ts === diff --git a/tests/baselines/reference/exportsAndImports4-es6.types b/tests/baselines/reference/exportsAndImports4-es6.types index 4bd6f8c0e1eee..dfddd897e5918 100644 --- a/tests/baselines/reference/exportsAndImports4-es6.types +++ b/tests/baselines/reference/exportsAndImports4-es6.types @@ -3,63 +3,63 @@ import a = require("./t1"); >a : typeof a a.default; ->a.default : string +>a.default : "hello" >a : typeof a ->default : string +>default : "hello" import b from "./t1"; ->b : string +>b : "hello" b; ->b : string +>b : "hello" import * as c from "./t1"; >c : typeof a c.default; ->c.default : string +>c.default : "hello" >c : typeof a ->default : string +>default : "hello" import { default as d } from "./t1"; ->default : string ->d : string +>default : "hello" +>d : "hello" d; ->d : string +>d : "hello" import e1, * as e2 from "./t1"; ->e1 : string +>e1 : "hello" >e2 : typeof a e1; ->e1 : string +>e1 : "hello" e2.default; ->e2.default : string +>e2.default : "hello" >e2 : typeof a ->default : string +>default : "hello" import f1, { default as f2 } from "./t1"; ->f1 : string ->default : string ->f2 : string +>f1 : "hello" +>default : "hello" +>f2 : "hello" f1; ->f1 : string +>f1 : "hello" f2; ->f2 : string +>f2 : "hello" export { a, b, c, d, e1, e2, f1, f2 }; >a : typeof a ->b : string +>b : "hello" >c : typeof a ->d : string ->e1 : string +>d : "hello" +>e1 : "hello" >e2 : typeof a ->f1 : string ->f2 : string +>f1 : "hello" +>f2 : "hello" === tests/cases/conformance/es6/modules/t1.ts === diff --git a/tests/baselines/reference/exportsAndImports4.types b/tests/baselines/reference/exportsAndImports4.types index 4bd6f8c0e1eee..dfddd897e5918 100644 --- a/tests/baselines/reference/exportsAndImports4.types +++ b/tests/baselines/reference/exportsAndImports4.types @@ -3,63 +3,63 @@ import a = require("./t1"); >a : typeof a a.default; ->a.default : string +>a.default : "hello" >a : typeof a ->default : string +>default : "hello" import b from "./t1"; ->b : string +>b : "hello" b; ->b : string +>b : "hello" import * as c from "./t1"; >c : typeof a c.default; ->c.default : string +>c.default : "hello" >c : typeof a ->default : string +>default : "hello" import { default as d } from "./t1"; ->default : string ->d : string +>default : "hello" +>d : "hello" d; ->d : string +>d : "hello" import e1, * as e2 from "./t1"; ->e1 : string +>e1 : "hello" >e2 : typeof a e1; ->e1 : string +>e1 : "hello" e2.default; ->e2.default : string +>e2.default : "hello" >e2 : typeof a ->default : string +>default : "hello" import f1, { default as f2 } from "./t1"; ->f1 : string ->default : string ->f2 : string +>f1 : "hello" +>default : "hello" +>f2 : "hello" f1; ->f1 : string +>f1 : "hello" f2; ->f2 : string +>f2 : "hello" export { a, b, c, d, e1, e2, f1, f2 }; >a : typeof a ->b : string +>b : "hello" >c : typeof a ->d : string ->e1 : string +>d : "hello" +>e1 : "hello" >e2 : typeof a ->f1 : string ->f2 : string +>f1 : "hello" +>f2 : "hello" === tests/cases/conformance/es6/modules/t1.ts === diff --git a/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames02.types b/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames02.types index 853fa787f0ae1..c12e84e320bd0 100644 --- a/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames02.types +++ b/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames02.types @@ -2,7 +2,7 @@ let as = 100; >as : number ->100 : number +>100 : 100 export { as as return, as }; >as : number diff --git a/tests/baselines/reference/exportsAndImportsWithUnderscores2.types b/tests/baselines/reference/exportsAndImportsWithUnderscores2.types index a684440f5bdf7..3b86789cc44d0 100644 --- a/tests/baselines/reference/exportsAndImportsWithUnderscores2.types +++ b/tests/baselines/reference/exportsAndImportsWithUnderscores2.types @@ -9,7 +9,7 @@ export default R = { >{ "__esmodule": true, "__proto__": {}} : { "__esmodule": boolean; "__proto__": {}; } "__esmodule": true, ->true : boolean +>true : true "__proto__": {} >{} : {} diff --git a/tests/baselines/reference/exportsAndImportsWithUnderscores3.types b/tests/baselines/reference/exportsAndImportsWithUnderscores3.types index 5addb44172d2f..b860928aa6208 100644 --- a/tests/baselines/reference/exportsAndImportsWithUnderscores3.types +++ b/tests/baselines/reference/exportsAndImportsWithUnderscores3.types @@ -9,13 +9,13 @@ export default R = { >{ "___": 30, "___hello": 21, "_hi": 40,} : { "___": number; "___hello": number; "_hi": number; } "___": 30, ->30 : number +>30 : 30 "___hello": 21, ->21 : number +>21 : 21 "_hi": 40, ->40 : number +>40 : 40 } === tests/cases/conformance/es6/modules/m2.ts === diff --git a/tests/baselines/reference/exportsAndImportsWithUnderscores4.types b/tests/baselines/reference/exportsAndImportsWithUnderscores4.types index a90420422855d..cf339db5deeac 100644 --- a/tests/baselines/reference/exportsAndImportsWithUnderscores4.types +++ b/tests/baselines/reference/exportsAndImportsWithUnderscores4.types @@ -11,7 +11,7 @@ export function _() { >console.log : any >console : any >log : any ->"_" : string +>"_" : "_" } export function __() { >__ : () => void @@ -21,7 +21,7 @@ export function __() { >console.log : any >console : any >log : any ->"__" : string +>"__" : "__" } export function ___() { >___ : () => void @@ -31,7 +31,7 @@ export function ___() { >console.log : any >console : any >log : any ->"___" : string +>"___" : "___" } export function _hi() { >_hi : () => void @@ -41,7 +41,7 @@ export function _hi() { >console.log : any >console : any >log : any ->"_hi" : string +>"_hi" : "_hi" } export function __proto() { >__proto : () => void @@ -51,7 +51,7 @@ export function __proto() { >console.log : any >console : any >log : any ->"__proto" : string +>"__proto" : "__proto" } export function __esmodule() { >__esmodule : () => void @@ -61,7 +61,7 @@ export function __esmodule() { >console.log : any >console : any >log : any ->"__esmodule" : string +>"__esmodule" : "__esmodule" } export function ___hello(){ >___hello : () => void @@ -71,7 +71,7 @@ export function ___hello(){ >console.log : any >console : any >log : any ->"___hello" : string +>"___hello" : "___hello" } === tests/cases/conformance/es6/modules/m2.ts === diff --git a/tests/baselines/reference/expr.errors.txt b/tests/baselines/reference/expr.errors.txt index 41d15a0835b71..17e39cc80be2f 100644 --- a/tests/baselines/reference/expr.errors.txt +++ b/tests/baselines/reference/expr.errors.txt @@ -4,14 +4,14 @@ tests/cases/compiler/expr.ts(94,5): error TS2365: Operator '==' cannot be applie tests/cases/compiler/expr.ts(95,5): error TS2365: Operator '==' cannot be applied to types 'string' and 'boolean'. tests/cases/compiler/expr.ts(98,5): error TS2365: Operator '==' cannot be applied to types 'string' and 'E'. tests/cases/compiler/expr.ts(115,5): error TS2365: Operator '==' cannot be applied to types 'E' and 'string'. -tests/cases/compiler/expr.ts(116,5): error TS2365: Operator '==' cannot be applied to types 'E' and 'boolean'. -tests/cases/compiler/expr.ts(142,5): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. +tests/cases/compiler/expr.ts(116,5): error TS2365: Operator '==' cannot be applied to types 'E' and 'false'. +tests/cases/compiler/expr.ts(142,5): error TS2365: Operator '+' cannot be applied to types 'number' and 'false'. tests/cases/compiler/expr.ts(143,5): error TS2365: Operator '+' cannot be applied to types 'number' and 'I'. tests/cases/compiler/expr.ts(161,5): error TS2365: Operator '+' cannot be applied to types 'I' and 'number'. -tests/cases/compiler/expr.ts(163,5): error TS2365: Operator '+' cannot be applied to types 'I' and 'boolean'. +tests/cases/compiler/expr.ts(163,5): error TS2365: Operator '+' cannot be applied to types 'I' and 'false'. tests/cases/compiler/expr.ts(165,5): error TS2365: Operator '+' cannot be applied to types 'I' and 'I'. tests/cases/compiler/expr.ts(166,5): error TS2365: Operator '+' cannot be applied to types 'I' and 'E'. -tests/cases/compiler/expr.ts(170,5): error TS2365: Operator '+' cannot be applied to types 'E' and 'boolean'. +tests/cases/compiler/expr.ts(170,5): error TS2365: Operator '+' cannot be applied to types 'E' and 'false'. tests/cases/compiler/expr.ts(172,5): error TS2365: Operator '+' cannot be applied to types 'E' and 'I'. tests/cases/compiler/expr.ts(176,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/expr.ts(177,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -199,7 +199,7 @@ tests/cases/compiler/expr.ts(242,7): error TS2363: The right-hand side of an ari !!! error TS2365: Operator '==' cannot be applied to types 'E' and 'string'. e==b; ~~~~ -!!! error TS2365: Operator '==' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '==' cannot be applied to types 'E' and 'false'. e==a; e==i; e==e; @@ -227,7 +227,7 @@ tests/cases/compiler/expr.ts(242,7): error TS2363: The right-hand side of an ari n+s; n+b; ~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'false'. n+i; ~~~ !!! error TS2365: Operator '+' cannot be applied to types 'number' and 'I'. @@ -254,7 +254,7 @@ tests/cases/compiler/expr.ts(242,7): error TS2363: The right-hand side of an ari i+s; i+b; ~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'I' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'I' and 'false'. i+a; i+i; ~~~ @@ -267,7 +267,7 @@ tests/cases/compiler/expr.ts(242,7): error TS2363: The right-hand side of an ari e+s; e+b; ~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'false'. e+a; e+i; ~~~ diff --git a/tests/baselines/reference/extBaseClass1.types b/tests/baselines/reference/extBaseClass1.types index 1ab2ec3ba5350..7e25c832f2a93 100644 --- a/tests/baselines/reference/extBaseClass1.types +++ b/tests/baselines/reference/extBaseClass1.types @@ -7,7 +7,7 @@ module M { public x=10; >x : number ->10 : number +>10 : 10 } export class C extends B { diff --git a/tests/baselines/reference/extendBooleanInterface.types b/tests/baselines/reference/extendBooleanInterface.types index 8f91deba713c7..0318704025925 100644 --- a/tests/baselines/reference/extendBooleanInterface.types +++ b/tests/baselines/reference/extendBooleanInterface.types @@ -15,35 +15,35 @@ interface Boolean { var x = true; >x : boolean ->true : boolean +>true : true var a: string = x.doStuff(); >a : string >x.doStuff() : string >x.doStuff : () => string ->x : boolean +>x : true >doStuff : () => string var b: string = x.doOtherStuff('hm'); >b : string ->x.doOtherStuff('hm') : string +>x.doOtherStuff('hm') : "hm" >x.doOtherStuff : (x: T) => T ->x : boolean +>x : true >doOtherStuff : (x: T) => T ->'hm' : string +>'hm' : "hm" var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string ->x : boolean ->'doStuff' : string +>x : true +>'doStuff' : "doStuff" var d: string = x['doOtherStuff']('hm'); >d : string ->x['doOtherStuff']('hm') : string +>x['doOtherStuff']('hm') : "hm" >x['doOtherStuff'] : (x: T) => T ->x : boolean ->'doOtherStuff' : string ->'hm' : string +>x : true +>'doOtherStuff' : "doOtherStuff" +>'hm' : "hm" diff --git a/tests/baselines/reference/extendConstructSignatureInInterface.types b/tests/baselines/reference/extendConstructSignatureInInterface.types index 363107b2e54c0..c89b7ca01f3f0 100644 --- a/tests/baselines/reference/extendConstructSignatureInInterface.types +++ b/tests/baselines/reference/extendConstructSignatureInInterface.types @@ -21,5 +21,5 @@ var e: E = new E(1); >E : E >new E(1) : E >E : typeof E ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/extendNumberInterface.types b/tests/baselines/reference/extendNumberInterface.types index 97ef307bab8c7..a6ba453894e8c 100644 --- a/tests/baselines/reference/extendNumberInterface.types +++ b/tests/baselines/reference/extendNumberInterface.types @@ -15,7 +15,7 @@ interface Number { var x = 1; >x : number ->1 : number +>1 : 1 var a: string = x.doStuff(); >a : string @@ -26,24 +26,24 @@ var a: string = x.doStuff(); var b: string = x.doOtherStuff('hm'); >b : string ->x.doOtherStuff('hm') : string +>x.doOtherStuff('hm') : "hm" >x.doOtherStuff : (x: T) => T >x : number >doOtherStuff : (x: T) => T ->'hm' : string +>'hm' : "hm" var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string >x : number ->'doStuff' : string +>'doStuff' : "doStuff" var d: string = x['doOtherStuff']('hm'); >d : string ->x['doOtherStuff']('hm') : string +>x['doOtherStuff']('hm') : "hm" >x['doOtherStuff'] : (x: T) => T >x : number ->'doOtherStuff' : string ->'hm' : string +>'doOtherStuff' : "doOtherStuff" +>'hm' : "hm" diff --git a/tests/baselines/reference/extendStringInterface.types b/tests/baselines/reference/extendStringInterface.types index edfd82390154c..428624dc57f1a 100644 --- a/tests/baselines/reference/extendStringInterface.types +++ b/tests/baselines/reference/extendStringInterface.types @@ -15,7 +15,7 @@ interface String { var x = ''; >x : string ->'' : string +>'' : "" var a: string = x.doStuff(); >a : string @@ -26,24 +26,24 @@ var a: string = x.doStuff(); var b: string = x.doOtherStuff('hm'); >b : string ->x.doOtherStuff('hm') : string +>x.doOtherStuff('hm') : "hm" >x.doOtherStuff : (x: T) => T >x : string >doOtherStuff : (x: T) => T ->'hm' : string +>'hm' : "hm" var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string >x : string ->'doStuff' : string +>'doStuff' : "doStuff" var d: string = x['doOtherStuff']('hm'); >d : string ->x['doOtherStuff']('hm') : string +>x['doOtherStuff']('hm') : "hm" >x['doOtherStuff'] : (x: T) => T >x : string ->'doOtherStuff' : string ->'hm' : string +>'doOtherStuff' : "doOtherStuff" +>'hm' : "hm" diff --git a/tests/baselines/reference/extendedInterfaceGenericType.types b/tests/baselines/reference/extendedInterfaceGenericType.types index a536ec7519052..5235dd2f9c8f0 100644 --- a/tests/baselines/reference/extendedInterfaceGenericType.types +++ b/tests/baselines/reference/extendedInterfaceGenericType.types @@ -37,5 +37,5 @@ betaOfNumber.takesArgOfT(5); >betaOfNumber.takesArgOfT : (arg: number) => Alpha >betaOfNumber : Beta >takesArgOfT : (arg: number) => Alpha ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/externFunc.types b/tests/baselines/reference/externFunc.types index ab417859ea5ec..5cda004d4cf55 100644 --- a/tests/baselines/reference/externFunc.types +++ b/tests/baselines/reference/externFunc.types @@ -6,5 +6,5 @@ declare function parseInt(s:string):number; parseInt("2"); >parseInt("2") : number >parseInt : { (s: string, radix?: number): number; (s: string): number; } ->"2" : string +>"2" : "2" diff --git a/tests/baselines/reference/externalModuleQualification.types b/tests/baselines/reference/externalModuleQualification.types index a7b70697209d4..42f0d3579b4ae 100644 --- a/tests/baselines/reference/externalModuleQualification.types +++ b/tests/baselines/reference/externalModuleQualification.types @@ -1,7 +1,7 @@ === tests/cases/compiler/externalModuleQualification.ts === export var ID = "test"; >ID : string ->"test" : string +>"test" : "test" export class DiffEditor { >DiffEditor : DiffEditor diff --git a/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types index 8d2c9b659912c..ad292656d259c 100644 --- a/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types +++ b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types @@ -14,31 +14,31 @@ declare module '__timezonecomplete/basics' { >TimeUnit : TimeUnit Second = 0, ->Second : TimeUnit ->0 : number +>Second : TimeUnit.Second +>0 : 0 Minute = 1, ->Minute : TimeUnit ->1 : number +>Minute : TimeUnit.Minute +>1 : 1 Hour = 2, ->Hour : TimeUnit ->2 : number +>Hour : TimeUnit.Hour +>2 : 2 Day = 3, ->Day : TimeUnit ->3 : number +>Day : TimeUnit.Day +>3 : 3 Week = 4, ->Week : TimeUnit ->4 : number +>Week : TimeUnit.Week +>4 : 4 Month = 5, ->Month : TimeUnit ->5 : number +>Month : TimeUnit.Month +>5 : 5 Year = 6, ->Year : TimeUnit ->6 : number +>Year : TimeUnit.Year +>6 : 6 } } diff --git a/tests/baselines/reference/externalModuleResolution.types b/tests/baselines/reference/externalModuleResolution.types index 45e2aef6883f3..1f0901dd040d6 100644 --- a/tests/baselines/reference/externalModuleResolution.types +++ b/tests/baselines/reference/externalModuleResolution.types @@ -13,7 +13,7 @@ module M2 { export var Y = 1; >Y : number ->1 : number +>1 : 1 } export = M2 >M2 : typeof M2 diff --git a/tests/baselines/reference/externalModuleResolution2.types b/tests/baselines/reference/externalModuleResolution2.types index 9f48b8b38f1c9..8eb1ae5d54627 100644 --- a/tests/baselines/reference/externalModuleResolution2.types +++ b/tests/baselines/reference/externalModuleResolution2.types @@ -13,7 +13,7 @@ module M2 { export var X = 1; >X : number ->1 : number +>1 : 1 } export = M2 >M2 : typeof M2 diff --git a/tests/baselines/reference/fallFromLastCase1.types b/tests/baselines/reference/fallFromLastCase1.types index 1a21727e7a1b2..0353ae88387a0 100644 --- a/tests/baselines/reference/fallFromLastCase1.types +++ b/tests/baselines/reference/fallFromLastCase1.types @@ -17,7 +17,7 @@ function foo1(a: number) { use("1"); >use("1") : any >use : (a: string) => any ->"1" : string +>"1" : "1" break; case 2: @@ -26,7 +26,7 @@ function foo1(a: number) { use("2"); >use("2") : any >use : (a: string) => any ->"2" : string +>"2" : "2" } } @@ -44,13 +44,13 @@ function foo2(a: number) { use("1"); >use("1") : any >use : (a: string) => any ->"1" : string +>"1" : "1" break; default: use("2"); >use("2") : any >use : (a: string) => any ->"2" : string +>"2" : "2" } } diff --git a/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types b/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types index fc41085098a67..7b1a2d8e6ffdb 100644 --- a/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types +++ b/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types @@ -19,7 +19,7 @@ trans(([b,c]) => 'foo'); >([b,c]) => 'foo' : ([b, c]: [any, any]) => string >b : any >c : any ->'foo' : string +>'foo' : "foo" trans(({d: [e,f]}) => 'foo'); >trans(({d: [e,f]}) => 'foo') : number @@ -28,7 +28,7 @@ trans(({d: [e,f]}) => 'foo'); >d : any >e : any >f : any ->'foo' : string +>'foo' : "foo" trans(([{g},{h}]) => 'foo'); >trans(([{g},{h}]) => 'foo') : number @@ -36,7 +36,7 @@ trans(([{g},{h}]) => 'foo'); >([{g},{h}]) => 'foo' : ([{g}, {h}]: [{ g: any; }, { h: any; }]) => string >g : any >h : any ->'foo' : string +>'foo' : "foo" trans(({a, b = 10}) => a); >trans(({a, b = 10}) => a) : number @@ -44,6 +44,6 @@ trans(({a, b = 10}) => a); >({a, b = 10}) => a : ({a, b}: { a: any; b?: number; }) => any >a : any >b : number ->10 : number +>10 : 10 >a : any diff --git a/tests/baselines/reference/fatArrowSelf.types b/tests/baselines/reference/fatArrowSelf.types index 574262265bc0d..1f9627b595e4e 100644 --- a/tests/baselines/reference/fatArrowSelf.types +++ b/tests/baselines/reference/fatArrowSelf.types @@ -41,7 +41,7 @@ module Consumer { >this : this >emitter : Events.EventEmitter >addListener : (type: string, listener: Events.ListenerCallback) => void ->'change' : string +>'change' : "change" >(e) => { this.changed(); } : (e: any) => void >e : any diff --git a/tests/baselines/reference/fatArrowfunctionAsType.types b/tests/baselines/reference/fatArrowfunctionAsType.types index a165048695fa8..826169517954a 100644 --- a/tests/baselines/reference/fatArrowfunctionAsType.types +++ b/tests/baselines/reference/fatArrowfunctionAsType.types @@ -14,7 +14,7 @@ var c: (x: T) => void = function (x: T) { return 42; } >T : T >x : T >T : T ->42 : number +>42 : 42 b = c; >b = c : (x: T) => void diff --git a/tests/baselines/reference/fatarrowfunctions.types b/tests/baselines/reference/fatarrowfunctions.types index 7fd15ee29a794..304c341c91640 100644 --- a/tests/baselines/reference/fatarrowfunctions.types +++ b/tests/baselines/reference/fatarrowfunctions.types @@ -79,7 +79,7 @@ foo(()=>{return 0;}); >foo(()=>{return 0;}) : any >foo : (x: any) => any >()=>{return 0;} : () => number ->0 : number +>0 : 0 foo((x:number,y,z)=>x+y+z); >foo((x:number,y,z)=>x+y+z) : any @@ -150,7 +150,7 @@ foo(()=>{return 0;}); >foo(()=>{return 0;}) : any >foo : (x: any) => any >()=>{return 0;} : () => number ->0 : number +>0 : 0 foo(((x) => x)); @@ -189,7 +189,7 @@ var z = (x:number) => x*x; var w = () => 3; >w : () => number >() => 3 : () => number ->3 : number +>3 : 3 function ternaryTest(isWhile:boolean) { >ternaryTest : (isWhile: boolean) => void @@ -203,7 +203,7 @@ function ternaryTest(isWhile:boolean) { >n : any >n > 0 : boolean >n : any ->0 : number +>0 : 0 >function (n) { return n === 0; } : (n: any) => boolean >n : any >n === 0 : boolean @@ -224,7 +224,7 @@ var messenger = { message: "Hello World", >message : string ->"Hello World" : string +>"Hello World" : "Hello World" start: function() { >start : () => void @@ -240,7 +240,7 @@ var messenger = { >this : any >message : any >toString : any ->3000 : number +>3000 : 3000 } }; diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types index 39cd994dcc194..bc33ec4c2fff5 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types @@ -19,5 +19,5 @@ fn.call(4); // Should be 4 >fn.call : (this: Function, thisArg: any, ...argArray: any[]) => any >fn : (x?: () => any, y?: any) => any >call : (this: Function, thisArg: any, ...argArray: any[]) => any ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctions.types b/tests/baselines/reference/fatarrowfunctionsInFunctions.types index 00abaec9f2505..8b9bd7ccd7a62 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctions.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctions.types @@ -11,7 +11,7 @@ var messenger = { message: "Hello World", >message : string ->"Hello World" : string +>"Hello World" : "Hello World" start: function() { >start : () => void @@ -35,7 +35,7 @@ var messenger = { >toString : any }, 3000); ->3000 : number +>3000 : 3000 } }; messenger.start(); diff --git a/tests/baselines/reference/fileReferencesWithNoExtensions.types b/tests/baselines/reference/fileReferencesWithNoExtensions.types index 7b56dbe0d20db..380792f1b7084 100644 --- a/tests/baselines/reference/fileReferencesWithNoExtensions.types +++ b/tests/baselines/reference/fileReferencesWithNoExtensions.types @@ -17,7 +17,7 @@ var c = cc; // Check that c.ts has precedence over c.d.ts === tests/cases/compiler/a.ts === var aa = 1; >aa : number ->1 : number +>1 : 1 === tests/cases/compiler/b.d.ts === declare var bb: number; @@ -26,7 +26,7 @@ declare var bb: number; === tests/cases/compiler/c.ts === var cc = 1; >cc : number ->1 : number +>1 : 1 === tests/cases/compiler/c.d.ts === declare var xx: number; diff --git a/tests/baselines/reference/fileWithNextLine1.types b/tests/baselines/reference/fileWithNextLine1.types index 2afb1f2ae3724..d314fd996dd2a 100644 --- a/tests/baselines/reference/fileWithNextLine1.types +++ b/tests/baselines/reference/fileWithNextLine1.types @@ -3,5 +3,5 @@ // 0. It should be counted as a space and should not cause an error. var v = '…'; >v : string ->'…' : string +>'…' : "\u0085" diff --git a/tests/baselines/reference/fileWithNextLine2.types b/tests/baselines/reference/fileWithNextLine2.types index c3e1fd642cffc..d7d08ef5b3f1a 100644 --- a/tests/baselines/reference/fileWithNextLine2.types +++ b/tests/baselines/reference/fileWithNextLine2.types @@ -3,5 +3,5 @@ // it should be treated like a space var v =…0; >v : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt index 3666c89a0edd0..e1cde0c163248 100644 --- a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt +++ b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts(2,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. ==== tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts(2,1): erro bar(1, ""); // Should be ok ~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. \ No newline at end of file +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. \ No newline at end of file diff --git a/tests/baselines/reference/fixingTypeParametersRepeatedly1.types b/tests/baselines/reference/fixingTypeParametersRepeatedly1.types index 273c66b342d6c..41e705ba94353 100644 --- a/tests/baselines/reference/fixingTypeParametersRepeatedly1.types +++ b/tests/baselines/reference/fixingTypeParametersRepeatedly1.types @@ -17,7 +17,7 @@ declare function f(x: T, y: (p: T) => T, z: (p: T) => T): T; f("", x => null, x => x.toLowerCase()); >f("", x => null, x => x.toLowerCase()) : string >f : (x: T, y: (p: T) => T, z: (p: T) => T) => T ->"" : string +>"" : "" >x => null : (x: string) => any >x : string >null : null @@ -50,7 +50,7 @@ declare function g(); g("", x => null, x => x.toLowerCase()); >g("", x => null, x => x.toLowerCase()) : string >g : { (x: T, y: (p: T) => T, z: (p: T) => T): T; (): any; } ->"" : string +>"" : "" >x => null : (x: string) => any >x : string >null : null diff --git a/tests/baselines/reference/for-of13.types b/tests/baselines/reference/for-of13.types index e176b1bbf0c27..af30e85fa1720 100644 --- a/tests/baselines/reference/for-of13.types +++ b/tests/baselines/reference/for-of13.types @@ -7,6 +7,6 @@ for (v of [""].values()) { } >[""].values() : IterableIterator >[""].values : () => IterableIterator >[""] : string[] ->"" : string +>"" : "" >values : () => IterableIterator diff --git a/tests/baselines/reference/for-of18.types b/tests/baselines/reference/for-of18.types index 415f2b1156831..86978b62cc772 100644 --- a/tests/baselines/reference/for-of18.types +++ b/tests/baselines/reference/for-of18.types @@ -18,11 +18,11 @@ class StringIterator { value: "", >value : string ->"" : string +>"" : "" done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of19.types b/tests/baselines/reference/for-of19.types index 5128617bf24c5..a2882ccf1ac6f 100644 --- a/tests/baselines/reference/for-of19.types +++ b/tests/baselines/reference/for-of19.types @@ -27,7 +27,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of20.types b/tests/baselines/reference/for-of20.types index de12979c650f4..9274c7f4b966a 100644 --- a/tests/baselines/reference/for-of20.types +++ b/tests/baselines/reference/for-of20.types @@ -27,7 +27,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of21.types b/tests/baselines/reference/for-of21.types index cab24c525d988..1366cb1a420af 100644 --- a/tests/baselines/reference/for-of21.types +++ b/tests/baselines/reference/for-of21.types @@ -27,7 +27,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of22.types b/tests/baselines/reference/for-of22.types index f15a1d7e11437..80cd42b2b3381 100644 --- a/tests/baselines/reference/for-of22.types +++ b/tests/baselines/reference/for-of22.types @@ -28,7 +28,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of23.types b/tests/baselines/reference/for-of23.types index 87f1eeabbb716..ed74156f514f6 100644 --- a/tests/baselines/reference/for-of23.types +++ b/tests/baselines/reference/for-of23.types @@ -5,8 +5,8 @@ for (const v of new FooIterator) { >FooIterator : typeof FooIterator const v = 0; // new scope ->v : number ->0 : number +>v : 0 +>0 : 0 } class Foo { } @@ -28,7 +28,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of36.types b/tests/baselines/reference/for-of36.types index f55b5377acc48..1448c212371c5 100644 --- a/tests/baselines/reference/for-of36.types +++ b/tests/baselines/reference/for-of36.types @@ -2,7 +2,7 @@ var tuple: [string, boolean] = ["", true]; >tuple : [string, boolean] >["", true] : [string, true] ->"" : string +>"" : "" >true : true for (var v of tuple) { diff --git a/tests/baselines/reference/for-of37.types b/tests/baselines/reference/for-of37.types index 986e26784026f..1168921596e11 100644 --- a/tests/baselines/reference/for-of37.types +++ b/tests/baselines/reference/for-of37.types @@ -5,7 +5,7 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, true][] >["", true] : [string, true] ->"" : string +>"" : "" >true : true for (var v of map) { diff --git a/tests/baselines/reference/for-of38.types b/tests/baselines/reference/for-of38.types index 78223cfc5be80..e2201d24394f1 100644 --- a/tests/baselines/reference/for-of38.types +++ b/tests/baselines/reference/for-of38.types @@ -5,7 +5,7 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, true][] >["", true] : [string, true] ->"" : string +>"" : "" >true : true for (var [k, v] of map) { diff --git a/tests/baselines/reference/for-of4.types b/tests/baselines/reference/for-of4.types index 5b8990797ba5c..ef73afdb9d2a8 100644 --- a/tests/baselines/reference/for-of4.types +++ b/tests/baselines/reference/for-of4.types @@ -2,7 +2,7 @@ for (var v of [0]) { >v : number >[0] : number[] ->0 : number +>0 : 0 v; >v : number diff --git a/tests/baselines/reference/for-of40.types b/tests/baselines/reference/for-of40.types index 9d2207409f380..4c690ed9ce748 100644 --- a/tests/baselines/reference/for-of40.types +++ b/tests/baselines/reference/for-of40.types @@ -5,14 +5,14 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, true][] >["", true] : [string, true] ->"" : string +>"" : "" >true : true for (var [k = "", v = false] of map) { >k : string ->"" : string +>"" : "" >v : boolean ->false : boolean +>false : false >map : Map k; diff --git a/tests/baselines/reference/for-of41.types b/tests/baselines/reference/for-of41.types index 31e3e253002e7..70550035783de 100644 --- a/tests/baselines/reference/for-of41.types +++ b/tests/baselines/reference/for-of41.types @@ -5,11 +5,11 @@ var array = [{x: [0], y: {p: ""}}] >{x: [0], y: {p: ""}} : { x: number[]; y: { p: string; }; } >x : number[] >[0] : number[] ->0 : number +>0 : 0 >y : { p: string; } >{p: ""} : { p: string; } >p : string ->"" : string +>"" : "" for (var {x: [a], y: {p}} of array) { >x : any diff --git a/tests/baselines/reference/for-of42.types b/tests/baselines/reference/for-of42.types index 64327bcc27fb6..c0495982a085f 100644 --- a/tests/baselines/reference/for-of42.types +++ b/tests/baselines/reference/for-of42.types @@ -4,9 +4,9 @@ var array = [{ x: "", y: 0 }] >[{ x: "", y: 0 }] : { x: string; y: number; }[] >{ x: "", y: 0 } : { x: string; y: number; } >x : string ->"" : string +>"" : "" >y : number ->0 : number +>0 : 0 for (var {x: a, y: b} of array) { >x : any diff --git a/tests/baselines/reference/for-of43.types b/tests/baselines/reference/for-of43.types index a11cd47182c5f..2327f1bafedde 100644 --- a/tests/baselines/reference/for-of43.types +++ b/tests/baselines/reference/for-of43.types @@ -4,22 +4,22 @@ var array = [{ x: "", y: 0 }] >[{ x: "", y: 0 }] : { x: string; y: number; }[] >{ x: "", y: 0 } : { x: string; y: number; } >x : string ->"" : string +>"" : "" >y : number ->0 : number +>0 : 0 for (var {x: a = "", y: b = true} of array) { >x : any >a : string ->"" : string +>"" : "" >y : any ->b : number | boolean ->true : boolean +>b : number | true +>true : true >array : { x: string; y: number; }[] a; >a : string b; ->b : number | boolean +>b : number | true } diff --git a/tests/baselines/reference/for-of44.types b/tests/baselines/reference/for-of44.types index 152edd6f1659e..42da734edb97e 100644 --- a/tests/baselines/reference/for-of44.types +++ b/tests/baselines/reference/for-of44.types @@ -1,15 +1,15 @@ === tests/cases/conformance/es6/for-ofStatements/for-of44.ts === var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symbol()]] >array : [number, string | boolean | symbol][] ->[[0, ""], [0, true], [1, Symbol()]] : ([number, string] | [number, true] | [number, symbol])[] ->[0, ""] : [number, string] ->0 : number ->"" : string +>[[0, ""], [0, true], [1, Symbol()]] : ([number, ""] | [number, true] | [number, symbol])[] +>[0, ""] : [number, ""] +>0 : 0 +>"" : "" >[0, true] : [number, true] ->0 : number +>0 : 0 >true : true >[1, Symbol()] : [number, symbol] ->1 : number +>1 : 1 >Symbol() : symbol >Symbol : SymbolConstructor diff --git a/tests/baselines/reference/for-of45.types b/tests/baselines/reference/for-of45.types index a2a70ddfed3d2..6e6a0a11bf425 100644 --- a/tests/baselines/reference/for-of45.types +++ b/tests/baselines/reference/for-of45.types @@ -9,14 +9,14 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, true][] >["", true] : [string, true] ->"" : string +>"" : "" >true : true for ([k = "", v = false] of map) { ->[k = "", v = false] : [string, false] ->k = "" : string +>[k = "", v = false] : [string, boolean] +>k = "" : "" >k : string ->"" : string +>"" : "" >v = false : false >v : boolean >false : false diff --git a/tests/baselines/reference/for-of46.errors.txt b/tests/baselines/reference/for-of46.errors.txt index 13685b122ca7e..c2a47bffdf656 100644 --- a/tests/baselines/reference/for-of46.errors.txt +++ b/tests/baselines/reference/for-of46.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/for-ofStatements/for-of46.ts(3,7): error TS2322: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/es6/for-ofStatements/for-of46.ts(3,18): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/es6/for-ofStatements/for-of46.ts(3,7): error TS2322: Type 'false' is not assignable to type 'string'. +tests/cases/conformance/es6/for-ofStatements/for-of46.ts(3,18): error TS2322: Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/for-ofStatements/for-of46.ts (2 errors) ==== @@ -7,9 +7,9 @@ tests/cases/conformance/es6/for-ofStatements/for-of46.ts(3,18): error TS2322: Ty var map = new Map([["", true]]); for ([k = false, v = ""] of map) { ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'false' is not assignable to type 'string'. ~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. k; v; } \ No newline at end of file diff --git a/tests/baselines/reference/for-of5.types b/tests/baselines/reference/for-of5.types index 921c327c18558..b5bc8f0b30aa4 100644 --- a/tests/baselines/reference/for-of5.types +++ b/tests/baselines/reference/for-of5.types @@ -2,7 +2,7 @@ for (let v of [0]) { >v : number >[0] : number[] ->0 : number +>0 : 0 v; >v : number diff --git a/tests/baselines/reference/for-of50.types b/tests/baselines/reference/for-of50.types index 87ad29793e832..8da0666571106 100644 --- a/tests/baselines/reference/for-of50.types +++ b/tests/baselines/reference/for-of50.types @@ -5,7 +5,7 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, true][] >["", true] : [string, true] ->"" : string +>"" : "" >true : true for (const [k, v] of map) { diff --git a/tests/baselines/reference/for-of8.types b/tests/baselines/reference/for-of8.types index 36bb20ef6b047..6122cd935fe58 100644 --- a/tests/baselines/reference/for-of8.types +++ b/tests/baselines/reference/for-of8.types @@ -5,5 +5,5 @@ v; for (var v of [0]) { } >v : number >[0] : number[] ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/for-of9.types b/tests/baselines/reference/for-of9.types index bf06bf460344c..4cd3cceb8252e 100644 --- a/tests/baselines/reference/for-of9.types +++ b/tests/baselines/reference/for-of9.types @@ -5,9 +5,9 @@ var v: string; for (v of ["hello"]) { } >v : string >["hello"] : string[] ->"hello" : string +>"hello" : "hello" for (v of "hello") { } >v : string ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/forInModule.types b/tests/baselines/reference/forInModule.types index d78a511206b1b..74bb866ec51b2 100644 --- a/tests/baselines/reference/forInModule.types +++ b/tests/baselines/reference/forInModule.types @@ -4,10 +4,10 @@ module Foo { for (var i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/forStatements.types b/tests/baselines/reference/forStatements.types index 95b198a7fec7a..a6ae6ea9aa5f2 100644 --- a/tests/baselines/reference/forStatements.types +++ b/tests/baselines/reference/forStatements.types @@ -38,7 +38,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string ->42 : number +>42 : 42 module M { >M : typeof M @@ -61,18 +61,18 @@ module M { for(var aNumber: number = 9.9;;){} >aNumber : number ->9.9 : number +>9.9 : 9.9 for(var aString: string = 'this is a string';;){} >aString : string ->'this is a string' : string +>'this is a string' : "this is a string" for(var aDate: Date = new Date(12);;){} >aDate : Date >Date : Date >new Date(12) : Date >Date : DateConstructor ->12 : number +>12 : 12 for(var anObject: Object = new Object();;){} >anObject : Object @@ -115,7 +115,7 @@ for(var anObjectLiteral: I = { id: 12 };;){} >I : I >{ id: 12 } : { id: number; } >id : number ->12 : number +>12 : 12 for(var anOtherObjectLiteral: { id: number } = new C();;){} >anOtherObjectLiteral : { id: number; } @@ -138,7 +138,7 @@ for(var aLambda: typeof F = (x) => 2;;){} >F : (x: string) => number >(x) => 2 : (x: string) => number >x : string ->2 : number +>2 : 2 for(var aModule: typeof M = M;;){} >aModule : typeof M @@ -161,5 +161,5 @@ for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} >F2 : (x: number) => string >(x) => 'this is a string' : (x: number) => string >x : number ->'this is a string' : string +>'this is a string' : "this is a string" diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.types b/tests/baselines/reference/forStatementsMultipleValidDecl.types index acb26f173120b..f40f4bbbc3ce8 100644 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.types +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.types @@ -7,7 +7,7 @@ for (var x: number; ;) { } for (var x = 2; ;) { } >x : number ->2 : number +>2 : 2 for (var x = undefined; ;) { } >x : number @@ -20,7 +20,7 @@ function declSpace() { for (var x = 'this is a string'; ;) { } >x : string ->'this is a string' : string +>'this is a string' : "this is a string" } interface Point { x: number; y: number; } >Point : Point @@ -35,16 +35,16 @@ for (var p = { x: 1, y: 2 }; ;) { } >p : Point >{ x: 1, y: 2 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 for (var p: Point = { x: 0, y: undefined }; ;) { } >p : Point >Point : Point >{ x: 0, y: undefined } : { x: number; y: undefined; } >x : number ->0 : number +>0 : 0 >y : undefined >undefined : undefined @@ -52,7 +52,7 @@ for (var p = { x: 1, y: undefined }; ;) { } >p : Point >{ x: 1, y: undefined } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number >undefined : number >undefined : undefined @@ -63,9 +63,9 @@ for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } >y : number >{ x: 1, y: 2 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } >p : Point @@ -74,7 +74,7 @@ for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } >y : number >{ x: 0, y: undefined } : { x: number; y: undefined; } >x : number ->0 : number +>0 : 0 >y : undefined >undefined : undefined @@ -86,13 +86,13 @@ for (var fn = function (s: string) { return 42; }; ;) { } >fn : (s: string) => number >function (s: string) { return 42; } : (s: string) => number >s : string ->42 : number +>42 : 42 for (var fn = (s: string) => 3; ;) { } >fn : (s: string) => number >(s: string) => 3 : (s: string) => number >s : string ->3 : number +>3 : 3 for (var fn: (s: string) => number; ;) { } >fn : (s: string) => number @@ -118,8 +118,8 @@ for (var a: string[]; ;) { } for (var a = ['a', 'b']; ;) { } >a : string[] >['a', 'b'] : string[] ->'a' : string ->'b' : string +>'a' : "a" +>'b' : "b" for (var a = []; ;) { } >a : string[] diff --git a/tests/baselines/reference/fromAsIdentifier2.types b/tests/baselines/reference/fromAsIdentifier2.types index ae605f79268cc..cea6974c946f2 100644 --- a/tests/baselines/reference/fromAsIdentifier2.types +++ b/tests/baselines/reference/fromAsIdentifier2.types @@ -1,6 +1,6 @@ === tests/cases/compiler/fromAsIdentifier2.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" var from; >from : any diff --git a/tests/baselines/reference/funcdecl.types b/tests/baselines/reference/funcdecl.types index 94c310d7b2511..8c632237ef3ae 100644 --- a/tests/baselines/reference/funcdecl.types +++ b/tests/baselines/reference/funcdecl.types @@ -3,7 +3,7 @@ function simpleFunc() { >simpleFunc : () => string return "this is my simple func"; ->"this is my simple func" : string +>"this is my simple func" : "this is my simple func" } var simpleFuncVar = simpleFunc; >simpleFuncVar : () => string @@ -20,7 +20,7 @@ function withReturn() : string{ >withReturn : () => string return "Hello"; ->"Hello" : string +>"Hello" : "Hello" } var withReturnVar = withReturn; >withReturnVar : () => string @@ -64,9 +64,9 @@ function withInitializedParams(a: string, b0, b = 30, c = "string value") { >a : string >b0 : any >b : number ->30 : number +>30 : 30 >c : string ->"string value" : string +>"string value" : "string value" } var withInitializedParamsVar = withInitializedParams; >withInitializedParamsVar : (a: string, b0: any, b?: number, c?: string) => void @@ -76,7 +76,7 @@ function withOptionalInitializedParams(a: string, c: string = "hello string") { >withOptionalInitializedParams : (a: string, c?: string) => void >a : string >c : string ->"hello string" : string +>"hello string" : "hello string" } var withOptionalInitializedParamsVar = withOptionalInitializedParams; >withOptionalInitializedParamsVar : (a: string, c?: string) => void @@ -139,7 +139,7 @@ m2.foo(() => { var b = 30; >b : number ->30 : number +>30 : 30 return b; >b : number @@ -164,5 +164,5 @@ var f2 = () => { >() => { return "string";} : () => string return "string"; ->"string" : string +>"string" : "string" } diff --git a/tests/baselines/reference/functionAssignment.errors.txt b/tests/baselines/reference/functionAssignment.errors.txt index 19fd0897f9823..292c2804431b5 100644 --- a/tests/baselines/reference/functionAssignment.errors.txt +++ b/tests/baselines/reference/functionAssignment.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionAssignment.ts(22,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/functionAssignment.ts(22,5): error TS2322: Type '4' is not assignable to type 'string'. tests/cases/compiler/functionAssignment.ts(34,17): error TS2339: Property 'length' does not exist on type 'number'. @@ -26,7 +26,7 @@ tests/cases/compiler/functionAssignment.ts(34,17): error TS2339: Property 'lengt var n = ''; n = 4; ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '4' is not assignable to type 'string'. }); function f3(a: { a: number; b: number; }) { } diff --git a/tests/baselines/reference/functionAssignmentError.types b/tests/baselines/reference/functionAssignmentError.types index 6430aa10fc468..3223a7b40f84e 100644 --- a/tests/baselines/reference/functionAssignmentError.types +++ b/tests/baselines/reference/functionAssignmentError.types @@ -2,11 +2,11 @@ var func = function (){return "ONE";}; >func : () => string >function (){return "ONE";} : () => string ->"ONE" : string +>"ONE" : "ONE" func = function (){return "ONE";}; >func = function (){return "ONE";} : () => string >func : () => string >function (){return "ONE";} : () => string ->"ONE" : string +>"ONE" : "ONE" diff --git a/tests/baselines/reference/functionCall1.types b/tests/baselines/reference/functionCall1.types index 777fcd79f9135..9295a06982e32 100644 --- a/tests/baselines/reference/functionCall1.types +++ b/tests/baselines/reference/functionCall1.types @@ -1,7 +1,7 @@ === tests/cases/compiler/functionCall1.ts === function foo():any{return ""}; >foo : () => any ->"" : string +>"" : "" var x = foo(); >x : any diff --git a/tests/baselines/reference/functionCall10.errors.txt b/tests/baselines/reference/functionCall10.errors.txt index 8352fc70a58de..7891b7008cb4e 100644 --- a/tests/baselines/reference/functionCall10.errors.txt +++ b/tests/baselines/reference/functionCall10.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/functionCall10.ts(3,5): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -tests/cases/compiler/functionCall10.ts(5,8): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/functionCall10.ts(3,5): error TS2345: Argument of type '"foo"' is not assignable to parameter of type 'number'. +tests/cases/compiler/functionCall10.ts(5,8): error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/functionCall10.ts (2 errors) ==== @@ -7,9 +7,9 @@ tests/cases/compiler/functionCall10.ts(5,8): error TS2345: Argument of type 'str foo(0, 1); foo('foo'); ~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"foo"' is not assignable to parameter of type 'number'. foo(); foo(1, 'bar'); ~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall11.errors.txt b/tests/baselines/reference/functionCall11.errors.txt index a1790974bbba1..f1a5949acd7df 100644 --- a/tests/baselines/reference/functionCall11.errors.txt +++ b/tests/baselines/reference/functionCall11.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionCall11.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall11.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall11.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/functionCall11.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -12,7 +12,7 @@ tests/cases/compiler/functionCall11.ts(6,1): error TS2346: Supplied parameters d !!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 1, 'bar'); ~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionCall12.errors.txt b/tests/baselines/reference/functionCall12.errors.txt index eabe1131ec1d4..ef93a34b080fb 100644 --- a/tests/baselines/reference/functionCall12.errors.txt +++ b/tests/baselines/reference/functionCall12.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/functionCall12.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall12.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/functionCall12.ts(7,15): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall12.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall12.ts(7,15): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall12.ts (3 errors) ==== @@ -12,9 +12,9 @@ tests/cases/compiler/functionCall12.ts(7,15): error TS2345: Argument of type 'nu !!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 1, 'bar'); foo('foo', 1, 3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall13.errors.txt b/tests/baselines/reference/functionCall13.errors.txt index 31c05915aab72..a89d7fc1efa6a 100644 --- a/tests/baselines/reference/functionCall13.errors.txt +++ b/tests/baselines/reference/functionCall13.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionCall13.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall13.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall13.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall13.ts (2 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/functionCall13.ts(5,5): error TS2345: Argument of type 'num !!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 1, 3); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall14.errors.txt b/tests/baselines/reference/functionCall14.errors.txt index 3b671d0252bd6..2de62978c8481 100644 --- a/tests/baselines/reference/functionCall14.errors.txt +++ b/tests/baselines/reference/functionCall14.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionCall14.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall14.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall14.ts (1 errors) ==== @@ -8,6 +8,6 @@ tests/cases/compiler/functionCall14.ts(5,5): error TS2345: Argument of type 'num foo(); foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 1, 3); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall16.errors.txt b/tests/baselines/reference/functionCall16.errors.txt index eb71df23eca27..d338c1305dd3a 100644 --- a/tests/baselines/reference/functionCall16.errors.txt +++ b/tests/baselines/reference/functionCall16.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/functionCall16.ts(2,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall16.ts(2,12): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/functionCall16.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall16.ts(6,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall16.ts(6,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall16.ts (3 errors) ==== function foo(a:string, b?:string, ...c:number[]){} foo('foo', 1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo'); foo('foo', 'bar'); foo(); @@ -15,6 +15,6 @@ tests/cases/compiler/functionCall16.ts(6,5): error TS2345: Argument of type 'num !!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 'bar', 3); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall17.errors.txt b/tests/baselines/reference/functionCall17.errors.txt index 09f36c22cfb46..f266554b51858 100644 --- a/tests/baselines/reference/functionCall17.errors.txt +++ b/tests/baselines/reference/functionCall17.errors.txt @@ -1,23 +1,23 @@ -tests/cases/compiler/functionCall17.ts(2,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall17.ts(2,12): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/functionCall17.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall17.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/functionCall17.ts(6,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall17.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall17.ts(6,12): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall17.ts (4 errors) ==== function foo(a:string, b?:string, c?:number, ...d:number[]){} foo('foo', 1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo'); foo(); ~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 1, 3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 'bar', 3, 4); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall2.types b/tests/baselines/reference/functionCall2.types index 152d54cb1863c..aec991aa85fc7 100644 --- a/tests/baselines/reference/functionCall2.types +++ b/tests/baselines/reference/functionCall2.types @@ -1,7 +1,7 @@ === tests/cases/compiler/functionCall2.ts === function foo():number{return 1}; >foo : () => number ->1 : number +>1 : 1 var x = foo(); >x : number diff --git a/tests/baselines/reference/functionCall3.types b/tests/baselines/reference/functionCall3.types index b58803ae66657..2df6de6fa74c3 100644 --- a/tests/baselines/reference/functionCall3.types +++ b/tests/baselines/reference/functionCall3.types @@ -2,7 +2,7 @@ function foo():any[]{return [1];} >foo : () => any[] >[1] : number[] ->1 : number +>1 : 1 var x = foo(); >x : any[] diff --git a/tests/baselines/reference/functionCall4.types b/tests/baselines/reference/functionCall4.types index ea60c759a7dc4..41c406ef48332 100644 --- a/tests/baselines/reference/functionCall4.types +++ b/tests/baselines/reference/functionCall4.types @@ -1,7 +1,7 @@ === tests/cases/compiler/functionCall4.ts === function foo():any{return ""}; >foo : () => any ->"" : string +>"" : "" function bar():()=>any{return foo}; >bar : () => () => any diff --git a/tests/baselines/reference/functionCall6.errors.txt b/tests/baselines/reference/functionCall6.errors.txt index 4da265ea5e247..3d590d8f5c26b 100644 --- a/tests/baselines/reference/functionCall6.errors.txt +++ b/tests/baselines/reference/functionCall6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionCall6.ts(3,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall6.ts(3,5): error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. tests/cases/compiler/functionCall6.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/functionCall6.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -8,7 +8,7 @@ tests/cases/compiler/functionCall6.ts(5,1): error TS2346: Supplied parameters do foo('bar'); foo(2); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. foo('foo', 'bar'); ~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionCall7.errors.txt b/tests/baselines/reference/functionCall7.errors.txt index 576ea9c266e86..138c5f62f1636 100644 --- a/tests/baselines/reference/functionCall7.errors.txt +++ b/tests/baselines/reference/functionCall7.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionCall7.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall7.ts(6,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. +tests/cases/compiler/functionCall7.ts(6,5): error TS2345: Argument of type '4' is not assignable to parameter of type 'c1'. tests/cases/compiler/functionCall7.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -13,7 +13,7 @@ tests/cases/compiler/functionCall7.ts(7,1): error TS2346: Supplied parameters do !!! error TS2346: Supplied parameters do not match any signature of call target. foo(4); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. +!!! error TS2345: Argument of type '4' is not assignable to parameter of type 'c1'. foo(); ~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionCall8.errors.txt b/tests/baselines/reference/functionCall8.errors.txt index 0e5479c8cfdde..7cf197d5812bd 100644 --- a/tests/baselines/reference/functionCall8.errors.txt +++ b/tests/baselines/reference/functionCall8.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionCall8.ts(3,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall8.ts(4,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall8.ts(4,5): error TS2345: Argument of type '4' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall8.ts (2 errors) ==== @@ -10,6 +10,6 @@ tests/cases/compiler/functionCall8.ts(4,5): error TS2345: Argument of type 'numb !!! error TS2346: Supplied parameters do not match any signature of call target. foo(4); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '4' is not assignable to parameter of type 'string'. foo(); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall9.errors.txt b/tests/baselines/reference/functionCall9.errors.txt index d9d00593414b0..83cda64e2044b 100644 --- a/tests/baselines/reference/functionCall9.errors.txt +++ b/tests/baselines/reference/functionCall9.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionCall9.ts(4,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/functionCall9.ts(4,11): error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'. tests/cases/compiler/functionCall9.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -8,7 +8,7 @@ tests/cases/compiler/functionCall9.ts(5,1): error TS2346: Supplied parameters do foo('foo'); foo('foo','bar'); ~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'. foo('foo', 1, 'bar'); ~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 7d3fa793ec8a3..7f3d8d90802c7 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Function'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'Function'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(23,14): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'. @@ -33,7 +33,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain foo(1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Function'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'Function'. foo(() => { }, 1); ~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionExpressionContextualTyping1.types b/tests/baselines/reference/functionExpressionContextualTyping1.types index 893744c4954bd..58265c74aa29e 100644 --- a/tests/baselines/reference/functionExpressionContextualTyping1.types +++ b/tests/baselines/reference/functionExpressionContextualTyping1.types @@ -4,8 +4,8 @@ enum E { red, blue } >E : E ->red : E ->blue : E +>red : E.red +>blue : E.blue // A contextual signature S is extracted from a function type T as follows: // If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. @@ -25,7 +25,7 @@ var a0: (n: number, s: string) => number = (num, str) => { >toExponential : (fractionDigits?: number) => string return 0; ->0 : number +>0 : 0 } class Class { @@ -51,7 +51,7 @@ var a1: (c: Class) => number = (a1) => { >foo : () => void return 1; ->1 : number +>1 : 1 } // A contextual signature S is extracted from a function type T as follows: @@ -87,7 +87,7 @@ b2 = (foo, bar) => { return foo + 1; } >bar : string >foo + 1 : number >foo : number ->1 : number +>1 : 1 b2 = (foo, bar) => { return "hello"; } >b2 = (foo, bar) => { return "hello"; } : (foo: number, bar: string) => string @@ -95,7 +95,7 @@ b2 = (foo, bar) => { return "hello"; } >(foo, bar) => { return "hello"; } : (foo: number, bar: string) => string >foo : number >bar : string ->"hello" : string +>"hello" : "hello" var b3: (name: string, num: number, boo: boolean) => void; >b3 : (name: string, num: number, boo: boolean) => void @@ -117,15 +117,15 @@ var b4: (n: E) => string = (number = 1) => { return "hello"; }; >(number = 1) => { return "hello"; } : (number?: E) => string >number : E >1 : 1 ->"hello" : string +>"hello" : "hello" var b5: (n: {}) => string = (number = "string") => { return "hello"; }; >b5 : (n: {}) => string >n : {} >(number = "string") => { return "hello"; } : (number?: {}) => string >number : {} ->"string" : string ->"hello" : string +>"string" : "string" +>"hello" : "hello" // A contextual signature S is extracted from a function type T as follows: // Otherwise, no contextual signature can be extracted from T and S is undefined. diff --git a/tests/baselines/reference/functionImplementationErrors.errors.txt b/tests/baselines/reference/functionImplementationErrors.errors.txt index dc5ad5a27477d..224ebc7c08ef1 100644 --- a/tests/baselines/reference/functionImplementationErrors.errors.txt +++ b/tests/baselines/reference/functionImplementationErrors.errors.txt @@ -1,44 +1,26 @@ -tests/cases/conformance/functions/functionImplementationErrors.ts(3,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(7,19): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(11,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(17,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/functions/functionImplementationErrors.ts(26,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/functions/functionImplementationErrors.ts(31,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. tests/cases/conformance/functions/functionImplementationErrors.ts(36,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. -tests/cases/conformance/functions/functionImplementationErrors.ts(50,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(54,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(58,11): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(62,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(66,11): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(70,11): error TS2354: No best common type exists among return expressions. -==== tests/cases/conformance/functions/functionImplementationErrors.ts (13 errors) ==== +==== tests/cases/conformance/functions/functionImplementationErrors.ts (3 errors) ==== // FunctionExpression with no return type annotation with multiple return statements with unrelated types var f1 = function () { - ~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return ''; return 3; }; var f2 = function x() { - ~ -!!! error TS2354: No best common type exists among return expressions. return ''; return 3; }; var f3 = () => { - ~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return ''; return 3; }; // FunctionExpression with no return type annotation with return branch of number[] and other of string[] var f4 = function () { - ~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. if (true) { return ['']; } else { @@ -78,38 +60,26 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(70,11): error class Derived1 extends Base { private m; } class Derived2 extends Base { private n; } function f8() { - ~~ -!!! error TS2354: No best common type exists among return expressions. return new Derived1(); return new Derived2(); } var f9 = function () { - ~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return new Derived1(); return new Derived2(); }; var f10 = () => { - ~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return new Derived1(); return new Derived2(); }; function f11() { - ~~~ -!!! error TS2354: No best common type exists among return expressions. return new Base(); return new AnotherClass(); } var f12 = function () { - ~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return new Base(); return new AnotherClass(); }; var f13 = () => { - ~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return new Base(); return new AnotherClass(); }; diff --git a/tests/baselines/reference/functionImplementations.types b/tests/baselines/reference/functionImplementations.types index 6cb1cde1c82ab..d81b02598bdf0 100644 --- a/tests/baselines/reference/functionImplementations.types +++ b/tests/baselines/reference/functionImplementations.types @@ -102,7 +102,7 @@ var n = function () { >function () { return 3;} : () => number return 3; ->3 : number +>3 : 3 } (); @@ -139,7 +139,7 @@ var un = function () { // FunctionExpression with no return type annotation and returns a type parameter type var n = function (x: T) { >n : number ->function (x: T) { return x;} (4) : number +>function (x: T) { return x;} (4) : 4 >function (x: T) { return x;} : (x: T) => T >T : T >x : T @@ -149,12 +149,12 @@ var n = function (x: T) { >x : T } (4); ->4 : number +>4 : 4 // FunctionExpression with no return type annotation and returns a constrained type parameter type var n = function (x: T) { >n : number ->function (x: T) { return x;} (4) : number +>function (x: T) { return x;} (4) : 4 >function (x: T) { return x;} : (x: T) => T >T : T >x : T @@ -164,19 +164,19 @@ var n = function (x: T) { >x : T } (4); ->4 : number +>4 : 4 // FunctionExpression with no return type annotation with multiple return statements with identical types var n = function () { >n : number ->function () { return 3; return 5;}() : number ->function () { return 3; return 5;} : () => number +>function () { return 3; return 5;}() : 3 | 5 +>function () { return 3; return 5;} : () => 3 | 5 return 3; ->3 : number +>3 : 3 return 5; ->5 : number +>5 : 5 }(); @@ -255,7 +255,7 @@ function thisFunc() { function opt1(n = 4) { >opt1 : (n?: number) => void >n : number ->4 : number +>4 : 4 var m = n; >m : number @@ -331,7 +331,7 @@ var f7: (x: number) => string | number = x => { // should be (x: number) => numb if (x < 0) { return x; } >x < 0 : boolean >x : number ->0 : number +>0 : 0 >x : number return x.toString(); diff --git a/tests/baselines/reference/functionInIfStatementInModule.types b/tests/baselines/reference/functionInIfStatementInModule.types index 11cdd80f0a19f..48dd8f82d7938 100644 --- a/tests/baselines/reference/functionInIfStatementInModule.types +++ b/tests/baselines/reference/functionInIfStatementInModule.types @@ -4,7 +4,7 @@ module Midori >Midori : typeof Midori { if (false) { ->false : boolean +>false : false function Foo(src) >Foo : (src: any) => void diff --git a/tests/baselines/reference/functionLiteral.types b/tests/baselines/reference/functionLiteral.types index 06c811093c3d3..69a7fc44e5114 100644 --- a/tests/baselines/reference/functionLiteral.types +++ b/tests/baselines/reference/functionLiteral.types @@ -4,7 +4,7 @@ var x = () => 1; >x : () => number >() => 1 : () => number ->1 : number +>1 : 1 var x: { >x : () => number diff --git a/tests/baselines/reference/functionMergedWithModule.types b/tests/baselines/reference/functionMergedWithModule.types index ec0143f2923bc..1752016d5fdc7 100644 --- a/tests/baselines/reference/functionMergedWithModule.types +++ b/tests/baselines/reference/functionMergedWithModule.types @@ -5,7 +5,7 @@ function foo(title: string) { var x = 10; >x : number ->10 : number +>10 : 10 } module foo.Bar { diff --git a/tests/baselines/reference/functionOnlyHasThrow.types b/tests/baselines/reference/functionOnlyHasThrow.types index c4e8cce38a2e9..18011f10ada90 100644 --- a/tests/baselines/reference/functionOnlyHasThrow.types +++ b/tests/baselines/reference/functionOnlyHasThrow.types @@ -5,5 +5,5 @@ function clone():number { throw new Error("To be implemented"); >new Error("To be implemented") : Error >Error : ErrorConstructor ->"To be implemented" : string +>"To be implemented" : "To be implemented" } diff --git a/tests/baselines/reference/functionOverloadCompatibilityWithVoid02.types b/tests/baselines/reference/functionOverloadCompatibilityWithVoid02.types index aa6fda7222b85..6530f5a0a2762 100644 --- a/tests/baselines/reference/functionOverloadCompatibilityWithVoid02.types +++ b/tests/baselines/reference/functionOverloadCompatibilityWithVoid02.types @@ -8,5 +8,5 @@ function f(x: string): number { >x : string return 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/functionOverloads.errors.txt b/tests/baselines/reference/functionOverloads.errors.txt index bd3bab3388b05..5530f8133846e 100644 --- a/tests/baselines/reference/functionOverloads.errors.txt +++ b/tests/baselines/reference/functionOverloads.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads.ts(4,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionOverloads.ts(4,13): error TS2345: Argument of type '5' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionOverloads.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/functionOverloads.ts(4,13): error TS2345: Argument of type function foo(bar?: string): any { return "" }; var x = foo(5); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '5' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads12.types b/tests/baselines/reference/functionOverloads12.types index 5db8ff68cd4d7..d29f6262844f9 100644 --- a/tests/baselines/reference/functionOverloads12.types +++ b/tests/baselines/reference/functionOverloads12.types @@ -8,7 +8,7 @@ function foo():number; function foo():any { if (true) return ""; else return 0;} >foo : { (): string; (): number; } ->true : boolean ->"" : string ->0 : number +>true : true +>"" : "" +>0 : 0 diff --git a/tests/baselines/reference/functionOverloads13.types b/tests/baselines/reference/functionOverloads13.types index f26067c7eb84e..2e77cf7364590 100644 --- a/tests/baselines/reference/functionOverloads13.types +++ b/tests/baselines/reference/functionOverloads13.types @@ -10,5 +10,5 @@ function foo(bar:number):number; function foo(bar?:number):any { return "" } >foo : { (bar: number): string; (bar: number): number; } >bar : number ->"" : string +>"" : "" diff --git a/tests/baselines/reference/functionOverloads14.types b/tests/baselines/reference/functionOverloads14.types index 032ed700545f2..3e88bd04f8867 100644 --- a/tests/baselines/reference/functionOverloads14.types +++ b/tests/baselines/reference/functionOverloads14.types @@ -12,5 +12,5 @@ function foo():{a:any;} { return {a:1} } >a : any >{a:1} : { a: number; } >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/functionOverloads15.types b/tests/baselines/reference/functionOverloads15.types index 8fe428e9a4084..86c9fc6a6653e 100644 --- a/tests/baselines/reference/functionOverloads15.types +++ b/tests/baselines/reference/functionOverloads15.types @@ -16,5 +16,5 @@ function foo(foo:{a:string; b?:number;}):any { return "" } >foo : { a: string; b?: number; } >a : string >b : number ->"" : string +>"" : "" diff --git a/tests/baselines/reference/functionOverloads16.types b/tests/baselines/reference/functionOverloads16.types index e6c6ceb57a678..1d7a4184de1af 100644 --- a/tests/baselines/reference/functionOverloads16.types +++ b/tests/baselines/reference/functionOverloads16.types @@ -14,5 +14,5 @@ function foo(foo:{a:string; b?:number;}):any { return "" } >foo : { a: string; b?: number; } >a : string >b : number ->"" : string +>"" : "" diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 85a4a882487ef..60fbe2843d9d2 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads2.ts(4,13): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +tests/cases/compiler/functionOverloads2.ts(4,13): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/functionOverloads2.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/functionOverloads2.ts(4,13): error TS2345: Argument of type function foo(bar: any): any { return bar }; var x = foo(true); ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. \ No newline at end of file +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads21.types b/tests/baselines/reference/functionOverloads21.types index 3b4cf261ea948..4d87e3a123cd9 100644 --- a/tests/baselines/reference/functionOverloads21.types +++ b/tests/baselines/reference/functionOverloads21.types @@ -15,5 +15,5 @@ function foo(bar:{a:any; b?:string;}[]) { return 0 } >bar : { a: any; b?: string; }[] >a : any >b : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/functionOverloads22.types b/tests/baselines/reference/functionOverloads22.types index 7557b1c049f4f..ff6b30c084bb2 100644 --- a/tests/baselines/reference/functionOverloads22.types +++ b/tests/baselines/reference/functionOverloads22.types @@ -18,5 +18,5 @@ function foo(bar:any):{a:any;b?:any;}[] { return [{a:""}] } >[{a:""}] : { a: string; }[] >{a:""} : { a: string; } >a : string ->"" : string +>"" : "" diff --git a/tests/baselines/reference/functionOverloads23.types b/tests/baselines/reference/functionOverloads23.types index ee510a336e1ef..98970307672f9 100644 --- a/tests/baselines/reference/functionOverloads23.types +++ b/tests/baselines/reference/functionOverloads23.types @@ -13,5 +13,5 @@ function foo(bar:(a?)=>void) { return 0 } >foo : { (bar: (b: string) => void): any; (bar: (a: number) => void): any; } >bar : (a?: any) => void >a : any ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/functionOverloads25.types b/tests/baselines/reference/functionOverloads25.types index 5b5c3781e74c4..53539cbc12278 100644 --- a/tests/baselines/reference/functionOverloads25.types +++ b/tests/baselines/reference/functionOverloads25.types @@ -9,7 +9,7 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' }; >foo : { (): string; (bar: string): number; } >bar : any ->'' : string +>'' : "" var x = foo(); >x : string diff --git a/tests/baselines/reference/functionOverloads26.types b/tests/baselines/reference/functionOverloads26.types index 9345507b72ea7..19f11bcf3fc15 100644 --- a/tests/baselines/reference/functionOverloads26.types +++ b/tests/baselines/reference/functionOverloads26.types @@ -9,11 +9,11 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' } >foo : { (): string; (bar: string): number; } >bar : any ->'' : string +>'' : "" var x = foo('baz'); >x : number >foo('baz') : number >foo : { (): string; (bar: string): number; } ->'baz' : string +>'baz' : "baz" diff --git a/tests/baselines/reference/functionOverloads27.errors.txt b/tests/baselines/reference/functionOverloads27.errors.txt index a5d16935f2fbc..2b21de7134b44 100644 --- a/tests/baselines/reference/functionOverloads27.errors.txt +++ b/tests/baselines/reference/functionOverloads27.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads27.ts(4,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionOverloads27.ts(4,13): error TS2345: Argument of type '5' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionOverloads27.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/compiler/functionOverloads27.ts(4,13): error TS2345: Argument of typ function foo(bar?:any):any{ return '' } var x = foo(5); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '5' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads28.types b/tests/baselines/reference/functionOverloads28.types index ae4ab6c0664f3..96d126adf3e27 100644 --- a/tests/baselines/reference/functionOverloads28.types +++ b/tests/baselines/reference/functionOverloads28.types @@ -9,7 +9,7 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' } >foo : { (): string; (bar: string): number; } >bar : any ->'' : string +>'' : "" var t:any; var x = foo(t); >t : any diff --git a/tests/baselines/reference/functionOverloads30.types b/tests/baselines/reference/functionOverloads30.types index a97bc0bb74d41..fdbefa027ef1c 100644 --- a/tests/baselines/reference/functionOverloads30.types +++ b/tests/baselines/reference/functionOverloads30.types @@ -16,5 +16,5 @@ var x = foo('bar'); >x : string >foo('bar') : string >foo : { (bar: string): string; (bar: number): number; } ->'bar' : string +>'bar' : "bar" diff --git a/tests/baselines/reference/functionOverloads31.types b/tests/baselines/reference/functionOverloads31.types index c85470ebd65ef..a80ba71153e7b 100644 --- a/tests/baselines/reference/functionOverloads31.types +++ b/tests/baselines/reference/functionOverloads31.types @@ -16,5 +16,5 @@ var x = foo(5); >x : number >foo(5) : number >foo : { (bar: string): string; (bar: number): number; } ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/functionOverloads33.types b/tests/baselines/reference/functionOverloads33.types index 3d57c983305c4..99d8f429b803d 100644 --- a/tests/baselines/reference/functionOverloads33.types +++ b/tests/baselines/reference/functionOverloads33.types @@ -16,5 +16,5 @@ var x = foo(5); >x : number >foo(5) : number >foo : { (bar: string): string; (bar: any): number; } ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/functionOverloads35.types b/tests/baselines/reference/functionOverloads35.types index 1b811cf4246ee..8686bc2fdf895 100644 --- a/tests/baselines/reference/functionOverloads35.types +++ b/tests/baselines/reference/functionOverloads35.types @@ -21,5 +21,5 @@ var x = foo({a:1}); >foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } >{a:1} : { a: number; } >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/functionOverloads36.types b/tests/baselines/reference/functionOverloads36.types index c8c1f7cede8af..8a78f466d349a 100644 --- a/tests/baselines/reference/functionOverloads36.types +++ b/tests/baselines/reference/functionOverloads36.types @@ -21,5 +21,5 @@ var x = foo({a:'foo'}); >foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } >{a:'foo'} : { a: string; } >a : string ->'foo' : string +>'foo' : "foo" diff --git a/tests/baselines/reference/functionOverloads38.types b/tests/baselines/reference/functionOverloads38.types index d718569c9bfa5..e8b32f78e7c3a 100644 --- a/tests/baselines/reference/functionOverloads38.types +++ b/tests/baselines/reference/functionOverloads38.types @@ -22,5 +22,5 @@ var x = foo([{a:1}]); >[{a:1}] : { a: number; }[] >{a:1} : { a: number; } >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/functionOverloads39.types b/tests/baselines/reference/functionOverloads39.types index bf4a6ec5ae946..058a98680f641 100644 --- a/tests/baselines/reference/functionOverloads39.types +++ b/tests/baselines/reference/functionOverloads39.types @@ -21,6 +21,6 @@ var x = foo([{a:true}]); >foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } >[{a:true}] : { a: true; }[] >{a:true} : { a: true; } ->a : true +>a : boolean >true : true diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index f965a4eb9e129..d871946cde246 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of type '{ a: "bar"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. + Type '{ a: "bar"; }' is not assignable to type '{ a: boolean; }'. Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'boolean'. + Type '"bar"' is not assignable to type 'boolean'. ==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== @@ -10,8 +10,8 @@ tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of typ function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); ~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Argument of type '{ a: "bar"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. +!!! error TS2345: Type '{ a: "bar"; }' is not assignable to type '{ a: boolean; }'. !!! error TS2345: Types of property 'a' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'boolean'. +!!! error TS2345: Type '"bar"' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads42.types b/tests/baselines/reference/functionOverloads42.types index 32e99d46aa12b..e709ea8b7efeb 100644 --- a/tests/baselines/reference/functionOverloads42.types +++ b/tests/baselines/reference/functionOverloads42.types @@ -22,5 +22,5 @@ var x = foo([{a:'s'}]); >[{a:'s'}] : { a: string; }[] >{a:'s'} : { a: string; } >a : string ->'s' : string +>'s' : "s" diff --git a/tests/baselines/reference/functionOverloads43.types b/tests/baselines/reference/functionOverloads43.types index e48ffd41f6016..41a29fd0fe3a1 100644 --- a/tests/baselines/reference/functionOverloads43.types +++ b/tests/baselines/reference/functionOverloads43.types @@ -34,7 +34,7 @@ var x = foo([{a: "str"}]); >[{a: "str"}] : { a: string; }[] >{a: "str"} : { a: string; } >a : string ->"str" : string +>"str" : "str" var y = foo([{a: 100}]); >y : number @@ -43,5 +43,5 @@ var y = foo([{a: 100}]); >[{a: 100}] : { a: number; }[] >{a: 100} : { a: number; } >a : number ->100 : number +>100 : 100 diff --git a/tests/baselines/reference/functionOverloads44.types b/tests/baselines/reference/functionOverloads44.types index 48fcfa3371bc9..af046ba72067d 100644 --- a/tests/baselines/reference/functionOverloads44.types +++ b/tests/baselines/reference/functionOverloads44.types @@ -66,7 +66,7 @@ var x1 = foo1([{a: "str"}]); >[{a: "str"}] : { a: string; }[] >{a: "str"} : { a: string; } >a : string ->"str" : string +>"str" : "str" var y1 = foo1([{a: 100}]); >y1 : Dog @@ -75,7 +75,7 @@ var y1 = foo1([{a: 100}]); >[{a: 100}] : { a: number; }[] >{a: 100} : { a: number; } >a : number ->100 : number +>100 : 100 var x2 = foo2([{a: "str"}]); >x2 : Dog | Cat @@ -84,7 +84,7 @@ var x2 = foo2([{a: "str"}]); >[{a: "str"}] : { a: string; }[] >{a: "str"} : { a: string; } >a : string ->"str" : string +>"str" : "str" var y2 = foo2([{a: 100}]); >y2 : Cat @@ -93,5 +93,5 @@ var y2 = foo2([{a: 100}]); >[{a: 100}] : { a: number; }[] >{a: 100} : { a: number; } >a : number ->100 : number +>100 : 100 diff --git a/tests/baselines/reference/functionOverloads45.types b/tests/baselines/reference/functionOverloads45.types index 29eb55a40edee..ca778e68056b1 100644 --- a/tests/baselines/reference/functionOverloads45.types +++ b/tests/baselines/reference/functionOverloads45.types @@ -66,7 +66,7 @@ var x1 = foo1([{a: "str"}]); >[{a: "str"}] : { a: string; }[] >{a: "str"} : { a: string; } >a : string ->"str" : string +>"str" : "str" var y1 = foo1([{a: 100}]); >y1 : Cat @@ -75,7 +75,7 @@ var y1 = foo1([{a: 100}]); >[{a: 100}] : { a: number; }[] >{a: 100} : { a: number; } >a : number ->100 : number +>100 : 100 var x2 = foo2([{a: "str"}]); >x2 : Dog @@ -84,7 +84,7 @@ var x2 = foo2([{a: "str"}]); >[{a: "str"}] : { a: string; }[] >{a: "str"} : { a: string; } >a : string ->"str" : string +>"str" : "str" var y2 = foo2([{a: 100}]); >y2 : Cat @@ -93,5 +93,5 @@ var y2 = foo2([{a: 100}]); >[{a: 100}] : { a: number; }[] >{a: 100} : { a: number; } >a : number ->100 : number +>100 : 100 diff --git a/tests/baselines/reference/functionOverloads7.types b/tests/baselines/reference/functionOverloads7.types index 7160068126f92..5bbc25dd5e2f0 100644 --- a/tests/baselines/reference/functionOverloads7.types +++ b/tests/baselines/reference/functionOverloads7.types @@ -12,7 +12,7 @@ class foo { private bar(foo?: any){ return "foo" } >bar : { (): any; (foo: string): any; } >foo : any ->"foo" : string +>"foo" : "foo" public n() { >n : () => void @@ -31,7 +31,7 @@ class foo { >this.bar : { (): any; (foo: string): any; } >this : this >bar : { (): any; (foo: string): any; } ->"test" : string +>"test" : "test" } } diff --git a/tests/baselines/reference/functionOverloads8.types b/tests/baselines/reference/functionOverloads8.types index 4751533e2af8f..c6876cdbe8f2e 100644 --- a/tests/baselines/reference/functionOverloads8.types +++ b/tests/baselines/reference/functionOverloads8.types @@ -9,5 +9,5 @@ function foo(foo:string); function foo(foo?:any){ return '' } >foo : { (): any; (foo: string): any; } >foo : any ->'' : string +>'' : "" diff --git a/tests/baselines/reference/functionOverloads9.types b/tests/baselines/reference/functionOverloads9.types index 88586c32eb288..6b7e1992f9939 100644 --- a/tests/baselines/reference/functionOverloads9.types +++ b/tests/baselines/reference/functionOverloads9.types @@ -6,11 +6,11 @@ function foo(foo:string); function foo(foo?:string){ return '' }; >foo : (foo: string) => any >foo : string ->'' : string +>'' : "" var x = foo('foo'); >x : any >foo('foo') : any >foo : (foo: string) => any ->'foo' : string +>'foo' : "foo" diff --git a/tests/baselines/reference/functionReturn.types b/tests/baselines/reference/functionReturn.types index f9c0b36fbc23a..7b8f58de2a891 100644 --- a/tests/baselines/reference/functionReturn.types +++ b/tests/baselines/reference/functionReturn.types @@ -21,7 +21,7 @@ function f4(): string { >f4 : () => string return ''; ->'' : string +>'' : "" return; } @@ -29,7 +29,7 @@ function f5(): string { >f5 : () => string return ''; ->'' : string +>'' : "" return undefined; >undefined : undefined diff --git a/tests/baselines/reference/functionType.types b/tests/baselines/reference/functionType.types index ac3d5c9944d13..985a66f435dc5 100644 --- a/tests/baselines/reference/functionType.types +++ b/tests/baselines/reference/functionType.types @@ -7,7 +7,7 @@ salt.apply("hello", []); >salt.apply : (this: Function, thisArg: any, argArray?: any) => any >salt : () => void >apply : (this: Function, thisArg: any, argArray?: any) => any ->"hello" : string +>"hello" : "hello" >[] : undefined[] (new Function("return 5"))(); @@ -15,7 +15,7 @@ salt.apply("hello", []); >(new Function("return 5")) : Function >new Function("return 5") : Function >Function : FunctionConstructor ->"return 5" : string +>"return 5" : "return 5" diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types index d695157db40d3..c45eb6f59cd60 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types @@ -2,5 +2,5 @@ function foo(x = 0) { } >foo : (x?: number) => void >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types index 8f8f03fafb18a..783b0f7242230 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types @@ -3,11 +3,11 @@ function foo(a = [0]) { } >foo : (a?: number[]) => void >a : number[] >[0] : number[] ->0 : number +>0 : 0 function bar(a = [0]) { >bar : (a?: number[]) => void >a : number[] >[0] : number[] ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types index e0a87bb265682..c548b0d5e92b3 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types @@ -7,12 +7,12 @@ function foo(a = v[0]) { } >a : any >v[0] : any >v : any[] ->0 : number +>0 : 0 function bar(a = v[0]) { >bar : (a?: any) => void >a : any >v[0] : any >v : any[] ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types index 58c2009886ac8..63b66352e545c 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types @@ -7,14 +7,14 @@ function foo(a = [1 + 1]) { } >a : number[] >[1 + 1] : number[] >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 function bar(a = [1 + 1]) { >bar : (a?: number[]) => void >a : number[] >[1 + 1] : number[] >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types index 2a5fbab691908..b88e03e5cce7d 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types @@ -8,8 +8,8 @@ function foo(a = v[1 + 1]) { } >v[1 + 1] : any >v : any[] >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 function bar(a = v[1 + 1]) { >bar : (a?: any) => void @@ -17,6 +17,6 @@ function bar(a = v[1 + 1]) { >v[1 + 1] : any >v : any[] >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types index e35f5a5f4e023..99020ba020a9b 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types @@ -7,14 +7,14 @@ function foo(a = (1 + 1)) { } >a : number >(1 + 1) : number >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 function bar(a = (1 + 1)) { >bar : (a?: number) => void >a : number >(1 + 1) : number >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types index 76b6b56dfa4eb..ac34fa3ad515a 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types @@ -2,5 +2,5 @@ function foo(x = 0) { >foo : (x?: number) => void >x : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types index 4254c0d28a93d..6d10e3fe3964c 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types @@ -2,10 +2,10 @@ function foo(a = "") { } >foo : (a?: string) => void >a : string ->"" : string +>"" : "" function bar(a = "") { >bar : (a?: string) => void >a : string ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types index 99e93927e0aac..52ef4b0bca0e6 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types @@ -2,10 +2,10 @@ function foo(a = 0) { } >foo : (a?: number) => void >a : number ->0 : number +>0 : 0 function bar(a = 0) { >bar : (a?: number) => void >a : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types index 6100a6dedce9d..d47f63a0ba49b 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types @@ -2,10 +2,10 @@ function foo(a = true) { } >foo : (a?: boolean) => void >a : boolean ->true : boolean +>true : true function bar(a = true) { >bar : (a?: boolean) => void >a : boolean ->true : boolean +>true : true } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types index 866087a9f9bda..987691e14e470 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types @@ -2,10 +2,10 @@ function foo(a = false) { } >foo : (a?: boolean) => void >a : boolean ->false : boolean +>false : false function bar(a = false) { >bar : (a?: boolean) => void >a : boolean ->false : boolean +>false : false } diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt deleted file mode 100644 index cc10d4c782c67..0000000000000 --- a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt +++ /dev/null @@ -1,85 +0,0 @@ -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(5,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(13,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(23,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(32,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(44,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(49,10): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts (6 errors) ==== - - // return type of a function with multiple returns is the BCT of each return statement - // it is an error if there is no single BCT, these are error cases - - function f1() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return 1; - } else { - return ''; - } - } - - function f2() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return 1; - } else if (false) { - return 2; - } else { - return ''; - } - } - - function f3() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - try { - return 1; - } - catch (e) { - return ''; - } - } - - function f4() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - try { - return 1; - } - catch (e) { - - } - finally { - return ''; - } - } - - function f5() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - return 1; - return ''; - } - - function f6(x: T, y:U) { - ~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return x; - } else { - return y; - } - } - - function f8(x: T, y: U) { - if (true) { - return x; - } else { - return y; - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.symbols b/tests/baselines/reference/functionWithMultipleReturnStatements.symbols new file mode 100644 index 0000000000000..a33db45964066 --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.symbols @@ -0,0 +1,103 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts === + +// return type of a function with multiple returns is the BCT of each return statement +// it is an error if there is no single BCT, these are error cases + +function f1() { +>f1 : Symbol(f1, Decl(functionWithMultipleReturnStatements.ts, 0, 0)) + + if (true) { + return 1; + } else { + return ''; + } +} + +function f2() { +>f2 : Symbol(f2, Decl(functionWithMultipleReturnStatements.ts, 10, 1)) + + if (true) { + return 1; + } else if (false) { + return 2; + } else { + return ''; + } +} + +function f3() { +>f3 : Symbol(f3, Decl(functionWithMultipleReturnStatements.ts, 20, 1)) + + try { + return 1; + } + catch (e) { +>e : Symbol(e, Decl(functionWithMultipleReturnStatements.ts, 26, 11)) + + return ''; + } +} + +function f4() { +>f4 : Symbol(f4, Decl(functionWithMultipleReturnStatements.ts, 29, 1)) + + try { + return 1; + } + catch (e) { +>e : Symbol(e, Decl(functionWithMultipleReturnStatements.ts, 35, 11)) + + } + finally { + return ''; + } +} + +function f5() { +>f5 : Symbol(f5, Decl(functionWithMultipleReturnStatements.ts, 41, 1)) + + return 1; + return ''; +} + +function f6(x: T, y:U) { +>f6 : Symbol(f6, Decl(functionWithMultipleReturnStatements.ts, 46, 1)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements.ts, 48, 12)) +>U : Symbol(U, Decl(functionWithMultipleReturnStatements.ts, 48, 14)) +>x : Symbol(x, Decl(functionWithMultipleReturnStatements.ts, 48, 18)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements.ts, 48, 12)) +>y : Symbol(y, Decl(functionWithMultipleReturnStatements.ts, 48, 23)) +>U : Symbol(U, Decl(functionWithMultipleReturnStatements.ts, 48, 14)) + + if (true) { + return x; +>x : Symbol(x, Decl(functionWithMultipleReturnStatements.ts, 48, 18)) + + } else { + return y; +>y : Symbol(y, Decl(functionWithMultipleReturnStatements.ts, 48, 23)) + } +} + +function f8(x: T, y: U) { +>f8 : Symbol(f8, Decl(functionWithMultipleReturnStatements.ts, 54, 1)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements.ts, 56, 12)) +>U : Symbol(U, Decl(functionWithMultipleReturnStatements.ts, 56, 24)) +>U : Symbol(U, Decl(functionWithMultipleReturnStatements.ts, 56, 24)) +>V : Symbol(V, Decl(functionWithMultipleReturnStatements.ts, 56, 37)) +>V : Symbol(V, Decl(functionWithMultipleReturnStatements.ts, 56, 37)) +>x : Symbol(x, Decl(functionWithMultipleReturnStatements.ts, 56, 41)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements.ts, 56, 12)) +>y : Symbol(y, Decl(functionWithMultipleReturnStatements.ts, 56, 46)) +>U : Symbol(U, Decl(functionWithMultipleReturnStatements.ts, 56, 24)) + + if (true) { + return x; +>x : Symbol(x, Decl(functionWithMultipleReturnStatements.ts, 56, 41)) + + } else { + return y; +>y : Symbol(y, Decl(functionWithMultipleReturnStatements.ts, 56, 46)) + } +} + diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.types b/tests/baselines/reference/functionWithMultipleReturnStatements.types new file mode 100644 index 0000000000000..775ca52e1dba7 --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.types @@ -0,0 +1,128 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts === + +// return type of a function with multiple returns is the BCT of each return statement +// it is an error if there is no single BCT, these are error cases + +function f1() { +>f1 : () => "" | 1 + + if (true) { +>true : true + + return 1; +>1 : 1 + + } else { + return ''; +>'' : "" + } +} + +function f2() { +>f2 : () => "" | 1 | 2 + + if (true) { +>true : true + + return 1; +>1 : 1 + + } else if (false) { +>false : false + + return 2; +>2 : 2 + + } else { + return ''; +>'' : "" + } +} + +function f3() { +>f3 : () => "" | 1 + + try { + return 1; +>1 : 1 + } + catch (e) { +>e : any + + return ''; +>'' : "" + } +} + +function f4() { +>f4 : () => "" | 1 + + try { + return 1; +>1 : 1 + } + catch (e) { +>e : any + + } + finally { + return ''; +>'' : "" + } +} + +function f5() { +>f5 : () => "" | 1 + + return 1; +>1 : 1 + + return ''; +>'' : "" +} + +function f6(x: T, y:U) { +>f6 : (x: T, y: U) => T | U +>T : T +>U : U +>x : T +>T : T +>y : U +>U : U + + if (true) { +>true : true + + return x; +>x : T + + } else { + return y; +>y : U + } +} + +function f8(x: T, y: U) { +>f8 : (x: T, y: U) => U +>T : T +>U : U +>U : U +>V : V +>V : V +>x : T +>T : T +>y : U +>U : U + + if (true) { +>true : true + + return x; +>x : T + + } else { + return y; +>y : U + } +} + diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt deleted file mode 100644 index 0399c7a79a6a6..0000000000000 --- a/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt +++ /dev/null @@ -1,101 +0,0 @@ -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(59,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(68,10): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts (2 errors) ==== - - // return type of a function with multiple returns is the BCT of each return statement - // no errors expected here - - function f1() { - if (true) { - return 1; - } else { - return null; - } - } - - function f2() { - if (true) { - return 1; - } else if (false) { - return null; - } else { - return 2; - } - } - - function f4() { - try { - return 1; - } - catch (e) { - return undefined; - } - finally { - return 1; - } - } - - function f5() { - return 1; - return new Object(); - } - - function f6(x: T) { - if (true) { - return x; - } else { - return null; - } - } - - //function f7(x: T, y: U) { - // if (true) { - // return x; - // } else { - // return y; - // } - //} - - var a: { x: number; y?: number }; - var b: { x: number; z?: number }; - // returns typeof a - function f9() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return a; - } else { - return b; - } - } - - // returns typeof b - function f10() { - ~~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return b; - } else { - return a; - } - } - - // returns number => void - function f11() { - if (true) { - return (x: number) => { } - } else { - return (x: Object) => { } - } - } - - // returns Object => void - function f12() { - if (true) { - return (x: Object) => { } - } else { - return (x: number) => { } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.symbols b/tests/baselines/reference/functionWithMultipleReturnStatements2.symbols new file mode 100644 index 0000000000000..39cad6bc41488 --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.symbols @@ -0,0 +1,142 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts === + +// return type of a function with multiple returns is the BCT of each return statement +// no errors expected here + +function f1() { +>f1 : Symbol(f1, Decl(functionWithMultipleReturnStatements2.ts, 0, 0)) + + if (true) { + return 1; + } else { + return null; + } +} + +function f2() { +>f2 : Symbol(f2, Decl(functionWithMultipleReturnStatements2.ts, 10, 1)) + + if (true) { + return 1; + } else if (false) { + return null; + } else { + return 2; + } +} + +function f4() { +>f4 : Symbol(f4, Decl(functionWithMultipleReturnStatements2.ts, 20, 1)) + + try { + return 1; + } + catch (e) { +>e : Symbol(e, Decl(functionWithMultipleReturnStatements2.ts, 26, 11)) + + return undefined; +>undefined : Symbol(undefined) + } + finally { + return 1; + } +} + +function f5() { +>f5 : Symbol(f5, Decl(functionWithMultipleReturnStatements2.ts, 32, 1)) + + return 1; + return new Object(); +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +} + +function f6(x: T) { +>f6 : Symbol(f6, Decl(functionWithMultipleReturnStatements2.ts, 37, 1)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements2.ts, 39, 12)) +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 39, 15)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements2.ts, 39, 12)) + + if (true) { + return x; +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 39, 15)) + + } else { + return null; + } +} + +//function f7(x: T, y: U) { +// if (true) { +// return x; +// } else { +// return y; +// } +//} + +var a: { x: number; y?: number }; +>a : Symbol(a, Decl(functionWithMultipleReturnStatements2.ts, 55, 3)) +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 55, 8)) +>y : Symbol(y, Decl(functionWithMultipleReturnStatements2.ts, 55, 19)) + +var b: { x: number; z?: number }; +>b : Symbol(b, Decl(functionWithMultipleReturnStatements2.ts, 56, 3)) +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 56, 8)) +>z : Symbol(z, Decl(functionWithMultipleReturnStatements2.ts, 56, 19)) + +// returns typeof a +function f9() { +>f9 : Symbol(f9, Decl(functionWithMultipleReturnStatements2.ts, 56, 33)) + + if (true) { + return a; +>a : Symbol(a, Decl(functionWithMultipleReturnStatements2.ts, 55, 3)) + + } else { + return b; +>b : Symbol(b, Decl(functionWithMultipleReturnStatements2.ts, 56, 3)) + } +} + +// returns typeof b +function f10() { +>f10 : Symbol(f10, Decl(functionWithMultipleReturnStatements2.ts, 64, 1)) + + if (true) { + return b; +>b : Symbol(b, Decl(functionWithMultipleReturnStatements2.ts, 56, 3)) + + } else { + return a; +>a : Symbol(a, Decl(functionWithMultipleReturnStatements2.ts, 55, 3)) + } +} + +// returns number => void +function f11() { +>f11 : Symbol(f11, Decl(functionWithMultipleReturnStatements2.ts, 73, 1)) + + if (true) { + return (x: number) => { } +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 78, 16)) + + } else { + return (x: Object) => { } +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 80, 16)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + } +} + +// returns Object => void +function f12() { +>f12 : Symbol(f12, Decl(functionWithMultipleReturnStatements2.ts, 82, 1)) + + if (true) { + return (x: Object) => { } +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 87, 16)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + } else { + return (x: number) => { } +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 89, 16)) + } +} diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.types b/tests/baselines/reference/functionWithMultipleReturnStatements2.types new file mode 100644 index 0000000000000..4615299bbf19d --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.types @@ -0,0 +1,176 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts === + +// return type of a function with multiple returns is the BCT of each return statement +// no errors expected here + +function f1() { +>f1 : () => number + + if (true) { +>true : true + + return 1; +>1 : 1 + + } else { + return null; +>null : null + } +} + +function f2() { +>f2 : () => 1 | 2 + + if (true) { +>true : true + + return 1; +>1 : 1 + + } else if (false) { +>false : false + + return null; +>null : null + + } else { + return 2; +>2 : 2 + } +} + +function f4() { +>f4 : () => number + + try { + return 1; +>1 : 1 + } + catch (e) { +>e : any + + return undefined; +>undefined : undefined + } + finally { + return 1; +>1 : 1 + } +} + +function f5() { +>f5 : () => Object + + return 1; +>1 : 1 + + return new Object(); +>new Object() : Object +>Object : ObjectConstructor +} + +function f6(x: T) { +>f6 : (x: T) => T +>T : T +>x : T +>T : T + + if (true) { +>true : true + + return x; +>x : T + + } else { + return null; +>null : null + } +} + +//function f7(x: T, y: U) { +// if (true) { +// return x; +// } else { +// return y; +// } +//} + +var a: { x: number; y?: number }; +>a : { x: number; y?: number; } +>x : number +>y : number + +var b: { x: number; z?: number }; +>b : { x: number; z?: number; } +>x : number +>z : number + +// returns typeof a +function f9() { +>f9 : () => { x: number; y?: number; } | { x: number; z?: number; } + + if (true) { +>true : true + + return a; +>a : { x: number; y?: number; } + + } else { + return b; +>b : { x: number; z?: number; } + } +} + +// returns typeof b +function f10() { +>f10 : () => { x: number; y?: number; } | { x: number; z?: number; } + + if (true) { +>true : true + + return b; +>b : { x: number; z?: number; } + + } else { + return a; +>a : { x: number; y?: number; } + } +} + +// returns number => void +function f11() { +>f11 : () => (x: number) => void + + if (true) { +>true : true + + return (x: number) => { } +>(x: number) => { } : (x: number) => void +>x : number + + } else { + return (x: Object) => { } +>(x: Object) => { } : (x: Object) => void +>x : Object +>Object : Object + } +} + +// returns Object => void +function f12() { +>f12 : () => (x: Object) => void + + if (true) { +>true : true + + return (x: Object) => { } +>(x: Object) => { } : (x: Object) => void +>x : Object +>Object : Object + + } else { + return (x: number) => { } +>(x: number) => { } : (x: number) => void +>x : number + } +} diff --git a/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt b/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt deleted file mode 100644 index 86234b7dd81b2..0000000000000 --- a/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/compiler/functionWithNoBestCommonType1.ts(2,10): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/compiler/functionWithNoBestCommonType1.ts (1 errors) ==== - - function foo() { - ~~~ -!!! error TS2354: No best common type exists among return expressions. - return true; - return bar(); - } - - function bar(): void { - } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithNoBestCommonType1.symbols b/tests/baselines/reference/functionWithNoBestCommonType1.symbols new file mode 100644 index 0000000000000..826b23f1b48a9 --- /dev/null +++ b/tests/baselines/reference/functionWithNoBestCommonType1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/functionWithNoBestCommonType1.ts === + +function foo() { +>foo : Symbol(foo, Decl(functionWithNoBestCommonType1.ts, 0, 0)) + + return true; + return bar(); +>bar : Symbol(bar, Decl(functionWithNoBestCommonType1.ts, 4, 1)) +} + +function bar(): void { +>bar : Symbol(bar, Decl(functionWithNoBestCommonType1.ts, 4, 1)) +} diff --git a/tests/baselines/reference/functionWithNoBestCommonType1.types b/tests/baselines/reference/functionWithNoBestCommonType1.types new file mode 100644 index 0000000000000..f93ffad337992 --- /dev/null +++ b/tests/baselines/reference/functionWithNoBestCommonType1.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionWithNoBestCommonType1.ts === + +function foo() { +>foo : () => true | void + + return true; +>true : true + + return bar(); +>bar() : void +>bar : () => void +} + +function bar(): void { +>bar : () => void +} diff --git a/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt b/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt deleted file mode 100644 index 6ce898e447cf6..0000000000000 --- a/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/compiler/functionWithNoBestCommonType2.ts(2,9): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/compiler/functionWithNoBestCommonType2.ts (1 errors) ==== - - var v = function () { - ~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. - return true; - return bar(); - }; - - function bar(): void { - } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithNoBestCommonType2.symbols b/tests/baselines/reference/functionWithNoBestCommonType2.symbols new file mode 100644 index 0000000000000..f32f86e67a9e7 --- /dev/null +++ b/tests/baselines/reference/functionWithNoBestCommonType2.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionWithNoBestCommonType2.ts === + +var v = function () { +>v : Symbol(v, Decl(functionWithNoBestCommonType2.ts, 1, 3)) + + return true; + return bar(); +>bar : Symbol(bar, Decl(functionWithNoBestCommonType2.ts, 4, 2)) + +}; + +function bar(): void { +>bar : Symbol(bar, Decl(functionWithNoBestCommonType2.ts, 4, 2)) +} diff --git a/tests/baselines/reference/functionWithNoBestCommonType2.types b/tests/baselines/reference/functionWithNoBestCommonType2.types new file mode 100644 index 0000000000000..76fdbda535f6a --- /dev/null +++ b/tests/baselines/reference/functionWithNoBestCommonType2.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionWithNoBestCommonType2.ts === + +var v = function () { +>v : () => true | void +>function () { return true; return bar();} : () => true | void + + return true; +>true : true + + return bar(); +>bar() : void +>bar : () => void + +}; + +function bar(): void { +>bar : () => void +} diff --git a/tests/baselines/reference/functionWithThrowButNoReturn1.types b/tests/baselines/reference/functionWithThrowButNoReturn1.types index c136d8a407602..462d5b9c88abd 100644 --- a/tests/baselines/reference/functionWithThrowButNoReturn1.types +++ b/tests/baselines/reference/functionWithThrowButNoReturn1.types @@ -5,7 +5,7 @@ function fn(): number { throw new Error('NYI'); >new Error('NYI') : Error >Error : ErrorConstructor ->'NYI' : string +>'NYI' : "NYI" var t; >t : any diff --git a/tests/baselines/reference/functionsInClassExpressions.types b/tests/baselines/reference/functionsInClassExpressions.types index ee4b5696cc176..b00f3df34902e 100644 --- a/tests/baselines/reference/functionsInClassExpressions.types +++ b/tests/baselines/reference/functionsInClassExpressions.types @@ -12,7 +12,7 @@ let Foo = class { } bar = 0; >bar : number ->0 : number +>0 : 0 inc = () => { >inc : () => void diff --git a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types index 2d71370c2ac0a..e58cf1551fa77 100644 --- a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types +++ b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types @@ -12,6 +12,6 @@ module fn { export var n = 1; >n : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/generatedContextualTyping.types b/tests/baselines/reference/generatedContextualTyping.types index 2e9625cdb8bd1..a9b350f856446 100644 --- a/tests/baselines/reference/generatedContextualTyping.types +++ b/tests/baselines/reference/generatedContextualTyping.types @@ -2849,7 +2849,7 @@ var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; >x285 : () => Base[] >Base : Base >true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2863,7 +2863,7 @@ var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { re >x286 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2877,7 +2877,7 @@ var x287: () => Base[] = true ? function named() { return [d1, d2] } : function >x287 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2893,7 +2893,7 @@ var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; >x288 : () => Base[] >Base : Base >true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2907,7 +2907,7 @@ var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { >x289 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2921,7 +2921,7 @@ var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : functi >x290 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2937,7 +2937,7 @@ var x291: Base[] = true ? [d1, d2] : [d1, d2]; >x291 : Base[] >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2950,7 +2950,7 @@ var x292: Array = true ? [d1, d2] : [d1, d2]; >Array : T[] >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2963,7 +2963,7 @@ var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; >n : number >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2976,7 +2976,7 @@ var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; >n : Base[] >Base : Base >true ? { n: [d1, d2] } : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->true : boolean +>true : true >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2993,7 +2993,7 @@ var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n = >s : Base[] >Base : Base >true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; } : (n: Base[]) => any ->true : boolean +>true : true >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] @@ -3010,7 +3010,7 @@ var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n >Genric : Genric >Base : Base >true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->true : boolean +>true : true >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] >n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] @@ -3030,7 +3030,7 @@ var x297: () => Base[] = true ? undefined : () => [d1, d2]; >x297 : () => Base[] >Base : Base >true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3041,7 +3041,7 @@ var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; >x298 : () => Base[] >Base : Base >true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3052,7 +3052,7 @@ var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] } >x299 : () => Base[] >Base : Base >true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] @@ -3064,7 +3064,7 @@ var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; >x300 : () => Base[] >Base : Base >true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3075,7 +3075,7 @@ var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; >x301 : () => Base[] >Base : Base >true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3086,7 +3086,7 @@ var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2 >x302 : () => Base[] >Base : Base >true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] @@ -3098,7 +3098,7 @@ var x303: Base[] = true ? undefined : [d1, d2]; >x303 : Base[] >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3109,7 +3109,7 @@ var x304: Array = true ? undefined : [d1, d2]; >Array : T[] >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3120,7 +3120,7 @@ var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; >n : number >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3131,7 +3131,7 @@ var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; >n : Base[] >Base : Base >true ? undefined : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->true : boolean +>true : true >undefined : undefined >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] @@ -3144,7 +3144,7 @@ var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return n >s : Base[] >Base : Base >true ? undefined : n => { var n: Base[]; return null; } : (n: Base[]) => any ->true : boolean +>true : true >undefined : undefined >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] @@ -3157,7 +3157,7 @@ var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; >Genric : Genric >Base : Base >true ? undefined : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->true : boolean +>true : true >undefined : undefined >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] @@ -3171,7 +3171,7 @@ var x309: () => Base[] = true ? () => [d1, d2] : undefined; >x309 : () => Base[] >Base : Base >true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3182,7 +3182,7 @@ var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; >x310 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3193,7 +3193,7 @@ var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined >x311 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3205,7 +3205,7 @@ var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; >x312 : () => Base[] >Base : Base >true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3216,7 +3216,7 @@ var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; >x313 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3227,7 +3227,7 @@ var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefi >x314 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3239,7 +3239,7 @@ var x315: Base[] = true ? [d1, d2] : undefined; >x315 : Base[] >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3250,7 +3250,7 @@ var x316: Array = true ? [d1, d2] : undefined; >Array : T[] >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3261,7 +3261,7 @@ var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; >n : number >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3272,7 +3272,7 @@ var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; >n : Base[] >Base : Base >true ? { n: [d1, d2] } : undefined : { n: (Derived1 | Derived2)[]; } ->true : boolean +>true : true >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3285,7 +3285,7 @@ var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : und >s : Base[] >Base : Base >true ? n => { var n: Base[]; return null; } : undefined : (n: Base[]) => any ->true : boolean +>true : true >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] @@ -3298,7 +3298,7 @@ var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; >Genric : Genric >Base : Base >true ? { func: n => { return [d1, d2]; } } : undefined : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->true : boolean +>true : true >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] >n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] diff --git a/tests/baselines/reference/generatorES6_2.types b/tests/baselines/reference/generatorES6_2.types index 9c9c8692757bb..61a2adbc697fa 100644 --- a/tests/baselines/reference/generatorES6_2.types +++ b/tests/baselines/reference/generatorES6_2.types @@ -3,10 +3,10 @@ class C { >C : C public * foo() { ->foo : () => IterableIterator +>foo : () => IterableIterator<1> yield 1 >yield 1 : any ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/generatorES6_3.types b/tests/baselines/reference/generatorES6_3.types index e87ad23ba77bc..9ecd01d6e23bb 100644 --- a/tests/baselines/reference/generatorES6_3.types +++ b/tests/baselines/reference/generatorES6_3.types @@ -1,9 +1,9 @@ === tests/cases/compiler/generatorES6_3.ts === var v = function*() { ->v : () => IterableIterator ->function*() { yield 0} : () => IterableIterator +>v : () => IterableIterator<0> +>function*() { yield 0} : () => IterableIterator<0> yield 0 >yield 0 : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/generatorES6_4.types b/tests/baselines/reference/generatorES6_4.types index 64b0924919b00..786e7b64020fd 100644 --- a/tests/baselines/reference/generatorES6_4.types +++ b/tests/baselines/reference/generatorES6_4.types @@ -1,13 +1,13 @@ === tests/cases/compiler/generatorES6_4.ts === var v = { ->v : { foo(): IterableIterator; } ->{ *foo() { yield 0 }} : { foo(): IterableIterator; } +>v : { foo(): IterableIterator<0>; } +>{ *foo() { yield 0 }} : { foo(): IterableIterator<0>; } *foo() { ->foo : () => IterableIterator +>foo : () => IterableIterator<0> yield 0 >yield 0 : any ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/generatorES6_6.types b/tests/baselines/reference/generatorES6_6.types index 4e3de8cea1e9c..6f50181d0efb0 100644 --- a/tests/baselines/reference/generatorES6_6.types +++ b/tests/baselines/reference/generatorES6_6.types @@ -10,6 +10,6 @@ class C { let a = yield 1; >a : any >yield 1 : any ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/generatorTypeCheck11.types b/tests/baselines/reference/generatorTypeCheck11.types index ce47d49785174..7613cc189a974 100644 --- a/tests/baselines/reference/generatorTypeCheck11.types +++ b/tests/baselines/reference/generatorTypeCheck11.types @@ -4,5 +4,5 @@ function* g(): IterableIterator { >IterableIterator : IterableIterator return 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/generatorTypeCheck12.types b/tests/baselines/reference/generatorTypeCheck12.types index 3dd3c20f18d66..ef5b3564e1811 100644 --- a/tests/baselines/reference/generatorTypeCheck12.types +++ b/tests/baselines/reference/generatorTypeCheck12.types @@ -4,5 +4,5 @@ function* g(): IterableIterator { >IterableIterator : IterableIterator return ""; ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/generatorTypeCheck13.types b/tests/baselines/reference/generatorTypeCheck13.types index d77b630ae720f..8dfafd898843d 100644 --- a/tests/baselines/reference/generatorTypeCheck13.types +++ b/tests/baselines/reference/generatorTypeCheck13.types @@ -5,8 +5,8 @@ function* g(): IterableIterator { yield 0; >yield 0 : any ->0 : number +>0 : 0 return ""; ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/generatorTypeCheck14.types b/tests/baselines/reference/generatorTypeCheck14.types index db1b5bde19a1a..48565fe2be076 100644 --- a/tests/baselines/reference/generatorTypeCheck14.types +++ b/tests/baselines/reference/generatorTypeCheck14.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck14.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 return ""; ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/generatorTypeCheck15.types b/tests/baselines/reference/generatorTypeCheck15.types index 4437d78572d9f..eb14208009a5a 100644 --- a/tests/baselines/reference/generatorTypeCheck15.types +++ b/tests/baselines/reference/generatorTypeCheck15.types @@ -3,5 +3,5 @@ function* g() { >g : () => IterableIterator return ""; ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/generatorTypeCheck22.errors.txt b/tests/baselines/reference/generatorTypeCheck22.errors.txt deleted file mode 100644 index ab2b3de4f42c7..0000000000000 --- a/tests/baselines/reference/generatorTypeCheck22.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck22.ts(4,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck22.ts (1 errors) ==== - class Foo { x: number } - class Bar extends Foo { y: string } - class Baz { z: number } - function* g3() { - ~~ -!!! error TS2504: No best common type exists among yield expressions. - yield; - yield new Bar; - yield new Baz; - yield *[new Bar]; - yield *[new Baz]; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck22.symbols b/tests/baselines/reference/generatorTypeCheck22.symbols new file mode 100644 index 0000000000000..ae3bdac88f3a4 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck22.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck22.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck22.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck22.ts, 0, 11)) + +class Bar extends Foo { y: string } +>Bar : Symbol(Bar, Decl(generatorTypeCheck22.ts, 0, 23)) +>Foo : Symbol(Foo, Decl(generatorTypeCheck22.ts, 0, 0)) +>y : Symbol(Bar.y, Decl(generatorTypeCheck22.ts, 1, 23)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck22.ts, 1, 35)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck22.ts, 2, 11)) + +function* g3() { +>g3 : Symbol(g3, Decl(generatorTypeCheck22.ts, 2, 23)) + + yield; + yield new Bar; +>Bar : Symbol(Bar, Decl(generatorTypeCheck22.ts, 0, 23)) + + yield new Baz; +>Baz : Symbol(Baz, Decl(generatorTypeCheck22.ts, 1, 35)) + + yield *[new Bar]; +>Bar : Symbol(Bar, Decl(generatorTypeCheck22.ts, 0, 23)) + + yield *[new Baz]; +>Baz : Symbol(Baz, Decl(generatorTypeCheck22.ts, 1, 35)) +} diff --git a/tests/baselines/reference/generatorTypeCheck22.types b/tests/baselines/reference/generatorTypeCheck22.types new file mode 100644 index 0000000000000..e46e73874e619 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck22.types @@ -0,0 +1,42 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck22.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Bar extends Foo { y: string } +>Bar : Bar +>Foo : Foo +>y : string + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g3() { +>g3 : () => IterableIterator + + yield; +>yield : any + + yield new Bar; +>yield new Bar : any +>new Bar : Bar +>Bar : typeof Bar + + yield new Baz; +>yield new Baz : any +>new Baz : Baz +>Baz : typeof Baz + + yield *[new Bar]; +>yield *[new Bar] : any +>[new Bar] : Bar[] +>new Bar : Bar +>Bar : typeof Bar + + yield *[new Baz]; +>yield *[new Baz] : any +>[new Baz] : Baz[] +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/generatorTypeCheck23.errors.txt b/tests/baselines/reference/generatorTypeCheck23.errors.txt deleted file mode 100644 index 9e85117a0a884..0000000000000 --- a/tests/baselines/reference/generatorTypeCheck23.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck23.ts(4,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck23.ts (1 errors) ==== - class Foo { x: number } - class Bar extends Foo { y: string } - class Baz { z: number } - function* g3() { - ~~ -!!! error TS2504: No best common type exists among yield expressions. - yield; - yield new Foo; - yield new Bar; - yield new Baz; - yield *[new Bar]; - yield *[new Baz]; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck23.symbols b/tests/baselines/reference/generatorTypeCheck23.symbols new file mode 100644 index 0000000000000..507906f500b82 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck23.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck23.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck23.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck23.ts, 0, 11)) + +class Bar extends Foo { y: string } +>Bar : Symbol(Bar, Decl(generatorTypeCheck23.ts, 0, 23)) +>Foo : Symbol(Foo, Decl(generatorTypeCheck23.ts, 0, 0)) +>y : Symbol(Bar.y, Decl(generatorTypeCheck23.ts, 1, 23)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck23.ts, 1, 35)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck23.ts, 2, 11)) + +function* g3() { +>g3 : Symbol(g3, Decl(generatorTypeCheck23.ts, 2, 23)) + + yield; + yield new Foo; +>Foo : Symbol(Foo, Decl(generatorTypeCheck23.ts, 0, 0)) + + yield new Bar; +>Bar : Symbol(Bar, Decl(generatorTypeCheck23.ts, 0, 23)) + + yield new Baz; +>Baz : Symbol(Baz, Decl(generatorTypeCheck23.ts, 1, 35)) + + yield *[new Bar]; +>Bar : Symbol(Bar, Decl(generatorTypeCheck23.ts, 0, 23)) + + yield *[new Baz]; +>Baz : Symbol(Baz, Decl(generatorTypeCheck23.ts, 1, 35)) +} diff --git a/tests/baselines/reference/generatorTypeCheck23.types b/tests/baselines/reference/generatorTypeCheck23.types new file mode 100644 index 0000000000000..1d5d294503a60 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck23.types @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck23.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Bar extends Foo { y: string } +>Bar : Bar +>Foo : Foo +>y : string + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g3() { +>g3 : () => IterableIterator + + yield; +>yield : any + + yield new Foo; +>yield new Foo : any +>new Foo : Foo +>Foo : typeof Foo + + yield new Bar; +>yield new Bar : any +>new Bar : Bar +>Bar : typeof Bar + + yield new Baz; +>yield new Baz : any +>new Baz : Baz +>Baz : typeof Baz + + yield *[new Bar]; +>yield *[new Bar] : any +>[new Bar] : Bar[] +>new Bar : Bar +>Bar : typeof Bar + + yield *[new Baz]; +>yield *[new Baz] : any +>[new Baz] : Baz[] +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/generatorTypeCheck24.errors.txt b/tests/baselines/reference/generatorTypeCheck24.errors.txt deleted file mode 100644 index b4ca13c14c24a..0000000000000 --- a/tests/baselines/reference/generatorTypeCheck24.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck24.ts(4,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck24.ts (1 errors) ==== - class Foo { x: number } - class Bar extends Foo { y: string } - class Baz { z: number } - function* g3() { - ~~ -!!! error TS2504: No best common type exists among yield expressions. - yield; - yield * [new Foo]; - yield new Bar; - yield new Baz; - yield *[new Bar]; - yield *[new Baz]; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck24.symbols b/tests/baselines/reference/generatorTypeCheck24.symbols new file mode 100644 index 0000000000000..b0bc5307b8975 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck24.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck24.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck24.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck24.ts, 0, 11)) + +class Bar extends Foo { y: string } +>Bar : Symbol(Bar, Decl(generatorTypeCheck24.ts, 0, 23)) +>Foo : Symbol(Foo, Decl(generatorTypeCheck24.ts, 0, 0)) +>y : Symbol(Bar.y, Decl(generatorTypeCheck24.ts, 1, 23)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck24.ts, 1, 35)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck24.ts, 2, 11)) + +function* g3() { +>g3 : Symbol(g3, Decl(generatorTypeCheck24.ts, 2, 23)) + + yield; + yield * [new Foo]; +>Foo : Symbol(Foo, Decl(generatorTypeCheck24.ts, 0, 0)) + + yield new Bar; +>Bar : Symbol(Bar, Decl(generatorTypeCheck24.ts, 0, 23)) + + yield new Baz; +>Baz : Symbol(Baz, Decl(generatorTypeCheck24.ts, 1, 35)) + + yield *[new Bar]; +>Bar : Symbol(Bar, Decl(generatorTypeCheck24.ts, 0, 23)) + + yield *[new Baz]; +>Baz : Symbol(Baz, Decl(generatorTypeCheck24.ts, 1, 35)) +} diff --git a/tests/baselines/reference/generatorTypeCheck24.types b/tests/baselines/reference/generatorTypeCheck24.types new file mode 100644 index 0000000000000..e3c369bfce199 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck24.types @@ -0,0 +1,48 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck24.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Bar extends Foo { y: string } +>Bar : Bar +>Foo : Foo +>y : string + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g3() { +>g3 : () => IterableIterator + + yield; +>yield : any + + yield * [new Foo]; +>yield * [new Foo] : any +>[new Foo] : Foo[] +>new Foo : Foo +>Foo : typeof Foo + + yield new Bar; +>yield new Bar : any +>new Bar : Bar +>Bar : typeof Bar + + yield new Baz; +>yield new Baz : any +>new Baz : Baz +>Baz : typeof Baz + + yield *[new Bar]; +>yield *[new Bar] : any +>[new Bar] : Bar[] +>new Bar : Bar +>Bar : typeof Bar + + yield *[new Baz]; +>yield *[new Baz] : any +>[new Baz] : Baz[] +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/generatorTypeCheck33.types b/tests/baselines/reference/generatorTypeCheck33.types index f3b8af225d1c1..707bf7beccda2 100644 --- a/tests/baselines/reference/generatorTypeCheck33.types +++ b/tests/baselines/reference/generatorTypeCheck33.types @@ -1,16 +1,16 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck33.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 function* g2() { ->g2 : () => IterableIterator +>g2 : () => IterableIterator<""> yield ""; >yield "" : any ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/generatorTypeCheck34.types b/tests/baselines/reference/generatorTypeCheck34.types index 35063e988ebdb..2ca11177218dd 100644 --- a/tests/baselines/reference/generatorTypeCheck34.types +++ b/tests/baselines/reference/generatorTypeCheck34.types @@ -1,15 +1,15 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck34.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 function* g2() { >g2 : () => IterableIterator return ""; ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/generatorTypeCheck35.types b/tests/baselines/reference/generatorTypeCheck35.types index 0bfc22ab3f090..dcd5ab4be84bf 100644 --- a/tests/baselines/reference/generatorTypeCheck35.types +++ b/tests/baselines/reference/generatorTypeCheck35.types @@ -1,15 +1,15 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck35.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 function g2() { >g2 : () => string return ""; ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/generatorTypeCheck36.types b/tests/baselines/reference/generatorTypeCheck36.types index 110a4d3e02e0a..318a46c25fb59 100644 --- a/tests/baselines/reference/generatorTypeCheck36.types +++ b/tests/baselines/reference/generatorTypeCheck36.types @@ -5,5 +5,5 @@ function* g() { yield yield 0; >yield yield 0 : any >yield 0 : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/generatorTypeCheck37.types b/tests/baselines/reference/generatorTypeCheck37.types index e8611ec167ad4..aaa790c809474 100644 --- a/tests/baselines/reference/generatorTypeCheck37.types +++ b/tests/baselines/reference/generatorTypeCheck37.types @@ -5,5 +5,5 @@ function* g() { return yield yield 0; >yield yield 0 : any >yield 0 : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/generatorTypeCheck38.types b/tests/baselines/reference/generatorTypeCheck38.types index 08503e8640f4b..31fe452e65639 100644 --- a/tests/baselines/reference/generatorTypeCheck38.types +++ b/tests/baselines/reference/generatorTypeCheck38.types @@ -3,11 +3,11 @@ var yield; >yield : any function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 var v: typeof yield; >v : any diff --git a/tests/baselines/reference/generatorTypeCheck41.types b/tests/baselines/reference/generatorTypeCheck41.types index 0bed082dc438d..1a9ea21f9786b 100644 --- a/tests/baselines/reference/generatorTypeCheck41.types +++ b/tests/baselines/reference/generatorTypeCheck41.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck41.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> let x = { >x : { [x: number]: number; } @@ -8,7 +8,7 @@ function* g() { [yield 0]: 0 >yield 0 : any ->0 : number ->0 : number +>0 : 0 +>0 : 0 } } diff --git a/tests/baselines/reference/generatorTypeCheck42.types b/tests/baselines/reference/generatorTypeCheck42.types index 7538b8f249985..79b2516051e79 100644 --- a/tests/baselines/reference/generatorTypeCheck42.types +++ b/tests/baselines/reference/generatorTypeCheck42.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck42.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> let x = { >x : { [x: number]: () => void; } @@ -8,7 +8,7 @@ function* g() { [yield 0]() { >yield 0 : any ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/generatorTypeCheck43.types b/tests/baselines/reference/generatorTypeCheck43.types index a132dfcb01574..754d3fee814c8 100644 --- a/tests/baselines/reference/generatorTypeCheck43.types +++ b/tests/baselines/reference/generatorTypeCheck43.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck43.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> let x = { >x : { [x: number]: () => IterableIterator; } @@ -8,7 +8,7 @@ function* g() { *[yield 0]() { >yield 0 : any ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/generatorTypeCheck44.types b/tests/baselines/reference/generatorTypeCheck44.types index 5c432e41cbee2..e06b8961ca07a 100644 --- a/tests/baselines/reference/generatorTypeCheck44.types +++ b/tests/baselines/reference/generatorTypeCheck44.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck44.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> let x = { >x : { [x: number]: number; } @@ -8,10 +8,10 @@ function* g() { get [yield 0]() { >yield 0 : any ->0 : number +>0 : 0 return 0; ->0 : number +>0 : 0 } } } diff --git a/tests/baselines/reference/generatorTypeCheck45.types b/tests/baselines/reference/generatorTypeCheck45.types index 7ea442420d697..96895acde0fad 100644 --- a/tests/baselines/reference/generatorTypeCheck45.types +++ b/tests/baselines/reference/generatorTypeCheck45.types @@ -19,7 +19,7 @@ declare function foo(x: T, fun: () => Iterator<(x: T) => U>, fun2: (y: U) foo("", function* () { yield x => x.length }, p => undefined); // T is fixed, should be string >foo("", function* () { yield x => x.length }, p => undefined) : string >foo : (x: T, fun: () => Iterator<(x: T) => U>, fun2: (y: U) => T) => T ->"" : string +>"" : "" >function* () { yield x => x.length } : () => IterableIterator<(x: string) => number> >yield x => x.length : any >x => x.length : (x: string) => number diff --git a/tests/baselines/reference/generatorTypeCheck46.types b/tests/baselines/reference/generatorTypeCheck46.types index daf0d67b6ecb6..c69ae0881dae6 100644 --- a/tests/baselines/reference/generatorTypeCheck46.types +++ b/tests/baselines/reference/generatorTypeCheck46.types @@ -19,7 +19,7 @@ declare function foo(x: T, fun: () => Iterable<(x: T) => U>, fun2: (y: U) foo("", function* () { >foo("", function* () { yield* { *[Symbol.iterator]() { yield x => x.length } }}, p => undefined) : string >foo : (x: T, fun: () => Iterable<(x: T) => U>, fun2: (y: U) => T) => T ->"" : string +>"" : "" >function* () { yield* { *[Symbol.iterator]() { yield x => x.length } }} : () => IterableIterator<(x: string) => number> yield* { diff --git a/tests/baselines/reference/generatorTypeCheck49.types b/tests/baselines/reference/generatorTypeCheck49.types index f56cca33438fb..cd9f3e82d0987 100644 --- a/tests/baselines/reference/generatorTypeCheck49.types +++ b/tests/baselines/reference/generatorTypeCheck49.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck49.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/generatorTypeCheck52.errors.txt b/tests/baselines/reference/generatorTypeCheck52.errors.txt deleted file mode 100644 index 8dc280bb8c94a..0000000000000 --- a/tests/baselines/reference/generatorTypeCheck52.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck52.ts(3,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck52.ts (1 errors) ==== - class Foo { x: number } - class Baz { z: number } - function* g() { - ~ -!!! error TS2504: No best common type exists among yield expressions. - yield new Foo; - yield new Baz; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck52.symbols b/tests/baselines/reference/generatorTypeCheck52.symbols new file mode 100644 index 0000000000000..64c29f984383c --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck52.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck52.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck52.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck52.ts, 0, 11)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck52.ts, 0, 23)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck52.ts, 1, 11)) + +function* g() { +>g : Symbol(g, Decl(generatorTypeCheck52.ts, 1, 23)) + + yield new Foo; +>Foo : Symbol(Foo, Decl(generatorTypeCheck52.ts, 0, 0)) + + yield new Baz; +>Baz : Symbol(Baz, Decl(generatorTypeCheck52.ts, 0, 23)) +} diff --git a/tests/baselines/reference/generatorTypeCheck52.types b/tests/baselines/reference/generatorTypeCheck52.types new file mode 100644 index 0000000000000..97ac442aa0e30 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck52.types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck52.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g() { +>g : () => IterableIterator + + yield new Foo; +>yield new Foo : any +>new Foo : Foo +>Foo : typeof Foo + + yield new Baz; +>yield new Baz : any +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/generatorTypeCheck53.errors.txt b/tests/baselines/reference/generatorTypeCheck53.errors.txt deleted file mode 100644 index ee3512f34c584..0000000000000 --- a/tests/baselines/reference/generatorTypeCheck53.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck53.ts(3,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck53.ts (1 errors) ==== - class Foo { x: number } - class Baz { z: number } - function* g() { - ~ -!!! error TS2504: No best common type exists among yield expressions. - yield new Foo; - yield* [new Baz]; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck53.symbols b/tests/baselines/reference/generatorTypeCheck53.symbols new file mode 100644 index 0000000000000..ce573dbf422ec --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck53.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck53.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck53.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck53.ts, 0, 11)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck53.ts, 0, 23)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck53.ts, 1, 11)) + +function* g() { +>g : Symbol(g, Decl(generatorTypeCheck53.ts, 1, 23)) + + yield new Foo; +>Foo : Symbol(Foo, Decl(generatorTypeCheck53.ts, 0, 0)) + + yield* [new Baz]; +>Baz : Symbol(Baz, Decl(generatorTypeCheck53.ts, 0, 23)) +} diff --git a/tests/baselines/reference/generatorTypeCheck53.types b/tests/baselines/reference/generatorTypeCheck53.types new file mode 100644 index 0000000000000..b91974e98073e --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck53.types @@ -0,0 +1,23 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck53.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g() { +>g : () => IterableIterator + + yield new Foo; +>yield new Foo : any +>new Foo : Foo +>Foo : typeof Foo + + yield* [new Baz]; +>yield* [new Baz] : any +>[new Baz] : Baz[] +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/generatorTypeCheck54.errors.txt b/tests/baselines/reference/generatorTypeCheck54.errors.txt deleted file mode 100644 index de22dbfc6e812..0000000000000 --- a/tests/baselines/reference/generatorTypeCheck54.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck54.ts(3,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck54.ts (1 errors) ==== - class Foo { x: number } - class Baz { z: number } - function* g() { - ~ -!!! error TS2504: No best common type exists among yield expressions. - yield* [new Foo]; - yield* [new Baz]; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck54.symbols b/tests/baselines/reference/generatorTypeCheck54.symbols new file mode 100644 index 0000000000000..f6230b634f1d7 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck54.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck54.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck54.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck54.ts, 0, 11)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck54.ts, 0, 23)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck54.ts, 1, 11)) + +function* g() { +>g : Symbol(g, Decl(generatorTypeCheck54.ts, 1, 23)) + + yield* [new Foo]; +>Foo : Symbol(Foo, Decl(generatorTypeCheck54.ts, 0, 0)) + + yield* [new Baz]; +>Baz : Symbol(Baz, Decl(generatorTypeCheck54.ts, 0, 23)) +} diff --git a/tests/baselines/reference/generatorTypeCheck54.types b/tests/baselines/reference/generatorTypeCheck54.types new file mode 100644 index 0000000000000..1cdbde67498f0 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck54.types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck54.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g() { +>g : () => IterableIterator + + yield* [new Foo]; +>yield* [new Foo] : any +>[new Foo] : Foo[] +>new Foo : Foo +>Foo : typeof Foo + + yield* [new Baz]; +>yield* [new Baz] : any +>[new Baz] : Baz[] +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/genericAndNonGenericOverload1.types b/tests/baselines/reference/genericAndNonGenericOverload1.types index 28eeb2d4da03a..f7d0d4b35f8ce 100644 --- a/tests/baselines/reference/genericAndNonGenericOverload1.types +++ b/tests/baselines/reference/genericAndNonGenericOverload1.types @@ -21,5 +21,5 @@ var c2: callable2; c2(1); >c2(1) : string >c2 : callable2 ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types index f7dd10b11dd50..086c6e23a8e5a 100644 --- a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types @@ -49,11 +49,11 @@ _.all([true, 1, null, 'yes'], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean ->[true, 1, null, 'yes'] : (string | number | true)[] +>[true, 1, null, 'yes'] : (true | 1 | "yes")[] >true : true ->1 : number +>1 : 1 >null : null ->'yes' : string +>'yes' : "yes" >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericArray1.types b/tests/baselines/reference/genericArray1.types index bf44c88f518c6..baa2ec8a9cfbf 100644 --- a/tests/baselines/reference/genericArray1.types +++ b/tests/baselines/reference/genericArray1.types @@ -16,9 +16,9 @@ var lengths = ["a", "b", "c"].map(x => x.length); >["a", "b", "c"].map(x => x.length) : number[] >["a", "b", "c"].map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >["a", "b", "c"] : string[] ->"a" : string ->"b" : string ->"c" : string +>"a" : "a" +>"b" : "b" +>"c" : "c" >map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.types b/tests/baselines/reference/genericBaseClassLiteralProperty2.types index 3e3208249256e..017404269350b 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.types +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.types @@ -38,7 +38,7 @@ class DataView2 extends BaseCollection2 { >this._itemsByKey : { [key: string]: CollectionItem2; } >this : this >_itemsByKey : { [key: string]: CollectionItem2; } ->'dummy' : string +>'dummy' : "dummy" >item : CollectionItem2 } } diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.types b/tests/baselines/reference/genericCallTypeArgumentInference.types index 09cd907a5a9c0..33c38b0dd48e7 100644 --- a/tests/baselines/reference/genericCallTypeArgumentInference.types +++ b/tests/baselines/reference/genericCallTypeArgumentInference.types @@ -13,9 +13,9 @@ function foo(t: T) { var r = foo(''); // string >r : string ->foo('') : string +>foo('') : "" >foo : (t: T) => T ->'' : string +>'' : "" function foo2(t: T, u: U) { >foo2 : (t: T, u: U) => U @@ -47,16 +47,16 @@ function foo2b(u: U) { var r2 = foo2('', 1); // number >r2 : number ->foo2('', 1) : number +>foo2('', 1) : 1 >foo2 : (t: T, u: U) => U ->'' : string ->1 : number +>'' : "" +>1 : 1 var r3 = foo2b(1); // {} >r3 : {} >foo2b(1) : {} >foo2b : (u: U) => T ->1 : number +>1 : 1 class C { >C : C @@ -175,8 +175,8 @@ var c = new C('', 1); >c : C >new C('', 1) : C >C : typeof C ->'' : string ->1 : number +>'' : "" +>1 : 1 var r4 = c.foo('', 1); // string >r4 : string @@ -184,8 +184,8 @@ var r4 = c.foo('', 1); // string >c.foo : (t: string, u: number) => string >c : C >foo : (t: string, u: number) => string ->'' : string ->1 : number +>'' : "" +>1 : 1 var r5 = c.foo2('', 1); // number >r5 : number @@ -193,17 +193,17 @@ var r5 = c.foo2('', 1); // number >c.foo2 : (t: string, u: number) => number >c : C >foo2 : (t: string, u: number) => number ->'' : string ->1 : number +>'' : "" +>1 : 1 var r6 = c.foo3(true, 1); // boolean >r6 : boolean ->c.foo3(true, 1) : boolean +>c.foo3(true, 1) : true >c.foo3 : (t: T, u: number) => T >c : C >foo3 : (t: T, u: number) => T >true : true ->1 : number +>1 : 1 var r7 = c.foo4('', true); // string >r7 : string @@ -211,17 +211,17 @@ var r7 = c.foo4('', true); // string >c.foo4 : (t: string, u: U) => string >c : C >foo4 : (t: string, u: U) => string ->'' : string +>'' : "" >true : true var r8 = c.foo5(true, 1); // boolean >r8 : boolean ->c.foo5(true, 1) : boolean +>c.foo5(true, 1) : true >c.foo5 : (t: T, u: U) => T >c : C >foo5 : (t: T, u: U) => T >true : true ->1 : number +>1 : 1 var r9 = c.foo6(); // {} >r9 : {} @@ -236,7 +236,7 @@ var r10 = c.foo7(''); // {} >c.foo7 : (u: U) => T >c : C >foo7 : (u: U) => T ->'' : string +>'' : "" var r11 = c.foo8(); // {} >r11 : {} @@ -331,8 +331,8 @@ var r4 = i.foo('', 1); // string >i.foo : (t: string, u: number) => string >i : I >foo : (t: string, u: number) => string ->'' : string ->1 : number +>'' : "" +>1 : 1 var r5 = i.foo2('', 1); // number >r5 : number @@ -340,17 +340,17 @@ var r5 = i.foo2('', 1); // number >i.foo2 : (t: string, u: number) => number >i : I >foo2 : (t: string, u: number) => number ->'' : string ->1 : number +>'' : "" +>1 : 1 var r6 = i.foo3(true, 1); // boolean >r6 : boolean ->i.foo3(true, 1) : boolean +>i.foo3(true, 1) : true >i.foo3 : (t: T, u: number) => T >i : I >foo3 : (t: T, u: number) => T >true : true ->1 : number +>1 : 1 var r7 = i.foo4('', true); // string >r7 : string @@ -358,17 +358,17 @@ var r7 = i.foo4('', true); // string >i.foo4 : (t: string, u: U) => string >i : I >foo4 : (t: string, u: U) => string ->'' : string +>'' : "" >true : true var r8 = i.foo5(true, 1); // boolean >r8 : boolean ->i.foo5(true, 1) : boolean +>i.foo5(true, 1) : true >i.foo5 : (t: T, u: U) => T >i : I >foo5 : (t: T, u: U) => T >true : true ->1 : number +>1 : 1 var r9 = i.foo6(); // {} >r9 : {} @@ -383,7 +383,7 @@ var r10 = i.foo7(''); // {} >i.foo7 : (u: U) => T >i : I >foo7 : (u: U) => T ->'' : string +>'' : "" var r11 = i.foo8(); // {} >r11 : {} diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types index 48a7150ef4426..2727f0c1eced7 100644 --- a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types @@ -14,24 +14,24 @@ var r = foo([1, 2]); // number[] >foo([1, 2]) : number[] >foo : (t: T) => T >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var r = foo([1, 2]); // number[] >r : number[] >foo([1, 2]) : number[] >foo : (t: T) => T >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var ra = foo([1, 2]); // any[] >ra : any[] >foo([1, 2]) : any[] >foo : (t: T) => T >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var r2 = foo([]); // any[] >r2 : any[] @@ -50,16 +50,16 @@ var r4 = foo([1, '']); // {}[] >foo([1, '']) : (string | number)[] >foo : (t: T) => T >[1, ''] : (string | number)[] ->1 : number ->'' : string +>1 : 1 +>'' : "" var r5 = foo([1, '']); // any[] >r5 : any[] >foo([1, '']) : any[] >foo : (t: T) => T >[1, ''] : (string | number)[] ->1 : number ->'' : string +>1 : 1 +>'' : "" var r6 = foo([1, '']); // Object[] >r6 : Object[] @@ -67,6 +67,6 @@ var r6 = foo([1, '']); // Object[] >foo : (t: T) => T >Object : Object >[1, ''] : (string | number)[] ->1 : number ->'' : string +>1 : 1 +>'' : "" diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt index 805bde82b640c..6982031c9bab2 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts(11,26): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Date'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts(11,26): error TS2345: Argument of type '1' is not assignable to parameter of type 'Date'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts (1 errors) ==== @@ -14,5 +14,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithCon var r3 = foo(new Object()); // {} var r4 = foo(1); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Date'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'Date'. var r5 = foo(new Date()); // no error \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFixedArguments.types b/tests/baselines/reference/genericCallWithFixedArguments.types index f22dbc0125213..e10bbb9dd3522 100644 --- a/tests/baselines/reference/genericCallWithFixedArguments.types +++ b/tests/baselines/reference/genericCallWithFixedArguments.types @@ -18,6 +18,6 @@ g(7) // the parameter list is fixed, so this should not error >g : (x: any) => void >A : A >B : B ->7 : number +>7 : 7 diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt index 093c4bed545f8..80b04c069d511 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt @@ -1,13 +1,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(26,10): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(30,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(33,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(34,16): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(35,15): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts (5 errors) ==== @@ -39,26 +39,26 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r8 = foo3(1, function (a) { return '' }, 1); // error ~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. var r9 = foo3(1, (a) => '', ''); // string function other(t: T, u: U) { var r10 = foo2(1, (x: T) => ''); // error ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r10 = foo2(1, (x) => ''); // string var r11 = foo3(1, (x: T) => '', ''); // error ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r11b = foo3(1, (x: T) => '', 1); // error ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r12 = foo3(1, function (a) { return '' }, 1); // error ~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt index 3a397a66ebacf..90f87de070d7f 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(29,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(40,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts (2 errors) ==== @@ -36,7 +36,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r4 = foo2(1, i2); // error ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. var r4b = foo2(1, a); // any var r5 = foo2(1, i); // any var r6 = foo2('', i2); // string @@ -50,5 +50,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r8 = foo3(1, i2, 1); // error ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. var r9 = foo3('', i2, ''); // string \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt index e3da7eaeaec26..714fe32d31a97 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt @@ -1,14 +1,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(10,29): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(15,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(16,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(16,22): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(25,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. Types of parameters 'a' and 'x' are incompatible. Type 'Date' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(37,36): error TS2345: Argument of type '(x: E) => F' is not assignable to parameter of type '(x: E) => E'. Type 'F' is not assignable to type 'E'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(50,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(51,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(51,22): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(60,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. Types of parameters 'a' and 'x' are incompatible. Type 'Date' is not assignable to type 'T'. @@ -39,7 +39,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen !!! error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. var r10 = r7(1); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. } function foo2(a: (x: T) => T, b: (x: T) => T) { @@ -85,7 +85,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen !!! error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. var r10 = r7(1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. } function foo2(a: (x: T) => T, b: (x: U) => U) { diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types index e165932303395..26e19e68577d8 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types @@ -58,11 +58,11 @@ function other(arg: T) { >d : T >r2[1] : T >r2 : { [x: string]: Object; [x: number]: T; } ->1 : number +>1 : 1 var e = r2['1']; >e : Object >r2['1'] : Object >r2 : { [x: string]: Object; [x: number]: T; } ->'1' : string +>'1' : "1" } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types index bde72409edcd6..4141caac61798 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types @@ -67,18 +67,18 @@ function other3(arg: T) { >d : T >r2[1] : T >r2 : { [x: string]: Object; [x: number]: T; } ->1 : number +>1 : 1 var e = r2['1']; >e : Object >r2['1'] : Object >r2 : { [x: string]: Object; [x: number]: T; } ->'1' : string +>'1' : "1" var u: U = r2[1]; // ok >u : U >U : U >r2[1] : T >r2 : { [x: string]: Object; [x: number]: T; } ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt index 9795248e2f7f0..b65b21e127b43 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2322: Type 'number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2322: Type '1' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,37): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,56): error TS2322: Type 'U' is not assignable to type 'V'. Type 'T' is not assignable to type 'V'. @@ -11,7 +11,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericC function foo2(x: T = undefined) { return x; } // ok function foo3(x: T = 1) { } // error ~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type '1' is not assignable to type 'T'. function foo4(x: T, y: U = x) { } // error ~~~~~~~~ !!! error TS2322: Type 'T' is not assignable to type 'U'. diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types index 71e943c1ad351..e7676596c0714 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types @@ -62,7 +62,7 @@ function other2(arg: T) { >d : T >r2[1] : T >r2 : { [x: number]: T; } ->1 : number +>1 : 1 } function other3(arg: T) { @@ -89,7 +89,7 @@ function other3(arg: T) { >d : T >r2[1] : T >r2 : { [x: number]: T; } ->1 : number +>1 : 1 // BUG 821629 //var u: U = r2[1]; // ok diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types index 196103f422b86..a0b6e89c70a6c 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types @@ -63,7 +63,7 @@ function other2(arg: T) { >Date : Date >r2['hm'] : T >r2 : { [x: string]: T; } ->'hm' : string +>'hm' : "hm" } function other3(arg: T) { @@ -91,7 +91,7 @@ function other3(arg: T) { >Date : Date >r2['hm'] : T >r2 : { [x: string]: T; } ->'hm' : string +>'hm' : "hm" // BUG 821629 //var u: U = r2['hm']; // ok diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types index dbdecbec3e4cd..ab07e9c880a61 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types @@ -119,7 +119,7 @@ module GenericParameter { >T : T >x : T >T : T ->'' : string +>'' : "" var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) >r11 : { (x: any): string; (x: any, y?: any): string; } @@ -131,7 +131,7 @@ module GenericParameter { >T : T >y : T >T : T ->'' : string +>'' : "" function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } @@ -154,7 +154,7 @@ module GenericParameter { >r12 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, (x) => x) : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } ->1 : number +>1 : 1 >(x) => x : (x: any) => any >x : any >x : any @@ -163,12 +163,12 @@ module GenericParameter { >r13 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, (x: T) => '') : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } ->1 : number +>1 : 1 >(x: T) => '' : (x: T) => string >T : T >x : T >T : T ->'' : string +>'' : "" var a: { (x: T): string; (x: number): T; } >a : { (x: T): string; (x: number): T; } @@ -183,6 +183,6 @@ module GenericParameter { >r14 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, a) : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } ->1 : number +>1 : 1 >a : { (x: T): string; (x: number): T; } } diff --git a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt index af5d92f4e3c91..aec6b9c34b7ed 100644 --- a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt +++ b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(2,14): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(3,16): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(3,16): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(4,14): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(8,15): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(9,15): error TS2346: Supplied parameters do not match any signature of call target. @@ -15,7 +15,7 @@ tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,15 !!! error TS2346: Supplied parameters do not match any signature of call target. var r2 = f(1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/genericClassExpressionInFunction.types b/tests/baselines/reference/genericClassExpressionInFunction.types index 943391fdd59b8..e5e85fb8bf07c 100644 --- a/tests/baselines/reference/genericClassExpressionInFunction.types +++ b/tests/baselines/reference/genericClassExpressionInFunction.types @@ -86,23 +86,23 @@ var s = new S(); >S : typeof S c.genericVar = 12; ->c.genericVar = 12 : number +>c.genericVar = 12 : 12 >c.genericVar : number >c : C >genericVar : number ->12 : number +>12 : 12 k.genericVar = 12; ->k.genericVar = 12 : number +>k.genericVar = 12 : 12 >k.genericVar : number >k : K >genericVar : number ->12 : number +>12 : 12 s.genericVar = 12; ->s.genericVar = 12 : number +>s.genericVar = 12 : 12 >s.genericVar : number >s : S >genericVar : number ->12 : number +>12 : 12 diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types index 88ef74283aebd..3db47b0e47999 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types @@ -179,7 +179,7 @@ module Portal.Controls.Validators { >_validate : (value: TValue) => number >value : TValue >TValue : TValue ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt index 149a20e92a51d..bcfa8d8fbf951 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(57,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(60,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(61,20): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(62,19): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts (4 errors) ==== @@ -68,20 +68,20 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFu var r10 = c.foo2(1, (x: T) => ''); // error ~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r10 = c.foo2(1, (x) => ''); // string var r11 = c3.foo3(1, (x: T) => '', ''); // error ~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r11b = c3.foo3(1, (x: T) => '', 1); // error ~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r12 = c3.foo3(1, function (a) { return '' }, 1); // error ~~~~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/genericClassWithStaticFactory.types b/tests/baselines/reference/genericClassWithStaticFactory.types index c1af646e7fb11..1c09fcd493e19 100644 --- a/tests/baselines/reference/genericClassWithStaticFactory.types +++ b/tests/baselines/reference/genericClassWithStaticFactory.types @@ -109,9 +109,9 @@ module Editor { >next : List for (i = 0; !(entry.isHead); i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >!(entry.isHead) : boolean >(entry.isHead) : boolean >entry.isHead : boolean diff --git a/tests/baselines/reference/genericCloduleInModule.types b/tests/baselines/reference/genericCloduleInModule.types index 3ae3a8cf06d72..97ef24ff49bc9 100644 --- a/tests/baselines/reference/genericCloduleInModule.types +++ b/tests/baselines/reference/genericCloduleInModule.types @@ -17,7 +17,7 @@ module A { export var x = 1; >x : number ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/genericConstructSignatureInInterface.types b/tests/baselines/reference/genericConstructSignatureInInterface.types index c6653a0d90db2..d1d7646e945a8 100644 --- a/tests/baselines/reference/genericConstructSignatureInInterface.types +++ b/tests/baselines/reference/genericConstructSignatureInInterface.types @@ -16,5 +16,5 @@ var r = new v(1); >r : any >new v(1) : any >v : C ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.types b/tests/baselines/reference/genericContextualTypingSpecialization.types index 561370a6a320f..8225502034731 100644 --- a/tests/baselines/reference/genericContextualTypingSpecialization.types +++ b/tests/baselines/reference/genericContextualTypingSpecialization.types @@ -13,5 +13,5 @@ b.reduce((c, d) => c + d, 0); // should not error on '+' >c + d : number >c : number >d : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/genericFunctions0.types b/tests/baselines/reference/genericFunctions0.types index aac759af092c7..58256739dd4a5 100644 --- a/tests/baselines/reference/genericFunctions0.types +++ b/tests/baselines/reference/genericFunctions0.types @@ -10,5 +10,5 @@ var x = foo(5); // 'x' should be number >x : number >foo(5) : number >foo : (x: T) => T ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/genericFunctions1.types b/tests/baselines/reference/genericFunctions1.types index 602ee6b81a418..cd649a2177d49 100644 --- a/tests/baselines/reference/genericFunctions1.types +++ b/tests/baselines/reference/genericFunctions1.types @@ -8,7 +8,7 @@ function foo (x: T) { return x; } var x = foo(5); // 'x' should be number >x : number ->foo(5) : number +>foo(5) : 5 >foo : (x: T) => T ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types index 627181e5d050c..133c5cc206359 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types @@ -65,7 +65,7 @@ var r3 = utils.mapReduce(c, (x) => { return 1 }, (y) => { return new Date() }); >c : Collection >(x) => { return 1 } : (x: string) => number >x : string ->1 : number +>1 : 1 >(y) => { return new Date() } : (y: number) => Date >y : number >new Date() : Date @@ -80,7 +80,7 @@ var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return >c : Collection >(x: string) => { return 1 } : (x: string) => number >x : string ->1 : number +>1 : 1 >(y: number) => { return new Date() } : (y: number) => Date >y : number >new Date() : Date @@ -90,7 +90,7 @@ var f1 = (x: string) => { return 1 }; >f1 : (x: string) => number >(x: string) => { return 1 } : (x: string) => number >x : string ->1 : number +>1 : 1 var f2 = (y: number) => { return new Date() }; >f2 : (y: number) => Date diff --git a/tests/baselines/reference/genericInference1.types b/tests/baselines/reference/genericInference1.types index eeed8aa9f3ef1..30b7279ebc0e4 100644 --- a/tests/baselines/reference/genericInference1.types +++ b/tests/baselines/reference/genericInference1.types @@ -3,9 +3,9 @@ >['a', 'b', 'c'].map(x => x.length) : number[] >['a', 'b', 'c'].map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >['a', 'b', 'c'] : string[] ->'a' : string ->'b' : string ->'c' : string +>'a' : "a" +>'b' : "b" +>'c' : "c" >map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/genericInference2.types b/tests/baselines/reference/genericInference2.types index e5c7052b0db4c..54006dba41920 100644 --- a/tests/baselines/reference/genericInference2.types +++ b/tests/baselines/reference/genericInference2.types @@ -41,7 +41,7 @@ >ko.observable : (value: T) => ko.Observable >ko : typeof ko >observable : (value: T) => ko.Observable ->"Bob" : string +>"Bob" : "Bob" age: ko.observable(37) >age : ko.Observable @@ -49,7 +49,7 @@ >ko.observable : (value: T) => ko.Observable >ko : typeof ko >observable : (value: T) => ko.Observable ->37 : number +>37 : 37 }; var x_v = o.name().length; // should be 'number' @@ -74,7 +74,7 @@ >o.name : ko.Observable >o : { name: ko.Observable; age: ko.Observable; } >name : ko.Observable ->"Robert" : string +>"Robert" : "Robert" var zz_v = o.name.N; // should be 'number' >zz_v : number diff --git a/tests/baselines/reference/genericMethodOverspecialization.types b/tests/baselines/reference/genericMethodOverspecialization.types index 375eefaa86cb3..268943a97231e 100644 --- a/tests/baselines/reference/genericMethodOverspecialization.types +++ b/tests/baselines/reference/genericMethodOverspecialization.types @@ -2,11 +2,11 @@ var names = ["list", "table1", "table2", "table3", "summary"]; >names : string[] >["list", "table1", "table2", "table3", "summary"] : string[] ->"list" : string ->"table1" : string ->"table2" : string ->"table3" : string ->"summary" : string +>"list" : "list" +>"table1" : "table1" +>"table2" : "table2" +>"table3" : "table3" +>"summary" : "summary" interface HTMLElement { >HTMLElement : HTMLElement diff --git a/tests/baselines/reference/genericNewInterface.errors.txt b/tests/baselines/reference/genericNewInterface.errors.txt index f489b72c1b691..7754d5749fda4 100644 --- a/tests/baselines/reference/genericNewInterface.errors.txt +++ b/tests/baselines/reference/genericNewInterface.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/genericNewInterface.ts(2,21): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/genericNewInterface.ts(10,21): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/genericNewInterface.ts(2,21): error TS2345: Argument of type '42' is not assignable to parameter of type 'string'. +tests/cases/compiler/genericNewInterface.ts(10,21): error TS2345: Argument of type '1024' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/genericNewInterface.ts (2 errors) ==== function createInstance(ctor: new (s: string) => T): T { return new ctor(42); //should be an error ~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '42' is not assignable to parameter of type 'string'. } interface INewable { @@ -16,5 +16,5 @@ tests/cases/compiler/genericNewInterface.ts(10,21): error TS2345: Argument of ty function createInstance2(ctor: INewable): T { return new ctor(1024); //should be an error ~~~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1024' is not assignable to parameter of type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericObjectLitReturnType.types b/tests/baselines/reference/genericObjectLitReturnType.types index 6bdc352cbc7fd..0b54e9f8e350a 100644 --- a/tests/baselines/reference/genericObjectLitReturnType.types +++ b/tests/baselines/reference/genericObjectLitReturnType.types @@ -23,13 +23,13 @@ var t1 = x.f(5); >x.f : (t: number) => { a: number; } >x : X >f : (t: number) => { a: number; } ->5 : number +>5 : 5 t1.a = 5; // Should not error: t1 should have type {a: number}, instead has type {a: T} ->t1.a = 5 : number +>t1.a = 5 : 5 >t1.a : number >t1 : { a: number; } >a : number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.types b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.types index 2f62a20c41521..834f071659efe 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.types +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.types @@ -15,10 +15,10 @@ module TypeScript2 { >PullSymbolVisibility : PullSymbolVisibility Private, ->Private : PullSymbolVisibility +>Private : PullSymbolVisibility.Private Public ->Public : PullSymbolVisibility +>Public : PullSymbolVisibility.Public }   export class PullSymbol { diff --git a/tests/baselines/reference/genericRestArgs.errors.txt b/tests/baselines/reference/genericRestArgs.errors.txt index 8a97745295864..2297277fe8d16 100644 --- a/tests/baselines/reference/genericRestArgs.errors.txt +++ b/tests/baselines/reference/genericRestArgs.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/genericRestArgs.ts(2,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. -tests/cases/compiler/genericRestArgs.ts(5,34): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. +tests/cases/compiler/genericRestArgs.ts(5,34): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/compiler/genericRestArgs.ts(10,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. -tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. +tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type '1' is not assignable to parameter of type 'any[]'. ==== tests/cases/compiler/genericRestArgs.ts (4 errors) ==== @@ -11,12 +11,12 @@ tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type ' var a1Ga = makeArrayG(1, ""); // no error ~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. var a1Gb = makeArrayG(1, ""); var a1Gc = makeArrayG(1, ""); var a1Gd = makeArrayG(1, ""); // error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. function makeArrayGOpt(item1?: T, item2?: T, item3?: T) { return [item1, item2, item3]; @@ -24,8 +24,8 @@ tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type ' var a2Ga = makeArrayGOpt(1, ""); ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. var a2Gb = makeArrayG(1, ""); var a2Gc = makeArrayG(1, ""); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. \ No newline at end of file +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/genericReversingTypeParameters.types b/tests/baselines/reference/genericReversingTypeParameters.types index 524a2ebba0350..daab3c0248fe4 100644 --- a/tests/baselines/reference/genericReversingTypeParameters.types +++ b/tests/baselines/reference/genericReversingTypeParameters.types @@ -36,7 +36,7 @@ var r1 = b.get(''); >b.get : (key: string) => number >b : BiMap >get : (key: string) => number ->'' : string +>'' : "" var i = b.inverse(); // used to get the type wrong here. >i : BiMap @@ -51,5 +51,5 @@ var r2b = i.get(1); >i.get : (key: number) => string >i : BiMap >get : (key: number) => string ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/genericReversingTypeParameters2.types b/tests/baselines/reference/genericReversingTypeParameters2.types index 28c1f40ce9f12..d64c135cf20cc 100644 --- a/tests/baselines/reference/genericReversingTypeParameters2.types +++ b/tests/baselines/reference/genericReversingTypeParameters2.types @@ -43,5 +43,5 @@ var r2b = i.get(1); >i.get : (key: number) => string >i : BiMap >get : (key: number) => string ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/genericStaticAnyTypeFunction.types b/tests/baselines/reference/genericStaticAnyTypeFunction.types index 38b3c3708e774..3a6a182b08ae5 100644 --- a/tests/baselines/reference/genericStaticAnyTypeFunction.types +++ b/tests/baselines/reference/genericStaticAnyTypeFunction.types @@ -16,7 +16,7 @@ class A { } static goo() { return 0; } >goo : () => number ->0 : number +>0 : 0 static two(source: T): T { >two : (source: T) => T @@ -32,7 +32,7 @@ class A { >one : (source: T, value: number) => T >T : T >source : T ->42 : number +>42 : 42 } diff --git a/tests/baselines/reference/genericTypeAliases.types b/tests/baselines/reference/genericTypeAliases.types index 929ecf7d7e134..1cabaa8caa04c 100644 --- a/tests/baselines/reference/genericTypeAliases.types +++ b/tests/baselines/reference/genericTypeAliases.types @@ -21,7 +21,7 @@ var tree: Tree = { left: 0, >left : number ->0 : number +>0 : 0 right: { >right : { left: number; right: number; } @@ -29,17 +29,17 @@ var tree: Tree = { left: 1, >left : number ->1 : number +>1 : 1 right: 2 >right : number ->2 : number +>2 : 2 }, }, right: 3 >right : number ->3 : number +>3 : 3 }; @@ -54,15 +54,15 @@ var ls: Lazy; >Lazy : Lazy ls = "eager"; ->ls = "eager" : string +>ls = "eager" : "eager" >ls : Lazy ->"eager" : string +>"eager" : "eager" ls = () => "lazy"; >ls = () => "lazy" : () => string >ls : Lazy >() => "lazy" : () => string ->"lazy" : string +>"lazy" : "lazy" type Foo = T | { x: Foo }; >Foo : Foo @@ -100,16 +100,16 @@ y = x; >x : Foo x = "string"; ->x = "string" : string +>x = "string" : "string" >x : Foo ->"string" : string +>"string" : "string" x = { x: "hello" }; >x = { x: "hello" } : { x: string; } >x : Foo >{ x: "hello" } : { x: string; } >x : string ->"hello" : string +>"hello" : "hello" x = { x: { x: "world" } }; >x = { x: { x: "world" } } : { x: { x: string; }; } @@ -118,23 +118,23 @@ x = { x: { x: "world" } }; >x : { x: string; } >{ x: "world" } : { x: string; } >x : string ->"world" : string +>"world" : "world" var z: Foo; >z : Foo >Foo : Foo z = 42; ->z = 42 : number +>z = 42 : 42 >z : Foo ->42 : number +>42 : 42 z = { x: 42 }; >z = { x: 42 } : { x: number; } >z : Foo >{ x: 42 } : { x: number; } >x : number ->42 : number +>42 : 42 z = { x: { x: 42 } }; >z = { x: { x: 42 } } : { x: { x: number; }; } @@ -143,7 +143,7 @@ z = { x: { x: 42 } }; >x : { x: number; } >{ x: 42 } : { x: number; } >x : number ->42 : number +>42 : 42 type Strange = string; // Type parameter not used >Strange : string @@ -154,9 +154,9 @@ var s: Strange; >Strange : string s = "hello"; ->s = "hello" : string +>s = "hello" : "hello" >s : string ->"hello" : string +>"hello" : "hello" interface Tuple { >Tuple : Tuple @@ -194,25 +194,25 @@ var p: TaggedPair; >TaggedPair : TaggedPair p.a = 1; ->p.a = 1 : number +>p.a = 1 : 1 >p.a : number >p : TaggedPair >a : number ->1 : number +>1 : 1 p.b = 2; ->p.b = 2 : number +>p.b = 2 : 2 >p.b : number >p : TaggedPair >b : number ->2 : number +>2 : 2 p.tag = "test"; ->p.tag = "test" : string +>p.tag = "test" : "test" >p.tag : string >p : TaggedPair >tag : string ->"test" : string +>"test" : "test" function f() { >f : () => Foo diff --git a/tests/baselines/reference/genericTypeArgumentInference1.types b/tests/baselines/reference/genericTypeArgumentInference1.types index e2a570de28fec..2dc6e51ff0f66 100644 --- a/tests/baselines/reference/genericTypeArgumentInference1.types +++ b/tests/baselines/reference/genericTypeArgumentInference1.types @@ -47,11 +47,11 @@ var r = _.all([true, 1, null, 'yes'], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T ->[true, 1, null, 'yes'] : (string | number | true)[] +>[true, 1, null, 'yes'] : (true | 1 | "yes")[] >true : true ->1 : number +>1 : 1 >null : null ->'yes' : string +>'yes' : "yes" >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -87,7 +87,7 @@ var r4 = _.all([true], _.identity); >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >[true] : any[] >true : any ->true : boolean +>true : true >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericTypeParameterEquivalence2.types b/tests/baselines/reference/genericTypeParameterEquivalence2.types index 44e495088bce3..6ab297fe32cfd 100644 --- a/tests/baselines/reference/genericTypeParameterEquivalence2.types +++ b/tests/baselines/reference/genericTypeParameterEquivalence2.types @@ -49,7 +49,7 @@ function forEach(list: A[], f: (a: A, n?: number) => void ): void { for (var i = 0; i < list.length; ++i) { >i : number ->0 : number +>0 : 0 >i < list.length : boolean >i : number >list.length : number diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types index a316773e5c87f..c7c11a427433e 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types @@ -31,5 +31,5 @@ var value: string = lazyArray.array()["test"]; // used to be an error >lazyArray.array : () => { [objectId: string]: string; } >lazyArray : LazyArray >array : () => { [objectId: string]: string; } ->"test" : string +>"test" : "test" diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt index 98db4282244fd..ba9ec881f9973 100644 --- a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericWithOpenTypeParameters1.ts(7,40): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +tests/cases/compiler/genericWithOpenTypeParameters1.ts(7,40): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. tests/cases/compiler/genericWithOpenTypeParameters1.ts(8,35): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,35): error TS2346: Supplied parameters do not match any signature of call target. @@ -12,7 +12,7 @@ tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,35): error TS2346: Supp x.foo(1); // no error var f = (x: B) => { return x.foo(1); } // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var f2 = (x: B) => { return x.foo(1); } // error ~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt b/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt index 5b076b078c5c3..845a4011d9f9c 100644 --- a/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt +++ b/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts(8,16): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts(8,16): error TS2322: Type '"string"' is not assignable to type 'number'. ==== tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts (1 errors) ==== @@ -11,7 +11,7 @@ tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyp get X() { return "string"; // Error; get contextual type by set accessor parameter type annotation ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"string"' is not assignable to type 'number'. } set Y(y) { } diff --git a/tests/baselines/reference/getterSetterNonAccessor.types b/tests/baselines/reference/getterSetterNonAccessor.types index 0534ca623e79b..f5eb22296f3e5 100644 --- a/tests/baselines/reference/getterSetterNonAccessor.types +++ b/tests/baselines/reference/getterSetterNonAccessor.types @@ -1,7 +1,7 @@ === tests/cases/compiler/getterSetterNonAccessor.ts === function getFunc():any{return 0;} >getFunc : () => any ->0 : number +>0 : 0 function setFunc(v){} >setFunc : (v: any) => void @@ -13,7 +13,7 @@ Object.defineProperty({}, "0", ({ >Object : ObjectConstructor >defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >{} : {} ->"0" : string +>"0" : "0" >({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor >({ get: getFunc, set: setFunc, configurable: true }) : { get: () => any; set: (v: any) => void; configurable: true; } @@ -28,7 +28,7 @@ Object.defineProperty({}, "0", ({ >setFunc : (v: any) => void configurable: true ->configurable : true +>configurable : boolean >true : true })); diff --git a/tests/baselines/reference/global.types b/tests/baselines/reference/global.types index f866f062068a3..c56e039f2307a 100644 --- a/tests/baselines/reference/global.types +++ b/tests/baselines/reference/global.types @@ -15,13 +15,13 @@ module M { var x=10; >x : number ->10 : number +>10 : 10 M.f(3); >M.f(3) : number >M.f : (y: number) => number >M : typeof M >f : (y: number) => number ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/globalIsContextualKeyword.types b/tests/baselines/reference/globalIsContextualKeyword.types index d0bf624af6d4c..371c05c218338 100644 --- a/tests/baselines/reference/globalIsContextualKeyword.types +++ b/tests/baselines/reference/globalIsContextualKeyword.types @@ -4,7 +4,7 @@ function a() { let global = 1; >global : number ->1 : number +>1 : 1 } function b() { >b : () => void @@ -28,5 +28,5 @@ let obj = { global: "123" >global : string ->"123" : string +>"123" : "123" } diff --git a/tests/baselines/reference/globalThisCapture.types b/tests/baselines/reference/globalThisCapture.types index b8ed146d8c464..063100ff78eaf 100644 --- a/tests/baselines/reference/globalThisCapture.types +++ b/tests/baselines/reference/globalThisCapture.types @@ -15,5 +15,5 @@ var parts = []; parts[0]; >parts[0] : any >parts : any[] ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/grammarAmbiguities1.errors.txt b/tests/baselines/reference/grammarAmbiguities1.errors.txt index 12df5f3c1e081..8809c4aa3348f 100644 --- a/tests/baselines/reference/grammarAmbiguities1.errors.txt +++ b/tests/baselines/reference/grammarAmbiguities1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/grammarAmbiguities1.ts(8,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/grammarAmbiguities1.ts(8,3): error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. -tests/cases/compiler/grammarAmbiguities1.ts(8,10): error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. +tests/cases/compiler/grammarAmbiguities1.ts(8,10): error TS2365: Operator '>' cannot be applied to types 'typeof B' and '7'. tests/cases/compiler/grammarAmbiguities1.ts(9,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/grammarAmbiguities1.ts(9,3): error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. tests/cases/compiler/grammarAmbiguities1.ts(9,10): error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. @@ -20,7 +20,7 @@ tests/cases/compiler/grammarAmbiguities1.ts(9,10): error TS2365: Operator '>' ca ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. ~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'typeof B' and '7'. f(g < A, B > +(7)); ~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.types b/tests/baselines/reference/heterogeneousArrayLiterals.types index 026e9c26baeb3..f1c5b6b8dfc27 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.types +++ b/tests/baselines/reference/heterogeneousArrayLiterals.types @@ -4,27 +4,27 @@ var a = [1, '']; // {}[] >a : (string | number)[] >[1, ''] : (string | number)[] ->1 : number ->'' : string +>1 : 1 +>'' : "" var b = [1, null]; // number[] >b : number[] >[1, null] : number[] ->1 : number +>1 : 1 >null : null var c = [1, '', null]; // {}[] >c : (string | number)[] >[1, '', null] : (string | number)[] ->1 : number ->'' : string +>1 : 1 +>'' : "" >null : null var d = [{}, 1]; // {}[] >d : {}[] >[{}, 1] : {}[] >{} : {} ->1 : number +>1 : 1 var e = [{}, Object]; // {}[] >e : {}[] @@ -37,61 +37,61 @@ var f = [[], [1]]; // number[][] >[[], [1]] : number[][] >[] : undefined[] >[1] : number[] ->1 : number +>1 : 1 var g = [[1], ['']]; // {}[] >g : (number[] | string[])[] >[[1], ['']] : (number[] | string[])[] >[1] : number[] ->1 : number +>1 : 1 >[''] : string[] ->'' : string +>'' : "" var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] >h : ({ foo: number; bar: string; } | { foo: number; })[] >[{ foo: 1, bar: '' }, { foo: 2 }] : ({ foo: number; bar: string; } | { foo: number; })[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number ->1 : number +>1 : 1 >bar : string ->'' : string +>'' : "" >{ foo: 2 } : { foo: number; } >foo : number ->2 : number +>2 : 2 var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] >i : ({ foo: number; bar: string; } | { foo: string; })[] >[{ foo: 1, bar: '' }, { foo: '' }] : ({ foo: number; bar: string; } | { foo: string; })[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number ->1 : number +>1 : 1 >bar : string ->'' : string +>'' : "" >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" var j = [() => 1, () => '']; // {}[] >j : ((() => number) | (() => string))[] >[() => 1, () => ''] : ((() => number) | (() => string))[] >() => 1 : () => number ->1 : number +>1 : 1 >() => '' : () => string ->'' : string +>'' : "" var k = [() => 1, () => 1]; // { (): number }[] >k : (() => number)[] >[() => 1, () => 1] : (() => number)[] >() => 1 : () => number ->1 : number +>1 : 1 >() => 1 : () => number ->1 : number +>1 : 1 var l = [() => 1, () => null]; // { (): any }[] >l : (() => any)[] >[() => 1, () => null] : (() => any)[] >() => 1 : () => number ->1 : number +>1 : 1 >() => null : () => any >null : null @@ -99,9 +99,9 @@ var m = [() => 1, () => '', () => null]; // { (): any }[] >m : (() => any)[] >[() => 1, () => '', () => null] : (() => any)[] >() => 1 : () => number ->1 : number +>1 : 1 >() => '' : () => string ->'' : string +>'' : "" >() => null : () => any >null : null @@ -110,10 +110,10 @@ var n = [[() => 1], [() => '']]; // {}[] >[[() => 1], [() => '']] : ((() => number)[] | (() => string)[])[] >[() => 1] : (() => number)[] >() => 1 : () => number ->1 : number +>1 : 1 >[() => ''] : (() => string)[] >() => '' : () => string ->'' : string +>'' : "" class Base { foo: string; } >Base : Base @@ -182,7 +182,7 @@ module Derived { >() => base : () => Base >base : Base >() => 1 : () => number ->1 : number +>1 : 1 var l = [() => base, () => null]; // { (): any }[] >l : (() => any)[] @@ -299,7 +299,7 @@ function foo(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T ->1 : number +>1 : 1 var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -353,7 +353,7 @@ function foo2(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T ->1 : number +>1 : 1 var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -431,7 +431,7 @@ function foo3(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T ->1 : number +>1 : 1 var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -509,7 +509,7 @@ function foo4(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T ->1 : number +>1 : 1 var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] diff --git a/tests/baselines/reference/hidingCallSignatures.types b/tests/baselines/reference/hidingCallSignatures.types index c45cab69d8a66..87285361f9996 100644 --- a/tests/baselines/reference/hidingCallSignatures.types +++ b/tests/baselines/reference/hidingCallSignatures.types @@ -36,12 +36,12 @@ var d: D; d(""); // number >d("") : number >d : D ->"" : string +>"" : "" new d(""); // should be string >new d("") : string >d : D ->"" : string +>"" : "" var f: F; >f : F @@ -50,7 +50,7 @@ var f: F; f(""); // string >f("") : string >f : F ->"" : string +>"" : "" var e: E; >e : E @@ -59,5 +59,5 @@ var e: E; e(""); // {} >e("") : {} >e : E ->"" : string +>"" : "" diff --git a/tests/baselines/reference/hidingConstructSignatures.types b/tests/baselines/reference/hidingConstructSignatures.types index 0fd9860de25dc..7432732277fe6 100644 --- a/tests/baselines/reference/hidingConstructSignatures.types +++ b/tests/baselines/reference/hidingConstructSignatures.types @@ -36,12 +36,12 @@ var d: D; d(""); // string >d("") : string >d : D ->"" : string +>"" : "" new d(""); // should be number >new d("") : number >d : D ->"" : string +>"" : "" var f: F; >f : F @@ -50,7 +50,7 @@ var f: F; new f(""); // string >new f("") : string >f : F ->"" : string +>"" : "" var e: E; >e : E @@ -59,5 +59,5 @@ var e: E; new e(""); // {} >new e("") : {} >e : E ->"" : string +>"" : "" diff --git a/tests/baselines/reference/hidingIndexSignatures.types b/tests/baselines/reference/hidingIndexSignatures.types index 9a6346ace7bbe..a6609aa75c89a 100644 --- a/tests/baselines/reference/hidingIndexSignatures.types +++ b/tests/baselines/reference/hidingIndexSignatures.types @@ -21,7 +21,7 @@ var b: B; b[""]; // Should be number >b[""] : number >b : B ->"" : string +>"" : "" var a: A; >a : A @@ -30,5 +30,5 @@ var a: A; a[""]; // Should be {} >a[""] : {} >a : A ->"" : string +>"" : "" diff --git a/tests/baselines/reference/ifDoWhileStatements.types b/tests/baselines/reference/ifDoWhileStatements.types index 660eaa4fb634b..eee459391c508 100644 --- a/tests/baselines/reference/ifDoWhileStatements.types +++ b/tests/baselines/reference/ifDoWhileStatements.types @@ -49,14 +49,14 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string ->42 : number +>42 : 42 function F2(x: number): boolean { return x < 42; } >F2 : (x: number) => boolean >x : number >x < 42 : boolean >x : number ->42 : number +>42 : 42 module M { >M : typeof M @@ -98,13 +98,13 @@ module N { // literals if (true) { } ->true : boolean +>true : true while (true) { } ->true : boolean +>true : true do { }while(true) ->true : boolean +>true : true if (null) { } >null : null @@ -125,31 +125,31 @@ do { }while(undefined) >undefined : undefined if (0.0) { } ->0.0 : number +>0.0 : 0 while (0.0) { } ->0.0 : number +>0.0 : 0 do { }while(0.0) ->0.0 : number +>0.0 : 0 if ('a string') { } ->'a string' : string +>'a string' : "a string" while ('a string') { } ->'a string' : string +>'a string' : "a string" do { }while('a string') ->'a string' : string +>'a string' : "a string" if ('') { } ->'' : string +>'' : "" while ('') { } ->'' : string +>'' : "" do { }while('') ->'' : string +>'' : "" if (/[a-z]/) { } >/[a-z]/ : RegExp @@ -171,18 +171,18 @@ do { }while([]) if ([1, 2]) { } >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 while ([1, 2]) { } >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 do { }while([1, 2]) >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 if ({}) { } >{} : {} @@ -196,35 +196,35 @@ do { }while({}) if ({ x: 1, y: 'a' }) { } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'a' : string +>'a' : "a" while ({ x: 1, y: 'a' }) { } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'a' : string +>'a' : "a" do { }while({ x: 1, y: 'a' }) >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'a' : string +>'a' : "a" if (() => 43) { } >() => 43 : () => number ->43 : number +>43 : 43 while (() => 43) { } >() => 43 : () => number ->43 : number +>43 : 43 do { }while(() => 43) >() => 43 : () => number ->43 : number +>43 : 43 if (new C()) { } >new C() : C @@ -256,7 +256,7 @@ do { }while(new D()) // references var a = true; >a : boolean ->true : boolean +>true : true if (a) { } >a : boolean @@ -295,7 +295,7 @@ do { }while(c) var d = 0.0; >d : number ->0.0 : number +>0.0 : 0 if (d) { } >d : number @@ -308,7 +308,7 @@ do { }while(d) var e = 'a string'; >e : string ->'a string' : string +>'a string' : "a string" if (e) { } >e : string @@ -321,7 +321,7 @@ do { }while(e) var f = ''; >f : string ->'' : string +>'' : "" if (f) { } >f : string @@ -361,8 +361,8 @@ do { }while(h) var i = [1, 2]; >i : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 if (i) { } >i : number[] @@ -390,9 +390,9 @@ var k = { x: 1, y: 'a' }; >k : { x: number; y: string; } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'a' : string +>'a' : "a" if (k) { } >k : { x: number; y: string; } diff --git a/tests/baselines/reference/implicitAnyAnyReturningFunction.types b/tests/baselines/reference/implicitAnyAnyReturningFunction.types index 66f9cf49cb03e..73b90b76a0b11 100644 --- a/tests/baselines/reference/implicitAnyAnyReturningFunction.types +++ b/tests/baselines/reference/implicitAnyAnyReturningFunction.types @@ -4,7 +4,7 @@ function A() { return ""; >"" : any ->"" : string +>"" : "" } function B() { @@ -26,7 +26,7 @@ class C { return ""; >"" : any ->"" : string +>"" : "" } public B() { diff --git a/tests/baselines/reference/implicitAnyGenerics.types b/tests/baselines/reference/implicitAnyGenerics.types index e335c958fe984..2d43ecbbdbec1 100644 --- a/tests/baselines/reference/implicitAnyGenerics.types +++ b/tests/baselines/reference/implicitAnyGenerics.types @@ -49,20 +49,20 @@ var d2 = new D(1); >d2 : D >new D(1) : D >D : typeof D ->1 : number +>1 : 1 var d3 = new D(1); >d3 : D >new D(1) : D >D : typeof D ->1 : number +>1 : 1 var d4 = new D(1); >d4 : D >new D(1) : D >D : typeof D >1 : any ->1 : number +>1 : 1 var d5: D = new D(null); >d5 : D diff --git a/tests/baselines/reference/implicitAnyInCatch.types b/tests/baselines/reference/implicitAnyInCatch.types index 6dda46fd3ca84..d2a1be4a910bf 100644 --- a/tests/baselines/reference/implicitAnyInCatch.types +++ b/tests/baselines/reference/implicitAnyInCatch.types @@ -9,7 +9,7 @@ try { } catch (error) { >error : any >number : any >-2147024809 : -2147024809 ->2147024809 : number +>2147024809 : 2147024809 } for (var key in this) { } >key : string diff --git a/tests/baselines/reference/implicitIndexSignatures.types b/tests/baselines/reference/implicitIndexSignatures.types index 6d670c6341b55..ac8da0c7b6c2a 100644 --- a/tests/baselines/reference/implicitIndexSignatures.types +++ b/tests/baselines/reference/implicitIndexSignatures.types @@ -14,9 +14,9 @@ const names1 = { a: "foo", b: "bar" }; >names1 : { a: string; b: string; } >{ a: "foo", b: "bar" } : { a: string; b: string; } >a : string ->"foo" : string +>"foo" : "foo" >b : string ->"bar" : string +>"bar" : "bar" let names2: { a: string, b: string }; >names2 : { a: string; b: string; } @@ -32,9 +32,9 @@ map = { x: "xxx", y: "yyy" }; >map : { [x: string]: string; } >{ x: "xxx", y: "yyy" } : { x: string; y: string; } >x : string ->"xxx" : string +>"xxx" : "xxx" >y : string ->"yyy" : string +>"yyy" : "yyy" map = empty1; >map = empty1 : {} @@ -79,9 +79,9 @@ function f1() { >o1 : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 let o2: { a: number, b: number }; >o2 : { a: number; b: number; } @@ -108,9 +108,9 @@ function f2() { >o1 : { a: string; b: string; } >{ a: "1", b: "2" } : { a: string; b: string; } >a : string ->"1" : string +>"1" : "1" >b : string ->"2" : string +>"2" : "2" let o2: { a: string, b: string }; >o2 : { a: string; b: string; } @@ -137,9 +137,9 @@ function f3() { >o1 : { a: number; b: string; } >{ a: 1, b: "2" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"2" : string +>"2" : "2" let o2: { a: number, b: string }; >o2 : { a: number; b: string; } @@ -165,10 +165,10 @@ function f4() { const o1 = { 0: "0", 1: "1", count: 2 }; >o1 : { 0: string; 1: string; count: number; } >{ 0: "0", 1: "1", count: 2 } : { 0: string; 1: string; count: number; } ->"0" : string ->"1" : string +>"0" : "0" +>"1" : "1" >count : number ->2 : number +>2 : 2 let o2: { 0: string, 1: string, count: number }; >o2 : { 0: string; 1: string; count: number; } diff --git a/tests/baselines/reference/importAliasIdentifiers.types b/tests/baselines/reference/importAliasIdentifiers.types index 6746a5b3af7cb..4c9701ded100f 100644 --- a/tests/baselines/reference/importAliasIdentifiers.types +++ b/tests/baselines/reference/importAliasIdentifiers.types @@ -52,9 +52,9 @@ module clodule { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } import clolias = clodule; @@ -83,9 +83,9 @@ function fundule() { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } module fundule { @@ -103,9 +103,9 @@ module fundule { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } import funlias = fundule; diff --git a/tests/baselines/reference/importAliasWithDottedName.types b/tests/baselines/reference/importAliasWithDottedName.types index 24ec5d1b0bb3b..b5882fce1174d 100644 --- a/tests/baselines/reference/importAliasWithDottedName.types +++ b/tests/baselines/reference/importAliasWithDottedName.types @@ -4,14 +4,14 @@ module M { export var x = 1; >x : number ->1 : number +>1 : 1 export module N { >N : typeof N export var y = 2; >y : number ->2 : number +>2 : 2 } } diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict2.types b/tests/baselines/reference/importAndVariableDeclarationConflict2.types index eafc7be6deb50..4b6e9acec06f9 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict2.types +++ b/tests/baselines/reference/importAndVariableDeclarationConflict2.types @@ -4,7 +4,7 @@ module m { export var m = ''; >m : string ->'' : string +>'' : "" } import x = m.m; @@ -20,6 +20,6 @@ class C { var x = ''; >x : string ->'' : string +>'' : "" } } diff --git a/tests/baselines/reference/importImportOnlyModule.types b/tests/baselines/reference/importImportOnlyModule.types index c1275bed51144..d02cdb3353fb9 100644 --- a/tests/baselines/reference/importImportOnlyModule.types +++ b/tests/baselines/reference/importImportOnlyModule.types @@ -12,11 +12,11 @@ export class C1 { m1 = 42; >m1 : number ->42 : number +>42 : 42 static s1 = true; >s1 : boolean ->true : boolean +>true : true } === tests/cases/conformance/externalModules/foo_1.ts === @@ -25,5 +25,5 @@ import c1 = require('./foo_0'); // Makes this an external module var answer = 42; // No exports >answer : number ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/importInTypePosition.types b/tests/baselines/reference/importInTypePosition.types index 7360416e4b3a1..22802728fd042 100644 --- a/tests/baselines/reference/importInTypePosition.types +++ b/tests/baselines/reference/importInTypePosition.types @@ -13,8 +13,8 @@ module A { >Origin : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 } // no code gen expected @@ -46,8 +46,8 @@ module C { >p : a.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/importStatements.types b/tests/baselines/reference/importStatements.types index ecf4453b3605e..53509ceb70c2c 100644 --- a/tests/baselines/reference/importStatements.types +++ b/tests/baselines/reference/importStatements.types @@ -14,8 +14,8 @@ module A { >Origin : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 } // no code gen expected @@ -48,9 +48,9 @@ module C { >p : a.Point >{x:0, y:0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } // code gen expected @@ -67,8 +67,8 @@ module D { >a.Point : typeof a.Point >a : typeof a >Point : typeof a.Point ->1 : number ->1 : number +>1 : 1 +>1 : 1 } module E { diff --git a/tests/baselines/reference/import_reference-exported-alias.types b/tests/baselines/reference/import_reference-exported-alias.types index 3f9c34f62dcf8..2f2496a7b772b 100644 --- a/tests/baselines/reference/import_reference-exported-alias.types +++ b/tests/baselines/reference/import_reference-exported-alias.types @@ -34,7 +34,7 @@ module App { >getUserName : () => string return "Bill Gates"; ->"Bill Gates" : string +>"Bill Gates" : "Bill Gates" } } } diff --git a/tests/baselines/reference/import_reference-to-type-alias.types b/tests/baselines/reference/import_reference-to-type-alias.types index 53c7dabcd5f32..e2327650f1abb 100644 --- a/tests/baselines/reference/import_reference-to-type-alias.types +++ b/tests/baselines/reference/import_reference-to-type-alias.types @@ -32,7 +32,7 @@ export module App { >getUserName : () => string return "Bill Gates"; ->"Bill Gates" : string +>"Bill Gates" : "Bill Gates" } } } diff --git a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types index 2fda99dc064ee..0449bfd16bf68 100644 --- a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types +++ b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types @@ -12,7 +12,7 @@ var p = testData[0].name; >testData[0].name : string >testData[0] : ITest >testData : ITest[] ->0 : number +>0 : 0 >name : string === tests/cases/compiler/b.ts === diff --git a/tests/baselines/reference/inOperatorWithFunction.types b/tests/baselines/reference/inOperatorWithFunction.types index e85a86632c7c4..21e9da3f0409f 100644 --- a/tests/baselines/reference/inOperatorWithFunction.types +++ b/tests/baselines/reference/inOperatorWithFunction.types @@ -9,7 +9,7 @@ fn("a" in { "a": true }); >fn("a" in { "a": true }) : boolean >fn : (val: boolean) => boolean >"a" in { "a": true } : boolean ->"a" : string +>"a" : "a" >{ "a": true } : { "a": boolean; } ->true : boolean +>true : true diff --git a/tests/baselines/reference/inOperatorWithValidOperands.types b/tests/baselines/reference/inOperatorWithValidOperands.types index 0cca583e683c1..7e121e54146b0 100644 --- a/tests/baselines/reference/inOperatorWithValidOperands.types +++ b/tests/baselines/reference/inOperatorWithValidOperands.types @@ -31,13 +31,13 @@ var ra3 = a2 in x; var ra4 = '' in x; >ra4 : boolean >'' in x : boolean ->'' : string +>'' : "" >x : any var ra5 = 0 in x; >ra5 : boolean >0 in x : boolean ->0 : number +>0 : 0 >x : any // valid right operands diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index cb6de6576b259..4cd68470007eb 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -22,7 +22,7 @@ tests/cases/compiler/incompatibleTypes.ts(49,7): error TS2345: Argument of type Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. -tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type 'number' is not assignable to type '() => string'. +tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type '5' is not assignable to type '() => string'. tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. @@ -131,7 +131,7 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var i1c1: { (): string; } = 5; ~~~~ -!!! error TS2322: Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Type '5' is not assignable to type '() => string'. var fp1: () =>any = a => 0; ~~~ diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types index 3643b646acead..715de620bffaf 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types @@ -10,14 +10,14 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] ->"" : string ->"" : string +>"" : "" +>"" : "" var obj = {x:1,y:null}; >obj : { x: number; y: any; } >{x:1,y:null} : { x: number; y: null; } >x : number ->1 : number +>1 : 1 >y : null >null : null @@ -65,7 +65,7 @@ var ResultIsNumber5 = ++ANY2[0]; >++ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 var ResultIsNumber6 = ++obj.x; >ResultIsNumber6 : number @@ -100,7 +100,7 @@ var ResultIsNumber9 = ANY2[0]++; >ANY2[0]++ : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 var ResultIsNumber10 = obj.x++; >ResultIsNumber10 : number @@ -143,7 +143,7 @@ var ResultIsNumber13 = M.n++; >++ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 ++ANY, ++ANY1; >++ANY, ++ANY1 : number @@ -176,7 +176,7 @@ ANY2[0]++; >ANY2[0]++ : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 ANY++, ANY1++; >ANY++, ANY1++ : number diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.types b/tests/baselines/reference/incrementOperatorWithNumberType.types index 21211a3848c0a..03030289a77c7 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberType.types +++ b/tests/baselines/reference/incrementOperatorWithNumberType.types @@ -6,8 +6,8 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 class A { >A : A @@ -72,7 +72,7 @@ var ResultIsNumber7 = NUMBER1[0]++; >NUMBER1[0]++ : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 // miss assignment operators ++NUMBER; @@ -83,7 +83,7 @@ var ResultIsNumber7 = NUMBER1[0]++; >++NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 ++objA.a; >++objA.a : number @@ -115,7 +115,7 @@ NUMBER1[0]++; >NUMBER1[0]++ : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 objA.a++; >objA.a++ : number diff --git a/tests/baselines/reference/indexClassByNumber.types b/tests/baselines/reference/indexClassByNumber.types index b1fb79f256a3d..dfd27305ba9f3 100644 --- a/tests/baselines/reference/indexClassByNumber.types +++ b/tests/baselines/reference/indexClassByNumber.types @@ -10,9 +10,9 @@ var f = new foo(); >foo : typeof foo f[0] = 4; // Shouldn't be allowed ->f[0] = 4 : number +>f[0] = 4 : 4 >f[0] : any >f : foo ->0 : number ->4 : number +>0 : 0 +>4 : 4 diff --git a/tests/baselines/reference/indexIntoArraySubclass.errors.txt b/tests/baselines/reference/indexIntoArraySubclass.errors.txt index 1628e12d22fa7..bbcf259fb33c4 100644 --- a/tests/baselines/reference/indexIntoArraySubclass.errors.txt +++ b/tests/baselines/reference/indexIntoArraySubclass.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2322: Type '0' is not assignable to type 'string'. ==== tests/cases/compiler/indexIntoArraySubclass.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2322: Type 'number' var r = x2[0]; // string r = 0; //error ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type '0' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/indexIntoEnum.types b/tests/baselines/reference/indexIntoEnum.types index 3c0d91cd24019..9a22174d9bcc3 100644 --- a/tests/baselines/reference/indexIntoEnum.types +++ b/tests/baselines/reference/indexIntoEnum.types @@ -9,5 +9,5 @@ module M { >x : string >E[0] : string >E : typeof E ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.types b/tests/baselines/reference/indexSignaturesInferentialTyping.types index 47c7aa213881d..202e14898184d 100644 --- a/tests/baselines/reference/indexSignaturesInferentialTyping.types +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.types @@ -22,16 +22,16 @@ var x1 = foo({ 0: 0, 1: 1 }); // type should be number >foo({ 0: 0, 1: 1 }) : number >foo : (items: { [index: number]: T; }) => T >{ 0: 0, 1: 1 } : { 0: number; 1: number; } ->0 : number ->1 : number +>0 : 0 +>1 : 1 var x2 = bar({ 0: 0, 1: 1 }); >x2 : number >bar({ 0: 0, 1: 1 }) : number >bar : (items: { [index: string]: T; }) => T >{ 0: 0, 1: 1 } : { 0: number; 1: number; } ->0 : number ->1 : number +>0 : 0 +>1 : 1 var x3 = bar({ zero: 0, one: 1 }); // type should be number >x3 : number @@ -39,7 +39,7 @@ var x3 = bar({ zero: 0, one: 1 }); // type should be number >bar : (items: { [index: string]: T; }) => T >{ zero: 0, one: 1 } : { zero: number; one: number; } >zero : number ->0 : number +>0 : 0 >one : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/indexer.types b/tests/baselines/reference/indexer.types index f24c90f6ea142..6f648d8d2321b 100644 --- a/tests/baselines/reference/indexer.types +++ b/tests/baselines/reference/indexer.types @@ -20,15 +20,15 @@ var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >{ 0: { id : "a" }, 1: { id : "b" } } : { 0: { id: string; }; 1: { id: string; }; } >{ id : "a" } : { id: string; } >id : string ->"a" : string +>"a" : "a" >{ id : "b" } : { id: string; } >id : string ->"b" : string +>"b" : "b" jq[0].id; >jq[0].id : string >jq[0] : JQueryElement >jq : JQuery ->0 : number +>0 : 0 >id : string diff --git a/tests/baselines/reference/indexer3.types b/tests/baselines/reference/indexer3.types index 28bcd9cab0c93..58bf9b51f2ef9 100644 --- a/tests/baselines/reference/indexer3.types +++ b/tests/baselines/reference/indexer3.types @@ -10,5 +10,5 @@ var r: Date = dateMap["hello"] // result type includes indexer using BCT >Date : Date >dateMap["hello"] : Date >dateMap : { [x: string]: Date; } ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/indexerA.types b/tests/baselines/reference/indexerA.types index ee6351eae33ac..e0eadbc06b4d1 100644 --- a/tests/baselines/reference/indexerA.types +++ b/tests/baselines/reference/indexerA.types @@ -20,15 +20,15 @@ var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >{ 0: { id : "a" }, 1: { id : "b" } } : { 0: { id: string; }; 1: { id: string; }; } >{ id : "a" } : { id: string; } >id : string ->"a" : string +>"a" : "a" >{ id : "b" } : { id: string; } >id : string ->"b" : string +>"b" : "b" jq[0].id; >jq[0].id : string >jq[0] : JQueryElement >jq : JQuery ->0 : number +>0 : 0 >id : string diff --git a/tests/baselines/reference/indexerWithTuple.types b/tests/baselines/reference/indexerWithTuple.types index 54ee714f5ef41..8a14fa9816e44 100644 --- a/tests/baselines/reference/indexerWithTuple.types +++ b/tests/baselines/reference/indexerWithTuple.types @@ -2,55 +2,55 @@ var strNumTuple: [string, number] = ["foo", 10]; >strNumTuple : [string, number] >["foo", 10] : [string, number] ->"foo" : string ->10 : number +>"foo" : "foo" +>10 : 10 var numTupleTuple: [number, [string, number]] = [10, ["bar", 20]]; >numTupleTuple : [number, [string, number]] >[10, ["bar", 20]] : [number, [string, number]] ->10 : number +>10 : 10 >["bar", 20] : [string, number] ->"bar" : string ->20 : number +>"bar" : "bar" +>20 : 20 var unionTuple1: [number, string| number] = [10, "foo"]; >unionTuple1 : [number, string | number] >[10, "foo"] : [number, string] ->10 : number ->"foo" : string +>10 : 10 +>"foo" : "foo" var unionTuple2: [boolean, string| number] = [true, "foo"]; >unionTuple2 : [boolean, string | number] >[true, "foo"] : [true, string] >true : true ->"foo" : string +>"foo" : "foo" // no error var idx0 = 0; >idx0 : number ->0 : number +>0 : 0 var idx1 = 1; >idx1 : number ->1 : number +>1 : 1 var ele10 = strNumTuple[0]; // string >ele10 : string >strNumTuple[0] : string >strNumTuple : [string, number] ->0 : number +>0 : 0 var ele11 = strNumTuple[1]; // number >ele11 : number >strNumTuple[1] : number >strNumTuple : [string, number] ->1 : number +>1 : 1 var ele12 = strNumTuple[2]; // string | number >ele12 : string | number >strNumTuple[2] : string | number >strNumTuple : [string, number] ->2 : number +>2 : 2 var ele13 = strNumTuple[idx0]; // string | number >ele13 : string | number @@ -68,43 +68,43 @@ var ele15 = strNumTuple["0"]; // string >ele15 : string >strNumTuple["0"] : string >strNumTuple : [string, number] ->"0" : string +>"0" : "0" var ele16 = strNumTuple["1"]; // number >ele16 : number >strNumTuple["1"] : number >strNumTuple : [string, number] ->"1" : string +>"1" : "1" var strNumTuple1 = numTupleTuple[1]; //[string, number]; >strNumTuple1 : [string, number] >numTupleTuple[1] : [string, number] >numTupleTuple : [number, [string, number]] ->1 : number +>1 : 1 var ele17 = numTupleTuple[2]; // number | [string, number] >ele17 : number | [string, number] >numTupleTuple[2] : number | [string, number] >numTupleTuple : [number, [string, number]] ->2 : number +>2 : 2 var eleUnion10 = unionTuple1[0]; // number >eleUnion10 : number >unionTuple1[0] : number >unionTuple1 : [number, string | number] ->0 : number +>0 : 0 var eleUnion11 = unionTuple1[1]; // string | number >eleUnion11 : string | number >unionTuple1[1] : string | number >unionTuple1 : [number, string | number] ->1 : number +>1 : 1 var eleUnion12 = unionTuple1[2]; // string | number >eleUnion12 : string | number >unionTuple1[2] : string | number >unionTuple1 : [number, string | number] ->2 : number +>2 : 2 var eleUnion13 = unionTuple1[idx0]; // string | number >eleUnion13 : string | number @@ -122,31 +122,31 @@ var eleUnion15 = unionTuple1["0"]; // number >eleUnion15 : number >unionTuple1["0"] : number >unionTuple1 : [number, string | number] ->"0" : string +>"0" : "0" var eleUnion16 = unionTuple1["1"]; // string | number >eleUnion16 : string | number >unionTuple1["1"] : string | number >unionTuple1 : [number, string | number] ->"1" : string +>"1" : "1" var eleUnion20 = unionTuple2[0]; // boolean >eleUnion20 : boolean >unionTuple2[0] : boolean >unionTuple2 : [boolean, string | number] ->0 : number +>0 : 0 var eleUnion21 = unionTuple2[1]; // string | number >eleUnion21 : string | number >unionTuple2[1] : string | number >unionTuple2 : [boolean, string | number] ->1 : number +>1 : 1 var eleUnion22 = unionTuple2[2]; // string | number | boolean >eleUnion22 : string | number | boolean >unionTuple2[2] : string | number | boolean >unionTuple2 : [boolean, string | number] ->2 : number +>2 : 2 var eleUnion23 = unionTuple2[idx0]; // string | number | boolean >eleUnion23 : string | number | boolean @@ -164,11 +164,11 @@ var eleUnion25 = unionTuple2["0"]; // boolean >eleUnion25 : boolean >unionTuple2["0"] : boolean >unionTuple2 : [boolean, string | number] ->"0" : string +>"0" : "0" var eleUnion26 = unionTuple2["1"]; // string | number >eleUnion26 : string | number >unionTuple2["1"] : string | number >unionTuple2 : [boolean, string | number] ->"1" : string +>"1" : "1" diff --git a/tests/baselines/reference/indexersInClassType.types b/tests/baselines/reference/indexersInClassType.types index 496526776d92a..02316d810b97a 100644 --- a/tests/baselines/reference/indexersInClassType.types +++ b/tests/baselines/reference/indexersInClassType.types @@ -39,7 +39,7 @@ var r2 = r[1]; >r2 : Date >r[1] : Date >r : C ->1 : number +>1 : 1 var r3 = r.a >r3 : {} diff --git a/tests/baselines/reference/inferParameterWithMethodCallInitializer.types b/tests/baselines/reference/inferParameterWithMethodCallInitializer.types index 9aeccb2b2e0e9..41c01808ae04c 100644 --- a/tests/baselines/reference/inferParameterWithMethodCallInitializer.types +++ b/tests/baselines/reference/inferParameterWithMethodCallInitializer.types @@ -3,7 +3,7 @@ function getNumber(): number { >getNumber : () => number return 1; ->1 : number +>1 : 1 } class Example { >Example : Example @@ -12,7 +12,7 @@ class Example { >getNumber : () => number return 1; ->1 : number +>1 : 1 } doSomething(a = this.getNumber()): typeof a { >doSomething : (a?: number) => number diff --git a/tests/baselines/reference/inferSecondaryParameter.types b/tests/baselines/reference/inferSecondaryParameter.types index 34dbb14ea6668..c4d827bb3c5e8 100644 --- a/tests/baselines/reference/inferSecondaryParameter.types +++ b/tests/baselines/reference/inferSecondaryParameter.types @@ -23,7 +23,7 @@ b.m("test", function (bug) { >b.m : (test: string, fn: Function) => any >b : Ib >m : (test: string, fn: Function) => any ->"test" : string +>"test" : "test" >function (bug) { var a: number = bug;} : (bug: any) => void >bug : any diff --git a/tests/baselines/reference/inferSetterParamType.errors.txt b/tests/baselines/reference/inferSetterParamType.errors.txt index 2ae2a16f9d256..02c02ba69d536 100644 --- a/tests/baselines/reference/inferSetterParamType.errors.txt +++ b/tests/baselines/reference/inferSetterParamType.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inferSetterParamType.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2322: Type '0' is not assignable to type 'string'. tests/cases/compiler/inferSetterParamType.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -26,7 +26,7 @@ tests/cases/compiler/inferSetterParamType.ts(15,9): error TS1056: Accessors are !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 0; // should be an error - can't coerce infered return type to match setter annotated type ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '0' is not assignable to type 'string'. } set bar(n:string) { ~~~ diff --git a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types index f4d94388f427c..24cecbfd183c8 100644 --- a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types +++ b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types @@ -28,11 +28,11 @@ function i(array: T[], opt?: any[]) { } var a = [1, 2, 3, 4, 5]; >a : number[] >[1, 2, 3, 4, 5] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 f(a); // OK >f(a) : void diff --git a/tests/baselines/reference/inferenceFromParameterlessLambda.types b/tests/baselines/reference/inferenceFromParameterlessLambda.types index 57747d881f646..1adf508226ba0 100644 --- a/tests/baselines/reference/inferenceFromParameterlessLambda.types +++ b/tests/baselines/reference/inferenceFromParameterlessLambda.types @@ -34,5 +34,5 @@ foo(n => n.length, () => 'hi'); >n : string >length : number >() => 'hi' : () => string ->'hi' : string +>'hi' : "hi" diff --git a/tests/baselines/reference/inferenceLimit.types b/tests/baselines/reference/inferenceLimit.types index 37b51e49644a8..c31ce844b115e 100644 --- a/tests/baselines/reference/inferenceLimit.types +++ b/tests/baselines/reference/inferenceLimit.types @@ -1,6 +1,6 @@ === tests/cases/compiler/file1.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" import * as MyModule from "./mymodule"; >MyModule : typeof MyModule diff --git a/tests/baselines/reference/inferentialTypingObjectLiteralMethod1.types b/tests/baselines/reference/inferentialTypingObjectLiteralMethod1.types index da2fa24060f7f..9365013f050e0 100644 --- a/tests/baselines/reference/inferentialTypingObjectLiteralMethod1.types +++ b/tests/baselines/reference/inferentialTypingObjectLiteralMethod1.types @@ -29,7 +29,7 @@ declare function foo(x: T, y: Int, z: Int): T; foo("", { method(p1) { return p1.length } }, { method(p2) { return undefined } }); >foo("", { method(p1) { return p1.length } }, { method(p2) { return undefined } }) : string >foo : (x: T, y: Int, z: Int) => T ->"" : string +>"" : "" >{ method(p1) { return p1.length } } : { method(p1: string): number; } >method : (p1: string) => number >p1 : string diff --git a/tests/baselines/reference/inferentialTypingObjectLiteralMethod2.types b/tests/baselines/reference/inferentialTypingObjectLiteralMethod2.types index f70305739b896..2ee813193a259 100644 --- a/tests/baselines/reference/inferentialTypingObjectLiteralMethod2.types +++ b/tests/baselines/reference/inferentialTypingObjectLiteralMethod2.types @@ -29,7 +29,7 @@ declare function foo(x: T, y: Int, z: Int): T; foo("", { method(p1) { return p1.length } }, { method(p2) { return undefined } }); >foo("", { method(p1) { return p1.length } }, { method(p2) { return undefined } }) : string >foo : (x: T, y: Int, z: Int) => T ->"" : string +>"" : "" >{ method(p1) { return p1.length } } : { method(p1: string): number; } >method : (p1: string) => number >p1 : string diff --git a/tests/baselines/reference/inferentialTypingUsingApparentType3.types b/tests/baselines/reference/inferentialTypingUsingApparentType3.types index e375fe981e89a..1738eff89a807 100644 --- a/tests/baselines/reference/inferentialTypingUsingApparentType3.types +++ b/tests/baselines/reference/inferentialTypingUsingApparentType3.types @@ -19,7 +19,7 @@ class CharField implements Field { >input : string return "Yup"; ->"Yup" : string +>"Yup" : "Yup" } } @@ -32,7 +32,7 @@ class NumberField implements Field { >input : number return 123; ->123 : number +>123 : 123 } } diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType.types b/tests/baselines/reference/inferentialTypingWithFunctionType.types index 460156c91ead6..0360adefd7c5b 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType.types @@ -22,6 +22,6 @@ var s = map("", identity); >s : string >map("", identity) : string >map : (x: T, f: (s: T) => U) => U ->"" : string +>"" : "" >identity : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.types b/tests/baselines/reference/inferentialTypingWithFunctionType2.types index 6dc4cda3b6871..2c4bb2542fbe0 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType2.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.types @@ -15,10 +15,10 @@ var x = [1, 2, 3].map(identity)[0]; >[1, 2, 3].map(identity) : number[] >[1, 2, 3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >identity : (a: A) => A ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types index a83379b4c7317..86219faf53717 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types @@ -23,7 +23,7 @@ var s = map("", () => { return { x: identity }; }); >s : string >map("", () => { return { x: identity }; }) : string >map : (x: T, f: () => { x: (s: T) => U; }) => U ->"" : string +>"" : "" >() => { return { x: identity }; } : () => { x: (y: string) => string; } >{ x: identity } : { x: (y: V) => V; } >x : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types index 5a4decef4dc4e..cb7904b80603e 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types @@ -33,7 +33,7 @@ s = map("", dottedIdentity.x); >s : string >map("", dottedIdentity.x) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >dottedIdentity.x : (y: V) => V >dottedIdentity : { x: (y: V) => V; } >x : (y: V) => V @@ -44,10 +44,10 @@ s = map("", dottedIdentity['x']); >s : string >map("", dottedIdentity['x']) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >dottedIdentity['x'] : (y: V) => V >dottedIdentity : { x: (y: V) => V; } ->'x' : string +>'x' : "x" // function call s = map("", (() => identity)()); @@ -55,7 +55,7 @@ s = map("", (() => identity)()); >s : string >map("", (() => identity)()) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >(() => identity)() : (y: V) => V >(() => identity) : () => (y: V) => V >() => identity : () => (y: V) => V @@ -77,7 +77,7 @@ s = map("", new ic()); >s : string >map("", new ic()) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >new ic() : (y: V) => V >ic : IdentityConstructor @@ -90,7 +90,7 @@ s = map("", t = identity); >s : string >map("", t = identity) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >t = identity : (y: V) => V >t : any >identity : (y: V) => V @@ -101,7 +101,7 @@ s = map("", identity); >s : string >map("", identity) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >identity : (y: V) => V >identity : (y: V) => V >identity : (y: V) => V @@ -112,7 +112,7 @@ s = map("", (identity)); >s : string >map("", (identity)) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >(identity) : (y: V) => V >identity : (y: V) => V @@ -122,9 +122,9 @@ s = map("", ("", identity)); >s : string >map("", ("", identity)) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >("", identity) : (y: V) => V >"", identity : (y: V) => V ->"" : string +>"" : "" >identity : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types index cc9d8790bd4b5..58d51e48987f4 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types @@ -34,11 +34,11 @@ var result = zipWith([1, 2], ['a', 'b'], pair); >zipWith([1, 2], ['a', 'b'], pair) : { x: number; y: {}; }[] >zipWith : (a: T[], b: S[], f: (x: T) => (y: S) => U) => U[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >['a', 'b'] : string[] ->'a' : string ->'b' : string +>'a' : "a" +>'b' : "b" >pair : (x: T) => (y: S) => { x: T; y: S; } var i = result[0].x; // number @@ -46,6 +46,6 @@ var i = result[0].x; // number >result[0].x : number >result[0] : { x: number; y: {}; } >result : { x: number; y: {}; }[] ->0 : number +>0 : 0 >x : number diff --git a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt index 9dfb41c0faca8..69f215896708f 100644 --- a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt +++ b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(4,1): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts (2 errors) ==== @@ -8,8 +8,8 @@ tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error } f({ x: [null] }, { x: [1] }).x[0] = "" // ok ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. f({ x: [1] }, { x: [null] }).x[0] = "" // was error TS2011: Cannot convert 'string' to 'number'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt deleted file mode 100644 index bab58d0e4cf5f..0000000000000 --- a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(2,10): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts (1 errors) ==== - - function foo() { - ~~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return 42; - } - else { - return "42"; - } - }; - \ No newline at end of file diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.symbols b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.symbols new file mode 100644 index 0000000000000..059a992c3f33d --- /dev/null +++ b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts === + +function foo() { +>foo : Symbol(foo, Decl(inferredFunctionReturnTypeIsEmptyType.ts, 0, 0)) + + if (true) { + return 42; + } + else { + return "42"; + } +}; + diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.types b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.types new file mode 100644 index 0000000000000..3775ffd2faa82 --- /dev/null +++ b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.types @@ -0,0 +1,17 @@ +=== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts === + +function foo() { +>foo : () => 42 | "42" + + if (true) { +>true : true + + return 42; +>42 : 42 + } + else { + return "42"; +>"42" : "42" + } +}; + diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types index 3f170d1a6ece6..444c9b7706986 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types @@ -6,7 +6,7 @@ class a { >x : () => string return "10"; ->"10" : string +>"10" : "10" } } @@ -18,6 +18,6 @@ class b extends a { >x : () => string return "20"; ->"20" : string +>"20" : "20" } } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types index 22fa0a6660f14..5a1320cd66609 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types @@ -6,7 +6,7 @@ class a { >x : () => string return "10"; ->"10" : string +>"10" : "10" } } @@ -18,6 +18,6 @@ class b extends a { >x : () => string return "20"; ->"20" : string +>"20" : "20" } } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types index a7df20382ec42..3b6741770a459 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types @@ -14,6 +14,6 @@ class b extends a { >x : () => string return "20"; ->"20" : string +>"20" : "20" } } diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt index fd63eafbaf71f..5e9775b81d945 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inheritedConstructorWithRestParams.ts(13,17): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams.ts(14,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams.ts(13,17): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams.ts(14,13): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/inheritedConstructorWithRestParams.ts (2 errors) ==== @@ -17,7 +17,7 @@ tests/cases/compiler/inheritedConstructorWithRestParams.ts(14,13): error TS2345: // Errors new Derived("", 3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived(3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index 514d0d8941fff..9249e9512bc82 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,17): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,17): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,17): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,17): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/inheritedConstructorWithRestParams2.ts (3 errors) ==== @@ -37,10 +37,10 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,17): error TS2345 // Errors new Derived(3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", ""); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types index b13fde1189a73..ce918d27e9f8e 100644 --- a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types +++ b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types @@ -14,7 +14,7 @@ fn((a, b) => true); >(a, b) => true : (a: any, b: any) => boolean >a : any >b : any ->true : boolean +>true : true fn(function (a, b) { return true; }) >fn(function (a, b) { return true; }) : void @@ -22,6 +22,6 @@ fn(function (a, b) { return true; }) >function (a, b) { return true; } : (a: any, b: any) => boolean >a : any >b : any ->true : boolean +>true : true diff --git a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types index 563cb58a755e0..d15aab73b042a 100644 --- a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types +++ b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types @@ -26,7 +26,7 @@ b('foo').charAt(0); >b : B >'foo' : "foo" >charAt : (pos: number) => string ->0 : number +>0 : 0 interface A { >A : A @@ -118,7 +118,7 @@ var x5: void = c('A0'); >x5 : void >c('A0') : void >c : C ->'A0' : string +>'A0' : "A0" var x6: number[] = c('C1'); >x6 : number[] @@ -142,5 +142,5 @@ var x9: void = c('generic'); >x9 : void >c('generic') : void >c : C ->'generic' : string +>'generic' : "generic" diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.types b/tests/baselines/reference/initializePropertiesWithRenamedLet.types index 3c6938cd64338..65ea68059a7b9 100644 --- a/tests/baselines/reference/initializePropertiesWithRenamedLet.types +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.types @@ -4,7 +4,7 @@ var x0; >x0 : any if (true) { ->true : boolean +>true : true let x0; >x0 : any @@ -27,20 +27,20 @@ var x, y, z; >z : any if (true) { ->true : boolean +>true : true let { x: x } = { x: 0 }; >x : any >x : number >{ x: 0 } : { x: number; } >x : number ->0 : number +>0 : 0 let { y } = { y: 0 }; >y : number >{ y: 0 } : { y: number; } >y : number ->0 : number +>0 : 0 let z; >z : any @@ -53,7 +53,7 @@ if (true) { >z : any >{ z: 0 } : { z: number; } >z : number ->0 : number +>0 : 0 ({ z } = { z: 0 }); >({ z } = { z: 0 }) : { z: number; } @@ -62,5 +62,5 @@ if (true) { >z : any >{ z: 0 } : { z: number; } >z : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/initializersInAmbientEnums.types b/tests/baselines/reference/initializersInAmbientEnums.types index 40996e9b40afb..042ddbc50c967 100644 --- a/tests/baselines/reference/initializersInAmbientEnums.types +++ b/tests/baselines/reference/initializersInAmbientEnums.types @@ -4,7 +4,7 @@ declare enum E { a = 10, >a : E ->10 : number +>10 : 10 b = a, >b : E @@ -13,8 +13,8 @@ declare enum E { e = 10 << 2 * 8, >e : E >10 << 2 * 8 : number ->10 : number +>10 : 10 >2 * 8 : number ->2 : number ->8 : number +>2 : 2 +>8 : 8 } diff --git a/tests/baselines/reference/initializersWidened.types b/tests/baselines/reference/initializersWidened.types index 766f859029af9..17de14e9e9488 100644 --- a/tests/baselines/reference/initializersWidened.types +++ b/tests/baselines/reference/initializersWidened.types @@ -12,7 +12,7 @@ var y1 = undefined; var z1 = void 0; >z1 : any >void 0 : undefined ->0 : number +>0 : 0 // these are not widened @@ -35,7 +35,7 @@ var y3: undefined = undefined; var z3: undefined = void 0; >z3 : undefined >void 0 : undefined ->0 : number +>0 : 0 // widen only when all constituents of union are widening @@ -55,9 +55,9 @@ var z4 = void 0 || void 0; >z4 : any >void 0 || void 0 : undefined >void 0 : undefined ->0 : number +>0 : 0 >void 0 : undefined ->0 : number +>0 : 0 var x5 = null || x2; >x5 : null @@ -75,6 +75,6 @@ var z5 = void 0 || y2; >z5 : undefined >void 0 || y2 : undefined >void 0 : undefined ->0 : number +>0 : 0 >y2 : undefined diff --git a/tests/baselines/reference/innerFunc.types b/tests/baselines/reference/innerFunc.types index 48d98ae42e1aa..700ca630233a6 100644 --- a/tests/baselines/reference/innerFunc.types +++ b/tests/baselines/reference/innerFunc.types @@ -4,7 +4,7 @@ function salt() { function pepper() { return 5;} >pepper : () => number ->5 : number +>5 : 5 return pepper(); >pepper() : number @@ -19,7 +19,7 @@ module M { function oxygen() { return 6; }; >oxygen : () => number ->6 : number +>6 : 6 return oxygen(); >oxygen() : number diff --git a/tests/baselines/reference/innerOverloads.types b/tests/baselines/reference/innerOverloads.types index 68af57b3bea83..b15f9e5bf22ff 100644 --- a/tests/baselines/reference/innerOverloads.types +++ b/tests/baselines/reference/innerOverloads.types @@ -19,7 +19,7 @@ function outer() { return inner(0); >inner(0) : any >inner : { (x: number): any; (x: string): any; } ->0 : number +>0 : 0 } var x = outer(); // should work diff --git a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt index b5e56d2f4e37a..0e0bcde70de10 100644 --- a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt +++ b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2322: Type '10' is not assignable to type 'string'. ==== tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts (1 errors) ==== @@ -13,7 +13,7 @@ tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2322: Type // otherwise, there's a bug in overload resolution / partial typechecking var k: string = 10; ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '10' is not assignable to type 'string'. } ); \ No newline at end of file diff --git a/tests/baselines/reference/instanceAndStaticDeclarations1.types b/tests/baselines/reference/instanceAndStaticDeclarations1.types index cbed990690d15..91bd5e7eb523b 100644 --- a/tests/baselines/reference/instanceAndStaticDeclarations1.types +++ b/tests/baselines/reference/instanceAndStaticDeclarations1.types @@ -50,8 +50,8 @@ class Point { >origin : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 static distance(p1: Point, p2: Point) { return p1.distance(p2); } >distance : (p1: Point, p2: Point) => number diff --git a/tests/baselines/reference/instanceMemberInitialization.types b/tests/baselines/reference/instanceMemberInitialization.types index 4d65c62aa49bc..ca97ccac3336b 100644 --- a/tests/baselines/reference/instanceMemberInitialization.types +++ b/tests/baselines/reference/instanceMemberInitialization.types @@ -4,7 +4,7 @@ class C { x = 1; >x : number ->1 : number +>1 : 1 } var c = new C(); @@ -13,11 +13,11 @@ var c = new C(); >C : typeof C c.x = 3; ->c.x = 3 : number +>c.x = 3 : 3 >c.x : number >c : C >x : number ->3 : number +>3 : 3 var c2 = new C(); >c2 : C diff --git a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.types b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.types index d98a602579642..e9048af2e3403 100644 --- a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.types +++ b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.types @@ -40,7 +40,7 @@ function foo1(x: C1 | C2 | C3): string { >x.item : string[] >x : C2 >item : string[] ->0 : number +>0 : 0 } else if (x instanceof C3) { >x instanceof C3 : boolean @@ -53,7 +53,7 @@ function foo1(x: C1 | C2 | C3): string { >item : string } return "error"; ->"error" : string +>"error" : "error" } function isC1(c: C1 | C2 | C3): c is C1 { return c instanceof C1 } @@ -119,7 +119,7 @@ function foo2(x: C1 | C2 | C3): string { >x.item : string[] >x : C2 >item : string[] ->0 : number +>0 : 0 } else if (isC3(x)) { >isC3(x) : boolean @@ -132,7 +132,7 @@ function foo2(x: C1 | C2 | C3): string { >item : string } return "error"; ->"error" : string +>"error" : "error" } // More tests diff --git a/tests/baselines/reference/instantiateContextuallyTypedGenericThis.types b/tests/baselines/reference/instantiateContextuallyTypedGenericThis.types index 5cdce6b99fe18..11be8be8252ab 100644 --- a/tests/baselines/reference/instantiateContextuallyTypedGenericThis.types +++ b/tests/baselines/reference/instantiateContextuallyTypedGenericThis.types @@ -42,12 +42,12 @@ $.each(lines, function(dit) { >dit.charAt : (pos: number) => string >dit : string >charAt : (pos: number) => string ->0 : number +>0 : 0 >this.charAt(1) : string >this.charAt : (pos: number) => string >this : string >charAt : (pos: number) => string ->1 : number +>1 : 1 }); diff --git a/tests/baselines/reference/instantiateCrossFileMerge.types b/tests/baselines/reference/instantiateCrossFileMerge.types index 8fbeaab3d1f1f..2da25e6b138fc 100644 --- a/tests/baselines/reference/instantiateCrossFileMerge.types +++ b/tests/baselines/reference/instantiateCrossFileMerge.types @@ -22,5 +22,5 @@ new P(r => { r('foo') }); >r : (value: string) => void >r('foo') : void >r : (value: string) => void ->'foo' : string +>'foo' : "foo" diff --git a/tests/baselines/reference/instantiatedModule.types b/tests/baselines/reference/instantiatedModule.types index 743c6561161fc..b7072d6bb7385 100644 --- a/tests/baselines/reference/instantiatedModule.types +++ b/tests/baselines/reference/instantiatedModule.types @@ -11,7 +11,7 @@ module M { export var Point = 1; >Point : number ->1 : number +>1 : 1 } // primary expression @@ -69,9 +69,9 @@ module M2 { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } } } @@ -141,8 +141,8 @@ module M3 { export enum Color { Blue, Red } >Color : Color ->Blue : Color ->Red : Color +>Blue : Color.Blue +>Red : Color.Red } var m3: typeof M3; @@ -186,17 +186,17 @@ var p3: M3.Color; var p3 = M3.Color.Red; >p3 : M3.Color ->M3.Color.Red : M3.Color +>M3.Color.Red : M3.Color.Red >M3.Color : typeof M3.Color >M3 : typeof M3 >Color : typeof M3.Color ->Red : M3.Color +>Red : M3.Color.Red var p3 = m3.Color.Blue; >p3 : M3.Color ->m3.Color.Blue : M3.Color +>m3.Color.Blue : M3.Color.Blue >m3.Color : typeof M3.Color >m3 : typeof M3 >Color : typeof M3.Color ->Blue : M3.Color +>Blue : M3.Color.Blue diff --git a/tests/baselines/reference/interface0.types b/tests/baselines/reference/interface0.types index 8fd04eea83cd0..9a70cf066b177 100644 --- a/tests/baselines/reference/interface0.types +++ b/tests/baselines/reference/interface0.types @@ -13,5 +13,5 @@ var y: Generic = { x: 3 }; >Generic : Generic >{ x: 3 } : { x: number; } >x : number ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/interfaceClassMerging.types b/tests/baselines/reference/interfaceClassMerging.types index 0b17005c8683f..60712d226a494 100644 --- a/tests/baselines/reference/interfaceClassMerging.types +++ b/tests/baselines/reference/interfaceClassMerging.types @@ -32,7 +32,7 @@ class Foo { >this.method : (a: number) => string >this : this >method : (a: number) => string ->0 : number +>0 : 0 } } @@ -62,14 +62,14 @@ bar.method(0); >bar.method : (a: number) => string >bar : Bar >method : (a: number) => string ->0 : number +>0 : 0 bar.optionalMethod(1); >bar.optionalMethod(1) : string >bar.optionalMethod : (a: number) => string >bar : Bar >optionalMethod : (a: number) => string ->1 : number +>1 : 1 bar.property; >bar.property : string @@ -91,7 +91,7 @@ bar.additionalMethod(2); >bar.additionalMethod : (a: number) => string >bar : Bar >additionalMethod : (a: number) => string ->2 : number +>2 : 2 var obj: { >obj : { method(a: number): string; property: string; additionalProperty: string; additionalMethod(a: number): string; } diff --git a/tests/baselines/reference/interfaceContextualType.types b/tests/baselines/reference/interfaceContextualType.types index d1ff4021c5d44..65dda5b737fea 100644 --- a/tests/baselines/reference/interfaceContextualType.types +++ b/tests/baselines/reference/interfaceContextualType.types @@ -39,9 +39,9 @@ class Bug { >this.values : IMap >this : this >values : IMap ->'comments' : string +>'comments' : "comments" >{ italic: true } : { italic: true; } ->italic : true +>italic : boolean >true : true } shouldBeOK() { @@ -57,7 +57,7 @@ class Bug { comments: { italic: true } >comments : { italic: true; } >{ italic: true } : { italic: true; } ->italic : true +>italic : boolean >true : true }; diff --git a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types index 65a7ec60168dd..4f60c5d36cc57 100644 --- a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types +++ b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types @@ -14,7 +14,7 @@ if (typeof x !== "string") { >x.push : (...items: StringTree[]) => number >x : StringTreeArray >push : (...items: StringTree[]) => number ->"" : string +>"" : "" x.push([""]); >x.push([""]) : number @@ -22,7 +22,7 @@ if (typeof x !== "string") { >x : StringTreeArray >push : (...items: StringTree[]) => number >[""] : string[] ->"" : string +>"" : "" } type StringTree = string | StringTreeArray; diff --git a/tests/baselines/reference/interfaceSubtyping.types b/tests/baselines/reference/interfaceSubtyping.types index 26a900a56b27a..07c0d6446b501 100644 --- a/tests/baselines/reference/interfaceSubtyping.types +++ b/tests/baselines/reference/interfaceSubtyping.types @@ -14,6 +14,6 @@ class Camera implements iface{ } foo() { return "s"; } >foo : () => string ->"s" : string +>"s" : "s" } diff --git a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types index 1110992fd5251..755514680d296 100644 --- a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types +++ b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types @@ -25,7 +25,7 @@ var r2 = f(''); >r2 : number >f('') : number >f : Foo ->'' : string +>'' : "" var r3 = new f(); >r3 : any @@ -36,5 +36,5 @@ var r4 = new f(''); >r4 : Object >new f('') : Object >f : Foo ->'' : string +>'' : "" diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types index 0ad754476a23d..07832f23fc343 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types @@ -11,7 +11,7 @@ module M { export var y = 1; >y : number ->1 : number +>1 : 1 } enum E { A } >E : E @@ -84,14 +84,14 @@ var a: Foo = { a: 1, >a : number ->1 : number +>1 : 1 b: '', >b : string ->'' : string +>'' : "" c: true, ->c : true +>c : boolean >true : true d: {}, @@ -105,7 +105,7 @@ var a: Foo = { f: [1], >f : number[] >[1] : number[] ->1 : number +>1 : 1 g: {}, >g : {} @@ -115,7 +115,7 @@ var a: Foo = { >h : (x: number) => number >(x: number) => 1 : (x: number) => number >x : number ->1 : number +>1 : 1 i: (x: T) => x, >i : (x: T) => T diff --git a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types index 5288d9f15a434..b6c658e10dcf2 100644 --- a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types +++ b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types @@ -30,7 +30,7 @@ var r2 = f('A'); >r2 : any >f('A') : any >f : Foo ->'A' : string +>'A' : "A" var r3 = new f('a'); >r3 : any @@ -42,5 +42,5 @@ var r4 = new f('A'); >r4 : Object >new f('A') : Object >f : Foo ->'A' : string +>'A' : "A" diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types index 58afd2071fe99..155f035c6c78c 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types @@ -37,7 +37,7 @@ export module m2 { >cProp.foo : (a: number) => number >cProp : c >foo : (a: number) => number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types index 43f612d3f4423..6a0ee6fa98660 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types @@ -37,6 +37,6 @@ export module m2 { >cProp.foo : (a: number) => number >cProp : c >foo : (a: number) => number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types index 3d72c04aad6cf..407d0602de680 100644 --- a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types @@ -31,5 +31,5 @@ var cReturnVal = cProp.foo(10); >cProp.foo : (a: number) => number >cProp : xc >foo : (a: number) => number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types index f816fdce7af61..405232d72b75c 100644 --- a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types @@ -31,5 +31,5 @@ var cReturnVal = cProp.foo(10); >cProp.foo : (a: number) => number >cProp : xc >foo : (a: number) => number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/internalAliasEnum.types b/tests/baselines/reference/internalAliasEnum.types index 3f86d63c87946..0465dbc884154 100644 --- a/tests/baselines/reference/internalAliasEnum.types +++ b/tests/baselines/reference/internalAliasEnum.types @@ -6,13 +6,13 @@ module a { >weekend : weekend Friday, ->Friday : weekend +>Friday : weekend.Friday Saturday, ->Saturday : weekend +>Saturday : weekend.Saturday Sunday ->Sunday : weekend +>Sunday : weekend.Sunday } } diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.types index 66d946e47b37a..e35e5db5b479c 100644 --- a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.types @@ -6,13 +6,13 @@ export module a { >weekend : weekend Friday, ->Friday : weekend +>Friday : weekend.Friday Saturday, ->Saturday : weekend +>Saturday : weekend.Saturday Sunday ->Sunday : weekend +>Sunday : weekend.Sunday } } diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.types index f53a6fa355bf0..f063bb243523f 100644 --- a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.types @@ -6,13 +6,13 @@ export module a { >weekend : weekend Friday, ->Friday : weekend +>Friday : weekend.Friday Saturday, ->Saturday : weekend +>Saturday : weekend.Saturday Sunday ->Sunday : weekend +>Sunday : weekend.Sunday } } diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.types index 437e211bf16b7..f49f4c7421594 100644 --- a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.types @@ -6,13 +6,13 @@ export module a { >weekend : weekend Friday, ->Friday : weekend +>Friday : weekend.Friday Saturday, ->Saturday : weekend +>Saturday : weekend.Saturday Sunday ->Sunday : weekend +>Sunday : weekend.Sunday } } diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.types index c9b75f84266c1..209dba7aed18f 100644 --- a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.types @@ -6,13 +6,13 @@ export module a { >weekend : weekend Friday, ->Friday : weekend +>Friday : weekend.Friday Saturday, ->Saturday : weekend +>Saturday : weekend.Saturday Sunday ->Sunday : weekend +>Sunday : weekend.Sunday } } diff --git a/tests/baselines/reference/internalAliasFunction.types b/tests/baselines/reference/internalAliasFunction.types index d67535c76f78e..92e0fd11aa8d9 100644 --- a/tests/baselines/reference/internalAliasFunction.types +++ b/tests/baselines/reference/internalAliasFunction.types @@ -23,7 +23,7 @@ module c { >bVal : number >b(10) : number >b : (x: number) => number ->10 : number +>10 : 10 export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types index 928d8530228a9..275d7467ca5d8 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types @@ -23,7 +23,7 @@ export module c { >bVal : number >b(10) : number >b : (x: number) => number ->10 : number +>10 : 10 export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types index 630be11c71ece..45e72ff89c5ac 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types @@ -23,7 +23,7 @@ export module c { >bVal : number >b(10) : number >b : (x: number) => number ->10 : number +>10 : 10 export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types index c1e9f9af3d7f5..078b595651d39 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types @@ -20,7 +20,7 @@ export var bVal = b(10); >bVal : number >b(10) : number >b : (x: number) => number ->10 : number +>10 : 10 export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types index bca35e33dec78..2bab16ff814eb 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types @@ -20,7 +20,7 @@ export var bVal = b(10); >bVal : number >b(10) : number >b : (x: number) => number ->10 : number +>10 : 10 export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasVar.types b/tests/baselines/reference/internalAliasVar.types index 59da851b569bf..40897b403f098 100644 --- a/tests/baselines/reference/internalAliasVar.types +++ b/tests/baselines/reference/internalAliasVar.types @@ -4,7 +4,7 @@ module a { export var x = 10; >x : number ->10 : number +>10 : 10 } module c { diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types index 995c24bc382da..5527b00e47e88 100644 --- a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types @@ -4,7 +4,7 @@ export module a { export var x = 10; >x : number ->10 : number +>10 : 10 } export module c { diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types index 5e322f8483cc5..fe8f6fb54eae1 100644 --- a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types @@ -4,7 +4,7 @@ export module a { export var x = 10; >x : number ->10 : number +>10 : 10 } export module c { diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types index 199de9cae510f..41245f5b05e1a 100644 --- a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types @@ -4,7 +4,7 @@ export module a { export var x = 10; >x : number ->10 : number +>10 : 10 } export import b = a.x; diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types index d7a7309ccb4c4..e05e20108b28f 100644 --- a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types @@ -4,7 +4,7 @@ export module a { export var x = 10; >x : number ->10 : number +>10 : 10 } import b = a.x; diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types index e0548f1f8676e..f7949e5a3fe17 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types @@ -14,7 +14,7 @@ module A { export var a = 10; >a : number ->10 : number +>10 : 10 } module B { diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types index 1226ca3cbc4f9..856b61b66d700 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types @@ -12,7 +12,7 @@ module B { var A = 1; >A : number ->1 : number +>1 : 1 import Y = A; >Y : any diff --git a/tests/baselines/reference/intersectionTypeInference1.types b/tests/baselines/reference/intersectionTypeInference1.types index b74b2d2a4533f..9417f63336115 100644 --- a/tests/baselines/reference/intersectionTypeInference1.types +++ b/tests/baselines/reference/intersectionTypeInference1.types @@ -37,5 +37,5 @@ export const Form3 = brokenFunction(parameterFn)({store: "hello"}) >parameterFn : (props: { store: string; }) => void >{store: "hello"} : { store: string; } >store : string ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/intersectionTypeMembers.types b/tests/baselines/reference/intersectionTypeMembers.types index 6c3217698b8fa..4d1da7eab73d8 100644 --- a/tests/baselines/reference/intersectionTypeMembers.types +++ b/tests/baselines/reference/intersectionTypeMembers.types @@ -21,25 +21,25 @@ var abc: A & B & C; >C : C abc.a = "hello"; ->abc.a = "hello" : string +>abc.a = "hello" : "hello" >abc.a : string >abc : A & B & C >a : string ->"hello" : string +>"hello" : "hello" abc.b = "hello"; ->abc.b = "hello" : string +>abc.b = "hello" : "hello" >abc.b : string >abc : A & B & C >b : string ->"hello" : string +>"hello" : "hello" abc.c = "hello"; ->abc.c = "hello" : string +>abc.c = "hello" : "hello" >abc.c : string >abc : A & B & C >c : string ->"hello" : string +>"hello" : "hello" interface X { x: A } >X : X @@ -63,31 +63,31 @@ var xyz: X & Y & Z; >Z : Z xyz.x.a = "hello"; ->xyz.x.a = "hello" : string +>xyz.x.a = "hello" : "hello" >xyz.x.a : string >xyz.x : A & B & C >xyz : X & Y & Z >x : A & B & C >a : string ->"hello" : string +>"hello" : "hello" xyz.x.b = "hello"; ->xyz.x.b = "hello" : string +>xyz.x.b = "hello" : "hello" >xyz.x.b : string >xyz.x : A & B & C >xyz : X & Y & Z >x : A & B & C >b : string ->"hello" : string +>"hello" : "hello" xyz.x.c = "hello"; ->xyz.x.c = "hello" : string +>xyz.x.c = "hello" : "hello" >xyz.x.c : string >xyz.x : A & B & C >xyz : X & Y & Z >x : A & B & C >c : string ->"hello" : string +>"hello" : "hello" type F1 = (x: string) => string; >F1 : F1 @@ -106,13 +106,13 @@ var s = f("hello"); >s : string >f("hello") : string >f : F1 & F2 ->"hello" : string +>"hello" : "hello" var n = f(42); >n : number >f(42) : number >f : F1 & F2 ->42 : number +>42 : 42 interface D { >D : D @@ -150,24 +150,24 @@ const de: D & E = { d: 'yes', >d : string ->'yes' : string +>'yes' : "yes" f: 'no' >f : string ->'no' : string +>'no' : "no" }, different: { e: 12 }, >different : { e: number; } >{ e: 12 } : { e: number; } >e : number ->12 : number +>12 : 12 other: { g: 101 } >other : { g: number; } >{ g: 101 } : { g: number; } >g : number ->101 : number +>101 : 101 } } diff --git a/tests/baselines/reference/intersectionTypeOverloading.types b/tests/baselines/reference/intersectionTypeOverloading.types index f301ef6e4b722..8afa23ecb29cb 100644 --- a/tests/baselines/reference/intersectionTypeOverloading.types +++ b/tests/baselines/reference/intersectionTypeOverloading.types @@ -24,7 +24,7 @@ var x = fg("abc"); >x : string >fg("abc") : string >fg : F & G ->"abc" : string +>"abc" : "abc" var x: string; >x : string @@ -33,7 +33,7 @@ var y = gf("abc"); >y : any >gf("abc") : any >gf : G & F ->"abc" : string +>"abc" : "abc" var y: any; >y : any diff --git a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt index 3ac4f122e58d3..4b9b316e01097 100644 --- a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt +++ b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(3,1): error TS2322: Type 'boolean' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(4,1): error TS2322: Type 'string' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(2,1): error TS2322: Type '1' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(3,1): error TS2322: Type 'true' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(4,1): error TS2322: Type '""' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(5,1): error TS2322: Type '{}' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(9,1): error TS2322: Type 'typeof C' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(10,1): error TS2322: Type 'C' is not assignable to type 'void'. @@ -14,13 +14,13 @@ tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(22,1): var x: void; x = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type '1' is not assignable to type 'void'. x = true; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'true' is not assignable to type 'void'. x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type '""' is not assignable to type 'void'. x = {} ~ !!! error TS2322: Type '{}' is not assignable to type 'void'. diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index 99d32aff9bc96..7963197a0037d 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(3,5): error TS2322: Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4,5): error TS2322: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2322: Type 'boolean' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2322: Type 'boolean' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'boolean' is not assignable to type 'C'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'boolean' is not assignable to type '() => string'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(3,5): error TS2322: Type 'true' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4,5): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2322: Type 'true' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2322: Type 'true' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'true' is not assignable to type 'C'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'true' is not assignable to type 'I'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'true' is not assignable to type '() => string'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26,1): error TS2364: Invalid left-hand side of assignment expression. @@ -15,33 +15,33 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 var a: number = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'true' is not assignable to type 'number'. var b: string = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'true' is not assignable to type 'string'. var c: void = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'true' is not assignable to type 'void'. var d: typeof undefined = x; enum E { A } var e: E = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'E'. +!!! error TS2322: Type 'true' is not assignable to type 'E'. class C { foo: string } var f: C = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'C'. +!!! error TS2322: Type 'true' is not assignable to type 'C'. interface I { bar: string } var g: I = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'I'. +!!! error TS2322: Type 'true' is not assignable to type 'I'. var h: { (): string } = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type '() => string'. +!!! error TS2322: Type 'true' is not assignable to type '() => string'. var h2: { toString(): string } = x; // no error module M { export var a = 1; } diff --git a/tests/baselines/reference/invalidEnumAssignments.errors.txt b/tests/baselines/reference/invalidEnumAssignments.errors.txt index 962e4bf62d5e7..e769a829c9789 100644 --- a/tests/baselines/reference/invalidEnumAssignments.errors.txt +++ b/tests/baselines/reference/invalidEnumAssignments.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(14,1): error TS2322: Type 'E2' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(15,1): error TS2322: Type 'E' is not assignable to type 'E2'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(14,1): error TS2322: Type 'E2.A' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(15,1): error TS2322: Type 'E.A' is not assignable to type 'E2'. tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(16,1): error TS2322: Type 'void' is not assignable to type 'E'. tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(17,1): error TS2322: Type '{}' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(18,1): error TS2322: Type 'string' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(18,1): error TS2322: Type '""' is not assignable to type 'E'. tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): error TS2322: Type 'T' is not assignable to type 'E'. @@ -22,10 +22,10 @@ tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): e e = E2.A; ~ -!!! error TS2322: Type 'E2' is not assignable to type 'E'. +!!! error TS2322: Type 'E2.A' is not assignable to type 'E'. e2 = E.A; ~~ -!!! error TS2322: Type 'E' is not assignable to type 'E2'. +!!! error TS2322: Type 'E.A' is not assignable to type 'E2'. e = null; ~ !!! error TS2322: Type 'void' is not assignable to type 'E'. @@ -34,7 +34,7 @@ tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): e !!! error TS2322: Type '{}' is not assignable to type 'E'. e = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'E'. +!!! error TS2322: Type '""' is not assignable to type 'E'. function f(a: T) { e = a; diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt index fd8acaba03234..23f308830ff12 100644 --- a/tests/baselines/reference/invalidNumberAssignments.errors.txt +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -3,8 +3,8 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(4,5) tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(5,5): error TS2322: Type 'number' is not assignable to type 'void'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5): error TS2322: Type 'number' is not assignable to type 'C'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type '1' is not assignable to type '{ baz: string; }'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type '1' is not assignable to type '{ 0: number; }'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2322: Type 'number' is not assignable to type 'T'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -36,10 +36,10 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2322: Type '1' is not assignable to type '{ baz: string; }'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2322: Type '1' is not assignable to type '{ 0: number; }'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidSplice.types b/tests/baselines/reference/invalidSplice.types index 1e3b42ff55103..876846d3da9f0 100644 --- a/tests/baselines/reference/invalidSplice.types +++ b/tests/baselines/reference/invalidSplice.types @@ -5,8 +5,8 @@ var arr = [].splice(0,3,4,5); >[].splice : { (start: number): any[]; (start: number, deleteCount: number, ...items: any[]): any[]; } >[] : undefined[] >splice : { (start: number): any[]; (start: number, deleteCount: number, ...items: any[]): any[]; } ->0 : number ->3 : number ->4 : number ->5 : number +>0 : 0 +>3 : 3 +>4 : 4 +>5 : 5 diff --git a/tests/baselines/reference/invalidStringAssignments.errors.txt b/tests/baselines/reference/invalidStringAssignments.errors.txt index d7ac2134dc18c..b37c56e8a40b6 100644 --- a/tests/baselines/reference/invalidStringAssignments.errors.txt +++ b/tests/baselines/reference/invalidStringAssignments.errors.txt @@ -3,8 +3,8 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(4,5) tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(5,5): error TS2322: Type 'string' is not assignable to type 'void'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2322: Type 'string' is not assignable to type 'C'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type '1' is not assignable to type '{ baz: string; }'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type '1' is not assignable to type '{ 0: number; }'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -37,10 +37,10 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2322: Type '1' is not assignable to type '{ baz: string; }'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2322: Type '1' is not assignable to type '{ 0: number; }'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidSwitchBreakStatement.errors.txt b/tests/baselines/reference/invalidSwitchBreakStatement.errors.txt new file mode 100644 index 0000000000000..31715e3fc0b8f --- /dev/null +++ b/tests/baselines/reference/invalidSwitchBreakStatement.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/statements/breakStatements/invalidSwitchBreakStatement.ts(4,10): error TS2678: Type '5' is not comparable to type '12'. + + +==== tests/cases/conformance/statements/breakStatements/invalidSwitchBreakStatement.ts (1 errors) ==== + // break is not allowed in a switch statement + + switch (12) { + case 5: + ~ +!!! error TS2678: Type '5' is not comparable to type '12'. + break; + } + \ No newline at end of file diff --git a/tests/baselines/reference/invalidSwitchContinueStatement.errors.txt b/tests/baselines/reference/invalidSwitchContinueStatement.errors.txt index 9b86b019a7c3d..b5231d5948bc9 100644 --- a/tests/baselines/reference/invalidSwitchContinueStatement.errors.txt +++ b/tests/baselines/reference/invalidSwitchContinueStatement.errors.txt @@ -1,11 +1,14 @@ +tests/cases/conformance/statements/continueStatements/invalidSwitchContinueStatement.ts(4,10): error TS2678: Type '5' is not comparable to type '12'. tests/cases/conformance/statements/continueStatements/invalidSwitchContinueStatement.ts(5,9): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. -==== tests/cases/conformance/statements/continueStatements/invalidSwitchContinueStatement.ts (1 errors) ==== +==== tests/cases/conformance/statements/continueStatements/invalidSwitchContinueStatement.ts (2 errors) ==== // continue is not allowed in a switch statement switch (12) { case 5: + ~ +!!! error TS2678: Type '5' is not comparable to type '12'. continue; ~~~~~~~~~ !!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. diff --git a/tests/baselines/reference/invalidUndefinedValues.types b/tests/baselines/reference/invalidUndefinedValues.types index b88c202161874..b873f575263ea 100644 --- a/tests/baselines/reference/invalidUndefinedValues.types +++ b/tests/baselines/reference/invalidUndefinedValues.types @@ -4,19 +4,19 @@ var x: typeof undefined; >undefined : undefined x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 x = ''; ->x = '' : string +>x = '' : "" >x : any ->'' : string +>'' : "" x = true; ->x = true : boolean +>x = true : true >x : any ->true : boolean +>true : true var a: void; >a : void @@ -65,7 +65,7 @@ x = c; module M { export var x = 1; } >M : typeof M >x : number ->1 : number +>1 : 1 x = M; >x = M : typeof M diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt index af8cec62672a3..de19fc3a21874 100644 --- a/tests/baselines/reference/invalidVoidAssignments.errors.txt +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -3,8 +3,8 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(4,5): er tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(5,5): error TS2322: Type 'void' is not assignable to type 'number'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(9,5): error TS2322: Type 'void' is not assignable to type 'C'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(12,5): error TS2322: Type 'void' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type '1' is not assignable to type '{ baz: string; }'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type '1' is not assignable to type '{ 0: number; }'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2322: Type 'void' is not assignable to type 'T'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -39,10 +39,10 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2322: Type '1' is not assignable to type '{ baz: string; }'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2322: Type '1' is not assignable to type '{ 0: number; }'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidVoidValues.errors.txt b/tests/baselines/reference/invalidVoidValues.errors.txt index eb5ddd022593e..8fc015f692f10 100644 --- a/tests/baselines/reference/invalidVoidValues.errors.txt +++ b/tests/baselines/reference/invalidVoidValues.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(3,1): error TS2322: Type 'string' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(4,1): error TS2322: Type 'boolean' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(2,1): error TS2322: Type '1' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(3,1): error TS2322: Type '""' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(4,1): error TS2322: Type 'true' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(7,1): error TS2322: Type 'typeof E' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(8,1): error TS2322: Type 'E' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(12,1): error TS2322: Type 'C' is not assignable to type 'void'. @@ -15,13 +15,13 @@ tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(26,1): error var x: void; x = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type '1' is not assignable to type 'void'. x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type '""' is not assignable to type 'void'. x = true; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'true' is not assignable to type 'void'. enum E { A } x = E; diff --git a/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt b/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt index b38ed09f47e3a..e887d564df4ea 100644 --- a/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt +++ b/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/invocationExpressionInFunctionParameter.ts(3,24): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/invocationExpressionInFunctionParameter.ts(3,24): error TS2345: Argument of type '123' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/invocationExpressionInFunctionParameter.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/invocationExpressionInFunctionParameter.ts(3,24): error TS2 } function foo3(x = foo1(123)) { //should error, 123 is not string ~~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '123' is not assignable to parameter of type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/ipromise2.types b/tests/baselines/reference/ipromise2.types index b52c3460dd467..e643bd7da4be9 100644 --- a/tests/baselines/reference/ipromise2.types +++ b/tests/baselines/reference/ipromise2.types @@ -112,7 +112,7 @@ var p2 = p.then(function (s) { >s : string return 34; ->34 : number +>34 : 34 } ); diff --git a/tests/baselines/reference/ipromise4.types b/tests/baselines/reference/ipromise4.types index b12c47c7ed5b6..32461326c564f 100644 --- a/tests/baselines/reference/ipromise4.types +++ b/tests/baselines/reference/ipromise4.types @@ -116,7 +116,7 @@ p.then(function (x) { return "hello"; } ).then(function (x) { return x } ); // s >then : { (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >function (x) { return "hello"; } : (x: number) => string >x : number ->"hello" : string +>"hello" : "hello" >then : { (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >function (x) { return x } : (x: string) => string >x : string diff --git a/tests/baselines/reference/isLiteral1.types b/tests/baselines/reference/isLiteral1.types index 7ef84568f860a..ae512e8bcb18a 100644 --- a/tests/baselines/reference/isLiteral1.types +++ b/tests/baselines/reference/isLiteral1.types @@ -1,5 +1,5 @@ === tests/cases/compiler/isLiteral1.ts === var x: number = 02343; >x : number ->02343 : number +>02343 : 2343 diff --git a/tests/baselines/reference/isLiteral2.types b/tests/baselines/reference/isLiteral2.types index ab62993fab6c0..7ee40a962724a 100644 --- a/tests/baselines/reference/isLiteral2.types +++ b/tests/baselines/reference/isLiteral2.types @@ -1,5 +1,5 @@ === tests/cases/compiler/isLiteral2.ts === var x: number = 02343 >x : number ->02343 : number +>02343 : 2343 diff --git a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types index 4583a1c073070..0412a79c479bc 100644 --- a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types +++ b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types @@ -3,7 +3,7 @@ const enum E { X = 100 }; >E : E >X : E ->100 : number +>100 : 100 var e = E.X; >e : E diff --git a/tests/baselines/reference/isolatedModulesSourceMap.types b/tests/baselines/reference/isolatedModulesSourceMap.types index d2a474c023d06..2ac7b1f2f65c4 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.types +++ b/tests/baselines/reference/isolatedModulesSourceMap.types @@ -2,5 +2,5 @@ export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/iterableArrayPattern1.types b/tests/baselines/reference/iterableArrayPattern1.types index a2c9807d26a40..816ce7ac6cf10 100644 --- a/tests/baselines/reference/iterableArrayPattern1.types +++ b/tests/baselines/reference/iterableArrayPattern1.types @@ -21,7 +21,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern11.types b/tests/baselines/reference/iterableArrayPattern11.types index 5ec182ec3974b..0acadd7cfc8aa 100644 --- a/tests/baselines/reference/iterableArrayPattern11.types +++ b/tests/baselines/reference/iterableArrayPattern11.types @@ -37,7 +37,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern12.types b/tests/baselines/reference/iterableArrayPattern12.types index 89af4d47d01e8..c00e1daae8106 100644 --- a/tests/baselines/reference/iterableArrayPattern12.types +++ b/tests/baselines/reference/iterableArrayPattern12.types @@ -37,7 +37,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern13.types b/tests/baselines/reference/iterableArrayPattern13.types index e8873a74b725a..04dab57748d36 100644 --- a/tests/baselines/reference/iterableArrayPattern13.types +++ b/tests/baselines/reference/iterableArrayPattern13.types @@ -35,7 +35,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern2.types b/tests/baselines/reference/iterableArrayPattern2.types index 48f4444359130..63786a1d35165 100644 --- a/tests/baselines/reference/iterableArrayPattern2.types +++ b/tests/baselines/reference/iterableArrayPattern2.types @@ -21,7 +21,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern3.types b/tests/baselines/reference/iterableArrayPattern3.types index dd001d463764d..a21e702526b92 100644 --- a/tests/baselines/reference/iterableArrayPattern3.types +++ b/tests/baselines/reference/iterableArrayPattern3.types @@ -38,7 +38,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern30.types b/tests/baselines/reference/iterableArrayPattern30.types index 8cfb50c3abbd8..1abdba039ed98 100644 --- a/tests/baselines/reference/iterableArrayPattern30.types +++ b/tests/baselines/reference/iterableArrayPattern30.types @@ -8,9 +8,9 @@ const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) >Map : MapConstructor >[["", true], ["hello", true]] : [string, true][] >["", true] : [string, true] ->"" : string +>"" : "" >true : true >["hello", true] : [string, true] ->"hello" : string +>"hello" : "hello" >true : true diff --git a/tests/baselines/reference/iterableArrayPattern4.types b/tests/baselines/reference/iterableArrayPattern4.types index 2d6531494a4b2..a3be41144986b 100644 --- a/tests/baselines/reference/iterableArrayPattern4.types +++ b/tests/baselines/reference/iterableArrayPattern4.types @@ -39,7 +39,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern9.types b/tests/baselines/reference/iterableArrayPattern9.types index e9e342e77758e..b24d057f4a7da 100644 --- a/tests/baselines/reference/iterableArrayPattern9.types +++ b/tests/baselines/reference/iterableArrayPattern9.types @@ -31,7 +31,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray.types b/tests/baselines/reference/iteratorSpreadInArray.types index 780acf32fabf8..4b5a63e5d57b9 100644 --- a/tests/baselines/reference/iteratorSpreadInArray.types +++ b/tests/baselines/reference/iteratorSpreadInArray.types @@ -22,7 +22,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray2.types b/tests/baselines/reference/iteratorSpreadInArray2.types index f2e64e5282e4d..19bf5eab004c0 100644 --- a/tests/baselines/reference/iteratorSpreadInArray2.types +++ b/tests/baselines/reference/iteratorSpreadInArray2.types @@ -25,7 +25,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } @@ -51,11 +51,11 @@ class NumberIterator { value: 0, >value : number ->0 : number +>0 : 0 done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray3.types b/tests/baselines/reference/iteratorSpreadInArray3.types index a59da81e1576e..1fd29bb238176 100644 --- a/tests/baselines/reference/iteratorSpreadInArray3.types +++ b/tests/baselines/reference/iteratorSpreadInArray3.types @@ -4,8 +4,8 @@ var array = [...[0, 1], ...new SymbolIterator]; >[...[0, 1], ...new SymbolIterator] : (number | symbol)[] >...[0, 1] : number >[0, 1] : number[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator @@ -26,7 +26,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray4.types b/tests/baselines/reference/iteratorSpreadInArray4.types index 0e16758acf431..6024e79dee51d 100644 --- a/tests/baselines/reference/iteratorSpreadInArray4.types +++ b/tests/baselines/reference/iteratorSpreadInArray4.types @@ -2,8 +2,8 @@ var array = [0, 1, ...new SymbolIterator]; >array : (number | symbol)[] >[0, 1, ...new SymbolIterator] : (number | symbol)[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator @@ -24,7 +24,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray7.types b/tests/baselines/reference/iteratorSpreadInArray7.types index 38549a606ab00..ef0e3898e0fa6 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.types +++ b/tests/baselines/reference/iteratorSpreadInArray7.types @@ -28,7 +28,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall11.types b/tests/baselines/reference/iteratorSpreadInCall11.types index dd440a1b4ac73..5990b26df6407 100644 --- a/tests/baselines/reference/iteratorSpreadInCall11.types +++ b/tests/baselines/reference/iteratorSpreadInCall11.types @@ -13,7 +13,7 @@ function foo(...s: T[]) { return s[0] } >T : T >s[0] : T >s : T[] ->0 : number +>0 : 0 class SymbolIterator { >SymbolIterator : SymbolIterator @@ -31,7 +31,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall12.types b/tests/baselines/reference/iteratorSpreadInCall12.types index 8543e59f55fff..b614fdde16b82 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.types +++ b/tests/baselines/reference/iteratorSpreadInCall12.types @@ -38,7 +38,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } @@ -64,11 +64,11 @@ class StringIterator { value: "", >value : string ->"" : string +>"" : "" done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall3.types b/tests/baselines/reference/iteratorSpreadInCall3.types index 54857755b554e..56b7f6db6d134 100644 --- a/tests/baselines/reference/iteratorSpreadInCall3.types +++ b/tests/baselines/reference/iteratorSpreadInCall3.types @@ -26,7 +26,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall5.types b/tests/baselines/reference/iteratorSpreadInCall5.types index bf4a0f7ad65ab..9542a76daf177 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.types +++ b/tests/baselines/reference/iteratorSpreadInCall5.types @@ -29,7 +29,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } @@ -55,11 +55,11 @@ class StringIterator { value: "", >value : string ->"" : string +>"" : "" done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorsAndStrictNullChecks.types b/tests/baselines/reference/iteratorsAndStrictNullChecks.types index ce1d7430f77b2..43efed86ed47d 100644 --- a/tests/baselines/reference/iteratorsAndStrictNullChecks.types +++ b/tests/baselines/reference/iteratorsAndStrictNullChecks.types @@ -4,8 +4,8 @@ for (const x of ["a", "b"]) { >x : string >["a", "b"] : string[] ->"a" : string ->"b" : string +>"a" : "a" +>"b" : "b" x.substring; >x.substring : (start: number, end?: number | undefined) => string @@ -17,15 +17,15 @@ for (const x of ["a", "b"]) { const xs = [1, 2, 3]; >xs : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 const ys = [4, 5]; >ys : number[] >[4, 5] : number[] ->4 : number ->5 : number +>4 : 4 +>5 : 5 xs.push(...ys); >xs.push(...ys) : number diff --git a/tests/baselines/reference/jsFileCompilationExternalPackageError.types b/tests/baselines/reference/jsFileCompilationExternalPackageError.types index ae2eb085f2862..d3a696d7bfe9b 100644 --- a/tests/baselines/reference/jsFileCompilationExternalPackageError.types +++ b/tests/baselines/reference/jsFileCompilationExternalPackageError.types @@ -17,18 +17,18 @@ c++; === tests/cases/compiler/node_modules/b.ts === var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/node_modules/c.js === exports.a = 10; ->exports.a = 10 : number +>exports.a = 10 : 10 >exports.a : any >exports : any >a : any ->10 : number +>10 : 10 c = 10; ->c = 10 : number +>c = 10 : 10 >c : any ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types index 094f59d20225f..3cac906f5d73f 100644 --- a/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types +++ b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types @@ -6,10 +6,10 @@ function foo(a) { for (let a = 0; a < 10; a++) { >a : number ->0 : number +>0 : 0 >a < 10 : boolean >a : number ->10 : number +>10 : 10 >a++ : number >a : number diff --git a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types index 443ed7398286e..c420454b8cf6a 100644 --- a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types +++ b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types @@ -42,7 +42,7 @@ function apply(func, thisArg, args) { >thisArg : any >args[0] : any >args : any[] ->0 : number +>0 : 0 case 2: return func.call(thisArg, args[0], args[1]); >2 : 2 @@ -53,10 +53,10 @@ function apply(func, thisArg, args) { >thisArg : any >args[0] : any >args : any[] ->0 : number +>0 : 0 >args[1] : any >args : any[] ->1 : number +>1 : 1 case 3: return func.call(thisArg, args[0], args[1], args[2]); >3 : 3 @@ -67,13 +67,13 @@ function apply(func, thisArg, args) { >thisArg : any >args[0] : any >args : any[] ->0 : number +>0 : 0 >args[1] : any >args : any[] ->1 : number +>1 : 1 >args[2] : any >args : any[] ->2 : number +>2 : 2 } return func.apply(thisArg, args); >func.apply(thisArg, args) : any diff --git a/tests/baselines/reference/jsFileCompilationShortHandProperty.types b/tests/baselines/reference/jsFileCompilationShortHandProperty.types index e4dd1755cebb7..d6badf4490902 100644 --- a/tests/baselines/reference/jsFileCompilationShortHandProperty.types +++ b/tests/baselines/reference/jsFileCompilationShortHandProperty.types @@ -5,11 +5,11 @@ function foo() { var a = 10; >a : number ->10 : number +>10 : 10 var b = "Hello"; >b : string ->"Hello" : string +>"Hello" : "Hello" return { >{ a, b } : { a: number; b: string; } diff --git a/tests/baselines/reference/jsdocLiteral.types b/tests/baselines/reference/jsdocLiteral.types index b6c9e522ac35c..c0a17c9bad12a 100644 --- a/tests/baselines/reference/jsdocLiteral.types +++ b/tests/baselines/reference/jsdocLiteral.types @@ -25,6 +25,6 @@ function f(p1, p2, p3, p4, p5) { >p3 : "literal" | "other" >p4 : number | "literal" >p5 : true | 12 | "str" ->'.' : string +>'.' : "." } diff --git a/tests/baselines/reference/json.stringify.types b/tests/baselines/reference/json.stringify.types index aaf92a17c0a2a..b063b06d8d07c 100644 --- a/tests/baselines/reference/json.stringify.types +++ b/tests/baselines/reference/json.stringify.types @@ -11,7 +11,7 @@ JSON.stringify(value, undefined, 2); >stringify : { (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string; } >value : null >undefined : undefined ->2 : number +>2 : 2 JSON.stringify(value, null, 2); >JSON.stringify(value, null, 2) : string @@ -20,7 +20,7 @@ JSON.stringify(value, null, 2); >stringify : { (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string; } >value : null >null : null ->2 : number +>2 : 2 JSON.stringify(value, ["a", 1], 2); >JSON.stringify(value, ["a", 1], 2) : string @@ -29,9 +29,9 @@ JSON.stringify(value, ["a", 1], 2); >stringify : { (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string; } >value : null >["a", 1] : (string | number)[] ->"a" : string ->1 : number ->2 : number +>"a" : "a" +>1 : 1 +>2 : 2 JSON.stringify(value, (k) => undefined, 2); >JSON.stringify(value, (k) => undefined, 2) : string @@ -42,7 +42,7 @@ JSON.stringify(value, (k) => undefined, 2); >(k) => undefined : (k: string) => undefined >k : string >undefined : undefined ->2 : number +>2 : 2 JSON.stringify(value, undefined, 2); >JSON.stringify(value, undefined, 2) : string @@ -51,5 +51,5 @@ JSON.stringify(value, undefined, 2); >stringify : { (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string; } >value : null >undefined : undefined ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/jsxHash.types b/tests/baselines/reference/jsxHash.types index 6d413141ca624..41f89c4b0870a 100644 --- a/tests/baselines/reference/jsxHash.types +++ b/tests/baselines/reference/jsxHash.types @@ -3,21 +3,21 @@ var t02 = {0}#; >t02 : any >{0}# : any >a : any ->0 : number +>0 : 0 >a : any var t03 = #{0}; >t03 : any >#{0} : any >a : any ->0 : number +>0 : 0 >a : any var t04 = #{0}#; >t04 : any >#{0}# : any >a : any ->0 : number +>0 : 0 >a : any var t05 = #; diff --git a/tests/baselines/reference/jsxPreserveWithJsInput.types b/tests/baselines/reference/jsxPreserveWithJsInput.types index 7f4ed6daa2b98..4ae5c6aeed4cb 100644 --- a/tests/baselines/reference/jsxPreserveWithJsInput.types +++ b/tests/baselines/reference/jsxPreserveWithJsInput.types @@ -2,14 +2,14 @@ var elemA = 42; >elemA : number ->42 : number +>42 : 42 === tests/cases/compiler/b.jsx === var elemB = {"test"}; >elemB : any >{"test"} : any >b : any ->"test" : string +>"test" : "test" >b : any === tests/cases/compiler/c.js === @@ -17,19 +17,19 @@ var elemC = {42}; >elemC : any >{42} : any >c : any ->42 : number +>42 : 42 >c : any === tests/cases/compiler/d.ts === var elemD = 42; >elemD : number ->42 : number +>42 : 42 === tests/cases/compiler/e.tsx === var elemE = {true}; >elemE : any >{true} : any >e : any ->true : boolean +>true : true >e : any diff --git a/tests/baselines/reference/jsxReactTestSuite.types b/tests/baselines/reference/jsxReactTestSuite.types index 8bab7ce6e7df0..712a7368a622f 100644 --- a/tests/baselines/reference/jsxReactTestSuite.types +++ b/tests/baselines/reference/jsxReactTestSuite.types @@ -120,8 +120,8 @@ var x = "foo" + "bar" >"foo" + "bar" : string ->"foo" : string ->"bar" : string +>"foo" : "foo" +>"bar" : "bar" } attr2={ >attr2 : any @@ -130,12 +130,12 @@ var x = >"foo" + "bar" + "baz" + "bug" : string >"foo" + "bar" + "baz" : string >"foo" + "bar" : string ->"foo" : string ->"bar" : string +>"foo" : "foo" +>"bar" : "bar" "baz" + "bug" ->"baz" : string ->"bug" : string +>"baz" : "baz" +>"bug" : "bug" } attr3={ >attr3 : any @@ -144,12 +144,12 @@ var x = >"foo" + "bar" + "baz" + "bug" : string >"foo" + "bar" + "baz" : string >"foo" + "bar" : string ->"foo" : string ->"bar" : string +>"foo" : "foo" +>"bar" : "bar" "baz" + "bug" ->"baz" : string ->"bug" : string +>"baz" : "baz" +>"bug" : "bug" // Extra line here. } @@ -254,7 +254,7 @@ var x = >y : any ={2 } z />; ->2 : number +>2 : 2 >z : any Component : any >x : any >y : any ->2 : number +>2 : 2 ; > : any >Component : any >x : any >y : any ->2 : number +>2 : 2 >z : any ; > : any >Component : any >x : any ->1 : number +>1 : 1 >y : any @@ -313,7 +313,7 @@ var x = > : any >Component : any >x : any ->1 : number +>1 : 1 >y : any >z : any >z : any @@ -331,10 +331,10 @@ var x = >z : any >{ y: 2 } : { y: number; } >y : number ->2 : number +>2 : 2 >z : any >z : any ->3 : number +>3 : 3 >Component : any diff --git a/tests/baselines/reference/keywordField.types b/tests/baselines/reference/keywordField.types index 8bc977edd747f..b5e90e627ed31 100644 --- a/tests/baselines/reference/keywordField.types +++ b/tests/baselines/reference/keywordField.types @@ -4,17 +4,17 @@ var obj:any = {}; >{} : {} obj.if = 1; ->obj.if = 1 : number +>obj.if = 1 : 1 >obj.if : any >obj : any >if : any ->1 : number +>1 : 1 var a = { if: "test" } >a : { if: string; } >{ if: "test" } : { if: string; } >if : string ->"test" : string +>"test" : "test" var n = a.if >n : string @@ -26,5 +26,5 @@ var q = a["if"]; >q : string >a["if"] : string >a : { if: string; } ->"if" : string +>"if" : "if" diff --git a/tests/baselines/reference/lambdaASIEmit.types b/tests/baselines/reference/lambdaASIEmit.types index 8ea881c4cd5e0..381e45c5fd2a0 100644 --- a/tests/baselines/reference/lambdaASIEmit.types +++ b/tests/baselines/reference/lambdaASIEmit.types @@ -13,5 +13,5 @@ Foo(() => // do something 127); ->127 : number +>127 : 127 diff --git a/tests/baselines/reference/lambdaExpression.types b/tests/baselines/reference/lambdaExpression.types index 714cd851d63f8..fc60097b6b0cb 100644 --- a/tests/baselines/reference/lambdaExpression.types +++ b/tests/baselines/reference/lambdaExpression.types @@ -1,18 +1,18 @@ === tests/cases/compiler/lambdaExpression.ts === () => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) >() => 0 : () => number ->0 : number +>0 : 0 var y = 0; >y : number ->0 : number +>0 : 0 (()=>0); >(()=>0) : () => number >()=>0 : () => number ->0 : number +>0 : 0 var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/letConstInCaseClauses.errors.txt b/tests/baselines/reference/letConstInCaseClauses.errors.txt index af0777d56a440..754da95d367c8 100644 --- a/tests/baselines/reference/letConstInCaseClauses.errors.txt +++ b/tests/baselines/reference/letConstInCaseClauses.errors.txt @@ -1,8 +1,10 @@ tests/cases/compiler/letConstInCaseClauses.ts(7,5): error TS2304: Cannot find name 'console'. tests/cases/compiler/letConstInCaseClauses.ts(21,5): error TS2304: Cannot find name 'console'. +tests/cases/compiler/letConstInCaseClauses.ts(23,14): error TS2678: Type '10' is not comparable to type '1'. +tests/cases/compiler/letConstInCaseClauses.ts(27,14): error TS2678: Type '10' is not comparable to type '2'. -==== tests/cases/compiler/letConstInCaseClauses.ts (2 errors) ==== +==== tests/cases/compiler/letConstInCaseClauses.ts (4 errors) ==== var x = 10; var y = 20; @@ -30,10 +32,14 @@ tests/cases/compiler/letConstInCaseClauses.ts(21,5): error TS2304: Cannot find n !!! error TS2304: Cannot find name 'console'. switch (x) { case 10: + ~~ +!!! error TS2678: Type '10' is not comparable to type '1'. const x = 20; } switch (y) { case 10: + ~~ +!!! error TS2678: Type '10' is not comparable to type '2'. const y = 20; } } \ No newline at end of file diff --git a/tests/baselines/reference/letConstMatchingParameterNames.types b/tests/baselines/reference/letConstMatchingParameterNames.types index 2e29dff289b49..acf508f77a3dc 100644 --- a/tests/baselines/reference/letConstMatchingParameterNames.types +++ b/tests/baselines/reference/letConstMatchingParameterNames.types @@ -1,11 +1,11 @@ === tests/cases/compiler/letConstMatchingParameterNames.ts === let parent = true; >parent : boolean ->true : boolean +>true : true const parent2 = true; ->parent2 : boolean ->true : boolean +>parent2 : true +>true : true declare function use(a: any); >use : (a: any) => any @@ -16,11 +16,11 @@ function a() { let parent = 1; >parent : number ->1 : number +>1 : 1 const parent2 = 2; ->parent2 : number ->2 : number +>parent2 : 2 +>2 : 2 function b(parent: string, parent2: number) { >b : (parent: string, parent2: number) => void diff --git a/tests/baselines/reference/letDeclarations-access.types b/tests/baselines/reference/letDeclarations-access.types index 673fc97f80bd3..b2f984a4956f8 100644 --- a/tests/baselines/reference/letDeclarations-access.types +++ b/tests/baselines/reference/letDeclarations-access.types @@ -2,69 +2,69 @@ let x = 0 >x : number ->0 : number +>0 : 0 // No errors x = 1; ->x = 1 : number +>x = 1 : 1 >x : number ->1 : number +>1 : 1 x += 2; >x += 2 : number >x : number ->2 : number +>2 : 2 x -= 3; >x -= 3 : number >x : number ->3 : number +>3 : 3 x *= 4; >x *= 4 : number >x : number ->4 : number +>4 : 4 x /= 5; >x /= 5 : number >x : number ->5 : number +>5 : 5 x %= 6; >x %= 6 : number >x : number ->6 : number +>6 : 6 x <<= 7; >x <<= 7 : number >x : number ->7 : number +>7 : 7 x >>= 8; >x >>= 8 : number >x : number ->8 : number +>8 : 8 x >>>= 9; >x >>>= 9 : number >x : number ->9 : number +>9 : 9 x &= 10; >x &= 10 : number >x : number ->10 : number +>10 : 10 x |= 11; >x |= 11 : number >x : number ->11 : number +>11 : 11 x ^= 12; >x ^= 12 : number >x : number ->12 : number +>12 : 12 x++; >x++ : number @@ -86,7 +86,7 @@ var a = x + 1; >a : number >x + 1 : number >x : number ->1 : number +>1 : 1 function f(v: number) { } >f : (v: number) => void diff --git a/tests/baselines/reference/letDeclarations-es5-1.types b/tests/baselines/reference/letDeclarations-es5-1.types index b088677cd0a15..31506b717a9b5 100644 --- a/tests/baselines/reference/letDeclarations-es5-1.types +++ b/tests/baselines/reference/letDeclarations-es5-1.types @@ -13,17 +13,17 @@ let l7 = false; >l7 : boolean ->false : boolean +>false : false let l8: number = 23; >l8 : number ->23 : number +>23 : 23 let l9 = 0, l10 :string = "", l11 = null; >l9 : number ->0 : number +>0 : 0 >l10 : string ->"" : string +>"" : "" >l11 : any >null : null diff --git a/tests/baselines/reference/letDeclarations-es5.types b/tests/baselines/reference/letDeclarations-es5.types index f6e8d418632d0..9756951e705b1 100644 --- a/tests/baselines/reference/letDeclarations-es5.types +++ b/tests/baselines/reference/letDeclarations-es5.types @@ -14,17 +14,17 @@ let l3, l4, l5 :string, l6; let l7 = false; >l7 : boolean ->false : boolean +>false : false let l8: number = 23; >l8 : number ->23 : number +>23 : 23 let l9 = 0, l10 :string = "", l11 = null; >l9 : number ->0 : number +>0 : 0 >l10 : string ->"" : string +>"" : "" >l11 : any >null : null @@ -34,10 +34,10 @@ for(let l11 in {}) { } for(let l12 = 0; l12 < 9; l12++) { } >l12 : number ->0 : number +>0 : 0 >l12 < 9 : boolean >l12 : number ->9 : number +>9 : 9 >l12++ : number >l12 : number diff --git a/tests/baselines/reference/letDeclarations.types b/tests/baselines/reference/letDeclarations.types index bb20f895a14c5..b1548f788effe 100644 --- a/tests/baselines/reference/letDeclarations.types +++ b/tests/baselines/reference/letDeclarations.types @@ -14,17 +14,17 @@ let l3, l4, l5 :string, l6; let l7 = false; >l7 : boolean ->false : boolean +>false : false let l8: number = 23; >l8 : number ->23 : number +>23 : 23 let l9 = 0, l10 :string = "", l11 = null; >l9 : number ->0 : number +>0 : 0 >l10 : string ->"" : string +>"" : "" >l11 : any >null : null @@ -34,10 +34,10 @@ for(let l11 in {}) { } for(let l12 = 0; l12 < 9; l12++) { } >l12 : number ->0 : number +>0 : 0 >l12 < 9 : boolean >l12 : number ->9 : number +>9 : 9 >l12++ : number >l12 : number diff --git a/tests/baselines/reference/letDeclarations2.types b/tests/baselines/reference/letDeclarations2.types index eeb66838a6a7c..893514adb3f32 100644 --- a/tests/baselines/reference/letDeclarations2.types +++ b/tests/baselines/reference/letDeclarations2.types @@ -5,9 +5,9 @@ module M { let l1 = "s"; >l1 : string ->"s" : string +>"s" : "s" export let l2 = 0; >l2 : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/letIdentifierInElementAccess01.types b/tests/baselines/reference/letIdentifierInElementAccess01.types index 187fd7e221cbf..d169daa0307df 100644 --- a/tests/baselines/reference/letIdentifierInElementAccess01.types +++ b/tests/baselines/reference/letIdentifierInElementAccess01.types @@ -4,10 +4,10 @@ var let: any = {}; >{} : {} (let[0] = 100); ->(let[0] = 100) : number ->let[0] = 100 : number +>(let[0] = 100) : 100 +>let[0] = 100 : 100 >let[0] : any >let : any ->0 : number ->100 : number +>0 : 0 +>100 : 100 diff --git a/tests/baselines/reference/letInNonStrictMode.types b/tests/baselines/reference/letInNonStrictMode.types index ceb59dba6a34f..d37f7fe20a38f 100644 --- a/tests/baselines/reference/letInNonStrictMode.types +++ b/tests/baselines/reference/letInNonStrictMode.types @@ -2,12 +2,12 @@ let [x] = [1]; >x : number >[1] : [number] ->1 : number +>1 : 1 let {a: y} = {a: 1}; >a : any >y : number >{a: 1} : { a: number; } >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/letInVarDeclOfForIn_ES5.types b/tests/baselines/reference/letInVarDeclOfForIn_ES5.types index 095ae16b91e9d..d3751f5895950 100644 --- a/tests/baselines/reference/letInVarDeclOfForIn_ES5.types +++ b/tests/baselines/reference/letInVarDeclOfForIn_ES5.types @@ -4,16 +4,16 @@ for (var let in [1,2,3]) {} >let : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 { for (var let in [1,2,3]) {} >let : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 } diff --git a/tests/baselines/reference/letInVarDeclOfForIn_ES6.types b/tests/baselines/reference/letInVarDeclOfForIn_ES6.types index a5e2ce108db14..1d672c12ea67f 100644 --- a/tests/baselines/reference/letInVarDeclOfForIn_ES6.types +++ b/tests/baselines/reference/letInVarDeclOfForIn_ES6.types @@ -4,16 +4,16 @@ for (var let in [1,2,3]) {} >let : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 { for (var let in [1,2,3]) {} >let : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 } diff --git a/tests/baselines/reference/letInVarDeclOfForOf_ES5.types b/tests/baselines/reference/letInVarDeclOfForOf_ES5.types index a1000df8bed78..6b1648dcaf364 100644 --- a/tests/baselines/reference/letInVarDeclOfForOf_ES5.types +++ b/tests/baselines/reference/letInVarDeclOfForOf_ES5.types @@ -4,16 +4,16 @@ for (var let of [1,2,3]) {} >let : number >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 { for (var let of [1,2,3]) {} >let : number >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 } diff --git a/tests/baselines/reference/letInVarDeclOfForOf_ES6.types b/tests/baselines/reference/letInVarDeclOfForOf_ES6.types index 1515895fedaba..3231dbc0b2c33 100644 --- a/tests/baselines/reference/letInVarDeclOfForOf_ES6.types +++ b/tests/baselines/reference/letInVarDeclOfForOf_ES6.types @@ -4,16 +4,16 @@ for (var let of [1,2,3]) {} >let : number >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 { for (var let of [1,2,3]) {} >let : number >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 } diff --git a/tests/baselines/reference/library_ArraySlice.types b/tests/baselines/reference/library_ArraySlice.types index b92d925439013..5fe3858628acb 100644 --- a/tests/baselines/reference/library_ArraySlice.types +++ b/tests/baselines/reference/library_ArraySlice.types @@ -15,7 +15,7 @@ Array.prototype.slice(0); >Array : ArrayConstructor >prototype : any[] >slice : (start?: number, end?: number) => any[] ->0 : number +>0 : 0 Array.prototype.slice(0, 1); >Array.prototype.slice(0, 1) : any[] @@ -24,6 +24,6 @@ Array.prototype.slice(0, 1); >Array : ArrayConstructor >prototype : any[] >slice : (start?: number, end?: number) => any[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/library_DatePrototypeProperties.types b/tests/baselines/reference/library_DatePrototypeProperties.types index c048b9833d659..6a299f6723210 100644 --- a/tests/baselines/reference/library_DatePrototypeProperties.types +++ b/tests/baselines/reference/library_DatePrototypeProperties.types @@ -215,7 +215,7 @@ Date.prototype.setTime(0); >Date : DateConstructor >prototype : Date >setTime : (time: number) => number ->0 : number +>0 : 0 Date.prototype.setMilliseconds(0); >Date.prototype.setMilliseconds(0) : number @@ -224,7 +224,7 @@ Date.prototype.setMilliseconds(0); >Date : DateConstructor >prototype : Date >setMilliseconds : (ms: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCMilliseconds(0); >Date.prototype.setUTCMilliseconds(0) : number @@ -233,7 +233,7 @@ Date.prototype.setUTCMilliseconds(0); >Date : DateConstructor >prototype : Date >setUTCMilliseconds : (ms: number) => number ->0 : number +>0 : 0 Date.prototype.setSeconds(0); >Date.prototype.setSeconds(0) : number @@ -242,7 +242,7 @@ Date.prototype.setSeconds(0); >Date : DateConstructor >prototype : Date >setSeconds : (sec: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCSeconds(0); >Date.prototype.setUTCSeconds(0) : number @@ -251,7 +251,7 @@ Date.prototype.setUTCSeconds(0); >Date : DateConstructor >prototype : Date >setUTCSeconds : (sec: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setMinutes(0); >Date.prototype.setMinutes(0) : number @@ -260,7 +260,7 @@ Date.prototype.setMinutes(0); >Date : DateConstructor >prototype : Date >setMinutes : (min: number, sec?: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCMinutes(0); >Date.prototype.setUTCMinutes(0) : number @@ -269,7 +269,7 @@ Date.prototype.setUTCMinutes(0); >Date : DateConstructor >prototype : Date >setUTCMinutes : (min: number, sec?: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setHours(0); >Date.prototype.setHours(0) : number @@ -278,7 +278,7 @@ Date.prototype.setHours(0); >Date : DateConstructor >prototype : Date >setHours : (hours: number, min?: number, sec?: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCHours(0); >Date.prototype.setUTCHours(0) : number @@ -287,7 +287,7 @@ Date.prototype.setUTCHours(0); >Date : DateConstructor >prototype : Date >setUTCHours : (hours: number, min?: number, sec?: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setDate(0); >Date.prototype.setDate(0) : number @@ -296,7 +296,7 @@ Date.prototype.setDate(0); >Date : DateConstructor >prototype : Date >setDate : (date: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCDate(0); >Date.prototype.setUTCDate(0) : number @@ -305,7 +305,7 @@ Date.prototype.setUTCDate(0); >Date : DateConstructor >prototype : Date >setUTCDate : (date: number) => number ->0 : number +>0 : 0 Date.prototype.setMonth(0); >Date.prototype.setMonth(0) : number @@ -314,7 +314,7 @@ Date.prototype.setMonth(0); >Date : DateConstructor >prototype : Date >setMonth : (month: number, date?: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCMonth(0); >Date.prototype.setUTCMonth(0) : number @@ -323,7 +323,7 @@ Date.prototype.setUTCMonth(0); >Date : DateConstructor >prototype : Date >setUTCMonth : (month: number, date?: number) => number ->0 : number +>0 : 0 Date.prototype.setFullYear(0); >Date.prototype.setFullYear(0) : number @@ -332,7 +332,7 @@ Date.prototype.setFullYear(0); >Date : DateConstructor >prototype : Date >setFullYear : (year: number, month?: number, date?: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCFullYear(0); >Date.prototype.setUTCFullYear(0) : number @@ -341,7 +341,7 @@ Date.prototype.setUTCFullYear(0); >Date : DateConstructor >prototype : Date >setUTCFullYear : (year: number, month?: number, date?: number) => number ->0 : number +>0 : 0 Date.prototype.toUTCString(); >Date.prototype.toUTCString() : string diff --git a/tests/baselines/reference/library_ObjectPrototypeProperties.types b/tests/baselines/reference/library_ObjectPrototypeProperties.types index 616a9da633bd3..2f41dd7c1eb3f 100644 --- a/tests/baselines/reference/library_ObjectPrototypeProperties.types +++ b/tests/baselines/reference/library_ObjectPrototypeProperties.types @@ -39,7 +39,7 @@ Object.prototype.hasOwnProperty("string"); >Object : ObjectConstructor >prototype : Object >hasOwnProperty : (v: string) => boolean ->"string" : string +>"string" : "string" Object.prototype.isPrototypeOf(Object); >Object.prototype.isPrototypeOf(Object) : boolean @@ -57,5 +57,5 @@ Object.prototype.propertyIsEnumerable("string"); >Object : ObjectConstructor >prototype : Object >propertyIsEnumerable : (v: string) => boolean ->"string" : string +>"string" : "string" diff --git a/tests/baselines/reference/library_RegExpExecArraySlice.types b/tests/baselines/reference/library_RegExpExecArraySlice.types index b4673adb98835..0fd2a319833af 100644 --- a/tests/baselines/reference/library_RegExpExecArraySlice.types +++ b/tests/baselines/reference/library_RegExpExecArraySlice.types @@ -15,13 +15,13 @@ regExpExecArrayValue.slice(0); >regExpExecArrayValue.slice : (start?: number, end?: number) => string[] >regExpExecArrayValue : RegExpExecArray >slice : (start?: number, end?: number) => string[] ->0 : number +>0 : 0 regExpExecArrayValue.slice(0,1); >regExpExecArrayValue.slice(0,1) : string[] >regExpExecArrayValue.slice : (start?: number, end?: number) => string[] >regExpExecArrayValue : RegExpExecArray >slice : (start?: number, end?: number) => string[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/library_StringSlice.types b/tests/baselines/reference/library_StringSlice.types index 09b2a0b399594..a4f8e2e98e936 100644 --- a/tests/baselines/reference/library_StringSlice.types +++ b/tests/baselines/reference/library_StringSlice.types @@ -15,7 +15,7 @@ String.prototype.slice(0); >String : StringConstructor >prototype : String >slice : (start?: number, end?: number) => string ->0 : number +>0 : 0 String.prototype.slice(0,1); >String.prototype.slice(0,1) : string @@ -24,6 +24,6 @@ String.prototype.slice(0,1); >String : StringConstructor >prototype : String >slice : (start?: number, end?: number) => string ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/literalTypes2.js b/tests/baselines/reference/literalTypes2.js new file mode 100644 index 0000000000000..415129b2d9bea --- /dev/null +++ b/tests/baselines/reference/literalTypes2.js @@ -0,0 +1,348 @@ +//// [literalTypes2.ts] +enum E { + A, B, C +} + +let cond: boolean; + +function f1(p1 = 1, p2 = "abc", p3 = true, p4 = E.A) { + var v1 = 1; + var v2 = -123; + var v3 = 3 + 4; + var v4 = "abc"; + var v5 = ""; + var v6 = "abc" + "def"; + var v7 = true; + var v8 = E.A; + let x1 = 1; + let x2 = -123; + let x3 = 3 + 4; + let x4 = "abc"; + let x5 = ""; + let x6 = "abc" + "def"; + let x7 = true; + var x8 = E.A; + const c1 = 1; + const c2 = -123; + const c3 = 3 + 4; + const c4 = "abc"; + const c5 = ""; + const c6 = "abc" + "def"; + const c7 = true; + const c8 = E.A; +} + +function f2(p1: 1 = 1, p2: "abc" = "abc", p3: true = true, p4: E.A = E.A) { + var v1: 1 = 1; + var v2: -123 = -123; + var v3: "abc" = "abc"; + var v4: true = true; + var v5: E.A = E.A; + let x1: 1 = 1; + let x2: -123 = -123; + let x3: "abc" = "abc"; + let x4: true = true; + let x5: E.A = E.A; +} + +function f3() { + const c1 = cond ? 1 : 2; + const c2 = cond ? 1 : "two"; + const c3 = cond ? E.A : cond ? true : 123; + const c4 = cond ? "abc" : null; + const c5 = cond ? 456 : undefined; + const c6: { kind: 123 } = { kind: 123 }; + const c7: [1 | 2, "foo" | "bar"] = [1, "bar"]; + const c8 = cond ? c6 : cond ? c7 : "hello"; + let x1 = c1; + let x2 = c2; + let x3 = c3; + let x4 = c4; + let x5 = c5; + let x6 = c6; + let x7 = c7; + let x8 = c8; +} + +class C1 { + x1 = 1; + x2 = -123; + x3 = 3 + 4; + x4 = "abc"; + x5 = ""; + x6 = "abc" + "def"; + x7 = true; + x8 = E.A; + readonly c1 = 1; + readonly c2 = -123; + readonly c3 = 3 + 4; + readonly c4 = "abc"; + readonly c5 = ""; + readonly c6 = "abc" + "def"; + readonly c7 = true; + readonly c8 = E.A; +} + +function f4() { + const c1 = { a: 1, b: "foo" }; + const c2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; + let x1 = { a: 1, b: "foo" }; + let x2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; +} + +function f5() { + const c1 = [1, "foo"]; + const c2: (1 | "foo")[] = [1, "foo"]; + const c3: [1, "foo"] = [1, "foo"]; + let x1 = [1, "foo"]; + let x2: (1 | "foo")[] = [1, "foo"]; + let x3: [1, "foo"] = [1, "foo"]; +} + +function f6() { + const { c1 = true, c2 = 0, c3 = "foo" } = { c1: false, c2: 1, c3: "bar" }; + let { x1 = true, x2 = 0, x3 = "foo" } = { x1: false, x2: 1, x3: "bar" }; +} + +function f10() { + return "hello"; +} + +function f11() { + return cond ? 1 : "two"; +} + +function f12() { + if (cond) { + return 1; + } + else { + return "two"; + } +} + +class C2 { + foo() { + return 0; + } + bar() { + return cond ? 0 : 1; + } +} + +function f20() { + const f1 = () => 0; + const f2 = () => "hello"; + const f3 = () => true; + const f4 = () => E.C; + const f5 = (): "foo" => "foo"; + const f6: () => "foo" | "bar" = () => "bar"; + const f7: (() => "foo") | (() => "bar") = () => "bar"; +} + +declare function g1(x: T): T; +declare function g2(x: T, y: T): T; +declare function g3(x: T, y: U): T | U; +declare function g4(x: T): T[]; +declare function g5(x: T, y: T): T[]; +declare function g6(x: T[]): T; +declare function g7(x: T[]): T[]; +declare function g8(x: T, f: (p: T) => T): T; + +const a: (1 | 2)[] = [1, 2]; + +const x1 = g1(1); // Type 1 +const x2 = g2(1, 1); // Type 1 +const x3 = g2(1, 2); // Type 1 | 2 +const x4 = g3(1, "two"); // Type 1 | "two" +const x5 = g4(1); // Type number[] +const x6 = g5(1, 2); // Type (1 | 2)[] +const x7 = g6([1, 2]); // Type number +const x8 = g6(a); // Type 1 | 2 +const x9 = g7(a); // Type (1 | 2)[] +const x10 = g8(1, x => x); // Type number +const x11 = g8(1, x => x + 1); // Type number + +function makeArray(x: T): T[] { + return [x]; +} + +function append(a: T[], x: T): T[] { + let result = a.slice(); + result.push(x); + return result; +} + +type Bit = 0 | 1; + +let aa = makeArray(0); +aa = append(aa, 1); + + +//// [literalTypes2.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; + E[E["C"] = 2] = "C"; +})(E || (E = {})); +var cond; +function f1(p1, p2, p3, p4) { + if (p1 === void 0) { p1 = 1; } + if (p2 === void 0) { p2 = "abc"; } + if (p3 === void 0) { p3 = true; } + if (p4 === void 0) { p4 = E.A; } + var v1 = 1; + var v2 = -123; + var v3 = 3 + 4; + var v4 = "abc"; + var v5 = ""; + var v6 = "abc" + "def"; + var v7 = true; + var v8 = E.A; + var x1 = 1; + var x2 = -123; + var x3 = 3 + 4; + var x4 = "abc"; + var x5 = ""; + var x6 = "abc" + "def"; + var x7 = true; + var x8 = E.A; + var c1 = 1; + var c2 = -123; + var c3 = 3 + 4; + var c4 = "abc"; + var c5 = ""; + var c6 = "abc" + "def"; + var c7 = true; + var c8 = E.A; +} +function f2(p1, p2, p3, p4) { + if (p1 === void 0) { p1 = 1; } + if (p2 === void 0) { p2 = "abc"; } + if (p3 === void 0) { p3 = true; } + if (p4 === void 0) { p4 = E.A; } + var v1 = 1; + var v2 = -123; + var v3 = "abc"; + var v4 = true; + var v5 = E.A; + var x1 = 1; + var x2 = -123; + var x3 = "abc"; + var x4 = true; + var x5 = E.A; +} +function f3() { + var c1 = cond ? 1 : 2; + var c2 = cond ? 1 : "two"; + var c3 = cond ? E.A : cond ? true : 123; + var c4 = cond ? "abc" : null; + var c5 = cond ? 456 : undefined; + var c6 = { kind: 123 }; + var c7 = [1, "bar"]; + var c8 = cond ? c6 : cond ? c7 : "hello"; + var x1 = c1; + var x2 = c2; + var x3 = c3; + var x4 = c4; + var x5 = c5; + var x6 = c6; + var x7 = c7; + var x8 = c8; +} +var C1 = (function () { + function C1() { + this.x1 = 1; + this.x2 = -123; + this.x3 = 3 + 4; + this.x4 = "abc"; + this.x5 = ""; + this.x6 = "abc" + "def"; + this.x7 = true; + this.x8 = E.A; + this.c1 = 1; + this.c2 = -123; + this.c3 = 3 + 4; + this.c4 = "abc"; + this.c5 = ""; + this.c6 = "abc" + "def"; + this.c7 = true; + this.c8 = E.A; + } + return C1; +}()); +function f4() { + var c1 = { a: 1, b: "foo" }; + var c2 = { a: 1, b: "foo" }; + var x1 = { a: 1, b: "foo" }; + var x2 = { a: 1, b: "foo" }; +} +function f5() { + var c1 = [1, "foo"]; + var c2 = [1, "foo"]; + var c3 = [1, "foo"]; + var x1 = [1, "foo"]; + var x2 = [1, "foo"]; + var x3 = [1, "foo"]; +} +function f6() { + var _a = { c1: false, c2: 1, c3: "bar" }, _b = _a.c1, c1 = _b === void 0 ? true : _b, _c = _a.c2, c2 = _c === void 0 ? 0 : _c, _d = _a.c3, c3 = _d === void 0 ? "foo" : _d; + var _e = { x1: false, x2: 1, x3: "bar" }, _f = _e.x1, x1 = _f === void 0 ? true : _f, _g = _e.x2, x2 = _g === void 0 ? 0 : _g, _h = _e.x3, x3 = _h === void 0 ? "foo" : _h; +} +function f10() { + return "hello"; +} +function f11() { + return cond ? 1 : "two"; +} +function f12() { + if (cond) { + return 1; + } + else { + return "two"; + } +} +var C2 = (function () { + function C2() { + } + C2.prototype.foo = function () { + return 0; + }; + C2.prototype.bar = function () { + return cond ? 0 : 1; + }; + return C2; +}()); +function f20() { + var f1 = function () { return 0; }; + var f2 = function () { return "hello"; }; + var f3 = function () { return true; }; + var f4 = function () { return E.C; }; + var f5 = function () { return "foo"; }; + var f6 = function () { return "bar"; }; + var f7 = function () { return "bar"; }; +} +var a = [1, 2]; +var x1 = g1(1); // Type 1 +var x2 = g2(1, 1); // Type 1 +var x3 = g2(1, 2); // Type 1 | 2 +var x4 = g3(1, "two"); // Type 1 | "two" +var x5 = g4(1); // Type number[] +var x6 = g5(1, 2); // Type (1 | 2)[] +var x7 = g6([1, 2]); // Type number +var x8 = g6(a); // Type 1 | 2 +var x9 = g7(a); // Type (1 | 2)[] +var x10 = g8(1, function (x) { return x; }); // Type number +var x11 = g8(1, function (x) { return x + 1; }); // Type number +function makeArray(x) { + return [x]; +} +function append(a, x) { + var result = a.slice(); + result.push(x); + return result; +} +var aa = makeArray(0); +aa = append(aa, 1); diff --git a/tests/baselines/reference/literalTypes2.symbols b/tests/baselines/reference/literalTypes2.symbols new file mode 100644 index 0000000000000..a59a91eeb1a59 --- /dev/null +++ b/tests/baselines/reference/literalTypes2.symbols @@ -0,0 +1,602 @@ +=== tests/cases/conformance/types/literal/literalTypes2.ts === +enum E { +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) + + A, B, C +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>B : Symbol(E.B, Decl(literalTypes2.ts, 1, 6)) +>C : Symbol(E.C, Decl(literalTypes2.ts, 1, 9)) +} + +let cond: boolean; +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + +function f1(p1 = 1, p2 = "abc", p3 = true, p4 = E.A) { +>f1 : Symbol(f1, Decl(literalTypes2.ts, 4, 18)) +>p1 : Symbol(p1, Decl(literalTypes2.ts, 6, 12)) +>p2 : Symbol(p2, Decl(literalTypes2.ts, 6, 19)) +>p3 : Symbol(p3, Decl(literalTypes2.ts, 6, 31)) +>p4 : Symbol(p4, Decl(literalTypes2.ts, 6, 42)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + var v1 = 1; +>v1 : Symbol(v1, Decl(literalTypes2.ts, 7, 7)) + + var v2 = -123; +>v2 : Symbol(v2, Decl(literalTypes2.ts, 8, 7)) + + var v3 = 3 + 4; +>v3 : Symbol(v3, Decl(literalTypes2.ts, 9, 7)) + + var v4 = "abc"; +>v4 : Symbol(v4, Decl(literalTypes2.ts, 10, 7)) + + var v5 = ""; +>v5 : Symbol(v5, Decl(literalTypes2.ts, 11, 7)) + + var v6 = "abc" + "def"; +>v6 : Symbol(v6, Decl(literalTypes2.ts, 12, 7)) + + var v7 = true; +>v7 : Symbol(v7, Decl(literalTypes2.ts, 13, 7)) + + var v8 = E.A; +>v8 : Symbol(v8, Decl(literalTypes2.ts, 14, 7)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + let x1 = 1; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 15, 7)) + + let x2 = -123; +>x2 : Symbol(x2, Decl(literalTypes2.ts, 16, 7)) + + let x3 = 3 + 4; +>x3 : Symbol(x3, Decl(literalTypes2.ts, 17, 7)) + + let x4 = "abc"; +>x4 : Symbol(x4, Decl(literalTypes2.ts, 18, 7)) + + let x5 = ""; +>x5 : Symbol(x5, Decl(literalTypes2.ts, 19, 7)) + + let x6 = "abc" + "def"; +>x6 : Symbol(x6, Decl(literalTypes2.ts, 20, 7)) + + let x7 = true; +>x7 : Symbol(x7, Decl(literalTypes2.ts, 21, 7)) + + var x8 = E.A; +>x8 : Symbol(x8, Decl(literalTypes2.ts, 22, 7)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + const c1 = 1; +>c1 : Symbol(c1, Decl(literalTypes2.ts, 23, 9)) + + const c2 = -123; +>c2 : Symbol(c2, Decl(literalTypes2.ts, 24, 9)) + + const c3 = 3 + 4; +>c3 : Symbol(c3, Decl(literalTypes2.ts, 25, 9)) + + const c4 = "abc"; +>c4 : Symbol(c4, Decl(literalTypes2.ts, 26, 9)) + + const c5 = ""; +>c5 : Symbol(c5, Decl(literalTypes2.ts, 27, 9)) + + const c6 = "abc" + "def"; +>c6 : Symbol(c6, Decl(literalTypes2.ts, 28, 9)) + + const c7 = true; +>c7 : Symbol(c7, Decl(literalTypes2.ts, 29, 9)) + + const c8 = E.A; +>c8 : Symbol(c8, Decl(literalTypes2.ts, 30, 9)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +} + +function f2(p1: 1 = 1, p2: "abc" = "abc", p3: true = true, p4: E.A = E.A) { +>f2 : Symbol(f2, Decl(literalTypes2.ts, 31, 1)) +>p1 : Symbol(p1, Decl(literalTypes2.ts, 33, 12)) +>p2 : Symbol(p2, Decl(literalTypes2.ts, 33, 22)) +>p3 : Symbol(p3, Decl(literalTypes2.ts, 33, 41)) +>p4 : Symbol(p4, Decl(literalTypes2.ts, 33, 58)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + var v1: 1 = 1; +>v1 : Symbol(v1, Decl(literalTypes2.ts, 34, 7)) + + var v2: -123 = -123; +>v2 : Symbol(v2, Decl(literalTypes2.ts, 35, 7)) + + var v3: "abc" = "abc"; +>v3 : Symbol(v3, Decl(literalTypes2.ts, 36, 7)) + + var v4: true = true; +>v4 : Symbol(v4, Decl(literalTypes2.ts, 37, 7)) + + var v5: E.A = E.A; +>v5 : Symbol(v5, Decl(literalTypes2.ts, 38, 7)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + let x1: 1 = 1; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 39, 7)) + + let x2: -123 = -123; +>x2 : Symbol(x2, Decl(literalTypes2.ts, 40, 7)) + + let x3: "abc" = "abc"; +>x3 : Symbol(x3, Decl(literalTypes2.ts, 41, 7)) + + let x4: true = true; +>x4 : Symbol(x4, Decl(literalTypes2.ts, 42, 7)) + + let x5: E.A = E.A; +>x5 : Symbol(x5, Decl(literalTypes2.ts, 43, 7)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +} + +function f3() { +>f3 : Symbol(f3, Decl(literalTypes2.ts, 44, 1)) + + const c1 = cond ? 1 : 2; +>c1 : Symbol(c1, Decl(literalTypes2.ts, 47, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + + const c2 = cond ? 1 : "two"; +>c2 : Symbol(c2, Decl(literalTypes2.ts, 48, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + + const c3 = cond ? E.A : cond ? true : 123; +>c3 : Symbol(c3, Decl(literalTypes2.ts, 49, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + + const c4 = cond ? "abc" : null; +>c4 : Symbol(c4, Decl(literalTypes2.ts, 50, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + + const c5 = cond ? 456 : undefined; +>c5 : Symbol(c5, Decl(literalTypes2.ts, 51, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) +>undefined : Symbol(undefined) + + const c6: { kind: 123 } = { kind: 123 }; +>c6 : Symbol(c6, Decl(literalTypes2.ts, 52, 9)) +>kind : Symbol(kind, Decl(literalTypes2.ts, 52, 15)) +>kind : Symbol(kind, Decl(literalTypes2.ts, 52, 31)) + + const c7: [1 | 2, "foo" | "bar"] = [1, "bar"]; +>c7 : Symbol(c7, Decl(literalTypes2.ts, 53, 9)) + + const c8 = cond ? c6 : cond ? c7 : "hello"; +>c8 : Symbol(c8, Decl(literalTypes2.ts, 54, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) +>c6 : Symbol(c6, Decl(literalTypes2.ts, 52, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) +>c7 : Symbol(c7, Decl(literalTypes2.ts, 53, 9)) + + let x1 = c1; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 55, 7)) +>c1 : Symbol(c1, Decl(literalTypes2.ts, 47, 9)) + + let x2 = c2; +>x2 : Symbol(x2, Decl(literalTypes2.ts, 56, 7)) +>c2 : Symbol(c2, Decl(literalTypes2.ts, 48, 9)) + + let x3 = c3; +>x3 : Symbol(x3, Decl(literalTypes2.ts, 57, 7)) +>c3 : Symbol(c3, Decl(literalTypes2.ts, 49, 9)) + + let x4 = c4; +>x4 : Symbol(x4, Decl(literalTypes2.ts, 58, 7)) +>c4 : Symbol(c4, Decl(literalTypes2.ts, 50, 9)) + + let x5 = c5; +>x5 : Symbol(x5, Decl(literalTypes2.ts, 59, 7)) +>c5 : Symbol(c5, Decl(literalTypes2.ts, 51, 9)) + + let x6 = c6; +>x6 : Symbol(x6, Decl(literalTypes2.ts, 60, 7)) +>c6 : Symbol(c6, Decl(literalTypes2.ts, 52, 9)) + + let x7 = c7; +>x7 : Symbol(x7, Decl(literalTypes2.ts, 61, 7)) +>c7 : Symbol(c7, Decl(literalTypes2.ts, 53, 9)) + + let x8 = c8; +>x8 : Symbol(x8, Decl(literalTypes2.ts, 62, 7)) +>c8 : Symbol(c8, Decl(literalTypes2.ts, 54, 9)) +} + +class C1 { +>C1 : Symbol(C1, Decl(literalTypes2.ts, 63, 1)) + + x1 = 1; +>x1 : Symbol(C1.x1, Decl(literalTypes2.ts, 65, 10)) + + x2 = -123; +>x2 : Symbol(C1.x2, Decl(literalTypes2.ts, 66, 11)) + + x3 = 3 + 4; +>x3 : Symbol(C1.x3, Decl(literalTypes2.ts, 67, 14)) + + x4 = "abc"; +>x4 : Symbol(C1.x4, Decl(literalTypes2.ts, 68, 15)) + + x5 = ""; +>x5 : Symbol(C1.x5, Decl(literalTypes2.ts, 69, 15)) + + x6 = "abc" + "def"; +>x6 : Symbol(C1.x6, Decl(literalTypes2.ts, 70, 12)) + + x7 = true; +>x7 : Symbol(C1.x7, Decl(literalTypes2.ts, 71, 23)) + + x8 = E.A; +>x8 : Symbol(C1.x8, Decl(literalTypes2.ts, 72, 14)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + readonly c1 = 1; +>c1 : Symbol(C1.c1, Decl(literalTypes2.ts, 73, 13)) + + readonly c2 = -123; +>c2 : Symbol(C1.c2, Decl(literalTypes2.ts, 74, 20)) + + readonly c3 = 3 + 4; +>c3 : Symbol(C1.c3, Decl(literalTypes2.ts, 75, 23)) + + readonly c4 = "abc"; +>c4 : Symbol(C1.c4, Decl(literalTypes2.ts, 76, 24)) + + readonly c5 = ""; +>c5 : Symbol(C1.c5, Decl(literalTypes2.ts, 77, 24)) + + readonly c6 = "abc" + "def"; +>c6 : Symbol(C1.c6, Decl(literalTypes2.ts, 78, 21)) + + readonly c7 = true; +>c7 : Symbol(C1.c7, Decl(literalTypes2.ts, 79, 32)) + + readonly c8 = E.A; +>c8 : Symbol(C1.c8, Decl(literalTypes2.ts, 80, 23)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +} + +function f4() { +>f4 : Symbol(f4, Decl(literalTypes2.ts, 82, 1)) + + const c1 = { a: 1, b: "foo" }; +>c1 : Symbol(c1, Decl(literalTypes2.ts, 85, 9)) +>a : Symbol(a, Decl(literalTypes2.ts, 85, 16)) +>b : Symbol(b, Decl(literalTypes2.ts, 85, 22)) + + const c2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; +>c2 : Symbol(c2, Decl(literalTypes2.ts, 86, 9)) +>a : Symbol(a, Decl(literalTypes2.ts, 86, 15)) +>b : Symbol(b, Decl(literalTypes2.ts, 86, 26)) +>a : Symbol(a, Decl(literalTypes2.ts, 86, 49)) +>b : Symbol(b, Decl(literalTypes2.ts, 86, 55)) + + let x1 = { a: 1, b: "foo" }; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 87, 7)) +>a : Symbol(a, Decl(literalTypes2.ts, 87, 14)) +>b : Symbol(b, Decl(literalTypes2.ts, 87, 20)) + + let x2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; +>x2 : Symbol(x2, Decl(literalTypes2.ts, 88, 7)) +>a : Symbol(a, Decl(literalTypes2.ts, 88, 13)) +>b : Symbol(b, Decl(literalTypes2.ts, 88, 24)) +>a : Symbol(a, Decl(literalTypes2.ts, 88, 47)) +>b : Symbol(b, Decl(literalTypes2.ts, 88, 53)) +} + +function f5() { +>f5 : Symbol(f5, Decl(literalTypes2.ts, 89, 1)) + + const c1 = [1, "foo"]; +>c1 : Symbol(c1, Decl(literalTypes2.ts, 92, 9)) + + const c2: (1 | "foo")[] = [1, "foo"]; +>c2 : Symbol(c2, Decl(literalTypes2.ts, 93, 9)) + + const c3: [1, "foo"] = [1, "foo"]; +>c3 : Symbol(c3, Decl(literalTypes2.ts, 94, 9)) + + let x1 = [1, "foo"]; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 95, 7)) + + let x2: (1 | "foo")[] = [1, "foo"]; +>x2 : Symbol(x2, Decl(literalTypes2.ts, 96, 7)) + + let x3: [1, "foo"] = [1, "foo"]; +>x3 : Symbol(x3, Decl(literalTypes2.ts, 97, 7)) +} + +function f6() { +>f6 : Symbol(f6, Decl(literalTypes2.ts, 98, 1)) + + const { c1 = true, c2 = 0, c3 = "foo" } = { c1: false, c2: 1, c3: "bar" }; +>c1 : Symbol(c1, Decl(literalTypes2.ts, 101, 11)) +>c2 : Symbol(c2, Decl(literalTypes2.ts, 101, 22)) +>c3 : Symbol(c3, Decl(literalTypes2.ts, 101, 30)) +>c1 : Symbol(c1, Decl(literalTypes2.ts, 101, 47)) +>c2 : Symbol(c2, Decl(literalTypes2.ts, 101, 58)) +>c3 : Symbol(c3, Decl(literalTypes2.ts, 101, 65)) + + let { x1 = true, x2 = 0, x3 = "foo" } = { x1: false, x2: 1, x3: "bar" }; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 102, 9)) +>x2 : Symbol(x2, Decl(literalTypes2.ts, 102, 20)) +>x3 : Symbol(x3, Decl(literalTypes2.ts, 102, 28)) +>x1 : Symbol(x1, Decl(literalTypes2.ts, 102, 45)) +>x2 : Symbol(x2, Decl(literalTypes2.ts, 102, 56)) +>x3 : Symbol(x3, Decl(literalTypes2.ts, 102, 63)) +} + +function f10() { +>f10 : Symbol(f10, Decl(literalTypes2.ts, 103, 1)) + + return "hello"; +} + +function f11() { +>f11 : Symbol(f11, Decl(literalTypes2.ts, 107, 1)) + + return cond ? 1 : "two"; +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) +} + +function f12() { +>f12 : Symbol(f12, Decl(literalTypes2.ts, 111, 1)) + + if (cond) { +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + + return 1; + } + else { + return "two"; + } +} + +class C2 { +>C2 : Symbol(C2, Decl(literalTypes2.ts, 120, 1)) + + foo() { +>foo : Symbol(C2.foo, Decl(literalTypes2.ts, 122, 10)) + + return 0; + } + bar() { +>bar : Symbol(C2.bar, Decl(literalTypes2.ts, 125, 5)) + + return cond ? 0 : 1; +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + } +} + +function f20() { +>f20 : Symbol(f20, Decl(literalTypes2.ts, 129, 1)) + + const f1 = () => 0; +>f1 : Symbol(f1, Decl(literalTypes2.ts, 132, 9)) + + const f2 = () => "hello"; +>f2 : Symbol(f2, Decl(literalTypes2.ts, 133, 9)) + + const f3 = () => true; +>f3 : Symbol(f3, Decl(literalTypes2.ts, 134, 9)) + + const f4 = () => E.C; +>f4 : Symbol(f4, Decl(literalTypes2.ts, 135, 9)) +>E.C : Symbol(E.C, Decl(literalTypes2.ts, 1, 9)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>C : Symbol(E.C, Decl(literalTypes2.ts, 1, 9)) + + const f5 = (): "foo" => "foo"; +>f5 : Symbol(f5, Decl(literalTypes2.ts, 136, 9)) + + const f6: () => "foo" | "bar" = () => "bar"; +>f6 : Symbol(f6, Decl(literalTypes2.ts, 137, 9)) + + const f7: (() => "foo") | (() => "bar") = () => "bar"; +>f7 : Symbol(f7, Decl(literalTypes2.ts, 138, 9)) +} + +declare function g1(x: T): T; +>g1 : Symbol(g1, Decl(literalTypes2.ts, 139, 1)) +>T : Symbol(T, Decl(literalTypes2.ts, 141, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 141, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 141, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 141, 20)) + +declare function g2(x: T, y: T): T; +>g2 : Symbol(g2, Decl(literalTypes2.ts, 141, 32)) +>T : Symbol(T, Decl(literalTypes2.ts, 142, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 142, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 142, 20)) +>y : Symbol(y, Decl(literalTypes2.ts, 142, 28)) +>T : Symbol(T, Decl(literalTypes2.ts, 142, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 142, 20)) + +declare function g3(x: T, y: U): T | U; +>g3 : Symbol(g3, Decl(literalTypes2.ts, 142, 38)) +>T : Symbol(T, Decl(literalTypes2.ts, 143, 20)) +>U : Symbol(U, Decl(literalTypes2.ts, 143, 22)) +>x : Symbol(x, Decl(literalTypes2.ts, 143, 26)) +>T : Symbol(T, Decl(literalTypes2.ts, 143, 20)) +>y : Symbol(y, Decl(literalTypes2.ts, 143, 31)) +>U : Symbol(U, Decl(literalTypes2.ts, 143, 22)) +>T : Symbol(T, Decl(literalTypes2.ts, 143, 20)) +>U : Symbol(U, Decl(literalTypes2.ts, 143, 22)) + +declare function g4(x: T): T[]; +>g4 : Symbol(g4, Decl(literalTypes2.ts, 143, 45)) +>T : Symbol(T, Decl(literalTypes2.ts, 144, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 144, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 144, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 144, 20)) + +declare function g5(x: T, y: T): T[]; +>g5 : Symbol(g5, Decl(literalTypes2.ts, 144, 34)) +>T : Symbol(T, Decl(literalTypes2.ts, 145, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 145, 38)) +>T : Symbol(T, Decl(literalTypes2.ts, 145, 20)) +>y : Symbol(y, Decl(literalTypes2.ts, 145, 43)) +>T : Symbol(T, Decl(literalTypes2.ts, 145, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 145, 20)) + +declare function g6(x: T[]): T; +>g6 : Symbol(g6, Decl(literalTypes2.ts, 145, 55)) +>T : Symbol(T, Decl(literalTypes2.ts, 146, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 146, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 146, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 146, 20)) + +declare function g7(x: T[]): T[]; +>g7 : Symbol(g7, Decl(literalTypes2.ts, 146, 34)) +>T : Symbol(T, Decl(literalTypes2.ts, 147, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 147, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 147, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 147, 20)) + +declare function g8(x: T, f: (p: T) => T): T; +>g8 : Symbol(g8, Decl(literalTypes2.ts, 147, 36)) +>T : Symbol(T, Decl(literalTypes2.ts, 148, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 148, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 148, 20)) +>f : Symbol(f, Decl(literalTypes2.ts, 148, 28)) +>p : Symbol(p, Decl(literalTypes2.ts, 148, 33)) +>T : Symbol(T, Decl(literalTypes2.ts, 148, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 148, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 148, 20)) + +const a: (1 | 2)[] = [1, 2]; +>a : Symbol(a, Decl(literalTypes2.ts, 150, 5)) + +const x1 = g1(1); // Type 1 +>x1 : Symbol(x1, Decl(literalTypes2.ts, 152, 5)) +>g1 : Symbol(g1, Decl(literalTypes2.ts, 139, 1)) + +const x2 = g2(1, 1); // Type 1 +>x2 : Symbol(x2, Decl(literalTypes2.ts, 153, 5)) +>g2 : Symbol(g2, Decl(literalTypes2.ts, 141, 32)) + +const x3 = g2(1, 2); // Type 1 | 2 +>x3 : Symbol(x3, Decl(literalTypes2.ts, 154, 5)) +>g2 : Symbol(g2, Decl(literalTypes2.ts, 141, 32)) + +const x4 = g3(1, "two"); // Type 1 | "two" +>x4 : Symbol(x4, Decl(literalTypes2.ts, 155, 5)) +>g3 : Symbol(g3, Decl(literalTypes2.ts, 142, 38)) + +const x5 = g4(1); // Type number[] +>x5 : Symbol(x5, Decl(literalTypes2.ts, 156, 5)) +>g4 : Symbol(g4, Decl(literalTypes2.ts, 143, 45)) + +const x6 = g5(1, 2); // Type (1 | 2)[] +>x6 : Symbol(x6, Decl(literalTypes2.ts, 157, 5)) +>g5 : Symbol(g5, Decl(literalTypes2.ts, 144, 34)) + +const x7 = g6([1, 2]); // Type number +>x7 : Symbol(x7, Decl(literalTypes2.ts, 158, 5)) +>g6 : Symbol(g6, Decl(literalTypes2.ts, 145, 55)) + +const x8 = g6(a); // Type 1 | 2 +>x8 : Symbol(x8, Decl(literalTypes2.ts, 159, 5)) +>g6 : Symbol(g6, Decl(literalTypes2.ts, 145, 55)) +>a : Symbol(a, Decl(literalTypes2.ts, 150, 5)) + +const x9 = g7(a); // Type (1 | 2)[] +>x9 : Symbol(x9, Decl(literalTypes2.ts, 160, 5)) +>g7 : Symbol(g7, Decl(literalTypes2.ts, 146, 34)) +>a : Symbol(a, Decl(literalTypes2.ts, 150, 5)) + +const x10 = g8(1, x => x); // Type number +>x10 : Symbol(x10, Decl(literalTypes2.ts, 161, 5)) +>g8 : Symbol(g8, Decl(literalTypes2.ts, 147, 36)) +>x : Symbol(x, Decl(literalTypes2.ts, 161, 17)) +>x : Symbol(x, Decl(literalTypes2.ts, 161, 17)) + +const x11 = g8(1, x => x + 1); // Type number +>x11 : Symbol(x11, Decl(literalTypes2.ts, 162, 5)) +>g8 : Symbol(g8, Decl(literalTypes2.ts, 147, 36)) +>x : Symbol(x, Decl(literalTypes2.ts, 162, 17)) +>x : Symbol(x, Decl(literalTypes2.ts, 162, 17)) + +function makeArray(x: T): T[] { +>makeArray : Symbol(makeArray, Decl(literalTypes2.ts, 162, 30)) +>T : Symbol(T, Decl(literalTypes2.ts, 164, 19)) +>x : Symbol(x, Decl(literalTypes2.ts, 164, 22)) +>T : Symbol(T, Decl(literalTypes2.ts, 164, 19)) +>T : Symbol(T, Decl(literalTypes2.ts, 164, 19)) + + return [x]; +>x : Symbol(x, Decl(literalTypes2.ts, 164, 22)) +} + +function append(a: T[], x: T): T[] { +>append : Symbol(append, Decl(literalTypes2.ts, 166, 1)) +>T : Symbol(T, Decl(literalTypes2.ts, 168, 16)) +>a : Symbol(a, Decl(literalTypes2.ts, 168, 19)) +>T : Symbol(T, Decl(literalTypes2.ts, 168, 16)) +>x : Symbol(x, Decl(literalTypes2.ts, 168, 26)) +>T : Symbol(T, Decl(literalTypes2.ts, 168, 16)) +>T : Symbol(T, Decl(literalTypes2.ts, 168, 16)) + + let result = a.slice(); +>result : Symbol(result, Decl(literalTypes2.ts, 169, 7)) +>a.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>a : Symbol(a, Decl(literalTypes2.ts, 168, 19)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) + + result.push(x); +>result.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>result : Symbol(result, Decl(literalTypes2.ts, 169, 7)) +>push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(literalTypes2.ts, 168, 26)) + + return result; +>result : Symbol(result, Decl(literalTypes2.ts, 169, 7)) +} + +type Bit = 0 | 1; +>Bit : Symbol(Bit, Decl(literalTypes2.ts, 172, 1)) + +let aa = makeArray(0); +>aa : Symbol(aa, Decl(literalTypes2.ts, 176, 3)) +>makeArray : Symbol(makeArray, Decl(literalTypes2.ts, 162, 30)) +>Bit : Symbol(Bit, Decl(literalTypes2.ts, 172, 1)) + +aa = append(aa, 1); +>aa : Symbol(aa, Decl(literalTypes2.ts, 176, 3)) +>append : Symbol(append, Decl(literalTypes2.ts, 166, 1)) +>aa : Symbol(aa, Decl(literalTypes2.ts, 176, 3)) + diff --git a/tests/baselines/reference/literalTypes2.types b/tests/baselines/reference/literalTypes2.types new file mode 100644 index 0000000000000..ba12ada644ba1 --- /dev/null +++ b/tests/baselines/reference/literalTypes2.types @@ -0,0 +1,816 @@ +=== tests/cases/conformance/types/literal/literalTypes2.ts === +enum E { +>E : E + + A, B, C +>A : E.A +>B : E.B +>C : E.C +} + +let cond: boolean; +>cond : boolean + +function f1(p1 = 1, p2 = "abc", p3 = true, p4 = E.A) { +>f1 : (p1?: number, p2?: string, p3?: boolean, p4?: E) => void +>p1 : number +>1 : 1 +>p2 : string +>"abc" : "abc" +>p3 : boolean +>true : true +>p4 : E +>E.A : E.A +>E : typeof E +>A : E.A + + var v1 = 1; +>v1 : number +>1 : 1 + + var v2 = -123; +>v2 : number +>-123 : -123 +>123 : 123 + + var v3 = 3 + 4; +>v3 : number +>3 + 4 : number +>3 : 3 +>4 : 4 + + var v4 = "abc"; +>v4 : string +>"abc" : "abc" + + var v5 = ""; +>v5 : string +>"" : "" + + var v6 = "abc" + "def"; +>v6 : string +>"abc" + "def" : string +>"abc" : "abc" +>"def" : "def" + + var v7 = true; +>v7 : boolean +>true : true + + var v8 = E.A; +>v8 : E +>E.A : E.A +>E : typeof E +>A : E.A + + let x1 = 1; +>x1 : number +>1 : 1 + + let x2 = -123; +>x2 : number +>-123 : -123 +>123 : 123 + + let x3 = 3 + 4; +>x3 : number +>3 + 4 : number +>3 : 3 +>4 : 4 + + let x4 = "abc"; +>x4 : string +>"abc" : "abc" + + let x5 = ""; +>x5 : string +>"" : "" + + let x6 = "abc" + "def"; +>x6 : string +>"abc" + "def" : string +>"abc" : "abc" +>"def" : "def" + + let x7 = true; +>x7 : boolean +>true : true + + var x8 = E.A; +>x8 : E +>E.A : E.A +>E : typeof E +>A : E.A + + const c1 = 1; +>c1 : 1 +>1 : 1 + + const c2 = -123; +>c2 : -123 +>-123 : -123 +>123 : 123 + + const c3 = 3 + 4; +>c3 : number +>3 + 4 : number +>3 : 3 +>4 : 4 + + const c4 = "abc"; +>c4 : "abc" +>"abc" : "abc" + + const c5 = ""; +>c5 : "" +>"" : "" + + const c6 = "abc" + "def"; +>c6 : string +>"abc" + "def" : string +>"abc" : "abc" +>"def" : "def" + + const c7 = true; +>c7 : true +>true : true + + const c8 = E.A; +>c8 : E.A +>E.A : E.A +>E : typeof E +>A : E.A +} + +function f2(p1: 1 = 1, p2: "abc" = "abc", p3: true = true, p4: E.A = E.A) { +>f2 : (p1?: 1, p2?: "abc", p3?: true, p4?: E.A) => void +>p1 : 1 +>1 : 1 +>p2 : "abc" +>"abc" : "abc" +>p3 : true +>true : true +>true : true +>p4 : E.A +>E : any +>A : E.A +>E.A : E.A +>E : typeof E +>A : E.A + + var v1: 1 = 1; +>v1 : 1 +>1 : 1 + + var v2: -123 = -123; +>v2 : -123 +>-123 : -123 +>123 : 123 +>-123 : -123 +>123 : 123 + + var v3: "abc" = "abc"; +>v3 : "abc" +>"abc" : "abc" + + var v4: true = true; +>v4 : true +>true : true +>true : true + + var v5: E.A = E.A; +>v5 : E.A +>E : any +>A : E.A +>E.A : E.A +>E : typeof E +>A : E.A + + let x1: 1 = 1; +>x1 : 1 +>1 : 1 + + let x2: -123 = -123; +>x2 : -123 +>-123 : -123 +>123 : 123 +>-123 : -123 +>123 : 123 + + let x3: "abc" = "abc"; +>x3 : "abc" +>"abc" : "abc" + + let x4: true = true; +>x4 : true +>true : true +>true : true + + let x5: E.A = E.A; +>x5 : E.A +>E : any +>A : E.A +>E.A : E.A +>E : typeof E +>A : E.A +} + +function f3() { +>f3 : () => void + + const c1 = cond ? 1 : 2; +>c1 : 1 | 2 +>cond ? 1 : 2 : 1 | 2 +>cond : boolean +>1 : 1 +>2 : 2 + + const c2 = cond ? 1 : "two"; +>c2 : 1 | "two" +>cond ? 1 : "two" : 1 | "two" +>cond : boolean +>1 : 1 +>"two" : "two" + + const c3 = cond ? E.A : cond ? true : 123; +>c3 : true | E.A | 123 +>cond ? E.A : cond ? true : 123 : true | E.A | 123 +>cond : boolean +>E.A : E.A +>E : typeof E +>A : E.A +>cond ? true : 123 : true | 123 +>cond : boolean +>true : true +>123 : 123 + + const c4 = cond ? "abc" : null; +>c4 : "abc" +>cond ? "abc" : null : "abc" +>cond : boolean +>"abc" : "abc" +>null : null + + const c5 = cond ? 456 : undefined; +>c5 : 456 +>cond ? 456 : undefined : 456 +>cond : boolean +>456 : 456 +>undefined : undefined + + const c6: { kind: 123 } = { kind: 123 }; +>c6 : { kind: 123; } +>kind : 123 +>{ kind: 123 } : { kind: 123; } +>kind : number +>123 : 123 + + const c7: [1 | 2, "foo" | "bar"] = [1, "bar"]; +>c7 : [1 | 2, "foo" | "bar"] +>[1, "bar"] : [1, "bar"] +>1 : 1 +>"bar" : "bar" + + const c8 = cond ? c6 : cond ? c7 : "hello"; +>c8 : { kind: 123; } | [1 | 2, "foo" | "bar"] | "hello" +>cond ? c6 : cond ? c7 : "hello" : { kind: 123; } | [1 | 2, "foo" | "bar"] | "hello" +>cond : boolean +>c6 : { kind: 123; } +>cond ? c7 : "hello" : [1 | 2, "foo" | "bar"] | "hello" +>cond : boolean +>c7 : [1 | 2, "foo" | "bar"] +>"hello" : "hello" + + let x1 = c1; +>x1 : number +>c1 : 1 | 2 + + let x2 = c2; +>x2 : string | number +>c2 : 1 | "two" + + let x3 = c3; +>x3 : number | boolean | E +>c3 : true | E.A | 123 + + let x4 = c4; +>x4 : string +>c4 : "abc" + + let x5 = c5; +>x5 : number +>c5 : 456 + + let x6 = c6; +>x6 : { kind: 123; } +>c6 : { kind: 123; } + + let x7 = c7; +>x7 : [1 | 2, "foo" | "bar"] +>c7 : [1 | 2, "foo" | "bar"] + + let x8 = c8; +>x8 : string | { kind: 123; } | [1 | 2, "foo" | "bar"] +>c8 : { kind: 123; } | [1 | 2, "foo" | "bar"] | "hello" +} + +class C1 { +>C1 : C1 + + x1 = 1; +>x1 : number +>1 : 1 + + x2 = -123; +>x2 : number +>-123 : -123 +>123 : 123 + + x3 = 3 + 4; +>x3 : number +>3 + 4 : number +>3 : 3 +>4 : 4 + + x4 = "abc"; +>x4 : string +>"abc" : "abc" + + x5 = ""; +>x5 : string +>"" : "" + + x6 = "abc" + "def"; +>x6 : string +>"abc" + "def" : string +>"abc" : "abc" +>"def" : "def" + + x7 = true; +>x7 : boolean +>true : true + + x8 = E.A; +>x8 : E +>E.A : E.A +>E : typeof E +>A : E.A + + readonly c1 = 1; +>c1 : 1 +>1 : 1 + + readonly c2 = -123; +>c2 : -123 +>-123 : -123 +>123 : 123 + + readonly c3 = 3 + 4; +>c3 : number +>3 + 4 : number +>3 : 3 +>4 : 4 + + readonly c4 = "abc"; +>c4 : "abc" +>"abc" : "abc" + + readonly c5 = ""; +>c5 : "" +>"" : "" + + readonly c6 = "abc" + "def"; +>c6 : string +>"abc" + "def" : string +>"abc" : "abc" +>"def" : "def" + + readonly c7 = true; +>c7 : true +>true : true + + readonly c8 = E.A; +>c8 : E.A +>E.A : E.A +>E : typeof E +>A : E.A +} + +function f4() { +>f4 : () => void + + const c1 = { a: 1, b: "foo" }; +>c1 : { a: number; b: string; } +>{ a: 1, b: "foo" } : { a: number; b: string; } +>a : number +>1 : 1 +>b : string +>"foo" : "foo" + + const c2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; +>c2 : { a: 0 | 1; b: "foo" | "bar"; } +>a : 0 | 1 +>b : "foo" | "bar" +>{ a: 1, b: "foo" } : { a: 1; b: "foo"; } +>a : number +>1 : 1 +>b : string +>"foo" : "foo" + + let x1 = { a: 1, b: "foo" }; +>x1 : { a: number; b: string; } +>{ a: 1, b: "foo" } : { a: number; b: string; } +>a : number +>1 : 1 +>b : string +>"foo" : "foo" + + let x2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; +>x2 : { a: 0 | 1; b: "foo" | "bar"; } +>a : 0 | 1 +>b : "foo" | "bar" +>{ a: 1, b: "foo" } : { a: 1; b: "foo"; } +>a : number +>1 : 1 +>b : string +>"foo" : "foo" +} + +function f5() { +>f5 : () => void + + const c1 = [1, "foo"]; +>c1 : (string | number)[] +>[1, "foo"] : (string | number)[] +>1 : 1 +>"foo" : "foo" + + const c2: (1 | "foo")[] = [1, "foo"]; +>c2 : (1 | "foo")[] +>[1, "foo"] : (1 | "foo")[] +>1 : 1 +>"foo" : "foo" + + const c3: [1, "foo"] = [1, "foo"]; +>c3 : [1, "foo"] +>[1, "foo"] : [1, "foo"] +>1 : 1 +>"foo" : "foo" + + let x1 = [1, "foo"]; +>x1 : (string | number)[] +>[1, "foo"] : (string | number)[] +>1 : 1 +>"foo" : "foo" + + let x2: (1 | "foo")[] = [1, "foo"]; +>x2 : (1 | "foo")[] +>[1, "foo"] : (1 | "foo")[] +>1 : 1 +>"foo" : "foo" + + let x3: [1, "foo"] = [1, "foo"]; +>x3 : [1, "foo"] +>[1, "foo"] : [1, "foo"] +>1 : 1 +>"foo" : "foo" +} + +function f6() { +>f6 : () => void + + const { c1 = true, c2 = 0, c3 = "foo" } = { c1: false, c2: 1, c3: "bar" }; +>c1 : boolean +>true : true +>c2 : 0 | 1 +>0 : 0 +>c3 : "foo" | "bar" +>"foo" : "foo" +>{ c1: false, c2: 1, c3: "bar" } : { c1?: false; c2?: 1; c3?: "bar"; } +>c1 : boolean +>false : false +>c2 : number +>1 : 1 +>c3 : string +>"bar" : "bar" + + let { x1 = true, x2 = 0, x3 = "foo" } = { x1: false, x2: 1, x3: "bar" }; +>x1 : boolean +>true : true +>x2 : number +>0 : 0 +>x3 : string +>"foo" : "foo" +>{ x1: false, x2: 1, x3: "bar" } : { x1?: false; x2?: number; x3?: string; } +>x1 : boolean +>false : false +>x2 : number +>1 : 1 +>x3 : string +>"bar" : "bar" +} + +function f10() { +>f10 : () => string + + return "hello"; +>"hello" : "hello" +} + +function f11() { +>f11 : () => 1 | "two" + + return cond ? 1 : "two"; +>cond ? 1 : "two" : 1 | "two" +>cond : boolean +>1 : 1 +>"two" : "two" +} + +function f12() { +>f12 : () => 1 | "two" + + if (cond) { +>cond : boolean + + return 1; +>1 : 1 + } + else { + return "two"; +>"two" : "two" + } +} + +class C2 { +>C2 : C2 + + foo() { +>foo : () => number + + return 0; +>0 : 0 + } + bar() { +>bar : () => 0 | 1 + + return cond ? 0 : 1; +>cond ? 0 : 1 : 0 | 1 +>cond : boolean +>0 : 0 +>1 : 1 + } +} + +function f20() { +>f20 : () => void + + const f1 = () => 0; +>f1 : () => number +>() => 0 : () => number +>0 : 0 + + const f2 = () => "hello"; +>f2 : () => string +>() => "hello" : () => string +>"hello" : "hello" + + const f3 = () => true; +>f3 : () => boolean +>() => true : () => boolean +>true : true + + const f4 = () => E.C; +>f4 : () => E +>() => E.C : () => E +>E.C : E.C +>E : typeof E +>C : E.C + + const f5 = (): "foo" => "foo"; +>f5 : () => "foo" +>(): "foo" => "foo" : () => "foo" +>"foo" : "foo" + + const f6: () => "foo" | "bar" = () => "bar"; +>f6 : () => "foo" | "bar" +>() => "bar" : () => "bar" +>"bar" : "bar" + + const f7: (() => "foo") | (() => "bar") = () => "bar"; +>f7 : (() => "foo") | (() => "bar") +>() => "bar" : () => "bar" +>"bar" : "bar" +} + +declare function g1(x: T): T; +>g1 : (x: T) => T +>T : T +>x : T +>T : T +>T : T + +declare function g2(x: T, y: T): T; +>g2 : (x: T, y: T) => T +>T : T +>x : T +>T : T +>y : T +>T : T +>T : T + +declare function g3(x: T, y: U): T | U; +>g3 : (x: T, y: U) => T | U +>T : T +>U : U +>x : T +>T : T +>y : U +>U : U +>T : T +>U : U + +declare function g4(x: T): T[]; +>g4 : (x: T) => T[] +>T : T +>x : T +>T : T +>T : T + +declare function g5(x: T, y: T): T[]; +>g5 : (x: T, y: T) => T[] +>T : T +>x : T +>T : T +>y : T +>T : T +>T : T + +declare function g6(x: T[]): T; +>g6 : (x: T[]) => T +>T : T +>x : T[] +>T : T +>T : T + +declare function g7(x: T[]): T[]; +>g7 : (x: T[]) => T[] +>T : T +>x : T[] +>T : T +>T : T + +declare function g8(x: T, f: (p: T) => T): T; +>g8 : (x: T, f: (p: T) => T) => T +>T : T +>x : T +>T : T +>f : (p: T) => T +>p : T +>T : T +>T : T +>T : T + +const a: (1 | 2)[] = [1, 2]; +>a : (1 | 2)[] +>[1, 2] : (1 | 2)[] +>1 : 1 +>2 : 2 + +const x1 = g1(1); // Type 1 +>x1 : 1 +>g1(1) : 1 +>g1 : (x: T) => T +>1 : 1 + +const x2 = g2(1, 1); // Type 1 +>x2 : 1 +>g2(1, 1) : 1 +>g2 : (x: T, y: T) => T +>1 : 1 +>1 : 1 + +const x3 = g2(1, 2); // Type 1 | 2 +>x3 : 1 | 2 +>g2(1, 2) : 1 | 2 +>g2 : (x: T, y: T) => T +>1 : 1 +>2 : 2 + +const x4 = g3(1, "two"); // Type 1 | "two" +>x4 : 1 | "two" +>g3(1, "two") : 1 | "two" +>g3 : (x: T, y: U) => T | U +>1 : 1 +>"two" : "two" + +const x5 = g4(1); // Type number[] +>x5 : number[] +>g4(1) : number[] +>g4 : (x: T) => T[] +>1 : 1 + +const x6 = g5(1, 2); // Type (1 | 2)[] +>x6 : (1 | 2)[] +>g5(1, 2) : (1 | 2)[] +>g5 : (x: T, y: T) => T[] +>1 : 1 +>2 : 2 + +const x7 = g6([1, 2]); // Type number +>x7 : number +>g6([1, 2]) : number +>g6 : (x: T[]) => T +>[1, 2] : number[] +>1 : 1 +>2 : 2 + +const x8 = g6(a); // Type 1 | 2 +>x8 : 1 | 2 +>g6(a) : 1 | 2 +>g6 : (x: T[]) => T +>a : (1 | 2)[] + +const x9 = g7(a); // Type (1 | 2)[] +>x9 : (1 | 2)[] +>g7(a) : (1 | 2)[] +>g7 : (x: T[]) => T[] +>a : (1 | 2)[] + +const x10 = g8(1, x => x); // Type number +>x10 : number +>g8(1, x => x) : number +>g8 : (x: T, f: (p: T) => T) => T +>1 : 1 +>x => x : (x: number) => number +>x : number +>x : number + +const x11 = g8(1, x => x + 1); // Type number +>x11 : number +>g8(1, x => x + 1) : number +>g8 : (x: T, f: (p: T) => T) => T +>1 : 1 +>x => x + 1 : (x: number) => number +>x : number +>x + 1 : number +>x : number +>1 : 1 + +function makeArray(x: T): T[] { +>makeArray : (x: T) => T[] +>T : T +>x : T +>T : T +>T : T + + return [x]; +>[x] : T[] +>x : T +} + +function append(a: T[], x: T): T[] { +>append : (a: T[], x: T) => T[] +>T : T +>a : T[] +>T : T +>x : T +>T : T +>T : T + + let result = a.slice(); +>result : T[] +>a.slice() : T[] +>a.slice : (start?: number, end?: number) => T[] +>a : T[] +>slice : (start?: number, end?: number) => T[] + + result.push(x); +>result.push(x) : number +>result.push : (...items: T[]) => number +>result : T[] +>push : (...items: T[]) => number +>x : T + + return result; +>result : T[] +} + +type Bit = 0 | 1; +>Bit : 0 | 1 + +let aa = makeArray(0); +>aa : (0 | 1)[] +>makeArray(0) : (0 | 1)[] +>makeArray : (x: T) => T[] +>Bit : 0 | 1 +>0 : 0 + +aa = append(aa, 1); +>aa = append(aa, 1) : (0 | 1)[] +>aa : (0 | 1)[] +>append(aa, 1) : (0 | 1)[] +>append : (a: T[], x: T) => T[] +>aa : (0 | 1)[] +>1 : 1 + diff --git a/tests/baselines/reference/literals1.types b/tests/baselines/reference/literals1.types index 69e50c22f4a57..5b1a5c9cd6810 100644 --- a/tests/baselines/reference/literals1.types +++ b/tests/baselines/reference/literals1.types @@ -1,47 +1,47 @@ === tests/cases/compiler/literals1.ts === var a = 42; >a : number ->42 : number +>42 : 42 var b = 0xFA34; >b : number ->0xFA34 : number +>0xFA34 : 64052 var c = 0.1715; >c : number ->0.1715 : number +>0.1715 : 0.1715 var d = 3.14E5; >d : number ->3.14E5 : number +>3.14E5 : 314000 var e = 8.14e-5; >e : number ->8.14e-5 : number +>8.14e-5 : 0.0000814 var f = true; >f : boolean ->true : boolean +>true : true var g = false; >g : boolean ->false : boolean +>false : false var h = ""; >h : string ->"" : string +>"" : "" var i = "hi"; >i : string ->"hi" : string +>"hi" : "hi" var j = ''; >j : string ->'' : string +>'' : "" var k = 'q\tq'; >k : string ->'q\tq' : string +>'q\tq' : "q\tq" var m = /q/; >m : RegExp diff --git a/tests/baselines/reference/localClassesInLoop.types b/tests/baselines/reference/localClassesInLoop.types index f1c06f934636d..c88bfc0435d0c 100644 --- a/tests/baselines/reference/localClassesInLoop.types +++ b/tests/baselines/reference/localClassesInLoop.types @@ -4,7 +4,7 @@ declare function use(a: any); >a : any "use strict" ->"use strict" : string +>"use strict" : "use strict" var data = []; >data : any[] @@ -12,10 +12,10 @@ var data = []; for (let x = 0; x < 2; ++x) { >x : number ->0 : number +>0 : 0 >x < 2 : boolean >x : number ->2 : number +>2 : 2 >++x : number >x : number @@ -38,9 +38,9 @@ use(data[0]() === data[1]()); >data[0]() : any >data[0] : any >data : any[] ->0 : number +>0 : 0 >data[1]() : any >data[1] : any >data : any[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/localClassesInLoop_ES6.types b/tests/baselines/reference/localClassesInLoop_ES6.types index 518e75f4afa40..9d487f6c60051 100644 --- a/tests/baselines/reference/localClassesInLoop_ES6.types +++ b/tests/baselines/reference/localClassesInLoop_ES6.types @@ -5,7 +5,7 @@ declare function use(a: any); >a : any "use strict" ->"use strict" : string +>"use strict" : "use strict" var data = []; >data : any[] @@ -13,10 +13,10 @@ var data = []; for (let x = 0; x < 2; ++x) { >x : number ->0 : number +>0 : 0 >x < 2 : boolean >x : number ->2 : number +>2 : 2 >++x : number >x : number @@ -39,9 +39,9 @@ use(data[0]() === data[1]()); >data[0]() : any >data[0] : any >data : any[] ->0 : number +>0 : 0 >data[1]() : any >data[1] : any >data : any[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/localImportNameVsGlobalName.types b/tests/baselines/reference/localImportNameVsGlobalName.types index dd7f05fc8ddf7..d70cac65adf61 100644 --- a/tests/baselines/reference/localImportNameVsGlobalName.types +++ b/tests/baselines/reference/localImportNameVsGlobalName.types @@ -4,10 +4,10 @@ module Keyboard { export enum Key { UP, DOWN, LEFT, RIGHT } >Key : Key ->UP : Key ->DOWN : Key ->LEFT : Key ->RIGHT : Key +>UP : Key.UP +>DOWN : Key.DOWN +>LEFT : Key.LEFT +>RIGHT : Key.RIGHT } module App { diff --git a/tests/baselines/reference/localTypes1.types b/tests/baselines/reference/localTypes1.types index 78e92fd832494..7ac6896b9f351 100644 --- a/tests/baselines/reference/localTypes1.types +++ b/tests/baselines/reference/localTypes1.types @@ -7,9 +7,9 @@ function f1() { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -41,7 +41,7 @@ function f1() { >a[0].x : E >a[0] : I >a : I[] ->0 : number +>0 : 0 >x : E >E.B : E.B >E : typeof E @@ -61,9 +61,9 @@ function f2() { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -95,7 +95,7 @@ function f2() { >a[0].x : E >a[0] : I >a : I[] ->0 : number +>0 : 0 >x : E >E.B : E.B >E : typeof E @@ -114,15 +114,15 @@ function f3(b: boolean) { >b : boolean if (true) { ->true : boolean +>true : true enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } if (b) { >b : boolean @@ -157,7 +157,7 @@ function f3(b: boolean) { >a[0].x : E >a[0] : I >a : I[] ->0 : number +>0 : 0 >x : E >E.B : E.B >E : typeof E @@ -197,7 +197,7 @@ function f3(b: boolean) { >c[0].x : E >c[0] : J >c : J[] ->0 : number +>0 : 0 >x : E >E.B : E.B >E : typeof E @@ -220,9 +220,9 @@ function f5() { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -243,9 +243,9 @@ function f5() { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -268,9 +268,9 @@ class A { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -287,9 +287,9 @@ class A { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -309,9 +309,9 @@ class A { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -361,25 +361,25 @@ function f6() { >C : typeof C x.a = "a"; ->x.a = "a" : string +>x.a = "a" : "a" >x.a : string >x : C >a : string ->"a" : string +>"a" : "a" x.b = "b"; ->x.b = "b" : string +>x.b = "b" : "b" >x.b : string >x : C >b : string ->"b" : string +>"b" : "b" x.c = "c"; ->x.c = "c" : string +>x.c = "c" : "c" >x.c : string >x : C >c : string ->"c" : string +>"c" : "c" return x; >x : C diff --git a/tests/baselines/reference/localTypes2.types b/tests/baselines/reference/localTypes2.types index a6b85b7bb144e..e661b9fc0bf7b 100644 --- a/tests/baselines/reference/localTypes2.types +++ b/tests/baselines/reference/localTypes2.types @@ -24,8 +24,8 @@ function f1() { >v : C >new C(10, 20) : C >C : typeof C ->10 : number ->20 : number +>10 : 10 +>20 : 20 let x = v.x; >x : number @@ -64,13 +64,13 @@ function f2() { >C : typeof C >f(10) : typeof C >f : (x: number) => typeof C ->10 : number +>10 : 10 let v = new C(20); >v : C >new C(20) : C >C : typeof C ->20 : number +>20 : 20 let x = v.x; >x : number @@ -111,8 +111,8 @@ function f3() { >C : typeof C >f(10, 20) : typeof C >f : (x: number, y: number) => typeof C ->10 : number ->20 : number +>10 : 10 +>20 : 20 let v = new C(); >v : C diff --git a/tests/baselines/reference/localTypes3.types b/tests/baselines/reference/localTypes3.types index 551096468c57f..3ce32fef9e64d 100644 --- a/tests/baselines/reference/localTypes3.types +++ b/tests/baselines/reference/localTypes3.types @@ -28,8 +28,8 @@ function f1() { >v : C >new C(10, "hello") : C >C : typeof C ->10 : number ->"hello" : string +>10 : 10 +>"hello" : "hello" let x = v.x; >x : number @@ -72,13 +72,13 @@ function f2() { >C : typeof C >f(10) : typeof C >f : (x: X) => typeof C ->10 : number +>10 : 10 let v = new C("hello"); >v : f.C >new C("hello") : f.C >C : typeof C ->"hello" : string +>"hello" : "hello" let x = v.x; >x : number @@ -123,8 +123,8 @@ function f3() { >C : typeof C >f(10, "hello") : typeof C >f : (x: X, y: Y) => typeof C ->10 : number ->"hello" : string +>10 : 10 +>"hello" : "hello" let v = new C(); >v : f.C diff --git a/tests/baselines/reference/logicalAndOperatorStrictMode.types b/tests/baselines/reference/logicalAndOperatorStrictMode.types index a2321b0695805..892da9851209f 100644 --- a/tests/baselines/reference/logicalAndOperatorStrictMode.types +++ b/tests/baselines/reference/logicalAndOperatorStrictMode.types @@ -3,19 +3,19 @@ const a = [0]; >a : number[] >[0] : number[] ->0 : number +>0 : 0 const s = ""; ->s : string ->"" : string +>s : "" +>"" : "" const x = 0; ->x : number ->0 : number +>x : 0 +>0 : 0 const b = false; ->b : boolean ->false : boolean +>b : false +>false : false const v: void = undefined; >v : void @@ -30,11 +30,11 @@ const n = null; >null : null const z = s || x || u; ->z : string | number | undefined ->s || x || u : string | number | undefined ->s || x : string | number ->s : string ->x : number +>z : undefined +>s || x || u : undefined +>s || x : 0 +>s : "" +>x : 0 >u : undefined const a1 = a && a; @@ -44,22 +44,22 @@ const a1 = a && a; >a : number[] const a2 = a && s; ->a2 : string ->a && s : string +>a2 : "" +>a && s : "" >a : number[] ->s : string +>s : "" const a3 = a && x; ->a3 : number ->a && x : number +>a3 : 0 +>a && x : 0 >a : number[] ->x : number +>x : 0 const a4 = a && b; ->a4 : boolean ->a && b : boolean +>a4 : false +>a && b : false >a : number[] ->b : boolean +>b : false const a5 = a && v; >a5 : void @@ -80,154 +80,154 @@ const a7 = a && n; >n : null const a8 = a && z; ->a8 : string | number | undefined ->a && z : string | number | undefined +>a8 : undefined +>a && z : undefined >a : number[] ->z : string | number | undefined +>z : undefined const s1 = s && a; ->s1 : "" | number[] ->s && a : "" | number[] ->s : string +>s1 : "" +>s && a : "" +>s : "" >a : number[] const s2 = s && s; ->s2 : string ->s && s : string ->s : string ->s : string +>s2 : "" +>s && s : "" +>s : "" +>s : never const s3 = s && x; ->s3 : number | "" ->s && x : number | "" ->s : string ->x : number +>s3 : "" +>s && x : "" +>s : "" +>x : 0 const s4 = s && b; ->s4 : boolean | "" ->s && b : boolean | "" ->s : string ->b : boolean +>s4 : "" +>s && b : "" +>s : "" +>b : false const s5 = s && v; ->s5 : void | "" ->s && v : void | "" ->s : string +>s5 : "" +>s && v : "" +>s : "" >v : void const s6 = s && u; ->s6 : "" | undefined ->s && u : "" | undefined ->s : string +>s6 : "" +>s && u : "" +>s : "" >u : undefined const s7 = s && n; ->s7 : "" | null ->s && n : "" | null ->s : string +>s7 : "" +>s && n : "" +>s : "" >n : null const s8 = s && z; ->s8 : string | number | undefined ->s && z : string | number | undefined ->s : string ->z : string | number | undefined +>s8 : "" +>s && z : "" +>s : "" +>z : undefined const x1 = x && a; ->x1 : 0 | number[] ->x && a : 0 | number[] ->x : number +>x1 : 0 +>x && a : 0 +>x : 0 >a : number[] const x2 = x && s; ->x2 : string | 0 ->x && s : string | 0 ->x : number ->s : string +>x2 : 0 +>x && s : 0 +>x : 0 +>s : "" const x3 = x && x; ->x3 : number ->x && x : number ->x : number ->x : number +>x3 : 0 +>x && x : 0 +>x : 0 +>x : never const x4 = x && b; ->x4 : boolean | 0 ->x && b : boolean | 0 ->x : number ->b : boolean +>x4 : 0 +>x && b : 0 +>x : 0 +>b : false const x5 = x && v; ->x5 : void | 0 ->x && v : void | 0 ->x : number +>x5 : 0 +>x && v : 0 +>x : 0 >v : void const x6 = x && u; ->x6 : 0 | undefined ->x && u : 0 | undefined ->x : number +>x6 : 0 +>x && u : 0 +>x : 0 >u : undefined const x7 = x && n; ->x7 : 0 | null ->x && n : 0 | null ->x : number +>x7 : 0 +>x && n : 0 +>x : 0 >n : null const x8 = x && z; ->x8 : string | number | undefined ->x && z : string | number | undefined ->x : number ->z : string | number | undefined +>x8 : 0 +>x && z : 0 +>x : 0 +>z : undefined const b1 = b && a; ->b1 : false | number[] ->b && a : false | number[] ->b : boolean +>b1 : false +>b && a : false +>b : false >a : number[] const b2 = b && s; ->b2 : string | false ->b && s : string | false ->b : boolean ->s : string +>b2 : false +>b && s : false +>b : false +>s : "" const b3 = b && x; ->b3 : number | false ->b && x : number | false ->b : boolean ->x : number +>b3 : false +>b && x : false +>b : false +>x : 0 const b4 = b && b; ->b4 : boolean ->b && b : boolean ->b : boolean ->b : true +>b4 : false +>b && b : false +>b : false +>b : never const b5 = b && v; ->b5 : false | void ->b && v : false | void ->b : boolean +>b5 : false +>b && v : false +>b : false >v : void const b6 = b && u; ->b6 : false | undefined ->b && u : false | undefined ->b : boolean +>b6 : false +>b && u : false +>b : false >u : undefined const b7 = b && n; ->b7 : false | null ->b && n : false | null ->b : boolean +>b7 : false +>b && n : false +>b : false >n : null const b8 = b && z; ->b8 : string | number | false | undefined ->b && z : string | number | false | undefined ->b : boolean ->z : string | number | undefined +>b8 : false +>b && z : false +>b : false +>z : undefined const v1 = v && a; >v1 : void @@ -239,19 +239,19 @@ const v2 = v && s; >v2 : void >v && s : void >v : void ->s : string +>s : "" const v3 = v && x; >v3 : void >v && x : void >v : void ->x : number +>x : 0 const v4 = v && b; >v4 : void >v && b : void >v : void ->b : boolean +>b : false const v5 = v && v; >v5 : void @@ -275,7 +275,7 @@ const v8 = v && z; >v8 : void >v && z : void >v : void ->z : string | number | undefined +>z : undefined const u1 = u && a; >u1 : undefined @@ -287,19 +287,19 @@ const u2 = u && s; >u2 : undefined >u && s : undefined >u : undefined ->s : string +>s : "" const u3 = u && x; >u3 : undefined >u && x : undefined >u : undefined ->x : number +>x : 0 const u4 = u && b; >u4 : undefined >u && b : undefined >u : undefined ->b : boolean +>b : false const u5 = u && v; >u5 : undefined @@ -323,7 +323,7 @@ const u8 = u && z; >u8 : undefined >u && z : undefined >u : undefined ->z : string | number | undefined +>z : undefined const n1 = n && a; >n1 : null @@ -335,19 +335,19 @@ const n2 = n && s; >n2 : null >n && s : null >n : null ->s : string +>s : "" const n3 = n && x; >n3 : null >n && x : null >n : null ->x : number +>x : 0 const n4 = n && b; >n4 : null >n && b : null >n : null ->b : boolean +>b : false const n5 = n && v; >n5 : null @@ -371,53 +371,53 @@ const n8 = n && z; >n8 : null >n && z : null >n : null ->z : string | number | undefined +>z : undefined const z1 = z && a; ->z1 : "" | 0 | number[] | undefined ->z && a : "" | 0 | number[] | undefined ->z : string | number | undefined +>z1 : undefined +>z && a : undefined +>z : undefined >a : number[] const z2 = z && s; ->z2 : string | 0 | undefined ->z && s : string | 0 | undefined ->z : string | number | undefined ->s : string +>z2 : undefined +>z && s : undefined +>z : undefined +>s : "" const z3 = z && x; ->z3 : number | "" | undefined ->z && x : number | "" | undefined ->z : string | number | undefined ->x : number +>z3 : undefined +>z && x : undefined +>z : undefined +>x : 0 const z4 = z && b; ->z4 : boolean | "" | 0 | undefined ->z && b : boolean | "" | 0 | undefined ->z : string | number | undefined ->b : boolean +>z4 : undefined +>z && b : undefined +>z : undefined +>b : false const z5 = z && v; ->z5 : void | "" | 0 ->z && v : void | "" | 0 ->z : string | number | undefined +>z5 : undefined +>z && v : undefined +>z : undefined >v : void const z6 = z && u; ->z6 : "" | 0 | undefined ->z && u : "" | 0 | undefined ->z : string | number | undefined +>z6 : undefined +>z && u : undefined +>z : undefined >u : undefined const z7 = z && n; ->z7 : "" | 0 | null | undefined ->z && n : "" | 0 | null | undefined ->z : string | number | undefined +>z7 : undefined +>z && n : undefined +>z : undefined >n : null const z8 = z && z; ->z8 : string | number | undefined ->z && z : string | number | undefined ->z : string | number | undefined ->z : string | number +>z8 : undefined +>z && z : undefined +>z : undefined +>z : never diff --git a/tests/baselines/reference/logicalAndOperatorWithEveryType.types b/tests/baselines/reference/logicalAndOperatorWithEveryType.types index 22187bb16a961..54770acfab49e 100644 --- a/tests/baselines/reference/logicalAndOperatorWithEveryType.types +++ b/tests/baselines/reference/logicalAndOperatorWithEveryType.types @@ -4,9 +4,9 @@ enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a1: any; >a1 : any @@ -364,7 +364,7 @@ var rf5 = a5 && a6; >a6 : E var rf6 = a6 && a6; ->rf6 : E.b | E.c +>rf6 : E >a6 && a6 : E.b | E.c >a6 : E >a6 : E.b | E.c diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types index 63d5d38eddaba..93fdea731f1be 100644 --- a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types @@ -15,7 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -39,16 +39,16 @@ var ResultIsBoolean1 = !BOOLEAN; var ResultIsBoolean2 = !true; >ResultIsBoolean2 : boolean >!true : boolean ->true : boolean +>true : true var ResultIsBoolean3 = !{ x: true, y: false }; >ResultIsBoolean3 : boolean >!{ x: true, y: false } : boolean >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsBoolean4 = !objA.a; @@ -89,7 +89,7 @@ var ResultIsBoolean = !!BOOLEAN; // miss assignment operators !true; >!true : boolean ->true : boolean +>true : true !BOOLEAN; >!BOOLEAN : boolean @@ -101,10 +101,10 @@ var ResultIsBoolean = !!BOOLEAN; >foo : () => boolean !true, false; ->!true, false : boolean +>!true, false : false >!true : boolean ->true : boolean ->false : boolean +>true : true +>false : false !objA.a; >!objA.a : boolean diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.types b/tests/baselines/reference/logicalNotOperatorWithEnumType.types index 5d57916ceaafc..4495038eb8546 100644 --- a/tests/baselines/reference/logicalNotOperatorWithEnumType.types +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.types @@ -3,9 +3,9 @@ enum ENUM { A, B, C }; >ENUM : ENUM ->A : ENUM ->B : ENUM ->C : ENUM +>A : ENUM.A +>B : ENUM.B +>C : ENUM.C enum ENUM1 { }; >ENUM1 : ENUM1 @@ -20,21 +20,21 @@ var ResultIsBoolean1 = !ENUM; var ResultIsBoolean2 = !ENUM["B"]; >ResultIsBoolean2 : boolean >!ENUM["B"] : boolean ->ENUM["B"] : ENUM +>ENUM["B"] : ENUM.B >ENUM : typeof ENUM ->"B" : string +>"B" : "B" var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); >ResultIsBoolean3 : boolean >!(ENUM.B + ENUM["C"]) : boolean >(ENUM.B + ENUM["C"]) : number >ENUM.B + ENUM["C"] : number ->ENUM.B : ENUM +>ENUM.B : ENUM.B >ENUM : typeof ENUM ->B : ENUM ->ENUM["C"] : ENUM +>B : ENUM.B +>ENUM["C"] : ENUM.C >ENUM : typeof ENUM ->"C" : string +>"C" : "C" // multiple ! operators var ResultIsBoolean4 = !!ENUM; @@ -50,12 +50,12 @@ var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); >!(ENUM["B"] + ENUM.C) : boolean >(ENUM["B"] + ENUM.C) : number >ENUM["B"] + ENUM.C : number ->ENUM["B"] : ENUM +>ENUM["B"] : ENUM.B >ENUM : typeof ENUM ->"B" : string ->ENUM.C : ENUM +>"B" : "B" +>ENUM.C : ENUM.C >ENUM : typeof ENUM ->C : ENUM +>C : ENUM.C // miss assignment operators !ENUM; @@ -68,9 +68,9 @@ var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); !ENUM.B; >!ENUM.B : boolean ->ENUM.B : ENUM +>ENUM.B : ENUM.B >ENUM : typeof ENUM ->B : ENUM +>B : ENUM.B !ENUM, ENUM1; >!ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.types b/tests/baselines/reference/logicalNotOperatorWithNumberType.types index 6b7ce5b60883b..f66f878c3bee7 100644 --- a/tests/baselines/reference/logicalNotOperatorWithNumberType.types +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsBoolean2 = !NUMBER1; var ResultIsBoolean3 = !1; >ResultIsBoolean3 : boolean >!1 : boolean ->1 : number +>1 : 1 var ResultIsBoolean4 = !{ x: 1, y: 2}; >ResultIsBoolean4 : boolean >!{ x: 1, y: 2} : boolean >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } }; >ResultIsBoolean5 : boolean >!{ x: 1, y: (n: number) => { return n; } } : boolean >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsBoolean8 = !NUMBER1[0]; >!NUMBER1[0] : boolean >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsBoolean9 = !foo(); >ResultIsBoolean9 : boolean @@ -136,7 +136,7 @@ var ResultIsBoolean13 = !!!(NUMBER + NUMBER); // miss assignment operators !1; >!1 : boolean ->1 : number +>1 : 1 !NUMBER; >!NUMBER : boolean diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.types b/tests/baselines/reference/logicalNotOperatorWithStringType.types index 5ca820ea6d0aa..0d3c1e88fd1d3 100644 --- a/tests/baselines/reference/logicalNotOperatorWithStringType.types +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.types @@ -6,12 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] ->"" : string ->"abc" : string +>"" : "" +>"abc" : "abc" function foo(): string { return "abc"; } >foo : () => string ->"abc" : string +>"abc" : "abc" class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return ""; } >foo : () => string ->"" : string +>"" : "" } module M { >M : typeof M @@ -49,24 +49,24 @@ var ResultIsBoolean2 = !STRING1; // string type literal var ResultIsBoolean3 = !""; >ResultIsBoolean3 : boolean ->!"" : boolean ->"" : string +>!"" : true +>"" : "" var ResultIsBoolean4 = !{ x: "", y: "" }; >ResultIsBoolean4 : boolean >!{ x: "", y: "" } : boolean >{ x: "", y: "" } : { x: string; y: string; } >x : string ->"" : string +>"" : "" >y : string ->"" : string +>"" : "" var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } }; >ResultIsBoolean5 : boolean >!{ x: "", y: (s: string) => { return s; } } : boolean >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string ->"" : string +>"" : "" >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -92,7 +92,7 @@ var ResultIsBoolean8 = !STRING1[0]; >!STRING1[0] : boolean >STRING1[0] : string >STRING1 : string[] ->0 : number +>0 : 0 var ResultIsBoolean9 = !foo(); >ResultIsBoolean9 : boolean @@ -123,7 +123,7 @@ var ResultIsBoolean12 = !STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 // multiple ! operator var ResultIsBoolean13 = !!STRING; @@ -144,8 +144,8 @@ var ResultIsBoolean14 = !!!(STRING + STRING); // miss assignment operators !""; ->!"" : boolean ->"" : string +>!"" : true +>"" : "" !STRING; >!STRING : boolean diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.types b/tests/baselines/reference/logicalOrOperatorWithEveryType.types index 8f2f4af069851..327ae64cf07da 100644 --- a/tests/baselines/reference/logicalOrOperatorWithEveryType.types +++ b/tests/baselines/reference/logicalOrOperatorWithEveryType.types @@ -6,9 +6,9 @@ enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a1: any; >a1 : any @@ -163,7 +163,7 @@ var rc1 = a1 || a3; // any || number is any >a3 : number var rc2 = a2 || a3; // boolean || number is boolean | number ->rc2 : number | true +>rc2 : number | boolean >a2 || a3 : number | true >a2 : boolean >a3 : number @@ -223,7 +223,7 @@ var rd1 = a1 || a4; // any || string is any >a4 : string var rd2 = a2 || a4; // boolean || string is boolean | string ->rd2 : string | true +>rd2 : string | boolean >a2 || a4 : string | true >a2 : boolean >a4 : string @@ -283,7 +283,7 @@ var re1 = a1 || a5; // any || void is any >a5 : void var re2 = a2 || a5; // boolean || void is boolean | void ->re2 : true | void +>re2 : boolean | void >a2 || a5 : true | void >a2 : boolean >a5 : void @@ -343,7 +343,7 @@ var rg1 = a1 || a6; // any || enum is any >a6 : E var rg2 = a2 || a6; // boolean || enum is boolean | enum ->rg2 : true | E +>rg2 : boolean | E >a2 || a6 : true | E >a2 : boolean >a6 : E @@ -403,7 +403,7 @@ var rh1 = a1 || a7; // any || object is any >a7 : { a: string; } var rh2 = a2 || a7; // boolean || object is boolean | object ->rh2 : true | { a: string; } +>rh2 : boolean | { a: string; } >a2 || a7 : true | { a: string; } >a2 : boolean >a7 : { a: string; } @@ -463,7 +463,7 @@ var ri1 = a1 || a8; // any || array is any >a8 : string[] var ri2 = a2 || a8; // boolean || array is boolean | array ->ri2 : true | string[] +>ri2 : boolean | string[] >a2 || a8 : true | string[] >a2 : boolean >a8 : string[] @@ -523,7 +523,7 @@ var rj1 = a1 || null; // any || null is any >null : null var rj2 = a2 || null; // boolean || null is boolean ->rj2 : true +>rj2 : boolean >a2 || null : true >a2 : boolean >null : null @@ -583,7 +583,7 @@ var rf1 = a1 || undefined; // any || undefined is any >undefined : undefined var rf2 = a2 || undefined; // boolean || undefined is boolean ->rf2 : true +>rf2 : boolean >a2 || undefined : true >a2 : boolean >undefined : undefined diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types index f887ad7ae140c..ecd3fc5270900 100644 --- a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types @@ -112,7 +112,7 @@ function fn3t : T >{ a: '' } : { a: string; } >a : string ->'' : string +>'' : "" var r4: { a: string } = t || u; >r4 : { a: string; } diff --git a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt index 744ebed7d0854..405fa4d203671 100644 --- a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt +++ b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2322: Type '12345' is not assignable to type 'boolean'. ==== tests/cases/compiler/matchReturnTypeInAllBranches.ts (1 errors) ==== @@ -33,7 +33,7 @@ tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2322: Type { return 12345; ~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type '12345' is not assignable to type 'boolean'. } } } diff --git a/tests/baselines/reference/matchingOfObjectLiteralConstraints.types b/tests/baselines/reference/matchingOfObjectLiteralConstraints.types index f694571c72706..76f61c978a83a 100644 --- a/tests/baselines/reference/matchingOfObjectLiteralConstraints.types +++ b/tests/baselines/reference/matchingOfObjectLiteralConstraints.types @@ -15,7 +15,7 @@ foo2({ y: "foo" }, "foo"); >foo2 : (x: U, z: T) => void >{ y: "foo" } : { y: string; } >y : string ->"foo" : string ->"foo" : string +>"foo" : "foo" +>"foo" : "foo" diff --git a/tests/baselines/reference/maxConstraints.errors.txt b/tests/baselines/reference/maxConstraints.errors.txt index a7d07a5b5f218..ad8ba7f35393c 100644 --- a/tests/baselines/reference/maxConstraints.errors.txt +++ b/tests/baselines/reference/maxConstraints.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. +tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type '1' is not assignable to parameter of type 'Comparable<1 | 2>'. ==== tests/cases/compiler/maxConstraints.ts (1 errors) ==== @@ -11,4 +11,4 @@ tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type 'nu var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; var maxResult = max2(1, 2); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. \ No newline at end of file +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'Comparable<1 | 2>'. \ No newline at end of file diff --git a/tests/baselines/reference/memberAccessMustUseModuleInstances.types b/tests/baselines/reference/memberAccessMustUseModuleInstances.types index b1848660dac78..43291fdf8ca33 100644 --- a/tests/baselines/reference/memberAccessMustUseModuleInstances.types +++ b/tests/baselines/reference/memberAccessMustUseModuleInstances.types @@ -10,7 +10,7 @@ WinJS.Promise.timeout(10); >WinJS : typeof WinJS >Promise : typeof WinJS.Promise >timeout : (delay: number) => WinJS.Promise ->10 : number +>10 : 10 === tests/cases/compiler/memberAccessMustUseModuleInstances_0.ts === export class Promise { diff --git a/tests/baselines/reference/memberVariableDeclarations1.types b/tests/baselines/reference/memberVariableDeclarations1.types index 6f3a3856e1c35..b0c316ced68ee 100644 --- a/tests/baselines/reference/memberVariableDeclarations1.types +++ b/tests/baselines/reference/memberVariableDeclarations1.types @@ -12,7 +12,7 @@ class Employee { public retired = false; >retired : boolean ->false : boolean +>false : false public manager: Employee = null; >manager : Employee diff --git a/tests/baselines/reference/mergeWithImportedNamespace.types b/tests/baselines/reference/mergeWithImportedNamespace.types index d6c1df3b6090c..b4cd2bf4e6d49 100644 --- a/tests/baselines/reference/mergeWithImportedNamespace.types +++ b/tests/baselines/reference/mergeWithImportedNamespace.types @@ -2,7 +2,7 @@ export namespace N { export var x = 1; } >N : typeof N >x : number ->1 : number +>1 : 1 === tests/cases/compiler/f2.ts === import {N} from "./f1"; diff --git a/tests/baselines/reference/mergedDeclarations1.types b/tests/baselines/reference/mergedDeclarations1.types index 2a4f18947ce88..09eaa2a7ca26b 100644 --- a/tests/baselines/reference/mergedDeclarations1.types +++ b/tests/baselines/reference/mergedDeclarations1.types @@ -28,8 +28,8 @@ module point { >origin : Point >point(0, 0) : Point >point : typeof point ->0 : number ->0 : number +>0 : 0 +>0 : 0 export function equals(p1: Point, p2: Point) { >equals : (p1: Point, p2: Point) => boolean @@ -60,8 +60,8 @@ var p1 = point(0, 0); >p1 : Point >point(0, 0) : Point >point : typeof point ->0 : number ->0 : number +>0 : 0 +>0 : 0 var p2 = point.origin; >p2 : Point diff --git a/tests/baselines/reference/mergedDeclarations4.types b/tests/baselines/reference/mergedDeclarations4.types index 9c55747c6f68e..4bf9f3b896ef5 100644 --- a/tests/baselines/reference/mergedDeclarations4.types +++ b/tests/baselines/reference/mergedDeclarations4.types @@ -30,7 +30,7 @@ module M { export var hello = 1; >hello : number ->1 : number +>1 : 1 } f(); >f() : void diff --git a/tests/baselines/reference/mergedInterfacesWithIndexers.types b/tests/baselines/reference/mergedInterfacesWithIndexers.types index b228931660a3c..947c47f6ed77a 100644 --- a/tests/baselines/reference/mergedInterfacesWithIndexers.types +++ b/tests/baselines/reference/mergedInterfacesWithIndexers.types @@ -25,17 +25,17 @@ var r = a[1]; >r : string >a[1] : string >a : A ->1 : number +>1 : 1 var r2 = a['1']; >r2 : { length: number; } >a['1'] : { length: number; } >a : A ->'1' : string +>'1' : "1" var r3 = a['hi']; >r3 : { length: number; } >a['hi'] : { length: number; } >a : A ->'hi' : string +>'hi' : "hi" diff --git a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types index 484cee0b0af1d..641778fe9bbcc 100644 --- a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types +++ b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types @@ -4,7 +4,7 @@ module M { export var v = 10; >v : number ->10 : number +>10 : 10 v; >v : number diff --git a/tests/baselines/reference/methodContainingLocalFunction.types b/tests/baselines/reference/methodContainingLocalFunction.types index 8b6d102ade809..313b457ae7022 100644 --- a/tests/baselines/reference/methodContainingLocalFunction.types +++ b/tests/baselines/reference/methodContainingLocalFunction.types @@ -129,7 +129,7 @@ enum E { >localFunction : () => void return 0; ->0 : number +>0 : 0 })() } diff --git a/tests/baselines/reference/missingSemicolonInModuleSpecifier.types b/tests/baselines/reference/missingSemicolonInModuleSpecifier.types index b68c68b62e0a8..f7730558b68a8 100644 --- a/tests/baselines/reference/missingSemicolonInModuleSpecifier.types +++ b/tests/baselines/reference/missingSemicolonInModuleSpecifier.types @@ -1,16 +1,16 @@ === tests/cases/compiler/a.ts === export const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 === tests/cases/compiler/b.ts === import {x} from "./a" ->x : number +>x : 1 (function() { return 1; }()) >(function() { return 1; }()) : number >function() { return 1; }() : number >function() { return 1; } : () => number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.types b/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.types index dfd482a6bc894..097383ee75e5e 100644 --- a/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.types +++ b/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.types @@ -8,7 +8,7 @@ function f() { public baz = 1; >baz : number ->1 : number +>1 : 1 static foo() { } >foo : () => void diff --git a/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.types b/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.types index 87a200ee56e4f..4f454754b2b86 100644 --- a/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.types +++ b/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.types @@ -10,13 +10,13 @@ function g() { public prop1 = 1; >prop1 : number ->1 : number +>1 : 1 private foo() { } >foo : () => void static prop2 = 43; >prop2 : number ->43 : number +>43 : 43 } } diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.errors.txt b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.errors.txt index b5da9f9786784..f5a8b84ac29c6 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.errors.txt +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.ts(8,1): error TS2322: Type 'boolean' is not assignable to type 'string'. +tests/cases/compiler/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.ts(8,1): error TS2322: Type 'false' is not assignable to type 'string'. tests/cases/compiler/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.ts(8,3): error TS2304: Cannot find name 'Symbol'. @@ -12,6 +12,6 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6We let a = ['c', 'd']; a[Symbol.isConcatSpreadable] = false; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'false' is not assignable to type 'string'. ~~~~~~ !!! error TS2304: Cannot find name 'Symbol'. \ No newline at end of file diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index 3851714cad8fc..34f51fea3f3f7 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -18,9 +18,9 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); // no error >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 // Using ES6 collection var m = new Map(); @@ -56,12 +56,12 @@ function* gen() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -78,12 +78,12 @@ function* gen2() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -101,7 +101,7 @@ Math.sign(1); >Math.sign : (x: number) => number >Math : Math >sign : (x: number) => number ->1 : number +>1 : 1 // Using ES6 object var o = { @@ -110,7 +110,7 @@ var o = { a: 2, >a : number ->2 : number +>2 : 2 [Symbol.hasInstance](value: any) { >Symbol.hasInstance : symbol @@ -119,7 +119,7 @@ var o = { >value : any return false; ->false : boolean +>false : false } }; o.hasOwnProperty(Symbol.hasInstance); @@ -159,7 +159,7 @@ out().then(() => { >console.log : any >console : any >log : any ->"Yea!" : string +>"Yea!" : "Yea!" }); @@ -188,7 +188,7 @@ var reg = new RegExp("/s"); >reg : RegExp >new RegExp("/s") : RegExp >RegExp : RegExpConstructor ->"/s" : string +>"/s" : "/s" reg.flags; >reg.flags : string @@ -198,15 +198,15 @@ reg.flags; // Using ES6 string var str = "Hello world"; >str : string ->"Hello world" : string +>"Hello world" : "Hello world" str.includes("hello", 0); >str.includes("hello", 0) : boolean >str.includes : (searchString: string, position?: number) => boolean >str : string >includes : (searchString: string, position?: number) => boolean ->"hello" : string ->0 : number +>"hello" : "hello" +>0 : 0 // Using ES6 symbol var s = Symbol(); @@ -226,6 +226,6 @@ const o1 = { >value : any return false; ->false : boolean +>false : false } } diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index f9c1894f86f19..0d5847133ec34 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -18,9 +18,9 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); // no error >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 // Using ES6 collection var m = new Map(); @@ -56,12 +56,12 @@ function* gen() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -78,12 +78,12 @@ function* gen2() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -101,7 +101,7 @@ Math.sign(1); >Math.sign : (x: number) => number >Math : Math >sign : (x: number) => number ->1 : number +>1 : 1 // Using ES6 object var o = { @@ -110,7 +110,7 @@ var o = { a: 2, >a : number ->2 : number +>2 : 2 [Symbol.hasInstance](value: any) { >Symbol.hasInstance : symbol @@ -119,7 +119,7 @@ var o = { >value : any return false; ->false : boolean +>false : false } }; o.hasOwnProperty(Symbol.hasInstance); @@ -159,7 +159,7 @@ out().then(() => { >console.log : any >console : any >log : any ->"Yea!" : string +>"Yea!" : "Yea!" }); @@ -188,7 +188,7 @@ var reg = new RegExp("/s"); >reg : RegExp >new RegExp("/s") : RegExp >RegExp : RegExpConstructor ->"/s" : string +>"/s" : "/s" reg.flags; >reg.flags : string @@ -198,15 +198,15 @@ reg.flags; // Using ES6 string var str = "Hello world"; >str : string ->"Hello world" : string +>"Hello world" : "Hello world" str.includes("hello", 0); >str.includes("hello", 0) : boolean >str.includes : (searchString: string, position?: number) => boolean >str : string >includes : (searchString: string, position?: number) => boolean ->"hello" : string ->0 : number +>"hello" : "hello" +>0 : 0 // Using ES6 symbol var s = Symbol(); @@ -226,6 +226,6 @@ const o1 = { >value : any return false; ->false : boolean +>false : false } } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index 8728176c2c1d0..12950cf56b24c 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -18,9 +18,9 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); // no error >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 // Using ES6 collection var m = new Map(); @@ -56,12 +56,12 @@ function* gen() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -78,12 +78,12 @@ function* gen2() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -101,7 +101,7 @@ Math.sign(1); >Math.sign : (x: number) => number >Math : Math >sign : (x: number) => number ->1 : number +>1 : 1 // Using ES6 object var o = { @@ -110,7 +110,7 @@ var o = { a: 2, >a : number ->2 : number +>2 : 2 [Symbol.hasInstance](value: any) { >Symbol.hasInstance : symbol @@ -119,7 +119,7 @@ var o = { >value : any return false; ->false : boolean +>false : false } }; o.hasOwnProperty(Symbol.hasInstance); @@ -159,7 +159,7 @@ out().then(() => { >console.log : any >console : any >log : any ->"Yea!" : string +>"Yea!" : "Yea!" }); @@ -188,7 +188,7 @@ var reg = new RegExp("/s"); >reg : RegExp >new RegExp("/s") : RegExp >RegExp : RegExpConstructor ->"/s" : string +>"/s" : "/s" reg.flags; >reg.flags : string @@ -198,15 +198,15 @@ reg.flags; // Using ES6 string var str = "Hello world"; >str : string ->"Hello world" : string +>"Hello world" : "Hello world" str.includes("hello", 0); >str.includes("hello", 0) : boolean >str.includes : (searchString: string, position?: number) => boolean >str : string >includes : (searchString: string, position?: number) => boolean ->"hello" : string ->0 : number +>"hello" : "hello" +>0 : 0 // Using ES6 symbol var s = Symbol(); @@ -226,6 +226,6 @@ const o1 = { >value : any return false; ->false : boolean +>false : false } } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types index 248364f8d5513..5b96ce987bcb6 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types @@ -18,9 +18,9 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); // no error >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 // Using ES6 collection var m = new Map(); @@ -56,7 +56,7 @@ Math.sign(1); >Math.sign : (x: number) => number >Math : Math >sign : (x: number) => number ->1 : number +>1 : 1 // Using ES6 object var o = { @@ -65,7 +65,7 @@ var o = { a: 2, >a : number ->2 : number +>2 : 2 [Symbol.hasInstance](value: any) { >Symbol.hasInstance : symbol @@ -74,7 +74,7 @@ var o = { >value : any return false; ->false : boolean +>false : false } }; o.hasOwnProperty(Symbol.hasInstance); @@ -111,7 +111,7 @@ var reg = new RegExp("/s"); >reg : RegExp >new RegExp("/s") : RegExp >RegExp : RegExpConstructor ->"/s" : string +>"/s" : "/s" reg.flags; >reg.flags : string @@ -121,15 +121,15 @@ reg.flags; // Using ES6 string var str = "Hello world"; >str : string ->"Hello world" : string +>"Hello world" : "Hello world" str.includes("hello", 0); >str.includes("hello", 0) : boolean >str.includes : (searchString: string, position?: number) => boolean >str : string >includes : (searchString: string, position?: number) => boolean ->"hello" : string ->0 : number +>"hello" : "hello" +>0 : 0 // Using ES6 symbol var s = Symbol(); @@ -149,6 +149,6 @@ const o1 = { >value : any return false; ->false : boolean +>false : false } } diff --git a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types index d17a6fcbcbbf6..a097b11618680 100644 --- a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types +++ b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types @@ -18,7 +18,7 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 diff --git a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types index cee8d3fb96b4e..cceb9a1925e4a 100644 --- a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types +++ b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types @@ -28,18 +28,18 @@ function* idGen() { let i = 10; >i : number ->10 : number +>10 : 10 while (i < 20) { >i < 20 : boolean >i : number ->20 : number +>20 : 20 yield i + 2; >yield i + 2 : any >i + 2 : number >i : number ->2 : number +>2 : 2 } } diff --git a/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types b/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types index 3ae08c79fd455..6accc7e79056c 100644 --- a/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types +++ b/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types @@ -17,22 +17,22 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); // no error >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 let a = ['c', 'd']; >a : string[] >['c', 'd'] : string[] ->'c' : string ->'d' : string +>'c' : "c" +>'d' : "d" a[Symbol.isConcatSpreadable] = false; ->a[Symbol.isConcatSpreadable] = false : boolean +>a[Symbol.isConcatSpreadable] = false : false >a[Symbol.isConcatSpreadable] : any >a : string[] >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ->false : boolean +>false : false diff --git a/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types b/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types index fad835029c24d..6c693b2b23bec 100644 --- a/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types +++ b/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types @@ -79,5 +79,5 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types b/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types index 85e4ead2ac0cc..ee302e6407ec9 100644 --- a/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types +++ b/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types @@ -79,7 +79,7 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 let z1 = Observable.someValue.toFixed(); >z1 : string diff --git a/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types b/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types index e6ee79e358508..6c2c8c8e781ae 100644 --- a/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types +++ b/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types @@ -20,7 +20,7 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 === tests/cases/compiler/map.ts === diff --git a/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types b/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types index 70288e48f028b..b938cf9944e45 100644 --- a/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types +++ b/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types @@ -20,7 +20,7 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 let z1 = Observable.someValue.toFixed(); >z1 : string diff --git a/tests/baselines/reference/moduleAugmentationExtendFileModule1.types b/tests/baselines/reference/moduleAugmentationExtendFileModule1.types index fad835029c24d..6c693b2b23bec 100644 --- a/tests/baselines/reference/moduleAugmentationExtendFileModule1.types +++ b/tests/baselines/reference/moduleAugmentationExtendFileModule1.types @@ -79,5 +79,5 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/moduleAugmentationExtendFileModule2.types b/tests/baselines/reference/moduleAugmentationExtendFileModule2.types index 85e4ead2ac0cc..ee302e6407ec9 100644 --- a/tests/baselines/reference/moduleAugmentationExtendFileModule2.types +++ b/tests/baselines/reference/moduleAugmentationExtendFileModule2.types @@ -79,7 +79,7 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 let z1 = Observable.someValue.toFixed(); >z1 : string diff --git a/tests/baselines/reference/moduleAugmentationGlobal1.types b/tests/baselines/reference/moduleAugmentationGlobal1.types index 9963cbe116212..48ed21e21457c 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal1.types +++ b/tests/baselines/reference/moduleAugmentationGlobal1.types @@ -25,7 +25,7 @@ declare global { let x = [1]; >x : number[] >[1] : number[] ->1 : number +>1 : 1 let y = x.getA().x; >y : number diff --git a/tests/baselines/reference/moduleAugmentationGlobal2.types b/tests/baselines/reference/moduleAugmentationGlobal2.types index 96252569da6d0..f80f0ec7c72c0 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal2.types +++ b/tests/baselines/reference/moduleAugmentationGlobal2.types @@ -24,7 +24,7 @@ declare global { let x = [1]; >x : number[] >[1] : number[] ->1 : number +>1 : 1 let y = x.getCountAsString().toLowerCase(); >y : string diff --git a/tests/baselines/reference/moduleAugmentationGlobal3.types b/tests/baselines/reference/moduleAugmentationGlobal3.types index 0e8e731aec171..3b9ed24a452b2 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal3.types +++ b/tests/baselines/reference/moduleAugmentationGlobal3.types @@ -27,7 +27,7 @@ import "./f2"; let x = [1]; >x : number[] >[1] : number[] ->1 : number +>1 : 1 let y = x.getCountAsString().toLowerCase(); >y : string diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule5.types b/tests/baselines/reference/moduleAugmentationInAmbientModule5.types index 998452be45000..d6d81f97a3a82 100644 --- a/tests/baselines/reference/moduleAugmentationInAmbientModule5.types +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule5.types @@ -5,7 +5,7 @@ import "array"; let x = [1]; >x : number[] >[1] : number[] ->1 : number +>1 : 1 let y = x.getA().x; >y : number diff --git a/tests/baselines/reference/moduleAugmentationNoNewNames.types b/tests/baselines/reference/moduleAugmentationNoNewNames.types index 37dc54b666347..06eab66c8d148 100644 --- a/tests/baselines/reference/moduleAugmentationNoNewNames.types +++ b/tests/baselines/reference/moduleAugmentationNoNewNames.types @@ -82,5 +82,5 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/moduleAugmentationsBundledOutput1.types b/tests/baselines/reference/moduleAugmentationsBundledOutput1.types index 80e9127905d6c..c3cac91fa38ad 100644 --- a/tests/baselines/reference/moduleAugmentationsBundledOutput1.types +++ b/tests/baselines/reference/moduleAugmentationsBundledOutput1.types @@ -18,7 +18,7 @@ import {Cls} from "./m1"; >prototype : Cls >foo : any >function() { return 1; } : () => number ->1 : number +>1 : 1 (Cls.prototype).bar = function() { return "1"; }; >(Cls.prototype).bar = function() { return "1"; } : () => string @@ -30,7 +30,7 @@ import {Cls} from "./m1"; >prototype : Cls >bar : any >function() { return "1"; } : () => string ->"1" : string +>"1" : "1" declare module "./m1" { interface Cls { diff --git a/tests/baselines/reference/moduleCodeGenTest3.types b/tests/baselines/reference/moduleCodeGenTest3.types index 288b794326f61..77c59d8fc7300 100644 --- a/tests/baselines/reference/moduleCodeGenTest3.types +++ b/tests/baselines/reference/moduleCodeGenTest3.types @@ -2,12 +2,12 @@ module Baz { export var x = "hello"; } >Baz : typeof Baz >x : string ->"hello" : string +>"hello" : "hello" Baz.x = "goodbye"; ->Baz.x = "goodbye" : string +>Baz.x = "goodbye" : "goodbye" >Baz.x : string >Baz : typeof Baz >x : string ->"goodbye" : string +>"goodbye" : "goodbye" diff --git a/tests/baselines/reference/moduleCodeGenTest5.types b/tests/baselines/reference/moduleCodeGenTest5.types index c2e4ccf6d6511..b49c0c895d225 100644 --- a/tests/baselines/reference/moduleCodeGenTest5.types +++ b/tests/baselines/reference/moduleCodeGenTest5.types @@ -1,11 +1,11 @@ === tests/cases/compiler/moduleCodeGenTest5.ts === export var x = 0; >x : number ->0 : number +>0 : 0 var y = 0; >y : number ->0 : number +>0 : 0 export function f1() {} >f1 : () => void @@ -18,7 +18,7 @@ export class C1 { public p1 = 0; >p1 : number ->0 : number +>0 : 0 public p2() {} >p2 : () => void @@ -28,7 +28,7 @@ class C2{ public p1 = 0; >p1 : number ->0 : number +>0 : 0 public p2() {} >p2 : () => void @@ -37,7 +37,7 @@ class C2{ export enum E1 {A=0} >E1 : E1 >A : E1 ->0 : number +>0 : 0 var u = E1.A; >u : E1 @@ -48,7 +48,7 @@ var u = E1.A; enum E2 {B=0} >E2 : E2 >B : E2 ->0 : number +>0 : 0 var v = E2.B; >v : E2 diff --git a/tests/baselines/reference/moduleCodegenTest4.types b/tests/baselines/reference/moduleCodegenTest4.types index 919432c938f1f..1c419e8710f93 100644 --- a/tests/baselines/reference/moduleCodegenTest4.types +++ b/tests/baselines/reference/moduleCodegenTest4.types @@ -2,16 +2,16 @@ export module Baz { export var x = "hello"; } >Baz : typeof Baz >x : string ->"hello" : string +>"hello" : "hello" Baz.x = "goodbye"; ->Baz.x = "goodbye" : string +>Baz.x = "goodbye" : "goodbye" >Baz.x : string >Baz : typeof Baz >x : string ->"goodbye" : string +>"goodbye" : "goodbye" void 0; >void 0 : undefined ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/moduleIdentifiers.types b/tests/baselines/reference/moduleIdentifiers.types index dc5408238158f..fccf8a9a904a4 100644 --- a/tests/baselines/reference/moduleIdentifiers.types +++ b/tests/baselines/reference/moduleIdentifiers.types @@ -9,7 +9,7 @@ module M { export var a = 1 >a : number ->1 : number +>1 : 1 } //var p: M.P; diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types index 733eb617c6622..a9a0c4bbd5c51 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types @@ -75,7 +75,7 @@ module TypeScript { >findTokenInternal : (x: any, y: any, z: any) => any >null : null >position : number ->0 : number +>0 : 0 return null; >null : null diff --git a/tests/baselines/reference/moduleMerge.types b/tests/baselines/reference/moduleMerge.types index 06d532673edc0..99fe3c2a7c6b0 100644 --- a/tests/baselines/reference/moduleMerge.types +++ b/tests/baselines/reference/moduleMerge.types @@ -11,7 +11,7 @@ module A >Hello : () => string { return "from private B"; ->"from private B" : string +>"from private B" : "from private B" } } } @@ -26,7 +26,7 @@ module A >Hello : () => string { return "from export B"; ->"from export B" : string +>"from export B" : "from export B" } } } diff --git a/tests/baselines/reference/moduleNoEmit.types b/tests/baselines/reference/moduleNoEmit.types index 1097bea5a4cdf..da5f58fde37ee 100644 --- a/tests/baselines/reference/moduleNoEmit.types +++ b/tests/baselines/reference/moduleNoEmit.types @@ -4,6 +4,6 @@ module Foo { 1+1; >1+1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 } diff --git a/tests/baselines/reference/modulePrologueAMD.types b/tests/baselines/reference/modulePrologueAMD.types index b57b5a8bf2f33..f4c390ac060ad 100644 --- a/tests/baselines/reference/modulePrologueAMD.types +++ b/tests/baselines/reference/modulePrologueAMD.types @@ -1,6 +1,6 @@ === tests/cases/compiler/modulePrologueAMD.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Foo {} >Foo : Foo diff --git a/tests/baselines/reference/modulePrologueCommonjs.types b/tests/baselines/reference/modulePrologueCommonjs.types index 5d76532b3e47b..0aeaef6c38e1b 100644 --- a/tests/baselines/reference/modulePrologueCommonjs.types +++ b/tests/baselines/reference/modulePrologueCommonjs.types @@ -1,6 +1,6 @@ === tests/cases/compiler/modulePrologueCommonjs.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Foo {} >Foo : Foo diff --git a/tests/baselines/reference/modulePrologueES6.types b/tests/baselines/reference/modulePrologueES6.types index 5f09a60ac6aa7..4b6a74608cb55 100644 --- a/tests/baselines/reference/modulePrologueES6.types +++ b/tests/baselines/reference/modulePrologueES6.types @@ -1,6 +1,6 @@ === tests/cases/compiler/modulePrologueES6.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Foo {} >Foo : Foo diff --git a/tests/baselines/reference/modulePrologueSystem.types b/tests/baselines/reference/modulePrologueSystem.types index ac0d52e4a2b8f..f54048b79a42a 100644 --- a/tests/baselines/reference/modulePrologueSystem.types +++ b/tests/baselines/reference/modulePrologueSystem.types @@ -1,6 +1,6 @@ === tests/cases/compiler/modulePrologueSystem.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Foo {} >Foo : Foo diff --git a/tests/baselines/reference/modulePrologueUmd.types b/tests/baselines/reference/modulePrologueUmd.types index 2a1064da8e2a3..02f90df9704a7 100644 --- a/tests/baselines/reference/modulePrologueUmd.types +++ b/tests/baselines/reference/modulePrologueUmd.types @@ -1,6 +1,6 @@ === tests/cases/compiler/modulePrologueUmd.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Foo {} >Foo : Foo diff --git a/tests/baselines/reference/moduleResolutionNoResolve.types b/tests/baselines/reference/moduleResolutionNoResolve.types index 3e96ed2b19762..dbec43bf1a210 100644 --- a/tests/baselines/reference/moduleResolutionNoResolve.types +++ b/tests/baselines/reference/moduleResolutionNoResolve.types @@ -6,5 +6,5 @@ import a = require('./b'); === tests/cases/compiler/b.ts === export var c = ''; >c : string ->'' : string +>'' : "" diff --git a/tests/baselines/reference/moduleResolutionWithExtensions.types b/tests/baselines/reference/moduleResolutionWithExtensions.types index f59eda1a81e79..60196f2b25d7e 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions.types +++ b/tests/baselines/reference/moduleResolutionWithExtensions.types @@ -5,12 +5,12 @@ No type information for this code. No type information for this code.// No extension: '.ts' added No type information for this code.=== /src/b.ts === import a from './a'; ->a : number +>a : 0 // '.js' extension: stripped and replaced with '.ts' === /src/d.ts === import a from './a.js'; ->a : number +>a : 0 === /src/jquery.d.ts === declare var x: number; diff --git a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.types b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.types index 57be71c802b6a..bfeb5a14c94c5 100644 --- a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.types +++ b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.types @@ -8,5 +8,5 @@ No type information for this code. No type information for this code.=== tests/cases/compiler/c.ts === export var foo = 42; >foo : number ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.types b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.types index 600b0d946c68f..1e1f0be510107 100644 --- a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.types +++ b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.types @@ -11,9 +11,9 @@ export enum Animals { >Animals : Animals Cat, ->Cat : Animals +>Cat : Animals.Cat Dog ->Dog : Animals +>Dog : Animals.Dog }; diff --git a/tests/baselines/reference/moduleScoping.types b/tests/baselines/reference/moduleScoping.types index b2ee83dc69bbf..7ae2c0a2abfba 100644 --- a/tests/baselines/reference/moduleScoping.types +++ b/tests/baselines/reference/moduleScoping.types @@ -1,29 +1,29 @@ === tests/cases/conformance/externalModules/file1.ts === var v1 = "sausages"; // Global scope >v1 : string ->"sausages" : string +>"sausages" : "sausages" === tests/cases/conformance/externalModules/file2.ts === var v2 = 42; // Global scope >v2 : number ->42 : number +>42 : 42 var v4 = () => 5; >v4 : () => number >() => 5 : () => number ->5 : number +>5 : 5 === tests/cases/conformance/externalModules/file3.ts === export var v3 = true; >v3 : boolean ->true : boolean +>true : true var v2 = [1,2,3]; // Module scope. Should not appear in global scope >v2 : number[] >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 === tests/cases/conformance/externalModules/file4.ts === import file3 = require('./file3'); @@ -47,7 +47,7 @@ var v4 = {a: true, b: NaN}; // Should shadow global v2 in this module >v4 : { a: boolean; b: number; } >{a: true, b: NaN} : { a: boolean; b: number; } >a : boolean ->true : boolean +>true : true >b : number >NaN : number diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types index b473adf2aa477..865546d12fae5 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types @@ -7,7 +7,7 @@ module Z.M { >bar : () => string return ""; ->"" : string +>"" : "" } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types index 56160637e0f4d..b2a3198eab8e4 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types @@ -7,7 +7,7 @@ module Z.M { >bar : () => string return ""; ->"" : string +>"" : "" } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types index b8574a2c71f69..02f47ec112b56 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types @@ -7,7 +7,7 @@ module Z.M { >bar : () => string return ""; ->"" : string +>"" : "" } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types index 65f820e060647..32e5cbd850ec7 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types @@ -7,7 +7,7 @@ module Z.M { >bar : () => string return ""; ->"" : string +>"" : "" } } module A.M { diff --git a/tests/baselines/reference/moduleUnassignedVariable.types b/tests/baselines/reference/moduleUnassignedVariable.types index 3e5ab538ad543..cfc3cb0b3d229 100644 --- a/tests/baselines/reference/moduleUnassignedVariable.types +++ b/tests/baselines/reference/moduleUnassignedVariable.types @@ -4,7 +4,7 @@ module Bar { export var a = 1; >a : number ->1 : number +>1 : 1 function fooA() { return a; } // Correct: return Bar.a >fooA : () => number diff --git a/tests/baselines/reference/moduleVariableArrayIndexer.types b/tests/baselines/reference/moduleVariableArrayIndexer.types index 4c8e73b947811..aa31ab27c6a07 100644 --- a/tests/baselines/reference/moduleVariableArrayIndexer.types +++ b/tests/baselines/reference/moduleVariableArrayIndexer.types @@ -4,7 +4,7 @@ module Bar { export var a = 1; >a : number ->1 : number +>1 : 1 var t = undefined[a][a]; // CG: var t = undefined[Bar.a][a]; >t : any diff --git a/tests/baselines/reference/moduleVariables.types b/tests/baselines/reference/moduleVariables.types index 5bdf8490aed09..71cd74bd078fd 100644 --- a/tests/baselines/reference/moduleVariables.types +++ b/tests/baselines/reference/moduleVariables.types @@ -4,14 +4,14 @@ declare var console: any; var x = 1; >x : number ->1 : number +>1 : 1 module M { >M : typeof M export var x = 2; >x : number ->2 : number +>2 : 2 console.log(x); // 2 >console.log(x) : any @@ -37,7 +37,7 @@ module M { var x = 3; >x : number ->3 : number +>3 : 3 console.log(x); // 3 >console.log(x) : any diff --git a/tests/baselines/reference/moduleVisibilityTest1.types b/tests/baselines/reference/moduleVisibilityTest1.types index b54f897d01434..c8b7a1a8e3187 100644 --- a/tests/baselines/reference/moduleVisibilityTest1.types +++ b/tests/baselines/reference/moduleVisibilityTest1.types @@ -6,15 +6,15 @@ module OuterMod { export function someExportedOuterFunc() { return -1; } >someExportedOuterFunc : () => number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 export module OuterInnerMod { >OuterInnerMod : typeof OuterInnerMod export function someExportedOuterInnerFunc() { return "foo"; } >someExportedOuterInnerFunc : () => string ->"foo" : string +>"foo" : "foo" } } @@ -31,26 +31,26 @@ module M { export function someExportedInnerFunc() { return -2; } >someExportedInnerFunc : () => number ->-2 : number ->2 : number +>-2 : -2 +>2 : 2 } export enum E { >E : E A, ->A : E +>A : E.A B, ->B : E +>B : E.B C, ->C : E +>C : E.C } export var x = 5; >x : number ->5 : number +>5 : 5 export declare var exported_var; >exported_var : any @@ -72,7 +72,7 @@ module M { class B {public b = 0;} >B : B >b : number ->0 : number +>0 : 0 export class C implements I { >C : C @@ -101,30 +101,30 @@ module M { public someMethod() { return 0; } >someMethod : () => number ->0 : number +>0 : 0 public someProp = 1; >someProp : number ->1 : number +>1 : 1 constructor() { function someInnerFunc() { return 2; } >someInnerFunc : () => number ->2 : number +>2 : 2 var someInnerVar = 3; >someInnerVar : number ->3 : number +>3 : 3 } } var someModuleVar = 4; >someModuleVar : number ->4 : number +>4 : 4 function someModuleFunction() { return 5;} >someModuleFunction : () => number ->5 : number +>5 : 5 } module M { @@ -136,11 +136,11 @@ module M { export var meb = M.E.B; >meb : E ->M.E.B : E +>M.E.B : E.B >M.E : typeof E >M : typeof M >E : typeof E ->B : E +>B : E.B } var cprime : M.I = null; @@ -167,11 +167,11 @@ var z = M.x; var alpha = M.E.A; >alpha : M.E ->M.E.A : M.E +>M.E.A : M.E.A >M.E : typeof M.E >M : typeof M >E : typeof M.E ->A : M.E +>A : M.E.A var omega = M.exported_var; >omega : any diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.types b/tests/baselines/reference/moduleWithStatementsOfEveryKind.types index c6f4be850be65..6f2d524370439 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.types +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.types @@ -40,19 +40,19 @@ module A { } enum Color { Blue, Red } >Color : Color ->Blue : Color ->Red : Color +>Blue : Color.Blue +>Red : Color.Red var x = 12; >x : number ->12 : number +>12 : 12 function F(s: string): number { >F : (s: string) => number >s : string return 2; ->2 : number +>2 : 2 } var array: I[] = null; >array : I[] @@ -66,18 +66,18 @@ module A { return 'hello ' + s; >'hello ' + s : string ->'hello ' : string +>'hello ' : "hello " >s : string } var ol = { s: 'hello', id: 2, isvalid: true }; >ol : { s: string; id: number; isvalid: boolean; } >{ s: 'hello', id: 2, isvalid: true } : { s: string; id: number; isvalid: boolean; } >s : string ->'hello' : string +>'hello' : "hello" >id : number ->2 : number +>2 : 2 >isvalid : boolean ->true : boolean +>true : true declare class DC { >DC : DC @@ -128,19 +128,19 @@ module Y { } export enum Color { Blue, Red } >Color : Color ->Blue : Color ->Red : Color +>Blue : Color.Blue +>Red : Color.Red export var x = 12; >x : number ->12 : number +>12 : 12 export function F(s: string): number { >F : (s: string) => number >s : string return 2; ->2 : number +>2 : 2 } export var array: I[] = null; >array : I[] @@ -154,18 +154,18 @@ module Y { return 'hello ' + s; >'hello ' + s : string ->'hello ' : string +>'hello ' : "hello " >s : string } export var ol = { s: 'hello', id: 2, isvalid: true }; >ol : { s: string; id: number; isvalid: boolean; } >{ s: 'hello', id: 2, isvalid: true } : { s: string; id: number; isvalid: boolean; } >s : string ->'hello' : string +>'hello' : "hello" >id : number ->2 : number +>2 : 2 >isvalid : boolean ->true : boolean +>true : true export declare class DC { >DC : DC diff --git a/tests/baselines/reference/moduledecl.types b/tests/baselines/reference/moduledecl.types index 0c117fb51840d..e638286197228 100644 --- a/tests/baselines/reference/moduledecl.types +++ b/tests/baselines/reference/moduledecl.types @@ -156,7 +156,7 @@ module m1 { >d : () => string return "Hello"; ->"Hello" : string +>"Hello" : "Hello" } public e: { x: number; y: string; }; @@ -220,7 +220,7 @@ module m { var a = 10; >a : number ->10 : number +>10 : 10 export var b: number; >b : number @@ -270,7 +270,7 @@ module m13 { >f : () => number return 20; ->20 : number +>20 : 20 } } } @@ -318,14 +318,14 @@ module exportTests { >f2 : () => number return 30; ->30 : number +>30 : 30 } public f3() { >f3 : () => string return "string"; ->"string" : string +>"string" : "string" } } class C2_private { @@ -335,14 +335,14 @@ module exportTests { >f2 : () => number return 30; ->30 : number +>30 : 30 } public f3() { >f3 : () => string return "string"; ->"string" : string +>"string" : "string" } } diff --git a/tests/baselines/reference/multiModuleClodule1.types b/tests/baselines/reference/multiModuleClodule1.types index b958d18f98400..86749bd19357b 100644 --- a/tests/baselines/reference/multiModuleClodule1.types +++ b/tests/baselines/reference/multiModuleClodule1.types @@ -20,11 +20,11 @@ module C { export var x = 1; >x : number ->1 : number +>1 : 1 var y = 2; >y : number ->2 : number +>2 : 2 } module C { >C : typeof C @@ -34,7 +34,7 @@ module C { function baz() { return ''; } >baz : () => string ->'' : string +>'' : "" } var c = new C(C.x); diff --git a/tests/baselines/reference/multiModuleFundule1.types b/tests/baselines/reference/multiModuleFundule1.types index 7eed100c199f7..aed6f825a7c7e 100644 --- a/tests/baselines/reference/multiModuleFundule1.types +++ b/tests/baselines/reference/multiModuleFundule1.types @@ -8,7 +8,7 @@ module C { export var x = 1; >x : number ->1 : number +>1 : 1 } module C { >C : typeof C @@ -21,13 +21,13 @@ var r = C(2); >r : void >C(2) : void >C : typeof C ->2 : number +>2 : 2 var r2 = new C(2); // using void returning function as constructor >r2 : any >new C(2) : any >C : typeof C ->2 : number +>2 : 2 var r3 = C.foo(); >r3 : void diff --git a/tests/baselines/reference/multipleDeclarations.types b/tests/baselines/reference/multipleDeclarations.types index 900d03195d486..195bdc2ad0d61 100644 --- a/tests/baselines/reference/multipleDeclarations.types +++ b/tests/baselines/reference/multipleDeclarations.types @@ -42,11 +42,11 @@ class X { >this : this this.mistake = 'frankly, complete nonsense'; ->this.mistake = 'frankly, complete nonsense' : string +>this.mistake = 'frankly, complete nonsense' : "frankly, complete nonsense" >this.mistake : () => void >this : this >mistake : () => void ->'frankly, complete nonsense' : string +>'frankly, complete nonsense' : "frankly, complete nonsense" } m() { >m : () => void @@ -61,13 +61,13 @@ let x = new X(); >X : typeof X X.prototype.mistake = false; ->X.prototype.mistake = false : boolean +>X.prototype.mistake = false : false >X.prototype.mistake : () => void >X.prototype : X >X : typeof X >prototype : X >mistake : () => void ->false : boolean +>false : false x.m(); >x.m() : void @@ -104,21 +104,21 @@ class Y { >this : this this.mistake = 'even more nonsense'; ->this.mistake = 'even more nonsense' : string +>this.mistake = 'even more nonsense' : "even more nonsense" >this.mistake : any >this : this >mistake : any ->'even more nonsense' : string +>'even more nonsense' : "even more nonsense" } } Y.prototype.mistake = true; ->Y.prototype.mistake = true : boolean +>Y.prototype.mistake = true : true >Y.prototype.mistake : any >Y.prototype : Y >Y : typeof Y >prototype : Y >mistake : any ->true : boolean +>true : true let y = new Y(); >y : Y diff --git a/tests/baselines/reference/nameCollision.types b/tests/baselines/reference/nameCollision.types index e8badb7ab92ef..cfb56fb61e90f 100644 --- a/tests/baselines/reference/nameCollision.types +++ b/tests/baselines/reference/nameCollision.types @@ -6,11 +6,11 @@ module A { // in the generated function call. var A = 12; >A : number ->12 : number +>12 : 12 var _A = ''; >_A : string ->'' : string +>'' : "" } module B { @@ -18,7 +18,7 @@ module B { var A = 12; >A : number ->12 : number +>12 : 12 } module B { @@ -39,29 +39,29 @@ module X { var X = 13; >X : number ->13 : number +>13 : 13 export module Y { >Y : typeof X.Y var Y = 13; >Y : number ->13 : number +>13 : 13 export module Z { >Z : typeof X.Y.Z var X = 12; >X : number ->12 : number +>12 : 12 var Y = 12; >Y : number ->12 : number +>12 : 12 var Z = 12; >Z : number ->12 : number +>12 : 12 } } } @@ -74,8 +74,8 @@ module Y.Y { >Y : Y Red, Blue ->Red : Y ->Blue : Y +>Red : Y.Red +>Blue : Y.Blue } } @@ -93,5 +93,5 @@ module D { export var E = 'hello'; >E : string ->'hello' : string +>'hello' : "hello" } diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types index 7a3c07af187ba..43b91520db39c 100644 --- a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types +++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types @@ -10,7 +10,7 @@ module M { { let M = 0; >M : number ->0 : number +>0 : 0 new C(); >new C() : C diff --git a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types index bffe75896c40c..d1064ea3abb69 100644 --- a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types +++ b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types @@ -1,7 +1,7 @@ === tests/cases/compiler/nameCollisionsInPropertyAssignments.ts === var x = 1 >x : number ->1 : number +>1 : 1 var y = { x() { x++; } }; >y : { x(): void; } diff --git a/tests/baselines/reference/nameDelimitedBySlashes.types b/tests/baselines/reference/nameDelimitedBySlashes.types index 4987a52196fe4..03f4437ff6716 100644 --- a/tests/baselines/reference/nameDelimitedBySlashes.types +++ b/tests/baselines/reference/nameDelimitedBySlashes.types @@ -8,10 +8,10 @@ var x = foo.foo + 42; >foo.foo : number >foo : typeof foo >foo : number ->42 : number +>42 : 42 === tests/cases/conformance/externalModules/test/foo_0.ts === export var foo = 42; >foo : number ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/nameWithFileExtension.types b/tests/baselines/reference/nameWithFileExtension.types index a0fca3d456219..3f3e96eae1c55 100644 --- a/tests/baselines/reference/nameWithFileExtension.types +++ b/tests/baselines/reference/nameWithFileExtension.types @@ -8,10 +8,10 @@ var x = foo.foo + 42; >foo.foo : number >foo : typeof foo >foo : number ->42 : number +>42 : 42 === tests/cases/conformance/externalModules/foo_0.ts === export var foo = 42; >foo : number ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/nameWithRelativePaths.types b/tests/baselines/reference/nameWithRelativePaths.types index ea552cfa5310d..e27170e82f93d 100644 --- a/tests/baselines/reference/nameWithRelativePaths.types +++ b/tests/baselines/reference/nameWithRelativePaths.types @@ -30,14 +30,14 @@ if(foo2.M2.x){ === tests/cases/conformance/externalModules/foo_0.ts === export var foo = 42; >foo : number ->42 : number +>42 : 42 === tests/cases/conformance/externalModules/test/test/foo_1.ts === export function f(){ >f : () => number return 42; ->42 : number +>42 : 42 } === tests/cases/conformance/externalModules/test/foo_2.ts === @@ -46,6 +46,6 @@ export module M2 { export var x = true; >x : boolean ->true : boolean +>true : true } diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.types b/tests/baselines/reference/namedFunctionExpressionInModule.types index 8202cfbaf1bf4..2a361de76fb49 100644 --- a/tests/baselines/reference/namedFunctionExpressionInModule.types +++ b/tests/baselines/reference/namedFunctionExpressionInModule.types @@ -13,8 +13,8 @@ module Variables{ x(1, 2, 3); >x(1, 2, 3) : void >x : (a: any, b: any, c: any) => void ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 } diff --git a/tests/baselines/reference/narrowingByDiscriminantInLoop.types b/tests/baselines/reference/narrowingByDiscriminantInLoop.types index 50f322636cc2a..c0f6fe73bcaa0 100644 --- a/tests/baselines/reference/narrowingByDiscriminantInLoop.types +++ b/tests/baselines/reference/narrowingByDiscriminantInLoop.types @@ -185,7 +185,7 @@ function f1(x: A | B) { >B : B while (true) { ->true : boolean +>true : true x.prop; >x.prop : { a: string; } | { b: string; } @@ -230,7 +230,7 @@ function f2(x: A | B) { >B : B while (true) { ->true : boolean +>true : true if (x.kind) { >x.kind : boolean diff --git a/tests/baselines/reference/narrowingOfDottedNames.types b/tests/baselines/reference/narrowingOfDottedNames.types index 697e080b661b3..c9c3392b0c346 100644 --- a/tests/baselines/reference/narrowingOfDottedNames.types +++ b/tests/baselines/reference/narrowingOfDottedNames.types @@ -48,7 +48,7 @@ function f1(x: A | B) { >B : B while (true) { ->true : boolean +>true : true if (x instanceof A) { >x instanceof A : boolean @@ -84,7 +84,7 @@ function f2(x: A | B) { >B : B while (true) { ->true : boolean +>true : true if (isA(x)) { >isA(x) : boolean diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.types b/tests/baselines/reference/negateOperatorWithAnyOtherType.types index f864c9d166ce4..75054b49573bc 100644 --- a/tests/baselines/reference/negateOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.types @@ -10,8 +10,8 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] ->"" : string ->"" : string +>"" : "" +>"" : "" var obj: () => {} >obj : () => {} @@ -20,7 +20,7 @@ var obj1 = { x: "", y: () => { }}; >obj1 : { x: string; y: () => void; } >{ x: "", y: () => { }} : { x: string; y: () => void; } >x : string ->"" : string +>"" : "" >y : () => void >() => { } : () => void @@ -108,7 +108,7 @@ var ResultIsNumber8 = -ANY2[0]; >-ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 var ResultIsNumber9 = -obj1.x; >ResultIsNumber9 : number @@ -173,7 +173,7 @@ var ResultIsNumber15 = -(ANY - ANY1); >-ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 -ANY, ANY1; >-ANY, ANY1 : any diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.types b/tests/baselines/reference/negateOperatorWithBooleanType.types index bd61a5608980c..ca383455ec8f7 100644 --- a/tests/baselines/reference/negateOperatorWithBooleanType.types +++ b/tests/baselines/reference/negateOperatorWithBooleanType.types @@ -15,7 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -39,16 +39,16 @@ var ResultIsNumber1 = -BOOLEAN; var ResultIsNumber2 = -true; >ResultIsNumber2 : number >-true : number ->true : boolean +>true : true var ResultIsNumber3 = -{ x: true, y: false }; >ResultIsNumber3 : number >-{ x: true, y: false } : number >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsNumber4 = -objA.a; @@ -82,7 +82,7 @@ var ResultIsNumber7 = -A.foo(); // miss assignment operators -true; >-true : number ->true : boolean +>true : true -BOOLEAN; >-BOOLEAN : number @@ -94,10 +94,10 @@ var ResultIsNumber7 = -A.foo(); >foo : () => boolean -true, false; ->-true, false : boolean +>-true, false : false >-true : number ->true : boolean ->false : boolean +>true : true +>false : false -objA.a; >-objA.a : number diff --git a/tests/baselines/reference/negateOperatorWithEnumType.types b/tests/baselines/reference/negateOperatorWithEnumType.types index 2f39a581ef849..d49f01c7f0dce 100644 --- a/tests/baselines/reference/negateOperatorWithEnumType.types +++ b/tests/baselines/reference/negateOperatorWithEnumType.types @@ -6,8 +6,8 @@ enum ENUM { }; enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 +>A : ENUM1.A +>B : ENUM1.B // enum type var var ResultIsNumber1 = -ENUM; @@ -19,21 +19,21 @@ var ResultIsNumber1 = -ENUM; var ResultIsNumber2 = -ENUM1["B"]; >ResultIsNumber2 : number >-ENUM1["B"] : number ->ENUM1["B"] : ENUM1 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); >ResultIsNumber3 : number >-(ENUM1.B + ENUM1[""]) : number >(ENUM1.B + ENUM1[""]) : number >ENUM1.B + ENUM1[""] : number ->ENUM1.B : ENUM1 +>ENUM1.B : ENUM1.B >ENUM1 : typeof ENUM1 ->B : ENUM1 ->ENUM1[""] : ENUM1 +>B : ENUM1.B +>ENUM1[""] : ENUM1."" >ENUM1 : typeof ENUM1 ->"" : string +>"" : "" // miss assignment operators -ENUM; @@ -46,9 +46,9 @@ var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); -ENUM1["B"]; >-ENUM1["B"] : number ->ENUM1["B"] : ENUM1 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" -ENUM, ENUM1; >-ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/negateOperatorWithNumberType.types b/tests/baselines/reference/negateOperatorWithNumberType.types index e53a4e544445b..d3d9b47463794 100644 --- a/tests/baselines/reference/negateOperatorWithNumberType.types +++ b/tests/baselines/reference/negateOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -49,24 +49,24 @@ var ResultIsNumber2 = -NUMBER1; // number type literal var ResultIsNumber3 = -1; >ResultIsNumber3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 var ResultIsNumber4 = -{ x: 1, y: 2}; >ResultIsNumber4 : number >-{ x: 1, y: 2} : number >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } }; >ResultIsNumber5 : number >-{ x: 1, y: (n: number) => { return n; } } : number >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsNumber8 = -NUMBER1[0]; >-NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsNumber9 = -foo(); >ResultIsNumber9 : number @@ -118,8 +118,8 @@ var ResultIsNumber11 = -(NUMBER - NUMBER); // miss assignment operators -1; ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 -NUMBER; >-NUMBER : number diff --git a/tests/baselines/reference/negateOperatorWithStringType.types b/tests/baselines/reference/negateOperatorWithStringType.types index 6ef570557fe5b..053fd1138018c 100644 --- a/tests/baselines/reference/negateOperatorWithStringType.types +++ b/tests/baselines/reference/negateOperatorWithStringType.types @@ -6,12 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] ->"" : string ->"abc" : string +>"" : "" +>"abc" : "abc" function foo(): string { return "abc"; } >foo : () => string ->"abc" : string +>"abc" : "abc" class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return ""; } >foo : () => string ->"" : string +>"" : "" } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsNumber2 = -STRING1; var ResultIsNumber3 = -""; >ResultIsNumber3 : number >-"" : number ->"" : string +>"" : "" var ResultIsNumber4 = -{ x: "", y: "" }; >ResultIsNumber4 : number >-{ x: "", y: "" } : number >{ x: "", y: "" } : { x: string; y: string; } >x : string ->"" : string +>"" : "" >y : string ->"" : string +>"" : "" var ResultIsNumber5 = -{ x: "", y: (s: string) => { return s; } }; >ResultIsNumber5 : number >-{ x: "", y: (s: string) => { return s; } } : number >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string ->"" : string +>"" : "" >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -92,7 +92,7 @@ var ResultIsNumber8 = -STRING1[0]; >-STRING1[0] : number >STRING1[0] : string >STRING1 : string[] ->0 : number +>0 : 0 var ResultIsNumber9 = -foo(); >ResultIsNumber9 : number @@ -123,12 +123,12 @@ var ResultIsNumber12 = -STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 // miss assignment operators -""; >-"" : number ->"" : string +>"" : "" -STRING; >-STRING : number diff --git a/tests/baselines/reference/negativeZero.types b/tests/baselines/reference/negativeZero.types index 3468e22fdb2bb..114dc337927bd 100644 --- a/tests/baselines/reference/negativeZero.types +++ b/tests/baselines/reference/negativeZero.types @@ -1,6 +1,6 @@ === tests/cases/compiler/negativeZero.ts === var x = -0 >x : number ->-0 : number ->0 : number +>-0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/nestedBlockScopedBindings1.types b/tests/baselines/reference/nestedBlockScopedBindings1.types index e192b0748a55c..1812d54e3703f 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings1.types +++ b/tests/baselines/reference/nestedBlockScopedBindings1.types @@ -4,12 +4,12 @@ function a0() { { let x = 1; >x : number ->1 : number +>1 : 1 } { let x = 1; >x : number ->1 : number +>1 : 1 } } @@ -22,7 +22,7 @@ function a1() { { let x = 1; >x : number ->1 : number +>1 : 1 } } @@ -31,7 +31,7 @@ function a2() { { let x = 1; >x : number ->1 : number +>1 : 1 } { let x; @@ -44,10 +44,10 @@ function a3() { { let x = 1; >x : number ->1 : number +>1 : 1 } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -67,14 +67,14 @@ function a4() { >x : any } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 let x = 1; >x : number ->1 : number +>1 : 1 break; } diff --git a/tests/baselines/reference/nestedBlockScopedBindings10.types b/tests/baselines/reference/nestedBlockScopedBindings10.types index 747f2ef1f2b2d..d002a4f8cb423 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings10.types +++ b/tests/baselines/reference/nestedBlockScopedBindings10.types @@ -4,13 +4,13 @@ >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -19,9 +19,9 @@ switch (1) { >y : any y = 1; ->y = 1 : number +>y = 1 : 1 >y : any ->1 : number +>1 : 1 break; } diff --git a/tests/baselines/reference/nestedBlockScopedBindings11.types b/tests/baselines/reference/nestedBlockScopedBindings11.types index 4d1914d6f1a79..ed356c53ad953 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings11.types +++ b/tests/baselines/reference/nestedBlockScopedBindings11.types @@ -14,7 +14,7 @@ var y; >y : any switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 diff --git a/tests/baselines/reference/nestedBlockScopedBindings12.types b/tests/baselines/reference/nestedBlockScopedBindings12.types index ec75d16a37fe2..1ac7dc39bf00f 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings12.types +++ b/tests/baselines/reference/nestedBlockScopedBindings12.types @@ -6,16 +6,16 @@ var x; >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 } var y; >y : any switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -24,9 +24,9 @@ switch (1) { >y : any y = 1; ->y = 1 : number +>y = 1 : 1 >y : any ->1 : number +>1 : 1 break; } diff --git a/tests/baselines/reference/nestedBlockScopedBindings2.types b/tests/baselines/reference/nestedBlockScopedBindings2.types index 3e7dbe4b75765..2a7d077ad71fb 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings2.types +++ b/tests/baselines/reference/nestedBlockScopedBindings2.types @@ -4,7 +4,7 @@ function a0() { { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -13,7 +13,7 @@ function a0() { { let x = 1; >x : number ->1 : number +>1 : 1 } } @@ -26,7 +26,7 @@ function a1() { { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -39,7 +39,7 @@ function a2() { { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -61,14 +61,14 @@ function a3() { { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number >x : number } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -92,7 +92,7 @@ function a4() { >x : any } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -120,7 +120,7 @@ function a5() { >x : any } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -136,7 +136,7 @@ function a6() { >a6 : () => void switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -147,7 +147,7 @@ function a6() { break; } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -163,7 +163,7 @@ function a7() { >a7 : () => void switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -178,7 +178,7 @@ function a7() { break; } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -194,7 +194,7 @@ function a8() { >a8 : () => void switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -205,7 +205,7 @@ function a8() { break; } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -225,7 +225,7 @@ function a9() { >a9 : () => void switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -240,7 +240,7 @@ function a9() { break; } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 diff --git a/tests/baselines/reference/nestedBlockScopedBindings3.types b/tests/baselines/reference/nestedBlockScopedBindings3.types index e10cffb71232d..0de8123861d5b 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings3.types +++ b/tests/baselines/reference/nestedBlockScopedBindings3.types @@ -4,10 +4,10 @@ function a0() { { for (let x = 0; x < 1; ) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -32,7 +32,7 @@ function a1() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 () => x; >() => x : () => any @@ -54,14 +54,14 @@ function a2() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 } for (let x;;) { >x : any @@ -71,7 +71,7 @@ function a2() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 } } @@ -83,17 +83,17 @@ function a3() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -112,21 +112,21 @@ function a4() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 () => x; >() => x : () => any >x : any } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -146,21 +146,21 @@ function a5() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 () => x; >() => x : () => any >x : any } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 diff --git a/tests/baselines/reference/nestedBlockScopedBindings4.types b/tests/baselines/reference/nestedBlockScopedBindings4.types index b38d61f3f4400..65b5d73db9d85 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings4.types +++ b/tests/baselines/reference/nestedBlockScopedBindings4.types @@ -6,14 +6,14 @@ function a0() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 } for (let x;;) { >x : any @@ -23,7 +23,7 @@ function a0() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 } } @@ -34,14 +34,14 @@ function a1() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 () => x; >() => x : () => any @@ -55,7 +55,7 @@ function a1() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 } } @@ -66,14 +66,14 @@ function a2() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 } for (let x;;) { >x : any @@ -83,7 +83,7 @@ function a2() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 () => x; >() => x : () => any @@ -99,14 +99,14 @@ function a3() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 () => x; >() => x : () => any @@ -120,7 +120,7 @@ function a3() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 () => x; >() => x : () => any diff --git a/tests/baselines/reference/nestedBlockScopedBindings6.types b/tests/baselines/reference/nestedBlockScopedBindings6.types index fa4fa5ec6957e..865dea31e377e 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings6.types +++ b/tests/baselines/reference/nestedBlockScopedBindings6.types @@ -5,14 +5,14 @@ function a0() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 } for (let x;;) { >x : any @@ -22,7 +22,7 @@ function a0() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 } } @@ -32,14 +32,14 @@ function a1() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -53,7 +53,7 @@ function a1() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 } } @@ -63,14 +63,14 @@ function a2() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 } for (let x;;) { >x : any @@ -80,7 +80,7 @@ function a2() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 () => x; >() => x : () => any @@ -94,14 +94,14 @@ function a3() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -115,7 +115,7 @@ function a3() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 () => x; >() => x : () => any @@ -129,21 +129,21 @@ function a4() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number >x : number } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -162,17 +162,17 @@ function a5() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -194,17 +194,17 @@ function a6() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -222,21 +222,21 @@ function a7() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number >x : number } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 diff --git a/tests/baselines/reference/nestedBlockScopedBindings9.types b/tests/baselines/reference/nestedBlockScopedBindings9.types index e27254717fa9e..0aa2ecaa9d786 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings9.types +++ b/tests/baselines/reference/nestedBlockScopedBindings9.types @@ -9,7 +9,7 @@ } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 diff --git a/tests/baselines/reference/nestedIfStatement.types b/tests/baselines/reference/nestedIfStatement.types index 19799d25172a6..d6ea5b80b4fff 100644 --- a/tests/baselines/reference/nestedIfStatement.types +++ b/tests/baselines/reference/nestedIfStatement.types @@ -1,15 +1,15 @@ === tests/cases/compiler/nestedIfStatement.ts === if (0) { ->0 : number +>0 : 0 } else if (1) { ->1 : number +>1 : 1 } else if (2) { ->2 : number +>2 : 2 } else if (3) { ->3 : number +>3 : 3 } else { } diff --git a/tests/baselines/reference/nestedLoopTypeGuards.types b/tests/baselines/reference/nestedLoopTypeGuards.types index 9611fba2fbf30..9d7b793badf96 100644 --- a/tests/baselines/reference/nestedLoopTypeGuards.types +++ b/tests/baselines/reference/nestedLoopTypeGuards.types @@ -16,19 +16,19 @@ function f1() { // a is narrowed to "number | string" for (var i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number for (var j = 0; j < 1; j++) {} >j : number ->0 : number +>0 : 0 >j < 1 : boolean >j : number ->1 : number +>1 : 1 >j++ : number >j : number @@ -41,10 +41,10 @@ function f1() { // a is narrowed to "string' for (var j = 0; j < 1; j++) { >j : number ->0 : number +>0 : 0 >j < 1 : boolean >j : number ->1 : number +>1 : 1 >j++ : number >j : number @@ -71,10 +71,10 @@ function f2() { >'string' : "string" while (1) { ->1 : number +>1 : 1 while (1) {} ->1 : number +>1 : 1 if (typeof a === 'string') { >typeof a === 'string' : boolean @@ -83,7 +83,7 @@ function f2() { >'string' : "string" while (1) { ->1 : number +>1 : 1 a.length; // Should not error here >a.length : number diff --git a/tests/baselines/reference/nestedModules.types b/tests/baselines/reference/nestedModules.types index eee3ee3968a0a..95f6ae406696f 100644 --- a/tests/baselines/reference/nestedModules.types +++ b/tests/baselines/reference/nestedModules.types @@ -27,9 +27,9 @@ module A { >Point : C.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/nestedRedeclarationInES6AMD.types b/tests/baselines/reference/nestedRedeclarationInES6AMD.types index 2b8d971e3c198..ebc93abd3afdc 100644 --- a/tests/baselines/reference/nestedRedeclarationInES6AMD.types +++ b/tests/baselines/reference/nestedRedeclarationInES6AMD.types @@ -4,11 +4,11 @@ function a() { { let status = 1; >status : number ->1 : number +>1 : 1 status = 2; ->status = 2 : number +>status = 2 : 2 >status : number ->2 : number +>2 : 2 } } diff --git a/tests/baselines/reference/nestedSelf.types b/tests/baselines/reference/nestedSelf.types index ed7f084246a93..9fb4b0bd65dcf 100644 --- a/tests/baselines/reference/nestedSelf.types +++ b/tests/baselines/reference/nestedSelf.types @@ -7,16 +7,16 @@ module M { public n = 42; >n : number ->42 : number +>42 : 42 public foo() { [1,2,3].map((x) => { return this.n * x; })} >foo : () => void >[1,2,3].map((x) => { return this.n * x; }) : number[] >[1,2,3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >(x) => { return this.n * x; } : (x: number) => number >x : number diff --git a/tests/baselines/reference/neverType.js b/tests/baselines/reference/neverType.js index 56a1373903ed0..a1e4c71f80386 100644 --- a/tests/baselines/reference/neverType.js +++ b/tests/baselines/reference/neverType.js @@ -180,8 +180,8 @@ declare function fail(): never; declare function failOrThrow(shouldFail: boolean): never; declare function infiniteLoop1(): void; declare function infiniteLoop2(): never; -declare function move1(direction: "up" | "down"): number; -declare function move2(direction: "up" | "down"): number; +declare function move1(direction: "up" | "down"): 1 | -1; +declare function move2(direction: "up" | "down"): 1 | -1; declare function check(x: T | undefined): T; declare class C { void1(): void; diff --git a/tests/baselines/reference/neverType.types b/tests/baselines/reference/neverType.types index 72d8eae6b3b61..bdb1ff56c3e4e 100644 --- a/tests/baselines/reference/neverType.types +++ b/tests/baselines/reference/neverType.types @@ -27,7 +27,7 @@ function fail() { return error("Something failed"); >error("Something failed") : never >error : (message: string) => never ->"Something failed" : string +>"Something failed" : "Something failed" } function failOrThrow(shouldFail: boolean) { @@ -50,7 +50,7 @@ function infiniteLoop1() { >infiniteLoop1 : () => void while (true) { ->true : boolean +>true : true } } @@ -58,12 +58,12 @@ function infiniteLoop2(): never { >infiniteLoop2 : () => never while (true) { ->true : boolean +>true : true } } function move1(direction: "up" | "down") { ->move1 : (direction: "up" | "down") => number +>move1 : (direction: "up" | "down") => 1 | -1 >direction : "up" | "down" switch (direction) { @@ -73,44 +73,44 @@ function move1(direction: "up" | "down") { >"up" : "up" return 1; ->1 : number +>1 : 1 case "down": >"down" : "down" return -1; ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 } return error("Should never get here"); >error("Should never get here") : never >error : (message: string) => never ->"Should never get here" : string +>"Should never get here" : "Should never get here" } function move2(direction: "up" | "down") { ->move2 : (direction: "up" | "down") => number +>move2 : (direction: "up" | "down") => 1 | -1 >direction : "up" | "down" return direction === "up" ? 1 : ->direction === "up" ? 1 : direction === "down" ? -1 : error("Should never get here") : number +>direction === "up" ? 1 : direction === "down" ? -1 : error("Should never get here") : 1 | -1 >direction === "up" : boolean >direction : "up" | "down" >"up" : "up" ->1 : number +>1 : 1 direction === "down" ? -1 : ->direction === "down" ? -1 : error("Should never get here") : number +>direction === "down" ? -1 : error("Should never get here") : -1 >direction === "down" : boolean >direction : "down" >"down" : "down" ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 error("Should never get here"); >error("Should never get here") : never >error : (message: string) => never ->"Should never get here" : string +>"Should never get here" : "Should never get here" } function check(x: T | undefined) { @@ -124,7 +124,7 @@ function check(x: T | undefined) { >x : T | undefined >error("Undefined value") : never >error : (message: string) => never ->"Undefined value" : string +>"Undefined value" : "Undefined value" } class C { @@ -141,7 +141,7 @@ class C { >void2 : () => void while (true) {} ->true : boolean +>true : true } never1(): never { >never1 : () => never @@ -154,7 +154,7 @@ class C { >never2 : () => never while (true) {} ->true : boolean +>true : true } } @@ -178,7 +178,7 @@ function f2(x: string | number) { >x : string | number while (true) { ->true : boolean +>true : true if (typeof x === "boolean") { >typeof x === "boolean" : boolean @@ -210,13 +210,13 @@ let errorCallback = () => error("Error callback"); >() => error("Error callback") : () => never >error("Error callback") : never >error : (message: string) => never ->"Error callback" : string +>"Error callback" : "Error callback" test(() => "hello"); >test(() => "hello") : string >test : (cb: () => string) => string >() => "hello" : () => string ->"hello" : string +>"hello" : "hello" test(() => fail()); >test(() => fail()) : string diff --git a/tests/baselines/reference/neverTypeErrors1.errors.txt b/tests/baselines/reference/neverTypeErrors1.errors.txt index 8fd6f9c924eaa..cb79c0c19fb1f 100644 --- a/tests/baselines/reference/neverTypeErrors1.errors.txt +++ b/tests/baselines/reference/neverTypeErrors1.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/types/never/neverTypeErrors1.ts(3,5): error TS2322: Type 'number' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors1.ts(4,5): error TS2322: Type 'string' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors1.ts(5,5): error TS2322: Type 'boolean' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors1.ts(3,5): error TS2322: Type '1' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors1.ts(4,5): error TS2322: Type '"abc"' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors1.ts(5,5): error TS2322: Type 'false' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors1.ts(6,5): error TS2322: Type 'undefined' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors1.ts(7,5): error TS2322: Type 'null' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors1.ts(8,5): error TS2322: Type '{}' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors1.ts(12,5): error TS2322: Type 'undefined' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors1.ts(16,12): error TS2322: Type 'number' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors1.ts(16,12): error TS2322: Type '1' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors1.ts(19,16): error TS2534: A function returning 'never' cannot have a reachable end point. @@ -14,13 +14,13 @@ tests/cases/conformance/types/never/neverTypeErrors1.ts(19,16): error TS2534: A let x: never; x = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'never'. +!!! error TS2322: Type '1' is not assignable to type 'never'. x = "abc"; ~ -!!! error TS2322: Type 'string' is not assignable to type 'never'. +!!! error TS2322: Type '"abc"' is not assignable to type 'never'. x = false; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'never'. +!!! error TS2322: Type 'false' is not assignable to type 'never'. x = undefined; ~ !!! error TS2322: Type 'undefined' is not assignable to type 'never'. @@ -41,7 +41,7 @@ tests/cases/conformance/types/never/neverTypeErrors1.ts(19,16): error TS2534: A function f3(): never { return 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'never'. +!!! error TS2322: Type '1' is not assignable to type 'never'. } function f4(): never { diff --git a/tests/baselines/reference/neverTypeErrors2.errors.txt b/tests/baselines/reference/neverTypeErrors2.errors.txt index c6292657ad178..ed27e615ea1e7 100644 --- a/tests/baselines/reference/neverTypeErrors2.errors.txt +++ b/tests/baselines/reference/neverTypeErrors2.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/types/never/neverTypeErrors2.ts(4,5): error TS2322: Type 'number' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors2.ts(5,5): error TS2322: Type 'string' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors2.ts(6,5): error TS2322: Type 'boolean' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors2.ts(4,5): error TS2322: Type '1' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors2.ts(5,5): error TS2322: Type '"abc"' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors2.ts(6,5): error TS2322: Type 'false' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors2.ts(7,5): error TS2322: Type 'undefined' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors2.ts(8,5): error TS2322: Type 'null' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors2.ts(9,5): error TS2322: Type '{}' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors2.ts(13,5): error TS2322: Type 'undefined' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors2.ts(17,12): error TS2322: Type 'number' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors2.ts(17,12): error TS2322: Type '1' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors2.ts(20,16): error TS2534: A function returning 'never' cannot have a reachable end point. @@ -15,13 +15,13 @@ tests/cases/conformance/types/never/neverTypeErrors2.ts(20,16): error TS2534: A let x: never; x = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'never'. +!!! error TS2322: Type '1' is not assignable to type 'never'. x = "abc"; ~ -!!! error TS2322: Type 'string' is not assignable to type 'never'. +!!! error TS2322: Type '"abc"' is not assignable to type 'never'. x = false; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'never'. +!!! error TS2322: Type 'false' is not assignable to type 'never'. x = undefined; ~ !!! error TS2322: Type 'undefined' is not assignable to type 'never'. @@ -42,7 +42,7 @@ tests/cases/conformance/types/never/neverTypeErrors2.ts(20,16): error TS2534: A function f3(): never { return 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'never'. +!!! error TS2322: Type '1' is not assignable to type 'never'. } function f4(): never { diff --git a/tests/baselines/reference/newArrays.types b/tests/baselines/reference/newArrays.types index 3c0928a46ea65..7676b9b14f76c 100644 --- a/tests/baselines/reference/newArrays.types +++ b/tests/baselines/reference/newArrays.types @@ -14,11 +14,11 @@ module M { public x = 10; >x : number ->10 : number +>10 : 10 public y = 10; >y : number ->10 : number +>10 : 10 public m () { >m : () => void diff --git a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types index 6d54119880233..badd17765b8d2 100644 --- a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types @@ -15,7 +15,7 @@ var i: I; >I : I var y = new i(""); // y should be string ->y : "" +>y : string >new i("") : "" >i : I >"" : "" diff --git a/tests/baselines/reference/newLineFlagWithCRLF.types b/tests/baselines/reference/newLineFlagWithCRLF.types index 4898d2495b2f8..fc8caa2c32439 100644 --- a/tests/baselines/reference/newLineFlagWithCRLF.types +++ b/tests/baselines/reference/newLineFlagWithCRLF.types @@ -1,11 +1,11 @@ === tests/cases/compiler/newLineFlagWithCRLF.ts === var x=1; >x : number ->1 : number +>1 : 1 x=2; ->x=2 : number +>x=2 : 2 >x : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/newLineFlagWithLF.types b/tests/baselines/reference/newLineFlagWithLF.types index bfdf6072e0e06..e16a15282a086 100644 --- a/tests/baselines/reference/newLineFlagWithLF.types +++ b/tests/baselines/reference/newLineFlagWithLF.types @@ -1,11 +1,11 @@ === tests/cases/compiler/newLineFlagWithLF.ts === var x=1; >x : number ->1 : number +>1 : 1 x=2; ->x=2 : number +>x=2 : 2 >x : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/newOperatorConformance.types b/tests/baselines/reference/newOperatorConformance.types index 912c0a5c81ad8..c7fb0125a1ae4 100644 --- a/tests/baselines/reference/newOperatorConformance.types +++ b/tests/baselines/reference/newOperatorConformance.types @@ -110,7 +110,7 @@ function newFn2(s: T) { >p : string >new s(32) : string >s : T ->32 : number +>32 : 32 var p: string; >p : string diff --git a/tests/baselines/reference/newWithSpreadES5.types b/tests/baselines/reference/newWithSpreadES5.types index a2c83ed6372e0..dfa45b33ee1b5 100644 --- a/tests/baselines/reference/newWithSpreadES5.types +++ b/tests/baselines/reference/newWithSpreadES5.types @@ -84,26 +84,26 @@ var i: C[][]; new f(1, 2, "string"); >new f(1, 2, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new f(1, 2, ...a); >new f(1, 2, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] new f(1, 2, ...a, "string"); >new f(1, 2, ...a, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Multiple spreads arguments new f2(...a, ...a); @@ -117,8 +117,8 @@ new f2(...a, ...a); new f(1 ,2, ...a, ...a); >new f(1 ,2, ...a, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] >...a : string @@ -129,16 +129,16 @@ new f(1, 2, "string")(); >new f(1, 2, "string")() : any >new f(1, 2, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new f(1, 2, ...a)(); >new f(1, 2, ...a)() : any >new f(1, 2, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -146,11 +146,11 @@ new f(1, 2, ...a, "string")(); >new f(1, 2, ...a, "string")() : any >new f(1, 2, ...a, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Property access expression new b.f(1, 2, "string"); @@ -158,17 +158,17 @@ new b.f(1, 2, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new b.f(1, 2, ...a); >new b.f(1, 2, ...a) : any >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -177,11 +177,11 @@ new b.f(1, 2, ...a, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Parenthesised expression new (b.f)(1, 2, "string"); @@ -190,9 +190,9 @@ new (b.f)(1, 2, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new (b.f)(1, 2, ...a); >new (b.f)(1, 2, ...a) : any @@ -200,8 +200,8 @@ new (b.f)(1, 2, ...a); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -211,11 +211,11 @@ new (b.f)(1, 2, ...a, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression new d[1].f(1, 2, "string"); @@ -223,21 +223,21 @@ new d[1].f(1, 2, "string"); >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new d[1].f(1, 2, ...a); >new d[1].f(1, 2, ...a) : any >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -246,13 +246,13 @@ new d[1].f(1, 2, ...a, "string"); >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a punctuated key new e["a-b"].f(1, 2, "string"); @@ -260,21 +260,21 @@ new e["a-b"].f(1, 2, "string"); >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new e["a-b"].f(1, 2, ...a); >new e["a-b"].f(1, 2, ...a) : any >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -283,56 +283,56 @@ new e["a-b"].f(1, 2, ...a, "string"); >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Basic expression new B(1, 2, "string"); >new B(1, 2, "string") : B >B : typeof B ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new B(1, 2, ...a); >new B(1, 2, ...a) : B >B : typeof B ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] new B(1, 2, ...a, "string"); >new B(1, 2, ...a, "string") : B >B : typeof B ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Property access expression new c["a-b"](1, 2, "string"); >new c["a-b"](1, 2, "string") : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new c["a-b"](1, 2, ...a); >new c["a-b"](1, 2, ...a) : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -340,12 +340,12 @@ new c["a-b"](1, 2, ...a, "string"); >new c["a-b"](1, 2, ...a, "string") : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Parenthesised expression new (c["a-b"])(1, 2, "string"); @@ -353,19 +353,19 @@ new (c["a-b"])(1, 2, "string"); >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new (c["a-b"])(1, 2, ...a); >new (c["a-b"])(1, 2, ...a) : B >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -374,12 +374,12 @@ new (c["a-b"])(1, 2, ...a, "string"); >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression new g[1]["a-b"](1, 2, "string"); @@ -387,21 +387,21 @@ new g[1]["a-b"](1, 2, "string"); >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new g[1]["a-b"](1, 2, ...a); >new g[1]["a-b"](1, 2, ...a) : B >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -410,13 +410,13 @@ new g[1]["a-b"](1, 2, ...a, "string"); >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a punctuated key new h["a-b"]["a-b"](1, 2, "string"); @@ -424,21 +424,21 @@ new h["a-b"]["a-b"](1, 2, "string"); >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new h["a-b"]["a-b"](1, 2, ...a); >new h["a-b"]["a-b"](1, 2, ...a) : B >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -447,13 +447,13 @@ new h["a-b"]["a-b"](1, 2, ...a, "string"); >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a number new i["a-b"][1](1, 2, "string"); @@ -461,21 +461,21 @@ new i["a-b"][1](1, 2, "string"); >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 +>"string" : "string" new i["a-b"][1](1, 2, ...a); >new i["a-b"][1](1, 2, ...a) : any >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -484,11 +484,11 @@ new i["a-b"][1](1, 2, ...a, "string"); >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" diff --git a/tests/baselines/reference/newWithSpreadES6.types b/tests/baselines/reference/newWithSpreadES6.types index 52951729e3de4..587e7683e6a83 100644 --- a/tests/baselines/reference/newWithSpreadES6.types +++ b/tests/baselines/reference/newWithSpreadES6.types @@ -85,26 +85,26 @@ var i: C[][]; new f(1, 2, "string"); >new f(1, 2, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new f(1, 2, ...a); >new f(1, 2, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] new f(1, 2, ...a, "string"); >new f(1, 2, ...a, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Multiple spreads arguments new f2(...a, ...a); @@ -118,8 +118,8 @@ new f2(...a, ...a); new f(1 ,2, ...a, ...a); >new f(1 ,2, ...a, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] >...a : string @@ -130,16 +130,16 @@ new f(1, 2, "string")(); >new f(1, 2, "string")() : any >new f(1, 2, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new f(1, 2, ...a)(); >new f(1, 2, ...a)() : any >new f(1, 2, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -147,11 +147,11 @@ new f(1, 2, ...a, "string")(); >new f(1, 2, ...a, "string")() : any >new f(1, 2, ...a, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Property access expression new b.f(1, 2, "string"); @@ -159,17 +159,17 @@ new b.f(1, 2, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new b.f(1, 2, ...a); >new b.f(1, 2, ...a) : any >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -178,11 +178,11 @@ new b.f(1, 2, ...a, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Parenthesised expression new (b.f)(1, 2, "string"); @@ -191,9 +191,9 @@ new (b.f)(1, 2, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new (b.f)(1, 2, ...a); >new (b.f)(1, 2, ...a) : any @@ -201,8 +201,8 @@ new (b.f)(1, 2, ...a); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -212,11 +212,11 @@ new (b.f)(1, 2, ...a, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression new d[1].f(1, 2, "string"); @@ -224,21 +224,21 @@ new d[1].f(1, 2, "string"); >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new d[1].f(1, 2, ...a); >new d[1].f(1, 2, ...a) : any >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -247,13 +247,13 @@ new d[1].f(1, 2, ...a, "string"); >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a punctuated key new e["a-b"].f(1, 2, "string"); @@ -261,21 +261,21 @@ new e["a-b"].f(1, 2, "string"); >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new e["a-b"].f(1, 2, ...a); >new e["a-b"].f(1, 2, ...a) : any >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -284,56 +284,56 @@ new e["a-b"].f(1, 2, ...a, "string"); >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Basic expression new B(1, 2, "string"); >new B(1, 2, "string") : B >B : typeof B ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new B(1, 2, ...a); >new B(1, 2, ...a) : B >B : typeof B ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] new B(1, 2, ...a, "string"); >new B(1, 2, ...a, "string") : B >B : typeof B ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Property access expression new c["a-b"](1, 2, "string"); >new c["a-b"](1, 2, "string") : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new c["a-b"](1, 2, ...a); >new c["a-b"](1, 2, ...a) : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -341,12 +341,12 @@ new c["a-b"](1, 2, ...a, "string"); >new c["a-b"](1, 2, ...a, "string") : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Parenthesised expression new (c["a-b"])(1, 2, "string"); @@ -354,19 +354,19 @@ new (c["a-b"])(1, 2, "string"); >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new (c["a-b"])(1, 2, ...a); >new (c["a-b"])(1, 2, ...a) : B >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -375,12 +375,12 @@ new (c["a-b"])(1, 2, ...a, "string"); >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression new g[1]["a-b"](1, 2, "string"); @@ -388,21 +388,21 @@ new g[1]["a-b"](1, 2, "string"); >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new g[1]["a-b"](1, 2, ...a); >new g[1]["a-b"](1, 2, ...a) : B >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -411,13 +411,13 @@ new g[1]["a-b"](1, 2, ...a, "string"); >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a punctuated key new h["a-b"]["a-b"](1, 2, "string"); @@ -425,21 +425,21 @@ new h["a-b"]["a-b"](1, 2, "string"); >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new h["a-b"]["a-b"](1, 2, ...a); >new h["a-b"]["a-b"](1, 2, ...a) : B >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -448,13 +448,13 @@ new h["a-b"]["a-b"](1, 2, ...a, "string"); >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a number new i["a-b"][1](1, 2, "string"); @@ -462,21 +462,21 @@ new i["a-b"][1](1, 2, "string"); >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 +>"string" : "string" new i["a-b"][1](1, 2, ...a); >new i["a-b"][1](1, 2, ...a) : any >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -485,11 +485,11 @@ new i["a-b"][1](1, 2, ...a, "string"); >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types index 8c3cc633c10d6..da98162609f77 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types @@ -15,7 +15,7 @@ class class1 { var _this = 2; >_this : number ->2 : number +>2 : 2 return callback(_this); >callback(_this) : any @@ -32,7 +32,7 @@ class class2 { constructor() { var _this = 2; >_this : number ->2 : number +>2 : 2 var x2 = { >x2 : { doStuff: (callback: any) => () => any; } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types index 3edf54a594f31..1094638c7a179 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types @@ -11,7 +11,7 @@ function x() { var _this = 5; >_this : number ->5 : number +>5 : 5 x => { console.log(_this); }; >x => { console.log(_this); } : (x: any) => void diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types index 83732f9c350e7..a0a9a25c516c2 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types @@ -15,7 +15,7 @@ var x = { var _this = 2; >_this : number ->2 : number +>2 : 2 return callback(_this); >callback(_this) : any diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types index 49d0e3ed93ac6..6cec96104b529 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types @@ -1,7 +1,7 @@ === tests/cases/compiler/noCollisionThisExpressionAndLocalVarInMethod.ts === var _this = 2; >_this : number ->2 : number +>2 : 2 class a { >a : a @@ -20,7 +20,7 @@ class a { var _this = 2; >_this : number ->2 : number +>2 : 2 return callback(_this); >callback(_this) : any @@ -34,7 +34,7 @@ class a { var _this = 2; >_this : number ->2 : number +>2 : 2 return { >{ doStuff: (callback) => () => { return callback(_this); } } : { doStuff: (callback: any) => () => any; } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types index 8918ccc825c03..e118d92551591 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types @@ -14,7 +14,7 @@ class class1 { var _this = 2; >_this : number ->2 : number +>2 : 2 return callback(_this); >callback(_this) : any @@ -30,7 +30,7 @@ class class2 { constructor() { var _this = 2; >_this : number ->2 : number +>2 : 2 } public prop1 = { >prop1 : { doStuff: (callback: any) => () => any; } @@ -45,7 +45,7 @@ class class2 { return callback(10); >callback(10) : any >callback : any ->10 : number +>10 : 10 } } } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types index c5943ef5c14e2..36332f39505e6 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types @@ -1,7 +1,7 @@ === tests/cases/compiler/noCollisionThisExpressionAndVarInGlobal.ts === var _this = 1; >_this : number ->1 : number +>1 : 1 var f = () => _this; >f : () => number diff --git a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types index ba65e03ba5992..6fb54bbdf9ed4 100644 --- a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types +++ b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types @@ -8,7 +8,7 @@ var console: { } var _this = 5; >_this : number ->5 : number +>5 : 5 function x() { >x : () => void diff --git a/tests/baselines/reference/noEmitOnError.errors.txt b/tests/baselines/reference/noEmitOnError.errors.txt index e03e594809229..87a71c3075667 100644 --- a/tests/baselines/reference/noEmitOnError.errors.txt +++ b/tests/baselines/reference/noEmitOnError.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/noEmitOnError.ts(2,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/noEmitOnError.ts(2,5): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/compiler/noEmitOnError.ts (1 errors) ==== var x: number = ""; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/noErrorTruncation.errors.txt b/tests/baselines/reference/noErrorTruncation.errors.txt index d27fad84e5031..af3acb54bba89 100644 --- a/tests/baselines/reference/noErrorTruncation.errors.txt +++ b/tests/baselines/reference/noErrorTruncation.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/noErrorTruncation.ts(10,7): error TS2322: Type 'number' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'. +tests/cases/compiler/noErrorTruncation.ts(10,7): error TS2322: Type '42' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'. ==== tests/cases/compiler/noErrorTruncation.ts (1 errors) ==== @@ -13,7 +13,7 @@ tests/cases/compiler/noErrorTruncation.ts(10,7): error TS2322: Type 'number' is const x: SomeLongOptionA ~ -!!! error TS2322: Type 'number' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'. +!!! error TS2322: Type '42' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'. | SomeLongOptionB | SomeLongOptionC | SomeLongOptionD diff --git a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types index 9d07a26558d7b..c494d0795dd55 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types +++ b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types @@ -4,21 +4,21 @@ let [a, b, c] = [1, 2, 3]; // no error >b : number >c : number >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 let [a1 = 10, b1 = 10, c1 = 10] = [1, 2, 3]; // no error >a1 : number ->10 : number +>10 : 10 >b1 : number ->10 : number +>10 : 10 >c1 : number ->10 : number +>10 : 10 >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 let [a2 = undefined, b2 = undefined, c2 = undefined] = [1, 2, 3]; // no error >a2 : number @@ -28,9 +28,9 @@ let [a2 = undefined, b2 = undefined, c2 = undefined] = [1, 2, 3]; // no error >c2 : number >undefined : undefined >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 let [a3 = undefined, b3 = null, c3 = undefined] = [1, 2, 3]; // no error >a3 : any @@ -43,9 +43,9 @@ let [a3 = undefined, b3 = null, c3 = undefined] = [1, 2, 3]; // n >undefined : any >undefined : undefined >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 let [a4] = [undefined], [b4] = [null], c4 = undefined, d4 = null; // no error >a4 : any @@ -69,26 +69,26 @@ let {x, y, z} = { x: 1, y: 2, z: 3 }; // no error >z : number >{ x: 1, y: 2, z: 3 } : { x: number; y: number; z: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >z : number ->3 : number +>3 : 3 let {x1 = 10, y1 = 10, z1 = 10} = { x1: 1, y1: 2, z1: 3 }; // no error >x1 : number ->10 : number +>10 : 10 >y1 : number ->10 : number +>10 : 10 >z1 : number ->10 : number +>10 : 10 >{ x1: 1, y1: 2, z1: 3 } : { x1?: number; y1?: number; z1?: number; } >x1 : number ->1 : number +>1 : 1 >y1 : number ->2 : number +>2 : 2 >z1 : number ->3 : number +>3 : 3 let {x2 = undefined, y2 = undefined, z2 = undefined} = { x2: 1, y2: 2, z2: 3 }; // no error >x2 : number @@ -99,11 +99,11 @@ let {x2 = undefined, y2 = undefined, z2 = undefined} = { x2: 1, y2: 2, z2: 3 }; >undefined : undefined >{ x2: 1, y2: 2, z2: 3 } : { x2?: number; y2?: number; z2?: number; } >x2 : number ->1 : number +>1 : 1 >y2 : number ->2 : number +>2 : 2 >z2 : number ->3 : number +>3 : 3 let {x3 = undefined, y3 = null, z3 = undefined} = { x3: 1, y3: 2, z3: 3 }; // no error >x3 : any @@ -117,11 +117,11 @@ let {x3 = undefined, y3 = null, z3 = undefined} = { x3: 1, y3: 2, >undefined : undefined >{ x3: 1, y3: 2, z3: 3 } : { x3?: number; y3?: number; z3?: number; } >x3 : number ->1 : number +>1 : 1 >y3 : number ->2 : number +>2 : 2 >z3 : number ->3 : number +>3 : 3 let {x4} = { x4: undefined }, {y4} = { y4: null }; // no error >x4 : any diff --git a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types index afe2ff7bd22e0..928185a095361 100644 --- a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types +++ b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types @@ -3,8 +3,8 @@ var regexMatchList = ['', '']; >regexMatchList : string[] >['', ''] : string[] ->'' : string ->'' : string +>'' : "" +>'' : "" regexMatchList.forEach(match => ''.replace(match, '')); >regexMatchList.forEach(match => ''.replace(match, '')) : void @@ -15,8 +15,8 @@ regexMatchList.forEach(match => ''.replace(match, '')); >match : string >''.replace(match, '') : string >''.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } ->'' : string +>'' : "" >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >match : string ->'' : string +>'' : "" diff --git a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types index d82b37e0f9e5b..6bb0c04fbb0f4 100644 --- a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types +++ b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types @@ -12,7 +12,7 @@ var strRepresentation1 = MyEmusEnum[0] >strRepresentation1 : string >MyEmusEnum[0] : string >MyEmusEnum : typeof MyEmusEnum ->0 : number +>0 : 0 // Should be okay; should be a string. var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu] @@ -28,14 +28,14 @@ var strRepresentation3 = MyEmusEnum["monehh"]; >strRepresentation3 : any >MyEmusEnum["monehh"] : any >MyEmusEnum : typeof MyEmusEnum ->"monehh" : string +>"monehh" : "monehh" // Should be okay; should be a MyEmusEnum var strRepresentation4 = MyEmusEnum["emu"]; >strRepresentation4 : MyEmusEnum >MyEmusEnum["emu"] : MyEmusEnum >MyEmusEnum : typeof MyEmusEnum ->"emu" : string +>"emu" : "emu" // Should be okay, as we suppress implicit 'any' property access checks @@ -43,18 +43,18 @@ var x = {}["hi"]; >x : any >{}["hi"] : any >{} : {} ->"hi" : string +>"hi" : "hi" // Should be okay, as we suppress implicit 'any' property access checks var y = {}[10]; >y : any >{}[10] : any >{} : {} ->10 : number +>10 : 10 var hi: any = "hi"; >hi : any ->"hi" : string +>"hi" : "hi" var emptyObj = {}; >emptyObj : {} @@ -90,13 +90,13 @@ var m: MyMap = { >{ "0": 0, "1": 1, "2": 2, "Okay that's enough for today.": NaN} : { "0": number; "1": number; "2": number; "Okay that's enough for today.": number; } "0": 0, ->0 : number +>0 : 0 "1": 1, ->1 : number +>1 : 1 "2": 2, ->2 : number +>2 : 2 "Okay that's enough for today.": NaN >NaN : number diff --git a/tests/baselines/reference/noImplicitReturnsInAsync1.types b/tests/baselines/reference/noImplicitReturnsInAsync1.types index 27746bdec5a3b..19da8fdfaf4a3 100644 --- a/tests/baselines/reference/noImplicitReturnsInAsync1.types +++ b/tests/baselines/reference/noImplicitReturnsInAsync1.types @@ -19,5 +19,5 @@ async function test(isError: boolean = false) { >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->"The test is passed without an error." : string +>"The test is passed without an error." : "The test is passed without an error." } diff --git a/tests/baselines/reference/noImplicitReturnsWithProtectedBlocks1.types b/tests/baselines/reference/noImplicitReturnsWithProtectedBlocks1.types index 90db4fb42e178..87214276b7c7b 100644 --- a/tests/baselines/reference/noImplicitReturnsWithProtectedBlocks1.types +++ b/tests/baselines/reference/noImplicitReturnsWithProtectedBlocks1.types @@ -18,6 +18,6 @@ function main1() : number { log("in finally"); >log("in finally") : void >log : (s: string) => void ->"in finally" : string +>"in finally" : "in finally" } } diff --git a/tests/baselines/reference/noImplicitUseStrict_amd.types b/tests/baselines/reference/noImplicitUseStrict_amd.types index c9e1b5749dc0c..5eec5bf57af18 100644 --- a/tests/baselines/reference/noImplicitUseStrict_amd.types +++ b/tests/baselines/reference/noImplicitUseStrict_amd.types @@ -2,5 +2,5 @@ export var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/noImplicitUseStrict_commonjs.types b/tests/baselines/reference/noImplicitUseStrict_commonjs.types index 9999d3b94ba01..ad7ed27dfe6db 100644 --- a/tests/baselines/reference/noImplicitUseStrict_commonjs.types +++ b/tests/baselines/reference/noImplicitUseStrict_commonjs.types @@ -2,5 +2,5 @@ export var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/noImplicitUseStrict_es6.types b/tests/baselines/reference/noImplicitUseStrict_es6.types index 838c7316be059..38a83033ff719 100644 --- a/tests/baselines/reference/noImplicitUseStrict_es6.types +++ b/tests/baselines/reference/noImplicitUseStrict_es6.types @@ -2,5 +2,5 @@ export var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/noImplicitUseStrict_system.types b/tests/baselines/reference/noImplicitUseStrict_system.types index 1da563f938b28..66246719284aa 100644 --- a/tests/baselines/reference/noImplicitUseStrict_system.types +++ b/tests/baselines/reference/noImplicitUseStrict_system.types @@ -2,5 +2,5 @@ export var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/noImplicitUseStrict_umd.types b/tests/baselines/reference/noImplicitUseStrict_umd.types index 6a3fd6ece773a..102f21c238b4b 100644 --- a/tests/baselines/reference/noImplicitUseStrict_umd.types +++ b/tests/baselines/reference/noImplicitUseStrict_umd.types @@ -2,5 +2,5 @@ export var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/noReachabilityErrorsOnEmptyStatement.types b/tests/baselines/reference/noReachabilityErrorsOnEmptyStatement.types index e90fa04699bb2..c971741c5f1eb 100644 --- a/tests/baselines/reference/noReachabilityErrorsOnEmptyStatement.types +++ b/tests/baselines/reference/noReachabilityErrorsOnEmptyStatement.types @@ -3,5 +3,5 @@ function foo() { >foo : () => number return 1;; ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/nodeResolution1.types b/tests/baselines/reference/nodeResolution1.types index 4f29acfcc032d..cd4feb3aba8da 100644 --- a/tests/baselines/reference/nodeResolution1.types +++ b/tests/baselines/reference/nodeResolution1.types @@ -6,5 +6,5 @@ import y = require("./a"); export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/nodeResolution4.types b/tests/baselines/reference/nodeResolution4.types index b273b203bde6b..f52f28df25a2b 100644 --- a/tests/baselines/reference/nodeResolution4.types +++ b/tests/baselines/reference/nodeResolution4.types @@ -6,7 +6,7 @@ import y = require("./a"); var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/a.ts === /// diff --git a/tests/baselines/reference/nodeResolution6.types b/tests/baselines/reference/nodeResolution6.types index 13c5d6d9276d8..9e685e8c49317 100644 --- a/tests/baselines/reference/nodeResolution6.types +++ b/tests/baselines/reference/nodeResolution6.types @@ -6,7 +6,7 @@ import y = require("a"); var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/node_modules/a.d.ts === /// diff --git a/tests/baselines/reference/nodeResolution8.types b/tests/baselines/reference/nodeResolution8.types index cced0d3008d41..757af64a0ef38 100644 --- a/tests/baselines/reference/nodeResolution8.types +++ b/tests/baselines/reference/nodeResolution8.types @@ -6,7 +6,7 @@ import y = require("a"); var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/node_modules/a/index.d.ts === /// diff --git a/tests/baselines/reference/nonInstantiatedModule.types b/tests/baselines/reference/nonInstantiatedModule.types index c1aac2824dca2..97231a5e2c60c 100644 --- a/tests/baselines/reference/nonInstantiatedModule.types +++ b/tests/baselines/reference/nonInstantiatedModule.types @@ -9,7 +9,7 @@ module M { export var a = 1; >a : number ->1 : number +>1 : 1 } // primary expression @@ -52,9 +52,9 @@ module M2 { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/nonIterableRestElement1.types b/tests/baselines/reference/nonIterableRestElement1.types index a15fe5afd38cb..c226eb0413854 100644 --- a/tests/baselines/reference/nonIterableRestElement1.types +++ b/tests/baselines/reference/nonIterableRestElement1.types @@ -9,6 +9,6 @@ var c = {}; >...c : any >c : {} >["", 0] : (string | number)[] ->"" : string ->0 : number +>"" : "" +>0 : 0 diff --git a/tests/baselines/reference/nonIterableRestElement2.types b/tests/baselines/reference/nonIterableRestElement2.types index c39a592d2e68d..af99cc046558c 100644 --- a/tests/baselines/reference/nonIterableRestElement2.types +++ b/tests/baselines/reference/nonIterableRestElement2.types @@ -9,6 +9,6 @@ var c = {}; >...c : any >c : {} >["", 0] : (string | number)[] ->"" : string ->0 : number +>"" : "" +>0 : 0 diff --git a/tests/baselines/reference/null.types b/tests/baselines/reference/null.types index 6fd8b423f1381..35c084c3cbf40 100644 --- a/tests/baselines/reference/null.types +++ b/tests/baselines/reference/null.types @@ -7,13 +7,13 @@ var x=null; var y=3+x; >y : any >3+x : any ->3 : number +>3 : 3 >x : any var z=3+null; >z : number >3+null : number ->3 : number +>3 : 3 >null : null class C { @@ -36,7 +36,7 @@ function g() { >null : null return 3; ->3 : number +>3 : 3 } interface I { >I : I @@ -54,7 +54,7 @@ var w:I={x:null,y:3}; >x : null >null : null >y : number ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types index 42243076e9f1b..a65baab444270 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types @@ -4,14 +4,14 @@ var r0 = true ? null : null; >r0 : any >true ? null : null : null ->true : boolean +>true : true >null : null >null : null var r0 = true ? null : null; >r0 : any >true ? null : null : null ->true : boolean +>true : true >null : null >null : null @@ -22,63 +22,63 @@ var u: typeof undefined; var r0b = true ? u : null; >r0b : any >true ? u : null : any ->true : boolean +>true : true >u : any >null : null var r0b = true ? null : u; >r0b : any >true ? null : u : any ->true : boolean +>true : true >null : null >u : any var r1 = true ? 1 : null; >r1 : number ->true ? 1 : null : number ->true : boolean ->1 : number +>true ? 1 : null : 1 +>true : true +>1 : 1 >null : null var r1 = true ? null : 1; >r1 : number ->true ? null : 1 : number ->true : boolean +>true ? null : 1 : 1 +>true : true >null : null ->1 : number +>1 : 1 var r2 = true ? '' : null; >r2 : string ->true ? '' : null : string ->true : boolean ->'' : string +>true ? '' : null : "" +>true : true +>'' : "" >null : null var r2 = true ? null : ''; >r2 : string ->true ? null : '' : string ->true : boolean +>true ? null : '' : "" +>true : true >null : null ->'' : string +>'' : "" var r3 = true ? true : null; >r3 : boolean ->true ? true : null : boolean ->true : boolean ->true : boolean +>true ? true : null : true +>true : true +>true : true >null : null var r3 = true ? null : true; >r3 : boolean ->true ? null : true : boolean ->true : boolean +>true ? null : true : true +>true : true >null : null ->true : boolean +>true : true var r4 = true ? new Date() : null; >r4 : Date >true ? new Date() : null : Date ->true : boolean +>true : true >new Date() : Date >Date : DateConstructor >null : null @@ -86,7 +86,7 @@ var r4 = true ? new Date() : null; var r4 = true ? null : new Date(); >r4 : Date >true ? null : new Date() : Date ->true : boolean +>true : true >null : null >new Date() : Date >Date : DateConstructor @@ -94,53 +94,53 @@ var r4 = true ? null : new Date(); var r5 = true ? /1/ : null; >r5 : RegExp >true ? /1/ : null : RegExp ->true : boolean +>true : true >/1/ : RegExp >null : null var r5 = true ? null : /1/; >r5 : RegExp >true ? null : /1/ : RegExp ->true : boolean +>true : true >null : null >/1/ : RegExp var r6 = true ? { foo: 1 } : null; >r6 : { foo: number; } >true ? { foo: 1 } : null : { foo: number; } ->true : boolean +>true : true >{ foo: 1 } : { foo: number; } >foo : number ->1 : number +>1 : 1 >null : null var r6 = true ? null : { foo: 1 }; >r6 : { foo: number; } >true ? null : { foo: 1 } : { foo: number; } ->true : boolean +>true : true >null : null >{ foo: 1 } : { foo: number; } >foo : number ->1 : number +>1 : 1 var r7 = true ? () => { } : null; >r7 : () => void >true ? () => { } : null : () => void ->true : boolean +>true : true >() => { } : () => void >null : null var r7 = true ? null : () => { }; >r7 : () => void >true ? null : () => { } : () => void ->true : boolean +>true : true >null : null >() => { } : () => void var r8 = true ? (x: T) => { return x } : null; >r8 : (x: T) => T >true ? (x: T) => { return x } : null : (x: T) => T ->true : boolean +>true : true >(x: T) => { return x } : (x: T) => T >T : T >x : T @@ -151,7 +151,7 @@ var r8 = true ? (x: T) => { return x } : null; var r8b = true ? null : (x: T) => { return x }; // type parameters not identical across declarations >r8b : (x: T) => T >true ? null : (x: T) => { return x } : (x: T) => T ->true : boolean +>true : true >null : null >(x: T) => { return x } : (x: T) => T >T : T @@ -170,14 +170,14 @@ var i1: I1; var r9 = true ? i1 : null; >r9 : I1 >true ? i1 : null : I1 ->true : boolean +>true : true >i1 : I1 >null : null var r9 = true ? null : i1; >r9 : I1 >true ? null : i1 : I1 ->true : boolean +>true : true >null : null >i1 : I1 @@ -192,14 +192,14 @@ var c1: C1; var r10 = true ? c1 : null; >r10 : C1 >true ? c1 : null : C1 ->true : boolean +>true : true >c1 : C1 >null : null var r10 = true ? null : c1; >r10 : C1 >true ? null : c1 : C1 ->true : boolean +>true : true >null : null >c1 : C1 @@ -216,14 +216,14 @@ var c2: C2; var r12 = true ? c2 : null; >r12 : C2 >true ? c2 : null : C2 ->true : boolean +>true : true >c2 : C2 >null : null var r12 = true ? null : c2; >r12 : C2 >true ? null : c2 : C2 ->true : boolean +>true : true >null : null >c2 : C2 @@ -234,21 +234,21 @@ enum E { A } var r13 = true ? E : null; >r13 : typeof E >true ? E : null : typeof E ->true : boolean +>true : true >E : typeof E >null : null var r13 = true ? null : E; >r13 : typeof E >true ? null : E : typeof E ->true : boolean +>true : true >null : null >E : typeof E var r14 = true ? E.A : null; >r14 : E >true ? E.A : null : E ->true : boolean +>true : true >E.A : E >E : typeof E >A : E @@ -257,7 +257,7 @@ var r14 = true ? E.A : null; var r14 = true ? null : E.A; >r14 : E >true ? null : E.A : E ->true : boolean +>true : true >null : null >E.A : E >E : typeof E @@ -271,7 +271,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } var af: typeof f; >af : typeof f @@ -280,14 +280,14 @@ var af: typeof f; var r15 = true ? af : null; >r15 : typeof f >true ? af : null : typeof f ->true : boolean +>true : true >af : typeof f >null : null var r15 = true ? null : af; >r15 : typeof f >true ? null : af : typeof f ->true : boolean +>true : true >null : null >af : typeof f @@ -300,7 +300,7 @@ module c { export var bar = 1; >bar : number ->1 : number +>1 : 1 } var ac: typeof c; >ac : typeof c @@ -309,14 +309,14 @@ var ac: typeof c; var r16 = true ? ac : null; >r16 : typeof c >true ? ac : null : typeof c ->true : boolean +>true : true >ac : typeof c >null : null var r16 = true ? null : ac; >r16 : typeof c >true ? null : ac : typeof c ->true : boolean +>true : true >null : null >ac : typeof c @@ -329,14 +329,14 @@ function f17(x: T) { var r17 = true ? x : null; >r17 : T >true ? x : null : T ->true : boolean +>true : true >x : T >null : null var r17 = true ? null : x; >r17 : T >true ? null : x : T ->true : boolean +>true : true >null : null >x : T } @@ -351,14 +351,14 @@ function f18(x: U) { var r18 = true ? x : null; >r18 : U >true ? x : null : U ->true : boolean +>true : true >x : U >null : null var r18 = true ? null : x; >r18 : U >true ? null : x : U ->true : boolean +>true : true >null : null >x : U } @@ -370,7 +370,7 @@ function f18(x: U) { var r19 = true ? new Object() : null; >r19 : Object >true ? new Object() : null : Object ->true : boolean +>true : true >new Object() : Object >Object : ObjectConstructor >null : null @@ -378,7 +378,7 @@ var r19 = true ? new Object() : null; var r19 = true ? null : new Object(); >r19 : Object >true ? null : new Object() : Object ->true : boolean +>true : true >null : null >new Object() : Object >Object : ObjectConstructor @@ -386,14 +386,14 @@ var r19 = true ? null : new Object(); var r20 = true ? {} : null; >r20 : {} >true ? {} : null : {} ->true : boolean +>true : true >{} : {} >null : null var r20 = true ? null : {}; >r20 : {} >true ? null : {} : {} ->true : boolean +>true : true >null : null >{} : {} diff --git a/tests/baselines/reference/nullOrUndefinedTypeGuardIsOrderIndependent.types b/tests/baselines/reference/nullOrUndefinedTypeGuardIsOrderIndependent.types index f599366e66e62..4d5f6d11538b6 100644 --- a/tests/baselines/reference/nullOrUndefinedTypeGuardIsOrderIndependent.types +++ b/tests/baselines/reference/nullOrUndefinedTypeGuardIsOrderIndependent.types @@ -7,7 +7,7 @@ function test(strOrNull: string | null, strOrUndefined: string | undefined) { var str: string = "original"; >str : string ->"original" : string +>"original" : "original" var nil: null; >nil : null diff --git a/tests/baselines/reference/numberAsInLHS.types b/tests/baselines/reference/numberAsInLHS.types index 848f937c618da..af2541bffe72a 100644 --- a/tests/baselines/reference/numberAsInLHS.types +++ b/tests/baselines/reference/numberAsInLHS.types @@ -1,8 +1,8 @@ === tests/cases/compiler/numberAsInLHS.ts === 3 in [0, 1] >3 in [0, 1] : boolean ->3 : number +>3 : 3 >[0, 1] : number[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/numberPropertyAccess.types b/tests/baselines/reference/numberPropertyAccess.types index b7f5479ed7974..e7ffcbc246d3c 100644 --- a/tests/baselines/reference/numberPropertyAccess.types +++ b/tests/baselines/reference/numberPropertyAccess.types @@ -1,7 +1,7 @@ === tests/cases/conformance/types/primitives/number/numberPropertyAccess.ts === var x = 1; >x : number ->1 : number +>1 : 1 var a = x.toExponential(); >a : string @@ -16,20 +16,20 @@ var b = x.hasOwnProperty('toFixed'); >x.hasOwnProperty : (v: string) => boolean >x : number >hasOwnProperty : (v: string) => boolean ->'toFixed' : string +>'toFixed' : "toFixed" var c = x['toExponential'](); >c : string >x['toExponential']() : string >x['toExponential'] : (fractionDigits?: number) => string >x : number ->'toExponential' : string +>'toExponential' : "toExponential" var d = x['hasOwnProperty']('toFixed'); >d : boolean >x['hasOwnProperty']('toFixed') : boolean >x['hasOwnProperty'] : (v: string) => boolean >x : number ->'hasOwnProperty' : string ->'toFixed' : string +>'hasOwnProperty' : "hasOwnProperty" +>'toFixed' : "toFixed" diff --git a/tests/baselines/reference/numberToString.errors.txt b/tests/baselines/reference/numberToString.errors.txt index 07cc9009a67a3..60a382e47c3de 100644 --- a/tests/baselines/reference/numberToString.errors.txt +++ b/tests/baselines/reference/numberToString.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/numberToString.ts(2,12): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numberToString.ts(9,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/numberToString.ts(9,4): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/numberToString.ts (2 errors) ==== @@ -15,6 +15,6 @@ tests/cases/compiler/numberToString.ts(9,4): error TS2345: Argument of type 'num f1(3); f2(3); // error no coercion to string ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. f2(3+""); // ok + operator promotes \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexExpressions.errors.txt b/tests/baselines/reference/numericIndexExpressions.errors.txt index 2c3b8d76796fa..da0993ffee3c3 100644 --- a/tests/baselines/reference/numericIndexExpressions.errors.txt +++ b/tests/baselines/reference/numericIndexExpressions.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/numericIndexExpressions.ts(10,1): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(11,1): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(14,1): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(10,1): error TS2322: Type '4' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(11,1): error TS2322: Type '4' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(14,1): error TS2322: Type '4' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2322: Type '4' is not assignable to type 'string'. ==== tests/cases/compiler/numericIndexExpressions.ts (4 errors) ==== @@ -16,15 +16,15 @@ tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2322: Type 'numbe var x: Numbers1; x[1] = 4; // error ~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '4' is not assignable to type 'string'. x['1'] = 4; // error ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '4' is not assignable to type 'string'. var y: Strings1; y['1'] = 4; // should be error ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '4' is not assignable to type 'string'. y[1] = 4; // should be error ~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type '4' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexingResults.types b/tests/baselines/reference/numericIndexingResults.types index 9a060b388e363..8d25a44eab0db 100644 --- a/tests/baselines/reference/numericIndexingResults.types +++ b/tests/baselines/reference/numericIndexingResults.types @@ -6,10 +6,10 @@ class C { >x : number 1 = ''; ->'' : string +>'' : "" "2" = '' ->'' : string +>'' : "" } var c: C; @@ -20,37 +20,37 @@ var r1 = c['1']; >r1 : string >c['1'] : string >c : C ->'1' : string +>'1' : "1" var r2 = c['2']; >r2 : string >c['2'] : string >c : C ->'2' : string +>'2' : "2" var r3 = c['3']; >r3 : any >c['3'] : any >c : C ->'3' : string +>'3' : "3" var r4 = c[1]; >r4 : string >c[1] : string >c : C ->1 : number +>1 : 1 var r5 = c[2]; >r5 : string >c[2] : string >c : C ->2 : number +>2 : 2 var r6 = c[3]; >r6 : string >c[3] : string >c : C ->3 : number +>3 : 3 interface I { >I : I @@ -70,37 +70,37 @@ var r1 = i['1']; >r1 : string >i['1'] : string >i : I ->'1' : string +>'1' : "1" var r2 = i['2']; >r2 : string >i['2'] : string >i : I ->'2' : string +>'2' : "2" var r3 = i['3']; >r3 : any >i['3'] : any >i : I ->'3' : string +>'3' : "3" var r4 = i[1]; >r4 : string >i[1] : string >i : I ->1 : number +>1 : 1 var r5 = i[2]; >r5 : string >i[2] : string >i : I ->2 : number +>2 : 2 var r6 = i[3]; >r6 : string >i[3] : string >i : I ->3 : number +>3 : 3 var a: { >a : { [x: number]: string; 1: string; "2": string; } @@ -116,121 +116,121 @@ var r1 = a['1']; >r1 : string >a['1'] : string >a : { [x: number]: string; 1: string; "2": string; } ->'1' : string +>'1' : "1" var r2 = a['2']; >r2 : string >a['2'] : string >a : { [x: number]: string; 1: string; "2": string; } ->'2' : string +>'2' : "2" var r3 = a['3']; >r3 : any >a['3'] : any >a : { [x: number]: string; 1: string; "2": string; } ->'3' : string +>'3' : "3" var r4 = a[1]; >r4 : string >a[1] : string >a : { [x: number]: string; 1: string; "2": string; } ->1 : number +>1 : 1 var r5 = a[2]; >r5 : string >a[2] : string >a : { [x: number]: string; 1: string; "2": string; } ->2 : number +>2 : 2 var r6 = a[3]; >r6 : string >a[3] : string >a : { [x: number]: string; 1: string; "2": string; } ->3 : number +>3 : 3 var b: { [x: number]: string } = { 1: '', "2": '' } >b : { [x: number]: string; } >x : number >{ 1: '', "2": '' } : { 1: string; "2": string; } ->'' : string ->'' : string +>'' : "" +>'' : "" var r1a = b['1']; >r1a : any >b['1'] : any >b : { [x: number]: string; } ->'1' : string +>'1' : "1" var r2a = b['2']; >r2a : any >b['2'] : any >b : { [x: number]: string; } ->'2' : string +>'2' : "2" var r3 = b['3']; >r3 : any >b['3'] : any >b : { [x: number]: string; } ->'3' : string +>'3' : "3" var r4 = b[1]; >r4 : string >b[1] : string >b : { [x: number]: string; } ->1 : number +>1 : 1 var r5 = b[2]; >r5 : string >b[2] : string >b : { [x: number]: string; } ->2 : number +>2 : 2 var r6 = b[3]; >r6 : string >b[3] : string >b : { [x: number]: string; } ->3 : number +>3 : 3 var b2: { [x: number]: string; 1: string; "2": string; } = { 1: '', "2": '' } >b2 : { [x: number]: string; 1: string; "2": string; } >x : number >{ 1: '', "2": '' } : { 1: string; "2": string; } ->'' : string ->'' : string +>'' : "" +>'' : "" var r1b = b2['1']; >r1b : string >b2['1'] : string >b2 : { [x: number]: string; 1: string; "2": string; } ->'1' : string +>'1' : "1" var r2b = b2['2']; >r2b : string >b2['2'] : string >b2 : { [x: number]: string; 1: string; "2": string; } ->'2' : string +>'2' : "2" var r3 = b2['3']; >r3 : any >b2['3'] : any >b2 : { [x: number]: string; 1: string; "2": string; } ->'3' : string +>'3' : "3" var r4 = b2[1]; >r4 : string >b2[1] : string >b2 : { [x: number]: string; 1: string; "2": string; } ->1 : number +>1 : 1 var r5 = b2[2]; >r5 : string >b2[2] : string >b2 : { [x: number]: string; 1: string; "2": string; } ->2 : number +>2 : 2 var r6 = b2[3]; >r6 : string >b2[3] : string >b2 : { [x: number]: string; 1: string; "2": string; } ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/numericLiteralTypes1.types b/tests/baselines/reference/numericLiteralTypes1.types index 38912e05365ef..f091dd99d60b2 100644 --- a/tests/baselines/reference/numericLiteralTypes1.types +++ b/tests/baselines/reference/numericLiteralTypes1.types @@ -46,17 +46,17 @@ function f1() { type B1 = -1 | 0 | 1; >B1 : B1 >-1 : -1 ->1 : number +>1 : 1 type B2 = 1 | 0 | -1; >B2 : B1 >-1 : -1 ->1 : number +>1 : 1 type B3 = 0 | -1 | 1; >B3 : B1 >-1 : -1 ->1 : number +>1 : 1 function f2() { >f2 : () => void @@ -65,7 +65,7 @@ function f2() { >b : B1 >B1 : B1 >-1 : -1 ->1 : number +>1 : 1 var b: B2 = 0; >b : B1 @@ -242,7 +242,7 @@ function f5(a: 1, b: 0 | 1 | 2) { >z3 : number >g(2) : number >g : { (x: 0): string; (x: 1): boolean; (x: number): number; } ->2 : number +>2 : 2 var z4 = g(a); >z4 : boolean @@ -264,14 +264,14 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } type Tag = 0 | 1 | 2; >Tag : 0 | 1 | 2 function f10(x: Tag) { ->f10 : (x: 0 | 1 | 2) => string +>f10 : (x: 0 | 1 | 2) => "a" | "b" | "c" >x : 0 | 1 | 2 >Tag : 0 | 1 | 2 @@ -280,20 +280,20 @@ function f10(x: Tag) { case 0: return "a"; >0 : 0 ->"a" : string +>"a" : "a" case 1: return "b"; >1 : 1 ->"b" : string +>"b" : "b" case 2: return "c"; >2 : 2 ->"c" : string +>"c" : "c" } } function f11(x: Tag) { ->f11 : (x: 0 | 1 | 2) => string +>f11 : (x: 0 | 1 | 2) => "a" | "b" | "c" >x : 0 | 1 | 2 >Tag : 0 | 1 | 2 @@ -302,15 +302,15 @@ function f11(x: Tag) { case 0: return "a"; >0 : 0 ->"a" : string +>"a" : "a" case 1: return "b"; >1 : 1 ->"b" : string +>"b" : "b" case 2: return "c"; >2 : 2 ->"c" : string +>"c" : "c" } return assertNever(x); >assertNever(x) : never @@ -370,7 +370,7 @@ function f14(x: 0 | 1 | 2, y: string) { >y : string var b = x || y; ->b : string | 1 | 2 +>b : string | number >x || y : string | 1 | 2 >x : 0 | 1 | 2 >y : string @@ -383,31 +383,31 @@ function f15(x: 0 | false, y: 1 | "one") { >y : 1 | "one" var a = x && y; ->a : false | 0 +>a : number | boolean >x && y : false | 0 >x : false | 0 >y : 1 | "one" var b = y && x; ->b : false | 0 +>b : number | boolean >y && x : false | 0 >y : 1 | "one" >x : false | 0 var c = x || y; ->c : 1 | "one" +>c : string | number >x || y : 1 | "one" >x : false | 0 >y : 1 | "one" var d = y || x; ->d : false | 0 | 1 | "one" +>d : string | number | boolean >y || x : false | 0 | 1 | "one" >y : 1 | "one" >x : false | 0 var e = !x; ->e : true +>e : boolean >!x : true >x : false | 0 diff --git a/tests/baselines/reference/numericLiteralTypes2.types b/tests/baselines/reference/numericLiteralTypes2.types index 13292e5f75c07..a5744de2a34ca 100644 --- a/tests/baselines/reference/numericLiteralTypes2.types +++ b/tests/baselines/reference/numericLiteralTypes2.types @@ -47,17 +47,17 @@ function f1() { type B1 = -1 | 0 | 1; >B1 : B1 >-1 : -1 ->1 : number +>1 : 1 type B2 = 1 | 0 | -1; >B2 : B1 >-1 : -1 ->1 : number +>1 : 1 type B3 = 0 | -1 | 1; >B3 : B1 >-1 : -1 ->1 : number +>1 : 1 function f2() { >f2 : () => void @@ -66,7 +66,7 @@ function f2() { >b : B1 >B1 : B1 >-1 : -1 ->1 : number +>1 : 1 var b: B2 = 0; >b : B1 @@ -243,7 +243,7 @@ function f5(a: 1, b: 0 | 1 | 2) { >z3 : number >g(2) : number >g : { (x: 0): string; (x: 1): boolean; (x: number): number; } ->2 : number +>2 : 2 var z4 = g(a); >z4 : boolean @@ -265,14 +265,14 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } type Tag = 0 | 1 | 2; >Tag : 0 | 1 | 2 function f10(x: Tag) { ->f10 : (x: 0 | 1 | 2) => string +>f10 : (x: 0 | 1 | 2) => "a" | "b" | "c" >x : 0 | 1 | 2 >Tag : 0 | 1 | 2 @@ -281,20 +281,20 @@ function f10(x: Tag) { case 0: return "a"; >0 : 0 ->"a" : string +>"a" : "a" case 1: return "b"; >1 : 1 ->"b" : string +>"b" : "b" case 2: return "c"; >2 : 2 ->"c" : string +>"c" : "c" } } function f11(x: Tag) { ->f11 : (x: 0 | 1 | 2) => string +>f11 : (x: 0 | 1 | 2) => "a" | "b" | "c" >x : 0 | 1 | 2 >Tag : 0 | 1 | 2 @@ -303,15 +303,15 @@ function f11(x: Tag) { case 0: return "a"; >0 : 0 ->"a" : string +>"a" : "a" case 1: return "b"; >1 : 1 ->"b" : string +>"b" : "b" case 2: return "c"; >2 : 2 ->"c" : string +>"c" : "c" } return assertNever(x); >assertNever(x) : never @@ -365,13 +365,13 @@ function f14(x: 0 | 1 | 2, y: string) { >y : string var a = x && y; ->a : string | 0 +>a : string | number >x && y : string | 0 >x : 0 | 1 | 2 >y : string var b = x || y; ->b : string | 1 | 2 +>b : string | number >x || y : string | 1 | 2 >x : 0 | 1 | 2 >y : string @@ -384,36 +384,36 @@ function f15(x: 0 | false, y: 1 | "one") { >y : 1 | "one" var a = x && y; ->a : false | 0 +>a : number | boolean >x && y : false | 0 >x : false | 0 >y : 1 | "one" var b = y && x; ->b : false | 0 +>b : number | boolean >y && x : false | 0 >y : 1 | "one" >x : false | 0 var c = x || y; ->c : 1 | "one" +>c : string | number >x || y : 1 | "one" >x : false | 0 >y : 1 | "one" var d = y || x; ->d : 1 | "one" +>d : string | number >y || x : 1 | "one" >y : 1 | "one" >x : false | 0 var e = !x; ->e : true +>e : boolean >!x : true >x : false | 0 var f = !y; ->f : false +>f : boolean >!y : false >y : 1 | "one" } diff --git a/tests/baselines/reference/numericMethodName1.types b/tests/baselines/reference/numericMethodName1.types index e6e631fc70511..4f907f06feb50 100644 --- a/tests/baselines/reference/numericMethodName1.types +++ b/tests/baselines/reference/numericMethodName1.types @@ -3,6 +3,6 @@ class C { >C : C 1 = 2; ->2 : number +>2 : 2 } diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types index d736121a3b7d1..d5838d7174a18 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types @@ -4,5 +4,5 @@ var { as } = { as: 1 } >as : number >{ as: 1 } : { as: number; } >as : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types index 739771385b298..427957c1ef887 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types @@ -5,5 +5,5 @@ var { as: as } = { as: 1 } >as : number >{ as: 1 } : { as: number; } >as : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt index bd9e021494ca6..6948f080aef26 100644 --- a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt +++ b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(5,24): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(5,24): error TS2345: Argument of type '123' is not assignable to parameter of type 'string'. tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(6,2): error TS1128: Declaration or statement expected. @@ -9,7 +9,7 @@ tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(6,2): error } function foo(x = new A(123)) { //should error, 123 is not string ~~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '123' is not assignable to parameter of type 'string'. }} ~ !!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitGetterSetter.types b/tests/baselines/reference/objectLitGetterSetter.types index 4f7865374e2d2..12801b65340bd 100644 --- a/tests/baselines/reference/objectLitGetterSetter.types +++ b/tests/baselines/reference/objectLitGetterSetter.types @@ -9,7 +9,7 @@ >Object : ObjectConstructor >defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >obj : {} ->"accProperty" : string +>"accProperty" : "accProperty" >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : { get: () => number; set: (v: any) => void; } @@ -22,10 +22,10 @@ eval("public = 1;"); >eval("public = 1;") : any >eval : (x: string) => any ->"public = 1;" : string +>"public = 1;" : "public = 1;" return 11; ->11 : number +>11 : 11 }, set: function (v) { diff --git a/tests/baselines/reference/objectLiteral1.types b/tests/baselines/reference/objectLiteral1.types index 491b4ce365b7d..244cb62dbefb4 100644 --- a/tests/baselines/reference/objectLiteral1.types +++ b/tests/baselines/reference/objectLiteral1.types @@ -3,7 +3,7 @@ var v30 = {a:1, b:2}; >v30 : { a: number; b: number; } >{a:1, b:2} : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/objectLiteral2.types b/tests/baselines/reference/objectLiteral2.types index 387bd0ba90f43..52184a27833c8 100644 --- a/tests/baselines/reference/objectLiteral2.types +++ b/tests/baselines/reference/objectLiteral2.types @@ -3,8 +3,8 @@ var v30 = {a:1, b:2}, v31; >v30 : { a: number; b: number; } >{a:1, b:2} : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 >v31 : any diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.types b/tests/baselines/reference/objectLiteralArraySpecialization.types index 405d8bff47225..d51b7ffc3cf2e 100644 --- a/tests/baselines/reference/objectLiteralArraySpecialization.types +++ b/tests/baselines/reference/objectLiteralArraySpecialization.types @@ -31,14 +31,14 @@ var thing = create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]); // sh >[ { name: "bob", id: 24 }, { name: "doug", id: 32 } ] : { name: string; id: number; }[] >{ name: "bob", id: 24 } : { name: string; id: number; } >name : string ->"bob" : string +>"bob" : "bob" >id : number ->24 : number +>24 : 24 >{ name: "doug", id: 32 } : { name: string; id: number; } >name : string ->"doug" : string +>"doug" : "doug" >id : number ->32 : number +>32 : 32 thing.doSomething((x, y) => x.name === "bob"); // should not error >thing.doSomething((x, y) => x.name === "bob") : void diff --git a/tests/baselines/reference/objectLiteralContextualTyping.types b/tests/baselines/reference/objectLiteralContextualTyping.types index 8100b7a54463f..a0c6ff7417b07 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.types +++ b/tests/baselines/reference/objectLiteralContextualTyping.types @@ -29,7 +29,7 @@ var x = foo({ name: "Sprocket" }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket" } : { name: string; } >name : string ->"Sprocket" : string +>"Sprocket" : "Sprocket" var x: string; >x : string @@ -40,9 +40,9 @@ var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket", description: "Bumpy wheel" } : { name: string; description: string; } >name : string ->"Sprocket" : string +>"Sprocket" : "Sprocket" >description : string ->"Bumpy wheel" : string +>"Bumpy wheel" : "Bumpy wheel" var y: string; >y : string @@ -53,9 +53,9 @@ var z = foo({ name: "Sprocket", description: false }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket", description: false } : { name: string; description: boolean; } >name : string ->"Sprocket" : string +>"Sprocket" : "Sprocket" >description : boolean ->false : boolean +>false : false var z: number; >z : number @@ -66,7 +66,7 @@ var w = foo({ a: 10 }); >foo : { (item: Item): string; (item: any): number; } >{ a: 10 } : { a: number; } >a : number ->10 : number +>10 : 10 var w: number; >w : number diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 2505748760cab..234ac24a8fdc5 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -73,7 +73,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,16): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,47): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,29): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,29): error TS2322: Type '4' is not assignable to type 'string'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,16): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,55): error TS2380: 'get' and 'set' accessor must have the same type. @@ -274,7 +274,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,55) !!! error TS2380: 'get' and 'set' accessor must have the same type. var g2 = { get a() { return 4; }, set a(n: string) { } }; ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '4' is not assignable to type 'string'. var g3 = { get a(): number { return undefined; }, set a(n: string) { } }; ~ !!! error TS2380: 'get' and 'set' accessor must have the same type. diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.types b/tests/baselines/reference/objectLiteralShorthandProperties.types index 9d537173d49a3..4f4482906aa50 100644 --- a/tests/baselines/reference/objectLiteralShorthandProperties.types +++ b/tests/baselines/reference/objectLiteralShorthandProperties.types @@ -27,7 +27,7 @@ var x3 = { a: 0, >a : number ->0 : number +>0 : 0 b, >b : any diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types index 869a67fb22f1e..88a910a99fbcc 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts === var id: number = 10000; >id : number ->10000 : number +>10000 : 10000 var name: string = "my name"; >name : string ->"my name" : string +>"my name" : "my name" var person: { name: string; id: number } = { name, id }; >person : { name: string; id: number; } @@ -54,16 +54,16 @@ var person1 = bar("Hello", 5); >person1 : { name: string; id: number; } >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 var person2: { name: string } = bar("Hello", 5); >person2 : { name: string; } >name : string >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 var person3: { name: string; id:number } = bar("Hello", 5); >person3 : { name: string; id: number; } @@ -71,6 +71,6 @@ var person3: { name: string; id:number } = bar("Hello", 5); >id : number >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types index 710fc43033925..527c9c5fb6cc4 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts === var id: number = 10000; >id : number ->10000 : number +>10000 : 10000 var name: string = "my name"; >name : string ->"my name" : string +>"my name" : "my name" var person: { name: string; id: number } = { name, id }; >person : { name: string; id: number; } @@ -54,16 +54,16 @@ var person1 = bar("Hello", 5); >person1 : { name: string; id: number; } >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 var person2: { name: string } = bar("Hello", 5); >person2 : { name: string; } >name : string >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 var person3: { name: string; id: number } = bar("Hello", 5); >person3 : { name: string; id: number; } @@ -71,6 +71,6 @@ var person3: { name: string; id: number } = bar("Hello", 5); >id : number >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types index 5c36262f6954f..1565be04625b3 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types @@ -27,7 +27,7 @@ var x3 = { a: 0, >a : number ->0 : number +>0 : 0 b, >b : any diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types index 083d411812857..fe67e59dd7b5d 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts === var id: number = 10000; >id : number ->10000 : number +>10000 : 10000 var name: string = "my name"; >name : string ->"my name" : string +>"my name" : "my name" var person = { name, id }; >person : { name: string; id: number; } diff --git a/tests/baselines/reference/objectTypePropertyAccess.types b/tests/baselines/reference/objectTypePropertyAccess.types index 5fc03bd86ed5e..6f9bffaf0de45 100644 --- a/tests/baselines/reference/objectTypePropertyAccess.types +++ b/tests/baselines/reference/objectTypePropertyAccess.types @@ -23,7 +23,7 @@ var r2 = c['toString'](); >c['toString']() : string >c['toString'] : () => string >c : C ->'toString' : string +>'toString' : "toString" var r3 = c.foo; >r3 : string @@ -35,7 +35,7 @@ var r4 = c['foo']; >r4 : string >c['foo'] : string >c : C ->'foo' : string +>'foo' : "foo" interface I { >I : I @@ -59,7 +59,7 @@ var r5 = i['toString'](); >i['toString']() : string >i['toString'] : () => string >i : I ->'toString' : string +>'toString' : "toString" var r6 = i.bar; >r6 : string @@ -71,7 +71,7 @@ var r7 = i['bar']; >r7 : string >i['bar'] : string >i : I ->'bar' : string +>'bar' : "bar" var a = { >a : { foo: string; } @@ -79,7 +79,7 @@ var a = { foo: '' >foo : string ->'' : string +>'' : "" } var r8 = a.toString(); @@ -94,7 +94,7 @@ var r9 = a['toString'](); >a['toString']() : string >a['toString'] : () => string >a : { foo: string; } ->'toString' : string +>'toString' : "toString" var r10 = a.foo; >r10 : string @@ -106,5 +106,5 @@ var r11 = a['foo']; >r11 : string >a['foo'] : string >a : { foo: string; } ->'foo' : string +>'foo' : "foo" diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types index 93caca61bfa9b..ea0ee84b575d1 100644 --- a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types @@ -64,7 +64,7 @@ var r1e = i['hm']; // should be Object >r1e : any >i['hm'] : any >i : I ->'hm' : string +>'hm' : "hm" var x: { >x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } @@ -113,5 +113,5 @@ var r2e = x['hm']; // should be Object >r2e : any >x['hm'] : any >x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } ->'hm' : string +>'hm' : "hm" diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types index 427b700fb592b..c0b5c9d5a776a 100644 --- a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types @@ -61,7 +61,7 @@ var r1e = i['hm']; // should be Object >r1e : any >i['hm'] : any >i : I ->'hm' : string +>'hm' : "hm" var x: { >x : { new (): number; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } @@ -110,5 +110,5 @@ var r2e = x['hm']; // should be Object >r2e : any >x['hm'] : any >x : { new (): number; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } ->'hm' : string +>'hm' : "hm" diff --git a/tests/baselines/reference/objectTypeWithNumericProperty.types b/tests/baselines/reference/objectTypeWithNumericProperty.types index 32efd3398fb28..52a27ea09afed 100644 --- a/tests/baselines/reference/objectTypeWithNumericProperty.types +++ b/tests/baselines/reference/objectTypeWithNumericProperty.types @@ -16,25 +16,25 @@ var r1 = c[1]; >r1 : number >c[1] : number >c : C ->1 : number +>1 : 1 var r2 = c[1.1]; >r2 : string >c[1.1] : string >c : C ->1.1 : number +>1.1 : 1.1 var r3 = c['1']; >r3 : number >c['1'] : number >c : C ->'1' : string +>'1' : "1" var r4 = c['1.1']; >r4 : string >c['1.1'] : string >c : C ->'1.1' : string +>'1.1' : "1.1" interface I { >I : I @@ -51,25 +51,25 @@ var r1 = i[1]; >r1 : number >i[1] : number >i : I ->1 : number +>1 : 1 var r2 = i[1.1]; >r2 : string >i[1.1] : string >i : I ->1.1 : number +>1.1 : 1.1 var r3 = i['1']; >r3 : number >i['1'] : number >i : I ->'1' : string +>'1' : "1" var r4 = i['1.1']; >r4 : string >i['1.1'] : string >i : I ->'1.1' : string +>'1.1' : "1.1" var a: { >a : { 1: number; 1.1: string; } @@ -82,58 +82,58 @@ var r1 = a[1]; >r1 : number >a[1] : number >a : { 1: number; 1.1: string; } ->1 : number +>1 : 1 var r2 = a[1.1]; >r2 : string >a[1.1] : string >a : { 1: number; 1.1: string; } ->1.1 : number +>1.1 : 1.1 var r3 = a['1']; >r3 : number >a['1'] : number >a : { 1: number; 1.1: string; } ->'1' : string +>'1' : "1" var r4 = a['1.1']; >r4 : string >a['1.1'] : string >a : { 1: number; 1.1: string; } ->'1.1' : string +>'1.1' : "1.1" var b = { >b : { 1: number; 1.1: string; } >{ 1: 1, 1.1: ""} : { 1: number; 1.1: string; } 1: 1, ->1 : number +>1 : 1 1.1: "" ->"" : string +>"" : "" } var r1 = b[1]; >r1 : number >b[1] : number >b : { 1: number; 1.1: string; } ->1 : number +>1 : 1 var r2 = b[1.1]; >r2 : string >b[1.1] : string >b : { 1: number; 1.1: string; } ->1.1 : number +>1.1 : 1.1 var r3 = b['1']; >r3 : number >b['1'] : number >b : { 1: number; 1.1: string; } ->'1' : string +>'1' : "1" var r4 = b['1.1']; >r4 : string >b['1.1'] : string >b : { 1: number; 1.1: string; } ->'1.1' : string +>'1.1' : "1.1" diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types index 490f3101751a4..5e664fadd2092 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types @@ -32,108 +32,108 @@ var r1 = c['0.1']; >r1 : void >c['0.1'] : void >c : C ->'0.1' : string +>'0.1' : "0.1" var r2 = c['.1']; >r2 : Object >c['.1'] : Object >c : C ->'.1' : string +>'.1' : ".1" var r3 = c['1']; >r3 : number >c['1'] : number >c : C ->'1' : string +>'1' : "1" var r3 = c[1]; >r3 : number >c[1] : number >c : C ->1 : number +>1 : 1 var r4 = c['1.']; >r4 : string >c['1.'] : string >c : C ->'1.' : string +>'1.' : "1." var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C ->1. : number +>1. : 1 var r5 = c['1..']; >r5 : boolean >c['1..'] : boolean >c : C ->'1..' : string +>'1..' : "1.." var r6 = c['1.0']; >r6 : Date >c['1.0'] : Date >c : C ->'1.0' : string +>'1.0' : "1.0" var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C ->1.0 : number +>1.0 : 1 // BUG 823822 var r7 = i[-1]; >r7 : any >i[-1] : any >i : I ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I ->-1.0 : number ->1.0 : number +>-1.0 : -1 +>1.0 : 1 var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I ->"-1.0" : string +>"-1.0" : "-1.0" var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I ->"-1" : string +>"-1" : "-1" var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I ->0x1 : number +>0x1 : 1 var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I ->-0x1 : number ->0x1 : number +>-0x1 : -1 +>0x1 : 1 var r12 = i[01] >r12 : number >i[01] : number >i : I ->01 : number +>01 : 1 var r13 = i[-01] >r13 : any >i[-01] : any >i : I ->-01 : number ->01 : number +>-01 : -1 +>01 : 1 interface I { >I : I @@ -163,108 +163,108 @@ var r1 = i['0.1']; >r1 : void >i['0.1'] : void >i : I ->'0.1' : string +>'0.1' : "0.1" var r2 = i['.1']; >r2 : Object >i['.1'] : Object >i : I ->'.1' : string +>'.1' : ".1" var r3 = i['1']; >r3 : number >i['1'] : number >i : I ->'1' : string +>'1' : "1" var r3 = c[1]; >r3 : number >c[1] : number >c : C ->1 : number +>1 : 1 var r4 = i['1.']; >r4 : string >i['1.'] : string >i : I ->'1.' : string +>'1.' : "1." var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C ->1. : number +>1. : 1 var r5 = i['1..']; >r5 : boolean >i['1..'] : boolean >i : I ->'1..' : string +>'1..' : "1.." var r6 = i['1.0']; >r6 : Date >i['1.0'] : Date >i : I ->'1.0' : string +>'1.0' : "1.0" var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C ->1.0 : number +>1.0 : 1 // BUG 823822 var r7 = i[-1]; >r7 : any >i[-1] : any >i : I ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I ->-1.0 : number ->1.0 : number +>-1.0 : -1 +>1.0 : 1 var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I ->"-1.0" : string +>"-1.0" : "-1.0" var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I ->"-1" : string +>"-1" : "-1" var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I ->0x1 : number +>0x1 : 1 var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I ->-0x1 : number ->0x1 : number +>-0x1 : -1 +>0x1 : 1 var r12 = i[01] >r12 : number >i[01] : number >i : I ->01 : number +>01 : 1 var r13 = i[-01] >r13 : any >i[-01] : any >i : I ->-01 : number ->01 : number +>-01 : -1 +>01 : 1 var a: { >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } @@ -290,108 +290,108 @@ var r1 = a['0.1']; >r1 : void >a['0.1'] : void >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'0.1' : string +>'0.1' : "0.1" var r2 = a['.1']; >r2 : Object >a['.1'] : Object >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'.1' : string +>'.1' : ".1" var r3 = a['1']; >r3 : number >a['1'] : number >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'1' : string +>'1' : "1" var r3 = c[1]; >r3 : number >c[1] : number >c : C ->1 : number +>1 : 1 var r4 = a['1.']; >r4 : string >a['1.'] : string >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'1.' : string +>'1.' : "1." var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C ->1. : number +>1. : 1 var r5 = a['1..']; >r5 : boolean >a['1..'] : boolean >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'1..' : string +>'1..' : "1.." var r6 = a['1.0']; >r6 : Date >a['1.0'] : Date >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'1.0' : string +>'1.0' : "1.0" var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C ->1.0 : number +>1.0 : 1 // BUG 823822 var r7 = i[-1]; >r7 : any >i[-1] : any >i : I ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I ->-1.0 : number ->1.0 : number +>-1.0 : -1 +>1.0 : 1 var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I ->"-1.0" : string +>"-1.0" : "-1.0" var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I ->"-1" : string +>"-1" : "-1" var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I ->0x1 : number +>0x1 : 1 var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I ->-0x1 : number ->0x1 : number +>-0x1 : -1 +>0x1 : 1 var r12 = i[01] >r12 : number >i[01] : number >i : I ->01 : number +>01 : 1 var r13 = i[-01] >r13 : any >i[-01] : any >i : I ->-01 : number ->01 : number +>-01 : -1 +>01 : 1 var b = { >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } @@ -406,13 +406,13 @@ var b = { >Object : ObjectConstructor "1": 1, ->1 : number +>1 : 1 "1.": "", ->"" : string +>"" : "" "1..": true, ->true : boolean +>true : true "1.0": new Date(), >new Date() : Date @@ -430,106 +430,106 @@ var r1 = b['0.1']; >r1 : void >b['0.1'] : void >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'0.1' : string +>'0.1' : "0.1" var r2 = b['.1']; >r2 : Object >b['.1'] : Object >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'.1' : string +>'.1' : ".1" var r3 = b['1']; >r3 : number >b['1'] : number >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'1' : string +>'1' : "1" var r3 = c[1]; >r3 : number >c[1] : number >c : C ->1 : number +>1 : 1 var r4 = b['1.']; >r4 : string >b['1.'] : string >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'1.' : string +>'1.' : "1." var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C ->1. : number +>1. : 1 var r5 = b['1..']; >r5 : boolean >b['1..'] : boolean >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'1..' : string +>'1..' : "1.." var r6 = b['1.0']; >r6 : Date >b['1.0'] : Date >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'1.0' : string +>'1.0' : "1.0" var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C ->1.0 : number +>1.0 : 1 // BUG 823822 var r7 = i[-1]; >r7 : any >i[-1] : any >i : I ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I ->-1.0 : number ->1.0 : number +>-1.0 : -1 +>1.0 : 1 var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I ->"-1.0" : string +>"-1.0" : "-1.0" var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I ->"-1" : string +>"-1" : "-1" var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I ->0x1 : number +>0x1 : 1 var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I ->-0x1 : number ->0x1 : number +>-0x1 : -1 +>0x1 : 1 var r12 = i[01] >r12 : number >i[01] : number >i : I ->01 : number +>01 : 1 var r13 = i[-01] >r13 : any >i[-01] : any >i : I ->-01 : number ->01 : number +>-01 : -1 +>01 : 1 diff --git a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types index b676d284e7000..ca200efcebf9e 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types +++ b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types @@ -17,26 +17,26 @@ var r = c[" "]; >r : number >c[" "] : number >c : C ->" " : string +>" " : " " var r2 = c[" "]; >r2 : any >c[" "] : any >c : C ->" " : string +>" " : " " var r3 = c["a b"]; >r3 : string >c["a b"] : string >c : C ->"a b" : string +>"a b" : "a b" // BUG 817263 var r4 = c["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >c["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >c : C ->"~!@#$%^&*()_+{}|:'<>?\/.,`" : string +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : "~!@#$%^&*()_+{}|:'<>?/.,`" interface I { >I : I @@ -54,26 +54,26 @@ var r = i[" "]; >r : number >i[" "] : number >i : I ->" " : string +>" " : " " var r2 = i[" "]; >r2 : any >i[" "] : any >i : I ->" " : string +>" " : " " var r3 = i["a b"]; >r3 : string >i["a b"] : string >i : I ->"a b" : string +>"a b" : "a b" // BUG 817263 var r4 = i["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >i["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >i : I ->"~!@#$%^&*()_+{}|:'<>?\/.,`" : string +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : "~!@#$%^&*()_+{}|:'<>?/.,`" var a: { @@ -88,63 +88,63 @@ var r = a[" "]; >r : number >a[" "] : number >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->" " : string +>" " : " " var r2 = a[" "]; >r2 : any >a[" "] : any >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->" " : string +>" " : " " var r3 = a["a b"]; >r3 : string >a["a b"] : string >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->"a b" : string +>"a b" : "a b" // BUG 817263 var r4 = a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >a["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->"~!@#$%^&*()_+{}|:'<>?\/.,`" : string +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : "~!@#$%^&*()_+{}|:'<>?/.,`" var b = { >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } >{ " ": 1, "a b": "", "~!@#$%^&*()_+{}|:'<>?\/.,`": 1,} : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } " ": 1, ->1 : number +>1 : 1 "a b": "", ->"" : string +>"" : "" "~!@#$%^&*()_+{}|:'<>?\/.,`": 1, ->1 : number +>1 : 1 } var r = b[" "]; >r : number >b[" "] : number >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->" " : string +>" " : " " var r2 = b[" "]; >r2 : any >b[" "] : any >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->" " : string +>" " : " " var r3 = b["a b"]; >r3 : string >b["a b"] : string >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->"a b" : string +>"a b" : "a b" // BUG 817263 var r4 = b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >b["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->"~!@#$%^&*()_+{}|:'<>?\/.,`" : string +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : "~!@#$%^&*()_+{}|:'<>?/.,`" diff --git a/tests/baselines/reference/objectTypesIdentity.types b/tests/baselines/reference/objectTypesIdentity.types index 3491682954ae7..af9957f9aee16 100644 --- a/tests/baselines/reference/objectTypesIdentity.types +++ b/tests/baselines/reference/objectTypesIdentity.types @@ -39,7 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types index 545e2376bb34b..86a2ebec7c92e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types @@ -60,7 +60,7 @@ var b = { foo(x: string) { return ''; } }; >{ foo(x: string) { return ''; } } : { foo(x: string): string; } >foo : (x: string) => string >x : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types index 378c5c4fa0cc8..12ebec233aa43 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types @@ -62,7 +62,7 @@ var b = { foo(x: RegExp) { return ''; } }; >foo : (x: RegExp) => string >x : RegExp >RegExp : RegExp ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types index 62426cb033338..7808037fd70e9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types @@ -64,7 +64,7 @@ var b = { foo(x: string) { return ''; } }; >{ foo(x: string) { return ''; } } : { foo(x: string): string; } >foo : (x: string) => string >x : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types index edaad51b32ea7..ea89bbc059e30 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types @@ -110,7 +110,7 @@ var b = { >foo : (x: any) => any >x : any >'' : any ->'' : string +>'' : "" }; diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types index 2e5e7231721ea..4dd31ec26d346 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types @@ -47,7 +47,7 @@ var b = { new(x: RegExp) { return ''; } }; // not a construct signature, functio >new : (x: RegExp) => string >x : RegExp >RegExp : RegExp ->'' : string +>'' : "" function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types index b7f5995395912..b7d4b42a83e29 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types @@ -49,7 +49,7 @@ var b = { new(x: string) { return ''; } }; // not a construct signature, functio >{ new(x: string) { return ''; } } : { new(x: string): string; } >new : (x: string) => string >x : string ->'' : string +>'' : "" function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types index 90ed7fd094537..33598fe815f11 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types @@ -77,7 +77,7 @@ var b = { foo(x: T) { return ''; } }; >RegExp : RegExp >x : T >T : T ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types index 4974b0874eba2..265dd91784b75 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types @@ -121,7 +121,7 @@ var b = { foo(x: T, y: U) { return ''; } }; >T : T >y : U >U : U ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types index b5c2f6bdef0e8..89d0ceb2c73b7 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types @@ -155,7 +155,7 @@ var b = { foo(x: T, y: U) { return ''; } }; >T : T >y : U >U : U ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types index ef3ec91f479c5..40c1733a1e166 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types @@ -60,7 +60,7 @@ var b = { new(x: T) { return ''; } }; // not a construct signa >RegExp : RegExp >x : T >T : T ->'' : string +>'' : "" function foo1b(x: B>); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types index b1d1d79ac0582..2c2145658097e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types @@ -99,7 +99,7 @@ var b = { new(x: T, y: U) { return ''; } }; // no >T : T >y : U >U : U ->'' : string +>'' : "" function foo1b(x: B, Array>); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types index d8109a6a826fa..6b3dab83ded85 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types @@ -133,7 +133,7 @@ var b = { new(x: T, y: U) { return ''; } }; // not a >T : T >y : U >U : U ->'' : string +>'' : "" function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types index 78c69f0cdd36b..8ac7b807cbab8 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types @@ -51,7 +51,7 @@ var b: { [x: number]: string; } = { 0: '' }; >b : { [x: number]: string; } >x : number >{ 0: '' } : { 0: string; } ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types index a6ea5a292e5fc..bcf2ef6d73325 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types @@ -51,7 +51,7 @@ var b: { [x: number]: string; } = { 0: '' }; >b : { [x: number]: string; } >x : number >{ 0: '' } : { 0: string; } ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithOptionality.types b/tests/baselines/reference/objectTypesIdentityWithOptionality.types index bab319f359857..0e02350de9aeb 100644 --- a/tests/baselines/reference/objectTypesIdentityWithOptionality.types +++ b/tests/baselines/reference/objectTypesIdentityWithOptionality.types @@ -39,7 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" function foo2(x: I); >foo2 : { (x: I): any; (x: I): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.types b/tests/baselines/reference/objectTypesIdentityWithPrivates.types index c828f45ac5ab2..6a0cf84850fc0 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.types +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.types @@ -49,7 +49,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithPublics.types b/tests/baselines/reference/objectTypesIdentityWithPublics.types index daae624a7d146..5fe82c099efd5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPublics.types +++ b/tests/baselines/reference/objectTypesIdentityWithPublics.types @@ -39,7 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types index 8393eaf68a0dd..4028835a9c4ad 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types @@ -52,7 +52,7 @@ var b: { [x: string]: string; } = { foo: '' }; >x : string >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/octalIntegerLiteral.types b/tests/baselines/reference/octalIntegerLiteral.types index 8352e5fac0c3e..f8f07da9a4bc0 100644 --- a/tests/baselines/reference/octalIntegerLiteral.types +++ b/tests/baselines/reference/octalIntegerLiteral.types @@ -1,30 +1,30 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteral.ts === var oct1 = 0o45436; >oct1 : number ->0o45436 : number +>0o45436 : 19230 var oct2 = 0O45436; >oct2 : number ->0O45436 : number +>0O45436 : 19230 var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct3 : number ->0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : Infinity var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct4 : number ->0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : 5.462437423415177e+244 var obj1 = { >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } >{ 0o45436: "Hello", a: 0o45436, b: oct1, oct1, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true} : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0o45436: "Hello", ->"Hello" : string +>"Hello" : "Hello" a: 0o45436, >a : number ->0o45436 : number +>0o45436 : 19230 b: oct1, >b : number @@ -34,7 +34,7 @@ var obj1 = { >oct1 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true ->true : boolean +>true : true } var obj2 = { @@ -42,11 +42,11 @@ var obj2 = { >{ 0O45436: "hi", a: 0O45436, b: oct2, oct2, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,} : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0O45436: "hi", ->"hi" : string +>"hi" : "hi" a: 0O45436, >a : number ->0O45436 : number +>0O45436 : 19230 b: oct2, >b : number @@ -56,96 +56,96 @@ var obj2 = { >oct2 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, ->false : boolean +>false : false } obj1[0o45436]; // string >obj1[0o45436] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->0o45436 : number +>0o45436 : 19230 obj1["0o45436"]; // any >obj1["0o45436"] : any >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"0o45436" : string +>"0o45436" : "0o45436" obj1["19230"]; // string >obj1["19230"] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"19230" : string +>"19230" : "19230" obj1[19230]; // string >obj1[19230] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->19230 : number +>19230 : 19230 obj1["a"]; // number >obj1["a"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"a" : string +>"a" : "a" obj1["b"]; // number >obj1["b"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"b" : string +>"b" : "b" obj1["oct1"]; // number >obj1["oct1"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"oct1" : string +>"oct1" : "oct1" obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" obj2[0O45436]; // string >obj2[0O45436] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->0O45436 : number +>0O45436 : 19230 obj2["0O45436"]; // any >obj2["0O45436"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"0O45436" : string +>"0O45436" : "0O45436" obj2["19230"]; // string >obj2["19230"] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"19230" : string +>"19230" : "19230" obj2[19230]; // string >obj2[19230] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->19230 : number +>19230 : 19230 obj2["a"]; // number >obj2["a"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"a" : string +>"a" : "a" obj2["b"]; // number >obj2["b"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"b" : string +>"b" : "b" obj2["oct2"]; // number >obj2["oct2"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"oct2" : string +>"oct2" : "oct2" obj2[5.462437423415177e+244]; // boolean >obj2[5.462437423415177e+244] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->5.462437423415177e+244 : number +>5.462437423415177e+244 : 5.462437423415177e+244 obj2["5.462437423415177e+244"]; // boolean >obj2["5.462437423415177e+244"] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"5.462437423415177e+244" : string +>"5.462437423415177e+244" : "5.462437423415177e+244" obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" diff --git a/tests/baselines/reference/octalIntegerLiteralES6.types b/tests/baselines/reference/octalIntegerLiteralES6.types index 7ef32b4928933..06061be5d582b 100644 --- a/tests/baselines/reference/octalIntegerLiteralES6.types +++ b/tests/baselines/reference/octalIntegerLiteralES6.types @@ -1,30 +1,30 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralES6.ts === var oct1 = 0o45436; >oct1 : number ->0o45436 : number +>0o45436 : 19230 var oct2 = 0O45436; >oct2 : number ->0O45436 : number +>0O45436 : 19230 var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct3 : number ->0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : Infinity var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct4 : number ->0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : 5.462437423415177e+244 var obj1 = { >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } >{ 0o45436: "Hello", a: 0o45436, b: oct1, oct1, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true} : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0o45436: "Hello", ->"Hello" : string +>"Hello" : "Hello" a: 0o45436, >a : number ->0o45436 : number +>0o45436 : 19230 b: oct1, >b : number @@ -34,7 +34,7 @@ var obj1 = { >oct1 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true ->true : boolean +>true : true } var obj2 = { @@ -42,11 +42,11 @@ var obj2 = { >{ 0O45436: "hi", a: 0O45436, b: oct2, oct2, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,} : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0O45436: "hi", ->"hi" : string +>"hi" : "hi" a: 0O45436, >a : number ->0O45436 : number +>0O45436 : 19230 b: oct2, >b : number @@ -56,96 +56,96 @@ var obj2 = { >oct2 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, ->false : boolean +>false : false } obj1[0o45436]; // string >obj1[0o45436] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->0o45436 : number +>0o45436 : 19230 obj1["0o45436"]; // any >obj1["0o45436"] : any >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"0o45436" : string +>"0o45436" : "0o45436" obj1["19230"]; // string >obj1["19230"] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"19230" : string +>"19230" : "19230" obj1[19230]; // string >obj1[19230] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->19230 : number +>19230 : 19230 obj1["a"]; // number >obj1["a"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"a" : string +>"a" : "a" obj1["b"]; // number >obj1["b"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"b" : string +>"b" : "b" obj1["oct1"]; // number >obj1["oct1"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"oct1" : string +>"oct1" : "oct1" obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" obj2[0O45436]; // string >obj2[0O45436] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->0O45436 : number +>0O45436 : 19230 obj2["0O45436"]; // any >obj2["0O45436"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"0O45436" : string +>"0O45436" : "0O45436" obj2["19230"]; // string >obj2["19230"] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"19230" : string +>"19230" : "19230" obj2[19230]; // string >obj2[19230] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->19230 : number +>19230 : 19230 obj2["a"]; // number >obj2["a"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"a" : string +>"a" : "a" obj2["b"]; // number >obj2["b"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"b" : string +>"b" : "b" obj2["oct2"]; // number >obj2["oct2"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"oct2" : string +>"oct2" : "oct2" obj2[5.462437423415177e+244]; // boolean >obj2[5.462437423415177e+244] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->5.462437423415177e+244 : number +>5.462437423415177e+244 : 5.462437423415177e+244 obj2["5.462437423415177e+244"]; // boolean >obj2["5.462437423415177e+244"] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"5.462437423415177e+244" : string +>"5.462437423415177e+244" : "5.462437423415177e+244" obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" diff --git a/tests/baselines/reference/operatorsAndIntersectionTypes.types b/tests/baselines/reference/operatorsAndIntersectionTypes.types index b955059fea67d..7c594b088125e 100644 --- a/tests/baselines/reference/operatorsAndIntersectionTypes.types +++ b/tests/baselines/reference/operatorsAndIntersectionTypes.types @@ -12,7 +12,7 @@ function createGuid() { return "21EC2020-3AEA-4069-A2DD-08002B30309D" as Guid; >"21EC2020-3AEA-4069-A2DD-08002B30309D" as Guid : Guid ->"21EC2020-3AEA-4069-A2DD-08002B30309D" : string +>"21EC2020-3AEA-4069-A2DD-08002B30309D" : "21EC2020-3AEA-4069-A2DD-08002B30309D" >Guid : Guid } @@ -21,7 +21,7 @@ function createSerialNo() { return 12345 as SerialNo; >12345 as SerialNo : SerialNo ->12345 : number +>12345 : 12345 >SerialNo : SerialNo } @@ -36,11 +36,11 @@ let guid = createGuid(); >createGuid : () => Guid map1[guid] = 123; // Can with tagged string ->map1[guid] = 123 : number +>map1[guid] = 123 : 123 >map1[guid] : number >map1 : { [x: string]: number; } >guid : Guid ->123 : number +>123 : 123 let map2: { [x: number]: string } = {}; >map2 : { [x: number]: string; } @@ -53,19 +53,19 @@ let serialNo = createSerialNo(); >createSerialNo : () => SerialNo map2[serialNo] = "hello"; // Can index with tagged number ->map2[serialNo] = "hello" : string +>map2[serialNo] = "hello" : "hello" >map2[serialNo] : string >map2 : { [x: number]: string; } >serialNo : SerialNo ->"hello" : string +>"hello" : "hello" const s1 = "{" + guid + "}"; >s1 : string >"{" + guid + "}" : string >"{" + guid : string ->"{" : string +>"{" : "{" >guid : Guid ->"}" : string +>"}" : "}" const s2 = guid.toLowerCase(); >s2 : string @@ -92,13 +92,13 @@ const s5 = serialNo.toPrecision(0); >serialNo.toPrecision : (precision?: number) => string >serialNo : SerialNo >toPrecision : (precision?: number) => string ->0 : number +>0 : 0 const n1 = serialNo * 3; >n1 : number >serialNo * 3 : number >serialNo : SerialNo ->3 : number +>3 : 3 const n2 = serialNo + serialNo; >n2 : number diff --git a/tests/baselines/reference/optionalAccessorsInInterface1.types b/tests/baselines/reference/optionalAccessorsInInterface1.types index d030849e55433..c4894fd30dc92 100644 --- a/tests/baselines/reference/optionalAccessorsInInterface1.types +++ b/tests/baselines/reference/optionalAccessorsInInterface1.types @@ -21,11 +21,11 @@ defineMyProperty({}, "name", { get: function () { return 5; } }); >defineMyProperty({}, "name", { get: function () { return 5; } }) : any >defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any >{} : {} ->"name" : string +>"name" : "name" >{ get: function () { return 5; } } : { get: () => number; } >get : () => number >function () { return 5; } : () => number ->5 : number +>5 : 5 interface MyPropertyDescriptor2 { >MyPropertyDescriptor2 : MyPropertyDescriptor2 @@ -49,9 +49,9 @@ defineMyProperty2({}, "name", { get: function () { return 5; } }); >defineMyProperty2({}, "name", { get: function () { return 5; } }) : any >defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any >{} : {} ->"name" : string +>"name" : "name" >{ get: function () { return 5; } } : { get: () => number; } >get : () => number >function () { return 5; } : () => number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/optionalBindingParameters1.errors.txt b/tests/baselines/reference/optionalBindingParameters1.errors.txt index 0780c626baf8b..66256edf727d3 100644 --- a/tests/baselines/reference/optionalBindingParameters1.errors.txt +++ b/tests/baselines/reference/optionalBindingParameters1.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(2,14): error TS2463: A binding pattern parameter cannot be optional in an implementation signature. -tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(8,5): error TS2345: Argument of type '[boolean, number, string]' is not assignable to parameter of type '[string, number, boolean]'. +tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(8,5): error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. Type 'boolean' is not assignable to type 'string'. @@ -15,5 +15,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(8,5): er foo([false, 0, ""]); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[boolean, number, string]' is not assignable to parameter of type '[string, number, boolean]'. +!!! error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalBindingParameters2.errors.txt b/tests/baselines/reference/optionalBindingParameters2.errors.txt index e67687722d018..34f36d32380fd 100644 --- a/tests/baselines/reference/optionalBindingParameters2.errors.txt +++ b/tests/baselines/reference/optionalBindingParameters2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(2,14): error TS2463: A binding pattern parameter cannot be optional in an implementation signature. -tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(8,5): error TS2345: Argument of type '{ x: boolean; y: number; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(8,5): error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. Types of property 'x' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -16,6 +16,6 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(8,5): er foo({ x: false, y: 0, z: "" }); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: boolean; y: number; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +!!! error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. !!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt b/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt index 30ec4037c88b6..771ada1a4647d 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt +++ b/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads1.ts(9,5): error TS2345: Argument of type '[boolean, number, string]' is not assignable to parameter of type '[string, number, boolean]'. +tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads1.ts(9,5): error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. Type 'boolean' is not assignable to type 'string'. @@ -13,5 +13,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads1. foo([false, 0, ""]); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[boolean, number, string]' is not assignable to parameter of type '[string, number, boolean]'. +!!! error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt b/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt index 765fd5e3de6e5..e2546aff7243e 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt +++ b/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2.ts(9,5): error TS2345: Argument of type '{ x: boolean; y: number; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2.ts(9,5): error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. Types of property 'x' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -14,6 +14,6 @@ tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2. foo({ x: false, y: 0, z: "" }); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: boolean; y: number; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +!!! error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. !!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalMethods.types b/tests/baselines/reference/optionalMethods.types index 70fda27c01235..cf545eda50997 100644 --- a/tests/baselines/reference/optionalMethods.types +++ b/tests/baselines/reference/optionalMethods.types @@ -69,7 +69,7 @@ function test1(x: Foo) { >x.g : () => number >x : Foo >g : () => number ->0 : number +>0 : 0 } class Bar { @@ -83,18 +83,18 @@ class Bar { c? = 2; >c : number | undefined ->2 : number +>2 : 2 constructor(public d?: number, public e = 10) {} >d : number | undefined >e : number ->10 : number +>10 : 10 f() { >f : () => number return 1; ->1 : number +>1 : 1 } g?(): number; // Body of optional method can be omitted >g : (() => number) | undefined @@ -103,7 +103,7 @@ class Bar { >h : (() => number) | undefined return 2; ->2 : number +>2 : 2 } } @@ -175,7 +175,7 @@ function test2(x: Bar) { >x.g : () => number >x : Bar >g : () => number ->0 : number +>0 : 0 let h1 = x.h && x.h(); >h1 : number | undefined @@ -198,7 +198,7 @@ function test2(x: Bar) { >x.h : () => number >x : Bar >h : () => number ->0 : number +>0 : 0 } class Base { @@ -217,10 +217,10 @@ class Derived extends Base { a = 1; >a : number ->1 : number +>1 : 1 f(): number { return 1; } >f : () => number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams1.types b/tests/baselines/reference/optionalParamReferencingOtherParams1.types index 5a8963b8b33a6..ed8f04721914f 100644 --- a/tests/baselines/reference/optionalParamReferencingOtherParams1.types +++ b/tests/baselines/reference/optionalParamReferencingOtherParams1.types @@ -5,7 +5,7 @@ function strange(x: number, y = x * 1, z = x + y) { >y : number >x * 1 : number >x : number ->1 : number +>1 : 1 >z : number >x + y : number >x : number diff --git a/tests/baselines/reference/optionalParamterAndVariableDeclaration.types b/tests/baselines/reference/optionalParamterAndVariableDeclaration.types index 36c74bf00b913..ad153779039d8 100644 --- a/tests/baselines/reference/optionalParamterAndVariableDeclaration.types +++ b/tests/baselines/reference/optionalParamterAndVariableDeclaration.types @@ -10,7 +10,7 @@ class C { >(options || 0) : number >options || 0 : number >options : number ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types index 1f6a5fc9dc609..a1a47c3f97555 100644 --- a/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types +++ b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types @@ -2,5 +2,5 @@ var a = 10; >a : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/optionsSourcemapInlineSources.types b/tests/baselines/reference/optionsSourcemapInlineSources.types index 42fa1839371b9..1c9865777bbf8 100644 --- a/tests/baselines/reference/optionsSourcemapInlineSources.types +++ b/tests/baselines/reference/optionsSourcemapInlineSources.types @@ -2,5 +2,5 @@ var a = 10; >a : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types index 77abb6f7b11a3..cfe881d34f5bc 100644 --- a/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types @@ -2,5 +2,5 @@ var a = 10; >a : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.types b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.types index 3689afc382c76..02226ff945a8b 100644 --- a/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.types +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.types @@ -2,5 +2,5 @@ var a = 10; >a : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/out-flag.types b/tests/baselines/reference/out-flag.types index b182e4e53d9bf..f1dee2d3c4ada 100644 --- a/tests/baselines/reference/out-flag.types +++ b/tests/baselines/reference/out-flag.types @@ -10,7 +10,7 @@ class MyClass >Count : () => number { return 42; ->42 : number +>42 : 42 } public SetCount(value: number) diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index a1d8c5a6232a7..a88b4f81519ee 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assi tests/cases/compiler/overload1.ts(31,3): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/overload1.ts(32,3): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. -tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/overload1.ts (6 errors) ==== @@ -52,7 +52,7 @@ tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type 'number' !!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. z=x.h("hello",0); // good var v=x.g; diff --git a/tests/baselines/reference/overloadCallTest.types b/tests/baselines/reference/overloadCallTest.types index bd71931197560..8b35c56bf576a 100644 --- a/tests/baselines/reference/overloadCallTest.types +++ b/tests/baselines/reference/overloadCallTest.types @@ -13,13 +13,13 @@ class foo { function bar(foo?: string) { return "foo" }; >bar : { (): string; (s: string): any; } >foo : string ->"foo" : string +>"foo" : "foo" var test = bar("test"); >test : any >bar("test") : any >bar : { (): string; (s: string): any; } ->"test" : string +>"test" : "test" var goo = bar(); >goo : string @@ -31,7 +31,7 @@ class foo { >goo : string >bar("test") : any >bar : { (): string; (s: string): any; } ->"test" : string +>"test" : "test" } } diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types index 10a185708d4dd..382fddfb78abf 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types @@ -5,5 +5,5 @@ var f: (x: 'hi') => number = (x: 'hi') => { return 1; }; >x : "hi" >(x: 'hi') => { return 1; } : (x: "hi") => number >x : "hi" ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.types b/tests/baselines/reference/overloadOnConstConstraintChecks3.types index 0348d3d4b79b8..293d92d467478 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.types @@ -2,7 +2,7 @@ class A { private x = 1} >A : A >x : number ->1 : number +>1 : 1 class B extends A {} >B : B diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.types b/tests/baselines/reference/overloadOnConstConstraintChecks4.types index 6ca7288ead9ba..7b3900038d401 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.types @@ -6,7 +6,7 @@ class A extends Z { private x = 1 } >A : A >Z : Z >x : number ->1 : number +>1 : 1 class B extends A {} >B : B diff --git a/tests/baselines/reference/overloadOnConstInCallback1.types b/tests/baselines/reference/overloadOnConstInCallback1.types index c8c123df1e8e3..c9d954aa282b4 100644 --- a/tests/baselines/reference/overloadOnConstInCallback1.types +++ b/tests/baselines/reference/overloadOnConstInCallback1.types @@ -17,16 +17,16 @@ class C { callback('hi'); >callback('hi') : number >callback : (x: any) => number ->'hi' : string +>'hi' : "hi" callback('bye'); >callback('bye') : number >callback : (x: any) => number ->'bye' : string +>'bye' : "bye" var hm = "hm"; >hm : string ->"hm" : string +>"hm" : "hm" callback(hm); >callback(hm) : number diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt index fe5219606ff90..0573c6ed79ee6 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(9,8): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(9,8): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/overloadOnConstNoAnyImplementation.ts (1 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(9,8): error TS2345: A cb('uh'); cb(1); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. } var cb: (number) => number = (x: number) => 1; diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt index 8723a79d47487..24047578ec6a1 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(12,18): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(12,18): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'. Types of parameters 'x' and 'x' are incompatible. Type '"hi"' is not assignable to type '"bye"'. @@ -21,7 +21,7 @@ tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(21,9): error TS2345: callback(hm); callback(1); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. } } diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation.types b/tests/baselines/reference/overloadOnConstNoStringImplementation.types index 9161620841fa7..0fdbc97e380e9 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation.types +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation.types @@ -20,16 +20,16 @@ function x2(a: number, cb: (x: any) => number) { cb('hi'); >cb('hi') : number >cb : (x: any) => number ->'hi' : string +>'hi' : "hi" cb('bye'); >cb('bye') : number >cb : (x: any) => number ->'bye' : string +>'bye' : "bye" var hm = 'hm'; >hm : string ->'hm' : string +>'hm' : "hm" cb(hm); // should this work without a string definition? >cb(hm) : number @@ -39,12 +39,12 @@ function x2(a: number, cb: (x: any) => number) { cb('uh'); >cb('uh') : number >cb : (x: any) => number ->'uh' : string +>'uh' : "uh" cb(1); >cb(1) : number >cb : (x: any) => number ->1 : number +>1 : 1 } var cb: (number) => number = (x: number) => 1; @@ -52,27 +52,27 @@ var cb: (number) => number = (x: number) => 1; >number : any >(x: number) => 1 : (x: number) => number >x : number ->1 : number +>1 : 1 x2(1, cb); // error >x2(1, cb) : any >x2 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } ->1 : number +>1 : 1 >cb : (number: any) => number x2(1, (x: 'hi') => 1); // error >x2(1, (x: 'hi') => 1) : any >x2 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } ->1 : number +>1 : 1 >(x: 'hi') => 1 : (x: "hi") => number >x : "hi" ->1 : number +>1 : 1 x2(1, (x: string) => 1); >x2(1, (x: string) => 1) : any >x2 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } ->1 : number +>1 : 1 >(x: string) => 1 : (x: string) => number >x : string ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index e0a65f7475e6d..b8b2cdfe88845 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,5): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,11): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,5): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,11): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -55,7 +55,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments fn2('', 0); // Error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments fn2('', 0); // OK @@ -88,10 +88,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): fn4('', 3); fn4(3, ''); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. fn4('', 3); // Error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. fn4(3, ''); // Generic overloads with constraints called without type arguments but with types that satisfy the constraints @@ -108,10 +108,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. fn4(null, true); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(f: (n: string) => void): string; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index c6737c3d79264..4c8e9b2513a49 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -2,14 +2,14 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(75,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(79,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(80,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(79,9): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(80,9): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(84,9): error TS2344: Type 'boolean' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(87,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(88,15): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(87,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(88,15): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(96,18): error TS2339: Property 'toFixed' does not exist on type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(98,18): error TS2339: Property 'blah' does not exist on type 'string'. @@ -97,7 +97,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru new fn4('', 3); new fn4(3, ''); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new fn4('', 3); // Error ~~~~~~ !!! error TS2344: Type 'number' does not satisfy the constraint 'string'. @@ -109,10 +109,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru new fn4('', 3); new fn4(3, ''); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new fn4(3, undefined); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new fn4('', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints @@ -123,10 +123,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. new fn4(null, true); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. // Non - generic overloads where contextual typing of function arguments has errors class fn5 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 540e12774c741..9a112eaf2efdd 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,15): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,15): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -57,7 +57,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments new fn2('', 0); // Error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments new fn2('', 0); // OK @@ -95,10 +95,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors new fn4('', 3); new fn4(3, ''); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new fn4('', 3); // Error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. new fn4(3, ''); // Generic overloads with constraints called without type arguments but with types that satisfy the constraints @@ -115,10 +115,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. new fn4(null, true); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors interface fn5 { diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types index 4cf7b0b086fb1..ee5c336ba9ce7 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types @@ -27,7 +27,7 @@ module Bugs { >index : any >rest[0] : any >rest : any[] ->0 : number +>0 : 0 return typeof args[index] !== 'undefined' >typeof args[index] !== 'undefined' ? args[index] : match : any @@ -58,7 +58,7 @@ function bug3(f:(x:string)=>string) { return f("s") } >x : string >f("s") : string >f : (x: string) => string ->"s" : string +>"s" : "s" function fprime(x:string):string { return x; } >fprime : (x: string) => string diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types index e6ff0cda468dc..d5a06781eec55 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types @@ -46,11 +46,11 @@ module Bugs { >push : (...items: IToken[]) => number >{ startIndex: 1, type: '', bracket: 3 } : { startIndex: number; type: string; bracket: number; } >startIndex : number ->1 : number +>1 : 1 >type : string ->'' : string +>'' : "" >bracket : number ->3 : number +>3 : 3 tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })); >tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })) : number @@ -62,14 +62,14 @@ module Bugs { >({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 }) : { startIndex: number; type: string; bracket: number; state: null; length: number; } >{ startIndex: 1, type: '', bracket: 3, state: null, length: 10 } : { startIndex: number; type: string; bracket: number; state: null; length: number; } >startIndex : number ->1 : number +>1 : 1 >type : string ->'' : string +>'' : "" >bracket : number ->3 : number +>3 : 3 >state : null >null : null >length : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 9f51c0fa10bb5..1bb1fb2041a80 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/overloadResolutionTest1.ts(8,16): error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +tests/cases/compiler/overloadResolutionTest1.ts(8,16): error TS2345: Argument of type '{ a: "s"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. + Type '{ a: "s"; }' is not assignable to type '{ a: boolean; }'. Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(19,15): error TS2345: Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. + Type '"s"' is not assignable to type 'boolean'. +tests/cases/compiler/overloadResolutionTest1.ts(19,15): error TS2345: Argument of type '{ a: "s"; }' is not assignable to parameter of type '{ a: boolean; }'. Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'boolean'. + Type '"s"' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument of type '{ a: boolean; }' is not assignable to parameter of type '{ a: string; }'. Types of property 'a' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -20,10 +20,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument o var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~ -!!! error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Argument of type '{ a: "s"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. +!!! error TS2345: Type '{ a: "s"; }' is not assignable to type '{ a: boolean; }'. !!! error TS2345: Types of property 'a' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'boolean'. +!!! error TS2345: Type '"s"' is not assignable to type 'boolean'. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -36,9 +36,9 @@ tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument o var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error ~~~~~~~ -!!! error TS2345: Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. +!!! error TS2345: Argument of type '{ a: "s"; }' is not assignable to parameter of type '{ a: boolean; }'. !!! error TS2345: Types of property 'a' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'boolean'. +!!! error TS2345: Type '"s"' is not assignable to type 'boolean'. function foo4(bar:{a:number;}):number; diff --git a/tests/baselines/reference/overloadResolutionWithAny.types b/tests/baselines/reference/overloadResolutionWithAny.types index e66368d355441..362c70f61620b 100644 --- a/tests/baselines/reference/overloadResolutionWithAny.types +++ b/tests/baselines/reference/overloadResolutionWithAny.types @@ -13,12 +13,12 @@ var func: { func(""); // number >func("") : number >func : { (s: string): number; (s: any): string; } ->"" : string +>"" : "" func(3); // string >func(3) : string >func : { (s: string): number; (s: any): string; } ->3 : number +>3 : 3 var x: any; >x : any @@ -58,18 +58,18 @@ func2(x, x); // string func2("", ""); // number >func2("", "") : number >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } ->"" : string ->"" : string +>"" : "" +>"" : "" func2(x, ""); // boolean >func2(x, "") : boolean >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } >x : any ->"" : string +>"" : "" func2("", x); // RegExp >func2("", x) : RegExp >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } ->"" : string +>"" : "" >x : any diff --git a/tests/baselines/reference/overloadReturnTypes.types b/tests/baselines/reference/overloadReturnTypes.types index e8d1b7905dc48..c0f573fb98074 100644 --- a/tests/baselines/reference/overloadReturnTypes.types +++ b/tests/baselines/reference/overloadReturnTypes.types @@ -38,7 +38,7 @@ function attr(nameOrMap: any, value?: string): any { else { // handle string case return "s"; ->"s" : string +>"s" : "s" } } diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types index b9ea7d982701a..9b44e197cd8e5 100644 --- a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types @@ -18,12 +18,12 @@ x2(() => 1); >x2(() => 1) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } >() => 1 : () => number ->1 : number +>1 : 1 x2((x) => 1 ); >x2((x) => 1 ) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } >(x) => 1 : (x: number) => number >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArity.types b/tests/baselines/reference/overloadsAndTypeArgumentArity.types index b69f394e83d17..bd86c19beb965 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArity.types +++ b/tests/baselines/reference/overloadsAndTypeArgumentArity.types @@ -24,10 +24,10 @@ declare function Callbacks(flags?: string): void; Callbacks('s'); // no error >Callbacks('s') : void >Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } ->'s' : string +>'s' : "s" new Callbacks('s'); // no error >new Callbacks('s') : any >Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } ->'s' : string +>'s' : "s" diff --git a/tests/baselines/reference/overloadsWithConstraints.types b/tests/baselines/reference/overloadsWithConstraints.types index b045904ece5bb..87974482f4348 100644 --- a/tests/baselines/reference/overloadsWithConstraints.types +++ b/tests/baselines/reference/overloadsWithConstraints.types @@ -19,5 +19,5 @@ var v = f(""); >v : string >f("") : string >f : { (x: T): T; (x: T): T; } ->"" : string +>"" : "" diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.types b/tests/baselines/reference/parenthesizedContexualTyping1.types index 61ec1a24ec5bb..387e80d349fba 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping1.types +++ b/tests/baselines/reference/parenthesizedContexualTyping1.types @@ -50,7 +50,7 @@ var a = fun(x => x, 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var b = fun((x => x), 10); >b : number @@ -60,7 +60,7 @@ var b = fun((x => x), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var c = fun(((x => x)), 10); >c : number @@ -71,7 +71,7 @@ var c = fun(((x => x)), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var d = fun((((x => x))), 10); >d : number @@ -83,7 +83,7 @@ var d = fun((((x => x))), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var e = fun(x => x, x => x, 10); >e : number @@ -95,7 +95,7 @@ var e = fun(x => x, x => x, 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var f = fun((x => x), (x => x), 10); >f : number @@ -109,7 +109,7 @@ var f = fun((x => x), (x => x), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var g = fun(((x => x)), ((x => x)), 10); >g : number @@ -125,7 +125,7 @@ var g = fun(((x => x)), ((x => x)), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var h = fun((((x => x))), ((x => x)), 10); >h : number @@ -142,7 +142,7 @@ var h = fun((((x => x))), ((x => x)), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 // Ternaries in parens var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); @@ -156,14 +156,14 @@ var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >x => x : (x: number) => number >x : number >x : number >x => undefined : (x: number) => any >x : number >undefined : undefined ->10 : number +>10 : 10 var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >j : number @@ -176,7 +176,7 @@ var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -185,7 +185,7 @@ var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >x => undefined : (x: number) => any >x : number >undefined : undefined ->10 : number +>10 : 10 var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >k : number @@ -198,7 +198,7 @@ var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -210,7 +210,7 @@ var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x)), 10); >l : number @@ -224,7 +224,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x) >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >((x => x)) : (x: number) => number >(x => x) : (x: number) => number >x => x : (x: number) => number @@ -240,7 +240,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x) >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var lambda1: (x: number) => number = x => x; >lambda1 : (x: number) => number diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.types b/tests/baselines/reference/parenthesizedContexualTyping2.types index aa6e1916f8144..7944f6f43debf 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping2.types +++ b/tests/baselines/reference/parenthesizedContexualTyping2.types @@ -46,7 +46,7 @@ function fun(...rest: any[]): T { var a = fun(x => { x(undefined); return x; }, 10); >a : number ->fun(x => { x(undefined); return x; }, 10) : number +>fun(x => { x(undefined); return x; }, 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -54,11 +54,11 @@ var a = fun(x => { x(undefined); return x; }, 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var b = fun((x => { x(undefined); return x; }), 10); >b : number ->fun((x => { x(undefined); return x; }), 10) : number +>fun((x => { x(undefined); return x; }), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -67,11 +67,11 @@ var b = fun((x => { x(undefined); return x; }), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var c = fun(((x => { x(undefined); return x; })), 10); >c : number ->fun(((x => { x(undefined); return x; })), 10) : number +>fun(((x => { x(undefined); return x; })), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T @@ -81,11 +81,11 @@ var c = fun(((x => { x(undefined); return x; })), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var d = fun((((x => { x(undefined); return x; }))), 10); >d : number ->fun((((x => { x(undefined); return x; }))), 10) : number +>fun((((x => { x(undefined); return x; }))), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(((x => { x(undefined); return x; }))) : (x: (p: T) => T) => (p: T) => T >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T @@ -96,11 +96,11 @@ var d = fun((((x => { x(undefined); return x; }))), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var e = fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10); >e : number ->fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10) : number +>fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -114,11 +114,11 @@ var e = fun(x => { x(undefined); return x; }, x => { x(undefined >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var f = fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10); >f : number ->fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10) : number +>fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -134,11 +134,11 @@ var f = fun((x => { x(undefined); return x; }),(x => { x(undefin >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var g = fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10); >g : number ->fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10) : number +>fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T @@ -156,11 +156,11 @@ var g = fun(((x => { x(undefined); return x; })),((x => { x(unde >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var h = fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10); >h : number ->fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10) : number +>fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(((x => { x(undefined); return x; }))) : (x: (p: T) => T) => (p: T) => T >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T @@ -179,12 +179,12 @@ var h = fun((((x => { x(undefined); return x; }))),((x => { x(un >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 // Ternaries in parens var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10); >i : number ->fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10) : number +>fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined) : (x: (p: T) => T) => any >Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined : (x: (p: T) => T) => any @@ -193,7 +193,7 @@ var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >x(undefined) : number @@ -203,11 +203,11 @@ var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x >x => undefined : (x: (p: T) => T) => any >x : (p: T) => T >undefined : undefined ->10 : number +>10 : 10 var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10); >j : number ->fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10) : number +>fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)) : (x: (p: T) => T) => any >Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined) : (x: (p: T) => T) => any @@ -216,7 +216,7 @@ var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -228,11 +228,11 @@ var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >x => undefined : (x: (p: T) => T) => any >x : (p: T) => T >undefined : undefined ->10 : number +>10 : 10 var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); >k : number ->fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10) : number +>fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)) : (x: (p: T) => T) => any >Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined) : (x: (p: T) => T) => any @@ -241,7 +241,7 @@ var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -259,11 +259,11 @@ var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); >l : number ->fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10) : number +>fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))) : (x: (p: T) => T) => any >(Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined))) : (x: (p: T) => T) => any @@ -273,7 +273,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -295,7 +295,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var lambda1: FuncType = x => { x(undefined); return x; }; >lambda1 : FuncType diff --git a/tests/baselines/reference/parenthesizedContexualTyping3.types b/tests/baselines/reference/parenthesizedContexualTyping3.types index 5d424e5a7b0d1..522228b260d89 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping3.types +++ b/tests/baselines/reference/parenthesizedContexualTyping3.types @@ -62,7 +62,7 @@ var a = tempFun `${ x => x } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var b = tempFun `${ (x => x) } ${ 10 }` >b : number @@ -73,7 +73,7 @@ var b = tempFun `${ (x => x) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var c = tempFun `${ ((x => x)) } ${ 10 }` >c : number @@ -85,7 +85,7 @@ var c = tempFun `${ ((x => x)) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var d = tempFun `${ x => x } ${ x => x } ${ 10 }` >d : number @@ -98,7 +98,7 @@ var d = tempFun `${ x => x } ${ x => x } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` >e : number @@ -112,7 +112,7 @@ var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` >f : number @@ -127,7 +127,7 @@ var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` >g : number @@ -144,7 +144,7 @@ var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var h = tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }` >h : any diff --git a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt index 6f45030a6504b..16eb82ecb34db 100644 --- a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt +++ b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(4,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(5,17): error TS1210: Invalid use of 'eval'. Class definitions are automatically in strict mode. tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. -tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS2322: Type 'string' is not assignable to type 'IArguments'. +tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS2322: Type '"hello"' is not assignable to type 'IArguments'. ==== tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts (4 errors) ==== @@ -18,6 +18,6 @@ tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeBy ~~~~~~~~~ !!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'IArguments'. +!!! error TS2322: Type '"hello"' is not assignable to type 'IArguments'. } } \ No newline at end of file diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt index 940083ca93a93..2c721724b3e76 100644 --- a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt +++ b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(16,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'false'. tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error TS2304: Cannot find name 'runTestCase'. @@ -22,7 +22,7 @@ tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error T var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)); ~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'false'. if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) a.indexOf(0) === 7 && // a[7] = +0, 0===+0 a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 diff --git a/tests/baselines/reference/parser509546_2.types b/tests/baselines/reference/parser509546_2.types index 211553286a54d..819b972254d50 100644 --- a/tests/baselines/reference/parser509546_2.types +++ b/tests/baselines/reference/parser509546_2.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Logger { >Logger : Logger diff --git a/tests/baselines/reference/parser630933.types b/tests/baselines/reference/parser630933.types index 3f991f58d3076..9a0ba9e720548 100644 --- a/tests/baselines/reference/parser630933.types +++ b/tests/baselines/reference/parser630933.types @@ -1,7 +1,7 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser630933.ts === var a = "Hello"; >a : string ->"Hello" : string +>"Hello" : "Hello" var b = a.match(/\/ver=([^/]+)/); >b : RegExpMatchArray diff --git a/tests/baselines/reference/parser768531.types b/tests/baselines/reference/parser768531.types index 434535b5cc9e2..17bae7161fa1c 100644 --- a/tests/baselines/reference/parser768531.types +++ b/tests/baselines/reference/parser768531.types @@ -2,7 +2,7 @@ {a: 3} >a : any ->3 : number +>3 : 3 /x/ >/x/ : RegExp diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic3.types b/tests/baselines/reference/parserAccessibilityAfterStatic3.types index c85c50773921f..3bf87f8807fc8 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic3.types +++ b/tests/baselines/reference/parserAccessibilityAfterStatic3.types @@ -4,6 +4,6 @@ class Outer { static public = 1; >public : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types index bdeb5ab7bbc4d..234375fb46dda 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types @@ -17,5 +17,5 @@ function f1() { >(c + 1) : any >c + 1 : any >c : any ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types index 79eb212163e9a..ed3b4b903bb86 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types @@ -17,5 +17,5 @@ function f() { >(c + 1) : any >c + 1 : any >c : any ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types index aba5f4872d874..61601d8bdf653 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types @@ -17,6 +17,6 @@ function f() { >(c + 1) : any >c + 1 : any >c : any ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/parserArrayLiteralExpression10.types b/tests/baselines/reference/parserArrayLiteralExpression10.types index 370e9fb6c9d86..7960490e7cf23 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression10.types +++ b/tests/baselines/reference/parserArrayLiteralExpression10.types @@ -2,6 +2,6 @@ var v = [1,1,]; >v : number[] >[1,1,] : number[] ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression11.types b/tests/baselines/reference/parserArrayLiteralExpression11.types index aba6e30a2915f..36491c96655cb 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression11.types +++ b/tests/baselines/reference/parserArrayLiteralExpression11.types @@ -2,7 +2,7 @@ var v = [1,,1]; >v : number[] >[1,,1] : number[] ->1 : number +>1 : 1 > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression12.types b/tests/baselines/reference/parserArrayLiteralExpression12.types index 7d9e4c3897647..cd861667501ae 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression12.types +++ b/tests/baselines/reference/parserArrayLiteralExpression12.types @@ -2,8 +2,8 @@ var v = [1,,,1]; >v : number[] >[1,,,1] : number[] ->1 : number +>1 : 1 > : undefined > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression13.types b/tests/baselines/reference/parserArrayLiteralExpression13.types index 62fb9aea5f7fa..7d377e9ac5a55 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression13.types +++ b/tests/baselines/reference/parserArrayLiteralExpression13.types @@ -2,9 +2,9 @@ var v = [1,,1,,1]; >v : number[] >[1,,1,,1] : number[] ->1 : number +>1 : 1 > : undefined ->1 : number +>1 : 1 > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression14.types b/tests/baselines/reference/parserArrayLiteralExpression14.types index 9d3a029aed2ab..aa08d2b13d03d 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression14.types +++ b/tests/baselines/reference/parserArrayLiteralExpression14.types @@ -4,13 +4,13 @@ var v = [,,1,1,,1,,1,1,,1]; >[,,1,1,,1,,1,1,,1] : number[] > : undefined > : undefined ->1 : number ->1 : number +>1 : 1 +>1 : 1 > : undefined ->1 : number +>1 : 1 > : undefined ->1 : number ->1 : number +>1 : 1 +>1 : 1 > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression15.types b/tests/baselines/reference/parserArrayLiteralExpression15.types index 75afab3731cf0..7f7b855a007cb 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression15.types +++ b/tests/baselines/reference/parserArrayLiteralExpression15.types @@ -4,13 +4,13 @@ var v = [,,1,1,,1,,1,1,,1,]; >[,,1,1,,1,,1,1,,1,] : number[] > : undefined > : undefined ->1 : number ->1 : number +>1 : 1 +>1 : 1 > : undefined ->1 : number +>1 : 1 > : undefined ->1 : number ->1 : number +>1 : 1 +>1 : 1 > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression5.types b/tests/baselines/reference/parserArrayLiteralExpression5.types index 48fdaa024fcc9..b1b2e59b8d4fd 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression5.types +++ b/tests/baselines/reference/parserArrayLiteralExpression5.types @@ -2,5 +2,5 @@ var v = [1]; >v : number[] >[1] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression6.types b/tests/baselines/reference/parserArrayLiteralExpression6.types index 66df1cda219d1..f13db817901aa 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression6.types +++ b/tests/baselines/reference/parserArrayLiteralExpression6.types @@ -3,5 +3,5 @@ var v = [,1]; >v : number[] >[,1] : number[] > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression7.types b/tests/baselines/reference/parserArrayLiteralExpression7.types index 65225500eb209..35d786ea67bab 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression7.types +++ b/tests/baselines/reference/parserArrayLiteralExpression7.types @@ -2,5 +2,5 @@ var v = [1,]; >v : number[] >[1,] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression8.types b/tests/baselines/reference/parserArrayLiteralExpression8.types index e14c99f3b57e6..7ea2b3b8e5c43 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression8.types +++ b/tests/baselines/reference/parserArrayLiteralExpression8.types @@ -3,5 +3,5 @@ var v = [,1,]; >v : number[] >[,1,] : number[] > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression9.types b/tests/baselines/reference/parserArrayLiteralExpression9.types index 96bb1595326a2..3dc1326c8129d 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression9.types +++ b/tests/baselines/reference/parserArrayLiteralExpression9.types @@ -2,6 +2,6 @@ var v = [1,1]; >v : number[] >[1,1] : number[] ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/parserDoStatement2.types b/tests/baselines/reference/parserDoStatement2.types index 5affaa958d632..9e83f6ad6d21e 100644 --- a/tests/baselines/reference/parserDoStatement2.types +++ b/tests/baselines/reference/parserDoStatement2.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/Statements/parserDoStatement2.ts === do{;}while(false)false ->false : boolean ->false : boolean +>false : false +>false : false diff --git a/tests/baselines/reference/parserEmptyStatement1.types b/tests/baselines/reference/parserEmptyStatement1.types index a581dd6e87174..1cb1e33b2b80b 100644 --- a/tests/baselines/reference/parserEmptyStatement1.types +++ b/tests/baselines/reference/parserEmptyStatement1.types @@ -2,7 +2,7 @@ ; ; var a = 1; >a : number ->1 : number +>1 : 1 ; diff --git a/tests/baselines/reference/parserEnum1.types b/tests/baselines/reference/parserEnum1.types index 34d11a1858d5c..42161656a1e88 100644 --- a/tests/baselines/reference/parserEnum1.types +++ b/tests/baselines/reference/parserEnum1.types @@ -6,21 +6,21 @@ None = 0, >None : SignatureFlags ->0 : number +>0 : 0 IsIndexer = 1, >IsIndexer : SignatureFlags ->1 : number +>1 : 1 IsStringIndexer = 1 << 1, >IsStringIndexer : SignatureFlags >1 << 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 IsNumberIndexer = 1 << 2, >IsNumberIndexer : SignatureFlags >1 << 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 } diff --git a/tests/baselines/reference/parserEnum2.types b/tests/baselines/reference/parserEnum2.types index 6d119d8f07934..5c0a8fec2d400 100644 --- a/tests/baselines/reference/parserEnum2.types +++ b/tests/baselines/reference/parserEnum2.types @@ -6,21 +6,21 @@ None = 0, >None : SignatureFlags ->0 : number +>0 : 0 IsIndexer = 1, >IsIndexer : SignatureFlags ->1 : number +>1 : 1 IsStringIndexer = 1 << 1, >IsStringIndexer : SignatureFlags >1 << 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 IsNumberIndexer = 1 << 2 >IsNumberIndexer : SignatureFlags >1 << 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 } diff --git a/tests/baselines/reference/parserEnumDeclaration1.types b/tests/baselines/reference/parserEnumDeclaration1.types index de99855b310f6..cd58d5dc89a35 100644 --- a/tests/baselines/reference/parserEnumDeclaration1.types +++ b/tests/baselines/reference/parserEnumDeclaration1.types @@ -3,9 +3,9 @@ enum E { >E : E Foo = 1, ->Foo : E ->1 : number +>Foo : E.Foo +>1 : 1 Bar ->Bar : E +>Bar : E.Bar } diff --git a/tests/baselines/reference/parserEnumDeclaration3.types b/tests/baselines/reference/parserEnumDeclaration3.types index b427a795eb6fc..027f837229f73 100644 --- a/tests/baselines/reference/parserEnumDeclaration3.types +++ b/tests/baselines/reference/parserEnumDeclaration3.types @@ -4,5 +4,5 @@ declare enum E { A = 1 >A : E ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/parserEnumDeclaration5.types b/tests/baselines/reference/parserEnumDeclaration5.types index bbb596b7b0f88..4068eed0a4bd5 100644 --- a/tests/baselines/reference/parserEnumDeclaration5.types +++ b/tests/baselines/reference/parserEnumDeclaration5.types @@ -3,16 +3,16 @@ enum E { >E : E A = 1, ->A : E ->1 : number +>A : E.A +>1 : 1 B, ->B : E +>B : E.B C = 2, ->C : E ->2 : number +>C : E.B +>2 : 2 D ->D : E +>D : E.D } diff --git a/tests/baselines/reference/parserEnumDeclaration6.types b/tests/baselines/reference/parserEnumDeclaration6.types index c13d66db41c95..53d1e636750c9 100644 --- a/tests/baselines/reference/parserEnumDeclaration6.types +++ b/tests/baselines/reference/parserEnumDeclaration6.types @@ -4,7 +4,7 @@ enum E { A = 1, >A : E ->1 : number +>1 : 1 B, >B : E @@ -12,8 +12,8 @@ enum E { C = 1 << 1, >C : E >1 << 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 D, >D : E diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types index b38bbbfe64d4d..161824e512def 100644 --- a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types @@ -52,8 +52,8 @@ module Shapes { >origin : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 } } @@ -66,8 +66,8 @@ var p: IPoint = new Shapes.Point(3, 4); >Shapes.Point : typeof Shapes.Point >Shapes : typeof Shapes >Point : typeof Shapes.Point ->3 : number ->4 : number +>3 : 3 +>4 : 4 var dist = p.getDist(); >dist : number diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types index 0449fdda85a82..1c82fb807d80a 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity1.ts === 1 >> 2; >1 >> 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types index 8b3d5dd2ba3d7..cda7a97701e1b 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types @@ -1,10 +1,10 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity10.ts === 1 >1 // before>>> // after2 : number ->1 : number +>1 : 1 // before >>> // after 2; ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity2.errors.txt b/tests/baselines/reference/parserGreaterThanTokenAmbiguity2.errors.txt index 30ede342a85b9..ee2d36666825a 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity2.errors.txt +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity2.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity2.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity2.ts(1,5): error TS1109: Expression expected. ==== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity2.ts (2 errors) ==== 1 > > 2; ~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. ~ !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity3.errors.txt b/tests/baselines/reference/parserGreaterThanTokenAmbiguity3.errors.txt index baebfd81304e1..1651009bf0d55 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity3.errors.txt +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity3.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity3.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity3.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity3.ts(1,8): error TS1109: Expression expected. ==== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity3.ts (2 errors) ==== 1 >/**/> 2; ~~~~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. ~ !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.errors.txt b/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.errors.txt index 924c9440d169f..dff69b3761282 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.errors.txt +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity4.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity4.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity4.ts(2,1): error TS1109: Expression expected. @@ -7,6 +7,6 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbigu ~~~ > 2; ~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. ~ !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types index 609901bfdd519..0dc774103aa1d 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types @@ -1,10 +1,10 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity5.ts === 1 >1 // before>> // after2 : number ->1 : number +>1 : 1 // before >> // after 2; ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types index e7aa311113c68..171211bfbaba1 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity6.ts === 1 >>> 2; >1 >>> 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/parserInterfaceKeywordInEnum1.types b/tests/baselines/reference/parserInterfaceKeywordInEnum1.types index f6b613f3f6085..57c4ef2ebec74 100644 --- a/tests/baselines/reference/parserInterfaceKeywordInEnum1.types +++ b/tests/baselines/reference/parserInterfaceKeywordInEnum1.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserInterfaceKeywordInEnum1.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" enum Bar { >Bar : Bar diff --git a/tests/baselines/reference/parserKeywordsAsIdentifierName1.types b/tests/baselines/reference/parserKeywordsAsIdentifierName1.types index bc586e8a4bb3b..74b9e0b30deba 100644 --- a/tests/baselines/reference/parserKeywordsAsIdentifierName1.types +++ b/tests/baselines/reference/parserKeywordsAsIdentifierName1.types @@ -5,14 +5,14 @@ var big = { break : 0, >break : number ->0 : number +>0 : 0 super : 0, >super : number ->0 : number +>0 : 0 const : 0 >const : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/parserModule1.types b/tests/baselines/reference/parserModule1.types index 2d3b670aaa6f3..b32651a71a429 100644 --- a/tests/baselines/reference/parserModule1.types +++ b/tests/baselines/reference/parserModule1.types @@ -4,7 +4,7 @@ export var debug = false; >debug : boolean ->false : boolean +>false : false export interface IDiagnosticWriter { >IDiagnosticWriter : IDiagnosticWriter @@ -21,7 +21,7 @@ export var analysisPass: number = 0; >analysisPass : number ->0 : number +>0 : 0 export function Alert(output: string) { >Alert : (output: string) => void diff --git a/tests/baselines/reference/parserModuleDeclaration11.types b/tests/baselines/reference/parserModuleDeclaration11.types index 98075a505f796..21d9f0803eac4 100644 --- a/tests/baselines/reference/parserModuleDeclaration11.types +++ b/tests/baselines/reference/parserModuleDeclaration11.types @@ -14,7 +14,7 @@ string.foo("abc"); >string.foo : (s: string) => any >string : typeof string >foo : (s: string) => any ->"abc" : string +>"abc" : "abc" var x: string.X; >x : string.X diff --git a/tests/baselines/reference/parserObjectLiterals1.types b/tests/baselines/reference/parserObjectLiterals1.types index b6bca18e36066..fb85352747f6e 100644 --- a/tests/baselines/reference/parserObjectLiterals1.types +++ b/tests/baselines/reference/parserObjectLiterals1.types @@ -3,7 +3,7 @@ var v = { a: 1, b: 2 }; >v : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/parserSbp_7.9_A9_T3.types b/tests/baselines/reference/parserSbp_7.9_A9_T3.types index 5e1eed4dd988d..58147a37a67de 100644 --- a/tests/baselines/reference/parserSbp_7.9_A9_T3.types +++ b/tests/baselines/reference/parserSbp_7.9_A9_T3.types @@ -13,7 +13,7 @@ do { ; } while (false) true ->false : boolean ->true : boolean +>false : false +>true : true diff --git a/tests/baselines/reference/parserStrictMode16.types b/tests/baselines/reference/parserStrictMode16.types index a7a68ab781143..fbe701f374b13 100644 --- a/tests/baselines/reference/parserStrictMode16.types +++ b/tests/baselines/reference/parserStrictMode16.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode16.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" delete this; >delete this : boolean @@ -8,7 +8,7 @@ delete this; delete 1; >delete 1 : boolean ->1 : number +>1 : 1 delete null; >delete null : boolean @@ -16,5 +16,5 @@ delete null; delete "a"; >delete "a" : boolean ->"a" : string +>"a" : "a" diff --git a/tests/baselines/reference/parserStrictMode5.errors.txt b/tests/baselines/reference/parserStrictMode5.errors.txt index 4b3dc48f2b497..e541963a1fb5f 100644 --- a/tests/baselines/reference/parserStrictMode5.errors.txt +++ b/tests/baselines/reference/parserStrictMode5.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): error TS2365: Operator '+=' cannot be applied to types '(x: string) => any' and 'number'. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): error TS2365: Operator '+=' cannot be applied to types '(x: string) => any' and '1'. ==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. ~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types '(x: string) => any' and 'number'. \ No newline at end of file +!!! error TS2365: Operator '+=' cannot be applied to types '(x: string) => any' and '1'. \ No newline at end of file diff --git a/tests/baselines/reference/parserSymbolProperty6.types b/tests/baselines/reference/parserSymbolProperty6.types index a802765cb4f30..13553eb27c6cf 100644 --- a/tests/baselines/reference/parserSymbolProperty6.types +++ b/tests/baselines/reference/parserSymbolProperty6.types @@ -6,5 +6,5 @@ class C { >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/parserUnicode2.types b/tests/baselines/reference/parserUnicode2.types index 1051b23905f7e..5e25bef83063d 100644 --- a/tests/baselines/reference/parserUnicode2.types +++ b/tests/baselines/reference/parserUnicode2.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/parserUnicode2.ts === var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = 1; >才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserVoidExpression1.types b/tests/baselines/reference/parserVoidExpression1.types index a2d9988eee341..a4495f987e6c1 100644 --- a/tests/baselines/reference/parserVoidExpression1.types +++ b/tests/baselines/reference/parserVoidExpression1.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/parserVoidExpression1.ts === void 0; >void 0 : undefined ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/parser_breakInIterationOrSwitchStatement1.types b/tests/baselines/reference/parser_breakInIterationOrSwitchStatement1.types index 6688f334a86ef..d00c1e6f708d3 100644 --- a/tests/baselines/reference/parser_breakInIterationOrSwitchStatement1.types +++ b/tests/baselines/reference/parser_breakInIterationOrSwitchStatement1.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakInIterationOrSwitchStatement1.ts === while (true) { ->true : boolean +>true : true break; } diff --git a/tests/baselines/reference/parser_breakInIterationOrSwitchStatement2.types b/tests/baselines/reference/parser_breakInIterationOrSwitchStatement2.types index 7def75c322aa8..1d490ef10402b 100644 --- a/tests/baselines/reference/parser_breakInIterationOrSwitchStatement2.types +++ b/tests/baselines/reference/parser_breakInIterationOrSwitchStatement2.types @@ -3,5 +3,5 @@ do { break; } while (true); ->true : boolean +>true : true diff --git a/tests/baselines/reference/parser_breakTarget2.types b/tests/baselines/reference/parser_breakTarget2.types index 8a1e7a991dbb6..550a3d39de36e 100644 --- a/tests/baselines/reference/parser_breakTarget2.types +++ b/tests/baselines/reference/parser_breakTarget2.types @@ -3,7 +3,7 @@ target: >target : any while (true) { ->true : boolean +>true : true break target; >target : any diff --git a/tests/baselines/reference/parser_breakTarget3.types b/tests/baselines/reference/parser_breakTarget3.types index b1ce9f8d94dda..eb5c2cf68a5e9 100644 --- a/tests/baselines/reference/parser_breakTarget3.types +++ b/tests/baselines/reference/parser_breakTarget3.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true break target1; >target1 : any diff --git a/tests/baselines/reference/parser_breakTarget4.types b/tests/baselines/reference/parser_breakTarget4.types index 04bb129c9190c..3a368eeb6c9c9 100644 --- a/tests/baselines/reference/parser_breakTarget4.types +++ b/tests/baselines/reference/parser_breakTarget4.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true break target2; >target2 : any diff --git a/tests/baselines/reference/parser_continueInIterationStatement1.types b/tests/baselines/reference/parser_continueInIterationStatement1.types index c6819ba2c18c9..0e1bd38266cdc 100644 --- a/tests/baselines/reference/parser_continueInIterationStatement1.types +++ b/tests/baselines/reference/parser_continueInIterationStatement1.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueInIterationStatement1.ts === while (true) { ->true : boolean +>true : true continue; } diff --git a/tests/baselines/reference/parser_continueInIterationStatement2.types b/tests/baselines/reference/parser_continueInIterationStatement2.types index ead70157de409..701f5e5ffaf95 100644 --- a/tests/baselines/reference/parser_continueInIterationStatement2.types +++ b/tests/baselines/reference/parser_continueInIterationStatement2.types @@ -3,5 +3,5 @@ do { continue; } while (true); ->true : boolean +>true : true diff --git a/tests/baselines/reference/parser_continueLabel.types b/tests/baselines/reference/parser_continueLabel.types index a8a240ac18bcb..24f1ed509de93 100644 --- a/tests/baselines/reference/parser_continueLabel.types +++ b/tests/baselines/reference/parser_continueLabel.types @@ -2,10 +2,10 @@ label1: for(var i = 0; i < 1; i++) { >label1 : any >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/parser_continueTarget2.types b/tests/baselines/reference/parser_continueTarget2.types index ba01f3b8927aa..0dc073fda3f2e 100644 --- a/tests/baselines/reference/parser_continueTarget2.types +++ b/tests/baselines/reference/parser_continueTarget2.types @@ -3,7 +3,7 @@ target: >target : any while (true) { ->true : boolean +>true : true continue target; >target : any diff --git a/tests/baselines/reference/parser_continueTarget3.types b/tests/baselines/reference/parser_continueTarget3.types index fd8aedc357f74..273c47f97cf0b 100644 --- a/tests/baselines/reference/parser_continueTarget3.types +++ b/tests/baselines/reference/parser_continueTarget3.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true continue target1; >target1 : any diff --git a/tests/baselines/reference/parser_continueTarget4.types b/tests/baselines/reference/parser_continueTarget4.types index be1e5458f4bca..21381823e7ca2 100644 --- a/tests/baselines/reference/parser_continueTarget4.types +++ b/tests/baselines/reference/parser_continueTarget4.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true continue target2; >target2 : any diff --git a/tests/baselines/reference/parser_duplicateLabel3.types b/tests/baselines/reference/parser_duplicateLabel3.types index 88ea435bf3e21..8d62ee2a14d82 100644 --- a/tests/baselines/reference/parser_duplicateLabel3.types +++ b/tests/baselines/reference/parser_duplicateLabel3.types @@ -4,7 +4,7 @@ target: >target : any while (true) { ->true : boolean +>true : true function f() { >f : () => void @@ -13,7 +13,7 @@ while (true) { >target : any while (true) { ->true : boolean +>true : true } } } diff --git a/tests/baselines/reference/parser_duplicateLabel4.types b/tests/baselines/reference/parser_duplicateLabel4.types index b70dd12c695bf..483cf8a005133 100644 --- a/tests/baselines/reference/parser_duplicateLabel4.types +++ b/tests/baselines/reference/parser_duplicateLabel4.types @@ -4,12 +4,12 @@ target: >target : any while (true) { ->true : boolean +>true : true } target: >target : any while (true) { ->true : boolean +>true : true } diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution3_classic.types b/tests/baselines/reference/pathMappingBasedModuleResolution3_classic.types index 359811ff3b20d..17f9393226518 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution3_classic.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution3_classic.types @@ -35,10 +35,10 @@ export var x = a + b; === c:/root/folder2/file3.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/file4.ts === export var y = 100; >y : number ->100 : number +>100 : 100 diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution3_node.types b/tests/baselines/reference/pathMappingBasedModuleResolution3_node.types index 78597cf50eff6..2c85b8ebcbd8e 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution3_node.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution3_node.types @@ -35,7 +35,7 @@ export var x = a + b; === c:/root/folder2/file3.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/node_modules/file4/index.d.ts === export var y: number; diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution4_classic.types b/tests/baselines/reference/pathMappingBasedModuleResolution4_classic.types index d225246e2f949..6cb2db1bc5c42 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution4_classic.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution4_classic.types @@ -32,10 +32,10 @@ export var x = a + b; === c:/root/folder2/file3.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/file4.ts === export var y = 100; >y : number ->100 : number +>100 : 100 diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution4_node.types b/tests/baselines/reference/pathMappingBasedModuleResolution4_node.types index 5478a601f0226..871446b5ebb83 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution4_node.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution4_node.types @@ -32,7 +32,7 @@ export var x = a + b; === c:/root/folder2/file3.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/node_modules/file4/index.d.ts === export var y: number; diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution5_classic.types b/tests/baselines/reference/pathMappingBasedModuleResolution5_classic.types index 32a1f42bc0fb4..7a15355b157d5 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution5_classic.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution5_classic.types @@ -50,20 +50,20 @@ use(z1.toExponential()); === c:/root/folder2/file1.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/root/generated/folder3/file2.ts === export var y = 1; >y : number ->1 : number +>1 : 1 === c:/root/shared/components/file3.ts === export var z = 1; >z : number ->1 : number +>1 : 1 === c:/file4.ts === export var z1 = 1; >z1 : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution5_node.types b/tests/baselines/reference/pathMappingBasedModuleResolution5_node.types index 1b96e3f4f22a9..2cdc99dcd8cab 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution5_node.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution5_node.types @@ -50,12 +50,12 @@ use(z1.toExponential()); === c:/root/folder2/file1.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/root/generated/folder3/file2.ts === export var y = 1; >y : number ->1 : number +>1 : 1 === c:/root/shared/components/file3/index.d.ts === export var z: number; @@ -64,5 +64,5 @@ export var z: number; === c:/node_modules/file4.ts === export var z1 = 1; >z1 : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.types b/tests/baselines/reference/plusOperatorWithBooleanType.types index f688706c2e5e2..8fd2ee350ebd8 100644 --- a/tests/baselines/reference/plusOperatorWithBooleanType.types +++ b/tests/baselines/reference/plusOperatorWithBooleanType.types @@ -15,7 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -39,16 +39,16 @@ var ResultIsNumber1 = +BOOLEAN; var ResultIsNumber2 = +true; >ResultIsNumber2 : number >+true : number ->true : boolean +>true : true var ResultIsNumber3 = +{ x: true, y: false }; >ResultIsNumber3 : number >+{ x: true, y: false } : number >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsNumber4 = +objA.a; @@ -82,7 +82,7 @@ var ResultIsNumber7 = +A.foo(); // miss assignment operators +true; >+true : number ->true : boolean +>true : true +BOOLEAN; >+BOOLEAN : number @@ -94,10 +94,10 @@ var ResultIsNumber7 = +A.foo(); >foo : () => boolean +true, false; ->+true, false : boolean +>+true, false : false >+true : number ->true : boolean ->false : boolean +>true : true +>false : false +objA.a; >+objA.a : number diff --git a/tests/baselines/reference/plusOperatorWithEnumType.types b/tests/baselines/reference/plusOperatorWithEnumType.types index e6dd769900e48..f0b7df1075620 100644 --- a/tests/baselines/reference/plusOperatorWithEnumType.types +++ b/tests/baselines/reference/plusOperatorWithEnumType.types @@ -6,8 +6,8 @@ enum ENUM { }; enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 +>A : ENUM1.A +>B : ENUM1.B // enum type var var ResultIsNumber1 = +ENUM; @@ -24,9 +24,9 @@ var ResultIsNumber2 = +ENUM1; var ResultIsNumber3 = +ENUM1["A"]; >ResultIsNumber3 : number >+ENUM1["A"] : number ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string +>"A" : "A" var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]); >ResultIsNumber4 : number @@ -35,10 +35,10 @@ var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM ->0 : number ->ENUM1["B"] : ENUM1 +>0 : 0 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" // miss assignment operators +ENUM; @@ -51,9 +51,9 @@ var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]); +ENUM1.B; >+ENUM1.B : number ->ENUM1.B : ENUM1 +>ENUM1.B : ENUM1.B >ENUM1 : typeof ENUM1 ->B : ENUM1 +>B : ENUM1.B +ENUM, ENUM1; >+ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/plusOperatorWithNumberType.types b/tests/baselines/reference/plusOperatorWithNumberType.types index 2db1288de4ad9..f24785ffa0630 100644 --- a/tests/baselines/reference/plusOperatorWithNumberType.types +++ b/tests/baselines/reference/plusOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsNumber2 = +NUMBER1; var ResultIsNumber3 = +1; >ResultIsNumber3 : number >+1 : number ->1 : number +>1 : 1 var ResultIsNumber4 = +{ x: 1, y: 2}; >ResultIsNumber4 : number >+{ x: 1, y: 2} : number >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsNumber5 = +{ x: 1, y: (n: number) => { return n; } }; >ResultIsNumber5 : number >+{ x: 1, y: (n: number) => { return n; } } : number >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsNumber8 = +NUMBER1[0]; >+NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsNumber9 = +foo(); >ResultIsNumber9 : number @@ -119,7 +119,7 @@ var ResultIsNumber11 = +(NUMBER + NUMBER); // miss assignment operators +1; >+1 : number ->1 : number +>1 : 1 +NUMBER; >+NUMBER : number diff --git a/tests/baselines/reference/plusOperatorWithStringType.types b/tests/baselines/reference/plusOperatorWithStringType.types index c285a88c5d9c8..ec19aaed49710 100644 --- a/tests/baselines/reference/plusOperatorWithStringType.types +++ b/tests/baselines/reference/plusOperatorWithStringType.types @@ -6,12 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] ->"" : string ->"abc" : string +>"" : "" +>"abc" : "abc" function foo(): string { return "abc"; } >foo : () => string ->"abc" : string +>"abc" : "abc" class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return ""; } >foo : () => string ->"" : string +>"" : "" } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsNumber2 = +STRING1; var ResultIsNumber3 = +""; >ResultIsNumber3 : number >+"" : number ->"" : string +>"" : "" var ResultIsNumber4 = +{ x: "", y: "" }; >ResultIsNumber4 : number >+{ x: "", y: "" } : number >{ x: "", y: "" } : { x: string; y: string; } >x : string ->"" : string +>"" : "" >y : string ->"" : string +>"" : "" var ResultIsNumber5 = +{ x: "", y: (s: string) => { return s; } }; >ResultIsNumber5 : number >+{ x: "", y: (s: string) => { return s; } } : number >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string ->"" : string +>"" : "" >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -92,7 +92,7 @@ var ResultIsNumber8 = +STRING1[0]; >+STRING1[0] : number >STRING1[0] : string >STRING1 : string[] ->0 : number +>0 : 0 var ResultIsNumber9 = +foo(); >ResultIsNumber9 : number @@ -123,12 +123,12 @@ var ResultIsNumber12 = +STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 // miss assignment operators +""; >+"" : number ->"" : string +>"" : "" +STRING; >+STRING : number diff --git a/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.types b/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.types index d5c9b03cc5669..8e041acda3803 100644 --- a/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.types +++ b/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.types @@ -1,11 +1,11 @@ === tests/cases/compiler/prefixIncrementAsOperandOfPlusExpression.ts === var x = 1; >x : number ->1 : number +>1 : 1 var y = 1; >y : number ->1 : number +>1 : 1 + ++x; >+ ++x : number diff --git a/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.types b/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.types index c75ba492c31a6..4e4dbe93372f3 100644 --- a/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.types +++ b/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.types @@ -2,45 +2,45 @@ export var x = false; >x : boolean ->false : boolean +>false : false export var y = 1; >y : number ->1 : number +>1 : 1 if (!x) { ->!x : boolean ->x : boolean +>!x : true +>x : false } if (+x) { >+x : number ->x : boolean +>x : false } if (-x) { >-x : number ->x : boolean +>x : false } if (~x) { >~x : number ->x : boolean +>x : false } if (void x) { >void x : undefined ->x : boolean +>x : false } if (typeof x) { >typeof x : string ->x : boolean +>x : false } diff --git a/tests/baselines/reference/preserveConstEnums.types b/tests/baselines/reference/preserveConstEnums.types index f128b4a831b5c..9f2d30a36045b 100644 --- a/tests/baselines/reference/preserveConstEnums.types +++ b/tests/baselines/reference/preserveConstEnums.types @@ -4,7 +4,7 @@ const enum E { Value = 1, Value2 = Value >Value : E ->1 : number +>1 : 1 >Value2 : E >Value : E } diff --git a/tests/baselines/reference/primitiveConstraints2.errors.txt b/tests/baselines/reference/primitiveConstraints2.errors.txt index e571ee734179c..822846540f726 100644 --- a/tests/baselines/reference/primitiveConstraints2.errors.txt +++ b/tests/baselines/reference/primitiveConstraints2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/primitiveConstraints2.ts(8,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/primitiveConstraints2.ts(8,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/compiler/primitiveConstraints2.ts(9,8): error TS2344: Type 'string' does not satisfy the constraint 'number'. @@ -12,7 +12,7 @@ tests/cases/compiler/primitiveConstraints2.ts(9,8): error TS2344: Type 'string' var x = new C(); x.bar2(2, ""); // should error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. x.bar2(2, ""); // should error ~~~~~~ !!! error TS2344: Type 'string' does not satisfy the constraint 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types index fd5cafc037bdf..0c025ceaee38e 100644 --- a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types @@ -1,7 +1,7 @@ === tests/cases/compiler/privacyCheckAnonymousFunctionParameter.ts === export var x = 1; // Makes this an external module >x : number ->1 : number +>1 : 1 interface Iterator { >Iterator : Iterator diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types index 445e318c0fb67..de05ac5f74030 100644 --- a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types @@ -1,7 +1,7 @@ === tests/cases/compiler/privacyCheckAnonymousFunctionParameter2.ts === export var x = 1; // Makes this an external module >x : number ->1 : number +>1 : 1 interface Iterator { x: T } >Iterator : Iterator diff --git a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.types b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.types index ce785983ce87f..fcb0a27388bcc 100644 --- a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.types +++ b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.types @@ -24,6 +24,6 @@ module Foo { export var x = "hello"; >x : string ->"hello" : string +>"hello" : "hello" } diff --git a/tests/baselines/reference/privateVisibles.types b/tests/baselines/reference/privateVisibles.types index 71e26d7e264a9..95f60839fc1ca 100644 --- a/tests/baselines/reference/privateVisibles.types +++ b/tests/baselines/reference/privateVisibles.types @@ -4,7 +4,7 @@ class Foo { private pvar = 0; >pvar : number ->0 : number +>0 : 0 constructor() { var n = this.pvar; diff --git a/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt b/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt index 68a1ef3b7c965..8b4e11eb6065b 100644 --- a/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt +++ b/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt @@ -1,4 +1,4 @@ -importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type 'number'. +importHigher/root.ts(6,1): error TS2322: Type '"10"' is not assignable to type 'number'. ==== entry.js (0 errors) ==== @@ -36,5 +36,5 @@ importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type m1.f2.a = 10; m1.f2.person.age = "10"; // Error: Should be number (if direct import of m2 made the m3 module visible). ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt b/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt index 68a1ef3b7c965..8b4e11eb6065b 100644 --- a/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt +++ b/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt @@ -1,4 +1,4 @@ -importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type 'number'. +importHigher/root.ts(6,1): error TS2322: Type '"10"' is not assignable to type 'number'. ==== entry.js (0 errors) ==== @@ -36,5 +36,5 @@ importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type m1.f2.a = 10; m1.f2.person.age = "10"; // Error: Should be number (if direct import of m2 made the m3 module visible). ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt index 7099c05d57708..6d95ac42c8f10 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt @@ -1,5 +1,5 @@ -maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'. -maxDepthExceeded/root.ts(4,1): error TS2322: Type 'number' is not assignable to type 'boolean'. +maxDepthExceeded/root.ts(3,1): error TS2322: Type '"10"' is not assignable to type 'number'. +maxDepthExceeded/root.ts(4,1): error TS2322: Type '42' is not assignable to type 'true'. ==== entry.js (0 errors) ==== @@ -34,10 +34,10 @@ maxDepthExceeded/root.ts(4,1): error TS2322: Type 'number' is not assignable to m1.f1("test"); m1.f2.a = "10"; // Error: Should be number ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. m1.rel = 42; // Error: Should be boolean ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type '42' is not assignable to type 'true'. m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt index 7099c05d57708..6d95ac42c8f10 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt @@ -1,5 +1,5 @@ -maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'. -maxDepthExceeded/root.ts(4,1): error TS2322: Type 'number' is not assignable to type 'boolean'. +maxDepthExceeded/root.ts(3,1): error TS2322: Type '"10"' is not assignable to type 'number'. +maxDepthExceeded/root.ts(4,1): error TS2322: Type '42' is not assignable to type 'true'. ==== entry.js (0 errors) ==== @@ -34,10 +34,10 @@ maxDepthExceeded/root.ts(4,1): error TS2322: Type 'number' is not assignable to m1.f1("test"); m1.f2.a = "10"; // Error: Should be number ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. m1.rel = 42; // Error: Should be boolean ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type '42' is not assignable to type 'true'. m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt index f511000d5ac4a..684821d60a2fd 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt @@ -1,4 +1,4 @@ -maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to type 'number'. +maxDepthIncreased/root.ts(7,1): error TS2322: Type '"10"' is not assignable to type 'number'. ==== index.js (0 errors) ==== @@ -40,7 +40,7 @@ maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to m1.f2.person.age = "10"; // Should error if loaded the .js files correctly ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. let r2 = 3 + m4.foo; // Should be OK if correctly using the @types .d.ts file \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt index f511000d5ac4a..684821d60a2fd 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt @@ -1,4 +1,4 @@ -maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to type 'number'. +maxDepthIncreased/root.ts(7,1): error TS2322: Type '"10"' is not assignable to type 'number'. ==== index.js (0 errors) ==== @@ -40,7 +40,7 @@ maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to m1.f2.person.age = "10"; // Should error if loaded the .js files correctly ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. let r2 = 3 + m4.foo; // Should be OK if correctly using the @types .d.ts file \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining.types b/tests/baselines/reference/promiseChaining.types index 23a8b276fdc1a..fa40d8b68fc7e 100644 --- a/tests/baselines/reference/promiseChaining.types +++ b/tests/baselines/reference/promiseChaining.types @@ -42,7 +42,7 @@ class Chain { >then : (cb: (x: S) => S) => Chain >x => "abc" : (x: S) => string >x : S ->"abc" : string +>"abc" : "abc" >then : (cb: (x: string) => S) => Chain >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/promiseType.types b/tests/baselines/reference/promiseType.types index 1608182d6e9fd..3271c2aee9067 100644 --- a/tests/baselines/reference/promiseType.types +++ b/tests/baselines/reference/promiseType.types @@ -18,7 +18,7 @@ const b = p.then(b => 1); >then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } >b => 1 : (b: boolean) => number >b : boolean ->1 : number +>1 : 1 const c = p.then(b => 1, e => 'error'); >c : Promise @@ -28,10 +28,10 @@ const c = p.then(b => 1, e => 'error'); >then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } >b => 1 : (b: boolean) => number >b : boolean ->1 : number +>1 : 1 >e => 'error' : (e: any) => string >e : any ->'error' : string +>'error' : "error" const d = p.then(b => 1, e => { }); >d : Promise @@ -41,7 +41,7 @@ const d = p.then(b => 1, e => { }); >then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } >b => 1 : (b: boolean) => number >b : boolean ->1 : number +>1 : 1 >e => { } : (e: any) => void >e : any @@ -53,7 +53,7 @@ const e = p.then(b => 1, e => { throw Error(); }); >then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } >b => 1 : (b: boolean) => number >b : boolean ->1 : number +>1 : 1 >e => { throw Error(); } : (e: any) => never >e : any >Error() : Error @@ -67,7 +67,7 @@ const f = p.then(b => 1, e => Promise.reject(Error())); >then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } >b => 1 : (b: boolean) => number >b : boolean ->1 : number +>1 : 1 >e => Promise.reject(Error()) : (e: any) => Promise >e : any >Promise.reject(Error()) : Promise @@ -85,7 +85,7 @@ const g = p.catch(e => 'error'); >catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } >e => 'error' : (e: any) => string >e : any ->'error' : string +>'error' : "error" const h = p.catch(e => { }); >h : Promise @@ -143,7 +143,7 @@ async function B() { >p : Promise return 1; ->1 : number +>1 : 1 } // NOTE: This reports a "No best comment type exists among return expressions." error, and is @@ -168,7 +168,7 @@ async function D() { >p : Promise return 1; ->1 : number +>1 : 1 } catch (e) { >e : any @@ -185,7 +185,7 @@ async function E() { >p : Promise return 1; ->1 : number +>1 : 1 } catch (e) { >e : any @@ -206,7 +206,7 @@ async function F() { >p : Promise return 1; ->1 : number +>1 : 1 } catch (e) { >e : any diff --git a/tests/baselines/reference/promiseTypeInference.types b/tests/baselines/reference/promiseTypeInference.types index 2789f71087679..f3026c68f2123 100644 --- a/tests/baselines/reference/promiseTypeInference.types +++ b/tests/baselines/reference/promiseTypeInference.types @@ -45,7 +45,7 @@ var $$x = load("something").then(s => convert(s)); >load("something").then : (success?: (value: string) => Promise) => Promise >load("something") : Promise >load : (name: string) => Promise ->"something" : string +>"something" : "something" >then : (success?: (value: string) => Promise) => Promise >s => convert(s) : (s: string) => IPromise >s : string diff --git a/tests/baselines/reference/promiseVoidErrorCallback.types b/tests/baselines/reference/promiseVoidErrorCallback.types index 94773394ade26..cd3c67bc813de 100644 --- a/tests/baselines/reference/promiseVoidErrorCallback.types +++ b/tests/baselines/reference/promiseVoidErrorCallback.types @@ -32,7 +32,7 @@ function f1(): Promise { >resolve : { (value: T | PromiseLike): Promise; (): Promise; } >{ __t1: "foo_t1" } : { __t1: string; } >__t1 : string ->"foo_t1" : string +>"foo_t1" : "foo_t1" } function f2(x: T1): T2 { @@ -48,7 +48,7 @@ function f2(x: T1): T2 { >x.__t1 : string >x : T1 >__t1 : string ->":foo_21" : string +>":foo_21" : ":foo_21" } var x3 = f1() @@ -84,6 +84,6 @@ var x3 = f1() >x.__t2 : string >x : T2 >__t2 : string ->"bar" : string +>"bar" : "bar" }); diff --git a/tests/baselines/reference/propagationOfPromiseInitialization.types b/tests/baselines/reference/propagationOfPromiseInitialization.types index bd100f75b3e6b..0ec973474bc5e 100644 --- a/tests/baselines/reference/propagationOfPromiseInitialization.types +++ b/tests/baselines/reference/propagationOfPromiseInitialization.types @@ -33,7 +33,7 @@ foo.then((x) => { // x is inferred to be a number return "asdf"; ->"asdf" : string +>"asdf" : "asdf" }).then((x) => { >then : (successCallback: (promiseValue: string) => TResult, errorCallback?: (reason: any) => TResult) => IPromise @@ -47,7 +47,7 @@ foo.then((x) => { >length : number return 123; ->123 : number +>123 : 123 }); diff --git a/tests/baselines/reference/properties.types b/tests/baselines/reference/properties.types index d51ab4a95d2da..99ff875a0878e 100644 --- a/tests/baselines/reference/properties.types +++ b/tests/baselines/reference/properties.types @@ -7,7 +7,7 @@ class MyClass >Count : number { return 42; ->42 : number +>42 : 42 } public set Count(value: number) diff --git a/tests/baselines/reference/propertyAccess6.types b/tests/baselines/reference/propertyAccess6.types index 18f39f447c5fd..b899f4c53ec7f 100644 --- a/tests/baselines/reference/propertyAccess6.types +++ b/tests/baselines/reference/propertyAccess6.types @@ -3,9 +3,9 @@ var foo: any; >foo : any foo.bar = 4; ->foo.bar = 4 : number +>foo.bar = 4 : 4 >foo.bar : any >foo : any >bar : any ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.types index d808cddef8338..5faaf4d021639 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.types +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.types @@ -19,7 +19,7 @@ class C { >x['getDate']() : number >x['getDate'] : () => number >x : T ->'getDate' : string +>'getDate' : "getDate" return a + x.getDate(); >a + x.getDate() : number @@ -71,7 +71,7 @@ var r2b = i.foo['getDate'](); >i.foo : Date >i : I >foo : Date ->'getDate' : string +>'getDate' : "getDate" var a: { >a : () => T @@ -96,7 +96,7 @@ var r3b = a()['getDate'](); >a()['getDate'] : () => number >a() : Date >a : () => T ->'getDate' : string +>'getDate' : "getDate" var b = { >b : { foo: (x: T) => number; } @@ -115,7 +115,7 @@ var b = { >x['getDate']() : number >x['getDate'] : () => number >x : T ->'getDate' : string +>'getDate' : "getDate" return a + x.getDate(); >a + x.getDate() : number diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.types index 9ea015cc9ce2d..ad2ba3e829dc7 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.types +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.types @@ -6,7 +6,7 @@ class A { foo(): string { return ''; } >foo : () => string ->'' : string +>'' : "" } class B extends A { @@ -17,7 +17,7 @@ class B extends A { >bar : () => string return ''; ->'' : string +>'' : "" } } @@ -40,7 +40,7 @@ class C { >x['foo']() : string >x['foo'] : () => string >x : U ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string @@ -61,7 +61,7 @@ class C { >x['foo']() : string >x['foo'] : () => string >x : U ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string @@ -145,7 +145,7 @@ var r2b = i.foo['foo'](); >i.foo : B >i : I >foo : B ->'foo' : string +>'foo' : "foo" var a: { >a : { (): U; (x: U): U; (x: U, y: T): U; } @@ -198,7 +198,7 @@ var r3b = a()['foo'](); >a()['foo'] : () => string >a() : A >a : { (): U; (x: U): U; (x: U, y: T): U; } ->'foo' : string +>'foo' : "foo" // parameter supplied for type argument inference to succeed var aB = new B(); @@ -224,7 +224,7 @@ var r3d = a(aB, aB)['foo'](); >a : { (): U; (x: U): U; (x: U, y: T): U; } >aB : B >aB : B ->'foo' : string +>'foo' : "foo" var b = { >b : { foo: (x: U, y: T) => string; } @@ -247,7 +247,7 @@ var b = { >x['foo']() : string >x['foo'] : () => string >x : U ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types index f2423f2bff8c2..30a17935fc11a 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types @@ -6,7 +6,7 @@ class A { foo(): string { return ''; } >foo : () => string ->'' : string +>'' : "" } class B extends A { @@ -17,7 +17,7 @@ class B extends A { >bar : () => string return ''; ->'' : string +>'' : "" } } @@ -41,7 +41,7 @@ class C { >x['foo']() : string >x['foo'] : () => string >x : T ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string @@ -63,7 +63,7 @@ class C { >x['foo']() : string >x['foo'] : () => string >x : U ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string @@ -132,7 +132,7 @@ var r2b = i.foo['foo'](); >i.foo : B >i : I >foo : B ->'foo' : string +>'foo' : "foo" var a: { >a : { (): T; (x: U): U; } @@ -167,7 +167,7 @@ var r3b = a()['foo'](); >a()['foo'] : () => string >a() : A >a : { (): T; (x: U): U; } ->'foo' : string +>'foo' : "foo" // parameter supplied for type argument inference for U var r3c = a(new B()).foo(); // valid call to an invalid function, U is inferred as B, which has a foo @@ -188,7 +188,7 @@ var r3d = a(new B())['foo'](); // valid call to an invalid function, U is inferr >a : { (): T; (x: U): U; } >new B() : B >B : typeof B ->'foo' : string +>'foo' : "foo" var b = { >b : { foo: (x: T) => string; } @@ -210,7 +210,7 @@ var b = { >x['foo']() : string >x['foo'] : () => string >x : T ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types index 9d25bebea3719..2946b88b432a8 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types @@ -15,7 +15,7 @@ class C { >x['toString']() : string >x['toString'] : () => string >x : T ->'toString' : string +>'toString' : "toString" return a + x.toString(); >a + x.toString() : string @@ -64,7 +64,7 @@ var r2b = i.foo['toString'](); >i.foo : number >i : I >foo : number ->'toString' : string +>'toString' : "toString" var a: { >a : () => T @@ -87,7 +87,7 @@ var r3b: string = a()['toString'](); >a()['toString'] : () => string >a() : {} >a : () => T ->'toString' : string +>'toString' : "toString" var b = { >b : { foo: (x: T) => string; } @@ -105,7 +105,7 @@ var b = { >x['toString']() : string >x['toString'] : () => string >x : T ->'toString' : string +>'toString' : "toString" return a + x.toString(); >a + x.toString() : string @@ -123,5 +123,5 @@ var r4 = b.foo(1); >b.foo : (x: T) => string >b : { foo: (x: T) => string; } >foo : (x: T) => string ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/propertyNamesOfReservedWords.types b/tests/baselines/reference/propertyNamesOfReservedWords.types index 2554a7f61dda6..82780db22500e 100644 --- a/tests/baselines/reference/propertyNamesOfReservedWords.types +++ b/tests/baselines/reference/propertyNamesOfReservedWords.types @@ -625,204 +625,204 @@ enum E { >E : E abstract, ->abstract : E +>abstract : E.abstract as, ->as : E +>as : E.as boolean, ->boolean : E +>boolean : E.boolean break, ->break : E +>break : E.break byte, ->byte : E +>byte : E.byte case, ->case : E +>case : E.case catch, ->catch : E +>catch : E.catch char, ->char : E +>char : E.char class, ->class : E +>class : E.class continue, ->continue : E +>continue : E.continue const, ->const : E +>const : E.const debugger, ->debugger : E +>debugger : E.debugger default, ->default : E +>default : E.default delete, ->delete : E +>delete : E.delete do, ->do : E +>do : E.do double, ->double : E +>double : E.double else, ->else : E +>else : E.else enum, ->enum : E +>enum : E.enum export, ->export : E +>export : E.export extends, ->extends : E +>extends : E.extends false, ->false : E +>false : E.false final, ->final : E +>final : E.final finally, ->finally : E +>finally : E.finally float, ->float : E +>float : E.float for, ->for : E +>for : E.for function, ->function : E +>function : E.function goto, ->goto : E +>goto : E.goto if, ->if : E +>if : E.if implements, ->implements : E +>implements : E.implements import, ->import : E +>import : E.import in, ->in : E +>in : E.in instanceof, ->instanceof : E +>instanceof : E.instanceof int, ->int : E +>int : E.int interface, ->interface : E +>interface : E.interface is, ->is : E +>is : E.is long, ->long : E +>long : E.long namespace, ->namespace : E +>namespace : E.namespace native, ->native : E +>native : E.native new, ->new : E +>new : E.new null, ->null : E +>null : E.null package, ->package : E +>package : E.package private, ->private : E +>private : E.private protected, ->protected : E +>protected : E.protected public, ->public : E +>public : E.public return, ->return : E +>return : E.return short, ->short : E +>short : E.short static, ->static : E +>static : E.static super, ->super : E +>super : E.super switch, ->switch : E +>switch : E.switch synchronized, ->synchronized : E +>synchronized : E.synchronized this, ->this : E +>this : E.this throw, ->throw : E +>throw : E.throw throws, ->throws : E +>throws : E.throws transient, ->transient : E +>transient : E.transient true, ->true : E +>true : E.true try, ->try : E +>try : E.try typeof, ->typeof : E +>typeof : E.typeof use, ->use : E +>use : E.use var, ->var : E +>var : E.var void, ->void : E +>void : E.void volatile, ->volatile : E +>volatile : E.volatile while, ->while : E +>while : E.while with, ->with : E +>with : E.with } var r7 = E.abstract; >r7 : E ->E.abstract : E +>E.abstract : E.abstract >E : typeof E ->abstract : E +>abstract : E.abstract var r8 = E.as; >r8 : E ->E.as : E +>E.as : E.as >E : typeof E ->as : E +>as : E.as diff --git a/tests/baselines/reference/propertyNamesWithStringLiteral.types b/tests/baselines/reference/propertyNamesWithStringLiteral.types index 9c3eb5f201540..4e3c9c6080cf9 100644 --- a/tests/baselines/reference/propertyNamesWithStringLiteral.types +++ b/tests/baselines/reference/propertyNamesWithStringLiteral.types @@ -35,7 +35,7 @@ var a = Color.namedColors["azure"]; >Color.namedColors : NamedColors >Color : typeof Color >namedColors : NamedColors ->"azure" : string +>"azure" : "azure" var a = Color.namedColors.blue; // Should not error >a : _Color @@ -51,5 +51,5 @@ var a = Color.namedColors["pale blue"]; // should not error >Color.namedColors : NamedColors >Color : typeof Color >namedColors : NamedColors ->"pale blue" : string +>"pale blue" : "pale blue" diff --git a/tests/baselines/reference/protoAsIndexInIndexExpression.types b/tests/baselines/reference/protoAsIndexInIndexExpression.types index 56650cbf4eb49..b761aa2c7a70a 100644 --- a/tests/baselines/reference/protoAsIndexInIndexExpression.types +++ b/tests/baselines/reference/protoAsIndexInIndexExpression.types @@ -17,7 +17,7 @@ WorkspacePrototype['__proto__'] = EntityPrototype; >WorkspacePrototype['__proto__'] = EntityPrototype : any >WorkspacePrototype['__proto__'] : any >WorkspacePrototype : { serialize: () => any; } ->'__proto__' : string +>'__proto__' : "___proto__" >EntityPrototype : any var o = { @@ -25,14 +25,14 @@ var o = { >{ "__proto__": 0} : { "__proto__": number; } "__proto__": 0 ->0 : number +>0 : 0 }; class C { >C : C "__proto__" = 0; ->0 : number +>0 : 0 } === tests/cases/compiler/protoAsIndexInIndexExpression_0.ts === export var x; diff --git a/tests/baselines/reference/protoInIndexer.types b/tests/baselines/reference/protoInIndexer.types index bfafc56404ae4..27f1f721fd3b2 100644 --- a/tests/baselines/reference/protoInIndexer.types +++ b/tests/baselines/reference/protoInIndexer.types @@ -7,7 +7,7 @@ class X { >this['__proto__'] = null : null >this['__proto__'] : any >this : this ->'__proto__' : string +>'__proto__' : "___proto__" >null : null } } diff --git a/tests/baselines/reference/prototypeOnConstructorFunctions.types b/tests/baselines/reference/prototypeOnConstructorFunctions.types index 8d1b16e7a21d5..949cb4d7499f5 100644 --- a/tests/baselines/reference/prototypeOnConstructorFunctions.types +++ b/tests/baselines/reference/prototypeOnConstructorFunctions.types @@ -15,7 +15,7 @@ var i: I1; i.const.prototype.prop = "yo"; ->i.const.prototype.prop = "yo" : string +>i.const.prototype.prop = "yo" : "yo" >i.const.prototype.prop : any >i.const.prototype : any >i.const : new (options?: any, element?: any) => any @@ -23,5 +23,5 @@ i.const.prototype.prop = "yo"; >const : new (options?: any, element?: any) => any >prototype : any >prop : any ->"yo" : string +>"yo" : "yo" diff --git a/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.types b/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.types index 7c05f6a100658..d507fb42323a6 100644 --- a/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.types +++ b/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.types @@ -4,7 +4,7 @@ module Alpha { export var x = 100; >x : number ->100 : number +>100 : 100 } module Beta { diff --git a/tests/baselines/reference/qualify.errors.txt b/tests/baselines/reference/qualify.errors.txt index c3447664c963f..53c9927737f0c 100644 --- a/tests/baselines/reference/qualify.errors.txt +++ b/tests/baselines/reference/qualify.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/qualify.ts(21,13): error TS2322: Type 'number' is not assignable to type 'I'. -tests/cases/compiler/qualify.ts(30,13): error TS2322: Type 'number' is not assignable to type 'I2'. +tests/cases/compiler/qualify.ts(21,13): error TS2322: Type '3' is not assignable to type 'I'. +tests/cases/compiler/qualify.ts(30,13): error TS2322: Type '3' is not assignable to type 'I2'. tests/cases/compiler/qualify.ts(45,13): error TS2322: Type 'I4' is not assignable to type 'I3'. Property 'zeep' is missing in type 'I4'. tests/cases/compiler/qualify.ts(46,13): error TS2322: Type 'I4' is not assignable to type 'I3[]'. @@ -37,7 +37,7 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable export module U { var z:I=3; ~ -!!! error TS2322: Type 'number' is not assignable to type 'I'. +!!! error TS2322: Type '3' is not assignable to type 'I'. export interface I2 { q; } @@ -48,7 +48,7 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable export module U2 { var z:T.U.I2=3; ~ -!!! error TS2322: Type 'number' is not assignable to type 'I2'. +!!! error TS2322: Type '3' is not assignable to type 'I2'. } } diff --git a/tests/baselines/reference/quickInfoDisplayPartsConst.baseline b/tests/baselines/reference/quickInfoDisplayPartsConst.baseline index e5008bae3f38a..7493d001bd394 100644 --- a/tests/baselines/reference/quickInfoDisplayPartsConst.baseline +++ b/tests/baselines/reference/quickInfoDisplayPartsConst.baseline @@ -33,8 +33,8 @@ "kind": "space" }, { - "text": "number", - "kind": "keyword" + "text": "10", + "kind": "stringLiteral" } ], "documentation": [] @@ -74,8 +74,8 @@ "kind": "space" }, { - "text": "number", - "kind": "keyword" + "text": "10", + "kind": "stringLiteral" } ], "documentation": [] @@ -115,8 +115,8 @@ "kind": "space" }, { - "text": "number", - "kind": "keyword" + "text": "10", + "kind": "stringLiteral" } ], "documentation": [] @@ -156,8 +156,8 @@ "kind": "space" }, { - "text": "number", - "kind": "keyword" + "text": "10", + "kind": "stringLiteral" } ], "documentation": [] @@ -197,8 +197,8 @@ "kind": "space" }, { - "text": "number", - "kind": "keyword" + "text": "10", + "kind": "stringLiteral" } ], "documentation": [] @@ -246,8 +246,8 @@ "kind": "space" }, { - "text": "number", - "kind": "keyword" + "text": "10", + "kind": "stringLiteral" } ], "documentation": [] @@ -287,8 +287,8 @@ "kind": "space" }, { - "text": "number", - "kind": "keyword" + "text": "10", + "kind": "stringLiteral" } ], "documentation": [] diff --git a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInClass.baseline b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInClass.baseline index 7b3e3b6e37705..48bd280a1b505 100644 --- a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInClass.baseline +++ b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInClass.baseline @@ -1282,8 +1282,8 @@ "kind": "punctuation" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" }, { "text": ">", @@ -1306,8 +1306,8 @@ "kind": "space" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" }, { "text": ",", @@ -1346,8 +1346,8 @@ "kind": "space" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" } ], "documentation": [] diff --git a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInFunction.baseline b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInFunction.baseline index c47a264eb547c..278e9396fb69c 100644 --- a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInFunction.baseline +++ b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInFunction.baseline @@ -406,8 +406,8 @@ "kind": "punctuation" }, { - "text": "string", - "kind": "keyword" + "text": "\"Hello\"", + "kind": "stringLiteral" }, { "text": ">", @@ -430,8 +430,8 @@ "kind": "space" }, { - "text": "string", - "kind": "keyword" + "text": "\"Hello\"", + "kind": "stringLiteral" }, { "text": ")", @@ -446,8 +446,8 @@ "kind": "space" }, { - "text": "string", - "kind": "keyword" + "text": "\"Hello\"", + "kind": "stringLiteral" } ], "documentation": [] diff --git a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInInterface.baseline b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInInterface.baseline index decaad3c2f6e3..1306ed9cc97b7 100644 --- a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInInterface.baseline +++ b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInInterface.baseline @@ -2052,8 +2052,8 @@ "kind": "punctuation" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" }, { "text": ">", @@ -2076,8 +2076,8 @@ "kind": "space" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" }, { "text": ",", @@ -2120,8 +2120,8 @@ "kind": "space" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" } ], "documentation": [] @@ -2169,8 +2169,8 @@ "kind": "punctuation" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" }, { "text": ">", @@ -2193,8 +2193,8 @@ "kind": "space" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" }, { "text": ",", @@ -2237,8 +2237,8 @@ "kind": "space" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" } ], "documentation": [] @@ -2355,8 +2355,8 @@ "kind": "punctuation" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" }, { "text": ">", @@ -2379,8 +2379,8 @@ "kind": "space" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" }, { "text": ",", @@ -2419,8 +2419,8 @@ "kind": "space" }, { - "text": "string", - "kind": "keyword" + "text": "\"hello\"", + "kind": "stringLiteral" } ], "documentation": [] diff --git a/tests/baselines/reference/quotedPropertyName1.types b/tests/baselines/reference/quotedPropertyName1.types index 4a4e73529b390..a142d607a7537 100644 --- a/tests/baselines/reference/quotedPropertyName1.types +++ b/tests/baselines/reference/quotedPropertyName1.types @@ -3,5 +3,5 @@ class Test1 { >Test1 : Test1 "prop1" = 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/quotedPropertyName2.types b/tests/baselines/reference/quotedPropertyName2.types index fe737758e3e32..16b116a5e2246 100644 --- a/tests/baselines/reference/quotedPropertyName2.types +++ b/tests/baselines/reference/quotedPropertyName2.types @@ -3,5 +3,5 @@ class Test1 { >Test1 : Test1 static "prop1" = 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/quotedPropertyName3.types b/tests/baselines/reference/quotedPropertyName3.types index 7c957372e0dde..f5f1d47bbc822 100644 --- a/tests/baselines/reference/quotedPropertyName3.types +++ b/tests/baselines/reference/quotedPropertyName3.types @@ -11,7 +11,7 @@ class Test { >() => this["prop1"] : () => number >this["prop1"] : number >this : this ->"prop1" : string +>"prop1" : "prop1" var y: number = x(); >y : number diff --git a/tests/baselines/reference/randomSemicolons1.types b/tests/baselines/reference/randomSemicolons1.types index 48a7c307314d4..4a246eeed2143 100644 --- a/tests/baselines/reference/randomSemicolons1.types +++ b/tests/baselines/reference/randomSemicolons1.types @@ -2,7 +2,7 @@ ; ; var a = 1; >a : number ->1 : number +>1 : 1 ; diff --git a/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types b/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types index 37a6d11b598f9..72c23eae9720b 100644 --- a/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types +++ b/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types @@ -18,5 +18,5 @@ function foo(x: any) { print('1'); >print('1') : void >print : (s: string) => void ->'1' : string +>'1' : "1" } diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.types b/tests/baselines/reference/reactNamespaceJSXEmit.types index 06c803ef7fd5f..d2bd88e8fbd0e 100644 --- a/tests/baselines/reference/reactNamespaceJSXEmit.types +++ b/tests/baselines/reference/reactNamespaceJSXEmit.types @@ -37,5 +37,5 @@ declare var x: any; >Bar : any >x : any >y : any ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/readonlyInDeclarationFile.types b/tests/baselines/reference/readonlyInDeclarationFile.types index 7a3e11577c87d..ca83a0a4c01f2 100644 --- a/tests/baselines/reference/readonlyInDeclarationFile.types +++ b/tests/baselines/reference/readonlyInDeclarationFile.types @@ -29,19 +29,19 @@ class C { private get b1() { return 1 } >b1 : number ->1 : number +>1 : 1 protected get b2() { return 1 } >b2 : number ->1 : number +>1 : 1 public get b3() { return 1 } >b3 : number ->1 : number +>1 : 1 private get c1() { return 1 } >c1 : number ->1 : number +>1 : 1 private set c1(value) { } >c1 : number @@ -49,7 +49,7 @@ class C { protected get c2() { return 1 } >c2 : number ->1 : number +>1 : 1 protected set c2(value) { } >c2 : number @@ -57,7 +57,7 @@ class C { public get c3() { return 1 } >c3 : number ->1 : number +>1 : 1 public set c3(value) { } >c3 : number @@ -74,19 +74,19 @@ class C { private static get t1() { return 1 } >t1 : number ->1 : number +>1 : 1 protected static get t2() { return 1 } >t2 : number ->1 : number +>1 : 1 public static get t3() { return 1 } >t3 : number ->1 : number +>1 : 1 private static get u1() { return 1 } >u1 : number ->1 : number +>1 : 1 private static set u1(value) { } >u1 : number @@ -94,7 +94,7 @@ class C { protected static get u2() { return 1 } >u2 : number ->1 : number +>1 : 1 protected static set u2(value) { } >u2 : number @@ -102,7 +102,7 @@ class C { public static get u3() { return 1 } >u3 : number ->1 : number +>1 : 1 public static set u3(value) { } >u3 : number @@ -128,11 +128,11 @@ function f() { get x() { return 1; }, >x : number ->1 : number +>1 : 1 get y() { return 1; }, >y : number ->1 : number +>1 : 1 set y(value) { } >y : number diff --git a/tests/baselines/reference/reboundBaseClassSymbol.types b/tests/baselines/reference/reboundBaseClassSymbol.types index 9c62d838f42b3..602907cb5b33d 100644 --- a/tests/baselines/reference/reboundBaseClassSymbol.types +++ b/tests/baselines/reference/reboundBaseClassSymbol.types @@ -8,7 +8,7 @@ module Foo { var A = 1; >A : number ->1 : number +>1 : 1 interface B extends A { b: string; } >B : B diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.types b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.types index 482ec707e49d5..3e74ba7f57b10 100644 --- a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.types +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.types @@ -14,7 +14,7 @@ export class MemberName { public prefix: string = ""; >prefix : string ->"" : string +>"" : "" } export class MemberNameArray extends MemberName { >MemberNameArray : MemberNameArray diff --git a/tests/baselines/reference/recursiveComplicatedClasses.types b/tests/baselines/reference/recursiveComplicatedClasses.types index 1bb48a3c0c9ce..ea590daca5ae8 100644 --- a/tests/baselines/reference/recursiveComplicatedClasses.types +++ b/tests/baselines/reference/recursiveComplicatedClasses.types @@ -14,7 +14,7 @@ function aEnclosesB(a: Symbol) { >Symbol : Symbol return true; ->true : boolean +>true : true } class Symbol { diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index 8d5303c066918..8614f747016d4 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -1,23 +1,23 @@ -tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2322: Type 'number' is not assignable to type '() => typeof fn'. +tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2322: Type '1' is not assignable to type '() => typeof fn'. tests/cases/compiler/recursiveFunctionTypes.ts(3,5): error TS2322: Type '() => typeof fn' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(4,5): error TS2322: Type '() => typeof fn' is not assignable to type '() => number'. Type '() => typeof fn' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(11,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/recursiveFunctionTypes.ts(12,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/recursiveFunctionTypes.ts(17,5): error TS2322: Type '() => I' is not assignable to type 'number'. -tests/cases/compiler/recursiveFunctionTypes.ts(22,5): error TS2345: Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'. -tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2322: Type 'number' is not assignable to type '() => any'. +tests/cases/compiler/recursiveFunctionTypes.ts(22,5): error TS2345: Argument of type '3' is not assignable to parameter of type '(t: typeof g) => void'. +tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2322: Type '3' is not assignable to type '() => any'. tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: Overload signature is not compatible with function implementation. tests/cases/compiler/recursiveFunctionTypes.ts(33,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. +tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. tests/cases/compiler/recursiveFunctionTypes.ts(42,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. ==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ==== function fn(): typeof fn { return 1; } ~ -!!! error TS2322: Type 'number' is not assignable to type '() => typeof fn'. +!!! error TS2322: Type '1' is not assignable to type '() => typeof fn'. var x: number = fn; // error ~ @@ -51,12 +51,12 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of } C.g(3); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type '(t: typeof g) => void'. var f4: () => typeof f4; f4 = 3; // error ~~ -!!! error TS2322: Type 'number' is not assignable to type '() => any'. +!!! error TS2322: Type '3' is not assignable to type '() => any'. function f5() { return f5; } @@ -71,7 +71,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of !!! error TS2346: Supplied parameters do not match any signature of call target. f6(""); // ok (function takes an any param) ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. f6(); // ok declare function f7(): typeof f7; @@ -84,5 +84,5 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of !!! error TS2346: Supplied parameters do not match any signature of call target. f7(""); // ok (function takes an any param) ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. f7(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/recursiveInference1.types b/tests/baselines/reference/recursiveInference1.types index 58bb13d18e7f3..7144dd17abe09 100644 --- a/tests/baselines/reference/recursiveInference1.types +++ b/tests/baselines/reference/recursiveInference1.types @@ -5,23 +5,23 @@ function fib(x:number) { return x <= 1 ? x : fib(x - 1) + fib(x - 2); } >x <= 1 ? x : fib(x - 1) + fib(x - 2) : any >x <= 1 : boolean >x : number ->1 : number +>1 : 1 >x : number >fib(x - 1) + fib(x - 2) : any >fib(x - 1) : any >fib : (x: number) => any >x - 1 : number >x : number ->1 : number +>1 : 1 >fib(x - 2) : any >fib : (x: number) => any >x - 2 : number >x : number ->2 : number +>2 : 2 var result = fib(5); >result : any >fib(5) : any >fib : (x: number) => any ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/recursiveInitializer.types b/tests/baselines/reference/recursiveInitializer.types index f5bc2338902b5..ad6b8059b6cab 100644 --- a/tests/baselines/reference/recursiveInitializer.types +++ b/tests/baselines/reference/recursiveInitializer.types @@ -22,7 +22,7 @@ var s1 = s1 + ''; >s1 : any >s1 + '' : string >s1 : any ->'' : string +>'' : "" var s2 /* any */ = s2 + s2; >s2 : any @@ -39,7 +39,7 @@ var s3 : string = s3 + s3; var s4 = '' + s4; >s4 : any >'' + s4 : string ->'' : string +>'' : "" >s4 : any // boolean unless otherwise specified diff --git a/tests/baselines/reference/recursiveMods.types b/tests/baselines/reference/recursiveMods.types index d4db816daf7c3..45e803fee1e42 100644 --- a/tests/baselines/reference/recursiveMods.types +++ b/tests/baselines/reference/recursiveMods.types @@ -15,7 +15,7 @@ export module Foo { >C : C if (true) { return Bar();} ->true : boolean +>true : true >Bar() : C >Bar : () => C diff --git a/tests/baselines/reference/regExpWithSlashInCharClass.types b/tests/baselines/reference/regExpWithSlashInCharClass.types index fafe6e1be69b0..e866f2bc22900 100644 --- a/tests/baselines/reference/regExpWithSlashInCharClass.types +++ b/tests/baselines/reference/regExpWithSlashInCharClass.types @@ -3,26 +3,26 @@ var foo1 = "a/".replace(/.[/]/, ""); >foo1 : string >"a/".replace(/.[/]/, "") : string >"a/".replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } ->"a/" : string +>"a/" : "a/" >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >/.[/]/ : RegExp ->"" : string +>"" : "" var foo2 = "a//".replace(/.[//]/g, ""); >foo2 : string >"a//".replace(/.[//]/g, "") : string >"a//".replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } ->"a//" : string +>"a//" : "a//" >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >/.[//]/g : RegExp ->"" : string +>"" : "" var foo3 = "a/".replace(/.[/no sleep /till/]/, "bugfix"); >foo3 : string >"a/".replace(/.[/no sleep /till/]/, "bugfix") : string >"a/".replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } ->"a/" : string +>"a/" : "a/" >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >/.[/no sleep /till/]/ : RegExp ->"bugfix" : string +>"bugfix" : "bugfix" diff --git a/tests/baselines/reference/relativeModuleWithoutSlash.types b/tests/baselines/reference/relativeModuleWithoutSlash.types index 796ef714dd9e5..f17185e1e18a3 100644 --- a/tests/baselines/reference/relativeModuleWithoutSlash.types +++ b/tests/baselines/reference/relativeModuleWithoutSlash.types @@ -3,13 +3,13 @@ export default { a: 0 }; >{ a: 0 } : { a: number; } >a : number ->0 : number +>0 : 0 === /a/index.ts === export default { aIndex: 0 }; >{ aIndex: 0 } : { aIndex: number; } >aIndex : number ->0 : number +>0 : 0 === /a/test.ts === import a from "."; diff --git a/tests/baselines/reference/relativePathToDeclarationFile.types b/tests/baselines/reference/relativePathToDeclarationFile.types index ef77acc85b42b..0c196814b08c9 100644 --- a/tests/baselines/reference/relativePathToDeclarationFile.types +++ b/tests/baselines/reference/relativePathToDeclarationFile.types @@ -27,7 +27,7 @@ if(foo.M2.x){ >M2 : typeof other.M2 >x : string >charCodeAt : (index: number) => number ->0 : number +>0 : 0 } === tests/cases/conformance/externalModules/test/foo.d.ts === diff --git a/tests/baselines/reference/requireEmitSemicolon.types b/tests/baselines/reference/requireEmitSemicolon.types index 43ca9ef29c815..541cd67cb856e 100644 --- a/tests/baselines/reference/requireEmitSemicolon.types +++ b/tests/baselines/reference/requireEmitSemicolon.types @@ -23,7 +23,7 @@ export module Database { >P : typeof P >Models : typeof P.Models >Person : typeof P.Models.Person ->"Rock" : string +>"Rock" : "Rock" } } } diff --git a/tests/baselines/reference/requiredInitializedParameter3.types b/tests/baselines/reference/requiredInitializedParameter3.types index aa37f5e13ddb3..92b35e2c83ccc 100644 --- a/tests/baselines/reference/requiredInitializedParameter3.types +++ b/tests/baselines/reference/requiredInitializedParameter3.types @@ -13,6 +13,6 @@ class C1 implements I1 { method(a = 0, b?) { } >method : (a?: number, b?: any) => void >a : number ->0 : number +>0 : 0 >b : any } diff --git a/tests/baselines/reference/requiredInitializedParameter4.types b/tests/baselines/reference/requiredInitializedParameter4.types index c483146a1baab..5465c9d1820bf 100644 --- a/tests/baselines/reference/requiredInitializedParameter4.types +++ b/tests/baselines/reference/requiredInitializedParameter4.types @@ -5,6 +5,6 @@ class C1 { method(a = 0, b) { } >method : (a: number, b: any) => void >a : number ->0 : number +>0 : 0 >b : any } diff --git a/tests/baselines/reference/reservedWords.types b/tests/baselines/reference/reservedWords.types index 4c76e056ce25b..ae5a391bc58e3 100644 --- a/tests/baselines/reference/reservedWords.types +++ b/tests/baselines/reference/reservedWords.types @@ -5,19 +5,19 @@ var obj = { if: 0, >if : number ->0 : number +>0 : 0 debugger: 2, >debugger : number ->2 : number +>2 : 2 break: 3, >break : number ->3 : number +>3 : 3 function: 4 >function : number ->4 : number +>4 : 4 } //This compiles. @@ -28,22 +28,22 @@ var obj2 = { if: 0, >if : number ->0 : number +>0 : 0 while: 1, >while : number ->1 : number +>1 : 1 debugger: 2, >debugger : number ->2 : number +>2 : 2 break: 3, >break : number ->3 : number +>3 : 3 function: 4 >function : number ->4 : number +>4 : 4 } diff --git a/tests/baselines/reference/restElementWithAssignmentPattern5.types b/tests/baselines/reference/restElementWithAssignmentPattern5.types index c5cbc9ad20626..298bc2e4363f6 100644 --- a/tests/baselines/reference/restElementWithAssignmentPattern5.types +++ b/tests/baselines/reference/restElementWithAssignmentPattern5.types @@ -11,6 +11,6 @@ var s: string, s2: string; >s : string >s2 : string >["", ""] : string[] ->"" : string ->"" : string +>"" : "" +>"" : "" diff --git a/tests/baselines/reference/restParameterNoTypeAnnotation.types b/tests/baselines/reference/restParameterNoTypeAnnotation.types index eed17802d57e2..e4944ec32cff9 100644 --- a/tests/baselines/reference/restParameterNoTypeAnnotation.types +++ b/tests/baselines/reference/restParameterNoTypeAnnotation.types @@ -7,7 +7,7 @@ function foo(...rest) { >x : number >rest[0] : any >rest : any[] ->0 : number +>0 : 0 return x; >x : number diff --git a/tests/baselines/reference/returnInConstructor1.errors.txt b/tests/baselines/reference/returnInConstructor1.errors.txt index 30f629f9f8ad4..a7d3fd052048a 100644 --- a/tests/baselines/reference/returnInConstructor1.errors.txt +++ b/tests/baselines/reference/returnInConstructor1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/returnInConstructor1.ts(11,16): error TS2322: Type 'number' is not assignable to type 'B'. +tests/cases/compiler/returnInConstructor1.ts(11,16): error TS2322: Type '1' is not assignable to type 'B'. tests/cases/compiler/returnInConstructor1.ts(11,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class -tests/cases/compiler/returnInConstructor1.ts(25,16): error TS2322: Type 'string' is not assignable to type 'D'. +tests/cases/compiler/returnInConstructor1.ts(25,16): error TS2322: Type '"test"' is not assignable to type 'D'. tests/cases/compiler/returnInConstructor1.ts(25,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/compiler/returnInConstructor1.ts(39,16): error TS2322: Type '{ foo: number; }' is not assignable to type 'F'. Types of property 'foo' are incompatible. @@ -25,7 +25,7 @@ tests/cases/compiler/returnInConstructor1.ts(55,16): error TS2409: Return type o constructor() { return 1; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'B'. +!!! error TS2322: Type '1' is not assignable to type 'B'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } @@ -43,7 +43,7 @@ tests/cases/compiler/returnInConstructor1.ts(55,16): error TS2409: Return type o constructor() { return "test"; // error ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'D'. +!!! error TS2322: Type '"test"' is not assignable to type 'D'. ~~~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/returnStatement1.types b/tests/baselines/reference/returnStatement1.types index b7e166ffa75a9..0c90955104394 100644 --- a/tests/baselines/reference/returnStatement1.types +++ b/tests/baselines/reference/returnStatement1.types @@ -13,6 +13,6 @@ function f() { }; ("harmless extra line"); ->("harmless extra line") : string ->"harmless extra line" : string +>("harmless extra line") : "harmless extra line" +>"harmless extra line" : "harmless extra line" } diff --git a/tests/baselines/reference/returnStatements.types b/tests/baselines/reference/returnStatements.types index d64e7beb39fb7..b75104dd666ab 100644 --- a/tests/baselines/reference/returnStatements.types +++ b/tests/baselines/reference/returnStatements.types @@ -2,11 +2,11 @@ // all the following should be valid function fn1(): number { return 1; } >fn1 : () => number ->1 : number +>1 : 1 function fn2(): string { return ''; } >fn2 : () => string ->'' : string +>'' : "" function fn3(): void { return undefined; } >fn3 : () => void @@ -24,7 +24,7 @@ function fn6(): Date { return new Date(12); } >Date : Date >new Date(12) : Date >Date : DateConstructor ->12 : number +>12 : 12 function fn7(): any { return null; } >fn7 : () => any @@ -59,7 +59,7 @@ function fn10(): I { return { id: 12 }; } >I : I >{ id: 12 } : { id: number; } >id : number ->12 : number +>12 : 12 function fn11(): I { return new C(); } >fn11 : () => I diff --git a/tests/baselines/reference/reverseInferenceInContextualInstantiation.types b/tests/baselines/reference/reverseInferenceInContextualInstantiation.types index 881f6c6941f71..d4a0b43919c61 100644 --- a/tests/baselines/reference/reverseInferenceInContextualInstantiation.types +++ b/tests/baselines/reference/reverseInferenceInContextualInstantiation.types @@ -6,7 +6,7 @@ function compare(a: T, b: T): number { return 0; } >T : T >b : T >T : T ->0 : number +>0 : 0 var x: number[]; >x : number[] diff --git a/tests/baselines/reference/reversedRecusiveTypeInstantiation.types b/tests/baselines/reference/reversedRecusiveTypeInstantiation.types index fcbdab34e5a52..2b647369cf4eb 100644 --- a/tests/baselines/reference/reversedRecusiveTypeInstantiation.types +++ b/tests/baselines/reference/reversedRecusiveTypeInstantiation.types @@ -24,12 +24,12 @@ var a : A >A : A a.zPos2Pos1.xPos1 = 1 ->a.zPos2Pos1.xPos1 = 1 : number +>a.zPos2Pos1.xPos1 = 1 : 1 >a.zPos2Pos1.xPos1 : number >a.zPos2Pos1 : A >a : A >zPos2Pos1 : A >xPos1 : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/scannerES3NumericLiteral1.types b/tests/baselines/reference/scannerES3NumericLiteral1.types index 0a1108c7ca9e2..99b10d56ad649 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral1.types +++ b/tests/baselines/reference/scannerES3NumericLiteral1.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral1.ts === 0 ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/scannerES3NumericLiteral2.types b/tests/baselines/reference/scannerES3NumericLiteral2.types index 8fae044c21799..802e9fb7f337a 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral2.types +++ b/tests/baselines/reference/scannerES3NumericLiteral2.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral2.ts === 01 ->01 : number +>01 : 1 diff --git a/tests/baselines/reference/scannerES3NumericLiteral5.types b/tests/baselines/reference/scannerES3NumericLiteral5.types index 2a5367e5b1725..8e0d45c8085c0 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral5.types +++ b/tests/baselines/reference/scannerES3NumericLiteral5.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral5.ts === 1e0 ->1e0 : number +>1e0 : 1 diff --git a/tests/baselines/reference/scannerES3NumericLiteral7.types b/tests/baselines/reference/scannerES3NumericLiteral7.types index d5ffa0ea13118..b39a4c58be98d 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral7.types +++ b/tests/baselines/reference/scannerES3NumericLiteral7.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral7.ts === 1e+0 ->1e+0 : number +>1e+0 : 1 diff --git a/tests/baselines/reference/scannerEnum1.types b/tests/baselines/reference/scannerEnum1.types index d75899a75f1f7..c0b195db637fc 100644 --- a/tests/baselines/reference/scannerEnum1.types +++ b/tests/baselines/reference/scannerEnum1.types @@ -3,10 +3,10 @@ >CodeGenTarget : CodeGenTarget ES3 = 0, ->ES3 : CodeGenTarget ->0 : number +>ES3 : CodeGenTarget.ES3 +>0 : 0 ES5 = 1, ->ES5 : CodeGenTarget ->1 : number +>ES5 : CodeGenTarget.ES5 +>1 : 1 } diff --git a/tests/baselines/reference/scannerNumericLiteral1.types b/tests/baselines/reference/scannerNumericLiteral1.types index a3eebc411fa58..06663789f3f62 100644 --- a/tests/baselines/reference/scannerNumericLiteral1.types +++ b/tests/baselines/reference/scannerNumericLiteral1.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral1.ts === 0 ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/scannerNumericLiteral5.types b/tests/baselines/reference/scannerNumericLiteral5.types index 86ab1a903e03e..31fe2e5149d7d 100644 --- a/tests/baselines/reference/scannerNumericLiteral5.types +++ b/tests/baselines/reference/scannerNumericLiteral5.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral5.ts === 1e0 ->1e0 : number +>1e0 : 1 diff --git a/tests/baselines/reference/scannerNumericLiteral7.types b/tests/baselines/reference/scannerNumericLiteral7.types index 25ce9275290d0..e2824f8cf9402 100644 --- a/tests/baselines/reference/scannerNumericLiteral7.types +++ b/tests/baselines/reference/scannerNumericLiteral7.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral7.ts === 1e+0 ->1e+0 : number +>1e+0 : 1 diff --git a/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.types b/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.types index 43eadd8c2918d..9d17f416c39e0 100644 Binary files a/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.types and b/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.types differ diff --git a/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.types b/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.types index a73ee57b7913c..eb9516e6e253e 100644 --- a/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.types +++ b/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.types @@ -1,5 +1,5 @@ === tests/cases/conformance/scanner/ecmascript5/scannerUnicodeEscapeInKeyword1.ts === \u0076ar x = "hello"; >x : string ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/selfInCallback.types b/tests/baselines/reference/selfInCallback.types index 6010a64d80f28..2d3385e3be6f4 100644 --- a/tests/baselines/reference/selfInCallback.types +++ b/tests/baselines/reference/selfInCallback.types @@ -4,7 +4,7 @@ class C { public p1 = 0; >p1 : number ->0 : number +>0 : 0 public callback(cb:()=>void) {cb();} >callback : (cb: () => void) => void @@ -25,6 +25,6 @@ class C { >this.p1 : number >this : this >p1 : number ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/selfInLambdas.types b/tests/baselines/reference/selfInLambdas.types index 3addf07c75ab1..614ebc16e6817 100644 --- a/tests/baselines/reference/selfInLambdas.types +++ b/tests/baselines/reference/selfInLambdas.types @@ -28,7 +28,7 @@ var o = { counter: 0, >counter : number ->0 : number +>0 : 0 start: function() { >start : () => void @@ -67,7 +67,7 @@ class X { private value = "value"; >value : string ->"value" : string +>"value" : "value" public foo() { >foo : () => void diff --git a/tests/baselines/reference/shebang.types b/tests/baselines/reference/shebang.types index 5fd6f0533ec52..b1a175d53dc03 100644 --- a/tests/baselines/reference/shebang.types +++ b/tests/baselines/reference/shebang.types @@ -2,5 +2,5 @@ #!/usr/bin/env node var foo = 'I wish the generated JS to be executed in node'; >foo : string ->'I wish the generated JS to be executed in node' : string +>'I wish the generated JS to be executed in node' : "I wish the generated JS to be executed in node" diff --git a/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.js b/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.js index 9e057951b3a66..df23dba87760c 100644 --- a/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.js +++ b/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.js @@ -17,5 +17,5 @@ exports.foo = foo; //// [shorthandOfExportedEntity01_targetES2015_CommonJS.d.ts] -export declare const test: string; +export declare const test: "test"; export declare function foo(): void; diff --git a/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.types b/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.types index dcc04015993d3..f299632b3efcf 100644 --- a/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.types +++ b/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.types @@ -1,8 +1,8 @@ === tests/cases/compiler/shorthandOfExportedEntity01_targetES2015_CommonJS.ts === export const test = "test"; ->test : string ->"test" : string +>test : "test" +>"test" : "test" export function foo () { >foo : () => void @@ -10,6 +10,6 @@ export function foo () { const x = { test }; >x : { test: string; } >{ test } : { test: string; } ->test : string +>test : "test" } diff --git a/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.js b/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.js index 764739705c4e1..a594a1b6de5c0 100644 --- a/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.js +++ b/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.js @@ -17,5 +17,5 @@ exports.foo = foo; //// [shorthandOfExportedEntity02_targetES5_CommonJS.d.ts] -export declare const test: string; +export declare const test: "test"; export declare function foo(): void; diff --git a/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.types b/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.types index 27d16e2166f6e..effe8e89da409 100644 --- a/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.types +++ b/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.types @@ -1,8 +1,8 @@ === tests/cases/compiler/shorthandOfExportedEntity02_targetES5_CommonJS.ts === export const test = "test"; ->test : string ->"test" : string +>test : "test" +>"test" : "test" export function foo () { >foo : () => void @@ -10,6 +10,6 @@ export function foo () { const x = { test }; >x : { test: string; } >{ test } : { test: string; } ->test : string +>test : "test" } diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt index 7ac5fe9a26cdb..ce029a49f1815 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt @@ -1,13 +1,15 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(16,9): error TS2459: Type '{}' has no property 's1' and no string index signature. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(22,9): error TS2459: Type '{}' has no property 's1' and no string index signature. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(40,9): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(46,12): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(72,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(40,9): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(46,12): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(72,5): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(77,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(77,8): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(82,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(82,5): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(82,13): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(87,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(87,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(87,19): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. @@ -16,7 +18,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,12): err tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. -==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts (12 errors) ==== +==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts (14 errors) ==== (function() { @@ -62,7 +64,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err var s3: string; for ({ s3 = 5 } of [{ s3: "" }]) { ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. } }); @@ -70,7 +72,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err var s3: string; for ({ s3:s3 = 5 } of [{ s3: "" }]) { ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. } }); @@ -98,13 +100,15 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err let y1: string; ({ y1 = 5 } = {}) ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. }); (function() { let y1: string; ({ y1:y1 = 5 } = {}) ~~ +!!! error TS2322: Type '5' is not assignable to type 'string'. + ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. }); @@ -112,7 +116,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err let y2: string, y3: { x: string }; ({ y2 = 5, y3 = { x: 1 } } = {}) ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. ~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. !!! error TS2322: Types of property 'x' are incompatible. @@ -123,6 +127,8 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err let y2: string, y3: { x: string }; ({ y2:y2 = 5, y3:y3 = { x: 1 } } = {}) ~~ +!!! error TS2322: Type '5' is not assignable to type 'string'. + ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. ~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt index 7e6b6b35d7fa0..0a61eed7326ac 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt @@ -1,13 +1,15 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(16,9): error TS2459: Type '{}' has no property 's1' and no string index signature. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(22,9): error TS2459: Type '{}' has no property 's1' and no string index signature. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(40,9): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(46,12): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(72,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(40,9): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(46,12): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(72,5): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(77,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(77,8): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(82,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(82,5): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(82,13): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(87,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(87,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(87,19): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. @@ -16,7 +18,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,12): tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. -==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts (12 errors) ==== +==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts (14 errors) ==== (function() { @@ -62,7 +64,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): var s3: string; for ({ s3 = 5 } of [{ s3: "" }]) { ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. } }); @@ -70,7 +72,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): var s3: string; for ({ s3:s3 = 5 } of [{ s3: "" }]) { ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. } }); @@ -98,13 +100,15 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): let y1: string; ({ y1 = 5 } = {}) ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. }); (function() { let y1: string; ({ y1:y1 = 5 } = {}) ~~ +!!! error TS2322: Type '5' is not assignable to type 'string'. + ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. }); @@ -112,7 +116,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): let y2: string, y3: { x: string }; ({ y2 = 5, y3 = { x: 1 } } = {}) ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. ~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. !!! error TS2322: Types of property 'x' are incompatible. @@ -123,6 +127,8 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): let y2: string, y3: { x: string }; ({ y2:y2 = 5, y3:y3 = { x: 1 } } = {}) ~~ +!!! error TS2322: Type '5' is not assignable to type 'string'. + ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. ~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. diff --git a/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.types b/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.types index 48d44bb540648..f882239730660 100644 --- a/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.types +++ b/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.types @@ -40,7 +40,7 @@ let c1 = pInst.optionalParam('hello') >pInst.optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; } >pInst : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; } >optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; } ->'hello' : string +>'hello' : "hello" let c2 = pInst.optionalParam('hello', null) >c2 : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; } @@ -48,6 +48,6 @@ let c2 = pInst.optionalParam('hello', null) >pInst.optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; } >pInst : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; } >optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; } ->'hello' : string +>'hello' : "hello" >null : null diff --git a/tests/baselines/reference/singleLineCommentInConciseArrowFunctionES3.types b/tests/baselines/reference/singleLineCommentInConciseArrowFunctionES3.types index e8c449e7bb851..09efdfa2fece9 100644 --- a/tests/baselines/reference/singleLineCommentInConciseArrowFunctionES3.types +++ b/tests/baselines/reference/singleLineCommentInConciseArrowFunctionES3.types @@ -7,5 +7,5 @@ function test() { // some comments here; 123; ->123 : number +>123 : 123 } diff --git a/tests/baselines/reference/sourceMap-Comments.types b/tests/baselines/reference/sourceMap-Comments.types index b1681c05aad0d..088be00e43d26 100644 --- a/tests/baselines/reference/sourceMap-Comments.types +++ b/tests/baselines/reference/sourceMap-Comments.types @@ -11,7 +11,7 @@ module sas.tools { let f: number = 2; >f : number ->2 : number +>2 : 2 switch (f) { >f : number diff --git a/tests/baselines/reference/sourceMap-FileWithComments.types b/tests/baselines/reference/sourceMap-FileWithComments.types index 6f9ca2010858a..2198fa9a59022 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.types +++ b/tests/baselines/reference/sourceMap-FileWithComments.types @@ -50,14 +50,14 @@ module Shapes { >origin : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 } // Variable comment after class var a = 10; >a : number ->10 : number +>10 : 10 export function foo() { >foo : () => void @@ -68,7 +68,7 @@ module Shapes { */ var b = 10; >b : number ->10 : number +>10 : 10 } /** Local Variable */ @@ -79,8 +79,8 @@ var p: IPoint = new Shapes.Point(3, 4); >Shapes.Point : typeof Shapes.Point >Shapes : typeof Shapes >Point : typeof Shapes.Point ->3 : number ->4 : number +>3 : 3 +>4 : 4 var dist = p.getDist(); >dist : number diff --git a/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.types b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.types index fb361a53bd516..5faca1a4ddb6b 100644 --- a/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.types +++ b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.types @@ -5,5 +5,5 @@ interface I {} var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/sourceMap-LineBreaks.types b/tests/baselines/reference/sourceMap-LineBreaks.types index 1e0220906da9d..41dc77a36bf9e 100644 --- a/tests/baselines/reference/sourceMap-LineBreaks.types +++ b/tests/baselines/reference/sourceMap-LineBreaks.types @@ -1,40 +1,40 @@ === tests/cases/compiler/sourceMap-LineBreaks.ts === var endsWithlineSeparator = 10; 
var endsWithParagraphSeparator = 10; 
var endsWithNextLine = 1;…var endsWithLineFeed = 1; >endsWithlineSeparator : number ->10 : number +>10 : 10 var endsWithCarriageReturnLineFeed = 1; >endsWithParagraphSeparator : number ->10 : number +>10 : 10 var endsWithCarriageReturn = 1; var endsWithLineFeedCarriageReturn = 1; >endsWithNextLine : number ->1 : number +>1 : 1 >endsWithLineFeed : number ->1 : number +>1 : 1 var endsWithLineFeedCarriageReturnLineFeed = 1; >endsWithCarriageReturnLineFeed : number ->1 : number +>1 : 1 >endsWithCarriageReturn : number ->1 : number +>1 : 1 var stringLiteralWithLineFeed = "line 1\ >endsWithLineFeedCarriageReturn : number ->1 : number +>1 : 1 line 2"; var stringLiteralWithCarriageReturnLineFeed = "line 1\ >endsWithLineFeedCarriageReturnLineFeed : number ->1 : number +>1 : 1 line 2"; var stringLiteralWithCarriageReturn = "line 1\ line 2"; >stringLiteralWithLineFeed : string ->"line 1\line 2" : string +>"line 1\line 2" : "line 1line 2" var stringLiteralWithLineSeparator = "line 1\
line 2";
var stringLiteralWithParagraphSeparator = "line 1\
line 2";
var stringLiteralWithNextLine = "line 1\…line 2"; >stringLiteralWithCarriageReturnLineFeed : string ->"line 1\line 2" : string +>"line 1\line 2" : "line 1line 2" diff --git a/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.types b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.types index 827f523e277ee..26bfd605b9529 100644 --- a/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.types +++ b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.types @@ -19,11 +19,11 @@ module Foo { var x = "test1"; >x : string ->"test1" : string +>"test1" : "test1" var y = "test 2\ >y : string ->"test 2\isn't this a lot of fun" : string +>"test 2\isn't this a lot of fun" : "test 2isn't this a lot of fun" isn't this a lot of fun"; var z = window.document; diff --git a/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.types b/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.types index db4f2c320b47e..1c28536dafcb8 100644 --- a/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.types +++ b/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.types @@ -8,6 +8,6 @@ module Q { // Test this var a = 1; >a : number ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.types b/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.types index 5e3d01a6b5b3c..c4625f115ddaf 100644 --- a/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.types +++ b/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.types @@ -5,5 +5,5 @@ function P() { // Test this var a = 1; >a : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/sourceMapValidationClass.types b/tests/baselines/reference/sourceMapValidationClass.types index 3e5234b0d6e90..f6d80f3941649 100644 --- a/tests/baselines/reference/sourceMapValidationClass.types +++ b/tests/baselines/reference/sourceMapValidationClass.types @@ -12,18 +12,18 @@ class Greeter { return "

" + this.greeting + "

"; >"

" + this.greeting + "

" : string >"

" + this.greeting : string ->"

" : string +>"

" : "

" >this.greeting : string >this : this >greeting : string ->"

" : string +>"" : "" } private x: string; >x : string private x1: number = 10; >x1 : number ->10 : number +>10 : 10 private fn() { >fn : () => string diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.types b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.types index 5cca47a0a417e..a50677684dcfb 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.types +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.types @@ -4,9 +4,9 @@ class Greeter { public a = 10; >a : number ->10 : number +>10 : 10 public nameA = "Ten"; >nameA : string ->"Ten" : string +>"Ten" : "Ten" } diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.types b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.types index a20410aa842e5..7c686c4805957 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.types +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.types @@ -4,7 +4,7 @@ class Greeter { public a = 10; >a : number ->10 : number +>10 : 10 public returnA = () => this.a; >returnA : () => number diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.types b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.types index 12d8d56cf6e14..2ff310b28f613 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.types +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.types @@ -9,9 +9,9 @@ class Greeter extends AbstractGreeter { public a = 10; >a : number ->10 : number +>10 : 10 public nameA = "Ten"; >nameA : string ->"Ten" : string +>"Ten" : "Ten" } diff --git a/tests/baselines/reference/sourceMapValidationClasses.types b/tests/baselines/reference/sourceMapValidationClasses.types index 5b3512c06c16d..590f6d07c160b 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.types +++ b/tests/baselines/reference/sourceMapValidationClasses.types @@ -4,7 +4,7 @@ module Foo.Bar { >Bar : typeof Bar "use strict"; ->"use strict" : string +>"use strict" : "use strict" class Greeter { >Greeter : Greeter @@ -19,11 +19,11 @@ module Foo.Bar { return "

" + this.greeting + "

"; >"

" + this.greeting + "

" : string >"

" + this.greeting : string ->"

" : string +>"

" : "

" >this.greeting : string >this : this >greeting : string ->"

" : string +>"" : "" } } @@ -43,7 +43,7 @@ module Foo.Bar { >greeter : Greeter >new Greeter("Hello, world!") : Greeter >Greeter : typeof Greeter ->"Hello, world!" : string +>"Hello, world!" : "Hello, world!" var str = greeter.greet(); >str : string @@ -66,14 +66,14 @@ module Foo.Bar { >greeters[0] = new Greeter(greeting) : Greeter >greeters[0] : Greeter >greeters : Greeter[] ->0 : number +>0 : 0 >new Greeter(greeting) : Greeter >Greeter : typeof Greeter >greeting : string for (var i = 0; i < restGreetings.length; i++) { >i : number ->0 : number +>0 : 0 >i < restGreetings.length : boolean >i : number >restGreetings.length : number @@ -102,14 +102,14 @@ module Foo.Bar { >b : Greeter[] >foo2("Hello", "World", "!") : Greeter[] >foo2 : (greeting: string, ...restGreetings: string[]) => Greeter[] ->"Hello" : string ->"World" : string ->"!" : string +>"Hello" : "Hello" +>"World" : "World" +>"!" : "!" // This is simple signle line comment for (var j = 0; j < b.length; j++) { >j : number ->0 : number +>0 : 0 >j < b.length : boolean >j : number >b.length : number diff --git a/tests/baselines/reference/sourceMapValidationDecorators.types b/tests/baselines/reference/sourceMapValidationDecorators.types index 2fc05972307d2..8e807786e788c 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.types +++ b/tests/baselines/reference/sourceMapValidationDecorators.types @@ -48,7 +48,7 @@ declare function ParameterDecorator2(x: number): (target: Object, key: string | @ClassDecorator2(10) >ClassDecorator2(10) : (target: Function) => void >ClassDecorator2 : (x: number) => (target: Function) => void ->10 : number +>10 : 10 class Greeter { >Greeter : Greeter @@ -60,7 +60,7 @@ class Greeter { @ParameterDecorator2(20) >ParameterDecorator2(20) : (target: Object, key: string | symbol, paramIndex: number) => void >ParameterDecorator2 : (x: number) => (target: Object, key: string | symbol, paramIndex: number) => void ->20 : number +>20 : 20 public greeting: string, >greeting : string @@ -71,7 +71,7 @@ class Greeter { @ParameterDecorator2(30) >ParameterDecorator2(30) : (target: Object, key: string | symbol, paramIndex: number) => void >ParameterDecorator2 : (x: number) => (target: Object, key: string | symbol, paramIndex: number) => void ->30 : number +>30 : 30 ...b: string[]) { >b : string[] @@ -83,7 +83,7 @@ class Greeter { @PropertyDecorator2(40) >PropertyDecorator2(40) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void >PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void ->40 : number +>40 : 40 greet() { >greet : () => string @@ -91,11 +91,11 @@ class Greeter { return "

" + this.greeting + "

"; >"

" + this.greeting + "

" : string >"

" + this.greeting : string ->"

" : string +>"

" : "

" >this.greeting : string >this : this >greeting : string ->"

" : string +>"" : "" } @PropertyDecorator1 @@ -104,7 +104,7 @@ class Greeter { @PropertyDecorator2(50) >PropertyDecorator2(50) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void >PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void ->50 : number +>50 : 50 private x: string; >x : string @@ -115,11 +115,11 @@ class Greeter { @PropertyDecorator2(60) >PropertyDecorator2(60) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void >PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void ->60 : number +>60 : 60 private static x1: number = 10; >x1 : number ->10 : number +>10 : 10 private fn( >fn : (x: number) => string @@ -130,7 +130,7 @@ class Greeter { @ParameterDecorator2(70) >ParameterDecorator2(70) : (target: Object, key: string | symbol, paramIndex: number) => void >ParameterDecorator2 : (x: number) => (target: Object, key: string | symbol, paramIndex: number) => void ->70 : number +>70 : 70 x: number) { >x : number @@ -147,7 +147,7 @@ class Greeter { @PropertyDecorator2(80) >PropertyDecorator2(80) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void >PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void ->80 : number +>80 : 80 get greetings() { >greetings : string @@ -167,7 +167,7 @@ class Greeter { @ParameterDecorator2(90) >ParameterDecorator2(90) : (target: Object, key: string | symbol, paramIndex: number) => void >ParameterDecorator2 : (x: number) => (target: Object, key: string | symbol, paramIndex: number) => void ->90 : number +>90 : 90 greetings: string) { >greetings : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types index c2a88a6883816..00ecd2659eead 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types @@ -16,9 +16,9 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function getRobot() { >getRobot : () => [number, string, string] @@ -31,19 +31,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function getMultiRobot() { >getMultiRobot : () => [string, [string, string]] @@ -57,10 +57,10 @@ for (let [, nameA] = robotA, i = 0; i < 1; i++) { >nameA : string >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -77,10 +77,10 @@ for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -95,14 +95,14 @@ for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { > : undefined >nameA : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -119,10 +119,10 @@ for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) >secondarySkillA : string >multiRobotA : [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -140,10 +140,10 @@ for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -159,15 +159,15 @@ for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging >primarySkillA : string >secondarySkillA : string >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -183,10 +183,10 @@ for (let [numberB] = robotA, i = 0; i < 1; i++) { >numberB : number >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -202,10 +202,10 @@ for (let [numberB] = getRobot(), i = 0; i < 1; i++) { >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -219,14 +219,14 @@ for (let [numberB] = getRobot(), i = 0; i < 1; i++) { for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberB : number >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -241,10 +241,10 @@ for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { >nameB : string >multiRobotA : [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -260,10 +260,10 @@ for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -277,15 +277,15 @@ for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >nameB : string >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -303,10 +303,10 @@ for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { >skillA2 : string >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -324,10 +324,10 @@ for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -343,14 +343,14 @@ for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; >nameA2 : string >skillA2 : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -367,10 +367,10 @@ for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; >secondarySkillA : string >multiRobotA : [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -388,10 +388,10 @@ for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -407,15 +407,15 @@ for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", " >primarySkillA : string >secondarySkillA : string >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -432,10 +432,10 @@ for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { >robotAInfo : (string | number)[] >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -452,10 +452,10 @@ for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -470,14 +470,14 @@ for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i >numberA3 : string | number >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : (string | number)[] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -492,10 +492,10 @@ for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { >multiRobotAInfo : (string | [string, string])[] >multiRobotA : [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -511,10 +511,10 @@ for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -528,15 +528,15 @@ for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >multiRobotAInfo : (string | string[])[] >["trimmer", ["trimming", "edging"]] : (string | string[])[] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types index e9f7a0a740600..f317fa2a83cfd 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types @@ -16,9 +16,9 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function getRobot() { >getRobot : () => [number, string, string] @@ -31,19 +31,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function getMultiRobot() { >getMultiRobot : () => [string, [string, string]] @@ -76,18 +76,18 @@ let i: number; >i : number for ([, nameA] = robotA, i = 0; i < 1; i++) { ->[, nameA] = robotA, i = 0 : number +>[, nameA] = robotA, i = 0 : 0 >[, nameA] = robotA : [number, string, string] >[, nameA] : [undefined, string] > : undefined >nameA : string >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -99,19 +99,19 @@ for ([, nameA] = robotA, i = 0; i < 1; i++) { >nameA : string } for ([, nameA] = getRobot(), i = 0; i < 1; i++) { ->[, nameA] = getRobot(), i = 0 : number +>[, nameA] = getRobot(), i = 0 : 0 >[, nameA] = getRobot() : [number, string, string] >[, nameA] : [undefined, string] > : undefined >nameA : string >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -123,21 +123,21 @@ for ([, nameA] = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[, nameA] = [2, "trimmer", "trimming"], i = 0 : number +>[, nameA] = [2, "trimmer", "trimming"], i = 0 : 0 >[, nameA] = [2, "trimmer", "trimming"] : [number, string, string] >[, nameA] : [undefined, string] > : undefined >nameA : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -149,7 +149,7 @@ for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >nameA : string } for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { ->[, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : number +>[, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : 0 >[, [primarySkillA, secondarySkillA]] = multiRobotA : [string, [string, string]] >[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] > : undefined @@ -157,12 +157,12 @@ for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { >primarySkillA : string >secondarySkillA : string >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -174,7 +174,7 @@ for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { >primarySkillA : string } for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { ->[, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : number +>[, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : 0 >[, [primarySkillA, secondarySkillA]] = getMultiRobot() : [string, [string, string]] >[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] > : undefined @@ -183,12 +183,12 @@ for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) >secondarySkillA : string >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -200,7 +200,7 @@ for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) >primarySkillA : string } for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] > : undefined @@ -208,16 +208,16 @@ for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], >primarySkillA : string >secondarySkillA : string >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -230,17 +230,17 @@ for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], } for ([numberB] = robotA, i = 0; i < 1; i++) { ->[numberB] = robotA, i = 0 : number +>[numberB] = robotA, i = 0 : 0 >[numberB] = robotA : [number, string, string] >[numberB] : [number] >numberB : number >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -252,18 +252,18 @@ for ([numberB] = robotA, i = 0; i < 1; i++) { >numberB : number } for ([numberB] = getRobot(), i = 0; i < 1; i++) { ->[numberB] = getRobot(), i = 0 : number +>[numberB] = getRobot(), i = 0 : 0 >[numberB] = getRobot() : [number, string, string] >[numberB] : [number] >numberB : number >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -275,20 +275,20 @@ for ([numberB] = getRobot(), i = 0; i < 1; i++) { >numberB : number } for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberB] = [2, "trimmer", "trimming"], i = 0 : number +>[numberB] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberB] = [2, "trimmer", "trimming"] : [number, string, string] >[numberB] : [number] >numberB : number >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -300,17 +300,17 @@ for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberB : number } for ([nameB] = multiRobotA, i = 0; i < 1; i++) { ->[nameB] = multiRobotA, i = 0 : number +>[nameB] = multiRobotA, i = 0 : 0 >[nameB] = multiRobotA : [string, [string, string]] >[nameB] : [string] >nameB : string >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -322,18 +322,18 @@ for ([nameB] = multiRobotA, i = 0; i < 1; i++) { >nameB : string } for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { ->[nameB] = getMultiRobot(), i = 0 : number +>[nameB] = getMultiRobot(), i = 0 : 0 >[nameB] = getMultiRobot() : [string, [string, string]] >[nameB] : [string] >nameB : string >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -345,21 +345,21 @@ for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { >nameB : string } for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->[nameB] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameB] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[nameB] = ["trimmer", ["trimming", "edging"]] : [string, string[]] >[nameB] : [string] >nameB : string >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -372,19 +372,19 @@ for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { } for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { ->[numberA2, nameA2, skillA2] = robotA, i = 0 : number +>[numberA2, nameA2, skillA2] = robotA, i = 0 : 0 >[numberA2, nameA2, skillA2] = robotA : [number, string, string] >[numberA2, nameA2, skillA2] : [number, string, string] >numberA2 : number >nameA2 : string >skillA2 : string >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -396,7 +396,7 @@ for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { >nameA2 : string } for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { ->[numberA2, nameA2, skillA2] = getRobot(), i = 0 : number +>[numberA2, nameA2, skillA2] = getRobot(), i = 0 : 0 >[numberA2, nameA2, skillA2] = getRobot() : [number, string, string] >[numberA2, nameA2, skillA2] : [number, string, string] >numberA2 : number @@ -404,12 +404,12 @@ for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { >skillA2 : string >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -421,22 +421,22 @@ for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { >nameA2 : string } for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] : [number, string, string] >[numberA2, nameA2, skillA2] : [number, string, string] >numberA2 : number >nameA2 : string >skillA2 : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -448,7 +448,7 @@ for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++ >nameA2 : string } for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { ->[nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : 0 >[nameMA, [primarySkillA, secondarySkillA]] = multiRobotA : [string, [string, string]] >[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] >nameMA : string @@ -456,12 +456,12 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++ >primarySkillA : string >secondarySkillA : string >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -473,7 +473,7 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++ >nameMA : string } for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { ->[nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : 0 >[nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() : [string, [string, string]] >[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] >nameMA : string @@ -482,12 +482,12 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; >secondarySkillA : string >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -499,7 +499,7 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; >nameMA : string } for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] >nameMA : string @@ -507,16 +507,16 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edgi >primarySkillA : string >secondarySkillA : string >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -529,19 +529,19 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edgi } for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { ->[numberA3, ...robotAInfo] = robotA, i = 0 : number +>[numberA3, ...robotAInfo] = robotA, i = 0 : 0 >[numberA3, ...robotAInfo] = robotA : [number, string, string] >[numberA3, ...robotAInfo] : (string | number)[] >numberA3 : number >...robotAInfo : string | number >robotAInfo : (string | number)[] >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -553,7 +553,7 @@ for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { >numberA3 : number } for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { ->[numberA3, ...robotAInfo] = getRobot(), i = 0 : number +>[numberA3, ...robotAInfo] = getRobot(), i = 0 : 0 >[numberA3, ...robotAInfo] = getRobot() : [number, string, string] >[numberA3, ...robotAInfo] : (string | number)[] >numberA3 : number @@ -561,12 +561,12 @@ for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { >robotAInfo : (string | number)[] >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -578,7 +578,7 @@ for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { >numberA3 : number } for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] >[numberA3, ...robotAInfo] : (string | number)[] >numberA3 : number @@ -587,15 +587,15 @@ for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1 >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -607,18 +607,18 @@ for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1 >numberA3 : number } for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { ->[...multiRobotAInfo] = multiRobotA, i = 0 : number +>[...multiRobotAInfo] = multiRobotA, i = 0 : 0 >[...multiRobotAInfo] = multiRobotA : [string, [string, string]] >[...multiRobotAInfo] : (string | [string, string])[] >...multiRobotAInfo : string | [string, string] >multiRobotAInfo : (string | [string, string])[] >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -630,19 +630,19 @@ for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { >multiRobotAInfo : (string | [string, string])[] } for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { ->[...multiRobotAInfo] = getMultiRobot(), i = 0 : number +>[...multiRobotAInfo] = getMultiRobot(), i = 0 : 0 >[...multiRobotAInfo] = getMultiRobot() : [string, [string, string]] >[...multiRobotAInfo] : (string | [string, string])[] >...multiRobotAInfo : string | [string, string] >multiRobotAInfo : (string | [string, string])[] >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -654,7 +654,7 @@ for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { >multiRobotAInfo : (string | [string, string])[] } for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[...multiRobotAInfo] : (string | [string, string])[] >...multiRobotAInfo : string | [string, string] @@ -662,16 +662,16 @@ for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging" >["trimmer", ["trimming", "edging"]] : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types index 700e7b9f86307..443f22bbab813 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types @@ -16,9 +16,9 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function getRobot() { >getRobot : () => [number, string, string] @@ -31,19 +31,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, string[]] >MultiSkilledRobot : [string, string[]] >["mower", ["mowing", ""]] : [string, string[]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : string[] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, string[]] >MultiSkilledRobot : [string, string[]] >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function getMultiRobot() { >getMultiRobot : () => [string, string[]] @@ -55,13 +55,13 @@ function getMultiRobot() { for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { > : undefined >nameA : string ->"name" : string +>"name" : "name" >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -75,14 +75,14 @@ for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { > : undefined >nameA : string ->"name" : string +>"name" : "name" >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -96,16 +96,16 @@ for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { > : undefined >nameA : string ->"name" : string +>"name" : "name" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -121,22 +121,22 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >multiRobotA : [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -152,23 +152,23 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >getMultiRobot() : [string, string[]] >getMultiRobot : () => [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -184,26 +184,26 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -217,14 +217,14 @@ for (let [, [ for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -237,15 +237,15 @@ for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { } for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -258,17 +258,17 @@ for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { } for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -281,13 +281,13 @@ for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { } for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { >nameB : string ->"name" : string +>"name" : "name" >multiRobotA : [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -300,14 +300,14 @@ for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { } for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { >nameB : string ->"name" : string +>"name" : "name" >getMultiRobot() : [string, string[]] >getMultiRobot : () => [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -320,17 +320,17 @@ for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { } for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >nameB : string ->"name" : string +>"name" : "name" >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -344,18 +344,18 @@ for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"name" : string +>"name" : "name" >skillA2 : string ->"skill" : string +>"skill" : "skill" >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -368,19 +368,19 @@ for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i } for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"name" : string +>"name" : "name" >skillA2 : string ->"skill" : string +>"skill" : "skill" >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -393,21 +393,21 @@ for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0 } for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"name" : string +>"name" : "name" >skillA2 : string ->"skill" : string +>"skill" : "skill" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -421,29 +421,29 @@ for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "t for (let [nameMA = "noName", >nameMA : string ->"noName" : string +>"noName" : "noName" [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = multiRobotA, i = 0; i < 1; i++) { >multiRobotA : [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -456,30 +456,30 @@ for (let } for (let [nameMA = "noName", >nameMA : string ->"noName" : string +>"noName" : "noName" [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : [string, string[]] >getMultiRobot : () => [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -492,33 +492,33 @@ for (let [nameMA = "noName", } for (let [nameMA = "noName", >nameMA : string ->"noName" : string +>"noName" : "noName" [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -532,15 +532,15 @@ for (let [nameMA = "noName", for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -553,16 +553,16 @@ for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { } for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -575,18 +575,18 @@ for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { } for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberA3 : string | number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : (string | number)[] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types index 93d149a6bdec5..0795142c6778d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types @@ -16,9 +16,9 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function getRobot() { >getRobot : () => [number, string, string] @@ -31,19 +31,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function getMultiRobot() { >getMultiRobot : () => [string, [string, string]] @@ -76,20 +76,20 @@ let i: number; >i : number for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { ->[, nameA = "name"] = robotA, i = 0 : number +>[, nameA = "name"] = robotA, i = 0 : 0 >[, nameA = "name"] = robotA : [number, string, string] >[, nameA = "name"] : [undefined, string] > : undefined ->nameA = "name" : string +>nameA = "name" : "name" >nameA : string ->"name" : string +>"name" : "name" >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -101,21 +101,21 @@ for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { >nameA : string } for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { ->[, nameA = "name"] = getRobot(), i = 0 : number +>[, nameA = "name"] = getRobot(), i = 0 : 0 >[, nameA = "name"] = getRobot() : [number, string, string] >[, nameA = "name"] : [undefined, string] > : undefined ->nameA = "name" : string +>nameA = "name" : "name" >nameA : string ->"name" : string +>"name" : "name" >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -127,23 +127,23 @@ for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[, nameA = "name"] = [2, "trimmer", "trimming"], i = 0 : number +>[, nameA = "name"] = [2, "trimmer", "trimming"], i = 0 : 0 >[, nameA = "name"] = [2, "trimmer", "trimming"] : [number, string, string] >[, nameA = "name"] : [undefined, string] > : undefined ->nameA = "name" : string +>nameA = "name" : "name" >nameA : string ->"name" : string +>"name" : "name" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -155,7 +155,7 @@ for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >nameA : string } for ([, [ ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA, i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA, i = 0 : 0 >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA : [string, [string, string]] >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] > : undefined @@ -163,26 +163,26 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -194,7 +194,7 @@ for ([, [ >primarySkillA : string } for ([, [ ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot(), i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot(), i = 0 : 0 >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot() : [string, [string, string]] >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] > : undefined @@ -202,27 +202,27 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -234,7 +234,7 @@ for ([, [ >primarySkillA : string } for ([, [ ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] > : undefined @@ -242,30 +242,30 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -278,20 +278,20 @@ for ([, [ } for ([numberB = -1] = robotA, i = 0; i < 1; i++) { ->[numberB = -1] = robotA, i = 0 : number +>[numberB = -1] = robotA, i = 0 : 0 >[numberB = -1] = robotA : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -303,21 +303,21 @@ for ([numberB = -1] = robotA, i = 0; i < 1; i++) { >numberB : number } for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { ->[numberB = -1] = getRobot(), i = 0 : number +>[numberB = -1] = getRobot(), i = 0 : 0 >[numberB = -1] = getRobot() : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -329,23 +329,23 @@ for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { >numberB : number } for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberB = -1] = [2, "trimmer", "trimming"], i = 0 : number +>[numberB = -1] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberB = -1] = [2, "trimmer", "trimming"] : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -357,19 +357,19 @@ for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberB : number } for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { ->[nameB = "name"] = multiRobotA, i = 0 : number +>[nameB = "name"] = multiRobotA, i = 0 : 0 >[nameB = "name"] = multiRobotA : [string, [string, string]] >[nameB = "name"] : [string] ->nameB = "name" : string +>nameB = "name" : "name" >nameB : string ->"name" : string +>"name" : "name" >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -381,20 +381,20 @@ for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { >nameB : string } for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { ->[nameB = "name"] = getMultiRobot(), i = 0 : number +>[nameB = "name"] = getMultiRobot(), i = 0 : 0 >[nameB = "name"] = getMultiRobot() : [string, [string, string]] >[nameB = "name"] : [string] ->nameB = "name" : string +>nameB = "name" : "name" >nameB : string ->"name" : string +>"name" : "name" >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -406,23 +406,23 @@ for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { >nameB : string } for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->[nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[nameB = "name"] = ["trimmer", ["trimming", "edging"]] : [string, string[]] >[nameB = "name"] : [string] ->nameB = "name" : string +>nameB = "name" : "name" >nameB : string ->"name" : string +>"name" : "name" >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -435,26 +435,26 @@ for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) } for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { ->[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0 : 0 >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA : [number, string, string] >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "name" : string +>-1 : -1 +>1 : 1 +>nameA2 = "name" : "name" >nameA2 : string ->"name" : string ->skillA2 = "skill" : string +>"name" : "name" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -466,27 +466,27 @@ for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; >nameA2 : string } for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { ->[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0 : 0 >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() : [number, string, string] >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "name" : string +>-1 : -1 +>1 : 1 +>nameA2 = "name" : "name" >nameA2 : string ->"name" : string ->skillA2 = "skill" : string +>"name" : "name" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -498,29 +498,29 @@ for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i >nameA2 : string } for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] : [number, string, string] >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "name" : string +>-1 : -1 +>1 : 1 +>nameA2 = "name" : "name" >nameA2 : string ->"name" : string ->skillA2 = "skill" : string +>"name" : "name" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -534,29 +534,29 @@ for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimm for (let [nameMA = "noName", >nameMA : string ->"noName" : string +>"noName" : "noName" [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = multiRobotA, i = 0; i < 1; i++) { >multiRobotA : [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -568,41 +568,41 @@ for (let >nameMA : string } for ([nameMA = "noName", ->[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0 : number +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0 : 0 >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot() : [string, [string, string]] >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, [string, string]] ->nameMA = "noName" : string +>nameMA = "noName" : "noName" >nameMA : string ->"noName" : string +>"noName" : "noName" [ >[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : [string, string] >[ primarySkillA = "primary", secondarySkillA = "secondary" ] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -614,44 +614,44 @@ for ([nameMA = "noName", >nameMA : string } for ([nameMA = "noName", ->[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, [string, string]] ->nameMA = "noName" : string +>nameMA = "noName" : "noName" >nameMA : string ->"noName" : string +>"noName" : "noName" [ >[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : [string, string] >[ primarySkillA = "primary", secondarySkillA = "secondary" ] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -664,22 +664,22 @@ for ([nameMA = "noName", } for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { ->[numberA3 = -1, ...robotAInfo] = robotA, i = 0 : number +>[numberA3 = -1, ...robotAInfo] = robotA, i = 0 : 0 >[numberA3 = -1, ...robotAInfo] = robotA : [number, string, string] >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -691,23 +691,23 @@ for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { >numberA3 : number } for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { ->[numberA3 = -1, ...robotAInfo] = getRobot(), i = 0 : number +>[numberA3 = -1, ...robotAInfo] = getRobot(), i = 0 : 0 >[numberA3 = -1, ...robotAInfo] = getRobot() : [number, string, string] >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -719,27 +719,27 @@ for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { >numberA3 : number } for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types index 21a7122e5648f..3a78d92033bf1 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types @@ -39,22 +39,22 @@ let robot: Robot = { name: "mower", skill: "mowing" }; >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function getRobot() { >getRobot : () => Robot @@ -74,10 +74,10 @@ for (let {name: nameA } = robot, i = 0; i < 1; i++) { >nameA : string >robot : Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -94,10 +94,10 @@ for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { >getRobot() : Robot >getRobot : () => Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -115,14 +115,14 @@ for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -141,10 +141,10 @@ for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, >secondaryA : string >multiRobot : MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -164,10 +164,10 @@ for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobo >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -190,20 +190,20 @@ for (let { skills: { primary: primaryA, secondary: secondaryA } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -222,10 +222,10 @@ for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { >skillA : string >robot : Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -244,10 +244,10 @@ for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { >getRobot() : Robot >getRobot : () => Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -267,14 +267,14 @@ for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimm >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -295,10 +295,10 @@ for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = >secondaryA : string >multiRobot : MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -320,10 +320,10 @@ for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -348,20 +348,20 @@ for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types index 81beb06d3d76d..49ae5c619440b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types @@ -39,22 +39,22 @@ let robot: Robot = { name: "mower", skill: "mowing" }; >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function getRobot() { >getRobot : () => Robot @@ -83,18 +83,18 @@ let name: string, primary: string, secondary: string, skill: string; >skill : string for ({ name: nameA } = robot, i = 0; i < 1; i++) { ->{ name: nameA } = robot, i = 0 : number +>{ name: nameA } = robot, i = 0 : 0 >{ name: nameA } = robot : Robot >{ name: nameA } : { name: string; } >name : string >nameA : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -106,19 +106,19 @@ for ({ name: nameA } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { ->{ name: nameA } = getRobot(), i = 0 : number +>{ name: nameA } = getRobot(), i = 0 : 0 >{ name: nameA } = getRobot() : Robot >{ name: nameA } : { name: string; } >name : string >nameA : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -130,7 +130,7 @@ for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name: nameA } = { name: "trimmer", skill: "trimming" } : Robot >{ name: nameA } : { name: string; } >name : string @@ -139,15 +139,15 @@ for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -159,7 +159,7 @@ for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < >nameA : string } for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { ->{ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : 0 >{ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot : MultiRobot >{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -169,12 +169,12 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = >secondary : string >secondaryA : string >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -186,7 +186,7 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = >primaryA : string } for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { ->{ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : 0 >{ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() : MultiRobot >{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -197,12 +197,12 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), >secondaryA : string >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -214,7 +214,7 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), >primaryA : string } for ({ skills: { primary: primaryA, secondary: secondaryA } } = ->{ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -229,21 +229,21 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -255,17 +255,17 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = >primaryA : string } for ({ name } = robot, i = 0; i < 1; i++) { ->{ name } = robot, i = 0 : number +>{ name } = robot, i = 0 : 0 >{ name } = robot : Robot >{ name } : { name: string; } >name : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -277,18 +277,18 @@ for ({ name } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name } = getRobot(), i = 0; i < 1; i++) { ->{ name } = getRobot(), i = 0 : number +>{ name } = getRobot(), i = 0 : 0 >{ name } = getRobot() : Robot >{ name } : { name: string; } >name : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -300,7 +300,7 @@ for ({ name } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name } = { name: "trimmer", skill: "trimming" } : Robot >{ name } : { name: string; } >name : string @@ -308,15 +308,15 @@ for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++ >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -328,7 +328,7 @@ for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++ >nameA : string } for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { ->{ skills: { primary, secondary } } = multiRobot, i = 0 : number +>{ skills: { primary, secondary } } = multiRobot, i = 0 : 0 >{ skills: { primary, secondary } } = multiRobot : MultiRobot >{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -336,12 +336,12 @@ for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { >primary : string >secondary : string >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -353,7 +353,7 @@ for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { >primaryA : string } for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { ->{ skills: { primary, secondary } } = getMultiRobot(), i = 0 : number +>{ skills: { primary, secondary } } = getMultiRobot(), i = 0 : 0 >{ skills: { primary, secondary } } = getMultiRobot() : MultiRobot >{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -362,12 +362,12 @@ for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { >secondary : string >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -379,7 +379,7 @@ for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { >primaryA : string } for ({ skills: { primary, secondary } } = ->{ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -392,21 +392,21 @@ for ({ skills: { primary, secondary } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -420,7 +420,7 @@ for ({ skills: { primary, secondary } } = for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { ->{ name: nameA, skill: skillA } = robot, i = 0 : number +>{ name: nameA, skill: skillA } = robot, i = 0 : 0 >{ name: nameA, skill: skillA } = robot : Robot >{ name: nameA, skill: skillA } : { name: string; skill: string; } >name : string @@ -428,12 +428,12 @@ for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { >skill : string >skillA : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -445,7 +445,7 @@ for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { ->{ name: nameA, skill: skillA } = getRobot(), i = 0 : number +>{ name: nameA, skill: skillA } = getRobot(), i = 0 : 0 >{ name: nameA, skill: skillA } = getRobot() : Robot >{ name: nameA, skill: skillA } : { name: string; skill: string; } >name : string @@ -454,12 +454,12 @@ for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { >skillA : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -471,7 +471,7 @@ for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } : Robot >{ name: nameA, skill: skillA } : { name: string; skill: string; } >name : string @@ -482,15 +482,15 @@ for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -502,7 +502,7 @@ for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming >nameA : string } for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { ->{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : 0 >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot : MultiRobot >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -514,12 +514,12 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = mul >secondary : string >secondaryA : string >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -531,7 +531,7 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = mul >primaryA : string } for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { ->{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : 0 >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() : MultiRobot >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -544,12 +544,12 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = get >secondaryA : string >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -561,7 +561,7 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = get >primaryA : string } for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = ->{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -578,21 +578,21 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -604,18 +604,18 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = >primaryA : string } for ({ name, skill } = robot, i = 0; i < 1; i++) { ->{ name, skill } = robot, i = 0 : number +>{ name, skill } = robot, i = 0 : 0 >{ name, skill } = robot : Robot >{ name, skill } : { name: string; skill: string; } >name : string >skill : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -627,19 +627,19 @@ for ({ name, skill } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { ->{ name, skill } = getRobot(), i = 0 : number +>{ name, skill } = getRobot(), i = 0 : 0 >{ name, skill } = getRobot() : Robot >{ name, skill } : { name: string; skill: string; } >name : string >skill : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -651,7 +651,7 @@ for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name, skill } = { name: "trimmer", skill: "trimming" } : Robot >{ name, skill } : { name: string; skill: string; } >name : string @@ -660,15 +660,15 @@ for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -680,7 +680,7 @@ for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < >nameA : string } for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { ->{ name, skills: { primary, secondary } } = multiRobot, i = 0 : number +>{ name, skills: { primary, secondary } } = multiRobot, i = 0 : 0 >{ name, skills: { primary, secondary } } = multiRobot : MultiRobot >{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -689,12 +689,12 @@ for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { >primary : string >secondary : string >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -706,7 +706,7 @@ for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { >primaryA : string } for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { ->{ name, skills: { primary, secondary } } = getMultiRobot(), i = 0 : number +>{ name, skills: { primary, secondary } } = getMultiRobot(), i = 0 : 0 >{ name, skills: { primary, secondary } } = getMultiRobot() : MultiRobot >{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -716,12 +716,12 @@ for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i >secondary : string >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -733,7 +733,7 @@ for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i >primaryA : string } for ({ name, skills: { primary, secondary } } = ->{ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -747,21 +747,21 @@ for ({ name, skills: { primary, secondary } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types index c9e76f8858180..261ccd3639675 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types @@ -39,22 +39,22 @@ let robot: Robot = { name: "mower", skill: "mowing" }; >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function getRobot() { >getRobot : () => Robot @@ -72,13 +72,13 @@ function getMultiRobot() { for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >robot : Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -92,14 +92,14 @@ for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >getRobot() : Robot >getRobot : () => Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -113,19 +113,19 @@ for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -143,27 +143,27 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -181,28 +181,28 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -220,39 +220,39 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -267,16 +267,16 @@ for (let { for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"skill" : string +>"skill" : "skill" >robot : Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -290,17 +290,17 @@ for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"skill" : string +>"skill" : "skill" >getRobot() : Robot >getRobot : () => Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -314,22 +314,22 @@ for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"skill" : string +>"skill" : "skill" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -344,7 +344,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -352,27 +352,27 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -387,7 +387,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -395,28 +395,28 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -431,7 +431,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -439,39 +439,39 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types index aa8c95bae0114..c5f2c806def80 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types @@ -39,22 +39,22 @@ let robot: Robot = { name: "mower", skill: "mowing" }; >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function getRobot() { >getRobot : () => Robot @@ -83,20 +83,20 @@ let name: string, primary: string, secondary: string, skill: string; >skill : string for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { ->{name: nameA = "noName" } = robot, i = 0 : number +>{name: nameA = "noName" } = robot, i = 0 : 0 >{name: nameA = "noName" } = robot : Robot >{name: nameA = "noName" } : { name?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -108,21 +108,21 @@ for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { >nameA : string } for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { ->{name: nameA = "noName" } = getRobot(), i = 0 : number +>{name: nameA = "noName" } = getRobot(), i = 0 : 0 >{name: nameA = "noName" } = getRobot() : Robot >{name: nameA = "noName" } : { name?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -134,26 +134,26 @@ for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{name: nameA = "noName" } = { name: "trimmer", skill: "trimming" } : Robot >{name: nameA = "noName" } : { name?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -165,7 +165,7 @@ for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, >nameA : string } for ({ ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -176,31 +176,31 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -212,7 +212,7 @@ for ({ >primaryA : string } for ({ ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -223,32 +223,32 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -260,7 +260,7 @@ for ({ >primaryA : string } for ({ ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -271,43 +271,43 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -320,17 +320,17 @@ for ({ } for ({ name = "noName" } = robot, i = 0; i < 1; i++) { ->{ name = "noName" } = robot, i = 0 : number +>{ name = "noName" } = robot, i = 0 : 0 >{ name = "noName" } = robot : Robot >{ name = "noName" } : { name?: string; } >name : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -342,18 +342,18 @@ for ({ name = "noName" } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { ->{ name = "noName" } = getRobot(), i = 0 : number +>{ name = "noName" } = getRobot(), i = 0 : 0 >{ name = "noName" } = getRobot() : Robot >{ name = "noName" } : { name?: string; } >name : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -365,7 +365,7 @@ for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name = "noName" } = { name: "trimmer", skill: "trimming" } : Robot >{ name = "noName" } : { name?: string; } >name : string @@ -373,15 +373,15 @@ for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -393,7 +393,7 @@ for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; >nameA : string } for ({ ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -411,18 +411,18 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -434,7 +434,7 @@ for ({ >primaryA : string } for ({ ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -452,19 +452,19 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -476,7 +476,7 @@ for ({ >primaryA : string } for ({ ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -494,30 +494,30 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -531,24 +531,24 @@ for ({ for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { ->{name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0 : 0 >{name: nameA = "noName", skill: skillA = "skill" } = robot : Robot >{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : string ->skillA = "skill" : string +>skillA = "skill" : "skill" >skillA : string ->"skill" : string +>"skill" : "skill" >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -560,25 +560,25 @@ for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i >nameA : string } for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { ->{name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0 : 0 >{name: nameA = "noName", skill: skillA = "skill" } = getRobot() : Robot >{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : string ->skillA = "skill" : string +>skillA = "skill" : "skill" >skillA : string ->"skill" : string +>"skill" : "skill" >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -590,30 +590,30 @@ for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < >nameA : string } for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } : Robot >{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : string ->skillA = "skill" : string +>skillA = "skill" : "skill" >skillA : string ->"skill" : string +>"skill" : "skill" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -625,15 +625,15 @@ for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimme >nameA : string } for ({ ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } name: nameA = "noName", >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : { primary?: string; secondary?: string; } @@ -642,31 +642,31 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -678,15 +678,15 @@ for ({ >primaryA : string } for ({ ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } name: nameA = "noName", >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : { primary?: string; secondary?: string; } @@ -695,32 +695,32 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -732,15 +732,15 @@ for ({ >primaryA : string } for ({ ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } name: nameA = "noName", >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : { primary?: string; secondary?: string; } @@ -749,43 +749,43 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -798,18 +798,18 @@ for ({ } for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { ->{ name = "noName", skill = "skill" } = robot, i = 0 : number +>{ name = "noName", skill = "skill" } = robot, i = 0 : 0 >{ name = "noName", skill = "skill" } = robot : Robot >{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } >name : string >skill : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -821,19 +821,19 @@ for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { ->{ name = "noName", skill = "skill" } = getRobot(), i = 0 : number +>{ name = "noName", skill = "skill" } = getRobot(), i = 0 : 0 >{ name = "noName", skill = "skill" } = getRobot() : Robot >{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } >name : string >skill : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -845,7 +845,7 @@ for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" } : Robot >{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } >name : string @@ -854,15 +854,15 @@ for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "tr >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -874,7 +874,7 @@ for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "tr >nameA : string } for ({ ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } @@ -895,18 +895,18 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -918,7 +918,7 @@ for ({ >primaryA : string } for ({ ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } @@ -939,19 +939,19 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -963,7 +963,7 @@ for ({ >primaryA : string } for ({ ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } @@ -984,30 +984,30 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types index aebfe16dcde88..41dc32d2648c6 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types @@ -16,17 +16,17 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let robots = [robotA, robotB]; >robots : [number, string, string][] @@ -45,19 +45,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let multiRobots = [multiRobotA, multiRobotB]; >multiRobots : [string, [string, string]][] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types index be84bbe3459bb..abc08ee63d425 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types @@ -16,17 +16,17 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let robots = [robotA, robotB]; >robots : [number, string, string][] @@ -45,19 +45,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let multiRobots = [multiRobotA, multiRobotB]; >multiRobots : [string, [string, string]][] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types index 80ba5df531fa0..e82c981033e7d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types @@ -16,17 +16,17 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let robots = [robotA, robotB]; >robots : [number, string, string][] @@ -45,19 +45,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let multiRobots = [multiRobotA, multiRobotB]; >multiRobots : [string, [string, string]][] @@ -75,7 +75,7 @@ function getMultiRobots() { for (let [, nameA = "noName"] of robots) { > : undefined >nameA : string ->"noName" : string +>"noName" : "noName" >robots : [number, string, string][] console.log(nameA); @@ -88,7 +88,7 @@ for (let [, nameA = "noName"] of robots) { for (let [, nameA = "noName"] of getRobots()) { > : undefined >nameA : string ->"noName" : string +>"noName" : "noName" >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -102,7 +102,7 @@ for (let [, nameA = "noName"] of getRobots()) { for (let [, nameA = "noName"] of [robotA, robotB]) { > : undefined >nameA : string ->"noName" : string +>"noName" : "noName" >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -119,16 +119,16 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >multiRobots : [string, [string, string]][] console.log(primarySkillA); @@ -143,16 +143,16 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -168,16 +168,16 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -192,8 +192,8 @@ for (let [, [ for (let [numberB = -1] of robots) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robots : [number, string, string][] console.log(numberB); @@ -205,8 +205,8 @@ for (let [numberB = -1] of robots) { } for (let [numberB = -1] of getRobots()) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -219,8 +219,8 @@ for (let [numberB = -1] of getRobots()) { } for (let [numberB = -1] of [robotA, robotB]) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -234,7 +234,7 @@ for (let [numberB = -1] of [robotA, robotB]) { } for (let [nameB = "noName"] of multiRobots) { >nameB : string ->"noName" : string +>"noName" : "noName" >multiRobots : [string, [string, string]][] console.log(nameB); @@ -246,7 +246,7 @@ for (let [nameB = "noName"] of multiRobots) { } for (let [nameB = "noName"] of getMultiRobots()) { >nameB : string ->"noName" : string +>"noName" : "noName" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -259,7 +259,7 @@ for (let [nameB = "noName"] of getMultiRobots()) { } for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { >nameB : string ->"noName" : string +>"noName" : "noName" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -274,12 +274,12 @@ for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"noName" : string +>"noName" : "noName" >skillA2 : string ->"skill" : string +>"skill" : "skill" >robots : [number, string, string][] console.log(nameA2); @@ -291,12 +291,12 @@ for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { } for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"noName" : string +>"noName" : "noName" >skillA2 : string ->"skill" : string +>"skill" : "skill" >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -309,12 +309,12 @@ for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { } for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"noName" : string +>"noName" : "noName" >skillA2 : string ->"skill" : string +>"skill" : "skill" >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -328,20 +328,20 @@ for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robot } for (let [nameMA = "noName", [ >nameMA : string ->"noName" : string +>"noName" : "noName" primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >multiRobots : [string, [string, string]][] console.log(nameMA); @@ -353,20 +353,20 @@ for (let [nameMA = "noName", [ } for (let [nameMA = "noName", [ >nameMA : string ->"noName" : string +>"noName" : "noName" primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -379,20 +379,20 @@ for (let [nameMA = "noName", [ } for (let [nameMA = "noName", [ >nameMA : string ->"noName" : string +>"noName" : "noName" primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -407,8 +407,8 @@ for (let [nameMA = "noName", [ for (let [numberA3 = -1, ...robotAInfo] of robots) { >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >robots : [number, string, string][] @@ -421,8 +421,8 @@ for (let [numberA3 = -1, ...robotAInfo] of robots) { } for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -436,8 +436,8 @@ for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { } for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types index 257663d7fe33a..dad997dac4fe5 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types @@ -16,17 +16,17 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let robots = [robotA, robotB]; >robots : [number, string, string][] @@ -45,19 +45,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let multiRobots = [multiRobotA, multiRobotB]; >multiRobots : [string, [string, string]][] @@ -95,9 +95,9 @@ let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string for ([, nameA = "noName"] of robots) { >[, nameA = "noName"] : [undefined, string] > : undefined ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >robots : [number, string, string][] console.log(nameA); @@ -110,9 +110,9 @@ for ([, nameA = "noName"] of robots) { for ([, nameA = "noName"] of getRobots()) { >[, nameA = "noName"] : [undefined, string] > : undefined ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -126,9 +126,9 @@ for ([, nameA = "noName"] of getRobots()) { for ([, nameA = "noName"] of [robotA, robotB]) { >[, nameA = "noName"] : [undefined, string] > : undefined ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -147,19 +147,19 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >multiRobots : [string, [string, string]][] console.log(primarySkillA); @@ -176,19 +176,19 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -206,19 +206,19 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -233,10 +233,10 @@ for ([, [ for ([numberB = -1] of robots) { >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robots : [number, string, string][] console.log(numberB); @@ -248,10 +248,10 @@ for ([numberB = -1] of robots) { } for ([numberB = -1] of getRobots()) { >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -264,10 +264,10 @@ for ([numberB = -1] of getRobots()) { } for ([numberB = -1] of [robotA, robotB]) { >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -281,9 +281,9 @@ for ([numberB = -1] of [robotA, robotB]) { } for ([nameB = "noName"] of multiRobots) { >[nameB = "noName"] : [string] ->nameB = "noName" : string +>nameB = "noName" : "noName" >nameB : string ->"noName" : string +>"noName" : "noName" >multiRobots : [string, [string, string]][] console.log(nameB); @@ -295,9 +295,9 @@ for ([nameB = "noName"] of multiRobots) { } for ([nameB = "noName"] of getMultiRobots()) { >[nameB = "noName"] : [string] ->nameB = "noName" : string +>nameB = "noName" : "noName" >nameB : string ->"noName" : string +>"noName" : "noName" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -310,9 +310,9 @@ for ([nameB = "noName"] of getMultiRobots()) { } for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { >[nameB = "noName"] : [string] ->nameB = "noName" : string +>nameB = "noName" : "noName" >nameB : string ->"noName" : string +>"noName" : "noName" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -327,16 +327,16 @@ for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { >[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "noName" : string +>-1 : -1 +>1 : 1 +>nameA2 = "noName" : "noName" >nameA2 : string ->"noName" : string ->skillA2 = "skill" : string +>"noName" : "noName" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >robots : [number, string, string][] console.log(nameA2); @@ -348,16 +348,16 @@ for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { } for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { >[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "noName" : string +>-1 : -1 +>1 : 1 +>nameA2 = "noName" : "noName" >nameA2 : string ->"noName" : string ->skillA2 = "skill" : string +>"noName" : "noName" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -370,16 +370,16 @@ for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { } for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { >[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "noName" : string +>-1 : -1 +>1 : 1 +>nameA2 = "noName" : "noName" >nameA2 : string ->"noName" : string ->skillA2 = "skill" : string +>"noName" : "noName" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -393,26 +393,26 @@ for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) } for ([nameMA = "noName", [ >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, [string, string]] ->nameMA = "noName" : string +>nameMA = "noName" : "noName" >nameMA : string ->"noName" : string +>"noName" : "noName" >[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >multiRobots : [string, [string, string]][] console.log(nameMA); @@ -424,26 +424,26 @@ for ([nameMA = "noName", [ } for ([nameMA = "noName", [ >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, [string, string]] ->nameMA = "noName" : string +>nameMA = "noName" : "noName" >nameMA : string ->"noName" : string +>"noName" : "noName" >[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -456,26 +456,26 @@ for ([nameMA = "noName", [ } for ([nameMA = "noName", [ >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, [string, string]] ->nameMA = "noName" : string +>nameMA = "noName" : "noName" >nameMA : string ->"noName" : string +>"noName" : "noName" >[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -490,10 +490,10 @@ for ([nameMA = "noName", [ for ([numberA3 = -1, ...robotAInfo] of robots) { >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >robots : [number, string, string][] @@ -507,10 +507,10 @@ for ([numberA3 = -1, ...robotAInfo] of robots) { } for ([numberA3 = -1, ...robotAInfo] of getRobots()) { >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >getRobots() : [number, string, string][] @@ -525,10 +525,10 @@ for ([numberA3 = -1, ...robotAInfo] of getRobots()) { } for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >[robotA, robotB] : [number, string, string][] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types index 17c060225dc65..26d570974df92 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types @@ -40,14 +40,14 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] @@ -55,24 +55,24 @@ let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", s >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" function getRobots() { >getRobots : () => Robot[] @@ -119,14 +119,14 @@ for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -175,24 +175,24 @@ for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "m >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -239,14 +239,14 @@ for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -301,24 +301,24 @@ for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types index 1f2925425455e..64680d66001d9 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types @@ -40,14 +40,14 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] @@ -55,24 +55,24 @@ let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", s >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" function getRobots() { >getRobots : () => Robot[] @@ -135,14 +135,14 @@ for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", s >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -197,24 +197,24 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -254,14 +254,14 @@ for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: " >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -310,24 +310,24 @@ for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -378,14 +378,14 @@ for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { nam >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -446,24 +446,24 @@ for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void @@ -506,14 +506,14 @@ for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", s >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -565,24 +565,24 @@ for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { prim >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types index 36f67f946f0c1..d55ab46cbd28b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types @@ -40,14 +40,14 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] @@ -55,24 +55,24 @@ let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", s >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" function getRobots() { >getRobots : () => Robot[] @@ -91,7 +91,7 @@ function getMultiRobots() { for (let {name: nameA = "noName" } of robots) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >robots : Robot[] console.log(nameA); @@ -104,7 +104,7 @@ for (let {name: nameA = "noName" } of robots) { for (let {name: nameA = "noName" } of getRobots()) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >getRobots() : Robot[] >getRobots : () => Robot[] @@ -118,18 +118,18 @@ for (let {name: nameA = "noName" } of getRobots()) { for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -142,17 +142,17 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >skills : any >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" >multiRobots : MultiRobot[] console.log(primaryA); @@ -166,17 +166,17 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >skills : any >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" >getMultiRobots() : MultiRobot[] >getMultiRobots : () => MultiRobot[] @@ -191,17 +191,17 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >skills : any >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] @@ -209,24 +209,24 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -239,10 +239,10 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >robots : Robot[] console.log(nameA); @@ -255,10 +255,10 @@ for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >getRobots() : Robot[] >getRobots : () => Robot[] @@ -272,21 +272,21 @@ for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -299,7 +299,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -307,19 +307,19 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of multiRobots) { >multiRobots : MultiRobot[] @@ -335,7 +335,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -343,19 +343,19 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of getMultiRobots()) { >getMultiRobots() : MultiRobot[] @@ -372,7 +372,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -380,19 +380,19 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] @@ -400,24 +400,24 @@ for (let { >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types index adb5d515fe4b0..6119665124d2d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types @@ -40,14 +40,14 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] @@ -55,24 +55,24 @@ let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", s >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" function getRobots() { >getRobots : () => Robot[] @@ -104,9 +104,9 @@ let name: string, primary: string, secondary: string, skill: string; for ({name: nameA = "noName" } of robots) { >{name: nameA = "noName" } : { name?: string; } >name : Robot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >robots : Robot[] console.log(nameA); @@ -119,9 +119,9 @@ for ({name: nameA = "noName" } of robots) { for ({name: nameA = "noName" } of getRobots()) { >{name: nameA = "noName" } : { name?: string; } >name : Robot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >getRobots() : Robot[] >getRobots : () => Robot[] @@ -135,20 +135,20 @@ for ({name: nameA = "noName" } of getRobots()) { for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { >{name: nameA = "noName" } : { name?: string; } >name : { name: string; skill: string; } ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -163,20 +163,20 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" >multiRobots : MultiRobot[] console.log(primaryA); @@ -192,20 +192,20 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" >getMultiRobots() : MultiRobot[] >getMultiRobots : () => MultiRobot[] @@ -222,20 +222,20 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] @@ -243,24 +243,24 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -301,14 +301,14 @@ for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimme >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -334,9 +334,9 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of multiRobots) { >multiRobots : MultiRobot[] @@ -365,9 +365,9 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of getMultiRobots()) { >getMultiRobots() : MultiRobot[] @@ -397,32 +397,32 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -436,13 +436,13 @@ for ({ for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { >{name: nameA = "noName", skill: skillA = "noSkill" } : { name?: string; skill?: string; } >name : Robot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : Robot ->skillA = "noSkill" : string +>skillA = "noSkill" : "noSkill" >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >robots : Robot[] console.log(nameA); @@ -455,13 +455,13 @@ for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { >{name: nameA = "noName", skill: skillA = "noSkill" } : { name?: string; skill?: string; } >name : Robot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : Robot ->skillA = "noSkill" : string +>skillA = "noSkill" : "noSkill" >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >getRobots() : Robot[] >getRobots : () => Robot[] @@ -475,24 +475,24 @@ for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { >{name: nameA = "noName", skill: skillA = "noSkill" } : { name?: string; skill?: string; } >name : { name: string; skill: string; } ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : { name: string; skill: string; } ->skillA = "noSkill" : string +>skillA = "noSkill" : "noSkill" >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -506,9 +506,9 @@ for ({ name: nameA = "noName", >name : MultiRobot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : MultiRobot @@ -517,22 +517,22 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of multiRobots) { >multiRobots : MultiRobot[] @@ -549,9 +549,9 @@ for ({ name: nameA = "noName", >name : MultiRobot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : MultiRobot @@ -560,22 +560,22 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of getMultiRobots()) { >getMultiRobots() : MultiRobot[] @@ -593,9 +593,9 @@ for ({ name: nameA = "noName", >name : MultiRobot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : MultiRobot @@ -604,22 +604,22 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] @@ -627,24 +627,24 @@ for ({ >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void @@ -688,14 +688,14 @@ for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -724,9 +724,9 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of multiRobots) { >multiRobots : MultiRobot[] @@ -758,9 +758,9 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of getMultiRobots()) { >getMultiRobots() : MultiRobot[] @@ -793,32 +793,32 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types index af27c32d15ba9..eef87d57c458c 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types @@ -28,13 +28,13 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >Robot : Robot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { >foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}: Robot) => void @@ -95,13 +95,13 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" foo2(robotA); >foo2(robotA) : void @@ -113,13 +113,13 @@ foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo2 : ({name: nameC, skills: {primary: primaryB, secondary: secondaryB}}: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" foo3(robotA); >foo3(robotA) : void @@ -131,11 +131,11 @@ foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo3 : ({skills}: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types index 1115931feef2f..9f5b16407ca2f 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types @@ -28,13 +28,13 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >Robot : Robot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function foo1( >foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}?: Robot) => void @@ -45,19 +45,19 @@ function foo1( primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "SomeSkill", secondary: "someSkill" } >{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } >primary : string ->"SomeSkill" : string +>"SomeSkill" : "SomeSkill" >secondary : string ->"someSkill" : string +>"someSkill" : "someSkill" }: Robot = robotA) { >Robot : Robot @@ -76,7 +76,7 @@ function foo2( name: nameC = "name", >name : any >nameC : string ->"name" : string +>"name" : "name" skills: { >skills : any @@ -84,19 +84,19 @@ function foo2( primary: primaryB = "primary", >primary : any >primaryB : string ->"primary" : string +>"primary" : "primary" secondary: secondaryB = "secondary" >secondary : any >secondaryB : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "SomeSkill", secondary: "someSkill" } >{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } >primary : string ->"SomeSkill" : string +>"SomeSkill" : "SomeSkill" >secondary : string ->"someSkill" : string +>"someSkill" : "someSkill" }: Robot = robotA) { >Robot : Robot @@ -114,9 +114,9 @@ function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Ro >skills : { primary?: string; secondary?: string; } >{ primary: "SomeSkill", secondary: "someSkill" } : { primary: string; secondary: string; } >primary : string ->"SomeSkill" : string +>"SomeSkill" : "SomeSkill" >secondary : string ->"someSkill" : string +>"someSkill" : "someSkill" >Robot : Robot >robotA : Robot @@ -140,13 +140,13 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}?: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" foo2(robotA); >foo2(robotA) : void @@ -158,13 +158,13 @@ foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo2 : ({name: nameC, skills: {primary: primaryB, secondary: secondaryB}}?: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" foo3(robotA); >foo3(robotA) : void @@ -176,11 +176,11 @@ foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo3 : ({skills}?: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types index 6b8f26acf4307..225071a3d2efc 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types @@ -17,16 +17,16 @@ declare var console: { } var hello = "hello"; >hello : string ->"hello" : string +>"hello" : "hello" var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" function foo1({ name: nameA }: Robot) { >foo1 : ({name: nameA}: Robot) => void @@ -79,9 +79,9 @@ foo1({ name: "Edger", skill: "cutting edges" }); >foo1 : ({name: nameA}: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" foo2(robotA); >foo2(robotA) : void @@ -93,9 +93,9 @@ foo2({ name: "Edger", skill: "cutting edges" }); >foo2 : ({name: nameB, skill: skillB}: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" foo3(robotA); >foo3(robotA) : void @@ -107,7 +107,7 @@ foo3({ name: "Edger", skill: "cutting edges" }); >foo3 : ({name}: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types index 253c5feae8fbf..db6a8bcab29df 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types @@ -17,22 +17,22 @@ declare var console: { } var hello = "hello"; >hello : string ->"hello" : string +>"hello" : "hello" var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" function foo1({ name: nameA = "" }: Robot = { }) { >foo1 : ({name: nameA}?: Robot) => void >name : any >nameA : string ->"" : string +>"" : "" >Robot : Robot >{ } : {} @@ -47,10 +47,10 @@ function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = { >foo2 : ({name: nameB, skill: skillB}?: Robot) => void >name : any >nameB : string ->"" : string +>"" : "" >skill : any >skillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >Robot : Robot >{} : {} @@ -64,7 +64,7 @@ function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = { function foo3({ name = "" }: Robot = {}) { >foo3 : ({name}?: Robot) => void >name : string ->"" : string +>"" : "" >Robot : Robot >{} : {} @@ -86,9 +86,9 @@ foo1({ name: "Edger", skill: "cutting edges" }); >foo1 : ({name: nameA}?: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" foo2(robotA); >foo2(robotA) : void @@ -100,9 +100,9 @@ foo2({ name: "Edger", skill: "cutting edges" }); >foo2 : ({name: nameB, skill: skillB}?: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" foo3(robotA); >foo3(robotA) : void @@ -114,7 +114,7 @@ foo3({ name: "Edger", skill: "cutting edges" }); >foo3 : ({name}?: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types index aab0b3cf5c73e..d7aed64a23282 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types @@ -13,9 +13,9 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function foo1([, nameA]: Robot) { >foo1 : ([, nameA]: [number, string, string]) => void @@ -82,9 +82,9 @@ foo1([2, "trimmer", "trimming"]); >foo1([2, "trimmer", "trimming"]) : void >foo1 : ([, nameA]: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo2(robotA); >foo2(robotA) : void @@ -95,9 +95,9 @@ foo2([2, "trimmer", "trimming"]); >foo2([2, "trimmer", "trimming"]) : void >foo2 : ([numberB]: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo3(robotA); >foo3(robotA) : void @@ -108,9 +108,9 @@ foo3([2, "trimmer", "trimming"]); >foo3([2, "trimmer", "trimming"]) : void >foo3 : ([numberA2, nameA2, skillA2]: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo4(robotA); >foo4(robotA) : void @@ -121,7 +121,7 @@ foo4([2, "trimmer", "trimming"]); >foo4([2, "trimmer", "trimming"]) : void >foo4 : ([numberA3, ...robotAInfo]: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types index b3e09d962c3df..00809184d3b30 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types @@ -13,10 +13,10 @@ var robotA: Robot = ["trimmer", ["trimming", "edging"]]; >robotA : [string, [string, string]] >Robot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function foo1([, skillA]: Robot) { >foo1 : ([, skillA]: [string, [string, string]]) => void @@ -82,10 +82,10 @@ foo1(["roomba", ["vaccum", "mopping"]]); >foo1(["roomba", ["vaccum", "mopping"]]) : void >foo1 : ([, skillA]: [string, [string, string]]) => void >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" foo2(robotA); >foo2(robotA) : void @@ -96,10 +96,10 @@ foo2(["roomba", ["vaccum", "mopping"]]); >foo2(["roomba", ["vaccum", "mopping"]]) : void >foo2 : ([nameMB]: [string, [string, string]]) => void >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" foo3(robotA); >foo3(robotA) : void @@ -110,10 +110,10 @@ foo3(["roomba", ["vaccum", "mopping"]]); >foo3(["roomba", ["vaccum", "mopping"]]) : void >foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, [string, string]]) => void >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" foo4(robotA); >foo4(robotA) : void @@ -124,8 +124,8 @@ foo4(["roomba", ["vaccum", "mopping"]]); >foo4(["roomba", ["vaccum", "mopping"]]) : void >foo4 : ([...multiRobotAInfo]: [string, [string, string]]) => void >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types index 43420fdd58773..a9d1013c136cf 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types @@ -13,21 +13,21 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { >foo1 : ([, nameA]?: [number, string, string]) => void > : undefined >nameA : string ->"noName" : string +>"noName" : "noName" >Robot : [number, string, string] >[-1, "name", "skill"] : [number, string, string] ->-1 : number ->1 : number ->"name" : string ->"skill" : string +>-1 : -1 +>1 : 1 +>"name" : "name" +>"skill" : "skill" console.log(nameA); >console.log(nameA) : void @@ -40,14 +40,14 @@ function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { >foo2 : ([numberB]?: [number, string, string]) => void >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >Robot : [number, string, string] >[-1, "name", "skill"] : [number, string, string] ->-1 : number ->1 : number ->"name" : string ->"skill" : string +>-1 : -1 +>1 : 1 +>"name" : "name" +>"skill" : "skill" console.log(numberB); >console.log(numberB) : void @@ -60,18 +60,18 @@ function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { >foo3 : ([numberA2, nameA2, skillA2]?: [number, string, string]) => void >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"name" : string +>"name" : "name" >skillA2 : string ->"skill" : string +>"skill" : "skill" >Robot : [number, string, string] >[-1, "name", "skill"] : [number, string, string] ->-1 : number ->1 : number ->"name" : string ->"skill" : string +>-1 : -1 +>1 : 1 +>"name" : "name" +>"skill" : "skill" console.log(nameA2); >console.log(nameA2) : void @@ -84,15 +84,15 @@ function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { >foo4 : ([numberA3, ...robotAInfo]?: [number, string, string]) => void >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >Robot : [number, string, string] >[-1, "name", "skill"] : [number, string, string] ->-1 : number ->1 : number ->"name" : string ->"skill" : string +>-1 : -1 +>1 : 1 +>"name" : "name" +>"skill" : "skill" console.log(robotAInfo); >console.log(robotAInfo) : void @@ -111,9 +111,9 @@ foo1([2, "trimmer", "trimming"]); >foo1([2, "trimmer", "trimming"]) : void >foo1 : ([, nameA]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo2(robotA); >foo2(robotA) : void @@ -124,9 +124,9 @@ foo2([2, "trimmer", "trimming"]); >foo2([2, "trimmer", "trimming"]) : void >foo2 : ([numberB]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo3(robotA); >foo3(robotA) : void @@ -137,9 +137,9 @@ foo3([2, "trimmer", "trimming"]); >foo3([2, "trimmer", "trimming"]) : void >foo3 : ([numberA2, nameA2, skillA2]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo4(robotA); >foo4(robotA) : void @@ -150,7 +150,7 @@ foo4([2, "trimmer", "trimming"]); >foo4([2, "trimmer", "trimming"]) : void >foo4 : ([numberA3, ...robotAInfo]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types index bd140d6a23298..b3569bb58b7d1 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types @@ -13,24 +13,24 @@ var robotA: Robot = ["trimmer", ["trimming", "edging"]]; >robotA : [string, string[]] >Robot : [string, string[]] >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { >foo1 : ([, skillA]?: [string, string[]]) => void > : undefined >skillA : string[] >["noSkill", "noSkill"] : string[] ->"noSkill" : string ->"noSkill" : string +>"noSkill" : "noSkill" +>"noSkill" : "noSkill" >Robot : [string, string[]] >["name", ["skill1", "skill2"]] : [string, string[]] ->"name" : string +>"name" : "name" >["skill1", "skill2"] : string[] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" console.log(skillA); >console.log(skillA) : void @@ -43,13 +43,13 @@ function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "s function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { >foo2 : ([nameMB]?: [string, string[]]) => void >nameMB : string ->"noName" : string +>"noName" : "noName" >Robot : [string, string[]] >["name", ["skill1", "skill2"]] : [string, string[]] ->"name" : string +>"name" : "name" >["skill1", "skill2"] : string[] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" console.log(nameMB); >console.log(nameMB) : void @@ -62,20 +62,20 @@ function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { function foo3([nameMA = "noName", [ >foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, string[]]) => void >nameMA : string ->"noName" : string +>"noName" : "noName" primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["noSkill", "noSkill"]]: Robot) { >["noSkill", "noSkill"] : [string, string] ->"noSkill" : string ->"noSkill" : string +>"noSkill" : "noSkill" +>"noSkill" : "noSkill" >Robot : [string, string[]] console.log(nameMA); @@ -95,10 +95,10 @@ foo1(["roomba", ["vaccum", "mopping"]]); >foo1(["roomba", ["vaccum", "mopping"]]) : void >foo1 : ([, skillA]?: [string, string[]]) => void >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" foo2(robotA); >foo2(robotA) : void @@ -109,10 +109,10 @@ foo2(["roomba", ["vaccum", "mopping"]]); >foo2(["roomba", ["vaccum", "mopping"]]) : void >foo2 : ([nameMB]?: [string, string[]]) => void >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" foo3(robotA); >foo3(robotA) : void @@ -123,8 +123,8 @@ foo3(["roomba", ["vaccum", "mopping"]]); >foo3(["roomba", ["vaccum", "mopping"]]) : void >foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, string[]]) => void >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types index 82a2ffe88f63d..5d61294b5684b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types @@ -17,25 +17,25 @@ declare var console: { } var hello = "hello"; >hello : string ->"hello" : string +>"hello" : "hello" var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" var robotB: Robot = { name: "trimmer", skill: "trimming" }; >robotB : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" var { name: nameA } = robotA; >name : any @@ -56,9 +56,9 @@ var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; >skillC : string >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" if (nameA == nameB) { >nameA == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types index 9d8023f5f740c..9ed1df0f533ba 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types @@ -17,25 +17,25 @@ declare var console: { } var hello = "hello"; >hello : string ->"hello" : string +>"hello" : "hello" var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" var robotB: Robot = { name: "trimmer", skill: "trimming" }; >robotB : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" var a: string, { name: nameA } = robotA; >a : string @@ -59,9 +59,9 @@ var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting >skillC : string >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" var { name: nameA } = robotA, a = hello; >name : any @@ -77,7 +77,7 @@ var { name: nameB, skill: skillB } = robotB, b = " hello"; >skillB : string >robotB : Robot >b : string ->" hello" : string +>" hello" : " hello" var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; >name : any @@ -86,9 +86,9 @@ var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, >skillC : string >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" >c : string >hello : string @@ -99,7 +99,7 @@ var a = hello, { name: nameA } = robotA, a1= "hello"; >nameA : string >robotA : Robot >a1 : string ->"hello" : string +>"hello" : "hello" var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; >b : string @@ -110,7 +110,7 @@ var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; >skillB : string >robotB : Robot >b1 : string ->"hello" : string +>"hello" : "hello" var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; >c : string @@ -121,9 +121,9 @@ var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting >skillC : string >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" >c1 : string >hello : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types index db6e57258d764..46bdfec4b06b2 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types @@ -13,17 +13,17 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let [, nameA] = robotA; @@ -44,18 +44,18 @@ let [numberA2, nameA2, skillA2] = robotA; let [numberC2] = [3, "edging", "Trimming edges"]; >numberC2 : number >[3, "edging", "Trimming edges"] : [number, string, string] ->3 : number ->"edging" : string ->"Trimming edges" : string +>3 : 3 +>"edging" : "edging" +>"Trimming edges" : "Trimming edges" let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; >numberC : number >nameC : string >skillC : string >[3, "edging", "Trimming edges"] : [number, string, string] ->3 : number ->"edging" : string ->"Trimming edges" : string +>3 : 3 +>"edging" : "edging" +>"Trimming edges" : "Trimming edges" let [numberA3, ...robotAInfo] = robotA; >numberA3 : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types index 57d4b271c2fb4..99f280985b553 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types @@ -13,19 +13,19 @@ var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let [, skillA] = multiRobotA; > : undefined @@ -45,20 +45,20 @@ let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; let [nameMC] = ["roomba", ["vaccum", "mopping"]]; >nameMC : string >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; >nameMC2 : string >primarySkillC : string >secondarySkillC : string >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" let [...multiRobotAInfo] = multiRobotA; >multiRobotAInfo : (string | [string, string])[] @@ -77,8 +77,8 @@ if (nameMB == nameMA) { >skillA[0] + skillA[1] : string >skillA[0] : string >skillA : [string, string] ->0 : number +>0 : 0 >skillA[1] : string >skillA : [string, string] ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types index 14a8c18c051ef..bdd2059b863e8 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types @@ -16,35 +16,35 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let nameA: string, numberB: number, nameB: string, skillB: string; >nameA : string @@ -85,9 +85,9 @@ let multiRobotAInfo: (string | [string, string])[]; > : undefined >nameB : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [, multiSkillB] = multiRobotB; >[, multiSkillB] = multiRobotB : [string, [string, string]] @@ -110,10 +110,10 @@ let multiRobotAInfo: (string | [string, string])[]; > : undefined >multiSkillB : [string, string] >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" [numberB] = robotB; >[numberB] = robotB : [number, string, string] @@ -133,9 +133,9 @@ let multiRobotAInfo: (string | [string, string])[]; >[numberB] : [number] >numberB : number >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [nameMB] = multiRobotB; >[nameMB] = multiRobotB : [string, [string, string]] @@ -155,10 +155,10 @@ let multiRobotAInfo: (string | [string, string])[]; >[nameMB] : [string] >nameMB : string >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" [numberB, nameB, skillB] = robotB; >[numberB, nameB, skillB] = robotB : [number, string, string] @@ -184,9 +184,9 @@ let multiRobotAInfo: (string | [string, string])[]; >nameB : string >skillB : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; >[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB : [string, [string, string]] @@ -215,10 +215,10 @@ let multiRobotAInfo: (string | [string, string])[]; >primarySkillB : string >secondarySkillB : string >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" [numberB, ...robotAInfo] = robotB; >[numberB, ...robotAInfo] = robotB : [number, string, string] @@ -246,9 +246,9 @@ let multiRobotAInfo: (string | [string, string])[]; >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [...multiRobotAInfo] = multiRobotA; >[...multiRobotAInfo] = multiRobotA : [string, [string, string]] @@ -271,10 +271,10 @@ let multiRobotAInfo: (string | [string, string])[]; >...multiRobotAInfo : string | [string, string] >multiRobotAInfo : (string | [string, string])[] >["trimmer", ["trimming", "edging"]] : (string | [string, string])[] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" if (nameA == nameB) { >nameA == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern4.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern4.types index 461939a11aa2b..4f61c672b818b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern4.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern4.types @@ -3,6 +3,6 @@ var [x] = [1, 2]; >x : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern5.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern5.types index 1ef747517e416..908e566ca7135 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern5.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern5.types @@ -3,13 +3,13 @@ var [x] = [1, 2]; >x : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var [y, z] = [1, 2]; >y : number >z : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types index 1b94874ae7cda..166a6192bb736 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types @@ -2,8 +2,8 @@ var [x = 20] = [1, 2]; >x : number ->20 : number +>20 : 20 >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types index 9b369e410a411..da537c6e10958 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types @@ -2,9 +2,9 @@ var [x = 20, j] = [1, 2]; >x : number ->20 : number +>20 : 20 >j : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types index be5b47f2eaaf5..fae55a6cabfef 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types @@ -13,66 +13,66 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let [, nameA = "noName"] = robotA; > : undefined >nameA : string ->"noName" : string +>"noName" : "noName" >robotA : [number, string, string] let [numberB = -1] = robotB; >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotB : [number, string, string] let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"noName" : string +>"noName" : "noName" >skillA2 : string ->"noSkill" : string +>"noSkill" : "noSkill" >robotA : [number, string, string] let [numberC2 = -1] = [3, "edging", "Trimming edges"]; >numberC2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[3, "edging", "Trimming edges"] : [number, string, string] ->3 : number ->"edging" : string ->"Trimming edges" : string +>3 : 3 +>"edging" : "edging" +>"Trimming edges" : "Trimming edges" let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; >numberC : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameC : string ->"noName" : string +>"noName" : "noName" >skillC : string ->"noSkill" : string +>"noSkill" : "noSkill" >[3, "edging", "Trimming edges"] : [number, string, string] ->3 : number ->"edging" : string ->"Trimming edges" : string +>3 : 3 +>"edging" : "edging" +>"Trimming edges" : "Trimming edges" let [numberA3 = -1, ...robotAInfo] = robotA; >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >robotA : [number, string, string] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types index 12215507d4adf..21d75479c6dd8 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types @@ -13,69 +13,69 @@ var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, string[]] >MultiSkilledRobot : [string, string[]] >["mower", ["mowing", ""]] : [string, string[]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : string[] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, string[]] >MultiSkilledRobot : [string, string[]] >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; > : undefined >skillA : string[] >["noSkill", "noSkill"] : string[] ->"noSkill" : string ->"noSkill" : string +>"noSkill" : "noSkill" +>"noSkill" : "noSkill" >multiRobotA : [string, string[]] let [nameMB = "noName" ] = multiRobotB; >nameMB : string ->"noName" : string +>"noName" : "noName" >multiRobotB : [string, string[]] let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; >nameMA : string ->"noName" : string +>"noName" : "noName" >primarySkillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondarySkillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >["noSkill", "noSkill"] : [string, string] ->"noSkill" : string ->"noSkill" : string +>"noSkill" : "noSkill" +>"noSkill" : "noSkill" >multiRobotA : [string, string[]] let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; >nameMC : string ->"noName" : string +>"noName" : "noName" >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; >nameMC2 : string ->"noName" : string +>"noName" : "noName" >primarySkillC : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondarySkillC : string ->"noSkill" : string +>"noSkill" : "noSkill" >["noSkill", "noSkill"] : [string, string] ->"noSkill" : string ->"noSkill" : string +>"noSkill" : "noSkill" +>"noSkill" : "noSkill" >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" if (nameMB == nameMA) { >nameMB == nameMA : boolean @@ -90,8 +90,8 @@ if (nameMB == nameMA) { >skillA[0] + skillA[1] : string >skillA[0] : string >skillA : string[] ->0 : number +>0 : 0 >skillA[1] : string >skillA : string[] ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types index 0b1454bdf3b82..35c458f431066 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types @@ -16,35 +16,35 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, string[]] >MultiSkilledRobot : [string, string[]] >["mower", ["mowing", ""]] : [string, string[]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : string[] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, string[]] >MultiSkilledRobot : [string, string[]] >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let nameA: string, numberB: number, nameB: string, skillB: string; >nameA : string @@ -68,18 +68,18 @@ let multiRobotAInfo: (string | string[])[]; >[, nameA = "helloNoName"] = robotA : [number, string, string] >[, nameA = "helloNoName"] : [undefined, string] > : undefined ->nameA = "helloNoName" : string +>nameA = "helloNoName" : "helloNoName" >nameA : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >robotA : [number, string, string] [, nameB = "helloNoName"] = getRobotB(); >[, nameB = "helloNoName"] = getRobotB() : [number, string, string] >[, nameB = "helloNoName"] : [undefined, string] > : undefined ->nameB = "helloNoName" : string +>nameB = "helloNoName" : "helloNoName" >nameB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >getRobotB() : [number, string, string] >getRobotB : () => [number, string, string] @@ -87,13 +87,13 @@ let multiRobotAInfo: (string | string[])[]; >[, nameB = "helloNoName"] = [2, "trimmer", "trimming"] : [number, string, string] >[, nameB = "helloNoName"] : [undefined, string] > : undefined ->nameB = "helloNoName" : string +>nameB = "helloNoName" : "helloNoName" >nameB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [, multiSkillB = []] = multiRobotB; >[, multiSkillB = []] = multiRobotB : [string, string[]] @@ -122,151 +122,151 @@ let multiRobotAInfo: (string | string[])[]; >multiSkillB : string[] >[] : undefined[] >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" [numberB = -1] = robotB; >[numberB = -1] = robotB : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotB : [number, string, string] [numberB = -1] = getRobotB(); >[numberB = -1] = getRobotB() : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >getRobotB() : [number, string, string] >getRobotB : () => [number, string, string] [numberB = -1] = [2, "trimmer", "trimming"]; >[numberB = -1] = [2, "trimmer", "trimming"] : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [nameMB = "helloNoName"] = multiRobotB; >[nameMB = "helloNoName"] = multiRobotB : [string, string[]] >[nameMB = "helloNoName"] : [string] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >multiRobotB : [string, string[]] [nameMB = "helloNoName"] = getMultiRobotB(); >[nameMB = "helloNoName"] = getMultiRobotB() : [string, string[]] >[nameMB = "helloNoName"] : [string] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >getMultiRobotB() : [string, string[]] >getMultiRobotB : () => [string, string[]] [nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; >[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]] : [string, string[]] >[nameMB = "helloNoName"] : [string] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" [numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB : [number, string, string] >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number ->nameB = "helloNoName" : string +>-1 : -1 +>1 : 1 +>nameB = "helloNoName" : "helloNoName" >nameB : string ->"helloNoName" : string ->skillB = "noSkill" : string +>"helloNoName" : "helloNoName" +>skillB = "noSkill" : "noSkill" >skillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >robotB : [number, string, string] [numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB() : [number, string, string] >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number ->nameB = "helloNoName" : string +>-1 : -1 +>1 : 1 +>nameB = "helloNoName" : "helloNoName" >nameB : string ->"helloNoName" : string ->skillB = "noSkill" : string +>"helloNoName" : "helloNoName" +>skillB = "noSkill" : "noSkill" >skillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >getRobotB() : [number, string, string] >getRobotB : () => [number, string, string] [numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"] : [number, string, string] >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number ->nameB = "helloNoName" : string +>-1 : -1 +>1 : 1 +>nameB = "helloNoName" : "helloNoName" >nameB : string ->"helloNoName" : string ->skillB = "noSkill" : string +>"helloNoName" : "helloNoName" +>skillB = "noSkill" : "noSkill" >skillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB : [string, string[]] >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] ->primarySkillB = "noSkill" : string +>primarySkillB = "noSkill" : "noSkill" >primarySkillB : string ->"noSkill" : string ->secondarySkillB = "noSkill" : string +>"noSkill" : "noSkill" +>secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >[] : [string, string] >multiRobotB : [string, string[]] [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB() : [string, string[]] >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] ->primarySkillB = "noSkill" : string +>primarySkillB = "noSkill" : "noSkill" >primarySkillB : string ->"noSkill" : string ->secondarySkillB = "noSkill" : string +>"noSkill" : "noSkill" +>secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >[] : [string, string] >getMultiRobotB() : [string, string[]] >getMultiRobotB : () => [string, string[]] @@ -274,33 +274,33 @@ let multiRobotAInfo: (string | string[])[]; [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] ->primarySkillB = "noSkill" : string +>primarySkillB = "noSkill" : "noSkill" >primarySkillB : string ->"noSkill" : string ->secondarySkillB = "noSkill" : string +>"noSkill" : "noSkill" +>secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >[] : [string, string] ["trimmer", ["trimming", "edging"]]; >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" [numberB = -1, ...robotAInfo] = robotB; >[numberB = -1, ...robotAInfo] = robotB : [number, string, string] >[numberB = -1, ...robotAInfo] : (string | number)[] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >robotB : [number, string, string] @@ -308,10 +308,10 @@ let multiRobotAInfo: (string | string[])[]; [numberB = -1, ...robotAInfo] = getRobotB(); >[numberB = -1, ...robotAInfo] = getRobotB() : [number, string, string] >[numberB = -1, ...robotAInfo] : (string | number)[] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >getRobotB() : [number, string, string] @@ -320,18 +320,18 @@ let multiRobotAInfo: (string | string[])[]; [numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; >[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] >[numberB = -1, ...robotAInfo] : (string | number)[] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" if (nameA == nameB) { >nameA == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types index 0ad3330e867c4..fbce7dedef15a 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types @@ -17,53 +17,53 @@ declare var console: { } var hello = "hello"; >hello : string ->"hello" : string +>"hello" : "hello" var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" var robotB: Robot = { name: "trimmer", skill: "trimming" }; >robotB : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" var { name: nameA = "" } = robotA; >name : any >nameA : string ->"" : string +>"" : "" >robotA : Robot var { name: nameB = "", skill: skillB = "" } = robotB; >name : any >nameB : string ->"" : string +>"" : "" >skill : any >skillB : string ->"" : string +>"" : "" >robotB : Robot var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; >name : any >nameC : string ->"" : string +>"" : "" >skill : any >skillC : string ->"" : string +>"" : "" >{ name: "Edger", skill: "cutting edges" } : { name?: string; skill?: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" if (nameA == nameB) { >nameA == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types index 1101b01b1a720..cf60c4a515fb9 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types @@ -28,26 +28,26 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >Robot : Robot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; >robotB : Robot >Robot : Robot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; >skills : any @@ -77,13 +77,13 @@ var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { na >secondaryB : string >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" if (nameB == nameB) { >nameB == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types index e3fdec193390d..fa007d9a2fc3b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types @@ -28,26 +28,26 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >Robot : Robot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; >robotB : Robot >Robot : Robot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" var { skills: { @@ -56,19 +56,19 @@ var { primary: primaryA = "noSkill", >primary : any >primaryA : string ->"noSkill" : string +>"noSkill" : "noSkill" secondary: secondaryA = "noSkill" >secondary : any >secondaryA : string ->"noSkill" : string +>"noSkill" : "noSkill" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } = robotA; >robotA : Robot @@ -77,7 +77,7 @@ var { name: nameB = "noNameSpecified", >name : any >nameB : string ->"noNameSpecified" : string +>"noNameSpecified" : "noNameSpecified" skills: { >skills : any @@ -85,19 +85,19 @@ var { primary: primaryB = "noSkill", >primary : any >primaryB : string ->"noSkill" : string +>"noSkill" : "noSkill" secondary: secondaryB = "noSkill" >secondary : any >secondaryB : string ->"noSkill" : string +>"noSkill" : "noSkill" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } = robotB; >robotB : Robot @@ -106,7 +106,7 @@ var { name: nameC = "noNameSpecified", >name : any >nameC : string ->"noNameSpecified" : string +>"noNameSpecified" : "noNameSpecified" skills: { >skills : any @@ -114,32 +114,32 @@ var { primary: primaryB = "noSkill", >primary : any >primaryB : string ->"noSkill" : string +>"noSkill" : "noSkill" secondary: secondaryB = "noSkill" >secondary : any >secondaryB : string ->"noSkill" : string +>"noSkill" : "noSkill" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : Robot >Robot : Robot >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" if (nameB == nameB) { >nameB == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.types index c975a9eaae55b..14995bbe1c9bc 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.types @@ -4,5 +4,5 @@ var {x} = { x: 20 }; >x : number >{ x: 20 } : { x: number; } >x : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.types index a694d4ecd29c6..52a5484052c18 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.types @@ -4,14 +4,14 @@ var {x} = { x: 20 }; >x : number >{ x: 20 } : { x: number; } >x : number ->20 : number +>20 : 20 var { a, b } = { a: 30, b: 40 }; >a : number >b : number >{ a: 30, b: 40 } : { a: number; b: number; } >a : number ->30 : number +>30 : 30 >b : number ->40 : number +>40 : 40 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types index bec1b195c9853..4b70fa8aa8dcd 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types @@ -2,8 +2,8 @@ var {x = 500} = { x: 20 }; >x : number ->500 : number +>500 : 500 >{ x: 20 } : { x?: number; } >x : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types index 1d00ac2d56b9a..1bd508ef2e55e 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types @@ -2,13 +2,13 @@ var {x = 500, >x : number ->500 : number +>500 : 500 y} = { x: 20, y: "hi" }; >y : string >{ x: 20, y: "hi" } : { x?: number; y: string; } >x : number ->20 : number +>20 : 20 >y : string ->"hi" : string +>"hi" : "hi" diff --git a/tests/baselines/reference/sourceMapValidationDo.types b/tests/baselines/reference/sourceMapValidationDo.types index 7623a483fd13d..85716b8f8b824 100644 --- a/tests/baselines/reference/sourceMapValidationDo.types +++ b/tests/baselines/reference/sourceMapValidationDo.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationDo.ts === var i = 0; >i : number ->0 : number +>0 : 0 do { @@ -12,7 +12,7 @@ do } while (i < 10); >i < 10 : boolean >i : number ->10 : number +>10 : 10 do { i++; @@ -22,5 +22,5 @@ do { } while (i < 20); >i < 20 : boolean >i : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/sourceMapValidationFunctionExpressions.types b/tests/baselines/reference/sourceMapValidationFunctionExpressions.types index 9ddfd93b89dfa..d51798c084f5f 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionExpressions.types +++ b/tests/baselines/reference/sourceMapValidationFunctionExpressions.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationFunctionExpressions.ts === var greetings = 0; >greetings : number ->0 : number +>0 : 0 var greet = (greeting: string): number => { >greet : (greeting: string) => number @@ -18,7 +18,7 @@ var greet = (greeting: string): number => { greet("Hello"); >greet("Hello") : number >greet : (greeting: string) => number ->"Hello" : string +>"Hello" : "Hello" var incrGreetings = () => greetings++; >incrGreetings : () => number diff --git a/tests/baselines/reference/sourceMapValidationFunctions.types b/tests/baselines/reference/sourceMapValidationFunctions.types index 82cb550a8aa85..6a085996c5cd2 100644 --- a/tests/baselines/reference/sourceMapValidationFunctions.types +++ b/tests/baselines/reference/sourceMapValidationFunctions.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationFunctions.ts === var greetings = 0; >greetings : number ->0 : number +>0 : 0 function greet(greeting: string): number { >greet : (greeting: string) => number @@ -18,7 +18,7 @@ function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): >greet2 : (greeting: string, n?: number, x?: string, ...restParams: string[]) => number >greeting : string >n : number ->10 : number +>10 : 10 >x : string >restParams : string[] @@ -33,7 +33,7 @@ function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) >foo : (greeting: string, n?: number, x?: string, ...restParams: string[]) => void >greeting : string >n : number ->10 : number +>10 : 10 >x : string >restParams : string[] { diff --git a/tests/baselines/reference/sourceMapValidationIfElse.types b/tests/baselines/reference/sourceMapValidationIfElse.types index 2b195983f217b..b4a76d5564738 100644 --- a/tests/baselines/reference/sourceMapValidationIfElse.types +++ b/tests/baselines/reference/sourceMapValidationIfElse.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationIfElse.ts === var i = 10; >i : number ->10 : number +>10 : 10 if (i == 10) { >i == 10 : boolean @@ -41,7 +41,7 @@ else if (i == 20) { i += 70; >i += 70 : number >i : number ->70 : number +>70 : 70 } else { i--; diff --git a/tests/baselines/reference/sourceMapValidationLabeled.types b/tests/baselines/reference/sourceMapValidationLabeled.types index 7af624ac93b00..6756494a5c75c 100644 --- a/tests/baselines/reference/sourceMapValidationLabeled.types +++ b/tests/baselines/reference/sourceMapValidationLabeled.types @@ -5,5 +5,5 @@ x: var b = 10; >b : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/sourceMapValidationModule.types b/tests/baselines/reference/sourceMapValidationModule.types index 2c65327065011..45651200300e3 100644 --- a/tests/baselines/reference/sourceMapValidationModule.types +++ b/tests/baselines/reference/sourceMapValidationModule.types @@ -4,7 +4,7 @@ module m2 { var a = 10; >a : number ->10 : number +>10 : 10 a++; >a++ : number @@ -18,7 +18,7 @@ module m3 { export var x = 30; >x : number ->30 : number +>30 : 30 } export function foo() { diff --git a/tests/baselines/reference/sourceMapValidationSwitch.types b/tests/baselines/reference/sourceMapValidationSwitch.types index 1c0a73c1bbe11..9df86ee213251 100644 --- a/tests/baselines/reference/sourceMapValidationSwitch.types +++ b/tests/baselines/reference/sourceMapValidationSwitch.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationSwitch.ts === var x = 10; >x : number ->10 : number +>10 : 10 switch (x) { >x : number @@ -29,7 +29,7 @@ switch (x) { >x : number >x *10 : number >x : number ->10 : number +>10 : 10 } switch (x) >x : number @@ -58,6 +58,6 @@ switch (x) >x : number >x * 10 : number >x : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/sourceMapValidationTryCatchFinally.types b/tests/baselines/reference/sourceMapValidationTryCatchFinally.types index 9159ee5aa45f9..7d7fb1d3aa9c4 100644 --- a/tests/baselines/reference/sourceMapValidationTryCatchFinally.types +++ b/tests/baselines/reference/sourceMapValidationTryCatchFinally.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationTryCatchFinally.ts === var x = 10; >x : number ->10 : number +>10 : 10 try { x = x + 1; @@ -9,7 +9,7 @@ try { >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 } catch (e) { >e : any @@ -19,7 +19,7 @@ try { >x : number >x - 1 : number >x : number ->1 : number +>1 : 1 } finally { x = x * 10; @@ -27,7 +27,7 @@ try { >x : number >x * 10 : number >x : number ->10 : number +>10 : 10 } try { @@ -36,7 +36,7 @@ try >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 throw new Error(); >new Error() : Error @@ -50,7 +50,7 @@ catch (e) >x : number >x - 1 : number >x : number ->1 : number +>1 : 1 } finally { @@ -59,5 +59,5 @@ finally >x : number >x * 10 : number >x : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/sourceMapValidationVariables.types b/tests/baselines/reference/sourceMapValidationVariables.types index 2bacc7b526f50..5dc46f5e79236 100644 --- a/tests/baselines/reference/sourceMapValidationVariables.types +++ b/tests/baselines/reference/sourceMapValidationVariables.types @@ -1,19 +1,19 @@ === tests/cases/compiler/sourceMapValidationVariables.ts === var a = 10; >a : number ->10 : number +>10 : 10 var b; >b : any var c = 10, d, e; >c : number ->10 : number +>10 : 10 >d : any >e : any var c2, d2 = 10; >c2 : any >d2 : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/sourceMapValidationWhile.types b/tests/baselines/reference/sourceMapValidationWhile.types index 86cf021627694..71b50d86736cc 100644 --- a/tests/baselines/reference/sourceMapValidationWhile.types +++ b/tests/baselines/reference/sourceMapValidationWhile.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationWhile.ts === var a = 10; >a : number ->10 : number +>10 : 10 while (a == 10) { >a == 10 : boolean diff --git a/tests/baselines/reference/sourceMapValidationWithComments.types b/tests/baselines/reference/sourceMapValidationWithComments.types index 26971f0aaab1f..3e4b4639754df 100644 --- a/tests/baselines/reference/sourceMapValidationWithComments.types +++ b/tests/baselines/reference/sourceMapValidationWithComments.types @@ -8,7 +8,7 @@ class DebugClass { // Start Debugger Test Code var i = 0; >i : number ->0 : number +>0 : 0 i++; >i++ : number @@ -50,6 +50,6 @@ class DebugClass { return true; ->true : boolean +>true : true } } diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.types b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.types index 8e9cda7377a31..7c7cbc4e59929 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.types +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.types @@ -19,11 +19,11 @@ var x = { a: 10, >a : number ->10 : number +>10 : 10 b: 20 >b : number ->20 : number +>20 : 20 }; diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types index 561be8ce78316..d3a26c4114e9e 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types @@ -4,7 +4,7 @@ module M { export var X = 1; >X : number ->1 : number +>1 : 1 } interface Navigator { >Navigator : Navigator diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.types b/tests/baselines/reference/sourcemapValidationDuplicateNames.types index ccc6caa23b413..3798144f3afcb 100644 --- a/tests/baselines/reference/sourcemapValidationDuplicateNames.types +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.types @@ -4,7 +4,7 @@ module m1 { var x = 10; >x : number ->10 : number +>10 : 10 export class c { >c : c diff --git a/tests/baselines/reference/specializeVarArgs1.types b/tests/baselines/reference/specializeVarArgs1.types index 97b46876e6687..68e1be49d5e63 100644 --- a/tests/baselines/reference/specializeVarArgs1.types +++ b/tests/baselines/reference/specializeVarArgs1.types @@ -41,5 +41,5 @@ a.push('Some Value'); >a.push : (...values: string[]) => any >a : ObservableArray >push : (...values: string[]) => any ->'Some Value' : string +>'Some Value' : "Some Value" diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index 61b499e0aee7a..cf294de778075 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,4): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,4): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,4): error TS2 // both are errors x3(1, (x: string) => 1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. x3(1, (x: 'hm') => 1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types index ba720d78612fc..f2bd83674cd64 100644 --- a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types +++ b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types @@ -24,7 +24,7 @@ let y: number = outer(5).y; >outer(5).y : number >outer(5) : typeof Inner >outer : (x: T) => typeof Inner ->5 : number +>5 : 5 >y : number class ListWrapper2 { @@ -42,7 +42,7 @@ class ListWrapper2 { >array.slice : (start?: number, end?: number) => T[] >array : T[] >slice : (start?: number, end?: number) => T[] ->0 : number +>0 : 0 static reversed(dit: typeof ListWrapper2, array: T[]): T[] { >reversed : (dit: typeof ListWrapper2, array: T[]) => T[] @@ -92,7 +92,7 @@ namespace tessst { for (let i = 0, len = array.length; i < len; i++) { >i : number ->0 : number +>0 : 0 >len : number >array.length : number >array : T[] @@ -171,7 +171,7 @@ class ListWrapper { >array.slice : (start?: number, end?: number) => T[] >array : T[] >slice : (start?: number, end?: number) => T[] ->0 : number +>0 : 0 static forEachWithIndex(dit: typeof ListWrapper, array: T[], fn: (t: T, n: number) => void) { >forEachWithIndex : (dit: typeof ListWrapper, array: T[], fn: (t: T, n: number) => void) => void @@ -187,7 +187,7 @@ class ListWrapper { for (var i = 0; i < array.length; i++) { >i : number ->0 : number +>0 : 0 >i < array.length : boolean >i : number >array.length : number @@ -222,7 +222,7 @@ class ListWrapper { return array[0]; >array[0] : T >array : T[] ->0 : number +>0 : 0 } static last(dit: typeof ListWrapper, array: T[]): T { >last : (dit: typeof ListWrapper, array: T[]) => T @@ -251,7 +251,7 @@ class ListWrapper { >array.length : number >array : T[] >length : number ->1 : number +>1 : 1 } static indexOf(dit: typeof ListWrapper, array: T[], value: T, startIndex: number = 0): number { >indexOf : (dit: typeof ListWrapper, array: T[], value: T, startIndex?: number) => number @@ -263,7 +263,7 @@ class ListWrapper { >value : T >T : T >startIndex : number ->0 : number +>0 : 0 return array.indexOf(value, startIndex); >array.indexOf(value, startIndex) : number @@ -289,7 +289,7 @@ class ListWrapper { >indexOf : (searchElement: T, fromIndex?: number) => number >el : T >-1 : -1 ->1 : number +>1 : 1 static reversed(dit: typeof ListWrapper, array: T[]): T[] { >reversed : (dit: typeof ListWrapper, array: T[]) => T[] @@ -318,8 +318,8 @@ class ListWrapper { >scanner.scanRange : (start: number, length: number, callback: () => T) => T >scanner : Scanner >scanRange : (start: number, length: number, callback: () => T) => T ->3 : number ->5 : number +>3 : 3 +>5 : 5 >() => { } : () => void return tessst.funkyFor(array, t => t.toString()) ? a.reverse() : a; @@ -368,7 +368,7 @@ class ListWrapper { >list : T[] >splice : { (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; } >index : number ->0 : number +>0 : 0 >value : T static removeAt(dit: typeof ListWrapper, list: T[], index: number): T { @@ -393,7 +393,7 @@ class ListWrapper { >list : T[] >splice : { (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; } >index : number ->1 : number +>1 : 1 return res; >res : T @@ -410,7 +410,7 @@ class ListWrapper { for (var i = 0; i < items.length; ++i) { >i : number ->0 : number +>0 : 0 >i < items.length : boolean >i : number >items.length : number @@ -435,7 +435,7 @@ class ListWrapper { >list : T[] >splice : { (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; } >index : number ->1 : number +>1 : 1 } } static remove(dit: typeof ListWrapper, list: T[], el: T): boolean { @@ -459,8 +459,8 @@ class ListWrapper { if (index > -1) { >index > -1 : boolean >index : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 list.splice(index, 1); >list.splice(index, 1) : T[] @@ -468,7 +468,7 @@ class ListWrapper { >list : T[] >splice : { (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; } >index : number ->1 : number +>1 : 1 return true; >true : true @@ -481,11 +481,11 @@ class ListWrapper { >dit : typeof ListWrapper >ListWrapper : typeof ListWrapper >list : any[] ->list.length = 0 : number +>list.length = 0 : 0 >list.length : number >list : any[] >length : number ->0 : number +>0 : 0 static isEmpty(dit: typeof ListWrapper, list: any[]): boolean { return list.length == 0; } >isEmpty : (dit: typeof ListWrapper, list: any[]) => boolean @@ -505,7 +505,7 @@ class ListWrapper { >list : any[] >value : any >start : number ->0 : number +>0 : 0 >end : number >null : null @@ -544,7 +544,7 @@ class ListWrapper { for (var i = 0; i < a.length; ++i) { >i : number ->0 : number +>0 : 0 >i < a.length : boolean >i : number >a.length : number @@ -574,7 +574,7 @@ class ListWrapper { >l : T[] >T : T >from : number ->0 : number +>0 : 0 >to : number >null : null >T : T @@ -701,7 +701,7 @@ class ListWrapper { for (var index = 0; index < list.length; index++) { >index : number ->0 : number +>0 : 0 >index < list.length : boolean >index : number >list.length : number @@ -757,10 +757,10 @@ let cloned = ListWrapper.clone(ListWrapper, [1,2,3,4]); >clone : (dit: typeof ListWrapper, array: T[]) => T[] >ListWrapper : typeof ListWrapper >[1,2,3,4] : number[] ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 declare function isBlank(x: any): boolean; >isBlank : (x: any) => boolean diff --git a/tests/baselines/reference/staticFactory1.types b/tests/baselines/reference/staticFactory1.types index 538728de2dff5..941dc6145592d 100644 --- a/tests/baselines/reference/staticFactory1.types +++ b/tests/baselines/reference/staticFactory1.types @@ -4,7 +4,7 @@ class Base { foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 static create() { >create : () => Base @@ -21,7 +21,7 @@ class Derived extends Base { foo() { return 2; } >foo : () => number ->2 : number +>2 : 2 } var d = Derived.create(); >d : Base diff --git a/tests/baselines/reference/staticInstanceResolution.types b/tests/baselines/reference/staticInstanceResolution.types index 255242252e3b8..1eb555487da82 100644 --- a/tests/baselines/reference/staticInstanceResolution.types +++ b/tests/baselines/reference/staticInstanceResolution.types @@ -18,7 +18,7 @@ class Comment { >comments[0].getDocCommentText : () => void >comments[0] : Comment >comments : Comment[] ->0 : number +>0 : 0 >getDocCommentText : () => void var c: Comment; diff --git a/tests/baselines/reference/staticInstanceResolution2.types b/tests/baselines/reference/staticInstanceResolution2.types index 200e3336a28a9..68abb3a08ce46 100644 --- a/tests/baselines/reference/staticInstanceResolution2.types +++ b/tests/baselines/reference/staticInstanceResolution2.types @@ -7,7 +7,7 @@ A.hasOwnProperty('foo'); >A.hasOwnProperty : (v: string) => boolean >A : typeof A >hasOwnProperty : (v: string) => boolean ->'foo' : string +>'foo' : "foo" class B { >B : B @@ -19,7 +19,7 @@ B.hasOwnProperty('foo'); >B.hasOwnProperty : (v: string) => boolean >B : typeof B >hasOwnProperty : (v: string) => boolean ->'foo' : string +>'foo' : "foo" diff --git a/tests/baselines/reference/staticInstanceResolution3.types b/tests/baselines/reference/staticInstanceResolution3.types index fe50c659f6d5c..2bc480b0ac80d 100644 --- a/tests/baselines/reference/staticInstanceResolution3.types +++ b/tests/baselines/reference/staticInstanceResolution3.types @@ -10,7 +10,7 @@ WinJS.Promise.timeout(10); >WinJS : typeof WinJS >Promise : typeof WinJS.Promise >timeout : (delay: number) => WinJS.Promise ->10 : number +>10 : 10 === tests/cases/compiler/staticInstanceResolution3_0.ts === export class Promise { diff --git a/tests/baselines/reference/staticMemberAccessOffDerivedType1.types b/tests/baselines/reference/staticMemberAccessOffDerivedType1.types index 55b9c83969b2a..8eaba4abb9830 100644 --- a/tests/baselines/reference/staticMemberAccessOffDerivedType1.types +++ b/tests/baselines/reference/staticMemberAccessOffDerivedType1.types @@ -6,7 +6,7 @@ class SomeBase { >GetNumber : () => number return 2; ->2 : number +>2 : 2 } } class P extends SomeBase { diff --git a/tests/baselines/reference/staticMemberInitialization.types b/tests/baselines/reference/staticMemberInitialization.types index 518b2fce25ff2..cb2c37f3fe092 100644 --- a/tests/baselines/reference/staticMemberInitialization.types +++ b/tests/baselines/reference/staticMemberInitialization.types @@ -4,7 +4,7 @@ class C { static x = 1; >x : number ->1 : number +>1 : 1 } var c = new C(); diff --git a/tests/baselines/reference/staticMemberWithStringAndNumberNames.types b/tests/baselines/reference/staticMemberWithStringAndNumberNames.types index e23ac90d59a26..b0826343d2085 100644 --- a/tests/baselines/reference/staticMemberWithStringAndNumberNames.types +++ b/tests/baselines/reference/staticMemberWithStringAndNumberNames.types @@ -3,44 +3,44 @@ class C { >C : C static "foo" = 0; ->0 : number +>0 : 0 static 0 = 1; ->1 : number +>1 : 1 x = C['foo']; >x : number >C['foo'] : number >C : typeof C ->'foo' : string +>'foo' : "foo" x2 = C['0']; >x2 : number >C['0'] : number >C : typeof C ->'0' : string +>'0' : "0" x3 = C[0]; >x3 : number >C[0] : number >C : typeof C ->0 : number +>0 : 0 static s = C['foo']; >s : number >C['foo'] : number >C : typeof C ->'foo' : string +>'foo' : "foo" static s2 = C['0']; >s2 : number >C['0'] : number >C : typeof C ->'0' : string +>'0' : "0" static s3 = C[0]; >s3 : number >C[0] : number >C : typeof C ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/stradac.types b/tests/baselines/reference/stradac.types index acdb54f45bded..b0b0cb895a2f0 100644 --- a/tests/baselines/reference/stradac.types +++ b/tests/baselines/reference/stradac.types @@ -1,7 +1,7 @@ === tests/cases/compiler/stradac.ts === var x = 10; >x : number ->10 : number +>10 : 10 // C++-style comment diff --git a/tests/baselines/reference/strictModeUseContextualKeyword.types b/tests/baselines/reference/strictModeUseContextualKeyword.types index a13e3d16ef85e..9c6a89a7321ee 100644 --- a/tests/baselines/reference/strictModeUseContextualKeyword.types +++ b/tests/baselines/reference/strictModeUseContextualKeyword.types @@ -1,10 +1,10 @@ === tests/cases/compiler/strictModeUseContextualKeyword.ts === "use strict" ->"use strict" : string +>"use strict" : "use strict" var as = 0; >as : number ->0 : number +>0 : 0 function foo(as: string) { } >foo : (as: string) => void @@ -29,6 +29,6 @@ function H() { >as : number >{ as: 1 } : { as: number; } >as : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/strictModeWordInExportDeclaration.types b/tests/baselines/reference/strictModeWordInExportDeclaration.types index aa5f8e84f8248..5064280bd31a1 100644 --- a/tests/baselines/reference/strictModeWordInExportDeclaration.types +++ b/tests/baselines/reference/strictModeWordInExportDeclaration.types @@ -1,10 +1,10 @@ === tests/cases/compiler/strictModeWordInExportDeclaration.ts === "use strict" ->"use strict" : string +>"use strict" : "use strict" var x = 1; >x : number ->1 : number +>1 : 1 export { x as foo } >x : number diff --git a/tests/baselines/reference/strictNullChecksNoWidening.types b/tests/baselines/reference/strictNullChecksNoWidening.types index 6dd2ee3fb4cfb..a544f9cef94a4 100644 --- a/tests/baselines/reference/strictNullChecksNoWidening.types +++ b/tests/baselines/reference/strictNullChecksNoWidening.types @@ -11,7 +11,7 @@ var a2 = undefined; var a3 = void 0; >a3 : undefined >void 0 : undefined ->0 : number +>0 : 0 var b1 = []; >b1 : never[] diff --git a/tests/baselines/reference/strictNullLogicalAndOr.types b/tests/baselines/reference/strictNullLogicalAndOr.types index ba25c57fe1d20..50eb6586a0f2e 100644 --- a/tests/baselines/reference/strictNullLogicalAndOr.types +++ b/tests/baselines/reference/strictNullLogicalAndOr.types @@ -9,7 +9,7 @@ let sinOrCos = Math.random() < .5; >Math.random : () => number >Math : Math >random : () => number ->.5 : number +>.5 : 0.5 let choice = sinOrCos && Math.sin || Math.cos; >choice : (x: number) => number @@ -44,7 +44,7 @@ function sq(n?: number): number { >n*n : number >n : number >n : number ->0 : number +>0 : 0 return r; >r : number @@ -53,5 +53,5 @@ function sq(n?: number): number { sq(3); >sq(3) : number >sq : (n?: number | undefined) => number ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/stringHasStringValuedNumericIndexer.types b/tests/baselines/reference/stringHasStringValuedNumericIndexer.types index ce9504358eb0d..01f086ebbf434 100644 --- a/tests/baselines/reference/stringHasStringValuedNumericIndexer.types +++ b/tests/baselines/reference/stringHasStringValuedNumericIndexer.types @@ -2,6 +2,6 @@ var str: string = ""[0]; >str : string >""[0] : string ->"" : string ->0 : number +>"" : "" +>0 : 0 diff --git a/tests/baselines/reference/stringIncludes.types b/tests/baselines/reference/stringIncludes.types index 0d1e5ffea4df6..1dce85fcec708 100644 --- a/tests/baselines/reference/stringIncludes.types +++ b/tests/baselines/reference/stringIncludes.types @@ -8,17 +8,17 @@ includes = "abcde".includes("cd"); >includes : boolean >"abcde".includes("cd") : boolean >"abcde".includes : (searchString: string, position?: number) => boolean ->"abcde" : string +>"abcde" : "abcde" >includes : (searchString: string, position?: number) => boolean ->"cd" : string +>"cd" : "cd" includes = "abcde".includes("cd", 2); >includes = "abcde".includes("cd", 2) : boolean >includes : boolean >"abcde".includes("cd", 2) : boolean >"abcde".includes : (searchString: string, position?: number) => boolean ->"abcde" : string +>"abcde" : "abcde" >includes : (searchString: string, position?: number) => boolean ->"cd" : string ->2 : number +>"cd" : "cd" +>2 : 2 diff --git a/tests/baselines/reference/stringIndexingResults.types b/tests/baselines/reference/stringIndexingResults.types index 1fdc580b1a2cd..9d7c19f49cc4a 100644 --- a/tests/baselines/reference/stringIndexingResults.types +++ b/tests/baselines/reference/stringIndexingResults.types @@ -7,7 +7,7 @@ class C { y = ''; >y : string ->'' : string +>'' : "" } var c: C; @@ -18,19 +18,19 @@ var r1 = c['y']; >r1 : string >c['y'] : string >c : C ->'y' : string +>'y' : "y" var r2 = c['a']; >r2 : string >c['a'] : string >c : C ->'a' : string +>'a' : "a" var r3 = c[1]; >r3 : string >c[1] : string >c : C ->1 : number +>1 : 1 interface I { >I : I @@ -50,19 +50,19 @@ var r4 = i['y']; >r4 : string >i['y'] : string >i : I ->'y' : string +>'y' : "y" var r5 = i['a']; >r5 : string >i['a'] : string >i : I ->'a' : string +>'a' : "a" var r6 = i[1]; >r6 : string >i[1] : string >i : I ->1 : number +>1 : 1 var a: { >a : { [x: string]: string; y: string; } @@ -78,42 +78,42 @@ var r7 = a['y']; >r7 : string >a['y'] : string >a : { [x: string]: string; y: string; } ->'y' : string +>'y' : "y" var r8 = a['a']; >r8 : string >a['a'] : string >a : { [x: string]: string; y: string; } ->'a' : string +>'a' : "a" var r9 = a[1]; >r9 : string >a[1] : string >a : { [x: string]: string; y: string; } ->1 : number +>1 : 1 var b: { [x: string]: string } = { y: '' } >b : { [x: string]: string; } >x : string >{ y: '' } : { y: string; } >y : string ->'' : string +>'' : "" var r10 = b['y']; >r10 : string >b['y'] : string >b : { [x: string]: string; } ->'y' : string +>'y' : "y" var r11 = b['a']; >r11 : string >b['a'] : string >b : { [x: string]: string; } ->'a' : string +>'a' : "a" var r12 = b[1]; >r12 : string >b[1] : string >b : { [x: string]: string; } ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/stringLiteralCheckedInIf01.types b/tests/baselines/reference/stringLiteralCheckedInIf01.types index bbf83ebdaa6c7..2505870f9a934 100644 --- a/tests/baselines/reference/stringLiteralCheckedInIf01.types +++ b/tests/baselines/reference/stringLiteralCheckedInIf01.types @@ -36,6 +36,6 @@ function f(foo: T) { >foo as S[] : S[] >foo : S[] >S : S ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/stringLiteralCheckedInIf02.types b/tests/baselines/reference/stringLiteralCheckedInIf02.types index d8e0be2f0d9cf..6589c85222af9 100644 --- a/tests/baselines/reference/stringLiteralCheckedInIf02.types +++ b/tests/baselines/reference/stringLiteralCheckedInIf02.types @@ -42,6 +42,6 @@ function f(foo: T) { return foo[0]; >foo[0] : S >foo : S[] ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/stringLiteralMatchedInSwitch01.types b/tests/baselines/reference/stringLiteralMatchedInSwitch01.types index a0147779fd006..5f2d68d47cdaf 100644 --- a/tests/baselines/reference/stringLiteralMatchedInSwitch01.types +++ b/tests/baselines/reference/stringLiteralMatchedInSwitch01.types @@ -31,7 +31,7 @@ switch (foo) { >foo as S[] : S[] >foo : S[] >S : S ->0 : number +>0 : 0 break; } diff --git a/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.types b/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.types index 3f06c5eaa7528..7c4ea1c86bbc4 100644 --- a/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.types +++ b/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.types @@ -5,6 +5,6 @@ module m1 { export var n = { 'foo bar': 4 }; >n : { 'foo bar': number; } >{ 'foo bar': 4 } : { 'foo bar': number; } ->4 : number +>4 : 4 } diff --git a/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.types b/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.types index ee5b5b27b54bc..c5022b5463b6e 100644 --- a/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.types +++ b/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.types @@ -6,13 +6,13 @@ var x = {'text\ ': string; } ':'hello'} ->'hello' : string +>'hello' : "hello" x.text = "bar" ->x.text = "bar" : string +>x.text = "bar" : "bar" >x.text : string >x : { 'text\ ': string; } >text : string ->"bar" : string +>"bar" : "bar" diff --git a/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.errors.txt b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.errors.txt new file mode 100644 index 0000000000000..3a884d2d1c455 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts(6,5): error TS2322: Type 'string' is not assignable to type '"foo"'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts(8,5): error TS2322: Type 'string' is not assignable to type '"foo" | "bar"'. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts (2 errors) ==== + + declare function myRandBool(): boolean; + + let a: "foo" = "foo"; + let b = a || "foo"; + let c: "foo" = b; + ~ +!!! error TS2322: Type 'string' is not assignable to type '"foo"'. + let d = b || "bar"; + let e: "foo" | "bar" = d; + ~ +!!! error TS2322: Type 'string' is not assignable to type '"foo" | "bar"'. + \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js index 479256b18b7e5..b6bcaf7c887c1 100644 --- a/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js +++ b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js @@ -20,7 +20,7 @@ var e = d; //// [stringLiteralTypesAndLogicalOrExpressions01.d.ts] declare function myRandBool(): boolean; declare let a: "foo"; -declare let b: "foo"; +declare let b: string; declare let c: "foo"; -declare let d: "foo" | "bar"; +declare let d: string; declare let e: "foo" | "bar"; diff --git a/tests/baselines/reference/stringLiteralTypesAndTuples01.js b/tests/baselines/reference/stringLiteralTypesAndTuples01.js index b887213c8f6ad..4700cc65730dc 100644 --- a/tests/baselines/reference/stringLiteralTypesAndTuples01.js +++ b/tests/baselines/reference/stringLiteralTypesAndTuples01.js @@ -39,4 +39,4 @@ function rawr(dino) { declare let hello: string, brave: string, newish: string, world: string; declare type RexOrRaptor = "t-rex" | "raptor"; declare let im: "I'm", a: "a", dinosaur: RexOrRaptor; -declare function rawr(dino: RexOrRaptor): string; +declare function rawr(dino: RexOrRaptor): "ROAAAAR!" | "yip yip!"; diff --git a/tests/baselines/reference/stringLiteralTypesAndTuples01.types b/tests/baselines/reference/stringLiteralTypesAndTuples01.types index 10a30a6d75c94..f69e36cf541ca 100644 --- a/tests/baselines/reference/stringLiteralTypesAndTuples01.types +++ b/tests/baselines/reference/stringLiteralTypesAndTuples01.types @@ -7,10 +7,10 @@ let [hello, brave, newish, world] = ["Hello", "Brave", "New", "World"]; >newish : string >world : string >["Hello", "Brave", "New", "World"] : [string, string, string, string] ->"Hello" : string ->"Brave" : string ->"New" : string ->"World" : string +>"Hello" : "Hello" +>"Brave" : "Brave" +>"New" : "New" +>"World" : "World" type RexOrRaptor = "t-rex" | "raptor" >RexOrRaptor : RexOrRaptor @@ -26,12 +26,12 @@ let [im, a, dinosaur]: ["I'm", "a", RexOrRaptor] = ['I\'m', 'a', 't-rex']; >'t-rex' : "t-rex" rawr(dinosaur); ->rawr(dinosaur) : string ->rawr : (dino: RexOrRaptor) => string +>rawr(dinosaur) : "ROAAAAR!" | "yip yip!" +>rawr : (dino: RexOrRaptor) => "ROAAAAR!" | "yip yip!" >dinosaur : "t-rex" function rawr(dino: RexOrRaptor) { ->rawr : (dino: RexOrRaptor) => string +>rawr : (dino: RexOrRaptor) => "ROAAAAR!" | "yip yip!" >dino : RexOrRaptor >RexOrRaptor : RexOrRaptor @@ -41,7 +41,7 @@ function rawr(dino: RexOrRaptor) { >"t-rex" : "t-rex" return "ROAAAAR!"; ->"ROAAAAR!" : string +>"ROAAAAR!" : "ROAAAAR!" } if (dino === "raptor") { >dino === "raptor" : boolean @@ -49,11 +49,11 @@ function rawr(dino: RexOrRaptor) { >"raptor" : "raptor" return "yip yip!"; ->"yip yip!" : string +>"yip yip!" : "yip yip!" } throw "Unexpected " + dino; >"Unexpected " + dino : string ->"Unexpected " : string +>"Unexpected " : "Unexpected " >dino : never } diff --git a/tests/baselines/reference/stringLiteralTypesAsTags01.types b/tests/baselines/reference/stringLiteralTypesAsTags01.types index e95a7364f9340..ad53fb01c7987 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags01.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags01.types @@ -79,12 +79,12 @@ let x: A = { >{ kind: "A", a: 100,} : { kind: "A"; a: number; } kind: "A", ->kind : "A" +>kind : string >"A" : "A" a: 100, >a : number ->100 : number +>100 : 100 } if (hasKind(x, "A")) { diff --git a/tests/baselines/reference/stringLiteralTypesAsTags02.types b/tests/baselines/reference/stringLiteralTypesAsTags02.types index c984b8a78f9ba..2e2cb2831b666 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags02.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags02.types @@ -73,12 +73,12 @@ let x: A = { >{ kind: "A", a: 100,} : { kind: "A"; a: number; } kind: "A", ->kind : "A" +>kind : string >"A" : "A" a: 100, >a : number ->100 : number +>100 : 100 } if (hasKind(x, "A")) { diff --git a/tests/baselines/reference/stringLiteralTypesAsTags03.types b/tests/baselines/reference/stringLiteralTypesAsTags03.types index fbe71ff07c188..17507c1036fef 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags03.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags03.types @@ -76,12 +76,12 @@ let x: A = { >{ kind: "A", a: 100,} : { kind: "A"; a: number; } kind: "A", ->kind : "A" +>kind : string >"A" : "A" a: 100, >a : number ->100 : number +>100 : 100 } if (hasKind(x, "A")) { diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js index 4f49d326ec04f..805f16228ba9a 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js @@ -38,8 +38,8 @@ hResult = h("bar"); declare function foo(f: (x: T) => T): (x: T) => T; declare function bar(f: (x: T) => T): (x: T) => T; declare let f: (x: "foo") => "foo"; -declare let fResult: "foo"; +declare let fResult: string; declare let g: (x: "foo") => "foo"; -declare let gResult: "foo"; +declare let gResult: string; declare let h: (x: "foo" | "bar") => "foo" | "bar"; -declare let hResult: "foo" | "bar"; +declare let hResult: string; diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types index fe9163fc81911..e213faf3b6901 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types @@ -33,7 +33,7 @@ let f = foo(x => x); >x : "foo" let fResult = f("foo"); ->fResult : "foo" +>fResult : string >f("foo") : "foo" >f : (x: "foo") => "foo" >"foo" : "foo" @@ -48,7 +48,7 @@ let g = foo((x => x)); >x : "foo" let gResult = g("foo"); ->gResult : "foo" +>gResult : string >g("foo") : "foo" >g : (x: "foo") => "foo" >"foo" : "foo" @@ -62,14 +62,14 @@ let h = bar(x => x); >x : "foo" | "bar" let hResult = h("foo"); ->hResult : "foo" | "bar" +>hResult : string >h("foo") : "foo" | "bar" >h : (x: "foo" | "bar") => "foo" | "bar" >"foo" : "foo" hResult = h("bar"); >hResult = h("bar") : "foo" | "bar" ->hResult : "foo" | "bar" +>hResult : string >h("bar") : "foo" | "bar" >h : (x: "foo" | "bar") => "foo" | "bar" >"bar" : "bar" diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js index 173e74a6eef86..06ee42b68ad70 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js @@ -18,4 +18,4 @@ var fResult = f("foo"); //// [stringLiteralTypesAsTypeParameterConstraint02.d.ts] declare function foo(f: (x: T) => T): (x: T) => T; declare let f: (x: "foo") => "foo"; -declare let fResult: "foo"; +declare let fResult: string; diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.types b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.types index 3a1b8fdc05c83..75ba54cf6c231 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.types +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.types @@ -26,7 +26,7 @@ let f = foo((y: "foo" | "bar") => y === "foo" ? y : "foo"); >"foo" : "foo" let fResult = f("foo"); ->fResult : "foo" +>fResult : string >f("foo") : "foo" >f : (x: "foo") => "foo" >"foo" : "foo" diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.errors.txt b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.errors.txt new file mode 100644 index 0000000000000..39b2b154cc864 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.errors.txt @@ -0,0 +1,26 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes01.ts(16,9): error TS2322: Type 'string' is not assignable to type '"foo" | "bar" | "baz"'. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes01.ts (1 errors) ==== + + type T = "foo" | "bar" | "baz"; + + var x: "foo" | "bar" | "baz" = undefined; + var y: T = undefined; + + if (x === "foo") { + let a = x; + } + else if (x !== "bar") { + let b = x || y; + } + else { + let c = x; + let d = y; + let e: (typeof x) | (typeof y) = c || d; + ~ +!!! error TS2322: Type 'string' is not assignable to type '"foo" | "bar" | "baz"'. + } + + x = y; + y = x; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types index ab63a9e2fab36..40b34796e72bd 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types @@ -18,7 +18,7 @@ if (x === "foo") { >"foo" : "foo" let a = x; ->a : string | "foo" +>a : string >x : string | "foo" } else if (x !== "bar") { @@ -34,11 +34,11 @@ else if (x !== "bar") { } else { let c = x; ->c : string | "bar" +>c : string >x : string | "bar" let d = y; ->d : string | "foo" | "bar" | "baz" +>d : string >y : string | "foo" | "bar" | "baz" let e: (typeof x) | (typeof y) = c || d; @@ -46,8 +46,8 @@ else { >x : string | "bar" >y : string | "foo" | "bar" | "baz" >c || d : string ->c : string | "bar" ->d : string | "foo" | "bar" | "baz" +>c : string +>d : string } x = y; diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.errors.txt b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.errors.txt new file mode 100644 index 0000000000000..784f368c164e3 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.errors.txt @@ -0,0 +1,28 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes03.ts(16,9): error TS2322: Type 'string | number' is not assignable to type 'number | "foo" | "bar"'. + Type 'string' is not assignable to type 'number | "foo" | "bar"'. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes03.ts (1 errors) ==== + + type T = number | "foo" | "bar"; + + var x: "foo" | "bar" | number; + var y: T = undefined; + + if (x === "foo") { + let a = x; + } + else if (x !== "bar") { + let b = x || y; + } + else { + let c = x; + let d = y; + let e: (typeof x) | (typeof y) = c || d; + ~ +!!! error TS2322: Type 'string | number' is not assignable to type 'number | "foo" | "bar"'. +!!! error TS2322: Type 'string' is not assignable to type 'number | "foo" | "bar"'. + } + + x = y; + y = x; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types index 05b6b9b9b7aed..3d2a41ec5c9ee 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types @@ -19,7 +19,7 @@ if (x === "") { >"" : "" let a = x; ->a : "" +>a : string >x : "" } @@ -29,7 +29,7 @@ if (x !== "") { >"" : "" let b = x; ->b : "foo" +>b : string >x : "foo" } @@ -39,7 +39,7 @@ if (x == "") { >"" : "" let c = x; ->c : "" +>c : string >x : "" } @@ -49,7 +49,7 @@ if (x != "") { >"" : "" let d = x; ->d : "foo" +>d : string >x : "foo" } @@ -57,7 +57,7 @@ if (x) { >x : T let e = x; ->e : "foo" +>e : string >x : "foo" } @@ -66,7 +66,7 @@ if (!x) { >x : T let f = x; ->f : T +>f : string >x : T } @@ -76,7 +76,7 @@ if (!!x) { >x : T let g = x; ->g : "foo" +>g : string >x : "foo" } @@ -87,6 +87,6 @@ if (!!!x) { >x : T let h = x; ->h : T +>h : string >x : T } diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.types b/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.types index 8150eedd7b81a..00af8e6837397 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.types +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.types @@ -9,7 +9,7 @@ function f(x: string): number { >x : string return 0; ->0 : number +>0 : 0 } function g(x: "foo"): number; @@ -21,7 +21,7 @@ function g(x: string): number { >x : string return 0; ->0 : number +>0 : 0 } let a = f; diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.types b/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.types index 7187e276fe4b0..694a300d3d37d 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.types +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.types @@ -9,7 +9,7 @@ function f(x: "foo"): number { >x : "foo" return 0; ->0 : number +>0 : 0 } function g(x: "foo"): number; @@ -21,7 +21,7 @@ function g(x: "foo"): number { >x : "foo" return 0; ->0 : number +>0 : 0 } let a = f; diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.types b/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.types index b7dd9262a67bc..925d254741154 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.types +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.types @@ -13,7 +13,7 @@ function f(x: string): number { >x : string return 0; ->0 : number +>0 : 0 } function g(x: "foo"): number; @@ -25,7 +25,7 @@ function g(x: string): number { >x : string return 0; ->0 : number +>0 : 0 } let a = f; diff --git a/tests/baselines/reference/stringLiteralTypesOverloads01.types b/tests/baselines/reference/stringLiteralTypesOverloads01.types index 6a46c7676f745..2a0bc61f3e8bb 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads01.types +++ b/tests/baselines/reference/stringLiteralTypesOverloads01.types @@ -42,7 +42,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { >"string" : "string" return ""; ->"" : string +>"" : "" } if (x === "number") { >x === "number" : boolean @@ -50,7 +50,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { >"number" : "number" return 0; ->0 : number +>0 : 0 } if (x === "boolean") { >x === "boolean" : boolean @@ -63,7 +63,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { // Should be unreachable. throw "Invalid value"; ->"Invalid value" : string +>"Invalid value" : "Invalid value" } namespace Consts1 { diff --git a/tests/baselines/reference/stringLiteralTypesOverloads02.errors.txt b/tests/baselines/reference/stringLiteralTypesOverloads02.errors.txt deleted file mode 100644 index 995cf687b702c..0000000000000 --- a/tests/baselines/reference/stringLiteralTypesOverloads02.errors.txt +++ /dev/null @@ -1,57 +0,0 @@ -tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts(9,10): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts (1 errors) ==== - - function getFalsyPrimitive(x: "string"): string; - function getFalsyPrimitive(x: "number"): number; - function getFalsyPrimitive(x: "boolean"): boolean; - function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; - function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; - function getFalsyPrimitive(x: "number" | "string"): number | string; - function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; - function getFalsyPrimitive(x: string) { - ~~~~~~~~~~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. - if (x === "string") { - return ""; - } - if (x === "number") { - return 0; - } - if (x === "boolean") { - return false; - } - - // Should be unreachable. - throw "Invalid value"; - } - - namespace Consts1 { - const EMPTY_STRING = getFalsyPrimitive("string"); - const ZERO = getFalsyPrimitive('number'); - const FALSE = getFalsyPrimitive("boolean"); - } - - const string: "string" = "string" - const number: "number" = "number" - const boolean: "boolean" = "boolean" - - const stringOrNumber = string || number; - const stringOrBoolean = string || boolean; - const booleanOrNumber = number || boolean; - const stringOrBooleanOrNumber = stringOrBoolean || number; - - namespace Consts2 { - const EMPTY_STRING = getFalsyPrimitive(string); - const ZERO = getFalsyPrimitive(number); - const FALSE = getFalsyPrimitive(boolean); - - const a = getFalsyPrimitive(stringOrNumber); - const b = getFalsyPrimitive(stringOrBoolean); - const c = getFalsyPrimitive(booleanOrNumber); - const d = getFalsyPrimitive(stringOrBooleanOrNumber); - } - - - \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesOverloads02.js b/tests/baselines/reference/stringLiteralTypesOverloads02.js index 45443ea6a8fa3..0e7bd8c82c81e 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads02.js +++ b/tests/baselines/reference/stringLiteralTypesOverloads02.js @@ -7,7 +7,7 @@ function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; function getFalsyPrimitive(x: "number" | "string"): number | string; function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; -function getFalsyPrimitive(x: string) { +function getFalsyPrimitive(x: string): string | number | boolean { if (x === "string") { return ""; } @@ -28,9 +28,9 @@ namespace Consts1 { const FALSE = getFalsyPrimitive("boolean"); } -const string: "string" = "string" -const number: "number" = "number" -const boolean: "boolean" = "boolean" +const string = "string" +const number = "number" +const boolean = "boolean" const stringOrNumber = string || number; const stringOrBoolean = string || boolean; diff --git a/tests/baselines/reference/stringLiteralTypesOverloads02.symbols b/tests/baselines/reference/stringLiteralTypesOverloads02.symbols new file mode 100644 index 0000000000000..1bbedacf8a5e7 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads02.symbols @@ -0,0 +1,140 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts === + +function getFalsyPrimitive(x: "string"): string; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 1, 27)) + +function getFalsyPrimitive(x: "number"): number; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 2, 27)) + +function getFalsyPrimitive(x: "boolean"): boolean; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 3, 27)) + +function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 4, 27)) + +function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 5, 27)) + +function getFalsyPrimitive(x: "number" | "string"): number | string; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 6, 27)) + +function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 7, 27)) + +function getFalsyPrimitive(x: string): string | number | boolean { +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 8, 27)) + + if (x === "string") { +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 8, 27)) + + return ""; + } + if (x === "number") { +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 8, 27)) + + return 0; + } + if (x === "boolean") { +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 8, 27)) + + return false; + } + + // Should be unreachable. + throw "Invalid value"; +} + +namespace Consts1 { +>Consts1 : Symbol(Consts1, Decl(stringLiteralTypesOverloads02.ts, 21, 1)) + + const EMPTY_STRING = getFalsyPrimitive("string"); +>EMPTY_STRING : Symbol(EMPTY_STRING, Decl(stringLiteralTypesOverloads02.ts, 24, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) + + const ZERO = getFalsyPrimitive('number'); +>ZERO : Symbol(ZERO, Decl(stringLiteralTypesOverloads02.ts, 25, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) + + const FALSE = getFalsyPrimitive("boolean"); +>FALSE : Symbol(FALSE, Decl(stringLiteralTypesOverloads02.ts, 26, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +} + +const string = "string" +>string : Symbol(string, Decl(stringLiteralTypesOverloads02.ts, 29, 5)) + +const number = "number" +>number : Symbol(number, Decl(stringLiteralTypesOverloads02.ts, 30, 5)) + +const boolean = "boolean" +>boolean : Symbol(boolean, Decl(stringLiteralTypesOverloads02.ts, 31, 5)) + +const stringOrNumber = string || number; +>stringOrNumber : Symbol(stringOrNumber, Decl(stringLiteralTypesOverloads02.ts, 33, 5)) +>string : Symbol(string, Decl(stringLiteralTypesOverloads02.ts, 29, 5)) +>number : Symbol(number, Decl(stringLiteralTypesOverloads02.ts, 30, 5)) + +const stringOrBoolean = string || boolean; +>stringOrBoolean : Symbol(stringOrBoolean, Decl(stringLiteralTypesOverloads02.ts, 34, 5)) +>string : Symbol(string, Decl(stringLiteralTypesOverloads02.ts, 29, 5)) +>boolean : Symbol(boolean, Decl(stringLiteralTypesOverloads02.ts, 31, 5)) + +const booleanOrNumber = number || boolean; +>booleanOrNumber : Symbol(booleanOrNumber, Decl(stringLiteralTypesOverloads02.ts, 35, 5)) +>number : Symbol(number, Decl(stringLiteralTypesOverloads02.ts, 30, 5)) +>boolean : Symbol(boolean, Decl(stringLiteralTypesOverloads02.ts, 31, 5)) + +const stringOrBooleanOrNumber = stringOrBoolean || number; +>stringOrBooleanOrNumber : Symbol(stringOrBooleanOrNumber, Decl(stringLiteralTypesOverloads02.ts, 36, 5)) +>stringOrBoolean : Symbol(stringOrBoolean, Decl(stringLiteralTypesOverloads02.ts, 34, 5)) +>number : Symbol(number, Decl(stringLiteralTypesOverloads02.ts, 30, 5)) + +namespace Consts2 { +>Consts2 : Symbol(Consts2, Decl(stringLiteralTypesOverloads02.ts, 36, 58)) + + const EMPTY_STRING = getFalsyPrimitive(string); +>EMPTY_STRING : Symbol(EMPTY_STRING, Decl(stringLiteralTypesOverloads02.ts, 39, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>string : Symbol(string, Decl(stringLiteralTypesOverloads02.ts, 29, 5)) + + const ZERO = getFalsyPrimitive(number); +>ZERO : Symbol(ZERO, Decl(stringLiteralTypesOverloads02.ts, 40, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>number : Symbol(number, Decl(stringLiteralTypesOverloads02.ts, 30, 5)) + + const FALSE = getFalsyPrimitive(boolean); +>FALSE : Symbol(FALSE, Decl(stringLiteralTypesOverloads02.ts, 41, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>boolean : Symbol(boolean, Decl(stringLiteralTypesOverloads02.ts, 31, 5)) + + const a = getFalsyPrimitive(stringOrNumber); +>a : Symbol(a, Decl(stringLiteralTypesOverloads02.ts, 43, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>stringOrNumber : Symbol(stringOrNumber, Decl(stringLiteralTypesOverloads02.ts, 33, 5)) + + const b = getFalsyPrimitive(stringOrBoolean); +>b : Symbol(b, Decl(stringLiteralTypesOverloads02.ts, 44, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>stringOrBoolean : Symbol(stringOrBoolean, Decl(stringLiteralTypesOverloads02.ts, 34, 5)) + + const c = getFalsyPrimitive(booleanOrNumber); +>c : Symbol(c, Decl(stringLiteralTypesOverloads02.ts, 45, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>booleanOrNumber : Symbol(booleanOrNumber, Decl(stringLiteralTypesOverloads02.ts, 35, 5)) + + const d = getFalsyPrimitive(stringOrBooleanOrNumber); +>d : Symbol(d, Decl(stringLiteralTypesOverloads02.ts, 46, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>stringOrBooleanOrNumber : Symbol(stringOrBooleanOrNumber, Decl(stringLiteralTypesOverloads02.ts, 36, 5)) +} + + + diff --git a/tests/baselines/reference/stringLiteralTypesOverloads02.types b/tests/baselines/reference/stringLiteralTypesOverloads02.types new file mode 100644 index 0000000000000..7122929e85da5 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads02.types @@ -0,0 +1,170 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts === + +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: "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: "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: "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: "string" | "boolean"): string | boolean; (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: "number" | "boolean"): number | boolean; (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: "string" | "number"): string | number; (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: "string" | "number" | "boolean"): string | number | boolean; } +>x : "string" | "number" | "boolean" + +function getFalsyPrimitive(x: string): 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 + + if (x === "string") { +>x === "string" : boolean +>x : string +>"string" : "string" + + return ""; +>"" : "" + } + if (x === "number") { +>x === "number" : boolean +>x : string +>"number" : "number" + + return 0; +>0 : 0 + } + if (x === "boolean") { +>x === "boolean" : boolean +>x : string +>"boolean" : "boolean" + + return false; +>false : false + } + + // Should be unreachable. + throw "Invalid value"; +>"Invalid value" : "Invalid value" +} + +namespace Consts1 { +>Consts1 : typeof 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: "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: "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: "string" | "number" | "boolean"): string | number | boolean; } +>"boolean" : "boolean" +} + +const string = "string" +>string : "string" +>"string" : "string" + +const number = "number" +>number : "number" +>"number" : "number" + +const boolean = "boolean" +>boolean : "boolean" +>"boolean" : "boolean" + +const stringOrNumber = string || number; +>stringOrNumber : "string" | "number" +>string || number : "string" | "number" +>string : "string" +>number : "number" + +const stringOrBoolean = string || boolean; +>stringOrBoolean : "string" | "boolean" +>string || boolean : "string" | "boolean" +>string : "string" +>boolean : "boolean" + +const booleanOrNumber = number || boolean; +>booleanOrNumber : "number" | "boolean" +>number || boolean : "number" | "boolean" +>number : "number" +>boolean : "boolean" + +const stringOrBooleanOrNumber = stringOrBoolean || number; +>stringOrBooleanOrNumber : "string" | "number" | "boolean" +>stringOrBoolean || number : "string" | "number" | "boolean" +>stringOrBoolean : "string" | "boolean" +>number : "number" + +namespace Consts2 { +>Consts2 : typeof 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: "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: "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: "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: "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: "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: "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: "string" | "number" | "boolean"): string | number | boolean; } +>stringOrBooleanOrNumber : "string" | "number" | "boolean" +} + + + diff --git a/tests/baselines/reference/stringLiteralTypesOverloads04.js b/tests/baselines/reference/stringLiteralTypesOverloads04.js index fd10ac986a9d5..81e123c3e57b3 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads04.js +++ b/tests/baselines/reference/stringLiteralTypesOverloads04.js @@ -3,7 +3,7 @@ declare function f(x: (p: "foo" | "bar") => "foo"); f(y => { - let z = y = "foo"; + const z = y = "foo"; return z; }) diff --git a/tests/baselines/reference/stringLiteralTypesOverloads04.symbols b/tests/baselines/reference/stringLiteralTypesOverloads04.symbols index 9f468b8bd9502..de1951d325a95 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads04.symbols +++ b/tests/baselines/reference/stringLiteralTypesOverloads04.symbols @@ -9,11 +9,11 @@ f(y => { >f : Symbol(f, Decl(stringLiteralTypesOverloads04.ts, 0, 0)) >y : Symbol(y, Decl(stringLiteralTypesOverloads04.ts, 3, 2)) - let z = y = "foo"; ->z : Symbol(z, Decl(stringLiteralTypesOverloads04.ts, 4, 7)) + const z = y = "foo"; +>z : Symbol(z, Decl(stringLiteralTypesOverloads04.ts, 4, 9)) >y : Symbol(y, Decl(stringLiteralTypesOverloads04.ts, 3, 2)) return z; ->z : Symbol(z, Decl(stringLiteralTypesOverloads04.ts, 4, 7)) +>z : Symbol(z, Decl(stringLiteralTypesOverloads04.ts, 4, 9)) }) diff --git a/tests/baselines/reference/stringLiteralTypesOverloads04.types b/tests/baselines/reference/stringLiteralTypesOverloads04.types index 32d316494ca5e..8cb8b2a7ceab2 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads04.types +++ b/tests/baselines/reference/stringLiteralTypesOverloads04.types @@ -6,12 +6,12 @@ declare function f(x: (p: "foo" | "bar") => "foo"); >p : "foo" | "bar" f(y => { ->f(y => { let z = y = "foo"; return z;}) : any +>f(y => { const z = y = "foo"; return z;}) : any >f : (x: (p: "foo" | "bar") => "foo") => any ->y => { let z = y = "foo"; return z;} : (y: "foo" | "bar") => "foo" +>y => { const z = y = "foo"; return z;} : (y: "foo" | "bar") => "foo" >y : "foo" | "bar" - let z = y = "foo"; + const z = y = "foo"; >z : "foo" >y = "foo" : "foo" >y : "foo" | "bar" diff --git a/tests/baselines/reference/stringLiteralTypesTypePredicates01.types b/tests/baselines/reference/stringLiteralTypesTypePredicates01.types index 822103b86f571..0a87ffad86548 100644 --- a/tests/baselines/reference/stringLiteralTypesTypePredicates01.types +++ b/tests/baselines/reference/stringLiteralTypesTypePredicates01.types @@ -42,12 +42,12 @@ if (kindIs(x, "A")) { >"A" : "A" let a = x; ->a : "A" +>a : string >x : "A" } else { let b = x; ->b : "B" +>b : string >x : "B" } @@ -59,11 +59,11 @@ if (!kindIs(x, "B")) { >"B" : "B" let c = x; ->c : "A" +>c : string >x : "A" } else { let d = x; ->d : "B" +>d : string >x : "B" } diff --git a/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types index d55d5ab92948d..46dfef010a0a0 100644 --- a/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types +++ b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types @@ -16,33 +16,33 @@ let abcOrXyz: "ABC" | "XYZ" = abc || xyz; let abcOrXyzOrNumber: "ABC" | "XYZ" | number = abcOrXyz || 100; >abcOrXyzOrNumber : number | "ABC" | "XYZ" ->abcOrXyz || 100 : number | "ABC" | "XYZ" +>abcOrXyz || 100 : "ABC" | "XYZ" | 100 >abcOrXyz : "ABC" | "XYZ" ->100 : number +>100 : 100 let a = "" + abc; >a : string >"" + abc : string ->"" : string +>"" : "" >abc : "ABC" let b = abc + ""; >b : string >abc + "" : string >abc : "ABC" ->"" : string +>"" : "" let c = 10 + abc; >c : string >10 + abc : string ->10 : number +>10 : 10 >abc : "ABC" let d = abc + 10; >d : string >abc + 10 : string >abc : "ABC" ->10 : number +>10 : 10 let e = xyz + abc; >e : string @@ -59,14 +59,14 @@ let f = abc + xyz; let g = true + abc; >g : string >true + abc : string ->true : boolean +>true : true >abc : "ABC" let h = abc + true; >h : string >abc + true : string >abc : "ABC" ->true : boolean +>true : true let i = abc + abcOrXyz + xyz; >i : string @@ -96,12 +96,12 @@ let m = abcOrXyzOrNumber + ""; >m : string >abcOrXyzOrNumber + "" : string >abcOrXyzOrNumber : number | "ABC" | "XYZ" ->"" : string +>"" : "" let n = "" + abcOrXyzOrNumber; >n : string >"" + abcOrXyzOrNumber : string ->"" : string +>"" : "" >abcOrXyzOrNumber : number | "ABC" | "XYZ" let o = abcOrXyzOrNumber + abcOrXyz; diff --git a/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt b/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt index ad02604cc4cf6..a51469baa9360 100644 --- a/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt +++ b/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(7,9): error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'number'. -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(8,9): error TS2365: Operator '+' cannot be applied to types 'number' and 'number | "ABC" | "XYZ"'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(7,9): error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and '100'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(8,9): error TS2365: Operator '+' cannot be applied to types '100' and 'number | "ABC" | "XYZ"'. tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(9,9): error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'number | "ABC" | "XYZ"'. -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(10,9): error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'boolean'. -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(11,9): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number | "ABC" | "XYZ"'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(10,9): error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'true'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(11,9): error TS2365: Operator '+' cannot be applied to types 'false' and 'number | "ABC" | "XYZ"'. tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(12,9): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(13,11): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(14,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -21,19 +21,19 @@ tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperato let a = abcOrXyzOrNumber + 100; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and '100'. let b = 100 + abcOrXyzOrNumber; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'number | "ABC" | "XYZ"'. +!!! error TS2365: Operator '+' cannot be applied to types '100' and 'number | "ABC" | "XYZ"'. let c = abcOrXyzOrNumber + abcOrXyzOrNumber; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'number | "ABC" | "XYZ"'. let d = abcOrXyzOrNumber + true; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'true'. let e = false + abcOrXyzOrNumber; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number | "ABC" | "XYZ"'. +!!! error TS2365: Operator '+' cannot be applied to types 'false' and 'number | "ABC" | "XYZ"'. let f = abcOrXyzOrNumber++; ~~~~~~~~~~~~~~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. diff --git a/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons01.types b/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons01.types index 17a835a2461d6..71cfd959f5eeb 100644 --- a/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons01.types +++ b/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons01.types @@ -4,7 +4,7 @@ var a = "foo" === "bar" as string; >"foo" === "bar" as string : boolean >"foo" : "foo" >"bar" as string : string ->"bar" : string +>"bar" : "bar" var b = "foo" !== ("bar" as string); >b : boolean @@ -12,7 +12,7 @@ var b = "foo" !== ("bar" as string); >"foo" : "foo" >("bar" as string) : string >"bar" as string : string ->"bar" : string +>"bar" : "bar" var c = "foo" == ("bar"); >c : boolean @@ -20,5 +20,5 @@ var c = "foo" == ("bar"); >"foo" : "foo" >("bar") : any >"bar" : any ->"bar" : string +>"bar" : "bar" diff --git a/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons02.errors.txt b/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons02.errors.txt index 5daeab5dbeddc..fd92af4e84f63 100644 --- a/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons02.errors.txt +++ b/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons02.errors.txt @@ -1,21 +1,15 @@ tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(3,9): error TS2365: Operator '===' cannot be applied to types '"foo"' and '"baz"'. -tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(3,19): error TS2352: Type '"bar"' cannot be converted to type '"baz"'. -tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(4,20): error TS2352: Type '"bar"' cannot be converted to type '"foo"'. tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(5,9): error TS2365: Operator '==' cannot be applied to types 'string' and 'number'. tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(5,19): error TS2352: Type 'string' cannot be converted to type 'number'. -==== tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts (5 errors) ==== +==== tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts (3 errors) ==== type EnhancedString = string & { enhancements: any }; var a = "foo" === "bar" as "baz"; ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '===' cannot be applied to types '"foo"' and '"baz"'. - ~~~~~~~~~~~~~~ -!!! error TS2352: Type '"bar"' cannot be converted to type '"baz"'. var b = "foo" !== ("bar" as "foo"); - ~~~~~~~~~~~~~~ -!!! error TS2352: Type '"bar"' cannot be converted to type '"foo"'. var c = "foo" == ("bar"); ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '==' cannot be applied to types 'string' and 'number'. diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt b/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt index b2cbc96501fad..c5aedb8133429 100644 --- a/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt @@ -1,11 +1,16 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(10,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. Type '"baz"' is not comparable to type '"foo"'. tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(12,10): error TS2678: Type '"bar"' is not comparable to type '"foo"'. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,10): error TS2678: Type '"baz"' is not comparable to type '"foo"'. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(20,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. + Type '"baz"' is not comparable to type '"foo"'. tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(22,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. Type '"baz"' is not comparable to type '"foo"'. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(23,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. + Type '"baz"' is not comparable to type '"foo"'. -==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts (3 errors) ==== +==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts (6 errors) ==== let x: "foo"; let y: "foo" | "bar"; let z: "bar"; @@ -25,18 +30,26 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(22 !!! error TS2678: Type '"bar"' is not comparable to type '"foo"'. break; case (x, y, ("baz")): + ~~~~~~~~~~~~~~~ +!!! error TS2678: Type '"baz"' is not comparable to type '"foo"'. x; y; break; case (("foo" || ("bar"))): break; case (("bar" || ("baz"))): + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. +!!! error TS2678: Type '"baz"' is not comparable to type '"foo"'. break; case z || "baz": ~~~~~~~~~~ !!! error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. !!! error TS2678: Type '"baz"' is not comparable to type '"foo"'. case "baz" || z: + ~~~~~~~~~~ +!!! error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. +!!! error TS2678: Type '"baz"' is not comparable to type '"foo"'. z; break; } diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt b/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt new file mode 100644 index 0000000000000..10a461c753aa4 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt @@ -0,0 +1,28 @@ +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'. + + +==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts (1 errors) ==== + let x: "foo"; + let y: "foo" | "bar"; + + declare function randBool(): boolean; + + switch (y) { + case "foo", x: + break; + case x, "foo": + break; + case x, "baz": + ~~~~~~~~ +!!! error TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'. + break; + case "baz", x: + break; + case "baz" && "bar": + break; + case "baz" && ("foo" || "bar"): + break; + case "bar" && ("baz" || "bar"): + break; + } + \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralsWithTypeAssertions01.errors.txt b/tests/baselines/reference/stringLiteralsWithTypeAssertions01.errors.txt deleted file mode 100644 index d9d465c7afc24..0000000000000 --- a/tests/baselines/reference/stringLiteralsWithTypeAssertions01.errors.txt +++ /dev/null @@ -1,25 +0,0 @@ -tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts(3,9): error TS2352: Type '"foo"' cannot be converted to type '"bar"'. -tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts(4,9): error TS2352: Type '"bar"' cannot be converted to type '"foo"'. -tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts(7,9): error TS2352: Type '"foo" | "bar"' cannot be converted to type '"baz"'. - Type '"bar"' is not comparable to type '"baz"'. -tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts(8,9): error TS2352: Type '"baz"' cannot be converted to type '"foo" | "bar"'. - - -==== tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts (4 errors) ==== - let fooOrBar: "foo" | "bar"; - - let a = "foo" as "bar"; - ~~~~~~~~~~~~~~ -!!! error TS2352: Type '"foo"' cannot be converted to type '"bar"'. - let b = "bar" as "foo"; - ~~~~~~~~~~~~~~ -!!! error TS2352: Type '"bar"' cannot be converted to type '"foo"'. - let c = fooOrBar as "foo"; - let d = fooOrBar as "bar"; - let e = fooOrBar as "baz"; - ~~~~~~~~~~~~~~~~~ -!!! error TS2352: Type '"foo" | "bar"' cannot be converted to type '"baz"'. -!!! error TS2352: Type '"bar"' is not comparable to type '"baz"'. - let f = "baz" as typeof fooOrBar; - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2352: Type '"baz"' cannot be converted to type '"foo" | "bar"'. \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralsWithTypeAssertions01.symbols b/tests/baselines/reference/stringLiteralsWithTypeAssertions01.symbols new file mode 100644 index 0000000000000..915432deca328 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithTypeAssertions01.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts === +let fooOrBar: "foo" | "bar"; +>fooOrBar : Symbol(fooOrBar, Decl(stringLiteralsWithTypeAssertions01.ts, 0, 3)) + +let a = "foo" as "bar"; +>a : Symbol(a, Decl(stringLiteralsWithTypeAssertions01.ts, 2, 3)) + +let b = "bar" as "foo"; +>b : Symbol(b, Decl(stringLiteralsWithTypeAssertions01.ts, 3, 3)) + +let c = fooOrBar as "foo"; +>c : Symbol(c, Decl(stringLiteralsWithTypeAssertions01.ts, 4, 3)) +>fooOrBar : Symbol(fooOrBar, Decl(stringLiteralsWithTypeAssertions01.ts, 0, 3)) + +let d = fooOrBar as "bar"; +>d : Symbol(d, Decl(stringLiteralsWithTypeAssertions01.ts, 5, 3)) +>fooOrBar : Symbol(fooOrBar, Decl(stringLiteralsWithTypeAssertions01.ts, 0, 3)) + +let e = fooOrBar as "baz"; +>e : Symbol(e, Decl(stringLiteralsWithTypeAssertions01.ts, 6, 3)) +>fooOrBar : Symbol(fooOrBar, Decl(stringLiteralsWithTypeAssertions01.ts, 0, 3)) + +let f = "baz" as typeof fooOrBar; +>f : Symbol(f, Decl(stringLiteralsWithTypeAssertions01.ts, 7, 3)) +>fooOrBar : Symbol(fooOrBar, Decl(stringLiteralsWithTypeAssertions01.ts, 0, 3)) + diff --git a/tests/baselines/reference/stringLiteralsWithTypeAssertions01.types b/tests/baselines/reference/stringLiteralsWithTypeAssertions01.types new file mode 100644 index 0000000000000..4cd8599070229 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithTypeAssertions01.types @@ -0,0 +1,35 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts === +let fooOrBar: "foo" | "bar"; +>fooOrBar : "foo" | "bar" + +let a = "foo" as "bar"; +>a : string +>"foo" as "bar" : "bar" +>"foo" : "foo" + +let b = "bar" as "foo"; +>b : string +>"bar" as "foo" : "foo" +>"bar" : "bar" + +let c = fooOrBar as "foo"; +>c : string +>fooOrBar as "foo" : "foo" +>fooOrBar : "foo" | "bar" + +let d = fooOrBar as "bar"; +>d : string +>fooOrBar as "bar" : "bar" +>fooOrBar : "foo" | "bar" + +let e = fooOrBar as "baz"; +>e : string +>fooOrBar as "baz" : "baz" +>fooOrBar : "foo" | "bar" + +let f = "baz" as typeof fooOrBar; +>f : string +>"baz" as typeof fooOrBar : "foo" | "bar" +>"baz" : "baz" +>fooOrBar : "foo" | "bar" + diff --git a/tests/baselines/reference/stringNamedPropertyAccess.types b/tests/baselines/reference/stringNamedPropertyAccess.types index 2d0b585f82870..1b3d56abc10a7 100644 --- a/tests/baselines/reference/stringNamedPropertyAccess.types +++ b/tests/baselines/reference/stringNamedPropertyAccess.types @@ -13,13 +13,13 @@ var r1 = c["a b"]; >r1 : number >c["a b"] : number >c : C ->"a b" : string +>"a b" : "a b" var r1b = C['c d']; >r1b : number >C['c d'] : number >C : typeof C ->'c d' : string +>'c d' : "c d" interface I { >I : I @@ -34,7 +34,7 @@ var r2 = i["a b"]; >r2 : number >i["a b"] : number >i : I ->"a b" : string +>"a b" : "a b" var a: { >a : { "a b": number; } @@ -45,18 +45,18 @@ var r3 = a["a b"]; >r3 : number >a["a b"] : number >a : { "a b": number; } ->"a b" : string +>"a b" : "a b" var b = { >b : { "a b": number; } >{ "a b": 1} : { "a b": number; } "a b": 1 ->1 : number +>1 : 1 } var r4 = b["a b"]; >r4 : number >b["a b"] : number >b : { "a b": number; } ->"a b" : string +>"a b" : "a b" diff --git a/tests/baselines/reference/stringPropCodeGen.types b/tests/baselines/reference/stringPropCodeGen.types index 9b061a510e1e0..184718982fa21 100644 --- a/tests/baselines/reference/stringPropCodeGen.types +++ b/tests/baselines/reference/stringPropCodeGen.types @@ -7,7 +7,7 @@ var a = { >function() { } : () => void "bar" : 5 ->5 : number +>5 : 5 }; diff --git a/tests/baselines/reference/stringPropertyAccess.types b/tests/baselines/reference/stringPropertyAccess.types index 0540914035366..fd2ec13da7496 100644 --- a/tests/baselines/reference/stringPropertyAccess.types +++ b/tests/baselines/reference/stringPropertyAccess.types @@ -1,7 +1,7 @@ === tests/cases/conformance/types/primitives/string/stringPropertyAccess.ts === var x = ''; >x : string ->'' : string +>'' : "" var a = x.charAt(0); >a : string @@ -9,7 +9,7 @@ var a = x.charAt(0); >x.charAt : (pos: number) => string >x : string >charAt : (pos: number) => string ->0 : number +>0 : 0 var b = x.hasOwnProperty('charAt'); >b : boolean @@ -17,21 +17,21 @@ var b = x.hasOwnProperty('charAt'); >x.hasOwnProperty : (v: string) => boolean >x : string >hasOwnProperty : (v: string) => boolean ->'charAt' : string +>'charAt' : "charAt" var c = x['charAt'](0); >c : string >x['charAt'](0) : string >x['charAt'] : (pos: number) => string >x : string ->'charAt' : string ->0 : number +>'charAt' : "charAt" +>0 : 0 var e = x['hasOwnProperty']('toFixed'); >e : boolean >x['hasOwnProperty']('toFixed') : boolean >x['hasOwnProperty'] : (v: string) => boolean >x : string ->'hasOwnProperty' : string ->'toFixed' : string +>'hasOwnProperty' : "hasOwnProperty" +>'toFixed' : "toFixed" diff --git a/tests/baselines/reference/stringPropertyAccessWithError.errors.txt b/tests/baselines/reference/stringPropertyAccessWithError.errors.txt index fef1613bc5fd6..7cff28ee85de1 100644 --- a/tests/baselines/reference/stringPropertyAccessWithError.errors.txt +++ b/tests/baselines/reference/stringPropertyAccessWithError.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/primitives/string/stringPropertyAccessWithError.ts(2,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/primitives/string/stringPropertyAccessWithError.ts(2,21): error TS2345: Argument of type '"invalid"' is not assignable to parameter of type 'number'. ==== tests/cases/conformance/types/primitives/string/stringPropertyAccessWithError.ts (1 errors) ==== var x = ''; var d = x['charAt']('invalid'); // error ~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. \ No newline at end of file +!!! error TS2345: Argument of type '"invalid"' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/structural1.types b/tests/baselines/reference/structural1.types index 8ad3c679286da..12dfb25d91dda 100644 --- a/tests/baselines/reference/structural1.types +++ b/tests/baselines/reference/structural1.types @@ -23,8 +23,8 @@ module M { >f : (i: I) => void >{salt:2,pepper:0} : { salt: number; pepper: number; } >salt : number ->2 : number +>2 : 2 >pepper : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/styleOptions.types b/tests/baselines/reference/styleOptions.types index f0c0e93161c06..fca394ed9afc3 100644 --- a/tests/baselines/reference/styleOptions.types +++ b/tests/baselines/reference/styleOptions.types @@ -3,11 +3,11 @@ var x = 1; >x : number ->1 : number +>1 : 1 var y = 1; >y : number ->1 : number +>1 : 1 var t = x == y; >t : boolean diff --git a/tests/baselines/reference/subtypeRelationForNever.types b/tests/baselines/reference/subtypeRelationForNever.types index c577ee078628a..67c92b9b079e2 100644 --- a/tests/baselines/reference/subtypeRelationForNever.types +++ b/tests/baselines/reference/subtypeRelationForNever.types @@ -27,13 +27,13 @@ function withFew(values: a[], haveFew: (values: a[]) => r, haveNone: (reas >values.length : number >values : a[] >length : number ->0 : number +>0 : 0 >haveFew(values) : r >haveFew : (values: a[]) => r >values : a[] >haveNone('No values.') : r >haveNone : (reason: string) => r ->'No values.' : string +>'No values.' : "No values." } function id(value: a) : a { return value; } >id : (value: a) => a @@ -48,9 +48,9 @@ const result = withFew([1, 2, 3], id, fail); // expected result is number[] >withFew([1, 2, 3], id, fail) : number[] >withFew : (values: a[], haveFew: (values: a[]) => r, haveNone: (reason: string) => r) => r >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >id : (value: a) => a >fail : (message: string) => never diff --git a/tests/baselines/reference/subtypesOfAny.types b/tests/baselines/reference/subtypesOfAny.types index efa9fd1cd8244..aebe77df12e6a 100644 --- a/tests/baselines/reference/subtypesOfAny.types +++ b/tests/baselines/reference/subtypesOfAny.types @@ -187,7 +187,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } interface I15 { >I15 : I15 @@ -210,7 +210,7 @@ module c { export var bar = 1; >bar : number ->1 : number +>1 : 1 } interface I16 { >I16 : I16 diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types index 4059a1b0b5114..99aef9e95f6d7 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types @@ -14,14 +14,14 @@ function f1(x: T, y: U) { var r = true ? x : y; >r : U >true ? x : y : U ->true : boolean +>true : true >x : T >y : U var r = true ? y : x; >r : U >true ? y : x : U ->true : boolean +>true : true >y : U >x : T } @@ -44,14 +44,14 @@ function f2(x: T, y: U, z: V) { var r = true ? x : y; >r : U >true ? x : y : U ->true : boolean +>true : true >x : T >y : U var r = true ? y : x; >r : U >true ? y : x : U ->true : boolean +>true : true >y : U >x : T @@ -59,14 +59,14 @@ function f2(x: T, y: U, z: V) { var r2 = true ? z : y; >r2 : V >true ? z : y : V ->true : boolean +>true : true >z : V >y : U var r2 = true ? y : z; >r2 : V >true ? y : z : V ->true : boolean +>true : true >y : U >z : V @@ -74,14 +74,14 @@ function f2(x: T, y: U, z: V) { var r2a = true ? z : x; >r2a : V >true ? z : x : V ->true : boolean +>true : true >z : V >x : T var r2b = true ? x : z; >r2b : V >true ? x : z : V ->true : boolean +>true : true >x : T >z : V } @@ -101,14 +101,14 @@ function f3(x: T, y: U) { var r = true ? x : y; >r : U >true ? x : y : U ->true : boolean +>true : true >x : T >y : U var r = true ? y : x; >r : U >true ? y : x : U ->true : boolean +>true : true >y : U >x : T @@ -116,7 +116,7 @@ function f3(x: T, y: U) { var r2 = true ? x : new Date(); >r2 : Date >true ? x : new Date() : Date ->true : boolean +>true : true >x : T >new Date() : Date >Date : DateConstructor @@ -124,7 +124,7 @@ function f3(x: T, y: U) { var r2 = true ? new Date() : x; >r2 : Date >true ? new Date() : x : Date ->true : boolean +>true : true >new Date() : Date >Date : DateConstructor >x : T @@ -133,7 +133,7 @@ function f3(x: T, y: U) { var r3 = true ? y : new Date(); >r3 : Date >true ? y : new Date() : Date ->true : boolean +>true : true >y : U >new Date() : Date >Date : DateConstructor @@ -141,7 +141,7 @@ function f3(x: T, y: U) { var r3 = true ? new Date() : y; >r3 : Date >true ? new Date() : y : Date ->true : boolean +>true : true >new Date() : Date >Date : DateConstructor >y : U @@ -174,7 +174,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } class c { baz: string } >c : c @@ -185,7 +185,7 @@ module c { export var bar = 1; >bar : number ->1 : number +>1 : 1 } function f4(x: T) { @@ -198,14 +198,14 @@ function f4(x: T) { var r0 = true ? x : null; // ok >r0 : T >true ? x : null : T ->true : boolean +>true : true >x : T >null : null var r0 = true ? null : x; // ok >r0 : T >true ? null : x : T ->true : boolean +>true : true >null : null >x : T @@ -216,14 +216,14 @@ function f4(x: T) { var r0b = true ? u : x; // ok >r0b : any >true ? u : x : any ->true : boolean +>true : true >u : any >x : T var r0b = true ? x : u; // ok >r0b : any >true ? x : u : any ->true : boolean +>true : true >x : T >u : any } @@ -237,17 +237,17 @@ function f5(x: T) { var r1 = true ? 1 : x; // ok >r1 : number | T ->true ? 1 : x : number | T ->true : boolean ->1 : number +>true ? 1 : x : 1 | T +>true : true +>1 : 1 >x : T var r1 = true ? x : 1; // ok >r1 : number | T ->true ? x : 1 : number | T ->true : boolean +>true ? x : 1 : 1 | T +>true : true >x : T ->1 : number +>1 : 1 } function f6(x: T) { @@ -259,17 +259,17 @@ function f6(x: T) { var r2 = true ? '' : x; // ok >r2 : string | T ->true ? '' : x : string | T ->true : boolean ->'' : string +>true ? '' : x : "" | T +>true : true +>'' : "" >x : T var r2 = true ? x : ''; // ok >r2 : string | T ->true ? x : '' : string | T ->true : boolean +>true ? x : '' : "" | T +>true : true >x : T ->'' : string +>'' : "" } function f7(x: T) { @@ -281,17 +281,17 @@ function f7(x: T) { var r3 = true ? true : x; // ok >r3 : boolean | T ->true ? true : x : boolean | T ->true : boolean ->true : boolean +>true ? true : x : true | T +>true : true +>true : true >x : T var r3 = true ? x : true; // ok >r3 : boolean | T ->true ? x : true : boolean | T ->true : boolean +>true ? x : true : true | T +>true : true >x : T ->true : boolean +>true : true } function f8(x: T) { @@ -304,7 +304,7 @@ function f8(x: T) { var r4 = true ? new Date() : x; // ok >r4 : Date >true ? new Date() : x : Date ->true : boolean +>true : true >new Date() : Date >Date : DateConstructor >x : T @@ -312,7 +312,7 @@ function f8(x: T) { var r4 = true ? x : new Date(); // ok >r4 : Date >true ? x : new Date() : Date ->true : boolean +>true : true >x : T >new Date() : Date >Date : DateConstructor @@ -328,14 +328,14 @@ function f9(x: T) { var r5 = true ? /1/ : x; // ok >r5 : RegExp >true ? /1/ : x : RegExp ->true : boolean +>true : true >/1/ : RegExp >x : T var r5 = true ? x : /1/; // ok >r5 : RegExp >true ? x : /1/ : RegExp ->true : boolean +>true : true >x : T >/1/ : RegExp } @@ -350,20 +350,20 @@ function f10(x: T) { var r6 = true ? { foo: 1 } : x; // ok >r6 : { foo: number; } >true ? { foo: 1 } : x : { foo: number; } ->true : boolean +>true : true >{ foo: 1 } : { foo: number; } >foo : number ->1 : number +>1 : 1 >x : T var r6 = true ? x : { foo: 1 }; // ok >r6 : { foo: number; } >true ? x : { foo: 1 } : { foo: number; } ->true : boolean +>true : true >x : T >{ foo: 1 } : { foo: number; } >foo : number ->1 : number +>1 : 1 } function f11 void>(x: T) { @@ -375,14 +375,14 @@ function f11 void>(x: T) { var r7 = true ? () => { } : x; // ok >r7 : () => void >true ? () => { } : x : () => void ->true : boolean +>true : true >() => { } : () => void >x : T var r7 = true ? x : () => { }; // ok >r7 : () => void >true ? x : () => { } : () => void ->true : boolean +>true : true >x : T >() => { } : () => void } @@ -400,7 +400,7 @@ function f12(x: U) => U>(x: T) { var r8 = true ? (x: T) => { return x } : x; // ok >r8 : (x: T) => T >true ? (x: T) => { return x } : x : (x: T) => T ->true : boolean +>true : true >(x: T) => { return x } : (x: T) => T >T : T >x : T @@ -411,7 +411,7 @@ function f12(x: U) => U>(x: T) { var r8b = true ? x : (x: T) => { return x }; // ok, type parameters not identical across declarations >r8b : (x: T) => T >true ? x : (x: T) => { return x } : (x: T) => T ->true : boolean +>true : true >x : T >(x: T) => { return x } : (x: T) => T >T : T @@ -434,14 +434,14 @@ function f13(x: T) { var r9 = true ? i1 : x; // ok >r9 : I1 >true ? i1 : x : I1 ->true : boolean +>true : true >i1 : I1 >x : T var r9 = true ? x : i1; // ok >r9 : I1 >true ? x : i1 : I1 ->true : boolean +>true : true >x : T >i1 : I1 } @@ -460,14 +460,14 @@ function f14(x: T) { var r10 = true ? c1 : x; // ok >r10 : C1 >true ? c1 : x : C1 ->true : boolean +>true : true >c1 : C1 >x : T var r10 = true ? x : c1; // ok >r10 : C1 >true ? x : c1 : C1 ->true : boolean +>true : true >x : T >c1 : C1 } @@ -486,14 +486,14 @@ function f15>(x: T) { var r12 = true ? c2 : x; // ok >r12 : C2 >true ? c2 : x : C2 ->true : boolean +>true : true >c2 : C2 >x : T var r12 = true ? x : c2; // ok >r12 : C2 >true ? x : c2 : C2 ->true : boolean +>true : true >x : T >c2 : C2 } @@ -508,21 +508,21 @@ function f16(x: T) { var r13 = true ? E : x; // ok >r13 : T | typeof E >true ? E : x : T | typeof E ->true : boolean +>true : true >E : typeof E >x : T var r13 = true ? x : E; // ok >r13 : T | typeof E >true ? x : E : T | typeof E ->true : boolean +>true : true >x : T >E : typeof E var r14 = true ? E.A : x; // ok >r14 : E >true ? E.A : x : E ->true : boolean +>true : true >E.A : E >E : typeof E >A : E @@ -531,7 +531,7 @@ function f16(x: T) { var r14 = true ? x : E.A; // ok >r14 : E >true ? x : E.A : E ->true : boolean +>true : true >x : T >E.A : E >E : typeof E @@ -552,14 +552,14 @@ function f17(x: T) { var r15 = true ? af : x; // ok >r15 : typeof f >true ? af : x : typeof f ->true : boolean +>true : true >af : typeof f >x : T var r15 = true ? x : af; // ok >r15 : typeof f >true ? x : af : typeof f ->true : boolean +>true : true >x : T >af : typeof f } @@ -578,14 +578,14 @@ function f18(x: T) { var r16 = true ? ac : x; // ok >r16 : typeof c >true ? ac : x : typeof c ->true : boolean +>true : true >ac : typeof c >x : T var r16 = true ? x : ac; // ok >r16 : typeof c >true ? x : ac : typeof c ->true : boolean +>true : true >x : T >ac : typeof c } @@ -606,14 +606,14 @@ function f19(x: T) { var r17 = true ? x : a; // ok >r17 : T >true ? x : a : T ->true : boolean +>true : true >x : T >a : U var r17 = true ? a : x; // ok >r17 : T >true ? a : x : T ->true : boolean +>true : true >a : U >x : T } @@ -630,14 +630,14 @@ function f19(x: T) { var r18 = true ? x : a; // ok >r18 : T >true ? x : a : T ->true : boolean +>true : true >x : T >a : V var r18 = true ? a : x; // ok >r18 : T >true ? a : x : T ->true : boolean +>true : true >a : V >x : T } @@ -653,7 +653,7 @@ function f20(x: T) { var r19 = true ? new Object() : x; // ok >r19 : Object >true ? new Object() : x : Object ->true : boolean +>true : true >new Object() : Object >Object : ObjectConstructor >x : T @@ -661,7 +661,7 @@ function f20(x: T) { var r19 = true ? x : new Object(); // ok >r19 : Object >true ? x : new Object() : Object ->true : boolean +>true : true >x : T >new Object() : Object >Object : ObjectConstructor @@ -677,14 +677,14 @@ function f21(x: T) { var r20 = true ? {} : x; // ok >r20 : {} >true ? {} : x : {} ->true : boolean +>true : true >{} : {} >x : T var r20 = true ? x : {}; // ok >r20 : {} >true ? x : {} : {} ->true : boolean +>true : true >x : T >{} : {} } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types index f0f075a37ce16..598fec51bc004 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types @@ -18,14 +18,14 @@ function f(t: T, u: U, v: V) { var r = true ? t : u; >r : U >true ? t : u : U ->true : boolean +>true : true >t : T >u : U var r = true ? u : t; >r : U >true ? u : t : U ->true : boolean +>true : true >u : U >t : T @@ -33,14 +33,14 @@ function f(t: T, u: U, v: V) { var r2 = true ? t : v; >r2 : T | V >true ? t : v : T | V ->true : boolean +>true : true >t : T >v : V var r2 = true ? v : t; >r2 : T | V >true ? v : t : T | V ->true : boolean +>true : true >v : V >t : T @@ -48,14 +48,14 @@ function f(t: T, u: U, v: V) { var r3 = true ? v : u; >r3 : U | V >true ? v : u : U | V ->true : boolean +>true : true >v : V >u : U var r3 = true ? u : v; >r3 : U | V >true ? u : v : U | V ->true : boolean +>true : true >u : U >v : V } diff --git a/tests/baselines/reference/subtypingTransitivity.types b/tests/baselines/reference/subtypingTransitivity.types index 0a41e045d98c3..8aabf635313f0 100644 --- a/tests/baselines/reference/subtypingTransitivity.types +++ b/tests/baselines/reference/subtypingTransitivity.types @@ -35,11 +35,11 @@ var d2: D2; >D2 : D2 d.x = ''; ->d.x = '' : string +>d.x = '' : "" >d.x : string >d : D >x : string ->'' : string +>'' : "" b = d; >b = d : D @@ -47,9 +47,9 @@ b = d; >d : D b.x = 1; // assigned number to string ->b.x = 1 : number +>b.x = 1 : 1 >b.x : Object >b : B >x : Object ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/subtypingWithCallSignatures.types b/tests/baselines/reference/subtypingWithCallSignatures.types index 50e773882d01e..3f6994c8a0400 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures.types +++ b/tests/baselines/reference/subtypingWithCallSignatures.types @@ -18,7 +18,7 @@ module CallSignature { >foo1 : { (cb: (x: number) => void): (x: number) => void; (cb: any): any; } >(x: number) => 1 : (x: number) => number >x : number ->1 : number +>1 : 1 var r2 = foo1((x: T) => ''); // ok because base returns void >r2 : (x: number) => void @@ -28,7 +28,7 @@ module CallSignature { >T : T >x : T >T : T ->'' : string +>'' : "" declare function foo2(cb: (x: number, y: number) => void): typeof cb; >foo2 : { (cb: (x: number, y: number) => void): (x: number, y: number) => void; (cb: any): any; } @@ -48,7 +48,7 @@ module CallSignature { >(x: number, y: number) => 1 : (x: number, y: number) => number >x : number >y : number ->1 : number +>1 : 1 var r4 = foo2((x: T) => ''); // ok because base returns void >r4 : (x: number, y: number) => void @@ -58,5 +58,5 @@ module CallSignature { >T : T >x : T >T : T ->'' : string +>'' : "" } diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.types b/tests/baselines/reference/subtypingWithCallSignatures2.types index 8a56e05a9c212..8ce4b566b8651 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.types +++ b/tests/baselines/reference/subtypingWithCallSignatures2.types @@ -322,7 +322,7 @@ var r1arg2 = (x: number) => [1]; >(x: number) => [1] : (x: number) => number[] >x : number >[1] : number[] ->1 : number +>1 : 1 var r1 = foo1(r1arg1); // any, return types are not subtype of first overload >r1 : any @@ -349,14 +349,14 @@ var r2arg1 = (x: T) => ['']; >x : T >T : T >[''] : string[] ->'' : string +>'' : "" var r2arg2 = (x: number) => ['']; >r2arg2 : (x: number) => string[] >(x: number) => [''] : (x: number) => string[] >x : number >[''] : string[] ->'' : string +>'' : "" var r2 = foo2(r2arg1); >r2 : (x: number) => string[] @@ -423,7 +423,7 @@ var r4arg2 = (x: string, y: number) => ''; >(x: string, y: number) => '' : (x: string, y: number) => string >x : string >y : number ->'' : string +>'' : "" var r4 = foo4(r4arg1); // any >r4 : any @@ -461,7 +461,7 @@ var r5arg2 = (x: (arg: string) => number) => ''; >(x: (arg: string) => number) => '' : (x: (arg: string) => number) => string >x : (arg: string) => number >arg : string ->'' : string +>'' : "" var r5 = foo5(r5arg1); // any >r5 : any @@ -701,7 +701,7 @@ var r10arg1 = (...x: T[]) => x[0]; >T : T >x[0] : T >x : T[] ->0 : number +>0 : 0 var r10arg2 = (...x: Derived[]) => null; >r10arg2 : (...x: Derived[]) => Derived @@ -929,7 +929,7 @@ var r16arg1 = (x: T) => [1]; >x : T >T : T >[1] : number[] ->1 : number +>1 : 1 var r16 = foo16(r16arg1); >r16 : { (x: T): number[]; (x: U): number[]; } diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.types b/tests/baselines/reference/subtypingWithCallSignatures3.types index 379810b2541f0..6abc7567efb2c 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.types +++ b/tests/baselines/reference/subtypingWithCallSignatures3.types @@ -224,7 +224,7 @@ module Errors { >(x: number) => [''] : (x: number) => string[] >x : number >[''] : string[] ->'' : string +>'' : "" >(x: T) => null : (x: T) => U[] >T : T >U : U @@ -248,7 +248,7 @@ module Errors { >(x: number) => [''] : (x: number) => string[] >x : number >[''] : string[] ->'' : string +>'' : "" var r2arg = (x: (arg: T) => U) => (r: T) => null; >r2arg : (x: (arg: T) => U) => (r: T) => V @@ -508,7 +508,7 @@ module Errors { >x : { a: string; b: number; } >a : string >b : number ->1 : number +>1 : 1 var r7 = foo15(r7arg); // any >r7 : any @@ -538,7 +538,7 @@ module Errors { >T : T >b : T >T : T ->1 : number +>1 : 1 var r7c = foo15(r7arg3); // (x: { a: string; b: number }) => number): number; >r7c : (x: { a: string; b: number; }) => number @@ -617,7 +617,7 @@ module WithGenericSignaturesInBaseType { >x : T >T : T >[''] : string[] ->'' : string +>'' : "" var r2 = foo2(r2arg2); // (x:T) => T[] since we can infer from generic signatures now >r2 : (x: T) => T[] diff --git a/tests/baselines/reference/subtypingWithCallSignatures4.types b/tests/baselines/reference/subtypingWithCallSignatures4.types index e76d36114e961..5926636289abc 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures4.types +++ b/tests/baselines/reference/subtypingWithCallSignatures4.types @@ -264,7 +264,7 @@ var r2arg = (x: T) => ['']; >x : T >T : T >[''] : string[] ->'' : string +>'' : "" var r2arg2 = (x: T) => ['']; >r2arg2 : (x: T) => string[] @@ -273,7 +273,7 @@ var r2arg2 = (x: T) => ['']; >x : T >T : T >[''] : string[] ->'' : string +>'' : "" var r2 = foo2(r2arg); >r2 : any @@ -337,7 +337,7 @@ var r4arg = (x: T, y: U) => ''; >T : T >y : U >U : U ->'' : string +>'' : "" var r4arg2 = (x: T, y: U) => ''; >r4arg2 : (x: T, y: U) => string @@ -348,7 +348,7 @@ var r4arg2 = (x: T, y: U) => ''; >T : T >y : U >U : U ->'' : string +>'' : "" var r4 = foo4(r4arg); >r4 : any diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality.types b/tests/baselines/reference/subtypingWithObjectMembersOptionality.types index 815f2d60740ca..e0198e31d2872 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality.types +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality.types @@ -87,7 +87,7 @@ var b = { Foo: null }; var r = true ? a : b; >r : { Foo?: Base; } >true ? a : b : { Foo?: Base; } ->true : boolean +>true : true >a : { Foo?: Base; } >b : { Foo: Derived; } @@ -158,7 +158,7 @@ module TwoLevels { var r = true ? a : b; >r : { Foo?: Base; } >true ? a : b : { Foo?: Base; } ->true : boolean +>true : true >a : { Foo?: Base; } >b : { Foo: Derived2; } } diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality3.types b/tests/baselines/reference/subtypingWithObjectMembersOptionality3.types index 6490b0abd9b16..7f93418506f77 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality3.types +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality3.types @@ -71,7 +71,7 @@ var b: { Foo2: Derived; } var r = true ? a : b; // ok >r : { Foo?: Base; } >true ? a : b : { Foo?: Base; } ->true : boolean +>true : true >a : { Foo?: Base; } >b : { Foo2: Derived; } diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality4.types b/tests/baselines/reference/subtypingWithObjectMembersOptionality4.types index ee636be020b8d..d1d00e8e1bcf9 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality4.types +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality4.types @@ -71,7 +71,7 @@ var b: { Foo2?: Derived; } var r = true ? a : b; // ok >r : { Foo2?: Derived; } >true ? a : b : { Foo2?: Derived; } ->true : boolean +>true : true >a : { Foo: Base; } >b : { Foo2?: Derived; } diff --git a/tests/baselines/reference/super2.types b/tests/baselines/reference/super2.types index a3807f03099df..2ff73710080b6 100644 --- a/tests/baselines/reference/super2.types +++ b/tests/baselines/reference/super2.types @@ -7,14 +7,14 @@ class Base5 { >x : () => string return "BaseX"; ->"BaseX" : string +>"BaseX" : "BaseX" } public y() { >y : () => string return "BaseY"; ->"BaseY" : string +>"BaseY" : "BaseY" } } @@ -26,7 +26,7 @@ class Sub5 extends Base5 { >x : () => string return "SubX"; ->"SubX" : string +>"SubX" : "SubX" } } @@ -62,7 +62,7 @@ class Base6 { >x : () => string return "BaseX"; ->"BaseX" : string +>"BaseX" : "BaseX" } } @@ -74,7 +74,7 @@ class Sub6 extends Base6 { >y : () => string return "SubY"; ->"SubY" : string +>"SubY" : "SubY" } } diff --git a/tests/baselines/reference/superCallArgsMustMatch.errors.txt b/tests/baselines/reference/superCallArgsMustMatch.errors.txt index 06758b44fe696..f5724a710d17e 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.errors.txt +++ b/tests/baselines/reference/superCallArgsMustMatch.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/superCallArgsMustMatch.ts(17,15): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/superCallArgsMustMatch.ts(17,15): error TS2345: Argument of type '"hi"' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/superCallArgsMustMatch.ts (1 errors) ==== @@ -20,7 +20,7 @@ tests/cases/compiler/superCallArgsMustMatch.ts(17,15): error TS2345: Argument of // which is instantiated with 'number' in the extends clause super("hi"); ~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"hi"' is not assignable to parameter of type 'number'. var x: number = this.foo; diff --git a/tests/baselines/reference/superCallAssignResult.errors.txt b/tests/baselines/reference/superCallAssignResult.errors.txt index bc9e2a0dc55d7..524866f28f180 100644 --- a/tests/baselines/reference/superCallAssignResult.errors.txt +++ b/tests/baselines/reference/superCallAssignResult.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2322: Type '5' is not assignable to type 'void'. ==== tests/cases/compiler/superCallAssignResult.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2322: Type 'number' var x = super(5); // Should be of type void, not E. x = 5; ~ -!!! error TS2322: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type '5' is not assignable to type 'void'. } } \ No newline at end of file diff --git a/tests/baselines/reference/superCalls.types b/tests/baselines/reference/superCalls.types index ce5353df329b0..ad5f0806c4487 100644 --- a/tests/baselines/reference/superCalls.types +++ b/tests/baselines/reference/superCalls.types @@ -4,7 +4,7 @@ class Base { x = 43; >x : number ->43 : number +>43 : 43 constructor(n: string) { >n : string @@ -26,14 +26,14 @@ class Derived extends Base { super(''); >super('') : void >super : typeof Base ->'' : string +>'' : "" //type of super call expression is void var p = super(''); >p : void >super('') : void >super : typeof Base ->'' : string +>'' : "" var p = v(); >p : void @@ -54,7 +54,7 @@ class OtherDerived extends OtherBase { constructor() { var p = ''; >p : string ->'' : string +>'' : "" super(); >super() : void diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types index d435bff69b543..78af8fdf0b9bc 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types @@ -4,7 +4,7 @@ class A { foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } class B extends A { @@ -13,7 +13,7 @@ class B extends A { foo() { return 2; } >foo : () => number ->2 : number +>2 : 2 bar() { >bar : () => typeof (Anonymous class) @@ -28,7 +28,7 @@ class B extends A { >foo : () => number return 100; ->100 : number +>100 : 100 } } } diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types index 817e3b73ba489..0e3d295fc88fc 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types @@ -4,7 +4,7 @@ class A { foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } class B extends A { @@ -13,7 +13,7 @@ class B extends A { foo() { return 2; } >foo : () => number ->2 : number +>2 : 2 bar() { >bar : () => typeof (Anonymous class) @@ -28,7 +28,7 @@ class B extends A { >foo : () => number return 100; ->100 : number +>100 : 100 } } } diff --git a/tests/baselines/reference/superPropertyAccessNoError.types b/tests/baselines/reference/superPropertyAccessNoError.types index b982b2ab69480..f1e6101c42166 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.types +++ b/tests/baselines/reference/superPropertyAccessNoError.types @@ -14,14 +14,14 @@ class SomeBaseClass { >func : () => string return ''; ->'' : string +>'' : "" } static func() { >func : () => number return 3; ->3 : number +>3 : 3 } returnThis() { diff --git a/tests/baselines/reference/superPropertyAccess_ES6.types b/tests/baselines/reference/superPropertyAccess_ES6.types index b10b1944a44ee..bb4082a73cf2e 100644 --- a/tests/baselines/reference/superPropertyAccess_ES6.types +++ b/tests/baselines/reference/superPropertyAccess_ES6.types @@ -5,11 +5,11 @@ class MyBase { getValue(): number { return 1; } >getValue : () => number ->1 : number +>1 : 1 get value(): number { return 1; } >value : number ->1 : number +>1 : 1 } class MyDerived extends MyBase { @@ -84,6 +84,6 @@ class B extends A { >property : string >value + " addition" : string >value : string ->" addition" : string +>" addition" : " addition" } } diff --git a/tests/baselines/reference/superSymbolIndexedAccess1.types b/tests/baselines/reference/superSymbolIndexedAccess1.types index af2c6cab156be..ab09528b04b14 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess1.types +++ b/tests/baselines/reference/superSymbolIndexedAccess1.types @@ -5,7 +5,7 @@ var symbol = Symbol.for('myThing'); >Symbol.for : (key: string) => symbol >Symbol : SymbolConstructor >for : (key: string) => symbol ->'myThing' : string +>'myThing' : "myThing" class Foo { >Foo : Foo @@ -14,7 +14,7 @@ class Foo { >symbol : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/superSymbolIndexedAccess2.types b/tests/baselines/reference/superSymbolIndexedAccess2.types index 72bb6914d3eab..61c760dfac757 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess2.types +++ b/tests/baselines/reference/superSymbolIndexedAccess2.types @@ -9,7 +9,7 @@ class Foo { >isConcatSpreadable : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.types b/tests/baselines/reference/superSymbolIndexedAccess5.types index abc3ba364b008..745fd81b8f845 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess5.types +++ b/tests/baselines/reference/superSymbolIndexedAccess5.types @@ -9,7 +9,7 @@ class Foo { >symbol : any return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.types b/tests/baselines/reference/superSymbolIndexedAccess6.types index 830ade0c685ac..11c4a0e553b51 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess6.types +++ b/tests/baselines/reference/superSymbolIndexedAccess6.types @@ -9,7 +9,7 @@ class Foo { >symbol : any return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/switchAssignmentCompat.errors.txt b/tests/baselines/reference/switchAssignmentCompat.errors.txt index 747a1035b6846..46c89fa5b52d2 100644 --- a/tests/baselines/reference/switchAssignmentCompat.errors.txt +++ b/tests/baselines/reference/switchAssignmentCompat.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type 'number'. +tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type '0'. ==== tests/cases/compiler/switchAssignmentCompat.ts (1 errors) ==== @@ -7,6 +7,6 @@ tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2678: Type 'typeof switch (0) { case Foo: break; // Error expected ~~~ -!!! error TS2678: Type 'typeof Foo' is not comparable to type 'number'. +!!! error TS2678: Type 'typeof Foo' is not comparable to type '0'. } \ No newline at end of file diff --git a/tests/baselines/reference/switchBreakStatements.errors.txt b/tests/baselines/reference/switchBreakStatements.errors.txt new file mode 100644 index 0000000000000..229c42068c308 --- /dev/null +++ b/tests/baselines/reference/switchBreakStatements.errors.txt @@ -0,0 +1,92 @@ +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(3,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(9,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(16,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(22,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(25,18): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(31,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(34,18): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(41,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(43,18): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(45,26): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(49,34): error TS2678: Type '"a"' is not comparable to type '""'. + + +==== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts (11 errors) ==== + + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break; + } + + ONE: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break ONE; + } + + TWO: + THREE: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break THREE; + } + + FOUR: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + FIVE: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break FOUR; + } + } + + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + SIX: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break SIX; + } + } + + SEVEN: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break SEVEN; + EIGHT: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + var fn = function () { } + break EIGHT; + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/switchCases.errors.txt b/tests/baselines/reference/switchCases.errors.txt new file mode 100644 index 0000000000000..205f8aae8c72a --- /dev/null +++ b/tests/baselines/reference/switchCases.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/switchCases.ts(2,7): error TS2678: Type '1' is not comparable to type '0'. + + +==== tests/cases/compiler/switchCases.ts (1 errors) ==== + switch(0) { + case 1: + ~ +!!! error TS2678: Type '1' is not comparable to type '0'. + break; + } + \ No newline at end of file diff --git a/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt b/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt index e430b33097c0a..3ea12e2460f65 100644 --- a/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt +++ b/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt @@ -1,22 +1,25 @@ -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type 'number'. -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2678: Type '"sss"' is not comparable to type 'number'. -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: Type 'true' is not comparable to type 'number'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type '0'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2678: Type '"sss"' is not comparable to type '0'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(6,10): error TS2678: Type '123' is not comparable to type '0'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: Type 'true' is not comparable to type '0'. -==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (3 errors) ==== +==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (4 errors) ==== class Foo { } switch (0) { case Foo: break; // Error ~~~ -!!! error TS2678: Type 'typeof Foo' is not comparable to type 'number'. +!!! error TS2678: Type 'typeof Foo' is not comparable to type '0'. case "sss": break; // Error ~~~~~ -!!! error TS2678: Type '"sss"' is not comparable to type 'number'. +!!! error TS2678: Type '"sss"' is not comparable to type '0'. case 123: break; // No Error + ~~~ +!!! error TS2678: Type '123' is not comparable to type '0'. case true: break; // Error ~~~~ -!!! error TS2678: Type 'true' is not comparable to type 'number'. +!!! error TS2678: Type 'true' is not comparable to type '0'. } var s: any = 0; diff --git a/tests/baselines/reference/switchFallThroughs.types b/tests/baselines/reference/switchFallThroughs.types index cd0af6693ebf8..3e0f02768469f 100644 --- a/tests/baselines/reference/switchFallThroughs.types +++ b/tests/baselines/reference/switchFallThroughs.types @@ -17,7 +17,7 @@ function R1(index: number) { var a = 'a'; >a : string ->'a' : string +>'a' : "a" return a; >a : string @@ -29,14 +29,14 @@ function R1(index: number) { >4 : 4 return 'b'; ->'b' : string +>'b' : "b" } case 5: >5 : 5 default: return 'c'; ->'c' : string +>'c' : "c" } } diff --git a/tests/baselines/reference/symbolDeclarationEmit10.types b/tests/baselines/reference/symbolDeclarationEmit10.types index 0d8d54c28de55..d7f5c861e8940 100644 --- a/tests/baselines/reference/symbolDeclarationEmit10.types +++ b/tests/baselines/reference/symbolDeclarationEmit10.types @@ -7,7 +7,7 @@ var obj = { >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ->'' : string +>'' : "" set [Symbol.isConcatSpreadable](x) { } >Symbol.isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit11.types b/tests/baselines/reference/symbolDeclarationEmit11.types index 30f92266eb28f..d75c3683e9725 100644 --- a/tests/baselines/reference/symbolDeclarationEmit11.types +++ b/tests/baselines/reference/symbolDeclarationEmit11.types @@ -6,7 +6,7 @@ class C { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 static [Symbol.isConcatSpreadable]() { } >Symbol.isConcatSpreadable : symbol @@ -17,7 +17,7 @@ class C { >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->"" : string +>"" : "" static set [Symbol.toPrimitive](x) { } >Symbol.toPrimitive : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit13.types b/tests/baselines/reference/symbolDeclarationEmit13.types index ce77ec9b38b4c..9fa17acdc106f 100644 --- a/tests/baselines/reference/symbolDeclarationEmit13.types +++ b/tests/baselines/reference/symbolDeclarationEmit13.types @@ -6,7 +6,7 @@ class C { >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->"" : string +>"" : "" set [Symbol.toStringTag](x) { } >Symbol.toStringTag : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit14.types b/tests/baselines/reference/symbolDeclarationEmit14.types index 5e975a6eae40f..daf7b6d5731a0 100644 --- a/tests/baselines/reference/symbolDeclarationEmit14.types +++ b/tests/baselines/reference/symbolDeclarationEmit14.types @@ -6,11 +6,11 @@ class C { >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->"" : string +>"" : "" get [Symbol.toStringTag]() { return ""; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/symbolDeclarationEmit2.types b/tests/baselines/reference/symbolDeclarationEmit2.types index 1072783671258..23d2fac2de871 100644 --- a/tests/baselines/reference/symbolDeclarationEmit2.types +++ b/tests/baselines/reference/symbolDeclarationEmit2.types @@ -6,5 +6,5 @@ class C { >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/symbolDeclarationEmit4.types b/tests/baselines/reference/symbolDeclarationEmit4.types index 51e4135b4987c..f9fa6dc581c96 100644 --- a/tests/baselines/reference/symbolDeclarationEmit4.types +++ b/tests/baselines/reference/symbolDeclarationEmit4.types @@ -6,7 +6,7 @@ class C { >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->"" : string +>"" : "" set [Symbol.toPrimitive](x) { } >Symbol.toPrimitive : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit8.types b/tests/baselines/reference/symbolDeclarationEmit8.types index e14bc5c395b52..4e8bfc9a9af83 100644 --- a/tests/baselines/reference/symbolDeclarationEmit8.types +++ b/tests/baselines/reference/symbolDeclarationEmit8.types @@ -7,5 +7,5 @@ var obj = { >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/symbolProperty1.types b/tests/baselines/reference/symbolProperty1.types index 667e51fda8aaa..4af154f7b2737 100644 --- a/tests/baselines/reference/symbolProperty1.types +++ b/tests/baselines/reference/symbolProperty1.types @@ -8,7 +8,7 @@ var x = { [s]: 0, >s : symbol ->0 : number +>0 : 0 [s]() { }, >s : symbol @@ -17,6 +17,6 @@ var x = { >s : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/symbolProperty18.types b/tests/baselines/reference/symbolProperty18.types index 681f86af11794..97b4de9897c01 100644 --- a/tests/baselines/reference/symbolProperty18.types +++ b/tests/baselines/reference/symbolProperty18.types @@ -7,13 +7,13 @@ var i = { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 [Symbol.toStringTag]() { return "" }, >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol ->"" : string +>"" : "" set [Symbol.toPrimitive](p: boolean) { } >Symbol.toPrimitive : symbol diff --git a/tests/baselines/reference/symbolProperty2.types b/tests/baselines/reference/symbolProperty2.types index 7584c6461e8ec..18aafb5afb5cd 100644 --- a/tests/baselines/reference/symbolProperty2.types +++ b/tests/baselines/reference/symbolProperty2.types @@ -10,7 +10,7 @@ var x = { [s]: 0, >s : symbol ->0 : number +>0 : 0 [s]() { }, >s : symbol @@ -19,6 +19,6 @@ var x = { >s : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/symbolProperty22.types b/tests/baselines/reference/symbolProperty22.types index 29d16b1553ea1..628164f39299f 100644 --- a/tests/baselines/reference/symbolProperty22.types +++ b/tests/baselines/reference/symbolProperty22.types @@ -28,7 +28,7 @@ declare function foo(p1: T, p2: I): U; foo("", { [Symbol.unscopables]: s => s.length }); >foo("", { [Symbol.unscopables]: s => s.length }) : number >foo : (p1: T, p2: I) => U ->"" : string +>"" : "" >{ [Symbol.unscopables]: s => s.length } : { [Symbol.unscopables]: (s: string) => number; } >Symbol.unscopables : symbol >Symbol : SymbolConstructor diff --git a/tests/baselines/reference/symbolProperty23.types b/tests/baselines/reference/symbolProperty23.types index b34a208a90734..c4a9d6765dd9d 100644 --- a/tests/baselines/reference/symbolProperty23.types +++ b/tests/baselines/reference/symbolProperty23.types @@ -18,6 +18,6 @@ class C implements I { >toPrimitive : symbol return true; ->true : boolean +>true : true } } diff --git a/tests/baselines/reference/symbolProperty26.types b/tests/baselines/reference/symbolProperty26.types index 386761c98f91e..cde412000db1e 100644 --- a/tests/baselines/reference/symbolProperty26.types +++ b/tests/baselines/reference/symbolProperty26.types @@ -8,7 +8,7 @@ class C1 { >toStringTag : symbol return ""; ->"" : string +>"" : "" } } @@ -22,6 +22,6 @@ class C2 extends C1 { >toStringTag : symbol return ""; ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/symbolProperty27.types b/tests/baselines/reference/symbolProperty27.types index d8ff2f2f11629..2c138b5a9d0de 100644 --- a/tests/baselines/reference/symbolProperty27.types +++ b/tests/baselines/reference/symbolProperty27.types @@ -22,6 +22,6 @@ class C2 extends C1 { >toStringTag : symbol return ""; ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/symbolProperty28.types b/tests/baselines/reference/symbolProperty28.types index 6eddebf44d858..2a7b5fabf79e4 100644 --- a/tests/baselines/reference/symbolProperty28.types +++ b/tests/baselines/reference/symbolProperty28.types @@ -10,7 +10,7 @@ class C1 { return { x: "" }; >{ x: "" } : { x: string; } >x : string ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/symbolProperty4.types b/tests/baselines/reference/symbolProperty4.types index 7bcf3f2339769..abcf4451b03d3 100644 --- a/tests/baselines/reference/symbolProperty4.types +++ b/tests/baselines/reference/symbolProperty4.types @@ -6,7 +6,7 @@ var x = { [Symbol()]: 0, >Symbol() : symbol >Symbol : SymbolConstructor ->0 : number +>0 : 0 [Symbol()]() { }, >Symbol() : symbol @@ -17,6 +17,6 @@ var x = { >Symbol : SymbolConstructor return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/symbolProperty40.types b/tests/baselines/reference/symbolProperty40.types index c349a705a290a..efe6600d5359e 100644 --- a/tests/baselines/reference/symbolProperty40.types +++ b/tests/baselines/reference/symbolProperty40.types @@ -37,7 +37,7 @@ c[Symbol.iterator](""); >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->"" : string +>"" : "" c[Symbol.iterator](0); >c[Symbol.iterator](0) : number @@ -46,5 +46,5 @@ c[Symbol.iterator](0); >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/symbolProperty41.types b/tests/baselines/reference/symbolProperty41.types index f312481ac0403..5eebd1076599a 100644 --- a/tests/baselines/reference/symbolProperty41.types +++ b/tests/baselines/reference/symbolProperty41.types @@ -40,7 +40,7 @@ c[Symbol.iterator](""); >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->"" : string +>"" : "" c[Symbol.iterator]("hello"); >c[Symbol.iterator]("hello") : { x: string; hello: string; } diff --git a/tests/baselines/reference/symbolProperty45.types b/tests/baselines/reference/symbolProperty45.types index 946ceeb9ea1fc..cb0fbdffc5315 100644 --- a/tests/baselines/reference/symbolProperty45.types +++ b/tests/baselines/reference/symbolProperty45.types @@ -8,7 +8,7 @@ class C { >hasInstance : symbol return ""; ->"" : string +>"" : "" } get [Symbol.toPrimitive]() { >Symbol.toPrimitive : symbol @@ -16,6 +16,6 @@ class C { >toPrimitive : symbol return ""; ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/symbolProperty46.errors.txt b/tests/baselines/reference/symbolProperty46.errors.txt index 68f86afc31549..3756f2c52713e 100644 --- a/tests/baselines/reference/symbolProperty46.errors.txt +++ b/tests/baselines/reference/symbolProperty46.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/Symbols/symbolProperty46.ts(10,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/es6/Symbols/symbolProperty46.ts(10,1): error TS2322: Type '0' is not assignable to type 'string'. ==== tests/cases/conformance/es6/Symbols/symbolProperty46.ts (1 errors) ==== @@ -13,5 +13,5 @@ tests/cases/conformance/es6/Symbols/symbolProperty46.ts(10,1): error TS2322: Typ (new C)[Symbol.hasInstance] = 0; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '0' is not assignable to type 'string'. (new C)[Symbol.hasInstance] = ""; \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty47.errors.txt b/tests/baselines/reference/symbolProperty47.errors.txt index b35650f94bb3f..2e15085eb24a9 100644 --- a/tests/baselines/reference/symbolProperty47.errors.txt +++ b/tests/baselines/reference/symbolProperty47.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/Symbols/symbolProperty47.ts(3,16): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/es6/Symbols/symbolProperty47.ts(11,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/Symbols/symbolProperty47.ts(3,16): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/es6/Symbols/symbolProperty47.ts(11,1): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/conformance/es6/Symbols/symbolProperty47.ts (2 errors) ==== @@ -7,7 +7,7 @@ tests/cases/conformance/es6/Symbols/symbolProperty47.ts(11,1): error TS2322: Typ get [Symbol.hasInstance]() { return ""; ~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. } // Should take a string set [Symbol.hasInstance](x: number) { @@ -17,4 +17,4 @@ tests/cases/conformance/es6/Symbols/symbolProperty47.ts(11,1): error TS2322: Typ (new C)[Symbol.hasInstance] = 0; (new C)[Symbol.hasInstance] = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '""' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty5.types b/tests/baselines/reference/symbolProperty5.types index b338f94f6d325..833b6aa525d9b 100644 --- a/tests/baselines/reference/symbolProperty5.types +++ b/tests/baselines/reference/symbolProperty5.types @@ -7,7 +7,7 @@ var x = { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 [Symbol.toPrimitive]() { }, >Symbol.toPrimitive : symbol @@ -20,6 +20,6 @@ var x = { >toStringTag : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/symbolProperty55.types b/tests/baselines/reference/symbolProperty55.types index 8c438bbf44520..3d56c268267c6 100644 --- a/tests/baselines/reference/symbolProperty55.types +++ b/tests/baselines/reference/symbolProperty55.types @@ -7,7 +7,7 @@ var obj = { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/symbolProperty56.types b/tests/baselines/reference/symbolProperty56.types index 8799890874525..63f6317e219df 100644 --- a/tests/baselines/reference/symbolProperty56.types +++ b/tests/baselines/reference/symbolProperty56.types @@ -7,7 +7,7 @@ var obj = { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 }; @@ -24,5 +24,5 @@ module M { >obj : { [Symbol.iterator]: number; } >Symbol["iterator"] : any >Symbol : {} ->"iterator" : string +>"iterator" : "iterator" } diff --git a/tests/baselines/reference/symbolProperty57.types b/tests/baselines/reference/symbolProperty57.types index b0c02052e58b9..6a4920b8e2f8a 100644 --- a/tests/baselines/reference/symbolProperty57.types +++ b/tests/baselines/reference/symbolProperty57.types @@ -7,7 +7,7 @@ var obj = { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 }; @@ -17,5 +17,5 @@ obj[Symbol["nonsense"]]; >obj : { [Symbol.iterator]: number; } >Symbol["nonsense"] : any >Symbol : SymbolConstructor ->"nonsense" : string +>"nonsense" : "nonsense" diff --git a/tests/baselines/reference/symbolProperty6.types b/tests/baselines/reference/symbolProperty6.types index a378acf1bbee2..a9fe1178e0753 100644 --- a/tests/baselines/reference/symbolProperty6.types +++ b/tests/baselines/reference/symbolProperty6.types @@ -6,7 +6,7 @@ class C { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 [Symbol.unscopables]: number; >Symbol.unscopables : symbol @@ -24,6 +24,6 @@ class C { >toStringTag : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/symbolType11.types b/tests/baselines/reference/symbolType11.types index 903c4ec0ecc2b..ec474dcdb54a6 100644 --- a/tests/baselines/reference/symbolType11.types +++ b/tests/baselines/reference/symbolType11.types @@ -5,7 +5,7 @@ var s = Symbol.for("logical"); >Symbol.for : (key: string) => symbol >Symbol : SymbolConstructor >for : (key: string) => symbol ->"logical" : string +>"logical" : "logical" s && s; >s && s : symbol @@ -18,8 +18,8 @@ s && []; >[] : undefined[] 0 && s; ->0 && s : symbol ->0 : number +>0 && s : 0 +>0 : 0 >s : symbol s || s; @@ -28,9 +28,9 @@ s || s; >s : symbol s || 1; ->s || 1 : number | symbol +>s || 1 : symbol | 1 >s : symbol ->1 : number +>1 : 1 ({}) || s; >({}) || s : {} diff --git a/tests/baselines/reference/symbolType12.errors.txt b/tests/baselines/reference/symbolType12.errors.txt index adceb58ae56d0..b6034c62eeca1 100644 --- a/tests/baselines/reference/symbolType12.errors.txt +++ b/tests/baselines/reference/symbolType12.errors.txt @@ -8,7 +8,7 @@ tests/cases/conformance/es6/Symbols/symbolType12.ts(7,1): error TS2362: The left tests/cases/conformance/es6/Symbols/symbolType12.ts(7,6): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es6/Symbols/symbolType12.ts(8,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es6/Symbols/symbolType12.ts(9,1): error TS2365: Operator '+=' cannot be applied to types 'symbol' and 'symbol'. -tests/cases/conformance/es6/Symbols/symbolType12.ts(10,1): error TS2365: Operator '+=' cannot be applied to types 'symbol' and 'number'. +tests/cases/conformance/es6/Symbols/symbolType12.ts(10,1): error TS2365: Operator '+=' cannot be applied to types 'symbol' and '0'. tests/cases/conformance/es6/Symbols/symbolType12.ts(11,1): error TS2469: The '+=' operator cannot be applied to type 'symbol'. tests/cases/conformance/es6/Symbols/symbolType12.ts(12,8): error TS2469: The '+=' operator cannot be applied to type 'symbol'. tests/cases/conformance/es6/Symbols/symbolType12.ts(13,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -67,7 +67,7 @@ tests/cases/conformance/es6/Symbols/symbolType12.ts(28,8): error TS2469: The '+= !!! error TS2365: Operator '+=' cannot be applied to types 'symbol' and 'symbol'. s += 0; ~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'symbol' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'symbol' and '0'. s += ""; ~ !!! error TS2469: The '+=' operator cannot be applied to type 'symbol'. diff --git a/tests/baselines/reference/symbolType6.errors.txt b/tests/baselines/reference/symbolType6.errors.txt index 29d894c2afb3f..42940ac196148 100644 --- a/tests/baselines/reference/symbolType6.errors.txt +++ b/tests/baselines/reference/symbolType6.errors.txt @@ -3,10 +3,10 @@ tests/cases/conformance/es6/Symbols/symbolType6.ts(4,1): error TS2362: The left- tests/cases/conformance/es6/Symbols/symbolType6.ts(4,5): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es6/Symbols/symbolType6.ts(5,1): error TS2469: The '+' operator cannot be applied to type 'symbol'. tests/cases/conformance/es6/Symbols/symbolType6.ts(6,1): error TS2469: The '+' operator cannot be applied to type 'symbol'. -tests/cases/conformance/es6/Symbols/symbolType6.ts(7,1): error TS2365: Operator '+' cannot be applied to types 'symbol' and 'number'. +tests/cases/conformance/es6/Symbols/symbolType6.ts(7,1): error TS2365: Operator '+' cannot be applied to types 'symbol' and '0'. tests/cases/conformance/es6/Symbols/symbolType6.ts(8,6): error TS2469: The '+' operator cannot be applied to type 'symbol'. tests/cases/conformance/es6/Symbols/symbolType6.ts(9,5): error TS2469: The '+' operator cannot be applied to type 'symbol'. -tests/cases/conformance/es6/Symbols/symbolType6.ts(10,1): error TS2365: Operator '+' cannot be applied to types 'number' and 'symbol'. +tests/cases/conformance/es6/Symbols/symbolType6.ts(10,1): error TS2365: Operator '+' cannot be applied to types '0' and 'symbol'. tests/cases/conformance/es6/Symbols/symbolType6.ts(11,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es6/Symbols/symbolType6.ts(12,5): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es6/Symbols/symbolType6.ts(14,1): error TS2469: The '+' operator cannot be applied to type 'symbol'. @@ -32,7 +32,7 @@ tests/cases/conformance/es6/Symbols/symbolType6.ts(15,6): error TS2469: The '+' !!! error TS2469: The '+' operator cannot be applied to type 'symbol'. s + 0; ~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'symbol' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'symbol' and '0'. "" + s; ~ !!! error TS2469: The '+' operator cannot be applied to type 'symbol'. @@ -41,7 +41,7 @@ tests/cases/conformance/es6/Symbols/symbolType6.ts(15,6): error TS2469: The '+' !!! error TS2469: The '+' operator cannot be applied to type 'symbol'. 0 + s; ~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'symbol'. +!!! error TS2365: Operator '+' cannot be applied to types '0' and 'symbol'. s - 0; ~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. diff --git a/tests/baselines/reference/systemModule1.types b/tests/baselines/reference/systemModule1.types index 2adf73d116f88..927b88f4b54cf 100644 --- a/tests/baselines/reference/systemModule1.types +++ b/tests/baselines/reference/systemModule1.types @@ -2,5 +2,5 @@ export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/systemModule13.types b/tests/baselines/reference/systemModule13.types index f31b082541613..ec85746d2bb55 100644 --- a/tests/baselines/reference/systemModule13.types +++ b/tests/baselines/reference/systemModule13.types @@ -5,9 +5,9 @@ export let [x,y,z] = [1, 2, 3]; >y : number >z : number >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; >a : any @@ -17,16 +17,16 @@ export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; >z1 : string >{a: true, b: {c: "123"}} : { a: boolean; b: { c: string; }; } >a : boolean ->true : boolean +>true : true >b : { c: string; } >{c: "123"} : { c: string; } >c : string ->"123" : string +>"123" : "123" for ([x] of [[1]]) {} >[x] : [number] >x : number >[[1]] : number[][] >[1] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/systemModule15.types b/tests/baselines/reference/systemModule15.types index 502638dab93bf..b3f5c0434044f 100644 --- a/tests/baselines/reference/systemModule15.types +++ b/tests/baselines/reference/systemModule15.types @@ -58,7 +58,7 @@ export { export var value = "youpi"; >value : string ->"youpi" : string +>"youpi" : "youpi" export default value; >value : string @@ -67,5 +67,5 @@ export default value; export var value2 = "v"; >value2 : string ->"v" : string +>"v" : "v" diff --git a/tests/baselines/reference/systemModule17.types b/tests/baselines/reference/systemModule17.types index 1f0b1b518425d..c0a0a7dc58432 100644 --- a/tests/baselines/reference/systemModule17.types +++ b/tests/baselines/reference/systemModule17.types @@ -11,7 +11,7 @@ export interface I {} var x = 1; >x : number ->1 : number +>1 : 1 interface I { } >I : I @@ -21,7 +21,7 @@ namespace N { export var x = 1; >x : number ->1 : number +>1 : 1 export interface I { } >I : I diff --git a/tests/baselines/reference/systemModule4.types b/tests/baselines/reference/systemModule4.types index 2029cdb88d7f2..8a871a987a7f8 100644 --- a/tests/baselines/reference/systemModule4.types +++ b/tests/baselines/reference/systemModule4.types @@ -2,7 +2,7 @@ export var x = 1; >x : number ->1 : number +>1 : 1 export var y; >y : any diff --git a/tests/baselines/reference/systemModule7.types b/tests/baselines/reference/systemModule7.types index 650e2d6cdb1e7..33003f5fa37d7 100644 --- a/tests/baselines/reference/systemModule7.types +++ b/tests/baselines/reference/systemModule7.types @@ -6,7 +6,7 @@ export module M { var x = 1; >x : number ->1 : number +>1 : 1 } // filename: nonInstantiatedModule.ts diff --git a/tests/baselines/reference/systemModule8.types b/tests/baselines/reference/systemModule8.types index 940067c5653ee..f31e77c346d1e 100644 --- a/tests/baselines/reference/systemModule8.types +++ b/tests/baselines/reference/systemModule8.types @@ -4,9 +4,9 @@ export var x; >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 x++; >x++ : number @@ -27,98 +27,98 @@ x--; x += 1; >x += 1 : any >x : any ->1 : number +>1 : 1 x -= 1; >x -= 1 : number >x : any ->1 : number +>1 : 1 x *= 1; >x *= 1 : number >x : any ->1 : number +>1 : 1 x /= 1; >x /= 1 : number >x : any ->1 : number +>1 : 1 x |= 1; >x |= 1 : number >x : any ->1 : number +>1 : 1 x &= 1; >x &= 1 : number >x : any ->1 : number +>1 : 1 x + 1; >x + 1 : any >x : any ->1 : number +>1 : 1 x - 1; >x - 1 : number >x : any ->1 : number +>1 : 1 x & 1; >x & 1 : number >x : any ->1 : number +>1 : 1 x | 1; >x | 1 : number >x : any ->1 : number +>1 : 1 for (x = 5;;x++) {} ->x = 5 : number +>x = 5 : 5 >x : any ->5 : number +>5 : 5 >x++ : number >x : any for (x = 8;;x--) {} ->x = 8 : number +>x = 8 : 8 >x : any ->8 : number +>8 : 8 >x-- : number >x : any for (x = 15;;++x) {} ->x = 15 : number +>x = 15 : 15 >x : any ->15 : number +>15 : 15 >++x : number >x : any for (x = 18;;--x) {} ->x = 18 : number +>x = 18 : 18 >x : any ->18 : number +>18 : 18 >--x : number >x : any for (let x = 50;;) {} >x : number ->50 : number +>50 : 50 function foo() { >foo : () => void x = 100; ->x = 100 : number +>x = 100 : 100 >x : any ->100 : number +>100 : 100 } export let [y] = [1]; >y : number >[1] : [number] ->1 : number +>1 : 1 export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; >a : any @@ -128,16 +128,16 @@ export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; >z1 : string >{a: true, b: {c: "123"}} : { a: boolean; b: { c: string; }; } >a : boolean ->true : boolean +>true : true >b : { c: string; } >{c: "123"} : { c: string; } >c : string ->"123" : string +>"123" : "123" for ([x] of [[1]]) {} >[x] : [any] >x : any >[[1]] : number[][] >[1] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/systemModuleAmbientDeclarations.types b/tests/baselines/reference/systemModuleAmbientDeclarations.types index 3633f922881d0..04c4f2d49df7e 100644 --- a/tests/baselines/reference/systemModuleAmbientDeclarations.types +++ b/tests/baselines/reference/systemModuleAmbientDeclarations.types @@ -12,7 +12,7 @@ declare class C {} declare enum E {X = 1}; >E : E >X : E ->1 : number +>1 : 1 export var promise = Promise; >promise : typeof Promise @@ -46,7 +46,7 @@ export declare var v: number; export declare enum E {X = 1} >E : E >X : E ->1 : number +>1 : 1 === tests/cases/compiler/file6.ts === export declare module M { var v: number; } diff --git a/tests/baselines/reference/systemModuleTargetES6.types b/tests/baselines/reference/systemModuleTargetES6.types index 5a9801a5d891f..193507fca899f 100644 --- a/tests/baselines/reference/systemModuleTargetES6.types +++ b/tests/baselines/reference/systemModuleTargetES6.types @@ -7,7 +7,7 @@ export class MyClass2 { static value = 42; >value : number ->42 : number +>42 : 42 static getInstance() { return MyClass2.value; } >getInstance : () => number diff --git a/tests/baselines/reference/taggedTemplateContextualTyping1.types b/tests/baselines/reference/taggedTemplateContextualTyping1.types index 2ccf8798dfd79..4e207a0d6bbaf 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping1.types +++ b/tests/baselines/reference/taggedTemplateContextualTyping1.types @@ -48,7 +48,7 @@ function tempTag1(...rest: any[]): T { // and it is an error to invoke an any-typed value with type arguments, // so this test will error. tempTag1 `${ x => { x(undefined); return x; } }${ 10 }`; ->tempTag1 `${ x => { x(undefined); return x; } }${ 10 }` : number +>tempTag1 `${ x => { x(undefined); return x; } }${ 10 }` : 10 >tempTag1 : { (templateStrs: TemplateStringsArray, f: FuncType, x: T): T; (templateStrs: TemplateStringsArray, f: FuncType, h: FuncType, x: T): T; } >`${ x => { x(undefined); return x; } }${ 10 }` : string >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -57,10 +57,10 @@ tempTag1 `${ x => { x(undefined); return x; } }${ 10 } >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 tempTag1 `${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }`; ->tempTag1 `${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }` : number +>tempTag1 `${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }` : 10 >tempTag1 : { (templateStrs: TemplateStringsArray, f: FuncType, x: T): T; (templateStrs: TemplateStringsArray, f: FuncType, h: FuncType, x: T): T; } >`${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }` : string >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -75,7 +75,7 @@ tempTag1 `${ x => { x(undefined); return x; } }${ y => >y : (p: T) => T >undefined : undefined >y : (p: T) => T ->10 : number +>10 : 10 tempTag1 `${ x => { x(undefined); return x; } }${ (y: (p: T) => T) => { y(undefined); return y } }${ undefined }`; >tempTag1 `${ x => { x(undefined); return x; } }${ (y: (p: T) => T) => { y(undefined); return y } }${ undefined }` : any diff --git a/tests/baselines/reference/taggedTemplateContextualTyping2.types b/tests/baselines/reference/taggedTemplateContextualTyping2.types index 02dcbd2275380..2dbf2c53c8b3b 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping2.types +++ b/tests/baselines/reference/taggedTemplateContextualTyping2.types @@ -59,7 +59,7 @@ tempTag2 `${ x => { x(undefined); return x; } }${ 0 }`; >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->0 : number +>0 : 0 tempTag2 `${ x => { x(undefined); return x; } }${ y => { y(null); return y; } }${ "hello" }`; >tempTag2 `${ x => { x(undefined); return x; } }${ y => { y(null); return y; } }${ "hello" }` : string @@ -77,7 +77,7 @@ tempTag2 `${ x => { x(undefined); return x; } }${ y => { yy : (p: T) => T >null : null >y : (p: T) => T ->"hello" : string +>"hello" : "hello" tempTag2 `${ x => { x(undefined); return x; } }${ undefined }${ "hello" }`; >tempTag2 `${ x => { x(undefined); return x; } }${ undefined }${ "hello" }` : string @@ -90,5 +90,5 @@ tempTag2 `${ x => { x(undefined); return x; } }${ undefined }${ >undefined : undefined >x : (p: T) => T >undefined : undefined ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types index 329ce9c3b21eb..e42bf52c005d4 100644 --- a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types +++ b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types @@ -8,5 +8,5 @@ f `\x0D${ "Interrupted CRLF" }\x0A`; >f `\x0D${ "Interrupted CRLF" }\x0A` : void >f : (...args: any[]) => void >`\x0D${ "Interrupted CRLF" }\x0A` : string ->"Interrupted CRLF" : string +>"Interrupted CRLF" : "Interrupted CRLF" diff --git a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types index f350b6137a7fd..1b5fefe9c9ee0 100644 --- a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types +++ b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types @@ -8,5 +8,5 @@ f `\x0D${ "Interrupted CRLF" }\x0A`; >f `\x0D${ "Interrupted CRLF" }\x0A` : void >f : (...args: any[]) => void >`\x0D${ "Interrupted CRLF" }\x0A` : string ->"Interrupted CRLF" : string +>"Interrupted CRLF" : "Interrupted CRLF" diff --git a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types index 9b02e0d3fb3e0..6619696bb3900 100644 --- a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types +++ b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types @@ -3,33 +3,33 @@ `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` >`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " diff --git a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types index ed2291262839f..2fae6446989cf 100644 --- a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types @@ -10,33 +10,33 @@ f `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " >f `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : void >f : (...x: any[]) => void >`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt index b345e971ab286..2ead58862b64e 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(64,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(77,79): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. @@ -72,7 +72,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. var a9a: {}; // Generic tag with multiple parameters of generic type passed arguments with multiple best common types diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt index 619e5081a3be9..781456b8bbbef 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(63,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(76,79): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. @@ -71,7 +71,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. var a9a: {}; // Generic tag with multiple parameters of generic type passed arguments with multiple best common types diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt index 44b30fb535fec..0634338986850 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,57): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,25): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,57): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts (6 errors) ==== @@ -22,31 +22,31 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped f `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`.member f `abc${1}def${2}ghi`.member; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`["member"]; f `abc${1}def${2}ghi`["member"]; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`[0].member `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt index c2825c19e6373..9d1ee541e4f2b 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(14,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(18,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(22,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(24,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(26,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(28,57): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(14,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(18,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(22,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(24,25): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(26,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(28,57): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts (6 errors) ==== @@ -22,31 +22,31 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped f `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`.member f `abc${1}def${2}ghi`.member; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`["member"]; f `abc${1}def${2}ghi`["member"]; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`[0].member `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types index 34d9e71dcabc7..f10c493dbd9f6 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types @@ -36,10 +36,10 @@ var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; >f `abc${ 0 }def` : I >f : I >`abc${ 0 }def` : string ->0 : number +>0 : 0 >member : new (s: string) => new (n: number) => new () => boolean ->"hello" : string ->42 : number +>"hello" : "hello" +>42 : 42 >true : true diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types index b57b1ba40aa98..23923ab718062 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types @@ -36,10 +36,10 @@ var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; >f `abc${ 0 }def` : I >f : I >`abc${ 0 }def` : string ->0 : number +>0 : 0 >member : new (s: string) => new (n: number) => new () => boolean ->"hello" : string ->42 : number +>"hello" : "hello" +>42 : 42 >true : true diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index 426eef8ce7fd3..e9c9e0ed6e05f 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target. @@ -43,7 +43,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) ~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index 73adc0c0302bb..d7817e32ee0ca 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target. @@ -43,7 +43,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) ~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types index 3c35974ddec13..38b2087ccbf6a 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types @@ -24,14 +24,14 @@ var a = foo1 `${1}`; >foo1 `${1}` : string >foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } >`${1}` : string ->1 : number +>1 : 1 var b = foo1([], 1); >b : number >foo1([], 1) : number >foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } >[] : undefined[] ->1 : number +>1 : 1 function foo2(strs: string[], x: number): number; >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } @@ -57,12 +57,12 @@ var c = foo2 `${1}`; >foo2 `${1}` : string >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } >`${1}` : string ->1 : number +>1 : 1 var d = foo2([], 1); >d : number >foo2([], 1) : number >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } >[] : undefined[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types index 7faeec19c4a70..41caabef752b5 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types @@ -23,14 +23,14 @@ var a = foo1 `${1}`; >foo1 `${1}` : string >foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } >`${1}` : string ->1 : number +>1 : 1 var b = foo1([], 1); >b : number >foo1([], 1) : number >foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } >[] : undefined[] ->1 : number +>1 : 1 function foo2(strs: string[], x: number): number; >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } @@ -56,12 +56,12 @@ var c = foo2 `${1}`; >foo2 `${1}` : string >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } >`${1}` : string ->1 : number +>1 : 1 var d = foo2([], 1); >d : number >foo2([], 1) : number >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } >[] : undefined[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index 0d65c3fd13bd8..2248fee5ceb13 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(19,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,18): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,18): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(70,18): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -77,10 +77,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index e65acdee835bf..7329ade1b64d8 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -76,10 +76,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types index d1f56f387d68b..b0accf616afbe 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types @@ -11,5 +11,5 @@ declare `Hello ${0} world!`; >declare `Hello ${0} world!` : void >declare : (x: any, ...ys: any[]) => void >`Hello ${0} world!` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types index e2274f82ff71e..6e474bf3474c7 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types @@ -10,5 +10,5 @@ declare `Hello ${0} world!`; >declare `Hello ${0} world!` : void >declare : (x: any, ...ys: any[]) => void >`Hello ${0} world!` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types index 0db2a3bb96392..9e894240c939d 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types @@ -11,8 +11,8 @@ f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.g.h `abc` >f.g.h `abc` : any @@ -31,8 +31,8 @@ f.g.h `abc${1}def${2}ghi`; >g : any >h : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc`.member >f `abc`.member : any @@ -46,8 +46,8 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 >member : any f `abc`["member"]; @@ -55,16 +55,16 @@ f `abc`["member"]; >f `abc` : any >f : any >`abc` : string ->"member" : string +>"member" : "member" f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : any >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc`["member"].someOtherTag `abc${1}def${2}ghi` : any @@ -73,11 +73,11 @@ f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc` : any >f : any >`abc` : string ->"member" : string +>"member" : "member" >someOtherTag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi` : any @@ -86,13 +86,13 @@ f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" >someOtherTag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.thisIsNotATag(`abc`); >f.thisIsNotATag(`abc`) : any @@ -107,6 +107,6 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f : any >thisIsNotATag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types index 1a6ffb5eba06d..99bb10f354616 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types @@ -11,8 +11,8 @@ f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.g.h `abc` >f.g.h `abc` : any @@ -31,8 +31,8 @@ f.g.h `abc${1}def${2}ghi`; >g : any >h : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc`.member >f `abc`.member : any @@ -46,8 +46,8 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 >member : any f `abc`["member"]; @@ -55,16 +55,16 @@ f `abc`["member"]; >f `abc` : any >f : any >`abc` : string ->"member" : string +>"member" : "member" f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : any >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc`["member"].someOtherTag `abc${1}def${2}ghi` : any @@ -73,11 +73,11 @@ f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc` : any >f : any >`abc` : string ->"member" : string +>"member" : "member" >someOtherTag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi` : any @@ -86,13 +86,13 @@ f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" >someOtherTag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.thisIsNotATag(`abc`); >f.thisIsNotATag(`abc`) : any @@ -107,6 +107,6 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f : any >thisIsNotATag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt index 88bfac2321188..6da8d2ffce38d 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts(6,31): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts(6,31): error TS2322: Type '"bad"' is not assignable to type 'number'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFuncti foo `${function (x: number) { x = "bad"; } }`; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '"bad"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt index 6b0f4b642ff68..c1d18cd6f9123 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts(5,31): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts(5,31): error TS2322: Type '"bad"' is not assignable to type 'number'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts (1 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFuncti foo `${function (x: number) { x = "bad"; } }`; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '"bad"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types index c7c521154c744..69b9368f765a9 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types @@ -42,8 +42,8 @@ f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc`.member >f `abc`.member : I @@ -57,8 +57,8 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 >member : I f `abc`["member"]; @@ -66,16 +66,16 @@ f `abc`["member"]; >f `abc` : I >f : I >`abc` : string ->"member" : string +>"member" : "member" f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" f `abc`[0].member `abc${1}def${2}ghi`; >f `abc`[0].member `abc${1}def${2}ghi` : I @@ -84,11 +84,11 @@ f `abc`[0].member `abc${1}def${2}ghi`; >f `abc` : I >f : I >`abc` : string ->0 : number +>0 : 0 >member : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi` : I @@ -97,13 +97,13 @@ f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" >member : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.thisIsNotATag(`abc`); >f.thisIsNotATag(`abc`) : void @@ -118,6 +118,6 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f : I >thisIsNotATag : (x: string) => void >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types index bf45144c32953..97e2f011ca669 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types @@ -42,8 +42,8 @@ f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc`.member >f `abc`.member : I @@ -57,8 +57,8 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 >member : I f `abc`["member"]; @@ -66,16 +66,16 @@ f `abc`["member"]; >f `abc` : I >f : I >`abc` : string ->"member" : string +>"member" : "member" f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" f `abc`[0].member `abc${1}def${2}ghi`; >f `abc`[0].member `abc${1}def${2}ghi` : I @@ -84,11 +84,11 @@ f `abc`[0].member `abc${1}def${2}ghi`; >f `abc` : I >f : I >`abc` : string ->0 : number +>0 : 0 >member : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi` : I @@ -97,13 +97,13 @@ f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" >member : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.thisIsNotATag(`abc`); >f.thisIsNotATag(`abc`) : void @@ -118,6 +118,6 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f : I >thisIsNotATag : (x: string) => void >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types index 7b09b5c574673..4b9b447d32a32 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types +++ b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types @@ -8,5 +8,5 @@ f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'`; >f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : void >f : (...args: any[]) => void >`'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : string ->" should be converted to " : string +>" should be converted to " : " should be converted to " diff --git a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types index ad4c5cc67a9b2..36a298c5a38e9 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types @@ -8,5 +8,5 @@ f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'`; >f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : void >f : (...args: any[]) => void >`'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : string ->" should be converted to " : string +>" should be converted to " : " should be converted to " diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt index 33d93b43f13c9..ca306a8ad8b20 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts(6,18): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts(6,18): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts(6,23): error TS1109: Expression expected. @@ -10,6 +10,6 @@ tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts(6,23): // Incomplete call, not enough parameters. f `123qdawdrqw${ 1 }${ ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt index c577896aec7d1..a5d3f132b69e9 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts(6,18): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts(6,18): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts(6,23): error TS1109: Expression expected. @@ -10,6 +10,6 @@ tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts(6,23): // Incomplete call, not enough parameters, at EOF. f `123qdawdrqw${ 1 }${ ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/targetTypeArgs.types b/tests/baselines/reference/targetTypeArgs.types index 48dd35401b419..84985316aa2d6 100644 --- a/tests/baselines/reference/targetTypeArgs.types +++ b/tests/baselines/reference/targetTypeArgs.types @@ -7,7 +7,7 @@ function foo(callback: (x: string) => void) { callback("hello"); >callback("hello") : void >callback : (x: string) => void ->"hello" : string +>"hello" : "hello" } foo(function(x) { x }); @@ -21,7 +21,7 @@ foo(function(x) { x }); >[1].forEach(function(v,i,a) { v }) : void >[1].forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void >[1] : number[] ->1 : number +>1 : 1 >forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void >function(v,i,a) { v } : (v: number, i: number, a: number[]) => void >v : number @@ -33,7 +33,7 @@ foo(function(x) { x }); >["hello"].every(function(v,i,a) {return true;}) : boolean >["hello"].every : (callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any) => boolean >["hello"] : string[] ->"hello" : string +>"hello" : "hello" >every : (callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any) => boolean >function(v,i,a) {return true;} : (v: string, i: number, a: string[]) => true >v : string @@ -45,7 +45,7 @@ foo(function(x) { x }); >[1].every(function(v,i,a) {return true;}) : boolean >[1].every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean >[1] : number[] ->1 : number +>1 : 1 >every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean >function(v,i,a) {return true;} : (v: number, i: number, a: number[]) => true >v : number @@ -57,7 +57,7 @@ foo(function(x) { x }); >[1].every(function(v,i,a) {return true;}) : boolean >[1].every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean >[1] : number[] ->1 : number +>1 : 1 >every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean >function(v,i,a) {return true;} : (v: number, i: number, a: number[]) => true >v : number @@ -69,7 +69,7 @@ foo(function(x) { x }); >["s"].every(function(v,i,a) {return true;}) : boolean >["s"].every : (callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any) => boolean >["s"] : string[] ->"s" : string +>"s" : "s" >every : (callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any) => boolean >function(v,i,a) {return true;} : (v: string, i: number, a: string[]) => true >v : string @@ -81,7 +81,7 @@ foo(function(x) { x }); >["s"].forEach(function(v,i,a) { v }) : void >["s"].forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void >["s"] : string[] ->"s" : string +>"s" : "s" >forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void >function(v,i,a) { v } : (v: string, i: number, a: string[]) => void >v : string diff --git a/tests/baselines/reference/targetTypeBaseCalls.errors.txt b/tests/baselines/reference/targetTypeBaseCalls.errors.txt index 37a00c9798d91..0ff253d138985 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.errors.txt +++ b/tests/baselines/reference/targetTypeBaseCalls.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/targetTypeBaseCalls.ts(9,19): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/targetTypeBaseCalls.ts(13,23): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(9,19): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(13,23): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2322: Type '5' is not assignable to type 'string'. ==== tests/cases/compiler/targetTypeBaseCalls.ts (3 errors) ==== @@ -14,17 +14,17 @@ tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2322: Type 'number' foo(function(s) { s = 5 }); // Error, can’t assign number to string ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. new Foo(function(s) { s = 5 }); // error, if types are applied correctly ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. class Bar extends Foo { constructor() { super(function(s) { s = 5 }) } } // error, if types are applied correctly ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/targetTypeCalls.types b/tests/baselines/reference/targetTypeCalls.types index 6e9c1ca190dec..1ceb86a3a09e0 100644 --- a/tests/baselines/reference/targetTypeCalls.types +++ b/tests/baselines/reference/targetTypeCalls.types @@ -14,7 +14,7 @@ var fra2: (v:any)=>number = function() { return function () { return 0; } }() // >function() { return function () { return 0; } }() : () => number >function() { return function () { return 0; } } : () => () => number >function () { return 0; } : () => number ->0 : number +>0 : 0 var fra3: (v:any)=>string = function() { return function() { return function(v) {return v;};}(); }() // should work >fra3 : (v: any) => string diff --git a/tests/baselines/reference/targetTypeObjectLiteral.types b/tests/baselines/reference/targetTypeObjectLiteral.types index 8f77c11f7b65a..5f80a01bf0cb9 100644 --- a/tests/baselines/reference/targetTypeObjectLiteral.types +++ b/tests/baselines/reference/targetTypeObjectLiteral.types @@ -8,7 +8,7 @@ var z: { x: number; y: (w:string)=>number;} = { x: 12, >x : number ->12 : number +>12 : 12 y: function(w) { >y : (w: string) => number @@ -16,7 +16,7 @@ var z: { x: number; y: (w:string)=>number;} = { >w : string return 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/targetTypeObjectLiteralToAny.types b/tests/baselines/reference/targetTypeObjectLiteralToAny.types index b6bd1e910514b..1dd81b33603af 100644 --- a/tests/baselines/reference/targetTypeObjectLiteralToAny.types +++ b/tests/baselines/reference/targetTypeObjectLiteralToAny.types @@ -25,7 +25,7 @@ function suggest(){ >text : string >keyword : string >type : string ->"keyword" : string +>"keyword" : "keyword" }); } diff --git a/tests/baselines/reference/targetTypeTest2.types b/tests/baselines/reference/targetTypeTest2.types index 25b36f948c6c0..d3a4bc66dbb62 100644 --- a/tests/baselines/reference/targetTypeTest2.types +++ b/tests/baselines/reference/targetTypeTest2.types @@ -5,9 +5,9 @@ var a : any[] = [1,2,"3"]; >a : any[] >[1,2,"3"] : (string | number)[] ->1 : number ->2 : number ->"3" : string +>1 : 1 +>2 : 2 +>"3" : "3" function func1(stuff:any[]) { return stuff; } diff --git a/tests/baselines/reference/templateStringBinaryOperations.types b/tests/baselines/reference/templateStringBinaryOperations.types index d4b8c531ef4b0..01d306487ee01 100644 --- a/tests/baselines/reference/templateStringBinaryOperations.types +++ b/tests/baselines/reference/templateStringBinaryOperations.types @@ -2,440 +2,440 @@ var a = 1 + `${ 3 }`; >a : string >1 + `${ 3 }` : string ->1 : number +>1 : 1 >`${ 3 }` : string ->3 : number +>3 : 3 var b = 1 + `2${ 3 }`; >b : string >1 + `2${ 3 }` : string ->1 : number +>1 : 1 >`2${ 3 }` : string ->3 : number +>3 : 3 var c = 1 + `${ 3 }4`; >c : string >1 + `${ 3 }4` : string ->1 : number +>1 : 1 >`${ 3 }4` : string ->3 : number +>3 : 3 var d = 1 + `2${ 3 }4`; >d : string >1 + `2${ 3 }4` : string ->1 : number +>1 : 1 >`2${ 3 }4` : string ->3 : number +>3 : 3 var e = `${ 3 }` + 5; >e : string >`${ 3 }` + 5 : string >`${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var f = `2${ 3 }` + 5; >f : string >`2${ 3 }` + 5 : string >`2${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var g = `${ 3 }4` + 5; >g : string >`${ 3 }4` + 5 : string >`${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var h = `2${ 3 }4` + 5; >h : string >`2${ 3 }4` + 5 : string >`2${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var i = 1 + `${ 3 }` + 5; >i : string >1 + `${ 3 }` + 5 : string >1 + `${ 3 }` : string ->1 : number +>1 : 1 >`${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var j = 1 + `2${ 3 }` + 5; >j : string >1 + `2${ 3 }` + 5 : string >1 + `2${ 3 }` : string ->1 : number +>1 : 1 >`2${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var k = 1 + `${ 3 }4` + 5; >k : string >1 + `${ 3 }4` + 5 : string >1 + `${ 3 }4` : string ->1 : number +>1 : 1 >`${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var l = 1 + `2${ 3 }4` + 5; >l : string >1 + `2${ 3 }4` + 5 : string >1 + `2${ 3 }4` : string ->1 : number +>1 : 1 >`2${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var a2 = 1 + `${ 3 - 4 }`; >a2 : string >1 + `${ 3 - 4 }` : string ->1 : number +>1 : 1 >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b2 = 1 + `2${ 3 - 4 }`; >b2 : string >1 + `2${ 3 - 4 }` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c2 = 1 + `${ 3 - 4 }5`; >c2 : string >1 + `${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d2 = 1 + `2${ 3 - 4 }5`; >d2 : string >1 + `2${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e2 = `${ 3 - 4 }` + 6; >e2 : string >`${ 3 - 4 }` + 6 : string >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f2 = `2${ 3 - 4 }` + 6; >f2 : string >`2${ 3 - 4 }` + 6 : string >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g2 = `${ 3 - 4 }5` + 6; >g2 : string >`${ 3 - 4 }5` + 6 : string >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h2 = `2${ 3 - 4 }5` + 6; >h2 : string >`2${ 3 - 4 }5` + 6 : string >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i2 = 1 + `${ 3 - 4 }` + 6; >i2 : string >1 + `${ 3 - 4 }` + 6 : string >1 + `${ 3 - 4 }` : string ->1 : number +>1 : 1 >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j2 = 1 + `2${ 3 - 4 }` + 6; >j2 : string >1 + `2${ 3 - 4 }` + 6 : string >1 + `2${ 3 - 4 }` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k2 = 1 + `${ 3 - 4 }5` + 6; >k2 : string >1 + `${ 3 - 4 }5` + 6 : string >1 + `${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l2 = 1 + `2${ 3 - 4 }5` + 6; >l2 : string >1 + `2${ 3 - 4 }5` + 6 : string >1 + `2${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var a3 = 1 + `${ 3 * 4 }`; >a3 : string >1 + `${ 3 * 4 }` : string ->1 : number +>1 : 1 >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b3 = 1 + `2${ 3 * 4 }`; >b3 : string >1 + `2${ 3 * 4 }` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c3 = 1 + `${ 3 * 4 }5`; >c3 : string >1 + `${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d3 = 1 + `2${ 3 * 4 }5`; >d3 : string >1 + `2${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e3 = `${ 3 * 4 }` + 6; >e3 : string >`${ 3 * 4 }` + 6 : string >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f3 = `2${ 3 * 4 }` + 6; >f3 : string >`2${ 3 * 4 }` + 6 : string >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g3 = `${ 3 * 4 }5` + 6; >g3 : string >`${ 3 * 4 }5` + 6 : string >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h3 = `2${ 3 * 4 }5` + 6; >h3 : string >`2${ 3 * 4 }5` + 6 : string >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i3 = 1 + `${ 3 * 4 }` + 6; >i3 : string >1 + `${ 3 * 4 }` + 6 : string >1 + `${ 3 * 4 }` : string ->1 : number +>1 : 1 >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j3 = 1 + `2${ 3 * 4 }` + 6; >j3 : string >1 + `2${ 3 * 4 }` + 6 : string >1 + `2${ 3 * 4 }` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k3 = 1 + `${ 3 * 4 }5` + 6; >k3 : string >1 + `${ 3 * 4 }5` + 6 : string >1 + `${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l3 = 1 + `2${ 3 * 4 }5` + 6; >l3 : string >1 + `2${ 3 * 4 }5` + 6 : string >1 + `2${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var a4 = 1 + `${ 3 & 4 }`; >a4 : string >1 + `${ 3 & 4 }` : string ->1 : number +>1 : 1 >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b4 = 1 + `2${ 3 & 4 }`; >b4 : string >1 + `2${ 3 & 4 }` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c4 = 1 + `${ 3 & 4 }5`; >c4 : string >1 + `${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d4 = 1 + `2${ 3 & 4 }5`; >d4 : string >1 + `2${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e4 = `${ 3 & 4 }` + 6; >e4 : string >`${ 3 & 4 }` + 6 : string >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f4 = `2${ 3 & 4 }` + 6; >f4 : string >`2${ 3 & 4 }` + 6 : string >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g4 = `${ 3 & 4 }5` + 6; >g4 : string >`${ 3 & 4 }5` + 6 : string >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h4 = `2${ 3 & 4 }5` + 6; >h4 : string >`2${ 3 & 4 }5` + 6 : string >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i4 = 1 + `${ 3 & 4 }` + 6; >i4 : string >1 + `${ 3 & 4 }` + 6 : string >1 + `${ 3 & 4 }` : string ->1 : number +>1 : 1 >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j4 = 1 + `2${ 3 & 4 }` + 6; >j4 : string >1 + `2${ 3 & 4 }` + 6 : string >1 + `2${ 3 & 4 }` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k4 = 1 + `${ 3 & 4 }5` + 6; >k4 : string >1 + `${ 3 & 4 }5` + 6 : string >1 + `${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l4 = 1 + `2${ 3 & 4 }5` + 6; >l4 : string >1 + `2${ 3 & 4 }5` + 6 : string >1 + `2${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 diff --git a/tests/baselines/reference/templateStringBinaryOperationsES6.types b/tests/baselines/reference/templateStringBinaryOperationsES6.types index a20da835a818a..0ac9775a655ab 100644 --- a/tests/baselines/reference/templateStringBinaryOperationsES6.types +++ b/tests/baselines/reference/templateStringBinaryOperationsES6.types @@ -2,440 +2,440 @@ var a = 1 + `${ 3 }`; >a : string >1 + `${ 3 }` : string ->1 : number +>1 : 1 >`${ 3 }` : string ->3 : number +>3 : 3 var b = 1 + `2${ 3 }`; >b : string >1 + `2${ 3 }` : string ->1 : number +>1 : 1 >`2${ 3 }` : string ->3 : number +>3 : 3 var c = 1 + `${ 3 }4`; >c : string >1 + `${ 3 }4` : string ->1 : number +>1 : 1 >`${ 3 }4` : string ->3 : number +>3 : 3 var d = 1 + `2${ 3 }4`; >d : string >1 + `2${ 3 }4` : string ->1 : number +>1 : 1 >`2${ 3 }4` : string ->3 : number +>3 : 3 var e = `${ 3 }` + 5; >e : string >`${ 3 }` + 5 : string >`${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var f = `2${ 3 }` + 5; >f : string >`2${ 3 }` + 5 : string >`2${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var g = `${ 3 }4` + 5; >g : string >`${ 3 }4` + 5 : string >`${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var h = `2${ 3 }4` + 5; >h : string >`2${ 3 }4` + 5 : string >`2${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var i = 1 + `${ 3 }` + 5; >i : string >1 + `${ 3 }` + 5 : string >1 + `${ 3 }` : string ->1 : number +>1 : 1 >`${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var j = 1 + `2${ 3 }` + 5; >j : string >1 + `2${ 3 }` + 5 : string >1 + `2${ 3 }` : string ->1 : number +>1 : 1 >`2${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var k = 1 + `${ 3 }4` + 5; >k : string >1 + `${ 3 }4` + 5 : string >1 + `${ 3 }4` : string ->1 : number +>1 : 1 >`${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var l = 1 + `2${ 3 }4` + 5; >l : string >1 + `2${ 3 }4` + 5 : string >1 + `2${ 3 }4` : string ->1 : number +>1 : 1 >`2${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var a2 = 1 + `${ 3 - 4 }`; >a2 : string >1 + `${ 3 - 4 }` : string ->1 : number +>1 : 1 >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b2 = 1 + `2${ 3 - 4 }`; >b2 : string >1 + `2${ 3 - 4 }` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c2 = 1 + `${ 3 - 4 }5`; >c2 : string >1 + `${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d2 = 1 + `2${ 3 - 4 }5`; >d2 : string >1 + `2${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e2 = `${ 3 - 4 }` + 6; >e2 : string >`${ 3 - 4 }` + 6 : string >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f2 = `2${ 3 - 4 }` + 6; >f2 : string >`2${ 3 - 4 }` + 6 : string >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g2 = `${ 3 - 4 }5` + 6; >g2 : string >`${ 3 - 4 }5` + 6 : string >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h2 = `2${ 3 - 4 }5` + 6; >h2 : string >`2${ 3 - 4 }5` + 6 : string >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i2 = 1 + `${ 3 - 4 }` + 6; >i2 : string >1 + `${ 3 - 4 }` + 6 : string >1 + `${ 3 - 4 }` : string ->1 : number +>1 : 1 >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j2 = 1 + `2${ 3 - 4 }` + 6; >j2 : string >1 + `2${ 3 - 4 }` + 6 : string >1 + `2${ 3 - 4 }` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k2 = 1 + `${ 3 - 4 }5` + 6; >k2 : string >1 + `${ 3 - 4 }5` + 6 : string >1 + `${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l2 = 1 + `2${ 3 - 4 }5` + 6; >l2 : string >1 + `2${ 3 - 4 }5` + 6 : string >1 + `2${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var a3 = 1 + `${ 3 * 4 }`; >a3 : string >1 + `${ 3 * 4 }` : string ->1 : number +>1 : 1 >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b3 = 1 + `2${ 3 * 4 }`; >b3 : string >1 + `2${ 3 * 4 }` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c3 = 1 + `${ 3 * 4 }5`; >c3 : string >1 + `${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d3 = 1 + `2${ 3 * 4 }5`; >d3 : string >1 + `2${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e3 = `${ 3 * 4 }` + 6; >e3 : string >`${ 3 * 4 }` + 6 : string >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f3 = `2${ 3 * 4 }` + 6; >f3 : string >`2${ 3 * 4 }` + 6 : string >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g3 = `${ 3 * 4 }5` + 6; >g3 : string >`${ 3 * 4 }5` + 6 : string >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h3 = `2${ 3 * 4 }5` + 6; >h3 : string >`2${ 3 * 4 }5` + 6 : string >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i3 = 1 + `${ 3 * 4 }` + 6; >i3 : string >1 + `${ 3 * 4 }` + 6 : string >1 + `${ 3 * 4 }` : string ->1 : number +>1 : 1 >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j3 = 1 + `2${ 3 * 4 }` + 6; >j3 : string >1 + `2${ 3 * 4 }` + 6 : string >1 + `2${ 3 * 4 }` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k3 = 1 + `${ 3 * 4 }5` + 6; >k3 : string >1 + `${ 3 * 4 }5` + 6 : string >1 + `${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l3 = 1 + `2${ 3 * 4 }5` + 6; >l3 : string >1 + `2${ 3 * 4 }5` + 6 : string >1 + `2${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var a4 = 1 + `${ 3 & 4 }`; >a4 : string >1 + `${ 3 & 4 }` : string ->1 : number +>1 : 1 >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b4 = 1 + `2${ 3 & 4 }`; >b4 : string >1 + `2${ 3 & 4 }` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c4 = 1 + `${ 3 & 4 }5`; >c4 : string >1 + `${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d4 = 1 + `2${ 3 & 4 }5`; >d4 : string >1 + `2${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e4 = `${ 3 & 4 }` + 6; >e4 : string >`${ 3 & 4 }` + 6 : string >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f4 = `2${ 3 & 4 }` + 6; >f4 : string >`2${ 3 & 4 }` + 6 : string >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g4 = `${ 3 & 4 }5` + 6; >g4 : string >`${ 3 & 4 }5` + 6 : string >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h4 = `2${ 3 & 4 }5` + 6; >h4 : string >`2${ 3 & 4 }5` + 6 : string >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i4 = 1 + `${ 3 & 4 }` + 6; >i4 : string >1 + `${ 3 & 4 }` + 6 : string >1 + `${ 3 & 4 }` : string ->1 : number +>1 : 1 >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j4 = 1 + `2${ 3 & 4 }` + 6; >j4 : string >1 + `2${ 3 & 4 }` + 6 : string >1 + `2${ 3 & 4 }` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k4 = 1 + `${ 3 & 4 }5` + 6; >k4 : string >1 + `${ 3 & 4 }5` + 6 : string >1 + `${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l4 = 1 + `2${ 3 & 4 }5` + 6; >l4 : string >1 + `2${ 3 & 4 }5` + 6 : string >1 + `2${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 diff --git a/tests/baselines/reference/templateStringInArray.types b/tests/baselines/reference/templateStringInArray.types index 04cc09a1005e7..03271a5dcd7c0 100644 --- a/tests/baselines/reference/templateStringInArray.types +++ b/tests/baselines/reference/templateStringInArray.types @@ -2,8 +2,8 @@ var x = [1, 2, `abc${ 123 }def`]; >x : (string | number)[] >[1, 2, `abc${ 123 }def`] : (string | number)[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInConditional.types b/tests/baselines/reference/templateStringInConditional.types index bb5de339533b5..a375d572a5df1 100644 --- a/tests/baselines/reference/templateStringInConditional.types +++ b/tests/baselines/reference/templateStringInConditional.types @@ -3,9 +3,9 @@ var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; >x : string >`abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def` : string >`abc${ " " }def` : string ->" " : string +>" " : " " >`abc${ " " }def` : string ->" " : string +>" " : " " >`abc${ " " }def` : string ->" " : string +>" " : " " diff --git a/tests/baselines/reference/templateStringInConditionalES6.types b/tests/baselines/reference/templateStringInConditionalES6.types index 060b81b2ab7ee..0f65ab2297743 100644 --- a/tests/baselines/reference/templateStringInConditionalES6.types +++ b/tests/baselines/reference/templateStringInConditionalES6.types @@ -3,9 +3,9 @@ var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; >x : string >`abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def` : string >`abc${ " " }def` : string ->" " : string +>" " : " " >`abc${ " " }def` : string ->" " : string +>" " : " " >`abc${ " " }def` : string ->" " : string +>" " : " " diff --git a/tests/baselines/reference/templateStringInDeleteExpression.types b/tests/baselines/reference/templateStringInDeleteExpression.types index ff950555fb960..1ae84e4e2ff53 100644 --- a/tests/baselines/reference/templateStringInDeleteExpression.types +++ b/tests/baselines/reference/templateStringInDeleteExpression.types @@ -2,5 +2,5 @@ delete `abc${0}abc`; >delete `abc${0}abc` : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInDeleteExpressionES6.types b/tests/baselines/reference/templateStringInDeleteExpressionES6.types index a182754dc685c..80569e533e42b 100644 --- a/tests/baselines/reference/templateStringInDeleteExpressionES6.types +++ b/tests/baselines/reference/templateStringInDeleteExpressionES6.types @@ -2,5 +2,5 @@ delete `abc${0}abc`; >delete `abc${0}abc` : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInEqualityChecks.types b/tests/baselines/reference/templateStringInEqualityChecks.types index 2f1b2cf987b00..dd78aa131d4be 100644 --- a/tests/baselines/reference/templateStringInEqualityChecks.types +++ b/tests/baselines/reference/templateStringInEqualityChecks.types @@ -4,7 +4,7 @@ var x = `abc${0}abc` === `abc` || >`abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean >`abc${0}abc` === `abc` : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 >`abc` : string `abc` !== `abc${0}abc` && @@ -13,17 +13,17 @@ var x = `abc${0}abc` === `abc` || >`abc` !== `abc${0}abc` : boolean >`abc` : string >`abc${0}abc` : string ->0 : number +>0 : 0 `abc${0}abc` == "abc0abc" && >`abc${0}abc` == "abc0abc" : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 >"abc0abc" : "abc0abc" "abc0abc" !== `abc${0}abc`; >"abc0abc" !== `abc${0}abc` : boolean >"abc0abc" : "abc0abc" >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInEqualityChecksES6.types b/tests/baselines/reference/templateStringInEqualityChecksES6.types index ce552da09eaa9..b3ef2b8972041 100644 --- a/tests/baselines/reference/templateStringInEqualityChecksES6.types +++ b/tests/baselines/reference/templateStringInEqualityChecksES6.types @@ -4,7 +4,7 @@ var x = `abc${0}abc` === `abc` || >`abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean >`abc${0}abc` === `abc` : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 >`abc` : string `abc` !== `abc${0}abc` && @@ -13,17 +13,17 @@ var x = `abc${0}abc` === `abc` || >`abc` !== `abc${0}abc` : boolean >`abc` : string >`abc${0}abc` : string ->0 : number +>0 : 0 `abc${0}abc` == "abc0abc" && >`abc${0}abc` == "abc0abc" : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 >"abc0abc" : "abc0abc" "abc0abc" !== `abc${0}abc`; >"abc0abc" !== `abc${0}abc` : boolean >"abc0abc" : "abc0abc" >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInFunctionExpression.types b/tests/baselines/reference/templateStringInFunctionExpression.types index 62e34b5fc2d8a..af92d867acd70 100644 --- a/tests/baselines/reference/templateStringInFunctionExpression.types +++ b/tests/baselines/reference/templateStringInFunctionExpression.types @@ -6,10 +6,10 @@ var x = function y() { `abc${ 0 }def` >`abc${ 0 }def` : string ->0 : number +>0 : 0 return `abc${ 0 }def`; >`abc${ 0 }def` : string ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/templateStringInFunctionExpressionES6.types b/tests/baselines/reference/templateStringInFunctionExpressionES6.types index 268928125c5be..2ab90b9e37404 100644 --- a/tests/baselines/reference/templateStringInFunctionExpressionES6.types +++ b/tests/baselines/reference/templateStringInFunctionExpressionES6.types @@ -6,10 +6,10 @@ var x = function y() { `abc${ 0 }def` >`abc${ 0 }def` : string ->0 : number +>0 : 0 return `abc${ 0 }def`; >`abc${ 0 }def` : string ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/templateStringInInOperator.types b/tests/baselines/reference/templateStringInInOperator.types index 881f37221feaf..5ed944af49626 100644 --- a/tests/baselines/reference/templateStringInInOperator.types +++ b/tests/baselines/reference/templateStringInInOperator.types @@ -3,10 +3,10 @@ var x = `${ "hi" }` in { hi: 10, hello: 20}; >x : boolean >`${ "hi" }` in { hi: 10, hello: 20} : boolean >`${ "hi" }` : string ->"hi" : string +>"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } >hi : number ->10 : number +>10 : 10 >hello : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringInInOperatorES6.types b/tests/baselines/reference/templateStringInInOperatorES6.types index 4297338ba56b2..335b77380c2ad 100644 --- a/tests/baselines/reference/templateStringInInOperatorES6.types +++ b/tests/baselines/reference/templateStringInInOperatorES6.types @@ -3,10 +3,10 @@ var x = `${ "hi" }` in { hi: 10, hello: 20}; >x : boolean >`${ "hi" }` in { hi: 10, hello: 20} : boolean >`${ "hi" }` : string ->"hi" : string +>"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } >hi : number ->10 : number +>10 : 10 >hello : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringInIndexExpression.types b/tests/baselines/reference/templateStringInIndexExpression.types index ff5461158ab96..b453c37f4c5f2 100644 --- a/tests/baselines/reference/templateStringInIndexExpression.types +++ b/tests/baselines/reference/templateStringInIndexExpression.types @@ -2,6 +2,6 @@ `abc${0}abc`[`0`]; >`abc${0}abc`[`0`] : any >`abc${0}abc` : string ->0 : number +>0 : 0 >`0` : string diff --git a/tests/baselines/reference/templateStringInIndexExpressionES6.types b/tests/baselines/reference/templateStringInIndexExpressionES6.types index 153bed9f97a27..b7be602e89336 100644 --- a/tests/baselines/reference/templateStringInIndexExpressionES6.types +++ b/tests/baselines/reference/templateStringInIndexExpressionES6.types @@ -2,6 +2,6 @@ `abc${0}abc`[`0`]; >`abc${0}abc`[`0`] : any >`abc${0}abc` : string ->0 : number +>0 : 0 >`0` : string diff --git a/tests/baselines/reference/templateStringInParentheses.types b/tests/baselines/reference/templateStringInParentheses.types index 29436a32d2a6e..ca9b328d5b5a1 100644 --- a/tests/baselines/reference/templateStringInParentheses.types +++ b/tests/baselines/reference/templateStringInParentheses.types @@ -3,5 +3,5 @@ var x = (`abc${0}abc`); >x : string >(`abc${0}abc`) : string >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInParenthesesES6.types b/tests/baselines/reference/templateStringInParenthesesES6.types index 0d4d89ef3a997..518ad88091865 100644 --- a/tests/baselines/reference/templateStringInParenthesesES6.types +++ b/tests/baselines/reference/templateStringInParenthesesES6.types @@ -3,5 +3,5 @@ var x = (`abc${0}abc`); >x : string >(`abc${0}abc`) : string >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInPropertyAssignment.types b/tests/baselines/reference/templateStringInPropertyAssignment.types index a8ba035131199..c47a921e94117 100644 --- a/tests/baselines/reference/templateStringInPropertyAssignment.types +++ b/tests/baselines/reference/templateStringInPropertyAssignment.types @@ -6,6 +6,6 @@ var x = { a: `abc${ 123 }def${ 456 }ghi` >a : string >`abc${ 123 }def${ 456 }ghi` : string ->123 : number ->456 : number +>123 : 123 +>456 : 456 } diff --git a/tests/baselines/reference/templateStringInPropertyAssignmentES6.types b/tests/baselines/reference/templateStringInPropertyAssignmentES6.types index 5da8d9ac6f9db..43a9e0f5507ff 100644 --- a/tests/baselines/reference/templateStringInPropertyAssignmentES6.types +++ b/tests/baselines/reference/templateStringInPropertyAssignmentES6.types @@ -6,6 +6,6 @@ var x = { a: `abc${ 123 }def${ 456 }ghi` >a : string >`abc${ 123 }def${ 456 }ghi` : string ->123 : number ->456 : number +>123 : 123 +>456 : 456 } diff --git a/tests/baselines/reference/templateStringInSwitchAndCase.types b/tests/baselines/reference/templateStringInSwitchAndCase.types index 0949aa21fde93..a0f8602167a21 100644 --- a/tests/baselines/reference/templateStringInSwitchAndCase.types +++ b/tests/baselines/reference/templateStringInSwitchAndCase.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringInSwitchAndCase.ts === switch (`abc${0}abc`) { >`abc${0}abc` : string ->0 : number +>0 : 0 case `abc`: >`abc` : string @@ -11,9 +11,9 @@ switch (`abc${0}abc`) { case `abc${0}abc`: >`abc${0}abc` : string ->0 : number +>0 : 0 `def${1}def`; >`def${1}def` : string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/templateStringInSwitchAndCaseES6.types b/tests/baselines/reference/templateStringInSwitchAndCaseES6.types index a9ba35c859918..0cde7e5875676 100644 --- a/tests/baselines/reference/templateStringInSwitchAndCaseES6.types +++ b/tests/baselines/reference/templateStringInSwitchAndCaseES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringInSwitchAndCaseES6.ts === switch (`abc${0}abc`) { >`abc${0}abc` : string ->0 : number +>0 : 0 case `abc`: >`abc` : string @@ -11,9 +11,9 @@ switch (`abc${0}abc`) { case `abc${0}abc`: >`abc${0}abc` : string ->0 : number +>0 : 0 `def${1}def`; >`def${1}def` : string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/templateStringInTypeAssertion.types b/tests/baselines/reference/templateStringInTypeAssertion.types index 73ed437adb3b5..c8950634a36ee 100644 --- a/tests/baselines/reference/templateStringInTypeAssertion.types +++ b/tests/baselines/reference/templateStringInTypeAssertion.types @@ -3,5 +3,5 @@ var x = `abc${ 123 }def`; >x : any >`abc${ 123 }def` : any >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInTypeAssertionES6.types b/tests/baselines/reference/templateStringInTypeAssertionES6.types index 26d4689f9392c..becccd7373803 100644 --- a/tests/baselines/reference/templateStringInTypeAssertionES6.types +++ b/tests/baselines/reference/templateStringInTypeAssertionES6.types @@ -3,5 +3,5 @@ var x = `abc${ 123 }def`; >x : any >`abc${ 123 }def` : any >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInTypeOf.types b/tests/baselines/reference/templateStringInTypeOf.types index 550828b3a4798..0d7d26a82b29a 100644 --- a/tests/baselines/reference/templateStringInTypeOf.types +++ b/tests/baselines/reference/templateStringInTypeOf.types @@ -3,5 +3,5 @@ var x = typeof `abc${ 123 }def`; >x : string >typeof `abc${ 123 }def` : string >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInTypeOfES6.types b/tests/baselines/reference/templateStringInTypeOfES6.types index b04e37426a428..ad142d13fe5f8 100644 --- a/tests/baselines/reference/templateStringInTypeOfES6.types +++ b/tests/baselines/reference/templateStringInTypeOfES6.types @@ -3,5 +3,5 @@ var x = typeof `abc${ 123 }def`; >x : string >typeof `abc${ 123 }def` : string >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInUnaryPlus.types b/tests/baselines/reference/templateStringInUnaryPlus.types index bab86198433b3..aa2b4fe4f2d63 100644 --- a/tests/baselines/reference/templateStringInUnaryPlus.types +++ b/tests/baselines/reference/templateStringInUnaryPlus.types @@ -3,5 +3,5 @@ var x = +`abc${ 123 }def`; >x : number >+`abc${ 123 }def` : number >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInUnaryPlusES6.types b/tests/baselines/reference/templateStringInUnaryPlusES6.types index d632e8e29655e..8286fa8b6c142 100644 --- a/tests/baselines/reference/templateStringInUnaryPlusES6.types +++ b/tests/baselines/reference/templateStringInUnaryPlusES6.types @@ -3,5 +3,5 @@ var x = +`abc${ 123 }def`; >x : number >+`abc${ 123 }def` : number >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInWhile.types b/tests/baselines/reference/templateStringInWhile.types index fe4931455e252..c0914ee771c9c 100644 --- a/tests/baselines/reference/templateStringInWhile.types +++ b/tests/baselines/reference/templateStringInWhile.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/templates/templateStringInWhile.ts === while (`abc${0}abc`) { >`abc${0}abc` : string ->0 : number +>0 : 0 `def${1}def`; >`def${1}def` : string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/templateStringInWhileES6.types b/tests/baselines/reference/templateStringInWhileES6.types index ef2c3d02cae22..29119d7f77ede 100644 --- a/tests/baselines/reference/templateStringInWhileES6.types +++ b/tests/baselines/reference/templateStringInWhileES6.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/templates/templateStringInWhileES6.ts === while (`abc${0}abc`) { >`abc${0}abc` : string ->0 : number +>0 : 0 `def${1}def`; >`def${1}def` : string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types index e7cc81af06c7d..62d0190586a2b 100644 --- a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types +++ b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types @@ -3,33 +3,33 @@ `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` >`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " diff --git a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types index 9b91b5db72c41..cf07cae5b93fa 100644 --- a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types +++ b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types @@ -2,33 +2,33 @@ `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` >`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " diff --git a/tests/baselines/reference/templateStringWithEmbeddedAddition.types b/tests/baselines/reference/templateStringWithEmbeddedAddition.types index 02173dc026fc7..56bc197c37764 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedAddition.types +++ b/tests/baselines/reference/templateStringWithEmbeddedAddition.types @@ -3,6 +3,6 @@ var x = `abc${ 10 + 10 }def`; >x : string >`abc${ 10 + 10 }def` : string >10 + 10 : number ->10 : number ->10 : number +>10 : 10 +>10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types index ec33cee95f1ab..6ee46c39f57c1 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types @@ -3,6 +3,6 @@ var x = `abc${ 10 + 10 }def`; >x : string >`abc${ 10 + 10 }def` : string >10 + 10 : number ->10 : number ->10 : number +>10 : 10 +>10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedArray.types b/tests/baselines/reference/templateStringWithEmbeddedArray.types index 2842936c502f1..b82fa26d40049 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArray.types +++ b/tests/baselines/reference/templateStringWithEmbeddedArray.types @@ -3,7 +3,7 @@ var x = `abc${ [1,2,3] }def`; >x : string >`abc${ [1,2,3] }def` : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types index 2f8e67f05396e..e8701a7f4c30a 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types @@ -3,7 +3,7 @@ var x = `abc${ [1,2,3] }def`; >x : string >`abc${ [1,2,3] }def` : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 diff --git a/tests/baselines/reference/templateStringWithEmbeddedComments.types b/tests/baselines/reference/templateStringWithEmbeddedComments.types index 46a5fd3b09129..f948a8bdaaf10 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedComments.types +++ b/tests/baselines/reference/templateStringWithEmbeddedComments.types @@ -3,7 +3,7 @@ >`head${ // single line comment10}middle${/* Multi- * line * comment */ 20 // closing comment}tail` : string 10 ->10 : number +>10 : 10 } middle${ /* Multi- @@ -11,7 +11,7 @@ middle${ * comment */ 20 ->20 : number +>20 : 20 // closing comment } diff --git a/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types b/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types index 0eaf40cafac5f..cd2e0b23441a7 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types @@ -3,7 +3,7 @@ >`head${ // single line comment10}middle${/* Multi- * line * comment */ 20 // closing comment}tail` : string 10 ->10 : number +>10 : 10 } middle${ /* Multi- @@ -11,7 +11,7 @@ middle${ * comment */ 20 ->20 : number +>20 : 20 // closing comment } diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditional.types b/tests/baselines/reference/templateStringWithEmbeddedConditional.types index 7ec1ef97a3015..d79433e7b8aa3 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedConditional.types +++ b/tests/baselines/reference/templateStringWithEmbeddedConditional.types @@ -2,8 +2,8 @@ var x = `abc${ true ? false : " " }def`; >x : string >`abc${ true ? false : " " }def` : string ->true ? false : " " : string | boolean ->true : boolean ->false : boolean ->" " : string +>true ? false : " " : false | " " +>true : true +>false : false +>" " : " " diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types b/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types index 5453880ce16d1..1ddc81a19e701 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types @@ -2,8 +2,8 @@ var x = `abc${ true ? false : " " }def`; >x : string >`abc${ true ? false : " " }def` : string ->true ? false : " " : string | boolean ->true : boolean ->false : boolean ->" " : string +>true ? false : " " : false | " " +>true : true +>false : false +>" " : " " diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivision.types b/tests/baselines/reference/templateStringWithEmbeddedDivision.types index 440d162933b7d..6f8913756246c 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedDivision.types +++ b/tests/baselines/reference/templateStringWithEmbeddedDivision.types @@ -3,6 +3,6 @@ var x = `abc${ 1 / 1 }def`; >x : string >`abc${ 1 / 1 }def` : string >1 / 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types index 7a5980bae9e42..f91b3a27639ee 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types @@ -3,6 +3,6 @@ var x = `abc${ 1 / 1 }def`; >x : string >`abc${ 1 / 1 }def` : string >1 / 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperator.types b/tests/baselines/reference/templateStringWithEmbeddedInOperator.types index d693dd276d1b0..f97ca55b63364 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInOperator.types +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperator.types @@ -3,10 +3,10 @@ var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; >x : string >`abc${ "hi" in { hi: 10, hello: 20} }def` : string >"hi" in { hi: 10, hello: 20} : boolean ->"hi" : string +>"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } >hi : number ->10 : number +>10 : 10 >hello : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types index ff5be5f4d82ba..a1346c2ce6d6c 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types @@ -3,10 +3,10 @@ var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; >x : string >`abc${ "hi" in { hi: 10, hello: 20} }def` : string >"hi" in { hi: 10, hello: 20} : boolean ->"hi" : string +>"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } >hi : number ->10 : number +>10 : 10 >hello : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithEmbeddedModulo.types b/tests/baselines/reference/templateStringWithEmbeddedModulo.types index fc5d3d2560d7f..c471180956327 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedModulo.types +++ b/tests/baselines/reference/templateStringWithEmbeddedModulo.types @@ -3,6 +3,6 @@ var x = `abc${ 1 % 1 }def`; >x : string >`abc${ 1 % 1 }def` : string >1 % 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types index 35ae5473befea..2a1e6b602e2cb 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types @@ -3,6 +3,6 @@ var x = `abc${ 1 % 1 }def`; >x : string >`abc${ 1 % 1 }def` : string >1 % 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types index 6d81cabc169d3..f442ab3165bbc 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types @@ -3,6 +3,6 @@ var x = `abc${ 7 * 6 }def`; >x : string >`abc${ 7 * 6 }def` : string >7 * 6 : number ->7 : number ->6 : number +>7 : 7 +>6 : 6 diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types index c4235f8535eb7..3e9f15773efba 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types @@ -3,6 +3,6 @@ var x = `abc${ 7 * 6 }def`; >x : string >`abc${ 7 * 6 }def` : string >7 * 6 : number ->7 : number ->6 : number +>7 : 7 +>6 : 6 diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types index bcc90c42c7456..1e358a571b3ac 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types @@ -4,5 +4,5 @@ var x = `abc${ new String("Hi") }def`; >`abc${ new String("Hi") }def` : string >new String("Hi") : String >String : StringConstructor ->"Hi" : string +>"Hi" : "Hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types index be58edbe4d877..4939c6f867f3a 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types @@ -4,5 +4,5 @@ var x = `abc${ new String("Hi") }def`; >`abc${ new String("Hi") }def` : string >new String("Hi") : String >String : StringConstructor ->"Hi" : string +>"Hi" : "Hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types index 0ff7fc140bbc3..9854e4e905632 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types @@ -4,7 +4,7 @@ var x = `abc${ { x: 10, y: 20 } }def`; >`abc${ { x: 10, y: 20 } }def` : string >{ x: 10, y: 20 } : { x: number; y: number; } >x : number ->10 : number +>10 : 10 >y : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types index 4a5df4707b7c1..db086517791dd 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types @@ -4,7 +4,7 @@ var x = `abc${ { x: 10, y: 20 } }def`; >`abc${ { x: 10, y: 20 } }def` : string >{ x: 10, y: 20 } : { x: number; y: number; } >x : number ->10 : number +>10 : 10 >y : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types index acda0c7a7ec6a..cef4f69c0a959 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types @@ -3,7 +3,7 @@ var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; >x : string >`123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321` : string >`456 ${ " | " } 654` : string ->" | " : string +>" | " : " | " >`456 ${ " | " } 654` : string ->" | " : string +>" | " : " | " diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types b/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types index 252765cb7c019..12532c8402e48 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types @@ -3,7 +3,7 @@ var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; >x : string >`123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321` : string >`456 ${ " | " } 654` : string ->" | " : string +>" | " : " | " >`456 ${ " | " } 654` : string ->" | " : string +>" | " : " | " diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types index 98254cad8b73d..898263825af3a 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types @@ -5,6 +5,6 @@ var x = `abc${ (10 + 10) }def`; >(10 + 10) : any >(10 + 10) : number >10 + 10 : number ->10 : number ->10 : number +>10 : 10 +>10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types index ac74625f57acc..e9e81a2d097d5 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types @@ -5,6 +5,6 @@ var x = `abc${ (10 + 10) }def`; >(10 + 10) : any >(10 + 10) : number >10 + 10 : number ->10 : number ->10 : number +>10 : 10 +>10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types index e63ea3aac6983..48330140ad347 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types @@ -3,5 +3,5 @@ var x = `abc${ typeof "hi" }def`; >x : string >`abc${ typeof "hi" }def` : string >typeof "hi" : string ->"hi" : string +>"hi" : "hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types index 0692eaccb5e4b..3d7eba45c1912 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types @@ -3,5 +3,5 @@ var x = `abc${ typeof "hi" }def`; >x : string >`abc${ typeof "hi" }def` : string >typeof "hi" : string ->"hi" : string +>"hi" : "hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types index 3a6f5d1672669..e4496aa4e8ba8 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts === function* gen() { ->gen : () => IterableIterator +>gen : () => IterableIterator<10> // Once this is supported, yield *must* be parenthesized. var x = `abc${ yield 10 }def`; >x : string >`abc${ yield 10 }def` : string >yield 10 : any ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types index f88ca5e749315..f20ab1552e3b8 100644 --- a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types @@ -6,68 +6,68 @@ var a = ``; var b = `${ 0 }`; >b : string >`${ 0 }` : string ->0 : number +>0 : 0 var c = `1${ 0 }`; >c : string >`1${ 0 }` : string ->0 : number +>0 : 0 var d = `${ 0 }2`; >d : string >`${ 0 }2` : string ->0 : number +>0 : 0 var e = `1${ 0 }2`; >e : string >`1${ 0 }2` : string ->0 : number +>0 : 0 var f = `${ 0 }${ 0 }`; >f : string >`${ 0 }${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var g = `1${ 0 }${ 0 }`; >g : string >`1${ 0 }${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var h = `${ 0 }2${ 0 }`; >h : string >`${ 0 }2${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var i = `1${ 0 }2${ 0 }`; >i : string >`1${ 0 }2${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var j = `${ 0 }${ 0 }3`; >j : string >`${ 0 }${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var k = `1${ 0 }${ 0 }3`; >k : string >`1${ 0 }${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var l = `${ 0 }2${ 0 }3`; >l : string >`${ 0 }2${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var m = `1${ 0 }2${ 0 }3`; >m : string >`1${ 0 }2${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types index 068da7f948499..73eeeaae04529 100644 --- a/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types @@ -6,68 +6,68 @@ var a = ``; var b = `${ 0 }`; >b : string >`${ 0 }` : string ->0 : number +>0 : 0 var c = `1${ 0 }`; >c : string >`1${ 0 }` : string ->0 : number +>0 : 0 var d = `${ 0 }2`; >d : string >`${ 0 }2` : string ->0 : number +>0 : 0 var e = `1${ 0 }2`; >e : string >`1${ 0 }2` : string ->0 : number +>0 : 0 var f = `${ 0 }${ 0 }`; >f : string >`${ 0 }${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var g = `1${ 0 }${ 0 }`; >g : string >`1${ 0 }${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var h = `${ 0 }2${ 0 }`; >h : string >`${ 0 }2${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var i = `1${ 0 }2${ 0 }`; >i : string >`1${ 0 }2${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var j = `${ 0 }${ 0 }3`; >j : string >`${ 0 }${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var k = `1${ 0 }${ 0 }3`; >k : string >`1${ 0 }${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var l = `${ 0 }2${ 0 }3`; >l : string >`${ 0 }2${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var m = `1${ 0 }2${ 0 }3`; >m : string >`1${ 0 }2${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types index 9adee37539606..8c6d4dc2e79ba 100644 --- a/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortion.ts === ` /**head ${ 10 } // still middle ${ 20 } /* still tail ` >` /**head ${ 10 } // still middle ${ 20 } /* still tail ` : string ->10 : number ->20 : number +>10 : 10 +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types b/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types index ea1513756deeb..fa9ede6976b3f 100644 --- a/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortionES6.ts === ` /**head ${ 10 } // still middle ${ 20 } /* still tail ` >` /**head ${ 10 } // still middle ${ 20 } /* still tail ` : string ->10 : number ->20 : number +>10 : 10 +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithPropertyAccess.types b/tests/baselines/reference/templateStringWithPropertyAccess.types index 6afb7402970c7..21749c848da58 100644 --- a/tests/baselines/reference/templateStringWithPropertyAccess.types +++ b/tests/baselines/reference/templateStringWithPropertyAccess.types @@ -3,7 +3,7 @@ >`abc${0}abc`.indexOf(`abc`) : number >`abc${0}abc`.indexOf : (searchString: string, position?: number) => number >`abc${0}abc` : string ->0 : number +>0 : 0 >indexOf : (searchString: string, position?: number) => number >`abc` : string diff --git a/tests/baselines/reference/templateStringWithPropertyAccessES6.types b/tests/baselines/reference/templateStringWithPropertyAccessES6.types index bdbded8be4a02..3e297e6bf07d1 100644 --- a/tests/baselines/reference/templateStringWithPropertyAccessES6.types +++ b/tests/baselines/reference/templateStringWithPropertyAccessES6.types @@ -3,7 +3,7 @@ >`abc${0}abc`.indexOf(`abc`) : number >`abc${0}abc`.indexOf : (searchString: string, position?: number) => number >`abc${0}abc` : string ->0 : number +>0 : 0 >indexOf : (searchString: string, position?: number) => number >`abc` : string diff --git a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt index 7204f32dba2cb..6b11fdb661a5b 100644 --- a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt +++ b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts(3,27): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts(3,27): error TS2322: Type '"bad"' is not assignable to type 'number'. ==== tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts (1 errors) ==== @@ -6,4 +6,4 @@ tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpr `${function (x: number) { x = "bad"; } }`; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '"bad"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt index 9fece57ef5e2b..8d5a8bb48850a 100644 --- a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt +++ b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts(2,27): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts(2,27): error TS2322: Type '"bad"' is not assignable to type 'number'. ==== tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts (1 errors) ==== `${function (x: number) { x = "bad"; } }`; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '"bad"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/ternaryExpressionSourceMap.types b/tests/baselines/reference/ternaryExpressionSourceMap.types index d74a175635a4b..d6d17091b4322 100644 --- a/tests/baselines/reference/ternaryExpressionSourceMap.types +++ b/tests/baselines/reference/ternaryExpressionSourceMap.types @@ -2,14 +2,14 @@ var x = 1; >x : number ->1 : number +>1 : 1 var foo = x ? () => 0 : () => 0; >foo : () => number >x ? () => 0 : () => 0 : () => number >x : number >() => 0 : () => number ->0 : number +>0 : 0 >() => 0 : () => number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/thisBinding2.types b/tests/baselines/reference/thisBinding2.types index 99668ca4901cb..dbd9f83c7412a 100644 --- a/tests/baselines/reference/thisBinding2.types +++ b/tests/baselines/reference/thisBinding2.types @@ -17,7 +17,7 @@ class C { var x = 1; >x : number ->1 : number +>1 : 1 return this.x; >this.x : number @@ -35,7 +35,7 @@ class C { var x = 1; >x : number ->1 : number +>1 : 1 return this.x; >this.x : any @@ -57,7 +57,7 @@ var messenger = { message: "Hello World", >message : string ->"Hello World" : string +>"Hello World" : "Hello World" start: function () { >start : () => number @@ -71,7 +71,7 @@ var messenger = { >this.message : any >this : any >message : any ->3000 : number +>3000 : 3000 } }; diff --git a/tests/baselines/reference/thisCapture1.types b/tests/baselines/reference/thisCapture1.types index eb4501203ca41..ff9e9e3b9fec0 100644 --- a/tests/baselines/reference/thisCapture1.types +++ b/tests/baselines/reference/thisCapture1.types @@ -4,7 +4,7 @@ class X { private y = 0; >y : number ->0 : number +>0 : 0 public getSettings(keys: string[]): any { >getSettings : (keys: string[]) => any @@ -23,11 +23,11 @@ class X { >() => { this.y = 0; } : () => void this.y = 0; ->this.y = 0 : number +>this.y = 0 : 0 >this.y : number >this : this >y : number ->0 : number +>0 : 0 }).promise(); >promise : any diff --git a/tests/baselines/reference/thisInGenericStaticMembers.types b/tests/baselines/reference/thisInGenericStaticMembers.types index 8d4aabe281220..082ffb588a521 100644 --- a/tests/baselines/reference/thisInGenericStaticMembers.types +++ b/tests/baselines/reference/thisInGenericStaticMembers.types @@ -30,7 +30,7 @@ class A { >one : (source: T, value: number) => T >T : T >source : T ->42 : number +>42 : 42 } } @@ -60,7 +60,7 @@ class B { >this : typeof B >one : (source: B, value: number) => B >source : B ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/thisInInnerFunctions.types b/tests/baselines/reference/thisInInnerFunctions.types index 2d0c3363b1866..e6c6d2b834c5c 100644 --- a/tests/baselines/reference/thisInInnerFunctions.types +++ b/tests/baselines/reference/thisInInnerFunctions.types @@ -4,7 +4,7 @@ class Foo { x = "hello"; >x : string ->"hello" : string +>"hello" : "hello" bar() { >bar : () => void @@ -13,11 +13,11 @@ class Foo { >inner : () => void this.y = "hi"; // 'this' should be not type to 'Foo' either ->this.y = "hi" : string +>this.y = "hi" : "hi" >this.y : any >this : any >y : any ->"hi" : string +>"hi" : "hi" var f = () => this.y; // 'this' should be not type to 'Foo' either >f : () => any diff --git a/tests/baselines/reference/thisInLambda.types b/tests/baselines/reference/thisInLambda.types index aea7fb08bd66f..a9d5b695750e5 100644 --- a/tests/baselines/reference/thisInLambda.types +++ b/tests/baselines/reference/thisInLambda.types @@ -4,7 +4,7 @@ class Foo { x = "hello"; >x : string ->"hello" : string +>"hello" : "hello" bar() { >bar : () => void diff --git a/tests/baselines/reference/thisInPropertyBoundDeclarations.types b/tests/baselines/reference/thisInPropertyBoundDeclarations.types index f871e78d2196d..b783c5c1b5fee 100644 --- a/tests/baselines/reference/thisInPropertyBoundDeclarations.types +++ b/tests/baselines/reference/thisInPropertyBoundDeclarations.types @@ -131,14 +131,14 @@ class B { >' ' + function() { } + ' ' + (() => () => () => this) : string >' ' + function() { } + ' ' : string >' ' + function() { } : string ->' ' : string +>' ' : " " function() { >function() { } : () => void } + ' ' + ->' ' : string +>' ' : " " (() => () => () => this); >(() => () => () => this) : () => () => () => this diff --git a/tests/baselines/reference/thisInStaticMethod1.types b/tests/baselines/reference/thisInStaticMethod1.types index fdee20c21bf5b..6e922737ca969 100644 --- a/tests/baselines/reference/thisInStaticMethod1.types +++ b/tests/baselines/reference/thisInStaticMethod1.types @@ -4,7 +4,7 @@ class foo { static x = 3; >x : number ->3 : number +>3 : 3 static bar() { >bar : () => number diff --git a/tests/baselines/reference/thisTypeInAccessors.types b/tests/baselines/reference/thisTypeInAccessors.types index 998658c5d5880..4bf2186105117 100644 --- a/tests/baselines/reference/thisTypeInAccessors.types +++ b/tests/baselines/reference/thisTypeInAccessors.types @@ -15,7 +15,7 @@ const explicit = { n: 12, >n : number ->12 : number +>12 : 12 get x(this: Foo): number { return this.n; }, >x : number @@ -42,7 +42,7 @@ const copiedFromGetter = { n: 14, >n : number ->14 : number +>14 : 14 get x(this: Foo): number { return this.n; }, >x : number @@ -67,7 +67,7 @@ const copiedFromSetter = { n: 15, >n : number ->15 : number +>15 : 15 get x() { return this.n }, >x : number @@ -92,7 +92,7 @@ const copiedFromGetterUnannotated = { n: 16, >n : number ->16 : number +>16 : 16 get x(this: Foo) { return this.n }, >x : number @@ -118,7 +118,7 @@ class Explicit { n = 17; >n : number ->17 : number +>17 : 17 get x(this: Foo): number { return this.n; } >x : number @@ -144,7 +144,7 @@ class Contextual { n = 21; >n : number ->21 : number +>21 : 21 get x() { return this.n } // inside a class, so already correct >x : number diff --git a/tests/baselines/reference/thisTypeInFunctions.types b/tests/baselines/reference/thisTypeInFunctions.types index 863ecbce628b7..44bf23ad509af 100644 --- a/tests/baselines/reference/thisTypeInFunctions.types +++ b/tests/baselines/reference/thisTypeInFunctions.types @@ -58,7 +58,7 @@ class C { return m + 1; >m + 1 : number >m : number ->1 : number +>1 : 1 } } class D extends C { } @@ -127,7 +127,7 @@ function implicitThis(n: number): number { >this : any >m : any >n : number ->12 : number +>12 : 12 } let impl: I = { >impl : I @@ -136,7 +136,7 @@ let impl: I = { a: 12, >a : number ->12 : number +>12 : 12 explicitVoid2: () => this.a, // ok, this: any because it refers to some outer object (window?) >explicitVoid2 : () => any @@ -147,7 +147,7 @@ let impl: I = { explicitVoid1() { return 12; }, >explicitVoid1 : (this: void) => number ->12 : number +>12 : 12 explicitStructural() { >explicitStructural : (this: { a: number; }) => number @@ -183,7 +183,7 @@ impl.explicitVoid1 = function () { return 12; }; >impl : I >explicitVoid1 : (this: void) => number >function () { return 12; } : (this: void) => number ->12 : number +>12 : 12 impl.explicitVoid2 = () => 12; >impl.explicitVoid2 = () => 12 : () => number @@ -191,7 +191,7 @@ impl.explicitVoid2 = () => 12; >impl : I >explicitVoid2 : (this: void) => number >() => 12 : () => number ->12 : number +>12 : 12 impl.explicitStructural = function() { return this.a; }; >impl.explicitStructural = function() { return this.a; } : (this: { a: number; }) => number @@ -219,7 +219,7 @@ impl.explicitStructural = () => 12; >impl : I >explicitStructural : (this: { a: number; }) => number >() => 12 : () => number ->12 : number +>12 : 12 impl.explicitInterface = () => 12; >impl.explicitInterface = () => 12 : () => number @@ -227,7 +227,7 @@ impl.explicitInterface = () => 12; >impl : I >explicitInterface : (this: I) => number >() => 12 : () => number ->12 : number +>12 : 12 impl.explicitThis = function () { return this.a; }; >impl.explicitThis = function () { return this.a; } : (this: I) => number @@ -249,7 +249,7 @@ let ok: {y: number, f: (this: { y: number }, x: number) => number} = { y: 12, f: >x : number >{ y: 12, f: explicitStructural } : { y: number; f: (this: { y: number; }, x: number) => number; } >y : number ->12 : number +>12 : 12 >f : (this: { y: number; }, x: number) => number >explicitStructural : (this: { y: number; }, x: number) => number @@ -260,7 +260,7 @@ let implicitAnyOk: {notSpecified: number, f: (x: number) => number} = { notSpeci >x : number >{ notSpecified: 12, f: implicitThis } : { notSpecified: number; f: (n: number) => number; } >notSpecified : number ->12 : number +>12 : 12 >f : (n: number) => number >implicitThis : (n: number) => number @@ -269,19 +269,19 @@ ok.f(13); >ok.f : (this: { y: number; }, x: number) => number >ok : { y: number; f: (this: { y: number; }, x: number) => number; } >f : (this: { y: number; }, x: number) => number ->13 : number +>13 : 13 implicitThis(12); >implicitThis(12) : number >implicitThis : (n: number) => number ->12 : number +>12 : 12 implicitAnyOk.f(12); >implicitAnyOk.f(12) : number >implicitAnyOk.f : (x: number) => number >implicitAnyOk : { notSpecified: number; f: (x: number) => number; } >f : (x: number) => number ->12 : number +>12 : 12 let c = new C(); >c : C @@ -304,42 +304,42 @@ c.explicitC(12); >c.explicitC : (this: C, m: number) => number >c : C >explicitC : (this: C, m: number) => number ->12 : number +>12 : 12 c.explicitProperty(12); >c.explicitProperty(12) : number >c.explicitProperty : (this: { n: number; }, m: number) => number >c : C >explicitProperty : (this: { n: number; }, m: number) => number ->12 : number +>12 : 12 c.explicitThis(12); >c.explicitThis(12) : number >c.explicitThis : (this: C, m: number) => number >c : C >explicitThis : (this: C, m: number) => number ->12 : number +>12 : 12 d.explicitC(12); >d.explicitC(12) : number >d.explicitC : (this: C, m: number) => number >d : D >explicitC : (this: C, m: number) => number ->12 : number +>12 : 12 d.explicitProperty(12); >d.explicitProperty(12) : number >d.explicitProperty : (this: { n: number; }, m: number) => number >d : D >explicitProperty : (this: { n: number; }, m: number) => number ->12 : number +>12 : 12 d.explicitThis(12); >d.explicitThis(12) : number >d.explicitThis : (this: D, m: number) => number >d : D >explicitThis : (this: D, m: number) => number ->12 : number +>12 : 12 let reconstructed: { >reconstructed : { n: number; explicitThis(this: C, m: number): number; explicitC(this: C, m: number): number; explicitProperty: (this: { n: number; }, m: number) => number; explicitVoid(this: void, m: number): number; } @@ -375,7 +375,7 @@ let reconstructed: { n: 12, >n : number ->12 : number +>12 : 12 explicitThis: c.explicitThis, >explicitThis : (this: C, m: number) => number @@ -407,14 +407,14 @@ reconstructed.explicitThis(10); >reconstructed.explicitThis : (this: C, m: number) => number >reconstructed : { n: number; explicitThis(this: C, m: number): number; explicitC(this: C, m: number): number; explicitProperty: (this: { n: number; }, m: number) => number; explicitVoid(this: void, m: number): number; } >explicitThis : (this: C, m: number) => number ->10 : number +>10 : 10 reconstructed.explicitProperty(11); >reconstructed.explicitProperty(11) : number >reconstructed.explicitProperty : (this: { n: number; }, m: number) => number >reconstructed : { n: number; explicitThis(this: C, m: number): number; explicitC(this: C, m: number): number; explicitProperty: (this: { n: number; }, m: number) => number; explicitVoid(this: void, m: number): number; } >explicitProperty : (this: { n: number; }, m: number) => number ->11 : number +>11 : 11 let explicitVoid = reconstructed.explicitVoid; >explicitVoid : (this: void, m: number) => number @@ -425,7 +425,7 @@ let explicitVoid = reconstructed.explicitVoid; explicitVoid(12); >explicitVoid(12) : number >explicitVoid : (this: void, m: number) => number ->12 : number +>12 : 12 // assignment checking let unboundToSpecified: (this: { y: number }, x: number) => number = x => x + this.y; // ok, this:any @@ -457,7 +457,7 @@ let anyToSpecified: (this: { y: number }, x: number) => number = function(x: num >x : number >x + 12 : number >x : number ->12 : number +>12 : 12 let unspecifiedLambda: (x: number) => number = x => x + 12; >unspecifiedLambda : (x: number) => number @@ -466,7 +466,7 @@ let unspecifiedLambda: (x: number) => number = x => x + 12; >x : number >x + 12 : number >x : number ->12 : number +>12 : 12 let specifiedLambda: (this: void, x: number) => number = x => x + 12; >specifiedLambda : (this: void, x: number) => number @@ -476,7 +476,7 @@ let specifiedLambda: (this: void, x: number) => number = x => x + 12; >x : number >x + 12 : number >x : number ->12 : number +>12 : 12 let unspecifiedLambdaToSpecified: (this: {y: number}, x: number) => number = unspecifiedLambda; >unspecifiedLambdaToSpecified : (this: { y: number; }, x: number) => number @@ -881,11 +881,11 @@ function InterfaceThis(this: I) { >I : I this.a = 12; ->this.a = 12 : number +>this.a = 12 : 12 >this.a : number >this : I >a : number ->12 : number +>12 : 12 } function LiteralTypeThis(this: {x: string}) { >LiteralTypeThis : (this: { x: string; }) => void @@ -893,22 +893,22 @@ function LiteralTypeThis(this: {x: string}) { >x : string this.x = "ok"; ->this.x = "ok" : string +>this.x = "ok" : "ok" >this.x : string >this : { x: string; } >x : string ->"ok" : string +>"ok" : "ok" } function AnyThis(this: any) { >AnyThis : (this: any) => void >this : any this.x = "ok"; ->this.x = "ok" : string +>this.x = "ok" : "ok" >this.x : any >this : any >x : any ->"ok" : string +>"ok" : "ok" } let interfaceThis = new InterfaceThis(); >interfaceThis : any @@ -949,7 +949,7 @@ let n: number = f.call(12); >f.call : (this: (...argArray: any[]) => U, ...argArray: any[]) => U >f : { (this: void, x: number): number; call(this: (...argArray: any[]) => U, ...argArray: any[]): U; } >call : (this: (...argArray: any[]) => U, ...argArray: any[]) => U ->12 : number +>12 : 12 function missingTypeIsImplicitAny(this, a: number) { return this.anything + a; } >missingTypeIsImplicitAny : (this: any, a: number) => any diff --git a/tests/baselines/reference/thisTypeInFunctions2.types b/tests/baselines/reference/thisTypeInFunctions2.types index 25fb2f28a6063..3cf6c1d2faedf 100644 --- a/tests/baselines/reference/thisTypeInFunctions2.types +++ b/tests/baselines/reference/thisTypeInFunctions2.types @@ -58,7 +58,7 @@ declare function simple(arg: SimpleInterface): void; extend1({ >extend1({ init() { this // this: IndexedWithThis because of contextual typing. // this.mine this.willDestroy }, mine: 12, foo() { this.url; // this: any because 'foo' matches the string indexer this.willDestroy; }}) : void >extend1 : (args: IndexedWithThis) => void ->{ init() { this // this: IndexedWithThis because of contextual typing. // this.mine this.willDestroy }, mine: 12, foo() { this.url; // this: any because 'foo' matches the string indexer this.willDestroy; }} : { init(this: IndexedWithThis): void; mine: number; foo(this: any): void; } +>{ init() { this // this: IndexedWithThis because of contextual typing. // this.mine this.willDestroy }, mine: 12, foo() { this.url; // this: any because 'foo' matches the string indexer this.willDestroy; }} : { init(this: IndexedWithThis): void; mine: 12; foo(this: any): void; } init() { >init : (this: IndexedWithThis) => void @@ -75,7 +75,7 @@ extend1({ }, mine: 12, >mine : number ->12 : number +>12 : 12 foo() { >foo : (this: any) => void @@ -115,7 +115,7 @@ extend2({ }, mine: 13, >mine : number ->13 : number +>13 : 13 foo() { >foo : () => void @@ -159,7 +159,7 @@ simple({ >bar : () => number return 14; ->14 : number +>14 : 14 } }) diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt index 564aa2ed92683..e88f4c1ca964f 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt @@ -11,7 +11,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(62,97): er tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(63,110): error TS2322: Type '{ wrongName: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(65,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(66,6): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(66,6): error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(67,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(68,1): error TS2684: The 'this' context of type '{ y: string; f: (this: { y: number; }, x: number) => number; }' is not assignable to method's 'this' of type '{ y: number; }'. Types of property 'y' are incompatible. @@ -19,16 +19,16 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(68,1): err tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(69,1): error TS2684: The 'this' context of type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }' is not assignable to method's 'this' of type '{ y: number; }'. Property 'y' is missing in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(72,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(73,13): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(73,13): error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(74,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(75,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(76,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(76,16): error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(77,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(78,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(79,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(79,16): error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(80,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(81,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(82,20): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(82,20): error TS2345: Argument of type '"wrong type 3"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(83,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(86,5): error TS2322: Type '(this: { y: number; }, x: number) => number' is not assignable to type '(this: void, x: number) => number'. The 'this' types of each signature are incompatible. @@ -190,7 +190,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e !!! error TS2346: Supplied parameters do not match any signature of call target. ok.f('wrong type'); ~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. ok.f(13, 'too many arguments'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -210,7 +210,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e !!! error TS2346: Supplied parameters do not match any signature of call target. c.explicitC('wrong type'); ~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. c.explicitC(13, 'too many arguments'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -219,7 +219,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e !!! error TS2346: Supplied parameters do not match any signature of call target. c.explicitThis('wrong type 2'); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'. c.explicitThis(14, 'too many arguments 2'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -228,7 +228,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e !!! error TS2346: Supplied parameters do not match any signature of call target. c.implicitThis('wrong type 2'); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'. c.implicitThis(14, 'too many arguments 2'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -237,7 +237,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e !!! error TS2346: Supplied parameters do not match any signature of call target. c.explicitProperty('wrong type 3'); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"wrong type 3"' is not assignable to parameter of type 'number'. c.explicitProperty(15, 'too many arguments 3'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/thisTypeInObjectLiterals.types b/tests/baselines/reference/thisTypeInObjectLiterals.types index 91d95d5f0a897..240cfaa54f975 100644 --- a/tests/baselines/reference/thisTypeInObjectLiterals.types +++ b/tests/baselines/reference/thisTypeInObjectLiterals.types @@ -5,7 +5,7 @@ let o = { d: "bar", >d : string ->"bar" : string +>"bar" : "bar" m() { >m : () => any @@ -37,7 +37,7 @@ let mutuallyRecursive = { a: 100, >a : number ->100 : number +>100 : 100 start() { >start : () => any @@ -71,7 +71,7 @@ let mutuallyRecursive = { if (n > 0) { >n > 0 : boolean >n : number ->0 : number +>0 : 0 return this.passthrough(n - 1); >this.passthrough(n - 1) : any @@ -80,7 +80,7 @@ let mutuallyRecursive = { >passthrough : any >n - 1 : number >n : number ->1 : number +>1 : 1 } return n; >n : number diff --git a/tests/baselines/reference/thisTypeInTuples.types b/tests/baselines/reference/thisTypeInTuples.types index d2d70ad8e098f..3b6f995840ec6 100644 --- a/tests/baselines/reference/thisTypeInTuples.types +++ b/tests/baselines/reference/thisTypeInTuples.types @@ -10,8 +10,8 @@ interface Array { let t: [number, string] = [42, "hello"]; >t : [number, string] >[42, "hello"] : [number, string] ->42 : number ->"hello" : string +>42 : 42 +>"hello" : "hello" let a = t.slice(); >a : [number, string] @@ -26,7 +26,7 @@ let b = t.slice(1); >t.slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } >t : [number, string] >slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } ->1 : number +>1 : 1 let c = t.slice(0, 1); >c : (string | number)[] @@ -34,6 +34,6 @@ let c = t.slice(0, 1); >t.slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } >t : [number, string] >slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/throwInEnclosingStatements.types b/tests/baselines/reference/throwInEnclosingStatements.types index eb127cf28bd93..4955b9243aebf 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.types +++ b/tests/baselines/reference/throwInEnclosingStatements.types @@ -34,12 +34,12 @@ switch (y) { var z = 0; >z : number ->0 : number +>0 : 0 while (z < 10) { >z < 10 : boolean >z : number ->10 : number +>10 : 10 throw z; >z : number @@ -47,7 +47,7 @@ while (z < 10) { for (var i = 0; ;) { throw i; } >i : number ->0 : number +>0 : 0 >i : number for (var idx in {}) { throw idx; } @@ -57,16 +57,16 @@ for (var idx in {}) { throw idx; } do { throw null; }while(true) >null : null ->true : boolean +>true : true var j = 0; >j : number ->0 : number +>0 : 0 while (j < 0) { throw j; } >j < 0 : boolean >j : number ->0 : number +>0 : 0 >j : number class C { @@ -98,7 +98,7 @@ var aa = { id:12, >id : number ->12 : number +>12 : 12 biz() { >biz : () => void diff --git a/tests/baselines/reference/throwStatements.types b/tests/baselines/reference/throwStatements.types index 5023513ee5372..19b8988ed47e4 100644 --- a/tests/baselines/reference/throwStatements.types +++ b/tests/baselines/reference/throwStatements.types @@ -40,7 +40,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string ->42 : number +>42 : 42 module M { >M : typeof M @@ -63,14 +63,14 @@ module M { var aNumber = 9.9; >aNumber : number ->9.9 : number +>9.9 : 9.9 throw aNumber; >aNumber : number var aString = 'this is a string'; >aString : string ->'this is a string' : string +>'this is a string' : "this is a string" throw aString; >aString : string @@ -79,7 +79,7 @@ var aDate = new Date(12); >aDate : Date >new Date(12) : Date >Date : DateConstructor ->12 : number +>12 : 12 throw aDate; >aDate : Date @@ -135,7 +135,7 @@ var anObjectLiteral = { id: 12 }; >anObjectLiteral : { id: number; } >{ id: 12 } : { id: number; } >id : number ->12 : number +>12 : 12 throw anObjectLiteral; >anObjectLiteral : { id: number; } @@ -150,13 +150,13 @@ throw aFunction; throw aFunction(''); >aFunction('') : number >aFunction : (x: string) => number ->'' : string +>'' : "" var aLambda = (x) => 2; >aLambda : (x: any) => number >(x) => 2 : (x: any) => number >x : any ->2 : number +>2 : 2 throw aLambda; >aLambda : (x: any) => number @@ -164,7 +164,7 @@ throw aLambda; throw aLambda(1); >aLambda(1) : number >aLambda : (x: any) => number ->1 : number +>1 : 1 var aModule = M; >aModule : typeof M @@ -205,10 +205,10 @@ throw x; // literals throw 0.0; ->0.0 : number +>0.0 : 0 throw false; ->false : boolean +>false : false throw null; >null : null @@ -217,34 +217,34 @@ throw undefined; >undefined : undefined throw 'a string'; ->'a string' : string +>'a string' : "a string" throw function () { return 'a string' }; >function () { return 'a string' } : () => string ->'a string' : string +>'a string' : "a string" throw (x:T) => 42; >(x:T) => 42 : (x: T) => number >T : T >x : T >T : T ->42 : number +>42 : 42 throw { x: 12, y: 13 }; >{ x: 12, y: 13 } : { x: number; y: number; } >x : number ->12 : number +>12 : 12 >y : number ->13 : number +>13 : 13 throw []; >[] : undefined[] throw ['a', ['b']]; >['a', ['b']] : (string | string[])[] ->'a' : string +>'a' : "a" >['b'] : string[] ->'b' : string +>'b' : "b" throw /[a-z]/; >/[a-z]/ : RegExp diff --git a/tests/baselines/reference/toStringOnPrimitives.types b/tests/baselines/reference/toStringOnPrimitives.types index 4d7227f248a08..1b0e320ef6f3a 100644 --- a/tests/baselines/reference/toStringOnPrimitives.types +++ b/tests/baselines/reference/toStringOnPrimitives.types @@ -2,22 +2,22 @@ true.toString() >true.toString() : string >true.toString : () => string ->true : boolean +>true : true >toString : () => string var aBool = false; >aBool : boolean ->false : boolean +>false : false aBool.toString(); >aBool.toString() : string >aBool.toString : () => string ->aBool : boolean +>aBool : false >toString : () => string 1..toString(); >1..toString() : string >1..toString : (radix?: number) => string ->1. : number +>1. : 1 >toString : (radix?: number) => string diff --git a/tests/baselines/reference/topLevel.types b/tests/baselines/reference/topLevel.types index ac1dd1182b93f..72794b6f4e3f5 100644 --- a/tests/baselines/reference/topLevel.types +++ b/tests/baselines/reference/topLevel.types @@ -48,21 +48,21 @@ class Point implements IPoint { >"("+this.x+","+this.y : string >"("+this.x+"," : string >"("+this.x : string ->"(" : string +>"(" : "(" >this.x : any >this : this >x : any ->"," : string +>"," : "," >this.y : any >this : this >y : any ->")" : string +>")" : ")" } } var result=""; >result : string ->"" : string +>"" : "" result+=(new Point(3,4).move(2,2)); >result+=(new Point(3,4).move(2,2)) : string @@ -72,11 +72,11 @@ result+=(new Point(3,4).move(2,2)); >new Point(3,4).move : (xo: number, yo: number) => Point >new Point(3,4) : Point >Point : typeof Point ->3 : number ->4 : number +>3 : 3 +>4 : 4 >move : (xo: number, yo: number) => Point ->2 : number ->2 : number +>2 : 2 +>2 : 2 module M { >M : typeof M @@ -85,8 +85,8 @@ module M { >origin : Point >new Point(0,0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 } result+=(M.origin.move(1,1)); @@ -99,7 +99,7 @@ result+=(M.origin.move(1,1)); >M : typeof M >origin : Point >move : (xo: number, yo: number) => Point ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/topLevelAmbientModule.types b/tests/baselines/reference/topLevelAmbientModule.types index c5bcfa3a5bf68..aef1bb5486f77 100644 --- a/tests/baselines/reference/topLevelAmbientModule.types +++ b/tests/baselines/reference/topLevelAmbientModule.types @@ -9,7 +9,7 @@ var z = foo.x + 10; >foo.x : number >foo : typeof foo >x : number ->10 : number +>10 : 10 === tests/cases/conformance/externalModules/foo_0.ts === declare module "foo" { diff --git a/tests/baselines/reference/topLevelExports.types b/tests/baselines/reference/topLevelExports.types index ab1569915067b..4a27478c08f8e 100644 --- a/tests/baselines/reference/topLevelExports.types +++ b/tests/baselines/reference/topLevelExports.types @@ -1,7 +1,7 @@ === tests/cases/compiler/topLevelExports.ts === export var foo = 3; >foo : number ->3 : number +>3 : 3 function log(n:number) { return n;} >log : (n: number) => number diff --git a/tests/baselines/reference/trailingCommasES3.types b/tests/baselines/reference/trailingCommasES3.types index 98777c6b37f14..21e397a1c4629 100644 --- a/tests/baselines/reference/trailingCommasES3.types +++ b/tests/baselines/reference/trailingCommasES3.types @@ -4,23 +4,23 @@ var o1 = { a: 1, b: 2 }; >o1 : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 var o2 = { a: 1, b: 2, }; >o2 : { a: number; b: number; } >{ a: 1, b: 2, } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 var o3 = { a: 1, }; >o3 : { a: number; } >{ a: 1, } : { a: number; } >a : number ->1 : number +>1 : 1 var o4 = {}; >o4 : {} @@ -29,19 +29,19 @@ var o4 = {}; var a1 = [1, 2]; >a1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a2 = [1, 2, ]; >a2 : number[] >[1, 2, ] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a3 = [1, ]; >a3 : number[] >[1, ] : number[] ->1 : number +>1 : 1 var a4 = []; >a4 : any[] @@ -50,7 +50,7 @@ var a4 = []; var a5 = [1, , ]; >a5 : number[] >[1, , ] : number[] ->1 : number +>1 : 1 > : undefined var a6 = [, , ]; diff --git a/tests/baselines/reference/trailingCommasES5.types b/tests/baselines/reference/trailingCommasES5.types index 498f70df94abf..22d4fb3778063 100644 --- a/tests/baselines/reference/trailingCommasES5.types +++ b/tests/baselines/reference/trailingCommasES5.types @@ -4,23 +4,23 @@ var o1 = { a: 1, b: 2 }; >o1 : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 var o2 = { a: 1, b: 2, }; >o2 : { a: number; b: number; } >{ a: 1, b: 2, } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 var o3 = { a: 1, }; >o3 : { a: number; } >{ a: 1, } : { a: number; } >a : number ->1 : number +>1 : 1 var o4 = {}; >o4 : {} @@ -29,19 +29,19 @@ var o4 = {}; var a1 = [1, 2]; >a1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a2 = [1, 2, ]; >a2 : number[] >[1, 2, ] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a3 = [1, ]; >a3 : number[] >[1, ] : number[] ->1 : number +>1 : 1 var a4 = []; >a4 : any[] @@ -50,7 +50,7 @@ var a4 = []; var a5 = [1, , ]; >a5 : number[] >[1, , ] : number[] ->1 : number +>1 : 1 > : undefined var a6 = [, , ]; diff --git a/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.types b/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.types index 9e2aa0abd8a63..00cca0b5e8739 100644 --- a/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.types +++ b/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.types @@ -7,7 +7,7 @@ function f1(x,) {} f1(1,); >f1(1,) : void >f1 : (x: any) => void ->1 : number +>1 : 1 function f2(...args,) {} >f2 : (...args: any[]) => void @@ -33,14 +33,14 @@ declare function f3(x, y,): string; >f3(1,) : number >f3(1,) : number >f3 : { (x: any): number; (x: any, y: any): string; } ->1 : number +>1 : 1 f3(1, 2,); >f3(1, 2,) : string >f3(1, 2,) : string >f3 : { (x: any): number; (x: any, y: any): string; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 // Works for constructors too class X { @@ -67,5 +67,5 @@ interface Y { new X(1,); >new X(1,) : X >X : typeof X ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/tsxAttributeErrors.errors.txt b/tests/baselines/reference/tsxAttributeErrors.errors.txt index 30a897c5163b1..4a89896936363 100644 --- a/tests/baselines/reference/tsxAttributeErrors.errors.txt +++ b/tests/baselines/reference/tsxAttributeErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsx/tsxAttributeErrors.tsx(15,6): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/tsxAttributeErrors.tsx(18,6): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/tsxAttributeErrors.tsx(15,6): error TS2322: Type '42' is not assignable to type 'string'. +tests/cases/conformance/jsx/tsxAttributeErrors.tsx(18,6): error TS2322: Type '"foo"' is not assignable to type 'number'. tests/cases/conformance/jsx/tsxAttributeErrors.tsx(22,6): error TS2606: Property 'text' of JSX spread attribute is not assignable to target property. Type 'number' is not assignable to type 'string'. @@ -21,12 +21,12 @@ tests/cases/conformance/jsx/tsxAttributeErrors.tsx(22,6): error TS2606: Property // Error, number is not assignable to string
; ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '42' is not assignable to type 'string'. // Error, string is not assignable to number
; ~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"foo"' is not assignable to type 'number'. // Error, number is not assignable to string var attribs = { text: 100 }; diff --git a/tests/baselines/reference/tsxAttributeResolution1.errors.txt b/tests/baselines/reference/tsxAttributeResolution1.errors.txt index 49bb504604e04..f7fb114f3e0bc 100644 --- a/tests/baselines/reference/tsxAttributeResolution1.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type '"0"' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(24,8): error TS2339: Property 'y' does not exist on type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(25,8): error TS2339: Property 'y' does not exist on type 'Attribs1'. -tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type '"32"' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(27,8): error TS2339: Property 'var' does not exist on type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(29,1): error TS2324: Property 'reqd' is missing in type '{ reqd: string; }'. -tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '10' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (7 errors) ==== @@ -32,7 +32,7 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type 'number' is not a // Errors ; // Error, '0' is not number ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"0"' is not assignable to type 'number'. ; // Error, no property "y" ~ !!! error TS2339: Property 'y' does not exist on type 'Attribs1'. @@ -41,7 +41,7 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type 'number' is not a !!! error TS2339: Property 'y' does not exist on type 'Attribs1'. ; // Error, "32" is not number ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"32"' is not assignable to type 'number'. ; // Error, no 'var' property ~~~ !!! error TS2339: Property 'var' does not exist on type 'Attribs1'. @@ -51,7 +51,7 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type 'number' is not a !!! error TS2324: Property 'reqd' is missing in type '{ reqd: string; }'. ; // Error, reqd is not string ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '10' is not assignable to type 'string'. // Should be OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution10.errors.txt b/tests/baselines/reference/tsxAttributeResolution10.errors.txt index c929756364cc5..787eb4b5f0003 100644 --- a/tests/baselines/reference/tsxAttributeResolution10.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution10.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type '"world"' is not assignable to type 'boolean'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -25,7 +25,7 @@ tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type 'string' is not // Should be an error ; ~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"world"' is not assignable to type 'boolean'. // Should be OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution14.errors.txt b/tests/baselines/reference/tsxAttributeResolution14.errors.txt index 81d42e49059f6..9f4e00747f1e7 100644 --- a/tests/baselines/reference/tsxAttributeResolution14.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution14.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(14,28): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(16,28): error TS2322: Type 'boolean' is not assignable to type 'string | number'. +tests/cases/conformance/jsx/file.tsx(14,28): error TS2322: Type '2' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(16,28): error TS2322: Type 'true' is not assignable to type 'string | number'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -28,11 +28,11 @@ tests/cases/conformance/jsx/file.tsx(16,28): error TS2322: Type 'boolean' is not
// error ~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '2' is not assignable to type 'string'. // ok // error ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'true' is not assignable to type 'string | number'.
) } \ No newline at end of file diff --git a/tests/baselines/reference/tsxAttributeResolution3.errors.txt b/tests/baselines/reference/tsxAttributeResolution3.errors.txt index 6513b9879dcaf..ae8ba7a9a5470 100644 --- a/tests/baselines/reference/tsxAttributeResolution3.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution3.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/jsx/file.tsx(19,8): error TS2606: Property 'x' of JSX sp tests/cases/conformance/jsx/file.tsx(23,1): error TS2324: Property 'x' is missing in type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(31,15): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(39,8): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(39,8): error TS2322: Type '32' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== @@ -55,5 +55,5 @@ tests/cases/conformance/jsx/file.tsx(39,8): error TS2322: Type 'number' is not a var obj7 = { x: 'foo' }; ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '32' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxAttributeResolution6.errors.txt b/tests/baselines/reference/tsxAttributeResolution6.errors.txt index 732ac9500a9a2..f3a4d512152da 100644 --- a/tests/baselines/reference/tsxAttributeResolution6.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/jsx/file.tsx(10,8): error TS2322: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(11,8): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(11,8): error TS2322: Type '"true"' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(12,1): error TS2324: Property 'n' is missing in type '{ n: boolean; }'. @@ -18,7 +18,7 @@ tests/cases/conformance/jsx/file.tsx(12,1): error TS2324: Property 'n' is missin !!! error TS2322: Type 'boolean' is not assignable to type 'string'. ; ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"true"' is not assignable to type 'boolean'. ; ~~~~~~~~~ !!! error TS2324: Property 'n' is missing in type '{ n: boolean; }'. diff --git a/tests/baselines/reference/tsxAttributeResolution7.errors.txt b/tests/baselines/reference/tsxAttributeResolution7.errors.txt index acbd7f407de8b..f5af1b48eb2aa 100644 --- a/tests/baselines/reference/tsxAttributeResolution7.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution7.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type '32' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type 'number' is not as // Error ; ~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '32' is not assignable to type 'string'. // OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution9.errors.txt b/tests/baselines/reference/tsxAttributeResolution9.errors.txt index c25532eaa0a35..73571689b1fa3 100644 --- a/tests/baselines/reference/tsxAttributeResolution9.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution9.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type '0' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -27,5 +27,5 @@ tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type 'number' is not a ; // ok ; // should be an error ~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '0' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxDynamicTagName1.types b/tests/baselines/reference/tsxDynamicTagName1.types index 005afcf6adb8d..def9810e05262 100644 --- a/tests/baselines/reference/tsxDynamicTagName1.types +++ b/tests/baselines/reference/tsxDynamicTagName1.types @@ -2,7 +2,7 @@ var CustomTag = "h1"; >CustomTag : string ->"h1" : string +>"h1" : "h1" Hello World // No error > Hello World : any diff --git a/tests/baselines/reference/tsxDynamicTagName5.types b/tests/baselines/reference/tsxDynamicTagName5.types index ac4ee31141aa3..dbc01e894834c 100644 --- a/tests/baselines/reference/tsxDynamicTagName5.types +++ b/tests/baselines/reference/tsxDynamicTagName5.types @@ -19,7 +19,7 @@ export class Text extends React.Component<{}, {}> { _tagName: string = 'div'; >_tagName : string ->'div' : string +>'div' : "div" render() { >render : () => any diff --git a/tests/baselines/reference/tsxDynamicTagName6.types b/tests/baselines/reference/tsxDynamicTagName6.types index 5dadf6fe825e9..b4fbb1ed358c9 100644 --- a/tests/baselines/reference/tsxDynamicTagName6.types +++ b/tests/baselines/reference/tsxDynamicTagName6.types @@ -18,7 +18,7 @@ const t = {tag:'h1'} >t : { tag: string; } >{tag:'h1'} : { tag: string; } >tag : string ->'h1' : string +>'h1' : "h1" const foo = // No error >foo : JSX.Element diff --git a/tests/baselines/reference/tsxDynamicTagName8.types b/tests/baselines/reference/tsxDynamicTagName8.types index 154e7e33fe089..e2d7956a98944 100644 --- a/tests/baselines/reference/tsxDynamicTagName8.types +++ b/tests/baselines/reference/tsxDynamicTagName8.types @@ -19,7 +19,7 @@ export class Text extends React.Component<{}, {}> { _tagName: string = 'div'; >_tagName : string ->'div' : string +>'div' : "div" render() { >render : () => any diff --git a/tests/baselines/reference/tsxElementResolution12.errors.txt b/tests/baselines/reference/tsxElementResolution12.errors.txt index 4a15005f6fb72..5367e29e388bd 100644 --- a/tests/baselines/reference/tsxElementResolution12.errors.txt +++ b/tests/baselines/reference/tsxElementResolution12.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/jsx/file.tsx(17,2): error TS2304: Cannot find name 'Obj2'. tests/cases/conformance/jsx/file.tsx(23,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property -tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type '"10"' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -39,5 +39,5 @@ tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type 'string' is not a ; // OK ; // Error ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution13.types b/tests/baselines/reference/tsxElementResolution13.types index 57884f86b56db..d55d4705ff419 100644 --- a/tests/baselines/reference/tsxElementResolution13.types +++ b/tests/baselines/reference/tsxElementResolution13.types @@ -25,5 +25,5 @@ var obj1: Obj1; > : JSX.Element >obj1 : Obj1 >x : any ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/tsxElementResolution14.types b/tests/baselines/reference/tsxElementResolution14.types index 2768a6c531d0b..752a0baafb996 100644 --- a/tests/baselines/reference/tsxElementResolution14.types +++ b/tests/baselines/reference/tsxElementResolution14.types @@ -20,5 +20,5 @@ var obj1: Obj1; > : JSX.Element >obj1 : Obj1 >x : any ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/tsxElementResolution9.types b/tests/baselines/reference/tsxElementResolution9.types index b138aa0509e33..c63e61efc0716 100644 --- a/tests/baselines/reference/tsxElementResolution9.types +++ b/tests/baselines/reference/tsxElementResolution9.types @@ -68,5 +68,5 @@ var Obj3: Obj3; > : JSX.Element >Obj3 : Obj3 >x : any ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/tsxEmit1.types b/tests/baselines/reference/tsxEmit1.types index e6f92bebd1edf..84f00b4758ab6 100644 --- a/tests/baselines/reference/tsxEmit1.types +++ b/tests/baselines/reference/tsxEmit1.types @@ -45,7 +45,7 @@ var selfClosed5 =
; >
: JSX.Element >div : any >x : any ->0 : number +>0 : 0 >y : any var selfClosed6 =
; @@ -53,7 +53,7 @@ var selfClosed6 =
; >
: JSX.Element >div : any >x : any ->"1" : string +>"1" : "1" >y : any var selfClosed7 =
; diff --git a/tests/baselines/reference/tsxEmit3.types b/tests/baselines/reference/tsxEmit3.types index e70c44d00418d..42c31a37720bc 100644 --- a/tests/baselines/reference/tsxEmit3.types +++ b/tests/baselines/reference/tsxEmit3.types @@ -77,7 +77,7 @@ module M { var M = 100; >M : number ->100 : number +>100 : 100 // Emit M_1.Foo Foo, ; diff --git a/tests/baselines/reference/tsxGenericArrowFunctionParsing.types b/tests/baselines/reference/tsxGenericArrowFunctionParsing.types index d5a9436872a83..693f920195dd3 100644 --- a/tests/baselines/reference/tsxGenericArrowFunctionParsing.types +++ b/tests/baselines/reference/tsxGenericArrowFunctionParsing.types @@ -51,7 +51,7 @@ var x4 = () => {}; >() => {} : JSX.Element >T : any >extends : any ->true : boolean +>true : true >T : any x4.isElement; diff --git a/tests/baselines/reference/tsxReactEmit1.types b/tests/baselines/reference/tsxReactEmit1.types index d837eb007bfa7..8eb14e9196365 100644 --- a/tests/baselines/reference/tsxReactEmit1.types +++ b/tests/baselines/reference/tsxReactEmit1.types @@ -47,7 +47,7 @@ var selfClosed5 =
; >
: JSX.Element >div : any >x : any ->0 : number +>0 : 0 >y : any var selfClosed6 =
; @@ -55,7 +55,7 @@ var selfClosed6 =
; >
: JSX.Element >div : any >x : any ->"1" : string +>"1" : "1" >y : any var selfClosed7 =
; diff --git a/tests/baselines/reference/tsxReactEmitEntities.types b/tests/baselines/reference/tsxReactEmitEntities.types index 3127e97afc3ad..34ef6dff0a867 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.types +++ b/tests/baselines/reference/tsxReactEmitEntities.types @@ -48,7 +48,7 @@ declare var React: any; >
: JSX.Element >div : any >attr : any ->"{…}\"" : string +>"{…}\"" : "{…}\"" >div : any // Preserves single quotes diff --git a/tests/baselines/reference/tsxReactEmitNesting.types b/tests/baselines/reference/tsxReactEmitNesting.types index fff29c1152535..7a1b3e82441e9 100644 --- a/tests/baselines/reference/tsxReactEmitNesting.types +++ b/tests/baselines/reference/tsxReactEmitNesting.types @@ -62,7 +62,7 @@ let render = (ctrl, model) => >style : any >{display:(model.todos && model.todos.length) ? "block" : "none"} : { display: string; } >display : string ->(model.todos && model.todos.length) ? "block" : "none" : string +>(model.todos && model.todos.length) ? "block" : "none" : "block" | "none" >(model.todos && model.todos.length) : any >model.todos && model.todos.length : any >model.todos : any @@ -73,8 +73,8 @@ let render = (ctrl, model) => >model : any >todos : any >length : any ->"block" : string ->"none" : string +>"block" : "block" +>"none" : "none" > : any @@ -111,7 +111,7 @@ let render = (ctrl, model) => >class : any >{todo: true, completed: todo.completed, editing: todo == model.editedTodo} : { todo: boolean; completed: any; editing: boolean; } >todo : boolean ->true : boolean +>true : true >completed : any >todo.completed : any >todo : any diff --git a/tests/baselines/reference/tsxReactEmitWhitespace.types b/tests/baselines/reference/tsxReactEmitWhitespace.types index 824aa5cfdae99..f5ae431d34253 100644 --- a/tests/baselines/reference/tsxReactEmitWhitespace.types +++ b/tests/baselines/reference/tsxReactEmitWhitespace.types @@ -20,7 +20,7 @@ declare var React: any; var p = 0; >p : number ->0 : number +>0 : 0 // Emit " "
; diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt index a40aef38e22d1..e1f7570d9c0a0 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/jsx/file.tsx(12,9): error TS2324: Property 'name' is missing in type 'IntrinsicAttributes & { name: string; }'. tests/cases/conformance/jsx/file.tsx(12,16): error TS2339: Property 'naaame' does not exist on type 'IntrinsicAttributes & { name: string; }'. -tests/cases/conformance/jsx/file.tsx(19,15): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(19,15): error TS2322: Type '42' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(21,15): error TS2339: Property 'naaaaaaame' does not exist on type 'IntrinsicAttributes & { name?: string; }'. @@ -29,7 +29,7 @@ tests/cases/conformance/jsx/file.tsx(21,15): error TS2339: Property 'naaaaaaame' // Error let e = ; ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '42' is not assignable to type 'string'. // Error let f = ; ~~~~~~~~~~ diff --git a/tests/baselines/reference/tsxTypeErrors.types b/tests/baselines/reference/tsxTypeErrors.types index 303c7695dbfc3..d64781479fa27 100644 --- a/tests/baselines/reference/tsxTypeErrors.types +++ b/tests/baselines/reference/tsxTypeErrors.types @@ -19,7 +19,7 @@ var thing = { oops: 100 }; >thing : { oops: number; } >{ oops: 100 } : { oops: number; } >oops : number ->100 : number +>100 : 100 var a3 =
>a3 : any @@ -62,7 +62,7 @@ var b1 = ; > : any >MyClass : typeof MyClass >reqd : any ->true : boolean +>true : true // Mistyped attribute member // sample.tsx(23,22): error TS2322: Type '{ x: number; y: string; }' is not assignable to type '{ x: number; y: number; }'. @@ -75,8 +75,8 @@ var b2 = ; >pt : any >{x: 4, y: 'oops'} : { x: number; y: string; } >x : number ->4 : number +>4 : 4 >y : string ->'oops' : string +>'oops' : "oops" diff --git a/tests/baselines/reference/tupleElementTypes3.types b/tests/baselines/reference/tupleElementTypes3.types index 6f29ba1371a1d..eee520d4425ed 100644 --- a/tests/baselines/reference/tupleElementTypes3.types +++ b/tests/baselines/reference/tupleElementTypes3.types @@ -3,6 +3,6 @@ var [a, b] = [0, undefined]; >a : number >b : any >[0, undefined] : [number, undefined] ->0 : number +>0 : 0 >undefined : undefined diff --git a/tests/baselines/reference/tupleElementTypes4.types b/tests/baselines/reference/tupleElementTypes4.types index 06e19ef72bbf2..72ff071e5e21a 100644 --- a/tests/baselines/reference/tupleElementTypes4.types +++ b/tests/baselines/reference/tupleElementTypes4.types @@ -4,6 +4,6 @@ function f([a, b] = [0, undefined]) { } >a : number >b : any >[0, undefined] : [number, undefined] ->0 : number +>0 : 0 >undefined : undefined diff --git a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types index d9702b5995427..897e54a233039 100644 --- a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types +++ b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types @@ -106,12 +106,12 @@ var c: C; var r2 = c.foo(1, 2); // number >r2 : number ->c.foo(1, 2) : number +>c.foo(1, 2) : 1 | 2 >c.foo : { (x: boolean, y: Date): string; (x: string, y: string): number; (x: W, y: W): W; } >c : C >foo : { (x: boolean, y: Date): string; (x: string, y: string): number; (x: W, y: W): W; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 // add generic overload that would be ambiguous interface D { @@ -163,6 +163,6 @@ var r3 = d.foo(1, 1); // boolean, last definition wins >d.foo : { (x: A, y: A): Date; (x: W, y: W): boolean; } >d : D >foo : { (x: A, y: A): Date; (x: W, y: W): boolean; } ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types index a796d65cf61a2..bbe716d43234a 100644 --- a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types +++ b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types @@ -28,14 +28,14 @@ var r2 = a(1); >r2 : number >a(1) : number >a : A ->1 : number +>1 : 1 var r3 = a(1, 2); >r3 : boolean >a(1, 2) : boolean >a : A ->1 : number ->2 : number +>1 : 1 +>2 : 2 module G { >G : typeof G @@ -90,12 +90,12 @@ module G { >a(true, 2) : boolean >a : A >true : true ->2 : number +>2 : 2 var r4 = a(1, true); >r4 : number ->a(1, true) : number +>a(1, true) : 1 >a : A ->1 : number +>1 : 1 >true : true } diff --git a/tests/baselines/reference/typeAliases.types b/tests/baselines/reference/typeAliases.types index 06dfd402829dc..1d798bc14a64a 100644 --- a/tests/baselines/reference/typeAliases.types +++ b/tests/baselines/reference/typeAliases.types @@ -191,7 +191,7 @@ type Meters = number enum E { x = 10 } >E : E >x : E ->10 : number +>10 : 10 declare function f15(a: string): boolean; >f15 : { (a: string): boolean; (a: number): string; } @@ -232,7 +232,7 @@ var y: StringAndBoolean = ["1", false]; >y : [string, boolean] >StringAndBoolean : [string, boolean] >["1", false] : [string, false] ->"1" : string +>"1" : "1" >false : false y[0].toLowerCase(); @@ -240,6 +240,6 @@ y[0].toLowerCase(); >y[0].toLowerCase : () => string >y[0] : string >y : [string, boolean] ->0 : number +>0 : 0 >toLowerCase : () => string diff --git a/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types b/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types index d0c881c1c5d77..66e35a5a5356d 100644 --- a/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types +++ b/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types @@ -28,31 +28,31 @@ var menuData: IMenuItem[] = [ >{ "id": "ourLogo", "type": "image", "link": "", "icon": "modules/menu/logo.svg" } : { "id": string; "type": string; "link": string; "icon": string; } "id": "ourLogo", ->"ourLogo" : string +>"ourLogo" : "ourLogo" "type": "image", ->"image" : string +>"image" : "image" "link": "", ->"" : string +>"" : "" "icon": "modules/menu/logo.svg" ->"modules/menu/logo.svg" : string +>"modules/menu/logo.svg" : "modules/menu/logo.svg" }, { >{ "id": "productName", "type": "default", "link": "", "text": "Product Name" } : { "id": string; "type": string; "link": string; "text": string; } "id": "productName", ->"productName" : string +>"productName" : "productName" "type": "default", ->"default" : string +>"default" : "default" "link": "", ->"" : string +>"" : "" "text": "Product Name" ->"Product Name" : string +>"Product Name" : "Product Name" } ]; diff --git a/tests/baselines/reference/typeArgInference.types b/tests/baselines/reference/typeArgInference.types index d553e0fe8d42f..e8a2fff80a7e5 100644 --- a/tests/baselines/reference/typeArgInference.types +++ b/tests/baselines/reference/typeArgInference.types @@ -39,9 +39,9 @@ var o = { a: 3, b: "test" }; >o : { a: number; b: string; } >{ a: 3, b: "test" } : { a: number; b: string; } >a : number ->3 : number +>3 : 3 >b : string ->"test" : string +>"test" : "test" var x: I; >x : I diff --git a/tests/baselines/reference/typeArgInference2WithError.errors.txt b/tests/baselines/reference/typeArgInference2WithError.errors.txt index 8a191ed310ec6..e7abedfecb742 100644 --- a/tests/baselines/reference/typeArgInference2WithError.errors.txt +++ b/tests/baselines/reference/typeArgInference2WithError.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeArgInference2WithError.ts(7,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '"abc"' is not a valid type argument because it is not a supertype of candidate '5'. ==== tests/cases/compiler/typeArgInference2WithError.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/typeArgInference2WithError.ts(7,10): error TS2453: The type var z7 = foo("abc", 5); // Error ~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file +!!! error TS2453: Type argument candidate '"abc"' is not a valid type argument because it is not a supertype of candidate '5'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgInferenceWithNull.types b/tests/baselines/reference/typeArgInferenceWithNull.types index 93ded4267eb02..52f656f689024 100644 --- a/tests/baselines/reference/typeArgInferenceWithNull.types +++ b/tests/baselines/reference/typeArgInferenceWithNull.types @@ -48,5 +48,5 @@ fn6({ x: null }, y => { }, { x: "" }); // y has type { x: any }, but ideally wou >y : { x: string; } >{ x: "" } : { x: string; } >x : string ->"" : string +>"" : "" diff --git a/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt b/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt index 1131b6e1a68cd..6f27916eda0b7 100644 --- a/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt +++ b/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeArgumentConstraintResolution1.ts(4,12): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. -tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. +tests/cases/compiler/typeArgumentConstraintResolution1.ts(4,12): error TS2345: Argument of type '""' is not assignable to parameter of type 'Date'. +tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: Argument of type '""' is not assignable to parameter of type 'Date'. ==== tests/cases/compiler/typeArgumentConstraintResolution1.ts (2 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: function foo1(test: any) { } foo1(""); // should error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'Date'. @@ -17,5 +17,5 @@ tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: function foo2(test: any): any { return null; } foo2(""); // Type Date does not satisfy the constraint 'Number' for type parameter 'T extends Number' ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'Date'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInference.errors.txt b/tests/baselines/reference/typeArgumentInference.errors.txt index 51cf4ccf7d253..cc6c1d8ce96e8 100644 --- a/tests/baselines/reference/typeArgumentInference.errors.txt +++ b/tests/baselines/reference/typeArgumentInference.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(68,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,69): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. @@ -78,7 +78,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74 var a9a = someGenerics9('', 0, []); ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. var a9a: {}; var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; diff --git a/tests/baselines/reference/typeArgumentInferenceApparentType1.types b/tests/baselines/reference/typeArgumentInferenceApparentType1.types index 29fd1aeca1885..1b25f79d4fcdb 100644 --- a/tests/baselines/reference/typeArgumentInferenceApparentType1.types +++ b/tests/baselines/reference/typeArgumentInferenceApparentType1.types @@ -14,5 +14,5 @@ var res: string = method("test"); >res : string >method("test") : string >method : (iterable: Iterable) => T ->"test" : string +>"test" : "test" diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index da01aa778b69a..ab056d461e93d 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(25,35): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(25,35): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(51,19): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(61,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. @@ -10,7 +10,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct Types of parameters 'n' and 'b' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(118,9): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,51): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,69): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. @@ -48,7 +48,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct new someGenerics1(3, 4); new someGenerics1(3, 4); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new someGenerics1(3, 4); // Generic call with argument of function type whose parameter is of type parameter type @@ -146,7 +146,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct var a9a = new someGenerics9('', 0, []); ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. var a9a: {}; var a9b = new someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; diff --git a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt index 36a17e166a527..47d5e82994c93 100644 --- a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(3,31): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(3,31): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(7,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -15,7 +15,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts function someGenerics1(n: T, m: number) { } someGenerics1(3, 4); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type function someGenerics4(n: T, f: (x: U) => void) { } diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.types b/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.types index 63ee130938323..dd434e8bb5ddf 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.types +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.types @@ -18,6 +18,6 @@ foo(class { static prop = "hello" }).length; >foo : (x?: typeof (Anonymous class)) => T >class { static prop = "hello" } : typeof (Anonymous class) >prop : string ->"hello" : string +>"hello" : "hello" >length : number diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.types b/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.types index 9a2bddd92963c..82764584abd3b 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.types +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.types @@ -18,6 +18,6 @@ foo(class { prop = "hello" }).length; >foo : (x?: typeof (Anonymous class)) => T >class { prop = "hello" } : typeof (Anonymous class) >prop : string ->"hello" : string +>"hello" : "hello" >length : number diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 22d18e11ecaa2..090f8c9b85227 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -15,7 +15,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(66,31): error TS2345: Argument of type '(a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(85,9): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,47): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,65): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. @@ -128,7 +128,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst var a9a = someGenerics9('', 0, []); ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. var a9a: {}; var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; diff --git a/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.errors.txt index c1352bedb9bc2..e82e7e020d074 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.errors.txt @@ -1,8 +1,10 @@ +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithObjectLiteral.ts(30,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'E1' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithObjectLiteral.ts(35,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'E1' is not a valid type argument because it is not a supertype of candidate 'E2'. -==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithObjectLiteral.ts (1 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithObjectLiteral.ts (2 errors) ==== interface Computed { read(): T; write(value: T); @@ -33,6 +35,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithObjec var v1 = f1({ w: x => x, r: () => 0 }, 0); var v1 = f1({ w: x => x, r: () => 0 }, E1.X); var v1 = f1({ w: x => x, r: () => E1.X }, 0); + ~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'E1' is not a valid type argument because it is not a supertype of candidate '0'. var v2: E1; var v2 = f1({ w: x => x, r: () => E1.X }, E1.X); diff --git a/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt b/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt index b529afd4c6a29..b2d9e3f8aaf16 100644 --- a/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt +++ b/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(2,13): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(3,15): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(3,15): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(4,13): error TS2346: Supplied parameters do not match any signature of call target. @@ -10,7 +10,7 @@ tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(4,13): erro !!! error TS2346: Supplied parameters do not match any signature of call target. var r2 = f(1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt index 48c7efb37e8c1..2876390758f1d 100644 --- a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt +++ b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt @@ -11,21 +11,17 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(55,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(57,52): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(58,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(61,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(63,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(75,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. - Type '"World"' is not assignable to type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(77,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. - Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(68,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(70,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(75,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(77,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(87,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(88,43): error TS2345: Argument of type '"Hello"' is not assignable to parameter of type '"World"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(89,52): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(93,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(97,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(100,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. - Type '"World"' is not assignable to type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(104,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. - Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(100,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(104,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(107,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(111,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. ==== tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts (24 errors) ==== @@ -116,32 +112,30 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 // Assignment from the returned value should cause an error. a = takeReturnString(a); - ~ -!!! error TS2322: Type 'string' is not assignable to type '"Hello"'. b = takeReturnString(b); c = takeReturnString(c); - ~ -!!! error TS2322: Type 'string' is not assignable to type '"Hello"'. d = takeReturnString(d); e = takeReturnString(e); // Should be valid a = takeReturnHello(a); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. b = takeReturnHello(b); c = takeReturnHello(c); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. d = takeReturnHello(d); e = takeReturnHello(e); // Assignment from the returned value should cause an error. a = takeReturnHelloWorld(a); - ~ -!!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. -!!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. b = takeReturnHelloWorld(b); c = takeReturnHelloWorld(c); - ~ -!!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. -!!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. d = takeReturnHelloWorld(d); e = takeReturnHelloWorld(e); } @@ -164,32 +158,30 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 // Assignment from the returned value should cause an error. a = takeReturnString(a); - ~ -!!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. b = takeReturnString(b); c = takeReturnString(c); d = takeReturnString(d); e = takeReturnString(e); - ~ -!!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. // Passing these as arguments should cause an error. a = takeReturnHello(a); ~ -!!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. -!!! error TS2345: Type '"World"' is not assignable to type '"Hello"'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. b = takeReturnHello(b); c = takeReturnHello(c); d = takeReturnHello(d); e = takeReturnHello(e); ~ -!!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. -!!! error TS2345: Type '"World"' is not assignable to type '"Hello"'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. // Both should be valid. a = takeReturnHelloWorld(a); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. b = takeReturnHelloWorld(b); c = takeReturnHelloWorld(c); d = takeReturnHelloWorld(d); e = takeReturnHelloWorld(e); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js index c07dd22539648..ca67e358705cf 100644 --- a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js +++ b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js @@ -229,16 +229,16 @@ declare namespace n1 { let e: string; } declare namespace n2 { - let a: "Hello"; + let a: string; let b: any; - let c: "Hello"; + let c: string; let d: any; let e: any; } declare namespace n3 { - let a: "Hello" | "World"; + let a: string; let b: any; let c: any; let d: any; - let e: "Hello" | "World"; + let e: string; } diff --git a/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt b/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt index a404b12701ad3..7d99934f5eab9 100644 --- a/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt +++ b/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeAssertionToGenericFunctionType.ts(5,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/typeAssertionToGenericFunctionType.ts(5,13): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/typeAssertionToGenericFunctionType.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -9,7 +9,7 @@ tests/cases/compiler/typeAssertionToGenericFunctionType.ts(6,1): error TS2346: S } x.a(1); // bug was that this caused 'Could not find symbol T' on return type T in the type assertion on x.a's definition ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. x.b(); // error ~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt b/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt index e8c9bd6fc2025..8df09b665131d 100644 --- a/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt +++ b/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(2,7): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(2,7): error TS2322: Type '10' is not assignable to type 'string'. tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(3,5): error TS2322: Type 'Object' is not assignable to type 'string'. tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(4,15): error TS2339: Property 'NonexistantMethod' does not exist on type 'number[]'. tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(5,5): error TS2304: Cannot find name 'derp'. @@ -8,7 +8,7 @@ tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(5,5): error var functions = [function () { var k: string = 10; ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '10' is not assignable to type 'string'. k = new Object(); ~ !!! error TS2322: Type 'Object' is not assignable to type 'string'. diff --git a/tests/baselines/reference/typeGuardFunction.types b/tests/baselines/reference/typeGuardFunction.types index 00dfc39f04a8b..a5635d2f31c1e 100644 --- a/tests/baselines/reference/typeGuardFunction.types +++ b/tests/baselines/reference/typeGuardFunction.types @@ -121,7 +121,7 @@ if (isC_multipleParams(a, 0)) { >isC_multipleParams(a, 0) : boolean >isC_multipleParams : (p1: any, p2: any) => p1 is C >a : A ->0 : number +>0 : 0 a.propC; >a.propC : number diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index eac2660df8114..88f71cda196ee 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(2,7): error TS2300: Duplicate identifier 'A'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(15,12): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(15,12): error TS2322: Type '""' is not assignable to type 'boolean'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,55): error TS2304: Cannot find name 'x'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,57): error TS1144: '{' or ';' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,57): error TS2304: Cannot find name 'is'. @@ -47,7 +47,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,22) tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,25): error TS1005: ';' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,27): error TS1005: ';' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(104,25): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2322: Type 'boolean' is not assignable to type 'D'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2322: Type 'true' is not assignable to type 'D'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(107,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(110,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. @@ -83,7 +83,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 function hasANonBooleanReturnStatement(x): x is A { return ''; ~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. } function hasTypeGuardTypeInsideTypeGuardType(x): x is x is A { @@ -259,7 +259,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 !!! error TS1228: A type predicate is only allowed in return type position for functions and methods. return true; ~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'D'. +!!! error TS2322: Type 'true' is not assignable to type 'D'. ~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/typeGuardFunctionGenerics.types b/tests/baselines/reference/typeGuardFunctionGenerics.types index c4655e71f0cb5..9d0fb25f2e87a 100644 --- a/tests/baselines/reference/typeGuardFunctionGenerics.types +++ b/tests/baselines/reference/typeGuardFunctionGenerics.types @@ -134,5 +134,5 @@ let test3: B = funE(isB, 1); >funE(isB, 1) : B >funE : (p1: (p1: any) => p1 is T, p2: U) => T >isB : (p1: any) => p1 is B ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/typeGuardNesting.types b/tests/baselines/reference/typeGuardNesting.types index 2417dbe797c41..29f6cba10db59 100644 --- a/tests/baselines/reference/typeGuardNesting.types +++ b/tests/baselines/reference/typeGuardNesting.types @@ -26,7 +26,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >strOrBool : string | boolean >'string' : "string" >strOrBool : string ->"string" : string +>"string" : "string" let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; >bool : boolean @@ -48,7 +48,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >strOrBool : string | boolean >'boolean' : "boolean" >strOrBool : string ->"string" : string +>"string" : "string" let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; >bool2 : boolean @@ -86,7 +86,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >strOrBool : string | boolean >'string' : "string" >strOrBool : string ->"string" : string +>"string" : "string" let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; >bool : boolean @@ -108,7 +108,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >strOrBool : string | boolean >'boolean' : "boolean" >strOrBool : string ->"string" : string +>"string" : "string" let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; >bool2 : boolean diff --git a/tests/baselines/reference/typeGuardOfFormFunctionEquality.types b/tests/baselines/reference/typeGuardOfFormFunctionEquality.types index 55f2e2aac0ee6..b47dfa94c8cbb 100644 --- a/tests/baselines/reference/typeGuardOfFormFunctionEquality.types +++ b/tests/baselines/reference/typeGuardOfFormFunctionEquality.types @@ -15,13 +15,13 @@ declare function isString2(a: Object): a is string; switch (isString1(0, "")) { >isString1(0, "") : boolean >isString1 : (a: number, b: Object) => b is string ->0 : number ->"" : string +>0 : 0 +>"" : "" case isString2(""): >isString2("") : boolean >isString2 : (a: Object) => a is string ->"" : string +>"" : "" default: } @@ -31,11 +31,11 @@ var x = isString1(0, "") === isString2(""); >isString1(0, "") === isString2("") : boolean >isString1(0, "") : boolean >isString1 : (a: number, b: Object) => b is string ->0 : number ->"" : string +>0 : 0 +>"" : "" >isString2("") : boolean >isString2 : (a: Object) => a is string ->"" : string +>"" : "" function isString3(a: number, b: number, c: Object): c is string { >isString3 : (a: number, b: number, c: Object) => c is string @@ -48,7 +48,7 @@ function isString3(a: number, b: number, c: Object): c is string { return isString1(0, c); >isString1(0, c) : boolean >isString1 : (a: number, b: Object) => b is string ->0 : number +>0 : 0 >c : Object } diff --git a/tests/baselines/reference/typeGuardsAsAssertions.types b/tests/baselines/reference/typeGuardsAsAssertions.types index 661ce9fbc55b1..bdda2eafefd9d 100644 --- a/tests/baselines/reference/typeGuardsAsAssertions.types +++ b/tests/baselines/reference/typeGuardsAsAssertions.types @@ -27,7 +27,7 @@ export const none : None = { none: '' }; >None : None >{ none: '' } : { none: string; } >none : string ->'' : string +>'' : "" export function isSome(value: Optional): value is Some { >isSome : (value: Optional) => value is Some @@ -41,7 +41,7 @@ export function isSome(value: Optional): value is Some { return 'some' in value; >'some' in value : boolean ->'some' : string +>'some' : "some" >value : Optional } @@ -102,7 +102,7 @@ function foo1() { let x: string | number | boolean = 0; >x : string | number | boolean ->0 : number +>0 : 0 x; // number >x : number @@ -125,7 +125,7 @@ function foo1() { >x.slice : (start?: number | undefined, end?: number | undefined) => string >x : string >slice : (start?: number | undefined, end?: number | undefined) => string ->"abc" : string +>"abc" : "abc" x; // string >x : string @@ -139,7 +139,7 @@ function foo2() { let x: string | number | boolean = 0; >x : string | number | boolean ->0 : number +>0 : 0 x; // number >x : number @@ -166,9 +166,9 @@ function foo2() { } else { x = "abc"; ->x = "abc" : string +>x = "abc" : "abc" >x : string | number | boolean ->"abc" : string +>"abc" : "abc" } x; // string >x : string @@ -306,9 +306,9 @@ function f6() { >slice : (start?: number | undefined, end?: number | undefined) => string x = ""; ->x = "" : string +>x = "" : "" >x : string | null | undefined ->"" : string +>"" : "" x!.slice(); >x!.slice() : string @@ -359,7 +359,7 @@ function f6() { >x = "" : string | undefined >x : string | null | undefined >"" : string | undefined ->"" : string +>"" : "" x!.slice(); >x!.slice() : string @@ -373,7 +373,7 @@ function f6() { >x : string | null | undefined >"" : string | null >null : null ->"" : string +>"" : "" x!.slice(); >x!.slice() : string diff --git a/tests/baselines/reference/typeGuardsInConditionalExpression.types b/tests/baselines/reference/typeGuardsInConditionalExpression.types index 8d5da1329e643..165eecd3514f3 100644 --- a/tests/baselines/reference/typeGuardsInConditionalExpression.types +++ b/tests/baselines/reference/typeGuardsInConditionalExpression.types @@ -40,10 +40,10 @@ function foo2(x: number | string) { ? ((x = "hello") && x) // string >((x = "hello") && x) : string >(x = "hello") && x : string ->(x = "hello") : string ->x = "hello" : string +>(x = "hello") : "hello" +>x = "hello" : "hello" >x : string | number ->"hello" : string +>"hello" : "hello" >x : string : x; // number @@ -63,10 +63,10 @@ function foo3(x: number | string) { ? ((x = 10) && x) // number >((x = 10) && x) : number >(x = 10) && x : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number ->10 : number +>10 : 10 >x : number : x; // number @@ -89,10 +89,10 @@ function foo4(x: number | string) { : ((x = 10) && x); // number >((x = 10) && x) : number >(x = 10) && x : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number ->10 : number +>10 : 10 >x : number } function foo5(x: number | string) { @@ -112,10 +112,10 @@ function foo5(x: number | string) { : ((x = "hello") && x); // string >((x = "hello") && x) : string >(x = "hello") && x : string ->(x = "hello") : string ->x = "hello" : string +>(x = "hello") : "hello" +>x = "hello" : "hello" >x : string | number ->"hello" : string +>"hello" : "hello" >x : string } function foo6(x: number | string) { @@ -133,19 +133,19 @@ function foo6(x: number | string) { ? ((x = 10) && x) // number >((x = 10) && x) : number >(x = 10) && x : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number ->10 : number +>10 : 10 >x : number : ((x = "hello") && x); // string >((x = "hello") && x) : string >(x = "hello") && x : string ->(x = "hello") : string ->x = "hello" : string +>(x = "hello") : "hello" +>x = "hello" : "hello" >x : string | number ->"hello" : string +>"hello" : "hello" >x : string } function foo7(x: number | string | boolean) { @@ -228,7 +228,7 @@ function foo9(x: number | string) { var y = 10; >y : number ->10 : number +>10 : 10 // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop return typeof x === "string" @@ -316,7 +316,7 @@ function foo11(x: number | string | boolean) { : ((b = x) // x is number | boolean >((b = x) // x is number | boolean && typeof x === "number" && (x = 10) // assignment to x && x) : number >(b = x) // x is number | boolean && typeof x === "number" && (x = 10) // assignment to x && x : number ->(b = x) // x is number | boolean && typeof x === "number" && (x = 10) : number +>(b = x) // x is number | boolean && typeof x === "number" && (x = 10) : 0 | 10 >(b = x) // x is number | boolean && typeof x === "number" : boolean >(b = x) : number | boolean >b = x : number | boolean @@ -330,10 +330,10 @@ function foo11(x: number | string | boolean) { >"number" : "number" && (x = 10) // assignment to x ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number | boolean ->10 : number +>10 : 10 && x); // x is number >x : number @@ -356,10 +356,10 @@ function foo12(x: number | string | boolean) { ? ((x = 10) && x.toString().length) // number >((x = 10) && x.toString().length) : number >(x = 10) && x.toString().length : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number | boolean ->10 : number +>10 : 10 >x.toString().length : number >x.toString() : string >x.toString : (radix?: number) => string diff --git a/tests/baselines/reference/typeGuardsInDoStatement.types b/tests/baselines/reference/typeGuardsInDoStatement.types index bc1e56bb1e416..fe14cff375fc2 100644 --- a/tests/baselines/reference/typeGuardsInDoStatement.types +++ b/tests/baselines/reference/typeGuardsInDoStatement.types @@ -64,9 +64,9 @@ function c(x: string | number) { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" do { x; // string diff --git a/tests/baselines/reference/typeGuardsInIfStatement.errors.txt b/tests/baselines/reference/typeGuardsInIfStatement.errors.txt index cd9ae40932ac9..ac8dfb07887e9 100644 --- a/tests/baselines/reference/typeGuardsInIfStatement.errors.txt +++ b/tests/baselines/reference/typeGuardsInIfStatement.errors.txt @@ -1,10 +1,7 @@ -tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(22,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(31,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(49,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(139,17): error TS2339: Property 'toString' does not exist on type 'never'. -==== tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts (4 errors) ==== +==== tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts (1 errors) ==== // In the true branch statement of an 'if' statement, // the type of a variable or parameter is narrowed by any type guard in the 'if' condition when true. // In the false branch statement of an 'if' statement, @@ -27,8 +24,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(139,17 } } function foo3(x: number | string) { - ~~~~ -!!! error TS2354: No best common type exists among return expressions. if (typeof x === "string") { x = "Hello"; return x; // string @@ -38,8 +33,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(139,17 } } function foo4(x: number | string) { - ~~~~ -!!! error TS2354: No best common type exists among return expressions. if (typeof x === "string") { return x; // string } @@ -58,8 +51,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(139,17 } } function foo6(x: number | string) { - ~~~~ -!!! error TS2354: No best common type exists among return expressions. if (typeof x === "string") { x = 10; return x; // number diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types index 9d22f63e7647a..54c1d0270b5b9 100644 --- a/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types +++ b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types @@ -30,10 +30,10 @@ function foo2(x: number | string) { >"string" : "string" >((x = 10) && x) : number >(x = 10) && x : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number ->10 : number +>10 : 10 >x : number } function foo3(x: number | string) { @@ -49,10 +49,10 @@ function foo3(x: number | string) { >"string" : "string" >((x = "hello") && x) : string >(x = "hello") && x : string ->(x = "hello") : string ->x = "hello" : string +>(x = "hello") : "hello" +>x = "hello" : "hello" >x : string | number ->"hello" : string +>"hello" : "hello" >x : string } function foo4(x: number | string | boolean) { @@ -174,10 +174,10 @@ function foo7(x: number | string | boolean) { ? ((x = 10) && x.toString()) // x is number >((x = 10) && x.toString()) : string >(x = 10) && x.toString() : string ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number | boolean ->10 : number +>10 : 10 >x.toString() : string >x.toString : (radix?: number) => string >x : number diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types index 0cb70c8c2d6d0..e8548ab1ef6b8 100644 --- a/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types +++ b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types @@ -31,10 +31,10 @@ function foo2(x: number | string) { >"string" : "string" >((x = 10) || x) : number >(x = 10) || x : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number ->10 : number +>10 : 10 >x : number } function foo3(x: number | string) { @@ -50,10 +50,10 @@ function foo3(x: number | string) { >"string" : "string" >((x = "hello") || x) : string >(x = "hello") || x : string ->(x = "hello") : string ->x = "hello" : string +>(x = "hello") : "hello" +>x = "hello" : "hello" >x : string | number ->"hello" : string +>"hello" : "hello" >x : string } function foo4(x: number | string | boolean) { @@ -175,10 +175,10 @@ function foo7(x: number | string | boolean) { ? ((x = 10) && x.toString()) // number | boolean | string >((x = 10) && x.toString()) : string >(x = 10) && x.toString() : string ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number | boolean ->10 : number +>10 : 10 >x.toString() : string >x.toString : (radix?: number) => string >x : number diff --git a/tests/baselines/reference/typeGuardsNestedAssignments.types b/tests/baselines/reference/typeGuardsNestedAssignments.types index 3b125d4f32c1b..32ac85e270b34 100644 --- a/tests/baselines/reference/typeGuardsNestedAssignments.types +++ b/tests/baselines/reference/typeGuardsNestedAssignments.types @@ -136,7 +136,7 @@ while ((match = re.exec("xxx")) != null) { >re.exec : (string: string) => RegExpExecArray | null >re : RegExp >exec : (string: string) => RegExpExecArray | null ->"xxx" : string +>"xxx" : "xxx" >null : null const length = match[1].length + match[2].length @@ -145,11 +145,11 @@ while ((match = re.exec("xxx")) != null) { >match[1].length : number >match[1] : string >match : RegExpExecArray ->1 : number +>1 : 1 >length : number >match[2].length : number >match[2] : string >match : RegExpExecArray ->2 : number +>2 : 2 >length : number } diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.types b/tests/baselines/reference/typeGuardsOnClassProperty.types index afff0afb03ff5..1b663ef209ff1 100644 --- a/tests/baselines/reference/typeGuardsOnClassProperty.types +++ b/tests/baselines/reference/typeGuardsOnClassProperty.types @@ -30,7 +30,7 @@ class D { >data.join : (separator?: string) => string >data : string[] >join : (separator?: string) => string ->" " : string +>" " : " " } getData1() { @@ -53,7 +53,7 @@ class D { >this : this >data : string[] >join : (separator?: string) => string ->" " : string +>" " : " " } } @@ -71,10 +71,10 @@ var o: { prop1: "string" , >prop1 : string ->"string" : string +>"string" : "string" prop2: true ->prop2 : true +>prop2 : boolean >true : true } diff --git a/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt index b67f73288560f..9c20377e7a6f9 100644 --- a/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt +++ b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(12,10): error TS2339: Property 'bar' does not exist on type 'A'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(18,10): error TS2339: Property 'bar' does not exist on type 'A'. -tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(33,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(33,5): error TS2322: Type '"str"' is not assignable to type 'number'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(34,10): error TS2339: Property 'bar' does not exist on type 'B'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(41,10): error TS2339: Property 'bar' does not exist on type 'B'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(66,10): error TS2339: Property 'bar2' does not exist on type 'C1'. @@ -59,7 +59,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru obj3.foo = 1; obj3.foo = "str"; ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"str"' is not assignable to type 'number'. obj3.bar = "str"; ~~~ !!! error TS2339: Property 'bar' does not exist on type 'B'. diff --git a/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt b/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt index f275e44503a18..d20b7ae4edef4 100644 --- a/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt +++ b/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeInferenceConflictingCandidates.ts(3,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '3'. ==== tests/cases/compiler/typeInferenceConflictingCandidates.ts (1 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/typeInferenceConflictingCandidates.ts(3,1): error TS2453: T g("", 3, a => a); ~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '3'. \ No newline at end of file diff --git a/tests/baselines/reference/typeInferenceFBoundedTypeParams.types b/tests/baselines/reference/typeInferenceFBoundedTypeParams.types index 0ce04aabddff6..a6d0a51dd45db 100644 --- a/tests/baselines/reference/typeInferenceFBoundedTypeParams.types +++ b/tests/baselines/reference/typeInferenceFBoundedTypeParams.types @@ -61,9 +61,9 @@ fold( [1, 2, 3], >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 [] as [string, string][], >[] as [string, string][] : [string, string][] @@ -81,8 +81,8 @@ fold( ["", ""] >["", ""] : [string, string] ->"" : string ->"" : string +>"" : "" +>"" : "" ) ); diff --git a/tests/baselines/reference/typeInferenceFixEarly.types b/tests/baselines/reference/typeInferenceFixEarly.types index 5c727ca32261c..2eacc53be610e 100644 --- a/tests/baselines/reference/typeInferenceFixEarly.types +++ b/tests/baselines/reference/typeInferenceFixEarly.types @@ -13,5 +13,5 @@ f(n => 3); >f : (p: (t: T) => T) => T >n => 3 : (n: {}) => number >n : {} ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/typeInferenceWithTupleType.types b/tests/baselines/reference/typeInferenceWithTupleType.types index a45e72518e844..a7f8bff679815 100644 --- a/tests/baselines/reference/typeInferenceWithTupleType.types +++ b/tests/baselines/reference/typeInferenceWithTupleType.types @@ -20,20 +20,20 @@ var combineResult = combine("string", 10); >combineResult : [string, number] >combine("string", 10) : [string, number] >combine : (x: T, y: U) => [T, U] ->"string" : string ->10 : number +>"string" : "string" +>10 : 10 var combineEle1 = combineResult[0]; // string >combineEle1 : string >combineResult[0] : string >combineResult : [string, number] ->0 : number +>0 : 0 var combineEle2 = combineResult[1]; // number >combineEle2 : number >combineResult[1] : number >combineResult : [string, number] ->1 : number +>1 : 1 function zip(array1: T[], array2: U[]): [[T, U]] { >zip : (array1: T[], array2: U[]) => [[T, U]] @@ -74,7 +74,7 @@ function zip(array1: T[], array2: U[]): [[T, U]] { for (var i = 0; i < length; ++i) { >i : number ->0 : number +>0 : 0 >i < length : boolean >i : number >length : number @@ -103,24 +103,24 @@ var zipResult = zip(["foo", "bar"], [5, 6]); >zip(["foo", "bar"], [5, 6]) : [[string, number]] >zip : (array1: T[], array2: U[]) => [[T, U]] >["foo", "bar"] : string[] ->"foo" : string ->"bar" : string +>"foo" : "foo" +>"bar" : "bar" >[5, 6] : number[] ->5 : number ->6 : number +>5 : 5 +>6 : 6 var zipResultEle = zipResult[0]; // [string, number] >zipResultEle : [string, number] >zipResult[0] : [string, number] >zipResult : [[string, number]] ->0 : number +>0 : 0 var zipResultEleEle = zipResult[0][0]; // string >zipResultEleEle : string >zipResult[0][0] : string >zipResult[0] : [string, number] >zipResult : [[string, number]] ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/typeName1.errors.txt b/tests/baselines/reference/typeName1.errors.txt index 152a5b951e7bc..3e99a18552f00 100644 --- a/tests/baselines/reference/typeName1.errors.txt +++ b/tests/baselines/reference/typeName1.errors.txt @@ -1,19 +1,19 @@ -tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. -tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. -tests/cases/compiler/typeName1.ts(11,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. -tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. -tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. -tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. -tests/cases/compiler/typeName1.ts(15,5): error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. -tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. +tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type '3' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. +tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type '3' is not assignable to type '{ f(s: string): number; }'. +tests/cases/compiler/typeName1.ts(11,5): error TS2322: Type '3' is not assignable to type '{ (s: string): number; (n: number): string; }'. +tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type '3' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type '3' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type '3' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. +tests/cases/compiler/typeName1.ts(15,5): error TS2322: Type '3' is not assignable to type '(s: string) => boolean'. +tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type '3' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. tests/cases/compiler/typeName1.ts(16,10): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. -tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type 'number' is not assignable to type 'I'. -tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type 'number' is not assignable to type 'I[][][][]'. -tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. -tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. +tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type '3' is not assignable to type 'I'. +tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type '3' is not assignable to type 'I[][][][]'. +tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type '3' is not assignable to type '{ z: I; x: boolean; }[][]'. +tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type '3' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. tests/cases/compiler/typeName1.ts(20,50): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. -tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. -tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. +tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type '3' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. +tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type '3' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not assignable to type 'number'. @@ -28,50 +28,50 @@ tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not as var x1:{ f(s:string):number;f(n:number):string; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. +!!! error TS2322: Type '3' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. var x2:{ f(s:string):number; } =3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. +!!! error TS2322: Type '3' is not assignable to type '{ f(s: string): number; }'. var x3:{ (s:string):number;(n:number):string; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. +!!! error TS2322: Type '3' is not assignable to type '{ (s: string): number; (n: number): string; }'. var x4:{ x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +!!! error TS2322: Type '3' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. var x5:{ (s:string):number;(n:number):string;x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +!!! error TS2322: Type '3' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. var x6:{ z:number;f:{(n:number):string;(s:string):number;}; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. +!!! error TS2322: Type '3' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. var x7:(s:string)=>boolean=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. +!!! error TS2322: Type '3' is not assignable to type '(s: string) => boolean'. var x8:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. +!!! error TS2322: Type '3' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x9:I=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type 'I'. +!!! error TS2322: Type '3' is not assignable to type 'I'. var x10:I[][][][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type 'I[][][][]'. +!!! error TS2322: Type '3' is not assignable to type 'I[][][][]'. var x11:{z:I;x:boolean;}[][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. +!!! error TS2322: Type '3' is not assignable to type '{ z: I; x: boolean; }[][]'. var x12:{z:I;x:boolean;y:(s:string)=>boolean;w:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; };}[][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. +!!! error TS2322: Type '3' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x13:{ new(): number; new(n:number):number; x: string; w: {y: number;}; (): {}; } = 3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. +!!! error TS2322: Type '3' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. var x14:{ f(x:number):boolean; p; q; ():string; }=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. +!!! error TS2322: Type '3' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. var x15:number=C; ~~~ !!! error TS2322: Type 'typeof C' is not assignable to type 'number'. diff --git a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt index d7410ec04cb50..89849d3a614a8 100644 --- a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt +++ b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt @@ -1,7 +1,9 @@ +tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. +tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,70): error TS2375: Duplicate number index signature. -==== tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts (1 errors) ==== +==== tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts (3 errors) ==== enum E { a } @@ -10,7 +12,11 @@ tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,70): error TS2375: Dup } var x = E; var x: { readonly a: E; readonly b: E; readonly [x: number]: string; }; // Shouldnt error + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. var y = E; var y: { readonly a: E; readonly b: E; readonly [x: number]: string; readonly [x: number]: string } // two errors: the types are not identical and duplicate signatures + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2375: Duplicate number index signature. \ No newline at end of file diff --git a/tests/baselines/reference/typeOfOnTypeArg.errors.txt b/tests/baselines/reference/typeOfOnTypeArg.errors.txt index 46b48983f218a..58412a5417f05 100644 --- a/tests/baselines/reference/typeOfOnTypeArg.errors.txt +++ b/tests/baselines/reference/typeOfOnTypeArg.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeOfOnTypeArg.ts(7,6): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ '': number; }'. +tests/cases/compiler/typeOfOnTypeArg.ts(7,6): error TS2345: Argument of type '32' is not assignable to parameter of type '{ '': number; }'. ==== tests/cases/compiler/typeOfOnTypeArg.ts (1 errors) ==== @@ -10,5 +10,5 @@ tests/cases/compiler/typeOfOnTypeArg.ts(7,6): error TS2345: Argument of type 'nu fill(32); ~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type '{ '': number; }'. +!!! error TS2345: Argument of type '32' is not assignable to parameter of type '{ '': number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/typeOfPrototype.types b/tests/baselines/reference/typeOfPrototype.types index 904667870809b..0660b4cd00c8f 100644 --- a/tests/baselines/reference/typeOfPrototype.types +++ b/tests/baselines/reference/typeOfPrototype.types @@ -4,11 +4,11 @@ class Foo { bar = 3; >bar : number ->3 : number +>3 : 3 static bar = ''; >bar : string ->'' : string +>'' : "" } Foo.prototype.bar = undefined; // Should be OK >Foo.prototype.bar = undefined : undefined diff --git a/tests/baselines/reference/typeOfThisInStaticMembers.types b/tests/baselines/reference/typeOfThisInStaticMembers.types index 72caa4a95a99d..55e92bd791c9d 100644 --- a/tests/baselines/reference/typeOfThisInStaticMembers.types +++ b/tests/baselines/reference/typeOfThisInStaticMembers.types @@ -35,7 +35,7 @@ var r2 = t.foo + 1; >t.foo : number >t : typeof C >foo : number ->1 : number +>1 : 1 var r3 = t.bar(); >r3 : typeof C @@ -48,7 +48,7 @@ var r4 = new t(1); >r4 : C >new t(1) : C >t : typeof C ->1 : number +>1 : 1 class C2 { >C2 : C2 @@ -90,7 +90,7 @@ var r5 = t2.foo + 1; >t2.foo : string >t2 : typeof C2 >foo : string ->1 : number +>1 : 1 var r6 = t2.bar(); >r6 : typeof C2 @@ -103,6 +103,6 @@ var r7 = new t2(''); >r7 : C2<{}> >new t2('') : C2<{}> >t2 : typeof C2 ->'' : string +>'' : "" diff --git a/tests/baselines/reference/typeParameterAndArgumentOfSameName1.types b/tests/baselines/reference/typeParameterAndArgumentOfSameName1.types index 8e476732ded79..a8b962752834b 100644 --- a/tests/baselines/reference/typeParameterAndArgumentOfSameName1.types +++ b/tests/baselines/reference/typeParameterAndArgumentOfSameName1.types @@ -13,7 +13,7 @@ function f(A: A): A { >A.toExponential : (fractionDigits?: number) => string >A : A >toExponential : (fractionDigits?: number) => string ->123 : number +>123 : 123 return null; >null : null diff --git a/tests/baselines/reference/typeParameterAsElementType.types b/tests/baselines/reference/typeParameterAsElementType.types index 10e6787ae31ee..b4c3b4f3ec0c7 100644 --- a/tests/baselines/reference/typeParameterAsElementType.types +++ b/tests/baselines/reference/typeParameterAsElementType.types @@ -11,5 +11,5 @@ function fee() { >arr : (string | T)[] >[t, ""] : (string | T)[] >t : T ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types index c5f15f1ba5596..885b655b74952 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types @@ -16,17 +16,17 @@ function foo(x: T, y: U): U { return y; } var r = foo(1, 2); >r : number ->foo(1, 2) : number +>foo(1, 2) : 2 >foo : (x: T, y: U) => U ->1 : number ->2 : number +>1 : 1 +>2 : 2 var r = foo({}, 1); >r : number ->foo({}, 1) : number +>foo({}, 1) : 1 >foo : (x: T, y: U) => U >{} : {} ->1 : number +>1 : 1 interface A { >A : A @@ -62,12 +62,12 @@ var r3 = foo({ x: 1 }, { x: 2, y: 3 }); >foo : (x: T, y: U) => U >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 >{ x: 2, y: 3 } : { x: number; y: number; } >x : number ->2 : number +>2 : 2 >y : number ->3 : number +>3 : 3 function foo2(x: T, y: U) { return y; } >foo2 : (x: T, y: U) => U @@ -82,10 +82,10 @@ function foo2(x: T, y: U) { return y; } >y : U foo2(1, ''); ->foo2(1, '') : string +>foo2(1, '') : "" >foo2 : (x: T, y: U) => U ->1 : number ->'' : string +>1 : 1 +>'' : "" foo2({}, { length: 2 }); >foo2({}, { length: 2 }) : { length: number; } @@ -93,28 +93,28 @@ foo2({}, { length: 2 }); >{} : {} >{ length: 2 } : { length: number; } >length : number ->2 : number +>2 : 2 foo2(1, { width: 3, length: 2 }); >foo2(1, { width: 3, length: 2 }) : { width: number; length: number; } >foo2 : (x: T, y: U) => U ->1 : number +>1 : 1 >{ width: 3, length: 2 } : { width: number; length: number; } >width : number ->3 : number +>3 : 3 >length : number ->2 : number +>2 : 2 foo2(1, []); >foo2(1, []) : any[] >foo2 : (x: T, y: U) => U ->1 : number +>1 : 1 >[] : undefined[] foo2(1, ['']); >foo2(1, ['']) : string[] >foo2 : (x: T, y: U) => U ->1 : number +>1 : 1 >[''] : string[] ->'' : string +>'' : "" diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt index 0e148cb568942..08706d095b237 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(6,8): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(6,8): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(7,8): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(13,17): error TS2345: Argument of type 'NumberVariant' is not assignable to parameter of type 'number'. tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(16,9): error TS2345: Argument of type '{ length: string; }' is not assignable to parameter of type '{ length: number; }'. @@ -20,7 +20,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTy foo(1, ''); ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. foo(1, {}); ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types index 680e86f5c85d2..8e5f04507bbdf 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types @@ -45,29 +45,29 @@ function foo(x: T, y: U, z: V): V { return z; } //function foo(x: T, y: U, z: V): V { return z; } foo(1, 2, 3); ->foo(1, 2, 3) : number +>foo(1, 2, 3) : 3 >foo : (x: T, y: U, z: V) => V ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: '', z: true }); >foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: '', z: true }) : { x: number; y: string; z: boolean; } >foo : (x: T, y: U, z: V) => V >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 >{ x: 1, y: '' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'' : string +>'' : "" >{ x: 2, y: '', z: true } : { x: number; y: string; z: true; } >x : number ->2 : number +>2 : 2 >y : string ->'' : string ->z : true +>'' : "" +>z : boolean >true : true foo(a, b, c); @@ -84,10 +84,10 @@ foo(a, b, { foo: 1, bar: '', hm: true }); >b : B >{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: true; } >foo : number ->1 : number +>1 : 1 >bar : string ->'' : string ->hm : true +>'' : "" +>hm : boolean >true : true foo((x: number, y) => { }, (x) => { }, () => { }); @@ -137,9 +137,9 @@ foo(b, b, { foo: 1, bar: '', hm: '' }); >b : B >{ foo: 1, bar: '', hm: '' } : { foo: number; bar: string; hm: string; } >foo : number ->1 : number +>1 : 1 >bar : string ->'' : string +>'' : "" >hm : string ->'' : string +>'' : "" diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types index 145bf081b18f3..80e800cb1e052 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types @@ -45,29 +45,29 @@ function foo(x: T, y: U, z: V): V { return z; } //function foo(x: T, y: U, z: V): V { return z; } foo(1, 2, ''); ->foo(1, 2, '') : string +>foo(1, 2, '') : "" >foo : (x: T, y: U, z: V) => V ->1 : number ->2 : number ->'' : string +>1 : 1 +>2 : 2 +>'' : "" foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: 2, z: true }); >foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: 2, z: true }) : { x: number; y: number; z: boolean; } >foo : (x: T, y: U, z: V) => V >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 >{ x: 1, y: '' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'' : string +>'' : "" >{ x: 2, y: 2, z: true } : { x: number; y: number; z: true; } >x : number ->2 : number +>2 : 2 >y : number ->2 : number ->z : true +>2 : 2 +>z : boolean >true : true foo(a, b, a); @@ -83,10 +83,10 @@ foo(a, { foo: 1, bar: '', hm: true }, b); >a : A >{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: true; } >foo : number ->1 : number +>1 : 1 >bar : string ->'' : string ->hm : true +>'' : "" +>hm : boolean >true : true >b : B diff --git a/tests/baselines/reference/typeReferenceDirectives7.types b/tests/baselines/reference/typeReferenceDirectives7.types index dab53a49899f4..8ef960dd4a90e 100644 --- a/tests/baselines/reference/typeReferenceDirectives7.types +++ b/tests/baselines/reference/typeReferenceDirectives7.types @@ -3,7 +3,7 @@ export let $ = 1; >$ : number ->1 : number +>1 : 1 export let x: typeof $; >x : number diff --git a/tests/baselines/reference/typeReferenceDirectives8.types b/tests/baselines/reference/typeReferenceDirectives8.types index 93d80b7988af4..54ed0efd6e009 100644 --- a/tests/baselines/reference/typeReferenceDirectives8.types +++ b/tests/baselines/reference/typeReferenceDirectives8.types @@ -22,5 +22,5 @@ export function foo(): Lib { return {x: 1} } >Lib : Lib >{x: 1} : { x: number; } >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/typeVal.types b/tests/baselines/reference/typeVal.types index d9768a9fbf728..26944f231b23a 100644 --- a/tests/baselines/reference/typeVal.types +++ b/tests/baselines/reference/typeVal.types @@ -11,13 +11,13 @@ var I:I = { I: 3}; >I : I >{ I: 3} : { I: number; } >I : number ->3 : number +>3 : 3 I.I=4; ->I.I=4 : number +>I.I=4 : 4 >I.I : number >I : I >I : number ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/typedArrays.types b/tests/baselines/reference/typedArrays.types index f7d3cbdd19f0e..444d6a74e4303 100644 --- a/tests/baselines/reference/typedArrays.types +++ b/tests/baselines/reference/typedArrays.types @@ -11,63 +11,63 @@ function CreateTypedArrayTypes() { >typedArrays[0] = Int8Array : Int8ArrayConstructor >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array : Int8ArrayConstructor typedArrays[1] = Uint8Array; >typedArrays[1] = Uint8Array : Uint8ArrayConstructor >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array : Uint8ArrayConstructor typedArrays[2] = Int16Array; >typedArrays[2] = Int16Array : Int16ArrayConstructor >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array : Int16ArrayConstructor typedArrays[3] = Uint16Array; >typedArrays[3] = Uint16Array : Uint16ArrayConstructor >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array : Uint16ArrayConstructor typedArrays[4] = Int32Array; >typedArrays[4] = Int32Array : Int32ArrayConstructor >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array : Int32ArrayConstructor typedArrays[5] = Uint32Array; >typedArrays[5] = Uint32Array : Uint32ArrayConstructor >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array : Uint32ArrayConstructor typedArrays[6] = Float32Array; >typedArrays[6] = Float32Array : Float32ArrayConstructor >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array : Float32ArrayConstructor typedArrays[7] = Float64Array; >typedArrays[7] = Float64Array : Float64ArrayConstructor >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array : Float64ArrayConstructor typedArrays[8] = Uint8ClampedArray; >typedArrays[8] = Uint8ClampedArray : Uint8ClampedArrayConstructor >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray : Uint8ClampedArrayConstructor return typedArrays; @@ -86,7 +86,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[0] = new Int8Array(obj) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >new Int8Array(obj) : Int8Array >Int8Array : Int8ArrayConstructor >obj : number @@ -95,7 +95,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[1] = new Uint8Array(obj) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >new Uint8Array(obj) : Uint8Array >Uint8Array : Uint8ArrayConstructor >obj : number @@ -104,7 +104,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[2] = new Int16Array(obj) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >new Int16Array(obj) : Int16Array >Int16Array : Int16ArrayConstructor >obj : number @@ -113,7 +113,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[3] = new Uint16Array(obj) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >new Uint16Array(obj) : Uint16Array >Uint16Array : Uint16ArrayConstructor >obj : number @@ -122,7 +122,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[4] = new Int32Array(obj) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >new Int32Array(obj) : Int32Array >Int32Array : Int32ArrayConstructor >obj : number @@ -131,7 +131,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[5] = new Uint32Array(obj) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >new Uint32Array(obj) : Uint32Array >Uint32Array : Uint32ArrayConstructor >obj : number @@ -140,7 +140,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[6] = new Float32Array(obj) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >new Float32Array(obj) : Float32Array >Float32Array : Float32ArrayConstructor >obj : number @@ -149,7 +149,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[7] = new Float64Array(obj) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >new Float64Array(obj) : Float64Array >Float64Array : Float64ArrayConstructor >obj : number @@ -158,7 +158,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[8] = new Uint8ClampedArray(obj) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >new Uint8ClampedArray(obj) : Uint8ClampedArray >Uint8ClampedArray : Uint8ClampedArrayConstructor >obj : number @@ -179,7 +179,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[0] = new Int8Array(obj) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >new Int8Array(obj) : Int8Array >Int8Array : Int8ArrayConstructor >obj : number[] @@ -188,7 +188,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[1] = new Uint8Array(obj) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >new Uint8Array(obj) : Uint8Array >Uint8Array : Uint8ArrayConstructor >obj : number[] @@ -197,7 +197,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[2] = new Int16Array(obj) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >new Int16Array(obj) : Int16Array >Int16Array : Int16ArrayConstructor >obj : number[] @@ -206,7 +206,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[3] = new Uint16Array(obj) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >new Uint16Array(obj) : Uint16Array >Uint16Array : Uint16ArrayConstructor >obj : number[] @@ -215,7 +215,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[4] = new Int32Array(obj) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >new Int32Array(obj) : Int32Array >Int32Array : Int32ArrayConstructor >obj : number[] @@ -224,7 +224,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[5] = new Uint32Array(obj) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >new Uint32Array(obj) : Uint32Array >Uint32Array : Uint32ArrayConstructor >obj : number[] @@ -233,7 +233,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[6] = new Float32Array(obj) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >new Float32Array(obj) : Float32Array >Float32Array : Float32ArrayConstructor >obj : number[] @@ -242,7 +242,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[7] = new Float64Array(obj) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >new Float64Array(obj) : Float64Array >Float64Array : Float64ArrayConstructor >obj : number[] @@ -251,7 +251,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[8] = new Uint8ClampedArray(obj) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >new Uint8ClampedArray(obj) : Uint8ClampedArray >Uint8ClampedArray : Uint8ClampedArrayConstructor >obj : number[] @@ -272,7 +272,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[0] = Int8Array.from(obj) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.from(obj) : Int8Array >Int8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor @@ -283,7 +283,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[1] = Uint8Array.from(obj) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.from(obj) : Uint8Array >Uint8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor @@ -294,7 +294,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[2] = Int16Array.from(obj) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.from(obj) : Int16Array >Int16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor @@ -305,7 +305,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[3] = Uint16Array.from(obj) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.from(obj) : Uint16Array >Uint16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor @@ -316,7 +316,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[4] = Int32Array.from(obj) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.from(obj) : Int32Array >Int32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor @@ -327,7 +327,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[5] = Uint32Array.from(obj) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.from(obj) : Uint32Array >Uint32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor @@ -338,7 +338,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[6] = Float32Array.from(obj) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.from(obj) : Float32Array >Float32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor @@ -349,7 +349,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[7] = Float64Array.from(obj) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.from(obj) : Float64Array >Float64Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor @@ -360,7 +360,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[8] = Uint8ClampedArray.from(obj) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.from(obj) : Uint8ClampedArray >Uint8ClampedArray.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor @@ -384,7 +384,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[0] = Int8Array.from(obj) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.from(obj) : Int8Array >Int8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor @@ -395,7 +395,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[1] = Uint8Array.from(obj) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.from(obj) : Uint8Array >Uint8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor @@ -406,7 +406,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[2] = Int16Array.from(obj) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.from(obj) : Int16Array >Int16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor @@ -417,7 +417,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[3] = Uint16Array.from(obj) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.from(obj) : Uint16Array >Uint16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor @@ -428,7 +428,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[4] = Int32Array.from(obj) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.from(obj) : Int32Array >Int32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor @@ -439,7 +439,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[5] = Uint32Array.from(obj) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.from(obj) : Uint32Array >Uint32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor @@ -450,7 +450,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[6] = Float32Array.from(obj) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.from(obj) : Float32Array >Float32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor @@ -461,7 +461,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[7] = Float64Array.from(obj) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.from(obj) : Float64Array >Float64Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor @@ -472,7 +472,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[8] = Uint8ClampedArray.from(obj) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.from(obj) : Uint8ClampedArray >Uint8ClampedArray.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor @@ -495,7 +495,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[0] = Int8Array.of(...obj) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.of(...obj) : Int8Array >Int8Array.of : (...items: number[]) => Int8Array >Int8Array : Int8ArrayConstructor @@ -507,7 +507,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[1] = Uint8Array.of(...obj) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.of(...obj) : Uint8Array >Uint8Array.of : (...items: number[]) => Uint8Array >Uint8Array : Uint8ArrayConstructor @@ -519,7 +519,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[2] = Int16Array.of(...obj) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.of(...obj) : Int16Array >Int16Array.of : (...items: number[]) => Int16Array >Int16Array : Int16ArrayConstructor @@ -531,7 +531,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[3] = Uint16Array.of(...obj) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.of(...obj) : Uint16Array >Uint16Array.of : (...items: number[]) => Uint16Array >Uint16Array : Uint16ArrayConstructor @@ -543,7 +543,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[4] = Int32Array.of(...obj) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.of(...obj) : Int32Array >Int32Array.of : (...items: number[]) => Int32Array >Int32Array : Int32ArrayConstructor @@ -555,7 +555,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[5] = Uint32Array.of(...obj) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.of(...obj) : Uint32Array >Uint32Array.of : (...items: number[]) => Uint32Array >Uint32Array : Uint32ArrayConstructor @@ -567,7 +567,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[6] = Float32Array.of(...obj) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.of(...obj) : Float32Array >Float32Array.of : (...items: number[]) => Float32Array >Float32Array : Float32ArrayConstructor @@ -579,7 +579,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[7] = Float64Array.of(...obj) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.of(...obj) : Float64Array >Float64Array.of : (...items: number[]) => Float64Array >Float64Array : Float64ArrayConstructor @@ -591,7 +591,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[8] = Uint8ClampedArray.of(...obj) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.of(...obj) : Uint8ClampedArray >Uint8ClampedArray.of : (...items: number[]) => Uint8ClampedArray >Uint8ClampedArray : Uint8ClampedArrayConstructor @@ -614,127 +614,127 @@ function CreateTypedArraysOf2() { >typedArrays[0] = Int8Array.of(1,2,3,4) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.of(1,2,3,4) : Int8Array >Int8Array.of : (...items: number[]) => Int8Array >Int8Array : Int8ArrayConstructor >of : (...items: number[]) => Int8Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[1] = Uint8Array.of(1,2,3,4); >typedArrays[1] = Uint8Array.of(1,2,3,4) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.of(1,2,3,4) : Uint8Array >Uint8Array.of : (...items: number[]) => Uint8Array >Uint8Array : Uint8ArrayConstructor >of : (...items: number[]) => Uint8Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[2] = Int16Array.of(1,2,3,4); >typedArrays[2] = Int16Array.of(1,2,3,4) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.of(1,2,3,4) : Int16Array >Int16Array.of : (...items: number[]) => Int16Array >Int16Array : Int16ArrayConstructor >of : (...items: number[]) => Int16Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[3] = Uint16Array.of(1,2,3,4); >typedArrays[3] = Uint16Array.of(1,2,3,4) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.of(1,2,3,4) : Uint16Array >Uint16Array.of : (...items: number[]) => Uint16Array >Uint16Array : Uint16ArrayConstructor >of : (...items: number[]) => Uint16Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[4] = Int32Array.of(1,2,3,4); >typedArrays[4] = Int32Array.of(1,2,3,4) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.of(1,2,3,4) : Int32Array >Int32Array.of : (...items: number[]) => Int32Array >Int32Array : Int32ArrayConstructor >of : (...items: number[]) => Int32Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[5] = Uint32Array.of(1,2,3,4); >typedArrays[5] = Uint32Array.of(1,2,3,4) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.of(1,2,3,4) : Uint32Array >Uint32Array.of : (...items: number[]) => Uint32Array >Uint32Array : Uint32ArrayConstructor >of : (...items: number[]) => Uint32Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[6] = Float32Array.of(1,2,3,4); >typedArrays[6] = Float32Array.of(1,2,3,4) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.of(1,2,3,4) : Float32Array >Float32Array.of : (...items: number[]) => Float32Array >Float32Array : Float32ArrayConstructor >of : (...items: number[]) => Float32Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[7] = Float64Array.of(1,2,3,4); >typedArrays[7] = Float64Array.of(1,2,3,4) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.of(1,2,3,4) : Float64Array >Float64Array.of : (...items: number[]) => Float64Array >Float64Array : Float64ArrayConstructor >of : (...items: number[]) => Float64Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[8] = Uint8ClampedArray.of(1,2,3,4); >typedArrays[8] = Uint8ClampedArray.of(1,2,3,4) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.of(1,2,3,4) : Uint8ClampedArray >Uint8ClampedArray.of : (...items: number[]) => Uint8ClampedArray >Uint8ClampedArray : Uint8ClampedArrayConstructor >of : (...items: number[]) => Uint8ClampedArray ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 return typedArrays; >typedArrays : any[] @@ -756,7 +756,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[0] = Int8Array.from(obj, mapFn) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.from(obj, mapFn) : Int8Array >Int8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor @@ -768,7 +768,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[1] = Uint8Array.from(obj, mapFn) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.from(obj, mapFn) : Uint8Array >Uint8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor @@ -780,7 +780,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[2] = Int16Array.from(obj, mapFn) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.from(obj, mapFn) : Int16Array >Int16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor @@ -792,7 +792,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[3] = Uint16Array.from(obj, mapFn) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.from(obj, mapFn) : Uint16Array >Uint16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor @@ -804,7 +804,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[4] = Int32Array.from(obj, mapFn) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.from(obj, mapFn) : Int32Array >Int32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor @@ -816,7 +816,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[5] = Uint32Array.from(obj, mapFn) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.from(obj, mapFn) : Uint32Array >Uint32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor @@ -828,7 +828,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[6] = Float32Array.from(obj, mapFn) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.from(obj, mapFn) : Float32Array >Float32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor @@ -840,7 +840,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[7] = Float64Array.from(obj, mapFn) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.from(obj, mapFn) : Float64Array >Float64Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor @@ -852,7 +852,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[8] = Uint8ClampedArray.from(obj, mapFn) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.from(obj, mapFn) : Uint8ClampedArray >Uint8ClampedArray.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor @@ -881,7 +881,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[0] = Int8Array.from(obj, mapFn, thisArg) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.from(obj, mapFn, thisArg) : Int8Array >Int8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor @@ -894,7 +894,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[1] = Uint8Array.from(obj, mapFn, thisArg) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.from(obj, mapFn, thisArg) : Uint8Array >Uint8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor @@ -907,7 +907,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[2] = Int16Array.from(obj, mapFn, thisArg) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.from(obj, mapFn, thisArg) : Int16Array >Int16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor @@ -920,7 +920,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[3] = Uint16Array.from(obj, mapFn, thisArg) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.from(obj, mapFn, thisArg) : Uint16Array >Uint16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor @@ -933,7 +933,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[4] = Int32Array.from(obj, mapFn, thisArg) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.from(obj, mapFn, thisArg) : Int32Array >Int32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor @@ -946,7 +946,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[5] = Uint32Array.from(obj, mapFn, thisArg) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.from(obj, mapFn, thisArg) : Uint32Array >Uint32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor @@ -959,7 +959,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[6] = Float32Array.from(obj, mapFn, thisArg) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.from(obj, mapFn, thisArg) : Float32Array >Float32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor @@ -972,7 +972,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[7] = Float64Array.from(obj, mapFn, thisArg) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.from(obj, mapFn, thisArg) : Float64Array >Float64Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor @@ -985,7 +985,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[8] = Uint8ClampedArray.from(obj, mapFn, thisArg) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.from(obj, mapFn, thisArg) : Uint8ClampedArray >Uint8ClampedArray.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor diff --git a/tests/baselines/reference/typedGenericPrototypeMember.types b/tests/baselines/reference/typedGenericPrototypeMember.types index 9e3f064de0dcd..b772c3be680c6 100644 --- a/tests/baselines/reference/typedGenericPrototypeMember.types +++ b/tests/baselines/reference/typedGenericPrototypeMember.types @@ -16,5 +16,5 @@ List.prototype.add("abc"); // Valid because T is instantiated to any >List : typeof List >prototype : List >add : (item: any) => void ->"abc" : string +>"abc" : "abc" diff --git a/tests/baselines/reference/typeofEnum.types b/tests/baselines/reference/typeofEnum.types index 2140bfa175b22..9026e664c1443 100644 --- a/tests/baselines/reference/typeofEnum.types +++ b/tests/baselines/reference/typeofEnum.types @@ -3,10 +3,10 @@ enum E { >E : E e1, ->e1 : E +>e1 : E.e1 e2 ->e2 : E +>e2 : E.e2 } var e1: typeof E; @@ -14,7 +14,7 @@ var e1: typeof E; >E : typeof E e1.e1; ->e1.e1 : E +>e1.e1 : E.e1 >e1 : typeof E ->e1 : E +>e1 : E.e1 diff --git a/tests/baselines/reference/typeofInterface.types b/tests/baselines/reference/typeofInterface.types index 70e3cfe69266e..fad9b02900444 100644 --- a/tests/baselines/reference/typeofInterface.types +++ b/tests/baselines/reference/typeofInterface.types @@ -25,5 +25,5 @@ var j: typeof k.foo = { a: "hello" }; >foo : { a: string; } >{ a: "hello" } : { a: string; } >a : string ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/typeofModuleWithoutExports.types b/tests/baselines/reference/typeofModuleWithoutExports.types index e0f29156c5378..764a6c1df33b6 100644 --- a/tests/baselines/reference/typeofModuleWithoutExports.types +++ b/tests/baselines/reference/typeofModuleWithoutExports.types @@ -4,7 +4,7 @@ module M { var x = 1; >x : number ->1 : number +>1 : 1 class C { >C : C diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.types b/tests/baselines/reference/typeofOperatorWithBooleanType.types index edf3c4e08712a..a1a01c3f61ff0 100644 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.types +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.types @@ -16,7 +16,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -40,16 +40,16 @@ var ResultIsString1 = typeof BOOLEAN; var ResultIsString2 = typeof true; >ResultIsString2 : string >typeof true : string ->true : boolean +>true : true var ResultIsString3 = typeof { x: true, y: false }; >ResultIsString3 : string >typeof { x: true, y: false } : string >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsString4 = typeof objA.a; @@ -90,7 +90,7 @@ var ResultIsString8 = typeof typeof BOOLEAN; // miss assignment operators typeof true; >typeof true : string ->true : boolean +>true : true typeof BOOLEAN; >typeof BOOLEAN : string @@ -102,10 +102,10 @@ typeof foo(); >foo : () => boolean typeof true, false; ->typeof true, false : boolean +>typeof true, false : false >typeof true : string ->true : boolean ->false : boolean +>true : true +>false : false typeof objA.a; >typeof objA.a : string @@ -143,9 +143,9 @@ var y = { a: true, b: false}; >y : { a: boolean; b: boolean; } >{ a: true, b: false} : { a: boolean; b: boolean; } >a : boolean ->true : boolean +>true : true >b : boolean ->false : boolean +>false : false z: typeof y.a; >z : any diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.types b/tests/baselines/reference/typeofOperatorWithEnumType.types index f9224811393c5..ec147bce88967 100644 --- a/tests/baselines/reference/typeofOperatorWithEnumType.types +++ b/tests/baselines/reference/typeofOperatorWithEnumType.types @@ -7,8 +7,8 @@ enum ENUM { }; enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 +>A : ENUM1.A +>B : ENUM1.B // enum type var var ResultIsString1 = typeof ENUM; @@ -25,9 +25,9 @@ var ResultIsString2 = typeof ENUM1; var ResultIsString3 = typeof ENUM1["A"]; >ResultIsString3 : string >typeof ENUM1["A"] : string ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string +>"A" : "A" var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); >ResultIsString4 : string @@ -36,10 +36,10 @@ var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM ->0 : number ->ENUM1["B"] : ENUM1 +>0 : 0 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" // multiple typeof operators var ResultIsString5 = typeof typeof ENUM; @@ -57,10 +57,10 @@ var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); >ENUM[0] + ENUM1.B : string >ENUM[0] : string >ENUM : typeof ENUM ->0 : number ->ENUM1.B : ENUM1 +>0 : 0 +>ENUM1.B : ENUM1.B >ENUM1 : typeof ENUM1 ->B : ENUM1 +>B : ENUM1.B // miss assignment operators typeof ENUM; @@ -73,9 +73,9 @@ typeof ENUM1; typeof ENUM1["B"]; >typeof ENUM1["B"] : string ->ENUM1["B"] : ENUM1 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" typeof ENUM, ENUM1; >typeof ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.types b/tests/baselines/reference/typeofOperatorWithNumberType.types index b80e6b1d4a8f4..d497257d636d2 100644 --- a/tests/baselines/reference/typeofOperatorWithNumberType.types +++ b/tests/baselines/reference/typeofOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsString2 = typeof NUMBER1; var ResultIsString3 = typeof 1; >ResultIsString3 : string >typeof 1 : string ->1 : number +>1 : 1 var ResultIsString4 = typeof { x: 1, y: 2}; >ResultIsString4 : string >typeof { x: 1, y: 2} : string >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } }; >ResultIsString5 : string >typeof { x: 1, y: (n: number) => { return n; } } : string >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsString8 = typeof NUMBER1[0]; >typeof NUMBER1[0] : string >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsString9 = typeof foo(); >ResultIsString9 : string @@ -136,7 +136,7 @@ var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER); // miss assignment operators typeof 1; >typeof 1 : string ->1 : number +>1 : 1 typeof NUMBER; >typeof NUMBER : string @@ -199,9 +199,9 @@ var y = { a: 1, b: 2 }; >y : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 z: typeof y.a; >z : any diff --git a/tests/baselines/reference/typesWithOptionalProperty.types b/tests/baselines/reference/typesWithOptionalProperty.types index 89879740732ca..e69b875a83134 100644 --- a/tests/baselines/reference/typesWithOptionalProperty.types +++ b/tests/baselines/reference/typesWithOptionalProperty.types @@ -32,26 +32,26 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" var c = { foo: '', bar: 3 }; >c : { foo: string; bar: number; } >{ foo: '', bar: 3 } : { foo: string; bar: number; } >foo : string ->'' : string +>'' : "" >bar : number ->3 : number +>3 : 3 var d = { foo: '', bar: 3, baz: () => '' }; >d : { foo: string; bar: number; baz: () => string; } >{ foo: '', bar: 3, baz: () => '' } : { foo: string; bar: number; baz: () => string; } >foo : string ->'' : string +>'' : "" >bar : number ->3 : number +>3 : 3 >baz : () => string >() => '' : () => string ->'' : string +>'' : "" var i: I; >i : I diff --git a/tests/baselines/reference/typesWithSpecializedCallSignatures.types b/tests/baselines/reference/typesWithSpecializedCallSignatures.types index b587ee7840e27..b2ce825199f24 100644 --- a/tests/baselines/reference/typesWithSpecializedCallSignatures.types +++ b/tests/baselines/reference/typesWithSpecializedCallSignatures.types @@ -143,5 +143,5 @@ var r3: Base = c.foo('hm'); >c.foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } >c : C >foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } ->'hm' : string +>'hm' : "hm" diff --git a/tests/baselines/reference/typesWithSpecializedConstructSignatures.types b/tests/baselines/reference/typesWithSpecializedConstructSignatures.types index 3036c0cea714d..3829cd5ce217f 100644 --- a/tests/baselines/reference/typesWithSpecializedConstructSignatures.types +++ b/tests/baselines/reference/typesWithSpecializedConstructSignatures.types @@ -38,7 +38,7 @@ var c = new C('a'); >c : C >new C('a') : C >C : typeof C ->'a' : string +>'a' : "a" interface I { >I : I @@ -114,5 +114,5 @@ var r3: Base = new a('hm'); >Base : Base >new a('hm') : Base >a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; } ->'hm' : string +>'hm' : "hm" diff --git a/tests/baselines/reference/typingsLookup4.types b/tests/baselines/reference/typingsLookup4.types index d922c7b1dfa53..e3f747ac55d6c 100644 --- a/tests/baselines/reference/typingsLookup4.types +++ b/tests/baselines/reference/typingsLookup4.types @@ -6,14 +6,14 @@ import { k } from "kquery"; >k : number import { l } from "lquery"; ->l : number +>l : 2 j + k + l; >j + k + l : number >j + k : number >j : number >k : number ->l : number +>l : 2 === /node_modules/@types/jquery/jquery.d.ts === export const j: number; @@ -25,6 +25,6 @@ export const k: number; === /node_modules/@types/lquery/lquery.ts === export const l = 2; ->l : number ->2 : number +>l : 2 +>2 : 2 diff --git a/tests/baselines/reference/umd-augmentation-1.types b/tests/baselines/reference/umd-augmentation-1.types index 59b577141e055..8f759912256b4 100644 --- a/tests/baselines/reference/umd-augmentation-1.types +++ b/tests/baselines/reference/umd-augmentation-1.types @@ -9,8 +9,8 @@ let v = new m.Vector(3, 2); >m.Vector : typeof m.Vector >m : typeof m >Vector : typeof m.Vector ->3 : number ->2 : number +>3 : 3 +>2 : 2 let magnitude = m.getLength(v); >magnitude : number @@ -28,8 +28,8 @@ let p: m.Point = v.translate(5, 5); >v.translate : (dx: number, dy: number) => m.Vector >v : m.Vector >translate : (dx: number, dy: number) => m.Vector ->5 : number ->5 : number +>5 : 5 +>5 : 5 p = v.reverse(); >p = v.reverse() : m.Point diff --git a/tests/baselines/reference/umd-augmentation-2.types b/tests/baselines/reference/umd-augmentation-2.types index 24fe6df3c3cc5..98d1d52ba4d9a 100644 --- a/tests/baselines/reference/umd-augmentation-2.types +++ b/tests/baselines/reference/umd-augmentation-2.types @@ -7,8 +7,8 @@ let v = new Math2d.Vector(3, 2); >Math2d.Vector : typeof Math2d.Vector >Math2d : typeof Math2d >Vector : typeof Math2d.Vector ->3 : number ->2 : number +>3 : 3 +>2 : 2 let magnitude = Math2d.getLength(v); >magnitude : number @@ -26,8 +26,8 @@ let p: Math2d.Point = v.translate(5, 5); >v.translate : (dx: number, dy: number) => Vector >v : Vector >translate : (dx: number, dy: number) => Vector ->5 : number ->5 : number +>5 : 5 +>5 : 5 p = v.reverse(); >p = v.reverse() : Math2d.Point diff --git a/tests/baselines/reference/umd-augmentation-3.types b/tests/baselines/reference/umd-augmentation-3.types index 39bc28cbd2451..c62107cc40f79 100644 --- a/tests/baselines/reference/umd-augmentation-3.types +++ b/tests/baselines/reference/umd-augmentation-3.types @@ -9,8 +9,8 @@ let v = new m.Vector(3, 2); >m.Vector : typeof m.Vector >m : typeof m >Vector : typeof m.Vector ->3 : number ->2 : number +>3 : 3 +>2 : 2 let magnitude = m.getLength(v); >magnitude : number @@ -28,8 +28,8 @@ let p: m.Point = v.translate(5, 5); >v.translate : (dx: number, dy: number) => m.Vector >v : m.Vector >translate : (dx: number, dy: number) => m.Vector ->5 : number ->5 : number +>5 : 5 +>5 : 5 p = v.reverse(); >p = v.reverse() : m.Point diff --git a/tests/baselines/reference/umd-augmentation-4.types b/tests/baselines/reference/umd-augmentation-4.types index 246270aa5a60f..e1283c74a7c27 100644 --- a/tests/baselines/reference/umd-augmentation-4.types +++ b/tests/baselines/reference/umd-augmentation-4.types @@ -7,8 +7,8 @@ let v = new Math2d.Vector(3, 2); >Math2d.Vector : typeof Math2d.Vector >Math2d : typeof Math2d >Vector : typeof Math2d.Vector ->3 : number ->2 : number +>3 : 3 +>2 : 2 let magnitude = Math2d.getLength(v); >magnitude : number @@ -26,8 +26,8 @@ let p: Math2d.Point = v.translate(5, 5); >v.translate : (dx: number, dy: number) => Math2d.Vector >v : Math2d.Vector >translate : (dx: number, dy: number) => Math2d.Vector ->5 : number ->5 : number +>5 : 5 +>5 : 5 p = v.reverse(); >p = v.reverse() : Math2d.Point diff --git a/tests/baselines/reference/unaryPlus.types b/tests/baselines/reference/unaryPlus.types index fc7a038ac72ce..8f92b51a1592e 100644 --- a/tests/baselines/reference/unaryPlus.types +++ b/tests/baselines/reference/unaryPlus.types @@ -3,40 +3,40 @@ var a = +1; >a : number >+1 : number ->1 : number +>1 : 1 var b = +(""); >b : number >+("") : number >("") : any >"" : any ->"" : string +>"" : "" enum E { some, thing }; >E : E ->some : E ->thing : E +>some : E.some +>thing : E.thing var c = +E.some; >c : number >+E.some : number ->E.some : E +>E.some : E.some >E : typeof E ->some : E +>some : E.some // also allowed, used to be errors var x = +"3"; //should be valid >x : number >+"3" : number ->"3" : string +>"3" : "3" var y = -"3"; // should be valid >y : number >-"3" : number ->"3" : string +>"3" : "3" var z = ~"3"; // should be valid >z : number >~"3" : number ->"3" : string +>"3" : "3" diff --git a/tests/baselines/reference/uncaughtCompilerError1.types b/tests/baselines/reference/uncaughtCompilerError1.types index 83503195f713e..d69a52334b3b5 100644 --- a/tests/baselines/reference/uncaughtCompilerError1.types +++ b/tests/baselines/reference/uncaughtCompilerError1.types @@ -22,7 +22,7 @@ function f() { >'=' : "=" >index > 0 : boolean >index : any ->0 : number +>0 : 0 >token.type === '' : boolean >token.type : any >token : any @@ -34,7 +34,7 @@ function f() { >tokens : any >index - 1 : number >index : any ->1 : number +>1 : 1 >type : any >'attribute.name.html' : "attribute.name.html" @@ -46,14 +46,14 @@ function f() { >tokens.length : any >tokens : any >length : any ->1 : number +>1 : 1 return { appendText: '\"\"', advanceCount: 1 }; >{ appendText: '\"\"', advanceCount: 1 } : { appendText: string; advanceCount: number; } >appendText : string ->'\"\"' : string +>'\"\"' : "\"\"" >advanceCount : number ->1 : number +>1 : 1 } else if (tokens[index + 1].type !== 'attribute.value.html' && tokens[index + 1].type !== '') { >tokens[index + 1].type !== 'attribute.value.html' && tokens[index + 1].type !== '' : boolean @@ -63,7 +63,7 @@ function f() { >tokens : any >index + 1 : any >index : any ->1 : number +>1 : 1 >type : any >'attribute.value.html' : "attribute.value.html" >tokens[index + 1].type !== '' : boolean @@ -72,16 +72,16 @@ function f() { >tokens : any >index + 1 : any >index : any ->1 : number +>1 : 1 >type : any >'' : "" return { appendText: '\"\"', advanceCount: 1 }; >{ appendText: '\"\"', advanceCount: 1 } : { appendText: string; advanceCount: number; } >appendText : string ->'\"\"' : string +>'\"\"' : "\"\"" >advanceCount : number ->1 : number +>1 : 1 } return null; >null : null diff --git a/tests/baselines/reference/undefinedInferentialTyping.types b/tests/baselines/reference/undefinedInferentialTyping.types index 525181f0f4cb2..49ebbb53716e1 100644 --- a/tests/baselines/reference/undefinedInferentialTyping.types +++ b/tests/baselines/reference/undefinedInferentialTyping.types @@ -14,8 +14,8 @@ function f(arr: T[], elemnt: T): T { var a = f([], 3); // should be number >a : number ->f([], 3) : number +>f([], 3) : 3 >f : (arr: T[], elemnt: T) => T >[] : undefined[] ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.types b/tests/baselines/reference/undefinedIsSubtypeOfEverything.types index d89f032bf29c2..c52b7b6211461 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.types +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.types @@ -171,7 +171,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } class D12 extends Base { >D12 : D12 @@ -192,7 +192,7 @@ module c { export var bar = 1; >bar : number ->1 : number +>1 : 1 } class D13 extends Base { >D13 : D13 diff --git a/tests/baselines/reference/underscoreMapFirst.types b/tests/baselines/reference/underscoreMapFirst.types index 60cbcccda2bd4..4de1389113765 100644 --- a/tests/baselines/reference/underscoreMapFirst.types +++ b/tests/baselines/reference/underscoreMapFirst.types @@ -127,7 +127,7 @@ class MyView extends View { >this : this >model : any >get : any ->"data" : string +>"data" : "data" var allSeries: ISeries[][] = _.pluck(data, "series"); >allSeries : ISeries[][] @@ -137,7 +137,7 @@ class MyView extends View { >_ : typeof _ >pluck : (list: _.Collection, propertyName: string) => any[] >data : IData[] ->"series" : string +>"series" : "series" return _.map(allSeries, _.first); >_.map(allSeries, _.first) : ISeries[] diff --git a/tests/baselines/reference/underscoreTest1.types b/tests/baselines/reference/underscoreTest1.types index ac794e1f2f97c..d4898d43beda4 100644 --- a/tests/baselines/reference/underscoreTest1.types +++ b/tests/baselines/reference/underscoreTest1.types @@ -14,9 +14,9 @@ _.each([1, 2, 3], (num) => alert(num.toString())); >_ : Underscore.Static >each : { (list: T[], iterator: Iterator, context?: any): void; (list: Dictionary, iterator: Iterator, context?: any): void; } >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >(num) => alert(num.toString()) : (num: number) => void >num : number >alert(num.toString()) : void @@ -33,11 +33,11 @@ _.each({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => alert(valu >each : { (list: T[], iterator: Iterator, context?: any): void; (list: Dictionary, iterator: Iterator, context?: any): void; } >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 >(value: number, key?: string) => alert(value.toString()) : (value: number, key?: string) => void >value : number >key : string @@ -54,14 +54,14 @@ _.map([1, 2, 3], (num) => num * 3); >_ : Underscore.Static >map : { (list: T[], iterator: Iterator, context?: any): U[]; (list: Dictionary, iterator: Iterator, context?: any): U[]; } >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >(num) => num * 3 : (num: number) => number >num : number >num * 3 : number >num : number ->3 : number +>3 : 3 _.map({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => value * 3); >_.map({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => value * 3) : number[] @@ -70,17 +70,17 @@ _.map({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => value * 3); >map : { (list: T[], iterator: Iterator, context?: any): U[]; (list: Dictionary, iterator: Iterator, context?: any): U[]; } >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 >(value: number, key?: string) => value * 3 : (value: number, key?: string) => number >value : number >key : string >value * 3 : number >value : number ->3 : number +>3 : 3 var sum = _.reduce([1, 2, 3], (memo, num) => memo + num, 0); >sum : number @@ -89,29 +89,29 @@ var sum = _.reduce([1, 2, 3], (memo, num) => memo + num, 0); >_ : Underscore.Static >reduce : { (list: T[], iterator: Reducer, initialValue?: T, context?: any): T; (list: T[], iterator: Reducer, initialValue: U, context?: any): U; (list: Dictionary, iterator: Reducer, initialValue?: T, context?: any): T; (list: Dictionary, iterator: Reducer, initialValue: U, context?: any): U; } >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >(memo, num) => memo + num : (memo: number, num: number) => number >memo : number >num : number >memo + num : number >memo : number >num : number ->0 : number +>0 : 0 var list = [[0, 1], [2, 3], [4, 5]]; >list : number[][] >[[0, 1], [2, 3], [4, 5]] : number[][] >[0, 1] : number[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 >[2, 3] : number[] ->2 : number ->3 : number +>2 : 2 +>3 : 3 >[4, 5] : number[] ->4 : number ->5 : number +>4 : 4 +>5 : 5 var flat = _.reduceRight(list, (a, b) => a.concat(b), []); >flat : number[] @@ -137,18 +137,18 @@ var even = _.find([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >_ : Underscore.Static >find : { (list: T[], iterator: Iterator, context?: any): T; (list: Dictionary, iterator: Iterator, context?: any): T; } >[1, 2, 3, 4, 5, 6] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->6 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 >(num) => num % 2 == 0 : (num: number) => boolean >num : number >num % 2 == 0 : boolean >num % 2 : number >num : number ->2 : number +>2 : 2 >0 : 0 var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); @@ -158,18 +158,18 @@ var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >_ : Underscore.Static >filter : { (list: T[], iterator: Iterator, context?: any): T[]; (list: Dictionary, iterator: Iterator, context?: any): T[]; } >[1, 2, 3, 4, 5, 6] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->6 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 >(num) => num % 2 == 0 : (num: number) => boolean >num : number >num % 2 == 0 : boolean >num % 2 : number >num : number ->2 : number +>2 : 2 >0 : 0 var listOfPlays = [{ title: "Cymbeline", author: "Shakespeare", year: 1611 }, { title: "The Tempest", author: "Shakespeare", year: 1611 }, { title: "Other", author: "Not Shakespeare", year: 2012 }]; @@ -177,25 +177,25 @@ var listOfPlays = [{ title: "Cymbeline", author: "Shakespeare", year: 1611 }, { >[{ title: "Cymbeline", author: "Shakespeare", year: 1611 }, { title: "The Tempest", author: "Shakespeare", year: 1611 }, { title: "Other", author: "Not Shakespeare", year: 2012 }] : { title: string; author: string; year: number; }[] >{ title: "Cymbeline", author: "Shakespeare", year: 1611 } : { title: string; author: string; year: number; } >title : string ->"Cymbeline" : string +>"Cymbeline" : "Cymbeline" >author : string ->"Shakespeare" : string +>"Shakespeare" : "Shakespeare" >year : number ->1611 : number +>1611 : 1611 >{ title: "The Tempest", author: "Shakespeare", year: 1611 } : { title: string; author: string; year: number; } >title : string ->"The Tempest" : string +>"The Tempest" : "The Tempest" >author : string ->"Shakespeare" : string +>"Shakespeare" : "Shakespeare" >year : number ->1611 : number +>1611 : 1611 >{ title: "Other", author: "Not Shakespeare", year: 2012 } : { title: string; author: string; year: number; } >title : string ->"Other" : string +>"Other" : "Other" >author : string ->"Not Shakespeare" : string +>"Not Shakespeare" : "Not Shakespeare" >year : number ->2012 : number +>2012 : 2012 _.where(listOfPlays, { author: "Shakespeare", year: 1611 }); >_.where(listOfPlays, { author: "Shakespeare", year: 1611 }) : { title: string; author: string; year: number; }[] @@ -205,9 +205,9 @@ _.where(listOfPlays, { author: "Shakespeare", year: 1611 }); >listOfPlays : { title: string; author: string; year: number; }[] >{ author: "Shakespeare", year: 1611 } : { author: string; year: number; } >author : string ->"Shakespeare" : string +>"Shakespeare" : "Shakespeare" >year : number ->1611 : number +>1611 : 1611 var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >odds : number[] @@ -216,18 +216,18 @@ var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >_ : Underscore.Static >reject : { (list: T[], iterator: Iterator, context?: any): T[]; (list: Dictionary, iterator: Iterator, context?: any): T[]; } >[1, 2, 3, 4, 5, 6] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->6 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 >(num) => num % 2 == 0 : (num: number) => boolean >num : number >num % 2 == 0 : boolean >num % 2 : number >num : number ->2 : number +>2 : 2 >0 : 0 _.all([true, 1, null, 'yes'], _.identity); @@ -235,11 +235,11 @@ _.all([true, 1, null, 'yes'], _.identity); >_.all : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } >_ : Underscore.Static >all : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } ->[true, 1, null, 'yes'] : (string | number | true)[] +>[true, 1, null, 'yes'] : (true | 1 | "yes")[] >true : true ->1 : number +>1 : 1 >null : null ->'yes' : string +>'yes' : "yes" >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -249,10 +249,10 @@ _.any([null, 0, 'yes', false]); >_.any : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } >_ : Underscore.Static >any : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } ->[null, 0, 'yes', false] : (string | number | false)[] +>[null, 0, 'yes', false] : (false | 0 | "yes")[] >null : null ->0 : number ->'yes' : string +>0 : 0 +>'yes' : "yes" >false : false _.contains([1, 2, 3], 3); @@ -261,10 +261,10 @@ _.contains([1, 2, 3], 3); >_ : Underscore.Static >contains : { (list: T[], value: T): boolean; (list: Dictionary, value: T): boolean; } >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 +>3 : 3 _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); >_.invoke([[5, 1, 7], [3, 2, 1]], 'sort') : any[] @@ -273,33 +273,33 @@ _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); >invoke : { (list: any[], methodName: string, ...args: any[]): any[]; (list: Dictionary, methodName: string, ...args: any[]): any[]; } >[[5, 1, 7], [3, 2, 1]] : number[][] >[5, 1, 7] : number[] ->5 : number ->1 : number ->7 : number +>5 : 5 +>1 : 1 +>7 : 7 >[3, 2, 1] : number[] ->3 : number ->2 : number ->1 : number ->'sort' : string +>3 : 3 +>2 : 2 +>1 : 1 +>'sort' : "sort" var stooges = [{ name: 'moe', age: 40 }, { name: 'larry', age: 50 }, { name: 'curly', age: 60 }]; >stooges : { name: string; age: number; }[] >[{ name: 'moe', age: 40 }, { name: 'larry', age: 50 }, { name: 'curly', age: 60 }] : { name: string; age: number; }[] >{ name: 'moe', age: 40 } : { name: string; age: number; } >name : string ->'moe' : string +>'moe' : "moe" >age : number ->40 : number +>40 : 40 >{ name: 'larry', age: 50 } : { name: string; age: number; } >name : string ->'larry' : string +>'larry' : "larry" >age : number ->50 : number +>50 : 50 >{ name: 'curly', age: 60 } : { name: string; age: number; } >name : string ->'curly' : string +>'curly' : "curly" >age : number ->60 : number +>60 : 60 _.pluck(stooges, 'name'); >_.pluck(stooges, 'name') : any[] @@ -307,7 +307,7 @@ _.pluck(stooges, 'name'); >_ : Underscore.Static >pluck : { (list: any[], propertyName: string): any[]; (list: Dictionary, propertyName: string): any[]; } >stooges : { name: string; age: number; }[] ->'name' : string +>'name' : "name" _.max(stooges, (stooge) => stooge.age); >_.max(stooges, (stooge) => stooge.age) : { name: string; age: number; } @@ -324,11 +324,11 @@ _.max(stooges, (stooge) => stooge.age); var numbers = [10, 5, 100, 2, 1000]; >numbers : number[] >[10, 5, 100, 2, 1000] : number[] ->10 : number ->5 : number ->100 : number ->2 : number ->1000 : number +>10 : 10 +>5 : 5 +>100 : 100 +>2 : 2 +>1000 : 1000 _.min(numbers); >_.min(numbers) : number @@ -343,12 +343,12 @@ _.sortBy([1, 2, 3, 4, 5, 6], (num) => Math.sin(num)); >_ : Underscore.Static >sortBy : { (list: T[], iterator: Iterator, context?: any): T[]; (list: Dictionary, iterator: Iterator, context?: any): T[]; (list: T[], propertyName: string): T[]; (list: Dictionary, propertyName: string): T[]; } >[1, 2, 3, 4, 5, 6] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->6 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 >(num) => Math.sin(num) : (num: number) => number >num : number >Math.sin(num) : number @@ -365,9 +365,9 @@ _([1.3, 2.1, 2.4]).groupBy((e: number, i?: number, list?: number[]) => Math.floo >_([1.3, 2.1, 2.4]) : Underscore.WrappedArray >_ : Underscore.Static >[1.3, 2.1, 2.4] : number[] ->1.3 : number ->2.1 : number ->2.4 : number +>1.3 : 1.3 +>2.1 : 2.1 +>2.4 : 2.4 >groupBy : { (iterator?: Iterator, context?: any): Dictionary; (propertyName: string): Dictionary; } >(e: number, i?: number, list?: number[]) => Math.floor(e) : (e: number, i?: number, list?: number[]) => number >e : number @@ -385,9 +385,9 @@ _.groupBy([1.3, 2.1, 2.4], (num: number) => Math.floor(num)); >_ : Underscore.Static >groupBy : { (list: T[], iterator?: Iterator, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } >[1.3, 2.1, 2.4] : number[] ->1.3 : number ->2.1 : number ->2.4 : number +>1.3 : 1.3 +>2.1 : 2.1 +>2.4 : 2.4 >(num: number) => Math.floor(num) : (num: number) => number >num : number >Math.floor(num) : number @@ -402,10 +402,10 @@ _.groupBy(['one', 'two', 'three'], 'length'); >_ : Underscore.Static >groupBy : { (list: T[], iterator?: Iterator, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } >['one', 'two', 'three'] : string[] ->'one' : string ->'two' : string ->'three' : string ->'length' : string +>'one' : "one" +>'two' : "two" +>'three' : "three" +>'length' : "length" _.countBy([1, 2, 3, 4, 5], (num) => num % 2 == 0 ? 'even' : 'odd'); >_.countBy([1, 2, 3, 4, 5], (num) => num % 2 == 0 ? 'even' : 'odd') : Dictionary @@ -413,21 +413,21 @@ _.countBy([1, 2, 3, 4, 5], (num) => num % 2 == 0 ? 'even' : 'odd'); >_ : Underscore.Static >countBy : { (list: T[], iterator?: Iterator, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } >[1, 2, 3, 4, 5] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->(num) => num % 2 == 0 ? 'even' : 'odd' : (num: number) => string +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>(num) => num % 2 == 0 ? 'even' : 'odd' : (num: number) => "even" | "odd" >num : number ->num % 2 == 0 ? 'even' : 'odd' : string +>num % 2 == 0 ? 'even' : 'odd' : "even" | "odd" >num % 2 == 0 : boolean >num % 2 : number >num : number ->2 : number +>2 : 2 >0 : 0 ->'even' : string ->'odd' : string +>'even' : "even" +>'odd' : "odd" _.shuffle([1, 2, 3, 4, 5, 6]); >_.shuffle([1, 2, 3, 4, 5, 6]) : number[] @@ -435,12 +435,12 @@ _.shuffle([1, 2, 3, 4, 5, 6]); >_ : Underscore.Static >shuffle : { (list: T[]): T[]; (list: Dictionary): T[]; } >[1, 2, 3, 4, 5, 6] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->6 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 // (function(){ return _.toArray(arguments).slice(1); })(1, 2, 3, 4); @@ -451,11 +451,11 @@ _.size({ one: 1, two: 2, three: 3 }); >size : { (list: T[]): number; (list: Dictionary): number; } >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 /////////////////////////////////////////////////////////////////////////////////////// @@ -465,11 +465,11 @@ _.first([5, 4, 3, 2, 1]); >_ : Underscore.Static >first : { (list: T[]): T; (list: T[], count: number): T[]; } >[5, 4, 3, 2, 1] : number[] ->5 : number ->4 : number ->3 : number ->2 : number ->1 : number +>5 : 5 +>4 : 4 +>3 : 3 +>2 : 2 +>1 : 1 _.initial([5, 4, 3, 2, 1]); >_.initial([5, 4, 3, 2, 1]) : number @@ -477,11 +477,11 @@ _.initial([5, 4, 3, 2, 1]); >_ : Underscore.Static >initial : { (list: T[]): T; (list: T[], count: number): T[]; } >[5, 4, 3, 2, 1] : number[] ->5 : number ->4 : number ->3 : number ->2 : number ->1 : number +>5 : 5 +>4 : 4 +>3 : 3 +>2 : 2 +>1 : 1 _.last([5, 4, 3, 2, 1]); >_.last([5, 4, 3, 2, 1]) : number @@ -489,11 +489,11 @@ _.last([5, 4, 3, 2, 1]); >_ : Underscore.Static >last : { (list: T[]): T; (list: T[], count: number): T[]; } >[5, 4, 3, 2, 1] : number[] ->5 : number ->4 : number ->3 : number ->2 : number ->1 : number +>5 : 5 +>4 : 4 +>3 : 3 +>2 : 2 +>1 : 1 _.rest([5, 4, 3, 2, 1]); >_.rest([5, 4, 3, 2, 1]) : number[] @@ -501,24 +501,24 @@ _.rest([5, 4, 3, 2, 1]); >_ : Underscore.Static >rest : (list: T[], index?: number) => T[] >[5, 4, 3, 2, 1] : number[] ->5 : number ->4 : number ->3 : number ->2 : number ->1 : number +>5 : 5 +>4 : 4 +>3 : 3 +>2 : 2 +>1 : 1 _.compact([0, 1, false, 2, '', 3]); >_.compact([0, 1, false, 2, '', 3]) : (string | number | boolean)[] >_.compact : (list: T[]) => T[] >_ : Underscore.Static >compact : (list: T[]) => T[] ->[0, 1, false, 2, '', 3] : (string | number | false)[] ->0 : number ->1 : number +>[0, 1, false, 2, '', 3] : (false | "" | 0 | 1 | 2 | 3)[] +>0 : 0 +>1 : 1 >false : false ->2 : number ->'' : string ->3 : number +>2 : 2 +>'' : "" +>3 : 3 _.flatten([1, 2, 3, 4]); >_.flatten([1, 2, 3, 4]) : {}[] @@ -526,10 +526,10 @@ _.flatten([1, 2, 3, 4]); >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >[1, 2, 3, 4] : number[] ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 _.flatten([1, [2]]); >_.flatten([1, [2]]) : {}[] @@ -537,9 +537,9 @@ _.flatten([1, [2]]); >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >[1, [2]] : (number | number[])[] ->1 : number +>1 : 1 >[2] : number[] ->2 : number +>2 : 2 // typescript doesn't like the elements being different _.flatten([1, [2], [3, [[4]]]]); @@ -548,14 +548,14 @@ _.flatten([1, [2], [3, [[4]]]]); >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >[1, [2], [3, [[4]]]] : (number | (number | number[][])[])[] ->1 : number +>1 : 1 >[2] : number[] ->2 : number +>2 : 2 >[3, [[4]]] : (number | number[][])[] ->3 : number +>3 : 3 >[[4]] : number[][] >[4] : number[] ->4 : number +>4 : 4 _.flatten([1, [2], [3, [[4]]]], true); >_.flatten([1, [2], [3, [[4]]]], true) : {}[] @@ -563,14 +563,14 @@ _.flatten([1, [2], [3, [[4]]]], true); >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >[1, [2], [3, [[4]]]] : (number | (number | number[][])[])[] ->1 : number +>1 : 1 >[2] : number[] ->2 : number +>2 : 2 >[3, [[4]]] : (number | number[][])[] ->3 : number +>3 : 3 >[[4]] : number[][] >[4] : number[] ->4 : number +>4 : 4 >true : true _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); @@ -579,15 +579,15 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); >_ : Underscore.Static >without : (list: T[], ...values: T[]) => T[] >[1, 2, 1, 0, 3, 1, 4] : number[] ->1 : number ->2 : number ->1 : number ->0 : number ->3 : number ->1 : number ->4 : number ->0 : number ->1 : number +>1 : 1 +>2 : 2 +>1 : 1 +>0 : 0 +>3 : 3 +>1 : 1 +>4 : 4 +>0 : 0 +>1 : 1 _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); >_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]) : number[] @@ -595,17 +595,17 @@ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); >_ : Underscore.Static >union : (...arrays: T[][]) => T[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >[101, 2, 1, 10] : number[] ->101 : number ->2 : number ->1 : number ->10 : number +>101 : 101 +>2 : 2 +>1 : 1 +>10 : 10 >[2, 1] : number[] ->2 : number ->1 : number +>2 : 2 +>1 : 1 _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); >_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]) : number[] @@ -613,17 +613,17 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); >_ : Underscore.Static >intersection : (...arrays: T[][]) => T[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >[101, 2, 1, 10] : number[] ->101 : number ->2 : number ->1 : number ->10 : number +>101 : 101 +>2 : 2 +>1 : 1 +>10 : 10 >[2, 1] : number[] ->2 : number ->1 : number +>2 : 2 +>1 : 1 _.difference([1, 2, 3, 4, 5], [5, 2, 10]); >_.difference([1, 2, 3, 4, 5], [5, 2, 10]) : number[] @@ -631,15 +631,15 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]); >_ : Underscore.Static >difference : (list: T[], ...others: T[][]) => T[] >[1, 2, 3, 4, 5] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 >[5, 2, 10] : number[] ->5 : number ->2 : number ->10 : number +>5 : 5 +>2 : 2 +>10 : 10 _.uniq([1, 2, 1, 3, 1, 4]); >_.uniq([1, 2, 1, 3, 1, 4]) : number[] @@ -647,12 +647,12 @@ _.uniq([1, 2, 1, 3, 1, 4]); >_ : Underscore.Static >uniq : { (list: T[], isSorted?: boolean): T[]; (list: T[], isSorted: boolean, iterator: Iterator, context?: any): U[]; } >[1, 2, 1, 3, 1, 4] : number[] ->1 : number ->2 : number ->1 : number ->3 : number ->1 : number ->4 : number +>1 : 1 +>2 : 2 +>1 : 1 +>3 : 3 +>1 : 1 +>4 : 4 _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); >_.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]) : Tuple3[] @@ -660,13 +660,13 @@ _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); >_ : Underscore.Static >zip : { (a0: T0[], a1: T1[]): Tuple2[]; (a0: T0[], a1: T1[], a2: T2[]): Tuple3[]; (a0: T0[], a1: T1[], a2: T2[], a3: T3[]): Tuple4[]; (...arrays: any[][]): any[][]; } >['moe', 'larry', 'curly'] : string[] ->'moe' : string ->'larry' : string ->'curly' : string +>'moe' : "moe" +>'larry' : "larry" +>'curly' : "curly" >[30, 40, 50] : number[] ->30 : number ->40 : number ->50 : number +>30 : 30 +>40 : 40 +>50 : 50 >[true, false, false] : boolean[] >true : true >false : false @@ -678,13 +678,13 @@ _.object(['moe', 'larry', 'curly'], [30, 40, 50]); >_ : Underscore.Static >object : { (list: any[][]): any; (keys: string[], values: any[]): any; } >['moe', 'larry', 'curly'] : string[] ->'moe' : string ->'larry' : string ->'curly' : string +>'moe' : "moe" +>'larry' : "larry" +>'curly' : "curly" >[30, 40, 50] : number[] ->30 : number ->40 : number ->50 : number +>30 : 30 +>40 : 40 +>50 : 50 _.object([['moe', 30], ['larry', 40], ['curly', 50]]); >_.object([['moe', 30], ['larry', 40], ['curly', 50]]) : any @@ -693,14 +693,14 @@ _.object([['moe', 30], ['larry', 40], ['curly', 50]]); >object : { (list: any[][]): any; (keys: string[], values: any[]): any; } >[['moe', 30], ['larry', 40], ['curly', 50]] : (string | number)[][] >['moe', 30] : (string | number)[] ->'moe' : string ->30 : number +>'moe' : "moe" +>30 : 30 >['larry', 40] : (string | number)[] ->'larry' : string ->40 : number +>'larry' : "larry" +>40 : 40 >['curly', 50] : (string | number)[] ->'curly' : string ->50 : number +>'curly' : "curly" +>50 : 50 _.indexOf([1, 2, 3], 2); >_.indexOf([1, 2, 3], 2) : number @@ -708,10 +708,10 @@ _.indexOf([1, 2, 3], 2); >_ : Underscore.Static >indexOf : (list: T[], value: T, isSorted?: boolean) => number >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number ->2 : number +>1 : 1 +>2 : 2 +>3 : 3 +>2 : 2 _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); >_.lastIndexOf([1, 2, 3, 1, 2, 3], 2) : number @@ -719,13 +719,13 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); >_ : Underscore.Static >lastIndexOf : (list: T[], value: T, fromIndex?: number) => number >[1, 2, 3, 1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number ->1 : number ->2 : number ->3 : number ->2 : number +>1 : 1 +>2 : 2 +>3 : 3 +>1 : 1 +>2 : 2 +>3 : 3 +>2 : 2 _.sortedIndex([10, 20, 30, 40, 50], 35); >_.sortedIndex([10, 20, 30, 40, 50], 35) : number @@ -733,52 +733,52 @@ _.sortedIndex([10, 20, 30, 40, 50], 35); >_ : Underscore.Static >sortedIndex : { (list: T[], obj: T, propertyName: string): number; (list: T[], obj: T, iterator?: Iterator, context?: any): number; } >[10, 20, 30, 40, 50] : number[] ->10 : number ->20 : number ->30 : number ->40 : number ->50 : number ->35 : number +>10 : 10 +>20 : 20 +>30 : 30 +>40 : 40 +>50 : 50 +>35 : 35 _.range(10); >_.range(10) : number[] >_.range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } >_ : Underscore.Static >range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } ->10 : number +>10 : 10 _.range(1, 11); >_.range(1, 11) : number[] >_.range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } >_ : Underscore.Static >range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } ->1 : number ->11 : number +>1 : 1 +>11 : 11 _.range(0, 30, 5); >_.range(0, 30, 5) : number[] >_.range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } >_ : Underscore.Static >range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } ->0 : number ->30 : number ->5 : number +>0 : 0 +>30 : 30 +>5 : 5 _.range(0, 30, 5); >_.range(0, 30, 5) : number[] >_.range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } >_ : Underscore.Static >range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } ->0 : number ->30 : number ->5 : number +>0 : 0 +>30 : 30 +>5 : 5 _.range(0); >_.range(0) : number[] >_.range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } >_ : Underscore.Static >range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } ->0 : number +>0 : 0 /////////////////////////////////////////////////////////////////////////////////////// @@ -789,7 +789,7 @@ var func = function (greeting) { return greeting + ': ' + this.name }; >greeting + ': ' + this.name : string >greeting + ': ' : string >greeting : any ->': ' : string +>': ' : ": " >this.name : any >this : any >name : any @@ -805,8 +805,8 @@ var func2 = _.bind(func, { name: 'moe' }, 'hi'); >func : (greeting: any) => string >{ name: 'moe' } : { name: string; } >name : string ->'moe' : string ->'hi' : string +>'moe' : "moe" +>'hi' : "hi" func2(); >func2() : any @@ -818,7 +818,7 @@ var buttonView = { label: 'underscore', >label : string ->'underscore' : string +>'underscore' : "underscore" onClick: function () { alert('clicked: ' + this.label); }, >onClick : () => void @@ -826,7 +826,7 @@ var buttonView = { >alert('clicked: ' + this.label) : void >alert : (x: string) => void >'clicked: ' + this.label : string ->'clicked: ' : string +>'clicked: ' : "clicked: " >this.label : any >this : any >label : any @@ -837,7 +837,7 @@ var buttonView = { >alert('hovering: ' + this.label) : void >alert : (x: string) => void >'hovering: ' + this.label : string ->'hovering: ' : string +>'hovering: ' : "hovering: " >this.label : any >this : any >label : any @@ -855,9 +855,9 @@ $('#underscore_button').bind('click', buttonView.onClick); >$('#underscore_button').bind : any >$('#underscore_button') : any >$ : any ->'#underscore_button' : string +>'#underscore_button' : "#underscore_button" >bind : any ->'click' : string +>'click' : "click" >buttonView.onClick : () => void >buttonView : { label: string; onClick: () => void; onHover: () => void; } >onClick : () => void @@ -875,19 +875,19 @@ var fibonacci = _.memoize(function (n) { >n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2) : any >n < 2 : boolean >n : any ->2 : number +>2 : 2 >n : any >fibonacci(n - 1) + fibonacci(n - 2) : any >fibonacci(n - 1) : any >fibonacci : (n: any) => any >n - 1 : number >n : any ->1 : number +>1 : 1 >fibonacci(n - 2) : any >fibonacci : (n: any) => any >n - 2 : number >n : any ->2 : number +>2 : 2 }); @@ -908,8 +908,8 @@ _.delay(log, 1000, 'logged later'); >_ : Underscore.Static >delay : (func: Function, wait: number, ...args: any[]) => number >log : (message?: string, ...rest: string[]) => void ->1000 : number ->'logged later' : string +>1000 : 1000 +>'logged later' : "logged later" _.defer(function () { alert('deferred'); }); >_.defer(function () { alert('deferred'); }) : number @@ -919,14 +919,14 @@ _.defer(function () { alert('deferred'); }); >function () { alert('deferred'); } : () => void >alert('deferred') : void >alert : (x: string) => void ->'deferred' : string +>'deferred' : "deferred" var updatePosition = () => alert('updating position...'); >updatePosition : () => void >() => alert('updating position...') : () => void >alert('updating position...') : void >alert : (x: string) => void ->'updating position...' : string +>'updating position...' : "updating position..." var throttled = _.throttle(updatePosition, 100); >throttled : () => void @@ -935,7 +935,7 @@ var throttled = _.throttle(updatePosition, 100); >_ : Underscore.Static >throttle : (func: T, wait: number) => T >updatePosition : () => void ->100 : number +>100 : 100 $(null).scroll(throttled); >$(null).scroll(throttled) : any @@ -951,7 +951,7 @@ var calculateLayout = () => alert('calculating layout...'); >() => alert('calculating layout...') : () => void >alert('calculating layout...') : void >alert : (x: string) => void ->'calculating layout...' : string +>'calculating layout...' : "calculating layout..." var lazyLayout = _.debounce(calculateLayout, 300); >lazyLayout : () => void @@ -960,7 +960,7 @@ var lazyLayout = _.debounce(calculateLayout, 300); >_ : Underscore.Static >debounce : (func: T, wait: number, immediate?: boolean) => T >calculateLayout : () => void ->300 : number +>300 : 300 $(null).resize(lazyLayout); >$(null).resize(lazyLayout) : any @@ -976,7 +976,7 @@ var createApplication = () => alert('creating application...'); >() => alert('creating application...') : () => void >alert('creating application...') : void >alert : (x: string) => void ->'creating application...' : string +>'creating application...' : "creating application..." var initialize = _.once(createApplication); >initialize : () => void @@ -1002,7 +1002,7 @@ var render = () => alert("rendering..."); >() => alert("rendering...") : () => void >alert("rendering...") : void >alert : (x: string) => void ->"rendering..." : string +>"rendering..." : "rendering..." var renderNotes = _.after(notes.length, render); >renderNotes : () => void @@ -1036,7 +1036,7 @@ var hello = function (name) { return "hello: " + name; }; >function (name) { return "hello: " + name; } : (name: any) => string >name : any >"hello: " + name : string ->"hello: " : string +>"hello: " : "hello: " >name : any hello = _.wrap(hello, (func, arg) => { return "before, " + func(arg) + ", after"; }); @@ -1052,23 +1052,23 @@ hello = _.wrap(hello, (func, arg) => { return "before, " + func(arg) + ", after" >arg : any >"before, " + func(arg) + ", after" : string >"before, " + func(arg) : string ->"before, " : string +>"before, " : "before, " >func(arg) : string >func : (name: any) => string >arg : any ->", after" : string +>", after" : ", after" hello("moe"); >hello("moe") : string >hello : (name: any) => string ->"moe" : string +>"moe" : "moe" var greet = function (name) { return "hi: " + name; }; >greet : (name: any) => string >function (name) { return "hi: " + name; } : (name: any) => string >name : any >"hi: " + name : string ->"hi: " : string +>"hi: " : "hi: " >name : any var exclaim = function (statement) { return statement + "!"; }; @@ -1077,7 +1077,7 @@ var exclaim = function (statement) { return statement + "!"; }; >statement : any >statement + "!" : string >statement : any ->"!" : string +>"!" : "!" var welcome = _.compose(exclaim, greet); >welcome : Function @@ -1091,7 +1091,7 @@ var welcome = _.compose(exclaim, greet); welcome('moe'); >welcome('moe') : any >welcome : Function ->'moe' : string +>'moe' : "moe" /////////////////////////////////////////////////////////////////////////////////////// @@ -1102,11 +1102,11 @@ _.keys({ one: 1, two: 2, three: 3 }); >keys : (object: any) => string[] >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 _.values({ one: 1, two: 2, three: 3 }); >_.values({ one: 1, two: 2, three: 3 }) : any[] @@ -1115,11 +1115,11 @@ _.values({ one: 1, two: 2, three: 3 }); >values : (object: any) => any[] >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 _.pairs({ one: 1, two: 2, three: 3 }); >_.pairs({ one: 1, two: 2, three: 3 }) : any[][] @@ -1128,11 +1128,11 @@ _.pairs({ one: 1, two: 2, three: 3 }); >pairs : (object: any) => any[][] >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 _.invert({ Moe: "Moses", Larry: "Louis", Curly: "Jerome" }); >_.invert({ Moe: "Moses", Larry: "Louis", Curly: "Jerome" }) : any @@ -1141,11 +1141,11 @@ _.invert({ Moe: "Moses", Larry: "Louis", Curly: "Jerome" }); >invert : (object: any) => any >{ Moe: "Moses", Larry: "Louis", Curly: "Jerome" } : { Moe: string; Larry: string; Curly: string; } >Moe : string ->"Moses" : string +>"Moses" : "Moses" >Larry : string ->"Louis" : string +>"Louis" : "Louis" >Curly : string ->"Jerome" : string +>"Jerome" : "Jerome" _.functions(_); >_.functions(_) : string[] @@ -1161,10 +1161,10 @@ _.extend({ name: 'moe' }, { age: 50 }); >extend : (destination: T, ...sources: any[]) => T >{ name: 'moe' } : { name: string; } >name : string ->'moe' : string +>'moe' : "moe" >{ age: 50 } : { age: number; } >age : number ->50 : number +>50 : 50 _.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age'); >_.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age') : { name: string; age: number; userid: string; } @@ -1173,13 +1173,13 @@ _.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age'); >pick : (object: T, ...keys: string[]) => T >{ name: 'moe', age: 50, userid: 'moe1' } : { name: string; age: number; userid: string; } >name : string ->'moe' : string +>'moe' : "moe" >age : number ->50 : number +>50 : 50 >userid : string ->'moe1' : string ->'name' : string ->'age' : string +>'moe1' : "moe1" +>'name' : "name" +>'age' : "age" _.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'userid'); >_.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'userid') : { name: string; age: number; userid: string; } @@ -1188,18 +1188,18 @@ _.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'userid'); >omit : (object: T, ...keys: string[]) => T >{ name: 'moe', age: 50, userid: 'moe1' } : { name: string; age: number; userid: string; } >name : string ->'moe' : string +>'moe' : "moe" >age : number ->50 : number +>50 : 50 >userid : string ->'moe1' : string ->'userid' : string +>'moe1' : "moe1" +>'userid' : "userid" var iceCream = { flavor: "chocolate" }; >iceCream : { flavor: string; } >{ flavor: "chocolate" } : { flavor: string; } >flavor : string ->"chocolate" : string +>"chocolate" : "chocolate" _.defaults(iceCream, { flavor: "vanilla", sprinkles: "lots" }); >_.defaults(iceCream, { flavor: "vanilla", sprinkles: "lots" }) : { flavor: string; } @@ -1209,9 +1209,9 @@ _.defaults(iceCream, { flavor: "vanilla", sprinkles: "lots" }); >iceCream : { flavor: string; } >{ flavor: "vanilla", sprinkles: "lots" } : { flavor: string; sprinkles: string; } >flavor : string ->"vanilla" : string +>"vanilla" : "vanilla" >sprinkles : string ->"lots" : string +>"lots" : "lots" _.clone({ name: 'moe' }); >_.clone({ name: 'moe' }) : { name: string; } @@ -1220,7 +1220,7 @@ _.clone({ name: 'moe' }); >clone : (object: T) => T >{ name: 'moe' } : { name: string; } >name : string ->'moe' : string +>'moe' : "moe" _.chain([1, 2, 3, 200]) >_.chain([1, 2, 3, 200]) .filter(function (num) { return num % 2 == 0; }) .tap(alert) .map(function (num) { return num * num }) .value() : number[] @@ -1236,10 +1236,10 @@ _.chain([1, 2, 3, 200]) >_ : Underscore.Static >chain : { (list: T[]): Underscore.ChainedArray; (list: Dictionary): Underscore.ChainedDictionary; (obj: T): Underscore.ChainedObject; } >[1, 2, 3, 200] : number[] ->1 : number ->2 : number ->3 : number ->200 : number +>1 : 1 +>2 : 2 +>3 : 3 +>200 : 200 .filter(function (num) { return num % 2 == 0; }) >filter : (iterator: Iterator, context?: any) => Underscore.ChainedArray @@ -1248,7 +1248,7 @@ _.chain([1, 2, 3, 200]) >num % 2 == 0 : boolean >num % 2 : number >num : number ->2 : number +>2 : 2 >0 : 0 .tap(alert) @@ -1274,34 +1274,34 @@ _.has({ a: 1, b: 2, c: 3 }, "b"); >has : (object: any, key: string) => boolean >{ a: 1, b: 2, c: 3 } : { a: number; b: number; c: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 >c : number ->3 : number ->"b" : string +>3 : 3 +>"b" : "b" var moe = { name: 'moe', luckyNumbers: [13, 27, 34] }; >moe : { name: string; luckyNumbers: number[]; } >{ name: 'moe', luckyNumbers: [13, 27, 34] } : { name: string; luckyNumbers: number[]; } >name : string ->'moe' : string +>'moe' : "moe" >luckyNumbers : number[] >[13, 27, 34] : number[] ->13 : number ->27 : number ->34 : number +>13 : 13 +>27 : 27 +>34 : 34 var clone = { name: 'moe', luckyNumbers: [13, 27, 34] }; >clone : { name: string; luckyNumbers: number[]; } >{ name: 'moe', luckyNumbers: [13, 27, 34] } : { name: string; luckyNumbers: number[]; } >name : string ->'moe' : string +>'moe' : "moe" >luckyNumbers : number[] >[13, 27, 34] : number[] ->13 : number ->27 : number ->34 : number +>13 : 13 +>27 : 27 +>34 : 34 moe == clone; >moe == clone : boolean @@ -1322,9 +1322,9 @@ _.isEmpty([1, 2, 3]); >_ : Underscore.Static >isEmpty : (object: any) => boolean >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 _.isEmpty({}); >_.isEmpty({}) : boolean @@ -1341,8 +1341,8 @@ _.isElement($('body')[0]); >$('body')[0] : any >$('body') : any >$ : any ->'body' : string ->0 : number +>'body' : "body" +>0 : 0 (function () { return _.isArray(arguments); })(); >(function () { return _.isArray(arguments); })() : boolean @@ -1360,9 +1360,9 @@ _.isArray([1, 2, 3]); >_ : Underscore.Static >isArray : (object: any) => boolean >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 _.isObject({}); >_.isObject({}) : boolean @@ -1376,7 +1376,7 @@ _.isObject(1); >_.isObject : (value: any) => boolean >_ : Underscore.Static >isObject : (value: any) => boolean ->1 : number +>1 : 1 // (() => { return _.isArguments(arguments); })(1, 2, 3); @@ -1386,9 +1386,9 @@ _.isArguments([1, 2, 3]); >_ : Underscore.Static >isArguments : (object: any) => boolean >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 _.isFunction(alert); >_.isFunction(alert) : boolean @@ -1402,7 +1402,7 @@ _.isString("moe"); >_.isString : (object: any) => boolean >_ : Underscore.Static >isString : (object: any) => boolean ->"moe" : string +>"moe" : "moe" _.isNumber(8.4 * 5); >_.isNumber(8.4 * 5) : boolean @@ -1410,16 +1410,16 @@ _.isNumber(8.4 * 5); >_ : Underscore.Static >isNumber : (object: any) => boolean >8.4 * 5 : number ->8.4 : number ->5 : number +>8.4 : 8.4 +>5 : 5 _.isFinite(-101); >_.isFinite(-101) : boolean >_.isFinite : (object: any) => boolean >_ : Underscore.Static >isFinite : (object: any) => boolean ->-101 : number ->101 : number +>-101 : -101 +>101 : 101 _.isFinite(-Infinity); >_.isFinite(-Infinity) : boolean @@ -1508,7 +1508,7 @@ var moe2 = { name: 'moe' }; >moe2 : { name: string; } >{ name: 'moe' } : { name: string; } >name : string ->'moe' : string +>'moe' : "moe" moe2 === _.identity(moe); >moe2 === _.identity(moe) : boolean @@ -1527,7 +1527,7 @@ _.times(3, function (n) { genie.grantWishNumber(n); }); >_.times : (n: number, iterator: Iterator, context?: any) => U[] >_ : Underscore.Static >times : (n: number, iterator: Iterator, context?: any) => U[] ->3 : number +>3 : 3 >function (n) { genie.grantWishNumber(n); } : (n: number) => void >n : number >genie.grantWishNumber(n) : any @@ -1541,8 +1541,8 @@ _.random(0, 100); >_.random : { (max: number): number; (min: number, max: number): number; } >_ : Underscore.Static >random : { (max: number): number; (min: number, max: number): number; } ->0 : number ->100 : number +>0 : 0 +>100 : 100 _.mixin({ >_.mixin({ capitalize: function (string) { return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase(); }}) : void @@ -1564,7 +1564,7 @@ _.mixin({ >string.charAt : any >string : any >charAt : any ->0 : number +>0 : 0 >toUpperCase : any >string.substring(1).toLowerCase() : any >string.substring(1).toLowerCase : any @@ -1572,7 +1572,7 @@ _.mixin({ >string.substring : any >string : any >substring : any ->1 : number +>1 : 1 >toLowerCase : any } }); @@ -1583,7 +1583,7 @@ _.mixin({ >_("fabio") : any >_("fabio") : Underscore.WrappedObject >_ : Underscore.Static ->"fabio" : string +>"fabio" : "fabio" >capitalize : any _.uniqueId('contact_'); @@ -1591,23 +1591,23 @@ _.uniqueId('contact_'); >_.uniqueId : { (): number; (prefix: string): string; } >_ : Underscore.Static >uniqueId : { (): number; (prefix: string): string; } ->'contact_' : string +>'contact_' : "contact_" _.escape('Curly, Larry & Moe'); >_.escape('Curly, Larry & Moe') : string >_.escape : (s: string) => string >_ : Underscore.Static >escape : (s: string) => string ->'Curly, Larry & Moe' : string +>'Curly, Larry & Moe' : "Curly, Larry & Moe" var object = { cheese: 'crumpets', stuff: function () { return 'nonsense'; } }; >object : { cheese: string; stuff: () => string; } >{ cheese: 'crumpets', stuff: function () { return 'nonsense'; } } : { cheese: string; stuff: () => string; } >cheese : string ->'crumpets' : string +>'crumpets' : "crumpets" >stuff : () => string >function () { return 'nonsense'; } : () => string ->'nonsense' : string +>'nonsense' : "nonsense" _.result(object, 'cheese'); >_.result(object, 'cheese') : any @@ -1615,7 +1615,7 @@ _.result(object, 'cheese'); >_ : Underscore.Static >result : (object: any, property: string) => any >object : { cheese: string; stuff: () => string; } ->'cheese' : string +>'cheese' : "cheese" _.result(object, 'stuff'); >_.result(object, 'stuff') : any @@ -1623,7 +1623,7 @@ _.result(object, 'stuff'); >_ : Underscore.Static >result : (object: any, property: string) => any >object : { cheese: string; stuff: () => string; } ->'stuff' : string +>'stuff' : "stuff" var compiled = _.template("hello: <%= name %>"); >compiled : (data: any) => string @@ -1631,18 +1631,18 @@ var compiled = _.template("hello: <%= name %>"); >_.template : { (templateString: string): (data: any) => string; (templateString: string, data: any, settings?: Underscore.TemplateSettings): string; } >_ : Underscore.Static >template : { (templateString: string): (data: any) => string; (templateString: string, data: any, settings?: Underscore.TemplateSettings): string; } ->"hello: <%= name %>" : string +>"hello: <%= name %>" : "hello: <%= name %>" compiled({ name: 'moe' }); >compiled({ name: 'moe' }) : string >compiled : (data: any) => string >{ name: 'moe' } : { name: string; } >name : string ->'moe' : string +>'moe' : "moe" var list2 = "<% _.each(people, function(name) { %>
  • <%= name %>
  • <% }); %>"; >list2 : string ->"<% _.each(people, function(name) { %>
  • <%= name %>
  • <% }); %>" : string +>"<% _.each(people, function(name) { %>
  • <%= name %>
  • <% }); %>" : "<% _.each(people, function(name) { %>
  • <%= name %>
  • <% }); %>" _.template(list2, { people: ['moe', 'curly', 'larry'] }); >_.template(list2, { people: ['moe', 'curly', 'larry'] }) : string @@ -1653,9 +1653,9 @@ _.template(list2, { people: ['moe', 'curly', 'larry'] }); >{ people: ['moe', 'curly', 'larry'] } : { people: string[]; } >people : string[] >['moe', 'curly', 'larry'] : string[] ->'moe' : string ->'curly' : string ->'larry' : string +>'moe' : "moe" +>'curly' : "curly" +>'larry' : "larry" var template = _.template("<%- value %>"); >template : (data: any) => string @@ -1663,14 +1663,14 @@ var template = _.template("<%- value %>"); >_.template : { (templateString: string): (data: any) => string; (templateString: string, data: any, settings?: Underscore.TemplateSettings): string; } >_ : Underscore.Static >template : { (templateString: string): (data: any) => string; (templateString: string, data: any, settings?: Underscore.TemplateSettings): string; } ->"<%- value %>" : string +>"<%- value %>" : "<%- value %>" template({ value: '