diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f132854a032..572edef07e8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1341,7 +1341,7 @@ namespace ts { function checkAndReportErrorForUsingTypeAsNamespace(errorLocation: Node, name: __String, meaning: SymbolFlags): boolean { if (meaning === SymbolFlags.Namespace) { - const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.Type & ~SymbolFlags.Value, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined, /*isUse*/ false)); + const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.Type & ~SymbolFlags.Namespace, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined, /*isUse*/ false)); const parent = errorLocation.parent; if (symbol) { if (isQualifiedName(parent)) { @@ -1903,13 +1903,17 @@ namespace ts { function tryGetMemberInModuleExportsAndProperties(memberName: __String, moduleSymbol: Symbol): Symbol | undefined { const symbol = tryGetMemberInModuleExports(memberName, moduleSymbol); - if (!symbol) { - const exportEquals = resolveExternalModuleSymbol(moduleSymbol); - if (exportEquals !== moduleSymbol) { - return getPropertyOfType(getTypeOfSymbol(exportEquals), memberName); - } + if (symbol) { + return symbol; } - return symbol; + + const exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals === moduleSymbol) { + return undefined; + } + + const type = getTypeOfSymbol(exportEquals); + return type.flags & TypeFlags.Primitive ? undefined : getPropertyOfType(type, memberName); } function getExportsOfSymbol(symbol: Symbol): SymbolTable { @@ -4482,7 +4486,7 @@ namespace ts { else if (jsDocType !== unknownType && declarationType !== unknownType && !isTypeIdenticalTo(jsDocType, declarationType) && !(symbol.flags & SymbolFlags.JSContainer)) { - errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, jsDocType, declaration, declarationType); + errorNextVariableOrPropertyDeclarationMustHaveSameType(jsDocType, declaration, declarationType); } } else if (!jsDocType) { @@ -6248,12 +6252,12 @@ namespace ts { function getAllPossiblePropertiesOfTypes(types: Type[]): Symbol[] { const unionType = getUnionType(types); if (!(unionType.flags & TypeFlags.Union)) { - return getPropertiesOfType(unionType); + return getAugmentedPropertiesOfType(unionType); } const props = createSymbolTable(); for (const memberType of types) { - for (const { escapedName } of getPropertiesOfType(memberType)) { + for (const { escapedName } of getAugmentedPropertiesOfType(memberType)) { if (!props.has(escapedName)) { props.set(escapedName, createUnionOrIntersectionProperty(unionType as UnionType, escapedName)); } @@ -9383,9 +9387,7 @@ namespace ts { !(target.flags & TypeFlags.Union) && !isIntersectionConstituent && source !== globalObjectType && - (getPropertiesOfType(source).length > 0 || - getSignaturesOfType(source, SignatureKind.Call).length > 0 || - getSignaturesOfType(source, SignatureKind.Construct).length > 0) && + (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source)) && isWeakType(target) && !hasCommonProperties(source, target)) { if (reportErrors) { @@ -10773,8 +10775,7 @@ namespace ts { */ function isObjectTypeWithInferableIndex(type: Type) { return type.symbol && (type.symbol.flags & (SymbolFlags.ObjectLiteral | SymbolFlags.TypeLiteral | SymbolFlags.ValueModule)) !== 0 && - getSignaturesOfType(type, SignatureKind.Call).length === 0 && - getSignaturesOfType(type, SignatureKind.Construct).length === 0; + !typeHasCallOrConstructSignatures(type); } function createSymbolWithType(source: Symbol, type: Type) { @@ -13051,7 +13052,7 @@ namespace ts { // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. if (declaration.kind === SyntaxKind.ClassDeclaration - && nodeIsDecorated(declaration)) { + && nodeIsDecorated(declaration as ClassDeclaration)) { let container = getContainingClass(node); while (container !== undefined) { if (container === declaration && container.name !== node) { @@ -15584,6 +15585,8 @@ namespace ts { function checkPropertyAccessExpressionOrQualifiedName(node: PropertyAccessExpression | QualifiedName, left: Expression | QualifiedName, right: Identifier) { let propType: Type; + let leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; + const leftWasReferenced = leftSymbol && getSymbolLinks(leftSymbol).referenced; const leftType = checkNonNullExpression(left); const apparentType = getApparentType(getWidenedType(leftType)); if (isTypeAny(apparentType) || apparentType === silentNeverType) { @@ -15607,6 +15610,13 @@ namespace ts { else { checkPropertyNotUsedBeforeDeclaration(prop, node, right); markPropertyAsReferenced(prop, node, left.kind === SyntaxKind.ThisKeyword); + // Reset the referenced-ness of the LHS expression if this access refers to a const enum or const enum only module + leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; + if (leftSymbol && !leftWasReferenced && getSymbolLinks(leftSymbol).referenced && + !(isNonLocalAlias(leftSymbol, /*excludes*/ SymbolFlags.Value) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(prop)) + ) { + getSymbolLinks(leftSymbol).referenced = undefined; + } getNodeLinks(node).resolvedSymbol = prop; checkPropertyAccessibility(node, left, apparentType, prop); if (assignmentKind) { @@ -18317,6 +18327,12 @@ namespace ts { (kind & TypeFlags.NonPrimitive && isTypeAssignableTo(source, nonPrimitiveType)); } + function allTypesAssignableToKind(source: Type, kind: TypeFlags, strict?: boolean): boolean { + return source.flags & TypeFlags.Union ? + every((source as UnionType).types, subType => allTypesAssignableToKind(subType, kind, strict)) : + isTypeAssignableToKind(source, kind, strict); + } + function isConstEnumObjectType(type: Type): boolean { return getObjectFlags(type) & ObjectFlags.Anonymous && type.symbol && isConstEnumSymbol(type.symbol); } @@ -18334,14 +18350,12 @@ namespace ts { // and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature. // The result is always of the Boolean primitive type. // NOTE: do not raise error if leftType is unknown as related error was already reported - if (!isTypeAny(leftType) && isTypeAssignableToKind(leftType, TypeFlags.Primitive)) { + if (!isTypeAny(leftType) && + allTypesAssignableToKind(leftType, TypeFlags.Primitive)) { error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } // NOTE: do not raise error if right is unknown as related error was already reported - if (!(isTypeAny(rightType) || - getSignaturesOfType(rightType, SignatureKind.Call).length || - getSignaturesOfType(rightType, SignatureKind.Construct).length || - isTypeSubtypeOf(rightType, globalFunctionType))) { + if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { error(right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -20693,7 +20707,7 @@ namespace ts { // skip this check for nodes that cannot have decorators. These should have already had an error reported by // checkGrammarDecorators. - if (!nodeCanBeDecorated(node)) { + if (!nodeCanBeDecorated(node, node.parent, node.parent.parent)) { return; } @@ -21440,7 +21454,7 @@ namespace ts { if (type !== unknownType && declarationType !== unknownType && !isTypeIdenticalTo(type, declarationType) && !(symbol.flags & SymbolFlags.JSContainer)) { - errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType); + errorNextVariableOrPropertyDeclarationMustHaveSameType(type, node, declarationType); } if (node.initializer) { checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, /*headMessage*/ undefined); @@ -21464,21 +21478,16 @@ namespace ts { } } - function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration: Declaration, firstType: Type, nextDeclaration: Declaration, nextType: Type): void { - const firstSourceFile = getSourceFileOfNode(firstDeclaration); - const firstSpan = getErrorSpanForNode(firstSourceFile, getNameOfDeclaration(firstDeclaration) || firstDeclaration); - const firstLocation = getLineAndCharacterOfPosition(firstSourceFile, firstSpan.start); - const firstLocationDescription = firstSourceFile.fileName + " " + firstLocation.line + ":" + firstLocation.character; + function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType: Type, nextDeclaration: Declaration, nextType: Type): void { const nextDeclarationName = getNameOfDeclaration(nextDeclaration); const message = nextDeclaration.kind === SyntaxKind.PropertyDeclaration || nextDeclaration.kind === SyntaxKind.PropertySignature - ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_has_type_1_at_2_but_here_has_type_3 - : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_type_3; + ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 + : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; error( nextDeclarationName, message, declarationNameToString(nextDeclarationName), typeToString(firstType), - firstLocationDescription, typeToString(nextType)); } @@ -22053,17 +22062,16 @@ namespace ts { if (func) { const signature = getSignatureFromDeclaration(func); const returnType = getReturnTypeOfSignature(signature); + const functionFlags = getFunctionFlags(func); + if (functionFlags & FunctionFlags.Generator) { // AsyncGenerator function or Generator function + // A generator does not need its return expressions checked against its return type. + // Instead, the yield expressions are checked against the element type. + // TODO: Check return expressions of generators when return type tracking is added + // for generators. + return; + } if (strictNullChecks || node.expression || returnType.flags & TypeFlags.Never) { const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - const functionFlags = getFunctionFlags(func); - if (functionFlags & FunctionFlags.Generator) { // AsyncGenerator function or Generator function - // A generator does not need its return expressions checked against its return type. - // Instead, the yield expressions are checked against the element type. - // TODO: Check return expressions of generators when return type tracking is added - // for generators. - return; - } - if (func.kind === SyntaxKind.SetAccessor) { if (node.expression) { error(node, Diagnostics.Setters_cannot_return_a_value); @@ -24427,7 +24435,7 @@ namespace ts { function getAugmentedPropertiesOfType(type: Type): Symbol[] { type = getApparentType(type); const propsByName = createSymbolTable(getPropertiesOfType(type)); - if (getSignaturesOfType(type, SignatureKind.Call).length || getSignaturesOfType(type, SignatureKind.Construct).length) { + if (typeHasCallOrConstructSignatures(type)) { forEach(getPropertiesOfType(globalFunctionType), p => { if (!propsByName.has(p.escapedName)) { propsByName.set(p.escapedName, p); @@ -24437,6 +24445,10 @@ namespace ts { return getNamedMembers(propsByName); } + function typeHasCallOrConstructSignatures(type: Type): boolean { + return ts.typeHasCallOrConstructSignatures(type, checker); + } + function getRootSymbols(symbol: Symbol): Symbol[] { if (getCheckFlags(symbol) & CheckFlags.Synthetic) { const symbols: Symbol[] = []; @@ -24696,6 +24708,11 @@ namespace ts { if (symbol && getSymbolLinks(symbol).referenced) { return true; } + const target = getSymbolLinks(symbol).target; + if (target && getModifierFlags(node) & ModifierFlags.Export && target.flags & SymbolFlags.Value) { + // An `export import ... =` of a value symbol is always considered referenced + return true; + } } if (checkChildren) { @@ -25202,7 +25219,7 @@ namespace ts { if (!node.decorators) { return false; } - if (!nodeCanBeDecorated(node)) { + if (!nodeCanBeDecorated(node, node.parent, node.parent.parent)) { if (node.kind === SyntaxKind.MethodDeclaration && !nodeIsPresent((node).body)) { return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index fdf888b0cfc..48c1b84dbaa 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -2758,6 +2758,12 @@ namespace ts { VeryAggressive = 3, } + /** + * Safer version of `Function` which should not be called. + * Every function should be assignable to this, but this should not be assignable to every function. + */ + export type AnyFunction = (...args: never[]) => void; + export namespace Debug { export let currentAssertionLevel = AssertionLevel.None; export let isDebugging = false; @@ -2766,7 +2772,7 @@ namespace ts { return currentAssertionLevel >= level; } - export function assert(expression: boolean, message?: string, verboseDebugInfo?: string | (() => string), stackCrawlMark?: Function): void { + export function assert(expression: boolean, message?: string, verboseDebugInfo?: string | (() => string), stackCrawlMark?: AnyFunction): void { if (!expression) { if (verboseDebugInfo) { message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); @@ -2800,7 +2806,7 @@ namespace ts { } } - export function fail(message?: string, stackCrawlMark?: Function): never { + export function fail(message?: string, stackCrawlMark?: AnyFunction): never { debugger; const e = new Error(message ? `Debug Failure. ${message}` : "Debug Failure."); if ((Error).captureStackTrace) { @@ -2809,11 +2815,11 @@ namespace ts { throw e; } - export function assertNever(member: never, message?: string, stackCrawlMark?: Function): never { + export function assertNever(member: never, message?: string, stackCrawlMark?: AnyFunction): never { return fail(message || `Illegal value: ${member}`, stackCrawlMark || assertNever); } - export function getFunctionName(func: Function) { + export function getFunctionName(func: AnyFunction) { if (typeof func !== "function") { return ""; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cd65bf945f4..965735debf6 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1344,7 +1344,7 @@ "category": "Error", "code": 2402 }, - "Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.": { + "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { "category": "Error", "code": 2403 }, @@ -2264,7 +2264,7 @@ "category": "Error", "code": 2716 }, - "Subsequent property declarations must have the same type. Property '{0}' has type '{1}' at {2}, but here has type '{3}'.": { + "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.": { "category": "Error", "code": 2717 }, @@ -2606,7 +2606,7 @@ "category": "Error", "code": 4102 }, - + "The current host does not support the '{0}' option.": { "category": "Error", "code": 5001 diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 78df166633c..f085c3ffc06 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -932,7 +932,7 @@ namespace ts { return value; } - function scanString(allowEscapes = true): string { + function scanString(jsxAttributeString = false): string { const quote = text.charCodeAt(pos); pos++; let result = ""; @@ -950,13 +950,13 @@ namespace ts { pos++; break; } - if (ch === CharacterCodes.backslash && allowEscapes) { + if (ch === CharacterCodes.backslash && !jsxAttributeString) { result += text.substring(start, pos); result += scanEscapeSequence(); start = pos; continue; } - if (isLineBreak(ch)) { + if (isLineBreak(ch) && !jsxAttributeString) { result += text.substring(start, pos); tokenFlags |= TokenFlags.Unterminated; error(Diagnostics.Unterminated_string_literal); @@ -1811,7 +1811,7 @@ namespace ts { switch (text.charCodeAt(pos)) { case CharacterCodes.doubleQuote: case CharacterCodes.singleQuote: - tokenValue = scanString(/*allowEscapes*/ false); + tokenValue = scanString(/*jsxAttributeString*/ true); return token = SyntaxKind.StringLiteral; default: // If this scans anything other than `{`, it's a parse error. diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts index ab44db8ef4b..35eaae2a5cf 100644 --- a/src/compiler/transformers/jsx.ts +++ b/src/compiler/transformers/jsx.ts @@ -6,6 +6,7 @@ namespace ts { export function transformJsx(context: TransformationContext) { const compilerOptions = context.getCompilerOptions(); + let currentSourceFile: SourceFile; return transformSourceFile; @@ -19,6 +20,7 @@ namespace ts { return node; } + currentSourceFile = node; const visited = visitEachChild(node, visitor, context); addEmitHelpers(visited, context.readEmitHelpers()); return visited; @@ -167,8 +169,11 @@ namespace ts { return createTrue(); } else if (node.kind === SyntaxKind.StringLiteral) { - const decoded = tryDecodeEntities((node).text); - return decoded ? setTextRange(createLiteral(decoded), node) : node; + // Always recreate the literal to escape any escape sequences or newlines which may be in the original jsx string and which + // Need to be escaped to be handled correctly in a normal string + const literal = createLiteral(tryDecodeEntities((node).text) || (node).text); + literal.singleQuote = (node as StringLiteral).singleQuote !== undefined ? (node as StringLiteral).singleQuote : !isStringDoubleQuoted(node as StringLiteral, currentSourceFile); + return setTextRange(literal, node); } else if (node.kind === SyntaxKind.JsxExpression) { if (node.expression === undefined) { diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 39a4cc83bda..3c1bba280f0 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -1261,7 +1261,7 @@ namespace ts { * the class. */ function getDecoratedClassElements(node: ClassExpression | ClassDeclaration, isStatic: boolean): ReadonlyArray { - return filter(node.members, isStatic ? isStaticDecoratedClassElement : isInstanceDecoratedClassElement); + return filter(node.members, isStatic ? m => isStaticDecoratedClassElement(m, node) : m => isInstanceDecoratedClassElement(m, node)); } /** @@ -1270,8 +1270,8 @@ namespace ts { * * @param member The class member. */ - function isStaticDecoratedClassElement(member: ClassElement) { - return isDecoratedClassElement(member, /*isStatic*/ true); + function isStaticDecoratedClassElement(member: ClassElement, parent: ClassLikeDeclaration) { + return isDecoratedClassElement(member, /*isStatic*/ true, parent); } /** @@ -1280,8 +1280,8 @@ namespace ts { * * @param member The class member. */ - function isInstanceDecoratedClassElement(member: ClassElement) { - return isDecoratedClassElement(member, /*isStatic*/ false); + function isInstanceDecoratedClassElement(member: ClassElement, parent: ClassLikeDeclaration) { + return isDecoratedClassElement(member, /*isStatic*/ false, parent); } /** @@ -1290,8 +1290,8 @@ namespace ts { * * @param member The class member. */ - function isDecoratedClassElement(member: ClassElement, isStatic: boolean) { - return nodeOrChildIsDecorated(member) + function isDecoratedClassElement(member: ClassElement, isStatic: boolean, parent: ClassLikeDeclaration) { + return nodeOrChildIsDecorated(member, parent) && isStatic === hasModifier(member, ModifierFlags.Static); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 380e7c7cc7a..2e57e563877 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -966,7 +966,7 @@ namespace ts { kind: SyntaxKind.GetAccessor; parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; - body: FunctionBody; + body?: FunctionBody; } // See the comment on MethodDeclaration for the intuition behind SetAccessorDeclaration being a @@ -975,7 +975,7 @@ namespace ts { kind: SyntaxKind.SetAccessor; parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; - body: FunctionBody; + body?: FunctionBody; } export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; @@ -2766,7 +2766,10 @@ namespace ts { getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; - /** Unlike `tryGetMemberInModuleExports`, this includes properties of an `export =` value. */ + /** + * Unlike `tryGetMemberInModuleExports`, this includes properties of an `export =` value. + * Does *not* return properties of primitive types. + */ /* @internal */ tryGetMemberInModuleExportsAndProperties(memberName: string, moduleSymbol: Symbol): Symbol | undefined; getApparentType(type: Type): Type; getSuggestionForNonexistentProperty(node: Identifier, containingType: Type): string | undefined; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 80ca3bbdfad..8c9e995e24a 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1205,7 +1205,10 @@ namespace ts { return (node).expression; } - export function nodeCanBeDecorated(node: Node): boolean { + export function nodeCanBeDecorated(node: ClassDeclaration): true; + export function nodeCanBeDecorated(node: ClassElement, parent: Node): boolean; + export function nodeCanBeDecorated(node: Node, parent: Node, grandparent: Node): boolean; + export function nodeCanBeDecorated(node: Node, parent?: Node, grandparent?: Node): boolean { switch (node.kind) { case SyntaxKind.ClassDeclaration: // classes are valid targets @@ -1213,43 +1216,51 @@ namespace ts { case SyntaxKind.PropertyDeclaration: // property declarations are valid if their parent is a class declaration. - return node.parent.kind === SyntaxKind.ClassDeclaration; + return parent.kind === SyntaxKind.ClassDeclaration; case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.MethodDeclaration: // if this method has a body and its parent is a class declaration, this is a valid target. return (node).body !== undefined - && node.parent.kind === SyntaxKind.ClassDeclaration; + && parent.kind === SyntaxKind.ClassDeclaration; case SyntaxKind.Parameter: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; - return (node.parent).body !== undefined - && (node.parent.kind === SyntaxKind.Constructor - || node.parent.kind === SyntaxKind.MethodDeclaration - || node.parent.kind === SyntaxKind.SetAccessor) - && node.parent.parent.kind === SyntaxKind.ClassDeclaration; + return (parent).body !== undefined + && (parent.kind === SyntaxKind.Constructor + || parent.kind === SyntaxKind.MethodDeclaration + || parent.kind === SyntaxKind.SetAccessor) + && grandparent.kind === SyntaxKind.ClassDeclaration; } return false; } - export function nodeIsDecorated(node: Node): boolean { + export function nodeIsDecorated(node: ClassDeclaration): boolean; + export function nodeIsDecorated(node: ClassElement, parent: Node): boolean; + export function nodeIsDecorated(node: Node, parent: Node, grandparent: Node): boolean; + export function nodeIsDecorated(node: Node, parent?: Node, grandparent?: Node): boolean { return node.decorators !== undefined - && nodeCanBeDecorated(node); + && nodeCanBeDecorated(node, parent, grandparent); } - export function nodeOrChildIsDecorated(node: Node): boolean { - return nodeIsDecorated(node) || childIsDecorated(node); + export function nodeOrChildIsDecorated(node: ClassDeclaration): boolean; + export function nodeOrChildIsDecorated(node: ClassElement, parent: Node): boolean; + export function nodeOrChildIsDecorated(node: Node, parent: Node, grandparent: Node): boolean; + export function nodeOrChildIsDecorated(node: Node, parent?: Node, grandparent?: Node): boolean { + return nodeIsDecorated(node, parent, grandparent) || childIsDecorated(node, parent); } - export function childIsDecorated(node: Node): boolean { + export function childIsDecorated(node: ClassDeclaration): boolean; + export function childIsDecorated(node: Node, parent: Node): boolean; + export function childIsDecorated(node: Node, parent?: Node): boolean { switch (node.kind) { case SyntaxKind.ClassDeclaration: - return forEach((node).members, nodeOrChildIsDecorated); + return forEach((node).members, m => nodeOrChildIsDecorated(m, node, parent)); case SyntaxKind.MethodDeclaration: case SyntaxKind.SetAccessor: - return forEach((node).parameters, nodeIsDecorated); + return forEach((node).parameters, p => nodeIsDecorated(p, node, parent)); } } @@ -1965,6 +1976,11 @@ namespace ts { return isKeyword(token) && !isContextualKeyword(token); } + export function isStringANonContextualKeyword(name: string) { + const token = stringToToken(name); + return token !== undefined && isNonContextualKeyword(token); + } + export function isTrivia(token: SyntaxKind) { return SyntaxKind.FirstTriviaToken <= token && token <= SyntaxKind.LastTriviaToken; } @@ -3660,6 +3676,10 @@ namespace ts { directory = parentPath; } } + + export function typeHasCallOrConstructSignatures(type: Type, checker: TypeChecker) { + return checker.getSignaturesOfType(type, SignatureKind.Call).length !== 0 || checker.getSignaturesOfType(type, SignatureKind.Construct).length !== 0; + } } namespace ts { diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index cd992464a65..0e37dd51c15 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -3081,7 +3081,7 @@ Actual: ${stringify(fullActual)}`); const itemsString = items.map(item => stringify({ name: item.name, source: item.source, kind: item.kind })).join(",\n"); this.raiseError(`Expected "${stringify({ entryId, text, documentation, kind })}" to be in list [${itemsString}]`); } - else if (matchingItems.length > 1 && !(options && options.allowDuplicate)) { + else if (matchingItems.length > 1) { this.raiseError(`Found duplicate completion items for ${stringify(entryId)}`); } const item = matchingItems[0]; @@ -4558,7 +4558,6 @@ namespace FourSlashInterface { export interface VerifyCompletionListContainsOptions extends ts.GetCompletionsAtPositionOptions { sourceDisplay: string; - allowDuplicate: boolean; // TODO: GH#20042 } export interface NewContentOptions { diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 8a3202b88be..f4a58352b16 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -135,7 +135,7 @@ namespace Utils { return content; } - export function memoize(f: T, memoKey: (...anything: any[]) => string): T { + export function memoize(f: T, memoKey: (...anything: any[]) => string): T { const cache = ts.createMap(); return (function(this: any, ...args: any[]) { diff --git a/src/harness/loggedIO.ts b/src/harness/loggedIO.ts index 37e8dddb3d7..949c6e5d947 100644 --- a/src/harness/loggedIO.ts +++ b/src/harness/loggedIO.ts @@ -364,7 +364,7 @@ namespace Playback { }; } - function recordReplay(original: T, underlying: any) { + function recordReplay(original: T, underlying: any) { function createWrapper(record: T, replay: T): T { // tslint:disable-next-line only-arrow-functions return (function () { diff --git a/src/harness/parallel/worker.ts b/src/harness/parallel/worker.ts index 953ed5aeb21..013992a8e35 100644 --- a/src/harness/parallel/worker.ts +++ b/src/harness/parallel/worker.ts @@ -2,7 +2,10 @@ namespace Harness.Parallel.Worker { let errors: ErrorInfo[] = []; let passing = 0; - type Executor = {name: string, callback: Function, kind: "suite" | "test"} | never; + type MochaCallback = (this: Mocha.ISuiteCallbackContext, done: MochaDone) => void; + type Callable = () => void; + + type Executor = {name: string, callback: MochaCallback, kind: "suite" | "test"} | never; function resetShimHarnessAndExecute(runner: RunnerBase) { errors = []; @@ -15,7 +18,7 @@ namespace Harness.Parallel.Worker { } - let beforeEachFunc: Function; + let beforeEachFunc: Callable; const namestack: string[] = []; let testList: Executor[] = []; function shimMochaHarness() { @@ -33,19 +36,19 @@ namespace Harness.Parallel.Worker { }) as Mocha.ITestDefinition; } - function executeSuiteCallback(name: string, callback: Function) { + function executeSuiteCallback(name: string, callback: MochaCallback) { const fakeContext: Mocha.ISuiteCallbackContext = { retries() { return this; }, slow() { return this; }, timeout() { return this; }, }; namestack.push(name); - let beforeFunc: Function; - (before as any) = (cb: Function) => beforeFunc = cb; - let afterFunc: Function; - (after as any) = (cb: Function) => afterFunc = cb; + let beforeFunc: Callable; + (before as any) = (cb: Callable) => beforeFunc = cb; + let afterFunc: Callable; + (after as any) = (cb: Callable) => afterFunc = cb; const savedBeforeEach = beforeEachFunc; - (beforeEach as any) = (cb: Function) => beforeEachFunc = cb; + (beforeEach as any) = (cb: Callable) => beforeEachFunc = cb; const savedTestList = testList; testList = []; @@ -90,7 +93,7 @@ namespace Harness.Parallel.Worker { } } - function executeCallback(name: string, callback: Function, kind: "suite" | "test") { + function executeCallback(name: string, callback: MochaCallback, kind: "suite" | "test") { if (kind === "suite") { executeSuiteCallback(name, callback); } @@ -99,7 +102,7 @@ namespace Harness.Parallel.Worker { } } - function executeTestCallback(name: string, callback: Function) { + function executeTestCallback(name: string, callback: MochaCallback) { const fakeContext: Mocha.ITestCallbackContext = { skip() { return this; }, timeout() { return this; }, @@ -238,7 +241,7 @@ namespace Harness.Parallel.Worker { } const unittest: "unittest" = "unittest"; - let unitTests: {[name: string]: Function}; + let unitTests: {[name: string]: MochaCallback}; function collectUnitTestsIfNeeded() { if (!unitTests && testList.length) { unitTests = {}; diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts index 871d4a37b9a..5cde1e9d2ea 100644 --- a/src/harness/unittests/session.ts +++ b/src/harness/unittests/session.ts @@ -54,7 +54,7 @@ namespace ts.server { } // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test - let oldPrepare: Function; + let oldPrepare: AnyFunction; before(() => { oldPrepare = (Error as any).prepareStackTrace; delete (Error as any).prepareStackTrace; @@ -402,7 +402,7 @@ namespace ts.server { describe("exceptions", () => { // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test - let oldPrepare: Function; + let oldPrepare: AnyFunction; before(() => { oldPrepare = (Error as any).prepareStackTrace; delete (Error as any).prepareStackTrace; diff --git a/src/harness/unittests/transform.ts b/src/harness/unittests/transform.ts index a39249bb225..64f0a19b32d 100644 --- a/src/harness/unittests/transform.ts +++ b/src/harness/unittests/transform.ts @@ -224,6 +224,32 @@ namespace ts { } } }); + + // https://github.com/Microsoft/TypeScript/issues/17384 + testBaseline("transformAddDecoratedNode", () => { + return ts.transpileModule("", { + transformers: { + before: [transformAddDecoratedNode], + }, + compilerOptions: { + target: ts.ScriptTarget.ES5, + newLine: NewLineKind.CarriageReturnLineFeed, + } + }).outputText; + + function transformAddDecoratedNode(_context: ts.TransformationContext) { + return (sourceFile: ts.SourceFile): ts.SourceFile => { + return visitNode(sourceFile); + }; + function visitNode(sf: ts.SourceFile) { + // produce `class Foo { @Bar baz() {} }`; + const classDecl = ts.createClassDeclaration([], [], "Foo", /*typeParameters*/ undefined, /*heritageClauses*/ undefined, [ + ts.createMethod([ts.createDecorator(ts.createIdentifier("Bar"))], [], /**/ undefined, "baz", /**/ undefined, /**/ undefined, [], /**/ undefined, ts.createBlock([])) + ]); + return ts.updateSourceFileNode(sf, [classDecl]); + } + } + }); }); } diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index ff2db0f9ee6..8e0dfe36c2f 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -4737,7 +4737,7 @@ namespace ts.projectSystem { describe("cancellationToken", () => { // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test - let oldPrepare: Function; + let oldPrepare: ts.AnyFunction; before(() => { oldPrepare = (Error as any).prepareStackTrace; delete (Error as any).prepareStackTrace; diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 83479d879c5..7ed37669f34 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -6579,20 +6579,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index fb4dfda449c..ea8a9bd9838 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -6579,20 +6579,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index de3f3987097..1f5a92cdf4a 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -318,6 +318,9 @@ + + + @@ -3774,32 +3777,11 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - + @@ -6606,20 +6588,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index 958d9774e8e..c20900a5abd 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -309,6 +309,9 @@ + + + @@ -3753,32 +3756,11 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - + @@ -6576,20 +6558,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index e2a933198cf..5f702fd6c58 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -6588,20 +6588,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index b77e815dfd5..ce91987a422 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -318,6 +318,9 @@ + + + @@ -3774,32 +3777,11 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - + @@ -6606,20 +6588,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index e204b688ed7..aa6a6d626bd 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -6579,20 +6579,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 861d10e5028..6067b27a513 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -6579,20 +6579,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index 9c099aeb990..35fa1147eac 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -6579,20 +6579,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index be3889c2dd4..88817c1298e 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -302,6 +302,9 @@ + + + @@ -3746,32 +3749,11 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - + @@ -6569,20 +6551,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 38902fa6734..e80dfb3e455 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -6551,20 +6551,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index 543639d56e9..2b490cc372c 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -308,6 +308,9 @@ + + + @@ -3764,32 +3767,11 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - + @@ -6596,20 +6578,17 @@ - + - - - - + - + - + - + diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 5bf19ff41b3..43e951d8504 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -302,6 +302,9 @@ + + + @@ -3758,32 +3761,11 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - + @@ -6590,20 +6572,17 @@ - + - - - - + - + - + - + diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index 41515265862..5124b47f475 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -814,7 +814,6 @@ namespace ts.codefix { lastCharWasValid = isValid; } // Need `|| "_"` to ensure result isn't empty. - const token = stringToToken(res); - return token === undefined || !isNonContextualKeyword(token) ? res || "_" : `_${res}`; + return !isStringANonContextualKeyword(res) ? res || "_" : `_${res}`; } } diff --git a/src/services/completions.ts b/src/services/completions.ts index a3b94acd4c0..083ddea37db 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -112,7 +112,7 @@ namespace ts.Completions { } const realName = unescapeLeadingUnderscores(name); - if (uniqueNames.has(realName)) { + if (uniqueNames.has(realName) || isStringANonContextualKeyword(realName)) { return; } @@ -552,8 +552,6 @@ namespace ts.Completions { options: GetCompletionsAtPositionOptions, target: ScriptTarget, ): CompletionData | undefined { - const isJavaScriptFile = isSourceFileJavaScript(sourceFile); - let request: Request | undefined; let start = timestamp(); @@ -832,23 +830,21 @@ namespace ts.Completions { } } - function addTypeProperties(type: Type) { - // Filter private properties - for (const symbol of type.getApparentProperties()) { - if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { - symbols.push(symbol); - } - } - - if (isJavaScriptFile && type.flags & TypeFlags.Union) { + function addTypeProperties(type: Type): void { + if (isSourceFileJavaScript(sourceFile)) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that - // each individual type has. This is because we're going to add all identifiers - // anyways. So we might as well elevate the members that were at least part + // each individual type has. This is because we're going to add all identifiers + // anyways. So we might as well elevate the members that were at least part // of the individual types to a higher status since we know what they are. - const unionType = type; - for (const elementType of unionType.types) { - addTypeProperties(elementType); + symbols.push(...getPropertiesForCompletion(type, typeChecker, /*isForAccess*/ true)); + } + else { + // Filter private properties + for (const symbol of type.getApparentProperties()) { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } } } } @@ -1239,7 +1235,7 @@ namespace ts.Completions { isNewIdentifierLocation = true; const typeForObject = typeChecker.getContextualType(objectLikeContainer); if (!typeForObject) return false; - typeMembers = getPropertiesForCompletion(typeForObject, typeChecker); + typeMembers = getPropertiesForCompletion(typeForObject, typeChecker, /*isForAccess*/ false); existingMembers = (objectLikeContainer).properties; } else { @@ -1952,6 +1948,8 @@ namespace ts.Completions { function getAllKeywordCompletions() { const allKeywordsCompletions: CompletionEntry[] = []; for (let i = SyntaxKind.FirstKeyword; i <= SyntaxKind.LastKeyword; i++) { + // "undefined" is a global variable, so don't need a keyword completion for it. + if (i === SyntaxKind.UndefinedKeyword) continue; allKeywordsCompletions.push({ name: tokenToString(i), kind: ScriptElementKind.keyword, @@ -2050,14 +2048,15 @@ namespace ts.Completions { * tries to only include those types which declare properties, not methods. * This ensures that we don't try providing completions for all the methods on e.g. Array. */ - function getPropertiesForCompletion(type: Type, checker: TypeChecker): Symbol[] { + function getPropertiesForCompletion(type: Type, checker: TypeChecker, isForAccess: boolean): Symbol[] { if (!(type.flags & TypeFlags.Union)) { - return checker.getPropertiesOfType(type); + return type.getApparentProperties(); } const { types } = type as UnionType; - const filteredTypes = types.filter(memberType => !(memberType.flags & TypeFlags.Primitive || checker.isArrayLikeType(memberType))); - // If there are no property-only types, just provide completions for every type as usual. + // If we're providing completions for an object literal, skip primitive, array-like, or callable types since those shouldn't be implemented by object literals. + const filteredTypes = isForAccess ? types : types.filter(memberType => + !(memberType.flags & TypeFlags.Primitive || checker.isArrayLikeType(memberType) || typeHasCallOrConstructSignatures(memberType, checker))); return checker.getAllPossiblePropertiesOfTypes(filteredTypes); } } diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index 06feabf439e..599187cab79 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -336,46 +336,53 @@ namespace ts.NavigationBar { nameToItems.set(name, [itemWithSameName, child]); return true; } - - function tryMerge(a: NavigationBarNode, b: NavigationBarNode): boolean { - if (shouldReallyMerge(a.node, b.node)) { - merge(a, b); - return true; - } - return false; - } }); + } - /** a and b have the same name, but they may not be mergeable. */ - function shouldReallyMerge(a: Node, b: Node): boolean { - return a.kind === b.kind && (a.kind !== SyntaxKind.ModuleDeclaration || areSameModule(a, b)); + function tryMerge(a: NavigationBarNode, b: NavigationBarNode): boolean { + if (shouldReallyMerge(a.node, b.node)) { + merge(a, b); + return true; + } + return false; + } - // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. - // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! - function areSameModule(a: ModuleDeclaration, b: ModuleDeclaration): boolean { - if (a.body.kind !== b.body.kind) { - return false; - } - if (a.body.kind !== SyntaxKind.ModuleDeclaration) { - return true; - } - return areSameModule(a.body, b.body); - } + /** a and b have the same name, but they may not be mergeable. */ + function shouldReallyMerge(a: Node, b: Node): boolean { + if (a.kind !== b.kind) { + return false; + } + switch (a.kind) { + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return hasModifier(a, ModifierFlags.Static) === hasModifier(b, ModifierFlags.Static); + case SyntaxKind.ModuleDeclaration: + return areSameModule(a, b); + default: + return true; + } + } + + // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. + // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! + function areSameModule(a: ModuleDeclaration, b: ModuleDeclaration): boolean { + return a.body.kind === b.body.kind && (a.body.kind !== SyntaxKind.ModuleDeclaration || areSameModule(a.body, b.body)); + } + + /** Merge source into target. Source should be thrown away after this is called. */ + function merge(target: NavigationBarNode, source: NavigationBarNode): void { + target.additionalNodes = target.additionalNodes || []; + target.additionalNodes.push(source.node); + if (source.additionalNodes) { + target.additionalNodes.push(...source.additionalNodes); } - /** Merge source into target. Source should be thrown away after this is called. */ - function merge(target: NavigationBarNode, source: NavigationBarNode): void { - target.additionalNodes = target.additionalNodes || []; - target.additionalNodes.push(source.node); - if (source.additionalNodes) { - target.additionalNodes.push(...source.additionalNodes); - } - - target.children = concatenate(target.children, source.children); - if (target.children) { - mergeChildren(target.children); - sortChildren(target.children); - } + target.children = concatenate(target.children, source.children); + if (target.children) { + mergeChildren(target.children); + sortChildren(target.children); } } diff --git a/src/services/pathCompletions.ts b/src/services/pathCompletions.ts index a6dfb53da80..15c1ff99758 100644 --- a/src/services/pathCompletions.ts +++ b/src/services/pathCompletions.ts @@ -138,39 +138,36 @@ namespace ts.Completions.PathCompletions { function getCompletionEntriesForNonRelativeModules(fragment: string, scriptPath: string, span: TextSpan, compilerOptions: CompilerOptions, host: LanguageServiceHost, typeChecker: TypeChecker): CompletionEntry[] { const { baseUrl, paths } = compilerOptions; - let result: CompletionEntry[]; + const result: CompletionEntry[] = []; const fileExtensions = getSupportedExtensions(compilerOptions); if (baseUrl) { const projectDir = compilerOptions.project || host.getCurrentDirectory(); const absolute = isRootedDiskPath(baseUrl) ? baseUrl : combinePaths(projectDir, baseUrl); - result = getCompletionEntriesForDirectoryFragment(fragment, normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span, host); + getCompletionEntriesForDirectoryFragment(fragment, normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span, host, /*exclude*/ undefined, result); - if (paths) { - for (const path in paths) { - if (paths.hasOwnProperty(path)) { - if (path === "*") { - if (paths[path]) { - for (const pattern of paths[path]) { - for (const match of getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host)) { - result.push(createCompletionEntryForModule(match, ScriptElementKind.externalModuleName, span)); - } - } - } - } - else if (startsWith(path, fragment)) { - const entry = paths[path] && paths[path].length === 1 && paths[path][0]; - if (entry) { - result.push(createCompletionEntryForModule(path, ScriptElementKind.externalModuleName, span)); - } + for (const path in paths) { + if (!paths.hasOwnProperty(path)) continue; + const patterns = paths[path]; + if (!patterns) continue; + + if (path === "*") { + for (const pattern of patterns) { + for (const match of getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host)) { + // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. + if (result.some(entry => entry.name === match)) continue; + result.push(createCompletionEntryForModule(match, ScriptElementKind.externalModuleName, span)); } } } + else if (startsWith(path, fragment)) { + if (patterns.length === 1) { + if (result.some(entry => entry.name === path)) continue; + result.push(createCompletionEntryForModule(path, ScriptElementKind.externalModuleName, span)); + } + } } } - else { - result = []; - } if (compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs) { forEachAncestorDirectory(scriptPath, ancestor => { diff --git a/src/services/refactors/installTypesForPackage.ts b/src/services/refactors/installTypesForPackage.ts index fbefbbcf4e8..236ca32c799 100644 --- a/src/services/refactors/installTypesForPackage.ts +++ b/src/services/refactors/installTypesForPackage.ts @@ -46,9 +46,19 @@ namespace ts.refactor.installTypesForPackage { function getAction(context: RefactorContext): CodeAction | undefined { const { file, startPosition } = context; const node = getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - if (isStringLiteral(node) && isModuleIdentifier(node) && getResolvedModule(file, node.text) === undefined) { - return codefix.tryGetCodeActionForInstallPackageTypes(context.host, file.fileName, node.text); + if (!isStringLiteral(node) || !isModuleIdentifier(node)) { + return undefined; } + + const resolvedTo = getResolvedModule(file, node.text); + // Still offer to install types if it resolved to e.g. a ".js" file. + // `tryGetCodeActionForInstallPackageTypes` will verify that we're looking for a valid package name, + // so the fix won't trigger for imports of ".js" files that couldn't be better replaced by typings. + if (resolvedTo && extensionIsTypeScript(resolvedTo.extension)) { + return undefined; + } + + return codefix.tryGetCodeActionForInstallPackageTypes(context.host, file.fileName, node.text); } function isModuleIdentifier(node: StringLiteral): boolean { diff --git a/tests/baselines/reference/ES5For-of7.errors.txt b/tests/baselines/reference/ES5For-of7.errors.txt index 082b0d18554..a3d40f38814 100644 --- a/tests/baselines/reference/ES5For-of7.errors.txt +++ b/tests/baselines/reference/ES5For-of7.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts 1:8, but here has type 'any[]'. +tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'. ==== tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts (1 errors) ==== @@ -9,5 +9,5 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS for (var v of []) { var x = [w, v]; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts 1:8, but here has type 'any[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt index 85f156a2b07..20f8e09248a 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. -tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'. -tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'. +tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. +tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. ==== tests/cases/conformance/internalModules/DeclarationMerging/function.ts (0 errors) ==== @@ -23,7 +23,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error T var fn: () => { x: number; y: number }; var fn = A.Point; ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. var cl: { x: number; y: number; } var cl = A.Point(); @@ -45,7 +45,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error T var fn: () => { x: number; y: number }; var fn = B.Point; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. var cl: { x: number; y: number; } var cl = B.Point(); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index bd8bab1e3b8..b12597fb881 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -672,13 +672,13 @@ declare namespace ts { kind: SyntaxKind.GetAccessor; parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; - body: FunctionBody; + body?: FunctionBody; } interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.SetAccessor; parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; - body: FunctionBody; + body?: FunctionBody; } type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement { diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 147b62e63c1..aaa91bb6161 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -672,13 +672,13 @@ declare namespace ts { kind: SyntaxKind.GetAccessor; parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; - body: FunctionBody; + body?: FunctionBody; } interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.SetAccessor; parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; name: PropertyName; - body: FunctionBody; + body?: FunctionBody; } type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement { diff --git a/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt index 1d3e9222ace..28ddb3bb9b9 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,18): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,24): error TS1005: ',' expected. -tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,33): error TS1005: ',' expected. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,40): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es20 ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt index 03c98f0707c..f132abff235 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,18): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,24): error TS1005: ',' expected. -tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,33): error TS1005: ',' expected. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,40): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts( ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt index 9fd82b6cc06..a2f6f441252 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,18): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,24): error TS1005: ',' expected. -tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,33): error TS1005: ',' expected. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,40): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts( ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt index a14b3f44303..cd2bb9c8858 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,18): error TS2304: Cannot find name 'a'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,37): error TS1005: ',' expected. -tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,46): error TS1005: ',' expected. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,53): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es20 ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt index a9e03eb897d..be561eab72c 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,18): error TS2304: Cannot find name 'a'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,37): error TS1005: ',' expected. -tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,46): error TS1005: ',' expected. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,53): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts( ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt index 123f07c020c..84177f28292 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,18): error TS2304: Cannot find name 'a'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,37): error TS1005: ',' expected. -tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,46): error TS1005: ',' expected. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,53): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts( ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'any'. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/augmentedTypesVar.errors.txt b/tests/baselines/reference/augmentedTypesVar.errors.txt index cbedb69bf4d..24c194d25c3 100644 --- a/tests/baselines/reference/augmentedTypesVar.errors.txt +++ b/tests/baselines/reference/augmentedTypesVar.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/augmentedTypesVar.ts(6,5): error TS2300: Duplicate identifier 'x2'. tests/cases/compiler/augmentedTypesVar.ts(7,10): error TS2300: Duplicate identifier 'x2'. -tests/cases/compiler/augmentedTypesVar.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' has type 'number' at tests/cases/compiler/augmentedTypesVar.ts 8:4, but here has type '() => void'. +tests/cases/compiler/augmentedTypesVar.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'. tests/cases/compiler/augmentedTypesVar.ts(13,5): error TS2300: Duplicate identifier 'x4'. tests/cases/compiler/augmentedTypesVar.ts(14,7): error TS2300: Duplicate identifier 'x4'. tests/cases/compiler/augmentedTypesVar.ts(16,5): error TS2300: Duplicate identifier 'x4a'. @@ -29,7 +29,7 @@ tests/cases/compiler/augmentedTypesVar.ts(31,8): error TS2300: Duplicate identif var x3 = 1; var x3 = () => { } // error ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' has type 'number' at tests/cases/compiler/augmentedTypesVar.ts 8:4, but here has type '() => void'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'. // var then class var x4 = 1; // error diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt index a17f8c2b082..344f403906d 100644 --- a/tests/baselines/reference/castingTuple.errors.txt +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -11,7 +11,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(30,10): error TS2352: Type ' tests/cases/conformance/types/tuple/castingTuple.ts(31,10): error TS2352: Type '[C, D]' cannot be converted to type '[A, I]'. Type 'C' is not comparable to type 'A'. Property 'a' is missing in type 'C'. -tests/cases/conformance/types/tuple/castingTuple.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' has type '{}[]' at tests/cases/conformance/types/tuple/castingTuple.ts 22:4, but here has type 'number[]'. +tests/cases/conformance/types/tuple/castingTuple.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot find name 't4'. @@ -68,7 +68,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot !!! error TS2352: Property 'a' is missing in type 'C'. var array1 = numStrTuple; ~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' has type '{}[]' at tests/cases/conformance/types/tuple/castingTuple.ts 22:4, but here has type 'number[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. t4[2] = 10; ~~ !!! error TS2304: Cannot find name 't4'. diff --git a/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt b/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt index de862cf387f..9897799d75b 100644 --- a/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt +++ b/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/classWithDuplicateIdentifier.ts(3,5): error TS2300: Duplica tests/cases/compiler/classWithDuplicateIdentifier.ts(6,5): error TS2300: Duplicate identifier 'b'. tests/cases/compiler/classWithDuplicateIdentifier.ts(7,5): error TS2300: Duplicate identifier 'b'. tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2300: Duplicate identifier 'c'. -tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2717: Subsequent property declarations must have the same type. Property 'c' has type 'number' at tests/cases/compiler/classWithDuplicateIdentifier.ts 9:4, but here has type 'string'. +tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2717: Subsequent property declarations must have the same type. Property 'c' must be of type 'number', but here has type 'string'. ==== tests/cases/compiler/classWithDuplicateIdentifier.ts (5 errors) ==== @@ -26,6 +26,6 @@ tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2717: Subseq ~ !!! error TS2300: Duplicate identifier 'c'. ~ -!!! error TS2717: Subsequent property declarations must have the same type. Property 'c' has type 'number' at tests/cases/compiler/classWithDuplicateIdentifier.ts 9:4, but here has type 'string'. +!!! error TS2717: Subsequent property declarations must have the same type. Property 'c' must be of type 'number', but here has type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport.js b/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport.js new file mode 100644 index 00000000000..d1ead34bdd5 --- /dev/null +++ b/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport.js @@ -0,0 +1,34 @@ +//// [tests/cases/compiler/constEnumNamespaceReferenceCausesNoImport.ts] //// + +//// [foo.ts] +export const enum ConstFooEnum { + Some, + Values, + Here +}; +export function fooFunc(): void { /* removed */ } +//// [index.ts] +import * as Foo from "./foo"; + +function check(x: Foo.ConstFooEnum): void { + switch (x) { + case Foo.ConstFooEnum.Some: + break; + } +} + +//// [foo.js] +"use strict"; +exports.__esModule = true; +; +function fooFunc() { } +exports.fooFunc = fooFunc; +//// [index.js] +"use strict"; +exports.__esModule = true; +function check(x) { + switch (x) { + case 0 /* Some */: + break; + } +} diff --git a/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport.symbols b/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport.symbols new file mode 100644 index 00000000000..92a85013834 --- /dev/null +++ b/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/foo.ts === +export const enum ConstFooEnum { +>ConstFooEnum : Symbol(ConstFooEnum, Decl(foo.ts, 0, 0)) + + Some, +>Some : Symbol(ConstFooEnum.Some, Decl(foo.ts, 0, 32)) + + Values, +>Values : Symbol(ConstFooEnum.Values, Decl(foo.ts, 1, 9)) + + Here +>Here : Symbol(ConstFooEnum.Here, Decl(foo.ts, 2, 11)) + +}; +export function fooFunc(): void { /* removed */ } +>fooFunc : Symbol(fooFunc, Decl(foo.ts, 4, 2)) + +=== tests/cases/compiler/index.ts === +import * as Foo from "./foo"; +>Foo : Symbol(Foo, Decl(index.ts, 0, 6)) + +function check(x: Foo.ConstFooEnum): void { +>check : Symbol(check, Decl(index.ts, 0, 29)) +>x : Symbol(x, Decl(index.ts, 2, 15)) +>Foo : Symbol(Foo, Decl(index.ts, 0, 6)) +>ConstFooEnum : Symbol(Foo.ConstFooEnum, Decl(foo.ts, 0, 0)) + + switch (x) { +>x : Symbol(x, Decl(index.ts, 2, 15)) + + case Foo.ConstFooEnum.Some: +>Foo.ConstFooEnum.Some : Symbol(Foo.ConstFooEnum.Some, Decl(foo.ts, 0, 32)) +>Foo.ConstFooEnum : Symbol(Foo.ConstFooEnum, Decl(foo.ts, 0, 0)) +>Foo : Symbol(Foo, Decl(index.ts, 0, 6)) +>ConstFooEnum : Symbol(Foo.ConstFooEnum, Decl(foo.ts, 0, 0)) +>Some : Symbol(Foo.ConstFooEnum.Some, Decl(foo.ts, 0, 32)) + + break; + } +} diff --git a/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport.types b/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport.types new file mode 100644 index 00000000000..ce1410a0911 --- /dev/null +++ b/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport.types @@ -0,0 +1,40 @@ +=== tests/cases/compiler/foo.ts === +export const enum ConstFooEnum { +>ConstFooEnum : ConstFooEnum + + Some, +>Some : ConstFooEnum.Some + + Values, +>Values : ConstFooEnum.Values + + Here +>Here : ConstFooEnum.Here + +}; +export function fooFunc(): void { /* removed */ } +>fooFunc : () => void + +=== tests/cases/compiler/index.ts === +import * as Foo from "./foo"; +>Foo : typeof Foo + +function check(x: Foo.ConstFooEnum): void { +>check : (x: Foo.ConstFooEnum) => void +>x : Foo.ConstFooEnum +>Foo : any +>ConstFooEnum : Foo.ConstFooEnum + + switch (x) { +>x : Foo.ConstFooEnum + + case Foo.ConstFooEnum.Some: +>Foo.ConstFooEnum.Some : Foo.ConstFooEnum.Some +>Foo.ConstFooEnum : typeof Foo.ConstFooEnum +>Foo : typeof Foo +>ConstFooEnum : typeof Foo.ConstFooEnum +>Some : Foo.ConstFooEnum.Some + + break; + } +} diff --git a/tests/baselines/reference/declarationsAndAssignments.errors.txt b/tests/baselines/reference/declarationsAndAssignments.errors.txt index 8f6d44a7c3a..64bd8d7e578 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' has type 'string | 1' at tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts 55:16, 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' has type 'string | 1' at tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts 55:16, 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/decoratorMetadataWithImportDeclarationNameCollision7.errors.txt b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.errors.txt index d4b714f1d4a..9fba625f3ad 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.errors.txt +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/service.ts(7,9): error TS2503: Cannot find namespace 'db'. -tests/cases/compiler/service.ts(9,21): error TS2503: Cannot find namespace 'db'. +tests/cases/compiler/service.ts(7,9): error TS2702: 'db' only refers to a type, but is being used as a namespace here. +tests/cases/compiler/service.ts(9,21): error TS2702: 'db' only refers to a type, but is being used as a namespace here. ==== tests/cases/compiler/db.ts (0 errors) ==== @@ -17,11 +17,11 @@ tests/cases/compiler/service.ts(9,21): error TS2503: Cannot find namespace 'db'. class MyClass { db: db.db; //error ~~ -!!! error TS2503: Cannot find namespace 'db'. +!!! error TS2702: 'db' only refers to a type, but is being used as a namespace here. constructor(db: db.db) { // error ~~ -!!! error TS2503: Cannot find namespace 'db'. +!!! error TS2702: 'db' only refers to a type, but is being used as a namespace here. this.db = db; this.db.doSomething(); } diff --git a/tests/baselines/reference/duplicateClassElements.errors.txt b/tests/baselines/reference/duplicateClassElements.errors.txt index be7e5a7770d..4ac91767768 100644 --- a/tests/baselines/reference/duplicateClassElements.errors.txt +++ b/tests/baselines/reference/duplicateClassElements.errors.txt @@ -16,7 +16,7 @@ tests/cases/compiler/duplicateClassElements.ts(26,9): error TS2300: Duplicate id tests/cases/compiler/duplicateClassElements.ts(29,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(32,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2300: Duplicate identifier 'x2'. -tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2717: Subsequent property declarations must have the same type. Property 'x2' has type 'number' at tests/cases/compiler/duplicateClassElements.ts 28:8, but here has type 'any'. +tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2717: Subsequent property declarations must have the same type. Property 'x2' must be of type 'number', but here has type 'any'. tests/cases/compiler/duplicateClassElements.ts(36,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateClassElements.ts(36,9): error TS2300: Duplicate identifier 'z2'. tests/cases/compiler/duplicateClassElements.ts(39,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -96,7 +96,7 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i ~~ !!! error TS2300: Duplicate identifier 'x2'. ~~ -!!! error TS2717: Subsequent property declarations must have the same type. Property 'x2' has type 'number' at tests/cases/compiler/duplicateClassElements.ts 28:8, but here has type 'any'. +!!! error TS2717: Subsequent property declarations must have the same type. Property 'x2' must be of type 'number', but here has type 'any'. get z2() { ~~ diff --git a/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt b/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt index 3602ca6e301..d8065df27c8 100644 --- a/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt +++ b/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt @@ -4,7 +4,7 @@ tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(6,10): error TS2300: Dup tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(8,9): error TS2300: Duplicate identifier 'w'. tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(12,9): error TS2300: Duplicate identifier 'x'. tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(13,14): error TS2300: Duplicate identifier 'x'. -tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'string' at tests/cases/compiler/duplicateIdentifierInCatchBlock.ts 14:8, but here has type 'number'. +tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'number'. ==== tests/cases/compiler/duplicateIdentifierInCatchBlock.ts (7 errors) ==== @@ -37,5 +37,5 @@ tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Sub var p: string; var p: number; // error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'string' at tests/cases/compiler/duplicateIdentifierInCatchBlock.ts 14:8, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'number'. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLocalVariable1.errors.txt b/tests/baselines/reference/duplicateLocalVariable1.errors.txt index 26e735e72ce..0486cd1af60 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable1.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(1,4): error TS1005: ';' expected. tests/cases/compiler/duplicateLocalVariable1.ts(1,11): error TS1146: Declaration expected. tests/cases/compiler/duplicateLocalVariable1.ts(1,13): error TS2304: Cannot find name 'commonjs'. -tests/cases/compiler/duplicateLocalVariable1.ts(186,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable1.ts 180:21, but here has type 'number'. +tests/cases/compiler/duplicateLocalVariable1.ts(186,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(186,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. tests/cases/compiler/duplicateLocalVariable1.ts(186,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. @@ -200,7 +200,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(186,37): error TS2356: An arithm var bytes = []; for (var i = 0; i < 14; i++) { ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable1.ts 180:21, but here has type 'number'. +!!! 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'. ~ diff --git a/tests/baselines/reference/duplicateLocalVariable2.errors.txt b/tests/baselines/reference/duplicateLocalVariable2.errors.txt index 13b2301d085..5e89cc422cc 100644 --- a/tests/baselines/reference/duplicateLocalVariable2.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable2.ts 21:21, but here has type 'number'. +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,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. @@ -32,7 +32,7 @@ tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithme var bytes = []; for (var i = 0; i < 14; i++) { ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable2.ts 21:21, but here has type 'number'. +!!! 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'. ~ diff --git a/tests/baselines/reference/duplicateLocalVariable3.errors.txt b/tests/baselines/reference/duplicateLocalVariable3.errors.txt index bff7ef43070..5dda5872da0 100644 --- a/tests/baselines/reference/duplicateLocalVariable3.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateLocalVariable3.ts 9:8, but here has type 'string'. +tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'. ==== tests/cases/compiler/duplicateLocalVariable3.ts (1 errors) ==== @@ -14,5 +14,5 @@ tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent var z = 3; var z = ""; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateLocalVariable3.ts 9:8, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLocalVariable4.errors.txt b/tests/baselines/reference/duplicateLocalVariable4.errors.txt index b4b838c3afa..3209c23e39e 100644 --- a/tests/baselines/reference/duplicateLocalVariable4.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/duplicateLocalVariable4.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'typeof E' at tests/cases/compiler/duplicateLocalVariable4.ts 4:4, but here has type 'E'. +tests/cases/compiler/duplicateLocalVariable4.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'. ==== tests/cases/compiler/duplicateLocalVariable4.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/duplicateLocalVariable4.ts(6,5): error TS2403: Subsequent v var x = E; var x = E.a; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'typeof E' at tests/cases/compiler/duplicateLocalVariable4.ts 4:4, but here has type 'E'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVariablesWithAny.errors.txt b/tests/baselines/reference/duplicateVariablesWithAny.errors.txt index 6959eb85a32..787e118ca37 100644 --- a/tests/baselines/reference/duplicateVariablesWithAny.errors.txt +++ b/tests/baselines/reference/duplicateVariablesWithAny.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/duplicateVariablesWithAny.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 1:4, but here has type 'number'. -tests/cases/compiler/duplicateVariablesWithAny.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 4:4, but here has type 'any'. -tests/cases/compiler/duplicateVariablesWithAny.ts(10,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 8:8, but here has type 'number'. -tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 11:8, but here has type 'any'. +tests/cases/compiler/duplicateVariablesWithAny.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. +tests/cases/compiler/duplicateVariablesWithAny.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. +tests/cases/compiler/duplicateVariablesWithAny.ts(10,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. +tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. ==== tests/cases/compiler/duplicateVariablesWithAny.ts (4 errors) ==== @@ -9,23 +9,23 @@ tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequen var x: any; var x = 2; //error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 1:4, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. var y = ""; var y; //error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 4:4, but here has type 'any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. module N { var x: any; var x = 2; //error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 8:8, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. var y = ""; var y; //error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 11:8, but here has type 'any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. } var z: any; diff --git a/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt index 3312b2127b3..d4222483212 100644 --- a/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt +++ b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'boolean'. -tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'string'. -tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 1:4, but here has type 'number'. -tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts 1:4, but here has type 'boolean'. +tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'boolean'. +tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'. +tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'. +tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'. ==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts (0 errors) ==== @@ -11,19 +11,19 @@ tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: ==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts (1 errors) ==== var x = true; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'boolean'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'boolean'. var z = 3; ==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts (3 errors) ==== var x = ""; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'. var y = 3; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 1:4, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'. var z = false; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts 1:4, but here has type 'boolean'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'. ==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_3.ts (0 errors) ==== var x = 0; diff --git a/tests/baselines/reference/dynamicNamesErrors.errors.txt b/tests/baselines/reference/dynamicNamesErrors.errors.txt index 15722ed1a49..d0f1d91a643 100644 --- a/tests/baselines/reference/dynamicNamesErrors.errors.txt +++ b/tests/baselines/reference/dynamicNamesErrors.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/dynamicNamesErrors.ts(5,5): error TS2718: Duplicate declaration '[c0]'. tests/cases/compiler/dynamicNamesErrors.ts(6,5): error TS2718: Duplicate declaration '[c0]'. -tests/cases/compiler/dynamicNamesErrors.ts(19,5): error TS2717: Subsequent property declarations must have the same type. Property '[c1]' has type 'number' at tests/cases/compiler/dynamicNamesErrors.ts 17:4, but here has type 'string'. +tests/cases/compiler/dynamicNamesErrors.ts(19,5): error TS2717: Subsequent property declarations must have the same type. Property '[c1]' must be of type 'number', but here has type 'string'. tests/cases/compiler/dynamicNamesErrors.ts(24,1): error TS2322: Type 'T2' is not assignable to type 'T1'. Types of property '[c0]' are incompatible. Type 'string' is not assignable to type 'number'. @@ -50,7 +50,7 @@ tests/cases/compiler/dynamicNamesErrors.ts(54,14): error TS4025: Exported variab [c0]: number; [c1]: string; ~~~~ -!!! error TS2717: Subsequent property declarations must have the same type. Property '[c1]' has type 'number' at tests/cases/compiler/dynamicNamesErrors.ts 17:4, but here has type 'string'. +!!! error TS2717: Subsequent property declarations must have the same type. Property '[c1]' must be of type 'number', but here has type 'string'. } let t1: T1; diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt b/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt index 3fd0fcaf7ac..e7c1297e1fd 100644 --- a/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(104,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(109,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(104,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(109,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts (2 errors) ==== @@ -108,11 +108,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var r4 = foo16(E.A); ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. declare function foo17(x: {}): {}; declare function foo17(x: E): E; var r4 = foo16(E.A); ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. \ No newline at end of file diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType01.errors.txt b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType01.errors.txt index 0c55ba75f13..58f9f2cc6d4 100644 --- a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType01.errors.txt +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType01.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(6,12): error TS2713: Cannot access 'Foo.bar' because 'Foo' is a type, but not a namespace. Did you mean to retrieve the type of the property 'bar' in 'Foo' with 'Foo["bar"]'? tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(7,18): error TS2694: Namespace 'Test1' has no exported member 'Foo'. -tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(15,12): error TS2503: Cannot find namespace 'Foo'. +tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(15,12): error TS2713: Cannot access 'Foo.bar' because 'Foo' is a type, but not a namespace. Did you mean to retrieve the type of the property 'bar' in 'Foo' with 'Foo["bar"]'? tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(16,18): error TS2694: Namespace 'Test2' has no exported member 'Foo'. tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(24,12): error TS2713: Cannot access 'Foo.bar' because 'Foo' is a type, but not a namespace. Did you mean to retrieve the type of the property 'bar' in 'Foo' with 'Foo["bar"]'? tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(25,18): error TS2694: Namespace 'Test3' has no exported member 'Foo'. @@ -32,8 +32,8 @@ tests/cases/compiler/errorForUsingPropertyOfTypeAsType01.ts(44,24): error TS1003 } var x: Foo.bar = ""; - ~~~ -!!! error TS2503: Cannot find namespace 'Foo'. + ~~~~~~~ +!!! error TS2713: Cannot access 'Foo.bar' because 'Foo' is a type, but not a namespace. Did you mean to retrieve the type of the property 'bar' in 'Foo' with 'Foo["bar"]'? var y: Test2.Foo.bar = ""; ~~~ !!! error TS2694: Namespace 'Test2' has no exported member 'Foo'. diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.errors.txt b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.errors.txt new file mode 100644 index 00000000000..53831fb54af --- /dev/null +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts(3,16): error TS2713: Cannot access 'T.abc' because 'T' is a type, but not a namespace. Did you mean to retrieve the type of the property 'abc' in 'T' with 'T["abc"]'? + + +==== tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts (1 errors) ==== + namespace Test1 { + function foo(x: T) { + let a: T.abc = x.abc; + ~~~~~ +!!! error TS2713: Cannot access 'T.abc' because 'T' is a type, but not a namespace. Did you mean to retrieve the type of the property 'abc' in 'T' with 'T["abc"]'? + } + } \ No newline at end of file diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.js b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.js new file mode 100644 index 00000000000..d621a89cbf2 --- /dev/null +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.js @@ -0,0 +1,14 @@ +//// [errorForUsingPropertyOfTypeAsType02.ts] +namespace Test1 { + function foo(x: T) { + let a: T.abc = x.abc; + } +} + +//// [errorForUsingPropertyOfTypeAsType02.js] +var Test1; +(function (Test1) { + function foo(x) { + var a = x.abc; + } +})(Test1 || (Test1 = {})); diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.symbols b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.symbols new file mode 100644 index 00000000000..b96d18c1981 --- /dev/null +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts === +namespace Test1 { +>Test1 : Symbol(Test1, Decl(errorForUsingPropertyOfTypeAsType02.ts, 0, 0)) + + function foo(x: T) { +>foo : Symbol(foo, Decl(errorForUsingPropertyOfTypeAsType02.ts, 0, 17)) +>T : Symbol(T, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 17)) +>abc : Symbol(abc, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 28)) +>x : Symbol(x, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 44)) +>T : Symbol(T, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 17)) + + let a: T.abc = x.abc; +>a : Symbol(a, Decl(errorForUsingPropertyOfTypeAsType02.ts, 2, 11)) +>x.abc : Symbol(abc, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 28)) +>x : Symbol(x, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 44)) +>abc : Symbol(abc, Decl(errorForUsingPropertyOfTypeAsType02.ts, 1, 28)) + } +} diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.types b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.types new file mode 100644 index 00000000000..11097df6cc7 --- /dev/null +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType02.types @@ -0,0 +1,20 @@ +=== tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts === +namespace Test1 { +>Test1 : typeof Test1 + + function foo(x: T) { +>foo : (x: T) => void +>T : T +>abc : number +>x : T +>T : T + + let a: T.abc = x.abc; +>a : any +>T : any +>abc : No type information available! +>x.abc : number +>x : T +>abc : number + } +} diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.errors.txt b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.errors.txt new file mode 100644 index 00000000000..990a7f425ae --- /dev/null +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.errors.txt @@ -0,0 +1,50 @@ +tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(11,19): error TS2694: Namespace 'Color' has no exported member 'Red'. +tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(13,19): error TS2339: Property 'Red' does not exist on type 'Color'. +tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(19,13): error TS2702: 'C1' only refers to a type, but is being used as a namespace here. +tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(20,13): error TS2702: 'C1' only refers to a type, but is being used as a namespace here. +tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(21,16): error TS2339: Property 'Red' does not exist on type 'Color'. +tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(23,13): error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'? +tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts(24,13): error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'? + + +==== tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts (7 errors) ==== + namespace Test1 { + enum Color { + Red, + Green, + Blue + } + + type C1 = Color; + type C2 = typeof Color; + + let a1: Color.Red.toString; + ~~~ +!!! error TS2694: Namespace 'Color' has no exported member 'Red'. + let a2: Color.Red["toString"]; + let a3: Color["Red"]["toString"]; + ~~~~~ +!!! error TS2339: Property 'Red' does not exist on type 'Color'. + + //let b1: (typeof Color).Red.toString; + //let b2: (typeof Color).Red["toString"]; + let b3: (typeof Color)["Red"]["toString"]; + + let c1: C1.Red.toString; + ~~ +!!! error TS2702: 'C1' only refers to a type, but is being used as a namespace here. + let c2: C1.Red["toString"]; + ~~ +!!! error TS2702: 'C1' only refers to a type, but is being used as a namespace here. + let c3: C1["Red"]["toString"]; + ~~~~~ +!!! error TS2339: Property 'Red' does not exist on type 'Color'. + + let d1: C2.Red.toString; + ~~~~~~ +!!! error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'? + let d2: C2.Red["toString"]; + ~~~~~~ +!!! error TS2713: Cannot access 'C2.Red' because 'C2' is a type, but not a namespace. Did you mean to retrieve the type of the property 'Red' in 'C2' with 'C2["Red"]'? + let d3: C2["Red"]["toString"]; + } \ No newline at end of file diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.js b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.js new file mode 100644 index 00000000000..d4335630860 --- /dev/null +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.js @@ -0,0 +1,50 @@ +//// [errorForUsingPropertyOfTypeAsType03.ts] +namespace Test1 { + enum Color { + Red, + Green, + Blue + } + + type C1 = Color; + type C2 = typeof Color; + + let a1: Color.Red.toString; + let a2: Color.Red["toString"]; + let a3: Color["Red"]["toString"]; + + //let b1: (typeof Color).Red.toString; + //let b2: (typeof Color).Red["toString"]; + let b3: (typeof Color)["Red"]["toString"]; + + let c1: C1.Red.toString; + let c2: C1.Red["toString"]; + let c3: C1["Red"]["toString"]; + + let d1: C2.Red.toString; + let d2: C2.Red["toString"]; + let d3: C2["Red"]["toString"]; +} + +//// [errorForUsingPropertyOfTypeAsType03.js] +var Test1; +(function (Test1) { + var Color; + (function (Color) { + Color[Color["Red"] = 0] = "Red"; + Color[Color["Green"] = 1] = "Green"; + Color[Color["Blue"] = 2] = "Blue"; + })(Color || (Color = {})); + var a1; + var a2; + var a3; + //let b1: (typeof Color).Red.toString; + //let b2: (typeof Color).Red["toString"]; + var b3; + var c1; + var c2; + var c3; + var d1; + var d2; + var d3; +})(Test1 || (Test1 = {})); diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.symbols b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.symbols new file mode 100644 index 00000000000..80d0a34fd9c --- /dev/null +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts === +namespace Test1 { +>Test1 : Symbol(Test1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 0)) + + enum Color { +>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17)) + + Red, +>Red : Symbol(Color.Red, Decl(errorForUsingPropertyOfTypeAsType03.ts, 1, 16)) + + Green, +>Green : Symbol(Color.Green, Decl(errorForUsingPropertyOfTypeAsType03.ts, 2, 12)) + + Blue +>Blue : Symbol(Color.Blue, Decl(errorForUsingPropertyOfTypeAsType03.ts, 3, 14)) + } + + type C1 = Color; +>C1 : Symbol(C1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 5, 5)) +>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17)) + + type C2 = typeof Color; +>C2 : Symbol(C2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 7, 20)) +>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17)) + + let a1: Color.Red.toString; +>a1 : Symbol(a1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 10, 7)) +>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17)) + + let a2: Color.Red["toString"]; +>a2 : Symbol(a2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 11, 7)) +>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17)) +>Red : Symbol(Color.Red, Decl(errorForUsingPropertyOfTypeAsType03.ts, 1, 16)) + + let a3: Color["Red"]["toString"]; +>a3 : Symbol(a3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 12, 7)) +>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17)) + + //let b1: (typeof Color).Red.toString; + //let b2: (typeof Color).Red["toString"]; + let b3: (typeof Color)["Red"]["toString"]; +>b3 : Symbol(b3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 16, 7)) +>Color : Symbol(Color, Decl(errorForUsingPropertyOfTypeAsType03.ts, 0, 17)) + + let c1: C1.Red.toString; +>c1 : Symbol(c1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 18, 7)) + + let c2: C1.Red["toString"]; +>c2 : Symbol(c2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 19, 7)) + + let c3: C1["Red"]["toString"]; +>c3 : Symbol(c3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 20, 7)) +>C1 : Symbol(C1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 5, 5)) + + let d1: C2.Red.toString; +>d1 : Symbol(d1, Decl(errorForUsingPropertyOfTypeAsType03.ts, 22, 7)) + + let d2: C2.Red["toString"]; +>d2 : Symbol(d2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 23, 7)) + + let d3: C2["Red"]["toString"]; +>d3 : Symbol(d3, Decl(errorForUsingPropertyOfTypeAsType03.ts, 24, 7)) +>C2 : Symbol(C2, Decl(errorForUsingPropertyOfTypeAsType03.ts, 7, 20)) +} diff --git a/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.types b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.types new file mode 100644 index 00000000000..8d6dbf3d4b5 --- /dev/null +++ b/tests/baselines/reference/errorForUsingPropertyOfTypeAsType03.types @@ -0,0 +1,76 @@ +=== tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts === +namespace Test1 { +>Test1 : typeof Test1 + + enum Color { +>Color : Color + + Red, +>Red : Color.Red + + Green, +>Green : Color.Green + + Blue +>Blue : Color.Blue + } + + type C1 = Color; +>C1 : Color +>Color : Color + + type C2 = typeof Color; +>C2 : typeof Color +>Color : typeof Color + + let a1: Color.Red.toString; +>a1 : any +>Color : any +>Red : any +>toString : No type information available! + + let a2: Color.Red["toString"]; +>a2 : (radix?: number) => string +>Color : any +>Red : Color.Red + + let a3: Color["Red"]["toString"]; +>a3 : any +>Color : Color + + //let b1: (typeof Color).Red.toString; + //let b2: (typeof Color).Red["toString"]; + let b3: (typeof Color)["Red"]["toString"]; +>b3 : (radix?: number) => string +>Color : typeof Color + + let c1: C1.Red.toString; +>c1 : any +>C1 : any +>Red : any +>toString : No type information available! + + let c2: C1.Red["toString"]; +>c2 : any +>C1 : any +>Red : No type information available! + + let c3: C1["Red"]["toString"]; +>c3 : any +>C1 : Color + + let d1: C2.Red.toString; +>d1 : any +>C2 : any +>Red : any +>toString : No type information available! + + let d2: C2.Red["toString"]; +>d2 : any +>C2 : any +>Red : No type information available! + + let d3: C2["Red"]["toString"]; +>d3 : (radix?: number) => string +>C2 : typeof Color +} diff --git a/tests/baselines/reference/for-inStatements.errors.txt b/tests/baselines/reference/for-inStatements.errors.txt index 60a921a7af5..c5ca29d2150 100644 --- a/tests/baselines/reference/for-inStatements.errors.txt +++ b/tests/baselines/reference/for-inStatements.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(33,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 30:17, but here has type 'keyof this'. -tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(50,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 47:17, but here has type 'keyof this'. +tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(33,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'. +tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(50,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'. tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. @@ -38,7 +38,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15): for (var x in this.biz) { } for (var x in this) { } ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 30:17, but here has type 'keyof this'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'. return null; } @@ -57,7 +57,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15): for (var x in this.biz) { } for (var x in this) { } ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 47:17, but here has type 'keyof this'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'. for (var x in super.biz) { } for (var x in super.biz()) { } diff --git a/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt b/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt index 0625460f6f4..a47ea077d95 100644 --- a/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt +++ b/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt @@ -2,8 +2,8 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors. tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(5,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(6,9): error TS2365: Operator '===' cannot be applied to types 'string' and 'number'. tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(8,16): error TS2339: Property 'unknownProperty' does not exist on type 'string'. -tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(12,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'number' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 10:4, but here has type 'string'. -tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(16,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type 'any' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 14:4, but here has type 'string'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(12,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'string'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(16,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type 'any', but here has type 'string'. ==== tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts (6 errors) ==== @@ -28,12 +28,12 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors. var i: number; for (var i in a ) { ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'number' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 10:4, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'string'. } var j: any; for (var j in a ) { ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type 'any' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 14:4, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type 'any', but here has type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/for-inStatementsInvalid.errors.txt b/tests/baselines/reference/for-inStatementsInvalid.errors.txt index 87d4f5582da..f98349973a3 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.errors.txt +++ b/tests/baselines/reference/for-inStatementsInvalid.errors.txt @@ -9,10 +9,10 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(1 tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(20,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(22,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(29,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. -tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(31,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 28:17, but here has type 'keyof this'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(31,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(38,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(46,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. -tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(48,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 45:17, but here has type 'keyof this'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(48,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(51,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(62,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. @@ -72,7 +72,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(6 for (var x in this.biz) { } for (var x in this) { } ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 28:17, but here has type 'keyof this'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'. return null; } @@ -95,7 +95,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(6 for (var x in this.biz) { } for (var x in this) { } ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 45:17, but here has type 'keyof this'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'. for (var x in super.biz) { } for (var x in super.biz()) { } diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt index e1175477f5d..53ecb88363d 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(32,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'number'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(33,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'string'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(34,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'C'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(35,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'D'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(36,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'typeof M'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(39,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(40,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C2'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(43,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 41:8, but here has type '(x: number) => string'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(46,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type 'number[]'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(47,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type '(C | D)[]'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(50,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 48:8, but here has type 'D[]'. -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(53,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 51:8, but here has type 'typeof A'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(32,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(33,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(34,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(35,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(36,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(39,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(40,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(43,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(46,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(47,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D)[]'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(50,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(53,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. ==== tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts (12 errors) ==== @@ -46,47 +46,47 @@ tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDec for( var a: any;;){} for( var a = 1;;){} ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. for( var a = 'a string';;){} ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. for( var a = new C();;){} ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. for( var a = new D();;){} ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'D'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. for( var a = M;;){} ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'typeof M'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. for( var b: I;;){} for( var b = new C();;){} ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. for( var b = new C2();;){} ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C2'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. for(var f = F;;){} for( var f = (x: number) => '';;){} ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 41:8, but here has type '(x: number) => string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. for(var arr: string[];;){} for( var arr = [1, 2, 3, 4];;){} ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type 'number[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. for( var arr = [new C(), new C2(), new D()];;){} ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type '(C | D)[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D)[]'. for(var arr2 = [new D()];;){} for( var arr2 = new Array>();;){} ~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 48:8, but here has type 'D[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. for(var m: typeof M;;){} for( var m = M.A;;){} ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 51:8, but here has type 'typeof A'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/functionArgShadowing.errors.txt b/tests/baselines/reference/functionArgShadowing.errors.txt index e85a5255e43..93022178452 100644 --- a/tests/baselines/reference/functionArgShadowing.errors.txt +++ b/tests/baselines/reference/functionArgShadowing.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/functionArgShadowing.ts(4,8): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'A' at tests/cases/compiler/functionArgShadowing.ts 2:13, but here has type 'B'. +tests/cases/compiler/functionArgShadowing.ts(4,8): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'A', but here has type 'B'. tests/cases/compiler/functionArgShadowing.ts(5,8): error TS2339: Property 'bar' does not exist on type 'A'. -tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'number' at tests/cases/compiler/functionArgShadowing.ts 8:20, but here has type 'string'. +tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'number', but here has type 'string'. ==== tests/cases/compiler/functionArgShadowing.ts (3 errors) ==== @@ -9,7 +9,7 @@ tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent var function foo(x: A) { var x: B = new B(); ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'A' at tests/cases/compiler/functionArgShadowing.ts 2:13, but here has type 'B'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'A', but here has type 'B'. x.bar(); // the property bar does not exist on a value of type A ~~~ !!! error TS2339: Property 'bar' does not exist on type 'A'. @@ -19,7 +19,7 @@ tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent var constructor(public p: number) { var p: string; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'number' at tests/cases/compiler/functionArgShadowing.ts 8:20, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'number', but here has type 'string'. var n: number = p; } diff --git a/tests/baselines/reference/generatorNoImplicitReturns.js b/tests/baselines/reference/generatorNoImplicitReturns.js new file mode 100644 index 00000000000..d43e801ba99 --- /dev/null +++ b/tests/baselines/reference/generatorNoImplicitReturns.js @@ -0,0 +1,17 @@ +//// [generatorNoImplicitReturns.ts] + +function* testGenerator () { + if (Math.random() > 0.5) { + return; + } + yield 'hello'; +} + + +//// [generatorNoImplicitReturns.js] +function* testGenerator() { + if (Math.random() > 0.5) { + return; + } + yield 'hello'; +} diff --git a/tests/baselines/reference/generatorNoImplicitReturns.symbols b/tests/baselines/reference/generatorNoImplicitReturns.symbols new file mode 100644 index 00000000000..d1d9961ae68 --- /dev/null +++ b/tests/baselines/reference/generatorNoImplicitReturns.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorNoImplicitReturns.ts === + +function* testGenerator () { +>testGenerator : Symbol(testGenerator, Decl(generatorNoImplicitReturns.ts, 0, 0)) + + if (Math.random() > 0.5) { +>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) + + return; + } + yield 'hello'; +} + diff --git a/tests/baselines/reference/generatorNoImplicitReturns.types b/tests/baselines/reference/generatorNoImplicitReturns.types new file mode 100644 index 00000000000..666ce4db474 --- /dev/null +++ b/tests/baselines/reference/generatorNoImplicitReturns.types @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorNoImplicitReturns.ts === + +function* testGenerator () { +>testGenerator : () => IterableIterator + + if (Math.random() > 0.5) { +>Math.random() > 0.5 : boolean +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number +>0.5 : 0.5 + + return; + } + yield 'hello'; +>yield 'hello' : any +>'hello' : "hello" +} + diff --git a/tests/baselines/reference/gettersAndSettersErrors.errors.txt b/tests/baselines/reference/gettersAndSettersErrors.errors.txt index 594c9d0bf62..e2a4bb3a146 100644 --- a/tests/baselines/reference/gettersAndSettersErrors.errors.txt +++ b/tests/baselines/reference/gettersAndSettersErrors.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2300: Duplicate identifier 'Foo'. -tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2717: Subsequent property declarations must have the same type. Property 'Foo' has type 'string' at tests/cases/compiler/gettersAndSettersErrors.ts 1:15, but here has type 'number'. +tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2717: Subsequent property declarations must have the same type. Property 'Foo' must be of type 'string', but here has type 'number'. tests/cases/compiler/gettersAndSettersErrors.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/gettersAndSettersErrors.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -23,7 +23,7 @@ tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS2379: Getter and ~~~ !!! error TS2300: Duplicate identifier 'Foo'. ~~~ -!!! error TS2717: Subsequent property declarations must have the same type. Property 'Foo' has type 'string' at tests/cases/compiler/gettersAndSettersErrors.ts 1:15, but here has type 'number'. +!!! error TS2717: Subsequent property declarations must have the same type. Property 'Foo' must be of type 'string', but here has type 'number'. public get Goo(v:string):string {return null;} // error - getters must not have a parameter ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt b/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt index bce8f57b442..60239280226 100644 --- a/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt +++ b/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' has type '(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 3:4, but here has type '(x: any, y: any) => any'. -tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' has type '(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 6:4, but here has type '(x: any, y: any) => any'. -tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type '(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 9:4, but here has type '(x: any, y: string) => any'. -tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type '(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 12:4, but here has type '(x: any, y: any) => string'. +tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. +tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. +tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: string) => any'. +tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => string'. ==== tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts (4 errors) ==== @@ -11,19 +11,19 @@ tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): err var g: (x: T, y: U) => T; var g: (x: any, y: any) => any; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'g' has type '(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 3:4, but here has type '(x: any, y: any) => any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. var h: (x: T, y: U) => T; var h: (x: any, y: any) => any; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'h' has type '(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 6:4, but here has type '(x: any, y: any) => any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. var i: (x: T, y: U) => T; var i: (x: any, y: string) => any; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type '(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 9:4, but here has type '(x: any, y: string) => any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: string) => any'. var j: (x: T, y: U) => T; var j: (x: any, y: any) => string; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type '(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 12:4, but here has type '(x: any, y: any) => string'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/instanceofWithPrimitiveUnion.errors.txt b/tests/baselines/reference/instanceofWithPrimitiveUnion.errors.txt new file mode 100644 index 00000000000..0172b89feca --- /dev/null +++ b/tests/baselines/reference/instanceofWithPrimitiveUnion.errors.txt @@ -0,0 +1,21 @@ +tests/cases/compiler/instanceofWithPrimitiveUnion.ts(2,9): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/compiler/instanceofWithPrimitiveUnion.ts(8,9): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + + +==== tests/cases/compiler/instanceofWithPrimitiveUnion.ts (2 errors) ==== + function test1(x: number | string) { + if (x instanceof Object) { + ~ +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + x; + } + } + + function test2(x: (number | string) | number) { + if (x instanceof Object) { + ~ +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + x; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/instanceofWithPrimitiveUnion.js b/tests/baselines/reference/instanceofWithPrimitiveUnion.js new file mode 100644 index 00000000000..5510f893f18 --- /dev/null +++ b/tests/baselines/reference/instanceofWithPrimitiveUnion.js @@ -0,0 +1,25 @@ +//// [instanceofWithPrimitiveUnion.ts] +function test1(x: number | string) { + if (x instanceof Object) { + x; + } +} + +function test2(x: (number | string) | number) { + if (x instanceof Object) { + x; + } +} + + +//// [instanceofWithPrimitiveUnion.js] +function test1(x) { + if (x instanceof Object) { + x; + } +} +function test2(x) { + if (x instanceof Object) { + x; + } +} diff --git a/tests/baselines/reference/instanceofWithPrimitiveUnion.symbols b/tests/baselines/reference/instanceofWithPrimitiveUnion.symbols new file mode 100644 index 00000000000..f9ad5ac943c --- /dev/null +++ b/tests/baselines/reference/instanceofWithPrimitiveUnion.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/instanceofWithPrimitiveUnion.ts === +function test1(x: number | string) { +>test1 : Symbol(test1, Decl(instanceofWithPrimitiveUnion.ts, 0, 0)) +>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 0, 15)) + + if (x instanceof Object) { +>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 0, 15)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + x; +>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 0, 15)) + } +} + +function test2(x: (number | string) | number) { +>test2 : Symbol(test2, Decl(instanceofWithPrimitiveUnion.ts, 4, 1)) +>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 6, 15)) + + if (x instanceof Object) { +>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 6, 15)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + x; +>x : Symbol(x, Decl(instanceofWithPrimitiveUnion.ts, 6, 15)) + } +} + diff --git a/tests/baselines/reference/instanceofWithPrimitiveUnion.types b/tests/baselines/reference/instanceofWithPrimitiveUnion.types new file mode 100644 index 00000000000..fcaba05b51f --- /dev/null +++ b/tests/baselines/reference/instanceofWithPrimitiveUnion.types @@ -0,0 +1,29 @@ +=== tests/cases/compiler/instanceofWithPrimitiveUnion.ts === +function test1(x: number | string) { +>test1 : (x: string | number) => void +>x : string | number + + if (x instanceof Object) { +>x instanceof Object : boolean +>x : string | number +>Object : ObjectConstructor + + x; +>x : string | number + } +} + +function test2(x: (number | string) | number) { +>test2 : (x: string | number) => void +>x : string | number + + if (x instanceof Object) { +>x instanceof Object : boolean +>x : string | number +>Object : ObjectConstructor + + x; +>x : string | number + } +} + diff --git a/tests/baselines/reference/interfaceDeclaration1.errors.txt b/tests/baselines/reference/interfaceDeclaration1.errors.txt index 86e4647edde..5a6b07fd0d6 100644 --- a/tests/baselines/reference/interfaceDeclaration1.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration1.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(2,5): error TS2300: Duplicate iden tests/cases/compiler/interfaceDeclaration1.ts(3,5): error TS2300: Duplicate identifier 'item'. tests/cases/compiler/interfaceDeclaration1.ts(7,5): error TS2300: Duplicate identifier 'item'. tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2300: Duplicate identifier 'item'. -tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2717: Subsequent property declarations must have the same type. Property 'item' has type 'any' at tests/cases/compiler/interfaceDeclaration1.ts 6:4, but here has type 'number'. +tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2717: Subsequent property declarations must have the same type. Property 'item' must be of type 'any', but here has type 'number'. tests/cases/compiler/interfaceDeclaration1.ts(22,11): error TS2310: Type 'I5' recursively references itself as a base type. tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2420: Class 'C1' incorrectly implements interface 'I3'. Property 'prototype' is missing in type 'C1'. @@ -29,7 +29,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i ~~~~ !!! error TS2300: Duplicate identifier 'item'. ~~~~ -!!! error TS2717: Subsequent property declarations must have the same type. Property 'item' has type 'any' at tests/cases/compiler/interfaceDeclaration1.ts 6:4, but here has type 'number'. +!!! error TS2717: Subsequent property declarations must have the same type. Property 'item' must be of type 'any', but here has type 'number'. } interface I3 { diff --git a/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt b/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt index c69cc85ad9d..570b41f499d 100644 --- a/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt +++ b/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(5,12): error TS2503: Cannot find namespace 'V'. -tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(11,12): error TS2503: Cannot find namespace 'C'. +tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(11,12): error TS2702: 'C' only refers to a type, but is being used as a namespace here. tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(23,12): error TS2702: 'I' only refers to a type, but is being used as a namespace here. @@ -18,7 +18,7 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde import c = C; ~ -!!! error TS2503: Cannot find namespace 'C'. +!!! error TS2702: 'C' only refers to a type, but is being used as a namespace here. enum E { Red, Blue diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt b/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt index 79c958e0ca6..3ec718f3b25 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'number'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'string'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(34,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'C'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(35,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'D'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'typeof M'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(40,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C2'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 41:4, but here has type '(x: number) => string'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(46,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type 'number[]'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(47,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type '(C | D)[]'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(50,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 48:4, but here has type 'D[]'. -tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(53,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 51:4, but here has type 'typeof A'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(34,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(35,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(40,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(46,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(47,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D)[]'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(50,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(53,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. ==== tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts (12 errors) ==== @@ -46,47 +46,47 @@ tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDec var a: any; var a = 1; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. var a = 'a string'; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. var a = new C(); ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. var a = new D(); ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'D'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. var a = M; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'typeof M'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. var b: I; var b = new C(); ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. var b = new C2(); ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C2'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. var f = F; var f = (x: number) => ''; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 41:4, but here has type '(x: number) => string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. var arr: string[]; var arr = [1, 2, 3, 4]; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type 'number[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. var arr = [new C(), new C2(), new D()]; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type '(C | D)[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D)[]'. var arr2 = [new D()]; var arr2 = new Array>(); ~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 48:4, but here has type 'D[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. var m: typeof M; var m = M.A; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 51:4, but here has type 'typeof A'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt index 02e32a647f4..f1374d95767 100644 --- a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt @@ -1,5 +1,5 @@ error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. -tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/compiler/b.js 0:4, but here has type 'number'. +tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'. !!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. @@ -9,4 +9,4 @@ tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations m ==== tests/cases/compiler/a.ts (1 errors) ==== var x = 10; // Error reported so no declaration file generated? ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/compiler/b.js 0:4, but here has type 'number'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt index 8af8f5033ba..53541851b4a 100644 --- a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt +++ b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt @@ -1,76 +1,92 @@ -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(3,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(3,3): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(3,4): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(4,3): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,1): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,2): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,3): error TS2304: Cannot find name 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,6): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,7): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,1): error TS2695: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,6): error TS1005: '{' expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,6): error TS2304: Cannot find name 'd'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,9): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,10): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(7,1): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(8,4): error TS17002: Expected corresponding JSX closing tag for 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(9,13): error TS1002: Unterminated string literal. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(10,1): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(10,6): error TS17002: Expected corresponding JSX closing tag for 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(10,10): error TS2657: JSX expressions must have one parent element. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,3): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,5): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,11): error TS1005: '>' expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,12): error TS2304: Cannot find name 'b'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,16): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,2): error TS2304: Cannot find name 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,5): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,10): error TS2304: Cannot find name 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,13): error TS1005: '>' expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,14): error TS2304: Cannot find name 'c'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,16): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(13,2): error TS2304: Cannot find name 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(13,8): error TS17002: Expected corresponding JSX closing tag for 'a.b.c'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,1): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,2): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,5): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,7): error TS1128: Declaration or statement expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,8): error TS2304: Cannot find name 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,10): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,2): error TS2304: Cannot find name 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,4): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,7): error TS2304: Cannot find name 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,9): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,3): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,4): error TS2304: Cannot find name 'foo'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,9): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,11): error TS2304: Cannot find name 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,13): error TS2304: Cannot find name 'foo'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,18): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,3): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,11): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,13): error TS2304: Cannot find name 'a'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(17,22): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(18,2): error TS17008: JSX element 'a' has no corresponding closing tag. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(19,2): error TS17008: JSX element 'a' has no corresponding closing tag. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(22,10): error TS1005: '}' expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(23,20): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(24,15): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(25,7): error TS1005: '...' expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(25,7): error TS2304: Cannot find name 'props'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(27,17): error TS1005: '>' expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(28,10): error TS2304: Cannot find name 'props'. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(28,28): error TS1005: '>' expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(32,2): error TS17008: JSX element 'a' has no corresponding closing tag. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(32,6): error TS1005: '{' expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,2): error TS17008: JSX element 'a' has no corresponding closing tag. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,6): error TS1005: '{' expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(33,7): error TS1109: Expression expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,4): error TS1003: Identifier expected. -tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: '' expected. +tests/cases/conformance/jsx/10.tsx(1,14): error TS2304: Cannot find name 'c'. +tests/cases/conformance/jsx/10.tsx(1,16): error TS1109: Expression expected. +tests/cases/conformance/jsx/11.tsx(1,2): error TS2304: Cannot find name 'a'. +tests/cases/conformance/jsx/11.tsx(1,8): error TS17002: Expected corresponding JSX closing tag for 'a.b.c'. +tests/cases/conformance/jsx/12.tsx(1,1): error TS1109: Expression expected. +tests/cases/conformance/jsx/12.tsx(1,2): error TS1109: Expression expected. +tests/cases/conformance/jsx/12.tsx(1,5): error TS1109: Expression expected. +tests/cases/conformance/jsx/12.tsx(1,7): error TS1128: Declaration or statement expected. +tests/cases/conformance/jsx/12.tsx(1,8): error TS2304: Cannot find name 'a'. +tests/cases/conformance/jsx/12.tsx(1,10): error TS1109: Expression expected. +tests/cases/conformance/jsx/13.tsx(1,2): error TS2304: Cannot find name 'a'. +tests/cases/conformance/jsx/13.tsx(1,4): error TS1003: Identifier expected. +tests/cases/conformance/jsx/13.tsx(1,7): error TS2304: Cannot find name 'a'. +tests/cases/conformance/jsx/13.tsx(1,9): error TS1003: Identifier expected. +tests/cases/conformance/jsx/14.tsx(1,3): error TS1003: Identifier expected. +tests/cases/conformance/jsx/14.tsx(1,4): error TS2304: Cannot find name 'foo'. +tests/cases/conformance/jsx/14.tsx(1,9): error TS1109: Expression expected. +tests/cases/conformance/jsx/14.tsx(1,11): error TS2304: Cannot find name 'a'. +tests/cases/conformance/jsx/14.tsx(1,13): error TS2304: Cannot find name 'foo'. +tests/cases/conformance/jsx/14.tsx(1,18): error TS1109: Expression expected. +tests/cases/conformance/jsx/15.tsx(1,3): error TS1003: Identifier expected. +tests/cases/conformance/jsx/15.tsx(1,11): error TS1109: Expression expected. +tests/cases/conformance/jsx/15.tsx(1,13): error TS2304: Cannot find name 'a'. +tests/cases/conformance/jsx/15.tsx(1,22): error TS1109: Expression expected. +tests/cases/conformance/jsx/16.tsx(1,2): error TS17008: JSX element 'a' has no corresponding closing tag. +tests/cases/conformance/jsx/16.tsx(1,10): error TS1005: '' expected. +tests/cases/conformance/jsx/24.tsx(1,18): error TS1128: Declaration or statement expected. +tests/cases/conformance/jsx/24.tsx(1,21): error TS2304: Cannot find name 'props'. +tests/cases/conformance/jsx/24.tsx(1,27): error TS1109: Expression expected. +tests/cases/conformance/jsx/24.tsx(1,28): error TS1109: Expression expected. +tests/cases/conformance/jsx/25.tsx(1,10): error TS2304: Cannot find name 'props'. +tests/cases/conformance/jsx/25.tsx(1,28): error TS1005: '>' expected. +tests/cases/conformance/jsx/25.tsx(1,29): error TS1128: Declaration or statement expected. +tests/cases/conformance/jsx/25.tsx(1,32): error TS2304: Cannot find name 'props'. +tests/cases/conformance/jsx/25.tsx(1,38): error TS1109: Expression expected. +tests/cases/conformance/jsx/25.tsx(1,39): error TS1109: Expression expected. +tests/cases/conformance/jsx/28.tsx(1,2): error TS17008: JSX element 'a' has no corresponding closing tag. +tests/cases/conformance/jsx/28.tsx(1,6): error TS1005: '{' expected. +tests/cases/conformance/jsx/28.tsx(2,1): error TS1005: '' expected. +tests/cases/conformance/jsx/9.tsx(1,12): error TS2304: Cannot find name 'b'. +tests/cases/conformance/jsx/9.tsx(1,16): error TS1109: Expression expected. -==== tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx (70 errors) ==== +==== tests/cases/conformance/jsx/1.tsx (3 errors) ==== declare var React: any; ; @@ -80,9 +96,11 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: !!! error TS1109: Expression expected. ~ !!! error TS1109: Expression expected. +==== tests/cases/conformance/jsx/2.tsx (1 errors) ==== ; ~ !!! error TS1003: Identifier expected. +==== tests/cases/conformance/jsx/3.tsx (5 errors) ==== <:a />; ~ !!! error TS1109: Expression expected. @@ -94,9 +112,8 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: !!! error TS1109: Expression expected. ~ !!! error TS1109: Expression expected. +==== tests/cases/conformance/jsx/4.tsx (5 errors) ==== ; - ~~~~~~~~~~ -!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: '{' expected. ~ @@ -105,22 +122,29 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: !!! error TS1109: Expression expected. ~ !!! error TS1109: Expression expected. + +!!! error TS1005: '/' expected. +==== tests/cases/conformance/jsx/5.tsx (2 errors) ==== ; - ~ -!!! error TS1003: Identifier expected. + ~ +!!! error TS17008: JSX element 'a' has no corresponding closing tag. + +!!! error TS1005: '; ~~~~ !!! error TS17002: Expected corresponding JSX closing tag for 'a'. +==== tests/cases/conformance/jsx/7.tsx (1 errors) ==== ; ~ !!! error TS1005: '}' expected. +==== tests/cases/conformance/jsx/21.tsx (1 errors) ==== ; ~ !!! error TS1003: Identifier expected. +==== tests/cases/conformance/jsx/22.tsx (2 errors) ====
; ~~~~~ !!! error TS1003: Identifier expected. + ~ +!!! error TS1109: Expression expected. +==== tests/cases/conformance/jsx/23.tsx (2 errors) ====
; ~~~~~ !!! error TS1005: '...' expected. ~~~~~ !!! error TS2304: Cannot find name 'props'. +==== tests/cases/conformance/jsx/24.tsx (5 errors) ====
stuff
; ~ !!! error TS1005: '>' expected. + ~~~ +!!! error TS1128: Declaration or statement expected. + ~~~~~ +!!! error TS2304: Cannot find name 'props'. + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1109: Expression expected. + +==== tests/cases/conformance/jsx/25.tsx (6 errors) ====
stuff
; ~~~~~ !!! error TS2304: Cannot find name 'props'. ~ !!! error TS1005: '>' expected. + ~~~ +!!! error TS1128: Declaration or statement expected. + ~~~~~ +!!! error TS2304: Cannot find name 'props'. + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1109: Expression expected. + +==== tests/cases/conformance/jsx/26.tsx (0 errors) ====
>; + +==== tests/cases/conformance/jsx/27.tsx (0 errors) ==== >; + +==== tests/cases/conformance/jsx/28.tsx (3 errors) ==== ; ~ !!! error TS17008: JSX element 'a' has no corresponding closing tag. ~ !!! error TS1005: '{' expected. + + +!!! error TS1005: '; ~ !!! error TS17008: JSX element 'a' has no corresponding closing tag. @@ -240,9 +321,13 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: !!! error TS1005: '{' expected. ~ !!! error TS1109: Expression expected. + + +!!! error TS1005: '}; + +==== tests/cases/conformance/jsx/31.tsx (1 errors) ==== ; ~~~ -!!! error TS1003: Identifier expected. - -!!! error TS1005: '; -; -<:a />; -; -; -; -; -; -
; +; +//// [2.tsx] +; +//// [3.tsx] +<:a />; +//// [4.tsx] +; +//// [5.tsx] +; +//// [6.tsx] +; +//// [7.tsx] +; +//// [21.tsx] +; +//// [22.tsx] +
; +//// [23.tsx]
; - + +//// [24.tsx]
stuff
; + +//// [25.tsx]
stuff
; + +//// [26.tsx]
>; + +//// [27.tsx] >; + +//// [28.tsx] ; + +//// [29.tsx] ; + +//// [30.tsx] }; + +//// [31.tsx] ; -//// [jsxInvalidEsprimaTestSuite.jsx] +//// [1.jsx] > ; +//// [2.jsx] ; - < ; +//// [3.jsx] + < ; a / > ; - }/> - , - ; -; -; +//// [8.jsx] +; +//// [9.jsx] ; b.c > ; +//// [10.jsx] ; c > ; +//// [11.jsx] ; - < .a > ; +//// [12.jsx] + < .a > ; a > ; +//// [13.jsx] ; +//// [14.jsx] ; [foo] > ; a[foo] > ; +//// [15.jsx] ; ['foo'] > ; a['foo'] > ; -; -; -var x =
one
two
;; -var x =
one
/* intervening comment */ /* intervening comment */
two
;; -
{"str"}}; - id="b" />; -
>; -
; - -
stuff
...props}>; -
stuff
...props}>; - ->; - >; +//// [16.jsx] +;; +//// [17.jsx] +;; +//// [18.jsx] +var x =
one
,
two
; +; +//// [19.jsx] +var x =
one
/* intervening comment */, /* intervening comment */
two
; +; +//// [20.jsx] +
{"str"}}; +//// [21.jsx] +; +//// [22.jsx] +
; +"app" > ; +//// [23.jsx] +
; +//// [24.jsx] +
stuff
; +{ + props; +} + > ; +//// [25.jsx] +
stuff
; +{ + props; +} + > ; +//// [26.jsx] +>; +//// [27.jsx] + >; +//// [28.jsx] ; +; +//// [29.jsx] ; -}; - /*hai*//*hai*/asdf/>;; +; +//// [30.jsx] +}; +//// [31.jsx] +; diff --git a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.symbols b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.symbols index 35d58dbff95..f2389f2e3e7 100644 --- a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.symbols +++ b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.symbols @@ -1,113 +1,150 @@ -=== tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx === +=== tests/cases/conformance/jsx/1.tsx === declare var React: any; ->React : Symbol(React, Decl(jsxInvalidEsprimaTestSuite.tsx, 0, 11)) +>React : Symbol(React, Decl(1.tsx, 0, 11)) ; +=== tests/cases/conformance/jsx/2.tsx === ; >a : Symbol(unknown) +=== tests/cases/conformance/jsx/3.tsx === <:a />; +No type information for this code.=== tests/cases/conformance/jsx/4.tsx === ; >a : Symbol(unknown) ->b : Symbol(b, Decl(jsxInvalidEsprimaTestSuite.tsx, 5, 2)) +>b : Symbol(b, Decl(4.tsx, 0, 2)) +=== tests/cases/conformance/jsx/5.tsx === ; >a : Symbol(unknown) +=== tests/cases/conformance/jsx/6.tsx === ; >a : Symbol(unknown) >b : Symbol(unknown) +=== tests/cases/conformance/jsx/7.tsx === ; >a : Symbol(unknown) >a : Symbol(unknown) +=== tests/cases/conformance/jsx/21.tsx === ; >span : Symbol(unknown) ->className : Symbol(className, Decl(jsxInvalidEsprimaTestSuite.tsx, 22, 5)) +>className : Symbol(className, Decl(21.tsx, 0, 5)) +>id : Symbol(id, Decl(21.tsx, 0, 20)) +=== tests/cases/conformance/jsx/22.tsx ===
; >div : Symbol(unknown) ->className : Symbol(className, Decl(jsxInvalidEsprimaTestSuite.tsx, 23, 4)) +>className : Symbol(className, Decl(22.tsx, 0, 4)) +=== tests/cases/conformance/jsx/23.tsx ===
; >div : Symbol(unknown) +=== tests/cases/conformance/jsx/24.tsx ===
stuff
; >div : Symbol(unknown) >div : Symbol(unknown) +=== tests/cases/conformance/jsx/25.tsx ===
stuff
; >div : Symbol(unknown) >div : Symbol(unknown) + +=== tests/cases/conformance/jsx/26.tsx ===
>; >a : Symbol(unknown) >a : Symbol(unknown) +=== tests/cases/conformance/jsx/27.tsx === >; >a : Symbol(unknown) >a : Symbol(unknown) +=== tests/cases/conformance/jsx/28.tsx === ; >a : Symbol(unknown) ->b : Symbol(b, Decl(jsxInvalidEsprimaTestSuite.tsx, 31, 2)) +>b : Symbol(b, Decl(28.tsx, 0, 2)) +=== tests/cases/conformance/jsx/29.tsx === ; >a : Symbol(unknown) ->b : Symbol(b, Decl(jsxInvalidEsprimaTestSuite.tsx, 32, 2)) +>b : Symbol(b, Decl(29.tsx, 0, 2)) +=== tests/cases/conformance/jsx/30.tsx === }; >a : Symbol(unknown) >a : Symbol(unknown) +=== tests/cases/conformance/jsx/31.tsx === ; >a : Symbol(unknown) +>asdf : Symbol(asdf, Decl(31.tsx, 0, 6)) diff --git a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.types b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.types index f20391339c4..0791b6d9e85 100644 --- a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.types +++ b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.types @@ -1,4 +1,4 @@ -=== tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx === +=== tests/cases/conformance/jsx/1.tsx === declare var React: any; >React : any @@ -7,10 +7,12 @@ declare var React: any; > : any > : any +=== tests/cases/conformance/jsx/2.tsx === ; > : any >a : any +=== tests/cases/conformance/jsx/3.tsx === <:a />; >< : boolean > : any @@ -21,8 +23,8 @@ declare var React: any; > : any > : any +=== tests/cases/conformance/jsx/4.tsx === ; ->;;; : any +>; : any >a : any +> : any +=== tests/cases/conformance/jsx/6.tsx === ; > : any >a : any >b : any +=== tests/cases/conformance/jsx/7.tsx === : any +=== tests/cases/conformance/jsx/16.tsx === ; ->;;var x =
one
two
;;var x =
one
/* intervening comment */
two
;;
{"str";};;
;
;
stuff
;
stuff
;>; >;;;};; : any +>; : any >a : any > : any >a : any +> : any +=== tests/cases/conformance/jsx/17.tsx === ; ->;var x =
one
two
;;var x =
one
/* intervening comment */
two
;;
{"str";};;
;
;
stuff
;
stuff
;>; >;;;};; : any +>; : any >a : any >b : any +> : any +=== tests/cases/conformance/jsx/18.tsx === var x =
one
two
;; +>x : any +>
one
two
: any >
one
: any >div : any >div : any @@ -149,7 +173,10 @@ var x =
one
two
;; >div : any >div : any +=== tests/cases/conformance/jsx/19.tsx === var x =
one
/* intervening comment */
two
;; +>x : any +>
one
/* intervening comment */
two
: any >
one
: any >div : any >div : any @@ -157,71 +184,97 @@ var x =
one
/* intervening comment */
two
;; >div : any >div : any +=== tests/cases/conformance/jsx/20.tsx ===
{"str";}; >{"str";} : any >a : any >"str" : "str" >a : any +=== tests/cases/conformance/jsx/21.tsx === ; -> : any >span : any >className : string +>id : string +=== tests/cases/conformance/jsx/22.tsx ===
; ->
div : any >className : true +>"app"> : boolean +>"app" : "app" +> : any +=== tests/cases/conformance/jsx/23.tsx ===
; >
: any >div : any >props : any +=== tests/cases/conformance/jsx/24.tsx ===
stuff
; ->
stuff
stuff
div : any >div : any +>props : any +>> : boolean +> : any +> : any +=== tests/cases/conformance/jsx/25.tsx ===
stuff
; ->
stuff
stuff
div : any >props : any >div : any +>props : any +>> : boolean +> : any +> : any + +=== tests/cases/conformance/jsx/26.tsx === >; >> : any >a : any >a : any +=== tests/cases/conformance/jsx/27.tsx === >; > > : any >a : any >a : any +=== tests/cases/conformance/jsx/28.tsx === ; ->;;};; : any +>; : any >a : any >b : any +> : any + +=== tests/cases/conformance/jsx/29.tsx === ; ->;};; : any +>; : any >a : any >b : boolean >< : boolean > : any > : any +> : any + +=== tests/cases/conformance/jsx/30.tsx === }; >} : any >a : any >a : any +=== tests/cases/conformance/jsx/31.tsx === ; -> : any >a : any -> : any -> : any -> : any -> : any +>asdf : true diff --git a/tests/baselines/reference/jsxMultilineAttributeStringValues.js b/tests/baselines/reference/jsxMultilineAttributeStringValues.js new file mode 100644 index 00000000000..5904a08bdc6 --- /dev/null +++ b/tests/baselines/reference/jsxMultilineAttributeStringValues.js @@ -0,0 +1,16 @@ +//// [jsxMultilineAttributeStringValues.tsx] +const a = ; +const b = ; + + +//// [jsxMultilineAttributeStringValues.jsx] +var a = ; +var b = ; diff --git a/tests/baselines/reference/jsxMultilineAttributeStringValues.symbols b/tests/baselines/reference/jsxMultilineAttributeStringValues.symbols new file mode 100644 index 00000000000..e2f1e19edea --- /dev/null +++ b/tests/baselines/reference/jsxMultilineAttributeStringValues.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/jsxMultilineAttributeStringValues.tsx === +const a = ; +>input : Symbol(unknown) + +const b = ; +>input : Symbol(unknown) + diff --git a/tests/baselines/reference/jsxMultilineAttributeStringValues.types b/tests/baselines/reference/jsxMultilineAttributeStringValues.types new file mode 100644 index 00000000000..b9e1b99267f --- /dev/null +++ b/tests/baselines/reference/jsxMultilineAttributeStringValues.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/jsxMultilineAttributeStringValues.tsx === +const a = : any +>input : any +>value : string + + foo: 23 +">; +>input : any + +const b = : any +>input : any +>value : string + +foo: 23 +'>; +>input : any + diff --git a/tests/baselines/reference/jsxMultilineAttributeValuesReact.js b/tests/baselines/reference/jsxMultilineAttributeValuesReact.js new file mode 100644 index 00000000000..25b46a1ff37 --- /dev/null +++ b/tests/baselines/reference/jsxMultilineAttributeValuesReact.js @@ -0,0 +1,17 @@ +//// [jsxMultilineAttributeValuesReact.tsx] +declare var React: any; +const a = ; +const b = ; +const c = ; + + +//// [jsxMultilineAttributeValuesReact.js] +var a = React.createElement("input", { value: "\nfoo: 23\n" }); +var b = React.createElement("input", { value: '\nfoo: 23\n' }); +var c = React.createElement("input", { value: '\nfoo: 23\\n\n' }); diff --git a/tests/baselines/reference/jsxMultilineAttributeValuesReact.symbols b/tests/baselines/reference/jsxMultilineAttributeValuesReact.symbols new file mode 100644 index 00000000000..39252554e16 --- /dev/null +++ b/tests/baselines/reference/jsxMultilineAttributeValuesReact.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/jsxMultilineAttributeValuesReact.tsx === +declare var React: any; +>React : Symbol(React, Decl(jsxMultilineAttributeValuesReact.tsx, 0, 11)) + +const a = ; +>input : Symbol(unknown) + +const b = ; +>input : Symbol(unknown) + +const c = ; +>input : Symbol(unknown) + diff --git a/tests/baselines/reference/jsxMultilineAttributeValuesReact.types b/tests/baselines/reference/jsxMultilineAttributeValuesReact.types new file mode 100644 index 00000000000..2d5dd820b21 --- /dev/null +++ b/tests/baselines/reference/jsxMultilineAttributeValuesReact.types @@ -0,0 +1,34 @@ +=== tests/cases/compiler/jsxMultilineAttributeValuesReact.tsx === +declare var React: any; +>React : any + +const a = : any +>input : any +>value : string + +foo: 23 +">; +>input : any + +const b = : any +>input : any +>value : string + +foo: 23 +'>; +>input : any + +const c = : any +>input : any +>value : string + +foo: 23\n +'>; +>input : any + diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index 396adaadf34..3245f9932f0 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -16,10 +16,10 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(37,24): error TS2344: T Type 'T' is not assignable to type '"visible"'. Type 'string | number' is not assignable to type '"visible"'. Type 'string' is not assignable to type '"visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(59,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ [P in keyof T]?: T[P] | undefined; }'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(60,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]: T[P]; }'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(61,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(66,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 64:8, but here has type '{ [P in keyof T]: T[P][]; }'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(59,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]?: T[P] | undefined; }'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(60,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]: T[P]; }'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(61,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(66,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]: T[P][]; }'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(75,45): error TS2345: Argument of type '{ x: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. Property 'y' is missing in type '{ x: number; }'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(77,59): error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. @@ -138,20 +138,20 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: var x: { [P in keyof T]: T[P] }; var x: { [P in keyof T]?: T[P] }; // Error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ [P in keyof T]?: T[P] | undefined; }'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]?: T[P] | undefined; }'. var x: { readonly [P in keyof T]: T[P] }; // Error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]: T[P]; }'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]: T[P]; }'. var x: { readonly [P in keyof T]?: T[P] }; // Error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'. } function f12() { var x: { [P in keyof T]: T[P] }; var x: { [P in keyof T]: T[P][] }; // Error ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 64:8, but here has type '{ [P in keyof T]: T[P][]; }'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]: T[P][]; }'. } // Check that inferences to mapped types are secondary diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt index 6bfdc149a6d..523cad05465 100644 --- a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'string' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 1:4, but here has type 'number'. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 10:8, but here has type 'number'. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 32:8, but here has type 'number'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'string', but here has type 'number'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. ==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts (3 errors) ==== @@ -11,7 +11,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli interface A { x: number; ~ -!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'string' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 1:4, but here has type 'number'. +!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'string', but here has type 'number'. } module M { @@ -22,7 +22,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli interface A { x: number; // error ~ -!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 10:8, but here has type 'number'. +!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. } } @@ -48,6 +48,6 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli export interface A { x: number; // error ~ -!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 32:8, but here has type 'number'. +!!! error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. } } \ No newline at end of file diff --git a/tests/baselines/reference/missingAndExcessProperties.errors.txt b/tests/baselines/reference/missingAndExcessProperties.errors.txt index c9b0fb8257f..0ee69d9af30 100644 --- a/tests/baselines/reference/missingAndExcessProperties.errors.txt +++ b/tests/baselines/reference/missingAndExcessProperties.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(3,11): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(3,14): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(4,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:10, but here has type 'number'. +tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(4,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(4,18): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(5,11): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(5,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:13, but here has type 'number'. -tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(6,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:10, but here has type 'number'. -tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(6,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:13, but here has type 'number'. +tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(5,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'any', but here has type 'number'. +tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(6,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. +tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(6,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'any', but here has type 'number'. tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(12,8): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(12,11): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(13,18): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. @@ -30,19 +30,19 @@ tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(31,16): !!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. var { x = 1, y } = {}; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:10, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. ~ !!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. var { x, y = 1 } = {}; ~ !!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:13, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'any', but here has type 'number'. var { x = 1, y = 1 } = {}; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:10, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:13, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'any', but here has type 'number'. } // Missing properties diff --git a/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt b/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt index d91d0fea02d..105a1af9efe 100644 --- a/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt +++ b/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt @@ -7,7 +7,7 @@ tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperator tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(8,24): error TS2531: Object is possibly 'null'. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(9,17): error TS2532: Object is possibly 'undefined'. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(9,29): error TS2532: Object is possibly 'undefined'. -tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(12,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'NUMBER' has type 'any' at tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts 3:18, but here has type 'number'. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(12,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'NUMBER' must be of type 'any', but here has type 'number'. tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(12,14): error TS1109: Expression expected. @@ -43,6 +43,6 @@ tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperator // miss operand var NUMBER =-; ~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'NUMBER' has type 'any' at tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts 3:18, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'NUMBER' must be of type 'any', but here has type 'number'. ~ !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt b/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt index 87e491fbd5d..8f0a27e03d9 100644 --- a/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt +++ b/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericString tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(12,5): error TS2300: Duplicate identifier '1'. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(16,5): error TS2300: Duplicate identifier '1'. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2300: Duplicate identifier '1'. -tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2717: Subsequent property declarations must have the same type. Property '1.0' has type 'number' at tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts 15:4, but here has type 'string'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2717: Subsequent property declarations must have the same type. Property '1.0' must be of type 'number', but here has type 'string'. tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(22,5): error TS2300: Duplicate identifier '0'. @@ -36,7 +36,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericString ~~~ !!! error TS2300: Duplicate identifier '1'. ~~~ -!!! error TS2717: Subsequent property declarations must have the same type. Property '1.0' has type 'number' at tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts 15:4, but here has type 'string'. +!!! error TS2717: Subsequent property declarations must have the same type. Property '1.0' must be of type 'number', but here has type 'string'. } var b = { diff --git a/tests/baselines/reference/optionalParamterAndVariableDeclaration2.errors.txt b/tests/baselines/reference/optionalParamterAndVariableDeclaration2.errors.txt index 57dba5ca474..982318d2f25 100644 --- a/tests/baselines/reference/optionalParamterAndVariableDeclaration2.errors.txt +++ b/tests/baselines/reference/optionalParamterAndVariableDeclaration2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts(3,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'options' has type 'number | undefined' at tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts 1:16, but here has type 'number'. +tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts(3,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'options' must be of type 'number | undefined', but here has type 'number'. ==== tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts(3,13): error TS2 constructor(options?: number) { var options = (options || 0); ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'options' has type 'number | undefined' at tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts 1:16, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'options' must be of type 'number | undefined', but here has type 'number'. } } \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index dddc0a0d575..f108f0ea92d 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,5): error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' has type 'A' at tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts 20:4, but here has type 'C'. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. @@ -32,7 +32,7 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS234 var w: A; var w: C; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'w' has type 'A' at tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts 20:4, but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. w({ s: "", n: 0 }).toLowerCase(); ~~~~~ diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index d3ad02929f2..37cea935e66 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -6,7 +6,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): 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 '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' has type 'number' at tests/cases/conformance/expressions/functionCalls/overloadResolution.ts 53:4, but here has 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'. @@ -119,7 +119,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): function fn5() { return undefined; } var n = fn5((n) => n.toFixed()); ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'n' has type 'number' at tests/cases/conformance/expressions/functionCalls/overloadResolution.ts 53:4, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. ~~~~~~~ !!! error TS2339: Property 'toFixed' does not exist on type 'string'. var s = fn5((n) => n.substr(0)); diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 474ee2c60d7..9b09992228e 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -6,7 +6,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors 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 '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' has type 'number' at tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts 57:4, but here has 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'. @@ -128,7 +128,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors var fn5: fn5; var n = new fn5((n) => n.toFixed()); ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'n' has type 'number' at tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts 57:4, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. ~~~~~~~ !!! error TS2339: Property 'toFixed' does not exist on type 'string'. var s = new fn5((n) => n.substr(0)); diff --git a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt index 8194219f555..e2d90538b8c 100644 --- a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt +++ b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(2,10): error TS2304: Cannot find name 'T'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(2,12): error TS2304: Cannot find name 'a'. -tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(4,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '(a: any) => number'. -tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '(a: any, b: any) => number'. -tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '(a?: number, b?: number) => number'. +tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(4,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '() => number', but here has type '(a: any) => number'. +tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '() => number', but here has type '(a: any, b: any) => number'. +tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '() => number', but here has type '(a?: number, b?: number) => number'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(8,10): error TS2304: Cannot find name 'T'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(8,13): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,10): error TS2304: Cannot find name 'T'. @@ -24,13 +24,13 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio var v = (a) => 1; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '(a: any) => number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '() => number', but here has type '(a: any) => number'. var v = (a, b) => 1; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '(a: any, b: any) => number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '() => number', but here has type '(a: any, b: any) => number'. var v = (a = 1, b = 2) => 1; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '(a?: number, b?: number) => number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '() => number', but here has type '(a?: number, b?: number) => number'. var v = (a); ~ diff --git a/tests/baselines/reference/promiseIdentity2.errors.txt b/tests/baselines/reference/promiseIdentity2.errors.txt index 38f426e4341..edfba2f42bc 100644 --- a/tests/baselines/reference/promiseIdentity2.errors.txt +++ b/tests/baselines/reference/promiseIdentity2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/promiseIdentity2.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'IPromise' at tests/cases/compiler/promiseIdentity2.ts 9:4, but here has type 'Promise'. +tests/cases/compiler/promiseIdentity2.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise', but here has type 'Promise'. ==== tests/cases/compiler/promiseIdentity2.ts (1 errors) ==== @@ -14,4 +14,4 @@ tests/cases/compiler/promiseIdentity2.ts(11,5): error TS2403: Subsequent variabl var x: IPromise; var x: Promise; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'IPromise' at tests/cases/compiler/promiseIdentity2.ts 9:4, but here has type 'Promise'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise', but here has type 'Promise'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseIdentityWithAny2.errors.txt b/tests/baselines/reference/promiseIdentityWithAny2.errors.txt index 69c09a91d29..9d01438b88c 100644 --- a/tests/baselines/reference/promiseIdentityWithAny2.errors.txt +++ b/tests/baselines/reference/promiseIdentityWithAny2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/promiseIdentityWithAny2.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'IPromise' at tests/cases/compiler/promiseIdentityWithAny2.ts 8:4, but here has type 'Promise'. -tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'IPromise2' at tests/cases/compiler/promiseIdentityWithAny2.ts 20:4, but here has type 'Promise2'. +tests/cases/compiler/promiseIdentityWithAny2.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise', but here has type 'Promise'. +tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'IPromise2', but here has type 'Promise2'. ==== tests/cases/compiler/promiseIdentityWithAny2.ts (2 errors) ==== @@ -14,7 +14,7 @@ tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent var x: IPromise; var x: Promise; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'IPromise' at tests/cases/compiler/promiseIdentityWithAny2.ts 8:4, but here has type 'Promise'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise', but here has type 'Promise'. interface IPromise2 { @@ -28,4 +28,4 @@ tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent var y: IPromise2; var y: Promise2; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'IPromise2' at tests/cases/compiler/promiseIdentityWithAny2.ts 20:4, but here has type 'Promise2'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'IPromise2', but here has type 'Promise2'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccess.errors.txt b/tests/baselines/reference/propertyAccess.errors.txt index 2ac87bc0e3e..a183ad79c11 100644 --- a/tests/baselines/reference/propertyAccess.errors.txt +++ b/tests/baselines/reference/propertyAccess.errors.txt @@ -4,7 +4,7 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(45,14): err tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(80,19): error TS2538: Type '{ name: string; }' cannot be used as an index type. tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(117,18): error TS2538: Type '{ name: string; }' cannot be used as an index type. tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(140,22): error TS2538: Type '{ name: string; }' cannot be used as an index type. -tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(149,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' has type 'A | B' at tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts 147:4, but here has type 'A'. +tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(149,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'A | B', but here has type 'A'. ==== tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts (6 errors) ==== @@ -169,5 +169,5 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(149,5): err var x3 = bothIndex[stringOrNumber]; var x3: A; ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' has type 'A | B' at tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts 147:4, but here has type 'A'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'A | B', but here has type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt index ad421dbc1f6..4c5644f6b76 100644 --- a/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt +++ b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'Foo' at tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts 3:4, but here has type 'Foo'. -tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'Foo1' at tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts 11:4, but here has type 'Foo2'. +tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'Foo', but here has type 'Foo'. +tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'Foo1', but here has type 'Foo2'. ==== tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts (2 errors) ==== @@ -9,7 +9,7 @@ tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS240 var x: m1.Foo; var x: m2.Foo; // Should be error (mod1.Foo !== mod2.Foo) ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'Foo' at tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts 3:4, but here has type 'Foo'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'Foo', but here has type 'Foo'. class Foo1 { private n; } @@ -19,7 +19,7 @@ tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS240 var y: Foo1; var y: Foo2; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'Foo1' at tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts 11:4, but here has type 'Foo2'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'Foo1', but here has type 'Foo2'. ==== tests/cases/compiler/propertyIdentityWithPrivacyMismatch_0.ts (0 errors) ==== declare module 'mod1' { class Foo { diff --git a/tests/baselines/reference/reassignStaticProp.errors.txt b/tests/baselines/reference/reassignStaticProp.errors.txt index bc54e6a7b35..b1bfb869d68 100644 --- a/tests/baselines/reference/reassignStaticProp.errors.txt +++ b/tests/baselines/reference/reassignStaticProp.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2300: Duplicate identifier 'bar'. -tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2717: Subsequent property declarations must have the same type. Property 'bar' has type 'number' at tests/cases/compiler/reassignStaticProp.ts 2:11, but here has type 'string'. +tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2717: Subsequent property declarations must have the same type. Property 'bar' must be of type 'number', but here has type 'string'. ==== tests/cases/compiler/reassignStaticProp.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2717: Subsequent prope ~~~ !!! error TS2300: Duplicate identifier 'bar'. ~~~ -!!! error TS2717: Subsequent property declarations must have the same type. Property 'bar' has type 'number' at tests/cases/compiler/reassignStaticProp.ts 2:11, but here has type 'string'. +!!! error TS2717: Subsequent property declarations must have the same type. Property 'bar' must be of type 'number', but here has type 'string'. } diff --git a/tests/baselines/reference/spreadUnion2.errors.txt b/tests/baselines/reference/spreadUnion2.errors.txt index f4f81dadf11..0115c449930 100644 --- a/tests/baselines/reference/spreadUnion2.errors.txt +++ b/tests/baselines/reference/spreadUnion2.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/spread/spreadUnion2.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o1' has type '{} | { a: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 3:4, but here has type '{}'. -tests/cases/conformance/types/spread/spreadUnion2.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o2' has type '{} | { b: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 6:4, but here has type '{}'. -tests/cases/conformance/types/spread/spreadUnion2.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' has type '{} | { a: number; } | { b: number; } | { a: number; b: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 9:4, but here has type '{}'. -tests/cases/conformance/types/spread/spreadUnion2.ts(12,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' has type '{} | { a: number; } | { b: number; } | { a: number; b: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 9:4, but here has type '{}'. -tests/cases/conformance/types/spread/spreadUnion2.ts(15,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o4' has type '{} | { a: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 13:4, but here has type '{}'. -tests/cases/conformance/types/spread/spreadUnion2.ts(18,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o5' has type '{} | { b: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 16:4, but here has type '{}'. +tests/cases/conformance/types/spread/spreadUnion2.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o1' must be of type '{} | { a: number; }', but here has type '{}'. +tests/cases/conformance/types/spread/spreadUnion2.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o2' must be of type '{} | { b: number; }', but here has type '{}'. +tests/cases/conformance/types/spread/spreadUnion2.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' must be of type '{} | { a: number; } | { b: number; } | { a: number; b: number; }', but here has type '{}'. +tests/cases/conformance/types/spread/spreadUnion2.ts(12,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' must be of type '{} | { a: number; } | { b: number; } | { a: number; b: number; }', but here has type '{}'. +tests/cases/conformance/types/spread/spreadUnion2.ts(15,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o4' must be of type '{} | { a: number; }', but here has type '{}'. +tests/cases/conformance/types/spread/spreadUnion2.ts(18,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'o5' must be of type '{} | { b: number; }', but here has type '{}'. ==== tests/cases/conformance/types/spread/spreadUnion2.ts (6 errors) ==== @@ -13,29 +13,29 @@ tests/cases/conformance/types/spread/spreadUnion2.ts(18,5): error TS2403: Subseq var o1: {} | { a: number }; var o1 = { ...undefinedUnion }; ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o1' has type '{} | { a: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 3:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o1' must be of type '{} | { a: number; }', but here has type '{}'. var o2: {} | { b: number }; var o2 = { ...nullUnion }; ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o2' has type '{} | { b: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 6:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o2' must be of type '{} | { b: number; }', but here has type '{}'. var o3: {} | { a: number } | { b: number } | { a: number, b: number }; var o3 = { ...undefinedUnion, ...nullUnion }; ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' has type '{} | { a: number; } | { b: number; } | { a: number; b: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 9:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' must be of type '{} | { a: number; } | { b: number; } | { a: number; b: number; }', but here has type '{}'. var o3 = { ...nullUnion, ...undefinedUnion }; ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' has type '{} | { a: number; } | { b: number; } | { a: number; b: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 9:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' must be of type '{} | { a: number; } | { b: number; } | { a: number; b: number; }', but here has type '{}'. var o4: {} | { a: number }; var o4 = { ...undefinedUnion, ...undefinedUnion }; ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o4' has type '{} | { a: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 13:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o4' must be of type '{} | { a: number; }', but here has type '{}'. var o5: {} | { b: number }; var o5 = { ...nullUnion, ...nullUnion }; ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o5' has type '{} | { b: number; }' at tests/cases/conformance/types/spread/spreadUnion2.ts 16:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o5' must be of type '{} | { b: number; }', but here has type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/strictTupleLength.errors.txt b/tests/baselines/reference/strictTupleLength.errors.txt index c31064f6b6b..23915f1f6fa 100644 --- a/tests/baselines/reference/strictTupleLength.errors.txt +++ b/tests/baselines/reference/strictTupleLength.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/tuple/strictTupleLength.ts(1,9): error TS1122: A tuple type element list cannot be empty. -tests/cases/conformance/types/tuple/strictTupleLength.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't1' has type '[number]' at tests/cases/conformance/types/tuple/strictTupleLength.ts 1:4, but here has type '[number, number]'. -tests/cases/conformance/types/tuple/strictTupleLength.ts(12,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't2' has type '[number, number]' at tests/cases/conformance/types/tuple/strictTupleLength.ts 2:4, but here has type '[number]'. +tests/cases/conformance/types/tuple/strictTupleLength.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't1' must be of type '[number]', but here has type '[number, number]'. +tests/cases/conformance/types/tuple/strictTupleLength.ts(12,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't2' must be of type '[number, number]', but here has type '[number]'. tests/cases/conformance/types/tuple/strictTupleLength.ts(18,1): error TS2322: Type 'number[]' is not assignable to type '[number]'. Property '0' is missing in type 'number[]'. @@ -20,10 +20,10 @@ tests/cases/conformance/types/tuple/strictTupleLength.ts(18,1): error TS2322: Ty var t1 = t2; // error ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't1' has type '[number]' at tests/cases/conformance/types/tuple/strictTupleLength.ts 1:4, but here has type '[number, number]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't1' must be of type '[number]', but here has type '[number, number]'. var t2 = t1; // error ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't2' has type '[number, number]' at tests/cases/conformance/types/tuple/strictTupleLength.ts 2:4, but here has type '[number]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't2' must be of type '[number, number]', but here has type '[number]'. type A = T['length']; var b: A<[boolean]>; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt index 7e4062ae10a..b7018031a69 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(62,36): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(76,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts 74:4, but here has type '{}'. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(76,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts (2 errors) ==== @@ -82,7 +82,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; var a9e: {}; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts 74:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. // Generic tag with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt index 9112a0542b5..ae63e6fd04d 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(62,36): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(76,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts 74:4, but here has type '{}'. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(76,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts (2 errors) ==== @@ -82,7 +82,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; var a9e: {}; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts 74:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. // Generic tag with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.transformAddDecoratedNode.js b/tests/baselines/reference/transformApi/transformsCorrectly.transformAddDecoratedNode.js new file mode 100644 index 00000000000..de841226c06 --- /dev/null +++ b/tests/baselines/reference/transformApi/transformsCorrectly.transformAddDecoratedNode.js @@ -0,0 +1,16 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var Foo = /** @class */ (function () { + function Foo() { + } + Foo.prototype.baz = function () { }; + __decorate([ + Bar + ], Foo.prototype, "baz", null); + Foo = __decorate([], Foo); + return Foo; +}()); diff --git a/tests/baselines/reference/typeArgumentInference.errors.txt b/tests/baselines/reference/typeArgumentInference.errors.txt index cfed6cc640b..95e47ab583f 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,29): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(83,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts 81:4, but here has type '{}'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(83,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. @@ -91,7 +91,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74 var a9e = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); var a9e: {}; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts 81:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); ~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index ef0c93f20cd..66fa0f66907 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -12,7 +12,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,33): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. 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(121,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts 119:4, but here has type '{}'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(121,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,56): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. @@ -163,7 +163,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct !!! error TS2304: Cannot find name 'window'. var a9e: {}; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts 119:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~~~~~~ !!! error TS2304: Cannot find name 'window'. diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 2b305390689..713640ab1f8 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -17,7 +17,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,29): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. 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(88,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts 86:4, but here has type '{}'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(88,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,52): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,70): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. @@ -145,7 +145,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst !!! error TS2304: Cannot find name 'window'. var a9e: {}; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts 86:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~~~~~~ !!! error TS2304: Cannot find name 'window'. diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.errors.txt b/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.errors.txt index 301626123f2..1845d2e9775 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.errors.txt +++ b/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 9:8, but here has type 'number'. -tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(20,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' has type 'boolean' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 16:8, but here has type 'string'. -tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(27,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' has type 'number' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 23:8, but here has type 'boolean'. +tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' must be of type 'string', but here has type 'number'. +tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(20,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' must be of type 'boolean', but here has type 'string'. +tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(27,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' must be of type 'number', but here has type 'boolean'. tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(30,5): error TS2365: Operator '==' cannot be applied to types '"string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"' and '"Object"'. -tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(34,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'C' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 30:8, but here has type 'string'. +tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(34,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'C', but here has type 'string'. ==== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts (5 errors) ==== @@ -20,7 +20,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa else { var r1 = strOrNum; // string | number ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 9:8, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' must be of type 'string', but here has type 'number'. } if (typeof strOrBool == "boolean") { @@ -29,7 +29,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa else { var r2 = strOrBool; // string | boolean ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' has type 'boolean' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 16:8, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' must be of type 'boolean', but here has type 'string'. } if (typeof numOrBool == "number") { @@ -38,7 +38,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa else { var r3 = numOrBool; // number | boolean ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' has type 'number' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 23:8, but here has type 'boolean'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' must be of type 'number', but here has type 'boolean'. } if (typeof strOrC == "Object") { @@ -49,5 +49,5 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa else { var r4 = strOrC; // string | C ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'C' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 30:8, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'C', but here has type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.errors.txt b/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.errors.txt index 34ea96e2e1f..1814abec823 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.errors.txt +++ b/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' has type 'number' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 9:8, but here has type 'string'. -tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(20,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 16:8, but here has type 'boolean'. -tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(27,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' has type 'boolean' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 23:8, but here has type 'number'. +tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' must be of type 'number', but here has type 'string'. +tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(20,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' must be of type 'string', but here has type 'boolean'. +tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(27,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' must be of type 'boolean', but here has type 'number'. tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(30,5): error TS2365: Operator '!=' cannot be applied to types '"string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"' and '"Object"'. -tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(34,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 30:8, but here has type 'C'. +tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(34,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'string', but here has type 'C'. ==== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts (5 errors) ==== @@ -20,7 +20,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN else { var r1 = strOrNum; // string | number ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' has type 'number' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 9:8, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' must be of type 'number', but here has type 'string'. } if (typeof strOrBool != "boolean") { @@ -29,7 +29,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN else { var r2 = strOrBool; // string | boolean ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 16:8, but here has type 'boolean'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' must be of type 'string', but here has type 'boolean'. } if (typeof numOrBool != "number") { @@ -38,7 +38,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN else { var r3 = numOrBool; // number | boolean ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' has type 'boolean' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 23:8, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' must be of type 'boolean', but here has type 'number'. } if (typeof strOrC != "Object") { @@ -49,5 +49,5 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN else { var r4 = strOrC; // string | C ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 30:8, but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'string', but here has type 'C'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt index 8471efb50f3..89849d3a614 100644 --- a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt +++ b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'typeof E' at tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts 6:4, 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' has type 'typeof E' at tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts 8:4, but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. +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. @@ -13,10 +13,10 @@ 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' has type 'typeof E' at tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts 6:4, but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. +!!! 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' has type 'typeof E' at tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts 8:4, but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. +!!! 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/typeOfThis.errors.txt b/tests/baselines/reference/typeOfThis.errors.txt index 1dc76a40c17..83d450570fc 100644 --- a/tests/baselines/reference/typeOfThis.errors.txt +++ b/tests/baselines/reference/typeOfThis.errors.txt @@ -1,19 +1,19 @@ -tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(14,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 12:15, but here has type 'MyTestClass'. -tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(18,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 16:12, but here has type 'MyTestClass'. +tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(14,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyTestClass'. +tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(18,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'. tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(22,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(24,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 22:12, but here has type 'MyTestClass'. +tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(24,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'. tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(27,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(29,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 27:12, but here has type 'MyTestClass'. -tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(37,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 35:12, but here has type 'MyTestClass'. +tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(29,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'. +tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(37,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyTestClass'. tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(53,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(61,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(83,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 81:15, but here has type 'MyGenericTestClass'. -tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(87,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 85:12, but here has type 'MyGenericTestClass'. +tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(83,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyGenericTestClass'. +tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(87,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass'. tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(91,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(93,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 91:12, but here has type 'MyGenericTestClass'. +tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(93,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass'. tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(96,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(98,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 96:12, but here has type 'MyGenericTestClass'. -tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 104:12, but here has type 'MyGenericTestClass'. +tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(98,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass'. +tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyGenericTestClass'. tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(122,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -34,13 +34,13 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1 memberFunc(t = this) { var t: MyTestClass; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 12:15, but here has type 'MyTestClass'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyTestClass'. //type of 'this' in member function body is the class instance type var p = this; var p: MyTestClass; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 16:12, but here has type 'MyTestClass'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'. } //type of 'this' in member accessor(get and set) body is the class instance type @@ -50,7 +50,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1 var p = this; var p: MyTestClass; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 22:12, but here has type 'MyTestClass'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'. return this; } set prop(v) { @@ -59,7 +59,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1 var p = this; var p: MyTestClass; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 27:12, but here has type 'MyTestClass'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'. p = v; v = p; } @@ -69,7 +69,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1 var t = this; var t: MyTestClass; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 35:12, but here has type 'MyTestClass'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyTestClass'. }; //type of 'this' in static function param list is constructor function type @@ -121,13 +121,13 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1 memberFunc(t = this) { var t: MyGenericTestClass; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 81:15, but here has type 'MyGenericTestClass'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyGenericTestClass'. //type of 'this' in member function body is the class instance type var p = this; var p: MyGenericTestClass; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 85:12, but here has type 'MyGenericTestClass'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass'. } //type of 'this' in member accessor(get and set) body is the class instance type @@ -137,7 +137,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1 var p = this; var p: MyGenericTestClass; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 91:12, but here has type 'MyGenericTestClass'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass'. return this; } set prop(v) { @@ -146,7 +146,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1 var p = this; var p: MyGenericTestClass; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 96:12, but here has type 'MyGenericTestClass'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass'. p = v; v = p; } @@ -156,7 +156,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1 var t = this; var t: MyGenericTestClass; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 104:12, but here has type 'MyGenericTestClass'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyGenericTestClass'. }; //type of 'this' in static function param list is constructor function type diff --git a/tests/baselines/reference/unionTypeEquivalence.errors.txt b/tests/baselines/reference/unionTypeEquivalence.errors.txt index 724e3ecec93..d561a96f97e 100644 --- a/tests/baselines/reference/unionTypeEquivalence.errors.txt +++ b/tests/baselines/reference/unionTypeEquivalence.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/union/unionTypeEquivalence.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'C' at tests/cases/conformance/types/union/unionTypeEquivalence.ts 3:4, but here has type 'C | D'. +tests/cases/conformance/types/union/unionTypeEquivalence.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'C', but here has type 'C | D'. ==== tests/cases/conformance/types/union/unionTypeEquivalence.ts (1 errors) ==== @@ -8,7 +8,7 @@ tests/cases/conformance/types/union/unionTypeEquivalence.ts(5,5): error TS2403: var x: C; var x : C | D; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'C' at tests/cases/conformance/types/union/unionTypeEquivalence.ts 3:4, but here has type 'C | D'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'C', but here has type 'C | D'. // A | B is equivalent to B | A. var y: string | number; diff --git a/tests/baselines/reference/unionTypeIdentity.errors.txt b/tests/baselines/reference/unionTypeIdentity.errors.txt index afa4eb844c1..77d25bd78d1 100644 --- a/tests/baselines/reference/unionTypeIdentity.errors.txt +++ b/tests/baselines/reference/unionTypeIdentity.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'string'. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(7,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'boolean'. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'number'. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'string'. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(7,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'boolean'. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'number'. ==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts (3 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeI var strOrNum: boolean | string | boolean; var strOrNum: string; // error ~~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'string'. var strOrNum: boolean; // error ~~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'boolean'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'boolean'. var strOrNum: number; // error ~~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'number'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeLiterals.errors.txt b/tests/baselines/reference/unionTypeLiterals.errors.txt index 3eb1cde76c5..d976d769f59 100644 --- a/tests/baselines/reference/unionTypeLiterals.errors.txt +++ b/tests/baselines/reference/unionTypeLiterals.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfFunctionType' has type '(() => string) | (() => number)' at tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts 8:4, but here has type '() => string | number'. -tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts(15,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfConstructorType' has type '(new () => string) | (new () => number)' at tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts 12:4, but here has type 'new () => string | number'. +tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfFunctionType' must be of type '(() => string) | (() => number)', but here has type '() => string | number'. +tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts(15,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfConstructorType' must be of type '(new () => string) | (new () => number)', but here has type 'new () => string | number'. ==== tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts (2 errors) ==== @@ -15,10 +15,10 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts( var unionOfFunctionType: { (): string } | { (): number }; var unionOfFunctionType: () => string | number; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfFunctionType' has type '(() => string) | (() => number)' at tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts 8:4, but here has type '() => string | number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfFunctionType' must be of type '(() => string) | (() => number)', but here has type '() => string | number'. var unionOfConstructorType: (new () => string) | (new () => number); var unionOfConstructorType: { new (): string } | { new (): number }; var unionOfConstructorType: new () => string | number; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfConstructorType' has type '(new () => string) | (new () => number)' at tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts 12:4, but here has type 'new () => string | number'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfConstructorType' must be of type '(new () => string) | (new () => number)', but here has type 'new () => string | number'. \ No newline at end of file diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 17d35a35d98..856690b7474 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -581,7 +581,7 @@ node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/cate node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/category-renderer.js(115,15): error TS2503: Cannot find namespace 'ReportRenderer'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/category-renderer.js(122,50): error TS2304: Cannot find name 'Util'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/category-renderer.js(146,15): error TS2503: Cannot find namespace 'ReportRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/category-renderer.js(151,38): error TS2503: Cannot find namespace 'CategoryRenderer'. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/category-renderer.js(151,38): error TS2702: 'CategoryRenderer' only refers to a type, but is being used as a namespace here. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/category-renderer.js(157,24): error TS2304: Cannot find name 'Util'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/category-renderer.js(182,29): error TS2304: Cannot find name 'Util'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/category-renderer.js(186,31): error TS2304: Cannot find name 'Util'. @@ -636,30 +636,30 @@ node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/crc- node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/crc-details-renderer.js(220,2): error TS1131: Property or signature expected. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/crc-details-renderer.js(228,30): error TS2339: Property 'CRCSegment' does not exist on type 'typeof CriticalRequestChainRenderer'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(12,15): error TS2304: Cannot find name 'DOM'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(29,15): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(39,45): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(41,50): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(43,50): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(45,46): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(47,46): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(51,44): error TS2503: Cannot find namespace 'DetailsRenderer'. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(29,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(39,45): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(41,50): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(43,50): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(45,46): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(47,46): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(51,44): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(53,16): error TS2304: Cannot find name 'CriticalRequestChainRenderer'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(54,25): error TS2503: Cannot find namespace 'CriticalRequestChainRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(56,45): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(63,15): error TS2503: Cannot find namespace 'DetailsRenderer'. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(56,45): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(63,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(72,22): error TS2304: Cannot find name 'Util'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(88,15): error TS2339: Property 'title' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(95,15): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(116,15): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(128,15): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(144,15): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(167,15): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(201,15): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(217,15): error TS2503: Cannot find namespace 'DetailsRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(248,15): error TS2503: Cannot find namespace 'DetailsRenderer'. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(95,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(116,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(128,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(144,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(167,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(201,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(217,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(248,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(257,20): error TS2304: Cannot find name 'Util'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(259,18): error TS2304: Cannot find name 'Util'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(276,15): error TS2503: Cannot find namespace 'DetailsRenderer'. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(276,15): error TS2702: 'DetailsRenderer' only refers to a type, but is being used as a namespace here. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(289,8): error TS2339: Property 'DetailsRenderer' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(294,2): error TS1131: Property or signature expected. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/details-renderer.js(298,17): error TS2339: Property 'DetailsJSON' does not exist on type 'typeof DetailsRenderer'. @@ -690,14 +690,14 @@ node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/dom. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/dom.js(177,8): error TS2339: Property 'DOM' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(19,15): error TS2304: Cannot find name 'DOM'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(20,15): error TS2304: Cannot find name 'CategoryRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(32,15): error TS2503: Cannot find namespace 'ReportRenderer'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(53,15): error TS2503: Cannot find namespace 'ReportRenderer'. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(32,15): error TS2702: 'ReportRenderer' only refers to a type, but is being used as a namespace here. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(53,15): error TS2702: 'ReportRenderer' only refers to a type, but is being used as a namespace here. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(59,9): error TS2304: Cannot find name 'Util'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(80,15): error TS2503: Cannot find namespace 'ReportRenderer'. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(80,15): error TS2702: 'ReportRenderer' only refers to a type, but is being used as a namespace here. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(87,9): error TS2304: Cannot find name 'Util'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(92,15): error TS2503: Cannot find namespace 'ReportRenderer'. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(92,15): error TS2702: 'ReportRenderer' only refers to a type, but is being used as a namespace here. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(110,47): error TS2304: Cannot find name 'Util'. -node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(118,15): error TS2503: Cannot find namespace 'ReportRenderer'. +node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(118,15): error TS2702: 'ReportRenderer' only refers to a type, but is being used as a namespace here. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(150,8): error TS2339: Property 'ReportRenderer' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(155,2): error TS1131: Property or signature expected. node_modules/chrome-devtools-frontend/front_end/audits2/lighthouse/renderer/report-renderer.js(175,16): error TS2339: Property 'AuditJSON' does not exist on type 'typeof ReportRenderer'. @@ -1160,7 +1160,7 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(26088,6): error TS2339: Property 'emit' does not exist on type '{ _writableState: { objectMode: any; highWaterMark: any; needDrain: boolean; ending: boolean; end...'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(26110,1): error TS2322: Type 'TypeError' is not assignable to type 'boolean'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(26112,1): error TS2322: Type 'TypeError' is not assignable to type 'boolean'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(26629,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'end' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js 26619:4, but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(26629,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'end' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(26780,21): error TS2304: Cannot find name 'global'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(26780,42): error TS2304: Cannot find name 'global'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(26826,40): error TS2345: Argument of type '(x: string) => string | number' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. @@ -3055,12 +3055,12 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(48927,7): error TS2339: Property 'componentsOrder' does not exist on type '{}'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(48928,7): error TS2339: Property 'components' does not exist on type '{}'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(48968,17): error TS2339: Property 'components' does not exist on type '{}'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(48999,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js 48835:4, but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(48999,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(49000,18): error TS2339: Property 'components' does not exist on type '{}'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(49001,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js 48835:6, but here has type 'string'. +node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(49001,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type 'any', but here has type 'string'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(49007,18): error TS2339: Property 'samplesPerLine' does not exist on type '{}'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(49008,19): error TS2339: Property 'scanLines' does not exist on type '{}'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(49012,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js 48835:4, but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(49012,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(49012,21): error TS2339: Property 'componentsOrder' does not exist on type '{}'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(49013,21): error TS2339: Property 'components' does not exist on type '{}'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(49013,38): error TS2339: Property 'componentsOrder' does not exist on type '{}'. @@ -3711,7 +3711,7 @@ node_modules/chrome-devtools-frontend/front_end/cm/overlay.js(15,17): error TS23 node_modules/chrome-devtools-frontend/front_end/cm/overlay.js(16,19): error TS2304: Cannot find name 'define'. node_modules/chrome-devtools-frontend/front_end/cm/overlay.js(16,43): error TS2304: Cannot find name 'define'. node_modules/chrome-devtools-frontend/front_end/cm/overlay.js(17,5): error TS2304: Cannot find name 'define'. -node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(30,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'ok' has type 'boolean' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js 28:38, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(30,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'ok' must be of type 'boolean', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(87,12): error TS2339: Property 'resolveMode' does not exist on type '{ (element: any, config: any): void; on: (obj: any, type: any, handler: any) => void; prototype: ...'. node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(97,21): error TS2339: Property 'resolveMode' does not exist on type '{ (element: any, config: any): void; on: (obj: any, type: any, handler: any) => void; prototype: ...'. node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(102,12): error TS2339: Property 'registerHelper' does not exist on type '{ (element: any, config: any): void; on: (obj: any, type: any, handler: any) => void; prototype: ...'. @@ -3767,8 +3767,8 @@ node_modules/chrome-devtools-frontend/front_end/cm_modes/php.js(6,85): error TS2 node_modules/chrome-devtools-frontend/front_end/cm_modes/php.js(7,19): error TS2304: Cannot find name 'define'. node_modules/chrome-devtools-frontend/front_end/cm_modes/php.js(7,43): error TS2304: Cannot find name 'define'. node_modules/chrome-devtools-frontend/front_end/cm_modes/php.js(8,5): error TS2304: Cannot find name 'define'. -node_modules/chrome-devtools-frontend/front_end/cm_modes/php.js(172,15): error TS2403: Subsequent variable declarations must have the same type. Variable 'style' has type 'string' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/cm_modes/php.js 168:14, but here has type 'any'. -node_modules/chrome-devtools-frontend/front_end/cm_modes/php.js(174,15): error TS2403: Subsequent variable declarations must have the same type. Variable 'style' has type 'string' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/cm_modes/php.js 168:14, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/cm_modes/php.js(172,15): error TS2403: Subsequent variable declarations must have the same type. Variable 'style' must be of type 'string', but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/cm_modes/php.js(174,15): error TS2403: Subsequent variable declarations must have the same type. Variable 'style' must be of type 'string', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/cm_modes/python.js(6,9): error TS2304: Cannot find name 'require'. node_modules/chrome-devtools-frontend/front_end/cm_modes/python.js(6,17): error TS2307: Cannot find module '../../lib/codemirror'. node_modules/chrome-devtools-frontend/front_end/cm_modes/python.js(7,19): error TS2304: Cannot find name 'define'. @@ -3899,7 +3899,7 @@ node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(905,29) node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(912,15): error TS1055: Type 'Promise' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(981,39): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/common/Color.js(36,22): error TS2694: Namespace 'Common' has no exported member 'Color'. -node_modules/chrome-devtools-frontend/front_end/common/Color.js(106,15): error TS2403: Subsequent variable declarations must have the same type. Variable 'rgba' has type 'any[]' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/common/Color.js 95:12, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/common/Color.js(106,15): error TS2403: Subsequent variable declarations must have the same type. Variable 'rgba' must be of type 'any[]', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/common/Color.js(194,18): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. node_modules/chrome-devtools-frontend/front_end/common/Color.js(210,18): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. node_modules/chrome-devtools-frontend/front_end/common/Color.js(373,23): error TS2694: Namespace 'Common' has no exported member 'Color'. @@ -4323,16 +4323,16 @@ node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(1525,9): node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(34,9): error TS2339: Property 'ConsoleViewMessage' does not exist on type '{ new (): Console; prototype: Console; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(49,26): error TS2694: Namespace 'DataGrid' has no exported member 'DataGrid'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(86,48): error TS2339: Property 'offsetHeight' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(171,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'rowValue' has type '{ [x: string]: any; }' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js 146:10, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(171,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'rowValue' must be of type '{ [x: string]: any; }', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(184,42): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(211,26): error TS2339: Property 'title' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(233,15): error TS2403: Subsequent variable declarations must have the same type. Variable 'args' has type 'any[]' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js 214:14, but here has type 'any[]'. +node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(233,15): error TS2403: Subsequent variable declarations must have the same type. Variable 'args' must be of type 'any[]', but here has type 'any[]'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(241,26): error TS2339: Property 'createTextChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(244,28): error TS2339: Property 'createTextChildren' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(246,28): error TS2339: Property 'createTextChildren' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(249,34): error TS2339: Property 'ConsoleViewMessage' does not exist on type '{ new (): Console; prototype: Console; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(252,35): error TS2694: Namespace 'SDK' has no exported member 'NetworkRequest'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(267,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'args' has type 'any[]' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js 214:14, but here has type 'any[]'. +node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(267,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'args' must be of type 'any[]', but here has type 'any[]'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(304,82): error TS2339: Property 'ConsoleViewMessage' does not exist on type '{ new (): Console; prototype: Console; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(311,28): error TS2339: Property 'createTextChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(332,23): error TS2551: Property '_url' does not exist on type '(Anonymous class)'. Did you mean 'url'? @@ -4643,9 +4643,9 @@ node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(160,15 node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(170,31): error TS2694: Namespace 'Protocol' has no exported member 'CSS'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(175,64): error TS2694: Namespace 'Coverage' has no exported member 'RangeUseCount'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(188,23): error TS2495: Type 'Map<(Anonymous class), any[]>' is not an array type or a string type. -node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(189,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'styleSheetHeader' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js 177:10, but here has type '(Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(189,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'styleSheetHeader' must be of type 'any', but here has type '(Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(190,48): error TS2694: Namespace 'Coverage' has no exported member 'RangeUseCount'. -node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(191,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'entry' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js 187:13, but here has type '(Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(191,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'entry' must be of type 'any', but here has type '(Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(201,31): error TS2694: Namespace 'Coverage' has no exported member 'RangeUseCount'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(202,32): error TS2694: Namespace 'Coverage' has no exported member 'CoverageSegment'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(210,23): error TS2339: Property 'peekLast' does not exist on type 'any[]'. @@ -4988,7 +4988,7 @@ node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(153,22): node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(156,30): error TS2503: Cannot find namespace 'Adb'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(161,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(164,30): error TS2503: Cannot find namespace 'Adb'. -node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(170,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'deviceId' has type 'string' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js 164:13, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(170,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'deviceId' must be of type 'string', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(170,26): error TS2495: Type 'IterableIterator' is not an array type or a string type. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(207,5): error TS2346: Call target does not contain any signatures. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(229,17): error TS2503: Cannot find namespace 'Adb'. @@ -5108,24 +5108,24 @@ node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,375): node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,379): error TS2365: Operator '+' cannot be applied to types '{ [x: string]: any; chars1: string; chars2: string; lineArray: string[]; }' and 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,388): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(6,476): error TS2322: Type '0' is not assignable to type '{ [x: string]: any; chars1: string; chars2: string; lineArray: string[]; }'. -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(13,201): error TS2403: Subsequent variable declarations must have the same type. Variable 'd' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js 12:76, but here has type 'number'. -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(15,142): error TS2403: Subsequent variable declarations must have the same type. Variable 'd' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js 14:4, but here has type 'any[]'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(13,201): error TS2403: Subsequent variable declarations must have the same type. Variable 'd' must be of type 'any', but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(15,142): error TS2403: Subsequent variable declarations must have the same type. Variable 'd' must be of type 'any', but here has type 'any[]'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(17,82): error TS2339: Property 'length' does not exist on type 'boolean'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(17,153): error TS2339: Property 'substring' does not exist on type 'boolean'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(17,167): error TS2339: Property 'length' does not exist on type 'boolean'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(17,219): error TS2339: Property 'length' does not exist on type 'boolean'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(17,261): error TS2339: Property 'substring' does not exist on type 'boolean'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(17,351): error TS2339: Property 'substring' does not exist on type 'boolean'. -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(19,282): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' has type 'number' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js 18:144, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(19,282): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type 'number', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(21,314): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(23,258): error TS2322: Type 'boolean' is not assignable to type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(23,494): error TS2322: Type 'true' is not assignable to type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(24,123): error TS2322: Type 'true' is not assignable to type 'number'. -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(30,429): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js 29:297, but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(30,429): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(34,12): error TS2339: Property 'length' does not exist on type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(34,41): error TS2339: Property 'length' does not exist on type 'number'. -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(39,396): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' has type 'string' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js 37:225, but here has type 'number'. -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(41,186): error TS2403: Subsequent variable declarations must have the same type. Variable 'd' has type 'number' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js 40:89, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(39,396): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type 'string', but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(41,186): error TS2403: Subsequent variable declarations must have the same type. Variable 'd' must be of type 'number', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(41,197): error TS2339: Property 'diffs' does not exist on type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(41,249): error TS2339: Property 'start1' does not exist on type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(41,261): error TS2339: Property 'start2' does not exist on type 'number'. @@ -5140,7 +5140,7 @@ node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(42,7): node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(42,20): error TS2339: Property 'length2' does not exist on type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(42,125): error TS2339: Property 'length1' does not exist on type 'number'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(42,138): error TS2339: Property 'length2' does not exist on type 'number'. -node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(43,411): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' has type 'string' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js 42:182, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(43,411): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type 'string', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(43,443): error TS2365: Operator '===' cannot be applied to types 'number' and 'string'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(44,7): error TS2365: Operator '===' cannot be applied to types 'number' and 'string'. node_modules/chrome-devtools-frontend/front_end/diff/diff_match_patch.js(44,220): error TS2365: Operator '===' cannot be applied to types 'number' and 'string'. @@ -5556,7 +5556,7 @@ node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(29 node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(369,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(372,54): error TS2694: Namespace 'SDK' has no exported member 'CSSModel'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(420,43): error TS2339: Property 'valuesArray' does not exist on type 'Set'. -node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(439,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'block' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js 421:10, but here has type '(Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(439,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'block' must be of type 'any', but here has type '(Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(489,14): error TS2339: Property 'peekLast' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(612,18): error TS2694: Namespace 'UI' has no exported member 'Widget'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(630,18): error TS2694: Namespace 'UI' has no exported member 'Widget'. @@ -6327,7 +6327,7 @@ node_modules/chrome-devtools-frontend/front_end/formatter_worker/RelaxedJSONPars node_modules/chrome-devtools-frontend/front_end/formatter_worker/RelaxedJSONParser.js(44,47): error TS2694: Namespace 'FormatterWorker' has no exported member 'RelaxedJSONParser'. node_modules/chrome-devtools-frontend/front_end/formatter_worker/RelaxedJSONParser.js(57,31): error TS2694: Namespace 'FormatterWorker' has no exported member 'RelaxedJSONParser'. node_modules/chrome-devtools-frontend/front_end/formatter_worker/RelaxedJSONParser.js(89,47): error TS2694: Namespace 'FormatterWorker' has no exported member 'RelaxedJSONParser'. -node_modules/chrome-devtools-frontend/front_end/formatter_worker/RelaxedJSONParser.js(93,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'newTip' has type '{ [x: string]: any; }' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/formatter_worker/RelaxedJSONParser.js 85:12, but here has type 'any[]'. +node_modules/chrome-devtools-frontend/front_end/formatter_worker/RelaxedJSONParser.js(93,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'newTip' must be of type '{ [x: string]: any; }', but here has type 'any[]'. node_modules/chrome-devtools-frontend/front_end/formatter_worker/RelaxedJSONParser.js(96,47): error TS2694: Namespace 'FormatterWorker' has no exported member 'RelaxedJSONParser'. node_modules/chrome-devtools-frontend/front_end/formatter_worker/RelaxedJSONParser.js(104,32): error TS2339: Property 'value' does not exist on type '{ start: number; end: number; type: string; body: any; declarations: any[]; properties: any[]; in...'. node_modules/chrome-devtools-frontend/front_end/formatter_worker/RelaxedJSONParser.js(159,20): error TS2339: Property 'value' does not exist on type '{ start: number; end: number; type: string; body: any; declarations: any[]; properties: any[]; in...'. @@ -6410,7 +6410,7 @@ node_modules/chrome-devtools-frontend/front_end/har_importer/HARFormat.js(286,5) node_modules/chrome-devtools-frontend/front_end/har_importer/HARFormat.js(301,5): error TS2346: Call target does not contain any signatures. node_modules/chrome-devtools-frontend/front_end/har_importer/HARImporter.js(8,27): error TS2694: Namespace 'SDK' has no exported member 'NetworkRequest'. node_modules/chrome-devtools-frontend/front_end/har_importer/HARImporter.js(20,28): error TS2694: Namespace 'SDK' has no exported member 'NetworkRequest'. -node_modules/chrome-devtools-frontend/front_end/har_importer/HARImporter.js(26,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'page' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/har_importer/HARImporter.js 12:13, but here has type '(Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/har_importer/HARImporter.js(26,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'page' must be of type 'any', but here has type '(Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/har_importer/HARImporter.js(41,19): error TS2694: Namespace 'SDK' has no exported member 'NetworkRequest'. node_modules/chrome-devtools-frontend/front_end/har_importer/HARImporter.js(53,19): error TS2694: Namespace 'SDK' has no exported member 'NetworkRequest'. node_modules/chrome-devtools-frontend/front_end/har_importer/HARImporter.js(117,19): error TS2694: Namespace 'SDK' has no exported member 'NetworkRequest'. @@ -6528,7 +6528,7 @@ node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapsho node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(2527,30): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(2541,17): error TS2339: Property 'isUserRoot' does not exist on type '(Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(2541,38): error TS2339: Property 'isDocumentDOMTreesRoot' does not exist on type '(Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(2587,16): error TS2403: Subsequent variable declarations must have the same type. Variable 'iter' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js 2580:15, but here has type '(Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(2587,16): error TS2403: Subsequent variable declarations must have the same type. Variable 'iter' must be of type 'any', but here has type '(Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(2835,5): error TS2346: Call target does not contain any signatures. node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(3020,5): error TS2346: Call target does not contain any signatures. node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(3039,27): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. @@ -6855,7 +6855,7 @@ node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(114 node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(1175,15): error TS1055: Type 'Promise' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value. node_modules/chrome-devtools-frontend/front_end/layer_viewer/PaintProfilerView.js(39,5): error TS2346: Call target does not contain any signatures. node_modules/chrome-devtools-frontend/front_end/layer_viewer/PaintProfilerView.js(158,24): error TS2694: Namespace 'Protocol' has no exported member 'DOM'. -node_modules/chrome-devtools-frontend/front_end/layer_viewer/PaintProfilerView.js(242,16): error TS2403: Subsequent variable declarations must have the same type. Variable 'categoryName' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/layer_viewer/PaintProfilerView.js 212:10, but here has type 'string'. +node_modules/chrome-devtools-frontend/front_end/layer_viewer/PaintProfilerView.js(242,16): error TS2403: Subsequent variable declarations must have the same type. Variable 'categoryName' must be of type 'any', but here has type 'string'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/PaintProfilerView.js(300,19): error TS2339: Property 'millisToString' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/PaintProfilerView.js(314,27): error TS2339: Property 'constrain' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/PaintProfilerView.js(315,28): error TS2339: Property 'constrain' does not exist on type 'NumberConstructor'. @@ -7297,7 +7297,7 @@ node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(425,35): node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(430,19): error TS2694: Namespace 'SDK' has no exported member 'NetworkRequest'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(458,18): error TS2694: Namespace 'UI' has no exported member 'SearchableView'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(525,22): error TS2339: Property 'isSelfOrDescendant' does not exist on type 'EventTarget'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(536,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'resource' has type '(Anonymous class)' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js 528:10, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(536,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'resource' must be of type '(Anonymous class)', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(544,35): error TS2694: Namespace 'SDK' has no exported member 'NetworkRequest'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(552,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(560,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -7345,9 +7345,9 @@ node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.j node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(180,69): error TS2339: Property 'offsetY' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(180,85): error TS2339: Property 'shiftKey' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(185,19): error TS2694: Namespace 'UI' has no exported member 'PopoverRequest'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(200,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'range' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js 194:10, but here has type '{ start: number; mid: number; end: number; }'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(201,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'start' has type 'number' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js 196:10, but here has type 'any'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(202,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'end' has type 'number' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js 197:10, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(200,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'range' must be of type 'any', but here has type '{ start: number; mid: number; end: number; }'. +node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(201,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'start' must be of type 'number', but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(202,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'end' must be of type 'number', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(211,15): error TS2339: Property 'clientX' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(211,68): error TS2339: Property 'clientX' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/network/NetworkWaterfallColumn.js(218,15): error TS2339: Property 'clientY' does not exist on type 'Event'. @@ -7597,8 +7597,8 @@ node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSectio node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(973,5): error TS2346: Call target does not contain any signatures. node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(973,18): error TS2339: Property 'sprintf' does not exist on type 'StringConstructor'. node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(1053,23): error TS2495: Type 'IterableIterator' is not an array type or a string type. -node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(1065,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js 1052:17, but here has type 'number'. -node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(1074,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'groupStart' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js 1065:14, but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(1065,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(1074,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'groupStart' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(1076,23): error TS2495: Type 'IterableIterator' is not an array type or a string type. node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(1156,23): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(1217,20): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -7720,14 +7720,14 @@ node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(485,11): e node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(485,41): error TS2339: Property 'keyCode' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(486,9): error TS2339: Property 'consume' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(488,18): error TS2339: Property 'keyCode' does not exist on type 'Event'. -node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(494,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'indexOnLevel' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js 477:10, but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(494,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'indexOnLevel' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(517,49): error TS2339: Property 'upperBound' does not exist on type 'Uint32Array'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(580,36): error TS2339: Property 'upperBound' does not exist on type 'Uint32Array'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(656,65): error TS2339: Property 'upperBound' does not exist on type 'Uint32Array'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(660,69): error TS2339: Property 'maxStackDepth' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(684,40): error TS2339: Property 'entryColor' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(694,31): error TS2339: Property 'keysArray' does not exist on type 'Map'. -node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(701,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'entryIndex' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js 671:12, but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(701,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'entryIndex' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(718,59): error TS2339: Property 'forceDecoration' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(749,37): error TS2339: Property 'entryTitle' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/perf_ui/FlameChart.js(751,43): error TS2339: Property 'entryFont' does not exist on type '() => void'. @@ -8041,7 +8041,7 @@ node_modules/chrome-devtools-frontend/front_end/persistence/NetworkPersistenceMa node_modules/chrome-devtools-frontend/front_end/persistence/NetworkPersistenceManager.js(303,25): error TS2339: Property 'createFile' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/persistence/NetworkPersistenceManager.js(319,102): error TS2339: Property 'id' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/persistence/NetworkPersistenceManager.js(334,32): error TS2339: Property 'type' does not exist on type '() => void'. -node_modules/chrome-devtools-frontend/front_end/persistence/NetworkPersistenceManager.js(351,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'url' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/persistence/NetworkPersistenceManager.js 334:10, but here has type 'string'. +node_modules/chrome-devtools-frontend/front_end/persistence/NetworkPersistenceManager.js(351,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'url' must be of type 'any', but here has type 'string'. node_modules/chrome-devtools-frontend/front_end/persistence/NetworkPersistenceManager.js(379,32): error TS2339: Property 'type' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/persistence/NetworkPersistenceManager.js(400,25): error TS2694: Namespace 'Workspace' has no exported member 'Project'. node_modules/chrome-devtools-frontend/front_end/persistence/NetworkPersistenceManager.js(403,17): error TS2339: Property 'type' does not exist on type '() => void'. @@ -9282,7 +9282,7 @@ node_modules/chrome-devtools-frontend/front_end/sdk/CSSStyleDeclaration.js(9,19) node_modules/chrome-devtools-frontend/front_end/sdk/CSSStyleDeclaration.js(35,19): error TS2694: Namespace 'SDK' has no exported member 'CSSModel'. node_modules/chrome-devtools-frontend/front_end/sdk/CSSStyleDeclaration.js(41,47): error TS2694: Namespace 'Protocol' has no exported member 'CSS'. node_modules/chrome-devtools-frontend/front_end/sdk/CSSStyleDeclaration.js(50,24): error TS2694: Namespace 'Protocol' has no exported member 'CSS'. -node_modules/chrome-devtools-frontend/front_end/sdk/CSSStyleDeclaration.js(75,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'property' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/sdk/CSSStyleDeclaration.js 66:10, but here has type '(Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/sdk/CSSStyleDeclaration.js(75,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'property' must be of type 'any', but here has type '(Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/sdk/CSSStyleDeclaration.js(161,20): error TS2694: Namespace 'SDK' has no exported member 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/CSSStyleSheetHeader.js(11,24): error TS2694: Namespace 'Protocol' has no exported member 'CSS'. node_modules/chrome-devtools-frontend/front_end/sdk/CSSStyleSheetHeader.js(32,23): error TS2694: Namespace 'Common' has no exported member 'ContentProvider'. @@ -10200,7 +10200,7 @@ node_modules/chrome-devtools-frontend/front_end/sdk/ServiceWorkerManager.js(80,3 node_modules/chrome-devtools-frontend/front_end/sdk/ServiceWorkerManager.js(101,25): error TS2495: Type 'IterableIterator<(Anonymous class)>' is not an array type or a string type. node_modules/chrome-devtools-frontend/front_end/sdk/ServiceWorkerManager.js(177,32): error TS2694: Namespace 'Protocol' has no exported member 'ServiceWorker'. node_modules/chrome-devtools-frontend/front_end/sdk/ServiceWorkerManager.js(200,32): error TS2694: Namespace 'Protocol' has no exported member 'ServiceWorker'. -node_modules/chrome-devtools-frontend/front_end/sdk/ServiceWorkerManager.js(212,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'registration' has type '(Anonymous class)' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/sdk/ServiceWorkerManager.js 205:10, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/sdk/ServiceWorkerManager.js(212,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'registration' must be of type '(Anonymous class)', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/sdk/ServiceWorkerManager.js(212,30): error TS2495: Type 'Set<(Anonymous class)>' is not an array type or a string type. node_modules/chrome-devtools-frontend/front_end/sdk/ServiceWorkerManager.js(223,24): error TS2694: Namespace 'Protocol' has no exported member 'ServiceWorker'. node_modules/chrome-devtools-frontend/front_end/sdk/ServiceWorkerManager.js(269,32): error TS2694: Namespace 'Protocol' has no exported member 'ServiceWorker'. @@ -10681,7 +10681,7 @@ node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(1 node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(177,15): error TS2503: Cannot find namespace 'Diff'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(186,42): error TS2694: Namespace 'SourceFrame' has no exported member 'SourceCodeDiff'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(198,70): error TS2694: Namespace 'SourceFrame' has no exported member 'SourceCodeDiff'. -node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(202,16): error TS2403: Subsequent variable declarations must have the same type. Variable 'lineNumber' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js 189:10, but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(202,16): error TS2403: Subsequent variable declarations must have the same type. Variable 'lineNumber' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(206,41): error TS2339: Property 'diff' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(216,68): error TS2694: Namespace 'SourceFrame' has no exported member 'SourceCodeDiff'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(244,27): error TS2694: Namespace 'SourceFrame' has no exported member 'SourceCodeDiff'. @@ -10702,7 +10702,7 @@ node_modules/chrome-devtools-frontend/front_end/source_frame/SourceFrame.js(475, node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js(9,27): error TS2694: Namespace 'SourceFrame' has no exported member 'SourcesTextEditorDelegate'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js(12,5): error TS2346: Call target does not contain any signatures. node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js(54,20): error TS2694: Namespace 'UI' has no exported member 'AutocompleteConfig'. -node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js(90,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'number' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js 78:10, but here has type 'string'. +node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js(90,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'string'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js(93,29): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js(313,32): error TS2339: Property 'populateLineGutterContextMenu' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourcesTextEditor.js(317,26): error TS2339: Property 'populateTextAreaContextMenu' does not exist on type '() => void'. @@ -10926,7 +10926,7 @@ node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1225,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1231,43): error TS2694: Namespace 'Bindings' has no exported member 'BreakpointManager'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1237,24): error TS2694: Namespace 'Bindings' has no exported member 'BreakpointManager'. -node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1285,16): error TS2403: Subsequent variable declarations must have the same type. Variable 'location' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js 1279:12, but here has type '(Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1285,16): error TS2403: Subsequent variable declarations must have the same type. Variable 'location' must be of type 'any', but here has type '(Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1301,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1307,43): error TS2694: Namespace 'Bindings' has no exported member 'BreakpointManager'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1341,60): error TS2339: Property 'valuesArray' does not exist on type 'Set'. @@ -11496,8 +11496,8 @@ node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(2574,25): error TS2339: Property '_array' does not exist on type 'PropertyDescriptor'. node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(2587,35): error TS2339: Property 'maxLength' does not exist on type '{ _array: any[]; _startIndex: number; _length: number; get: (index: any) => any; set: (index: any...'. node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(2589,43): error TS2339: Property 'maxLength' does not exist on type '{ _array: any[]; _startIndex: number; _length: number; get: (index: any) => any; set: (index: any...'. -node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(2612,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js 2605:21, but here has type 'number'. -node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(2615,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js 2605:21, but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(2612,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(2615,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(2618,52): error TS2339: Property 'maxLength' does not exist on type '{ _array: any[]; _startIndex: number; _length: number; get: (index: any) => any; set: (index: any...'. node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(2619,74): error TS2339: Property 'maxLength' does not exist on type '{ _array: any[]; _startIndex: number; _length: number; get: (index: any) => any; set: (index: any...'. node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(2620,37): error TS2339: Property 'maxLength' does not exist on type '{ _array: any[]; _startIndex: number; _length: number; get: (index: any) => any; set: (index: any...'. @@ -11603,7 +11603,7 @@ node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(3307,18): error TS2339: Property 'decLocator' does not exist on type '{ colors: any; options: any; parent: any; cols: any; rows: any; geometry: any[]; ybase: number; y...'. node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(3332,18): error TS2339: Property 'urxvtMouse' does not exist on type '{ colors: any; options: any; parent: any; cols: any; rows: any; geometry: any[]; ybase: number; y...'. node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(3340,18): error TS2339: Property 'sgrMouse' does not exist on type '{ colors: any; options: any; parent: any; cols: any; rows: any; geometry: any[]; ybase: number; y...'. -node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(3352,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'data' has type 'string' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js 3291:16, but here has type 'any[]'. +node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(3352,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'data' must be of type 'string', but here has type 'any[]'. node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(3367,26): error TS2339: Property 'browser' does not exist on type '{ colors: any; options: any; parent: any; cols: any; rows: any; geometry: any[]; ybase: number; y...'. node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(3389,18): error TS2339: Property 'vt200Mouse' does not exist on type '{ colors: any; options: any; parent: any; cols: any; rows: any; geometry: any[]; ybase: number; y...'. node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/build/xterm.js(3392,24): error TS2339: Property 'normalMouse' does not exist on type '{ colors: any; options: any; parent: any; cols: any; rows: any; geometry: any[]; ybase: number; y...'. @@ -12060,7 +12060,7 @@ node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataP node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(598,35): error TS2694: Namespace 'SDK' has no exported member 'TracingModel'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(621,36): error TS2339: Property 'preciseMillisToString' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(638,38): error TS2694: Namespace 'SDK' has no exported member 'FilmStripModel'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(648,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'image' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js 641:10, but here has type 'new (width?: number, height?: number) => HTMLImageElement'. +node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(648,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'image' must be of type 'any', but here has type 'new (width?: number, height?: number) => HTMLImageElement'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(696,37): error TS2694: Namespace 'TimelineModel' has no exported member 'TimelineIRModel'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(705,35): error TS2694: Namespace 'SDK' has no exported member 'TracingModel'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineFlameChartDataProvider.js(754,35): error TS2694: Namespace 'SDK' has no exported member 'TracingModel'. @@ -12322,7 +12322,7 @@ node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1391 node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1397,19): error TS2694: Namespace 'SDK' has no exported member 'TracingModel'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1404,21): error TS2694: Namespace 'SDK' has no exported member 'TracingModel'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1410,24): error TS2339: Property 'binaryIndexOf' does not exist on type 'any[]'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1434,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'categoryName' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js 1426:12, but here has type 'string'. +node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1434,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'categoryName' must be of type 'any', but here has type 'string'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1444,19): error TS2694: Namespace 'SDK' has no exported member 'TracingModel'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1445,19): error TS2694: Namespace 'SDK' has no exported member 'Target'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1446,15): error TS1055: Type 'Promise' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value. @@ -12814,8 +12814,8 @@ node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js(80,18): error TS node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js(108,18): error TS2694: Namespace 'UI' has no exported member 'GlassPane'. node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js(150,22): error TS2339: Property 'deepElementFromPoint' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js(252,27): error TS2339: Property 'constrain' does not exist on type 'NumberConstructor'. -node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js(263,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'arrowX' has type 'number' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js 250:14, but here has type 'any'. -node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js(305,15): error TS2403: Subsequent variable declarations must have the same type. Variable 'arrowY' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js 208:12, but here has type 'number'. +node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js(263,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'arrowX' must be of type 'number', but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js(305,15): error TS2403: Subsequent variable declarations must have the same type. Variable 'arrowY' must be of type 'any', but here has type 'number'. node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js(306,27): error TS2339: Property 'constrain' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/ui/GlassPane.js(330,19): error TS2694: Namespace 'UI' has no exported member 'Widget'. node_modules/chrome-devtools-frontend/front_end/ui/HistoryInput.js(44,15): error TS2339: Property 'keyCode' does not exist on type 'Event'. @@ -12912,13 +12912,13 @@ node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(443,20): error node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(462,26): error TS2339: Property 'isItemSelectable' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(478,39): error TS2339: Property 'offsetHeight' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(480,26): error TS2339: Property 'isItemSelectable' does not exist on type '() => void'. -node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(500,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'variableOffsets' has type 'any' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js 495:10, but here has type 'Int32Array'. +node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(500,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'variableOffsets' must be of type 'any', but here has type 'Int32Array'. node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(520,82): error TS2339: Property 'heightForItem' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(523,39): error TS2339: Property 'offsetHeight' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(529,35): error TS2339: Property 'constrain' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(557,33): error TS2339: Property 'constrain' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(592,18): error TS2339: Property 'removeChildren' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(637,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'index' has type 'number' at /home/nathansa/ts/tests/cases/user/chrome-devtools-frontend/node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js 632:13, but here has type 'any'. +node_modules/chrome-devtools-frontend/front_end/ui/ListControl.js(637,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'index' must be of type 'number', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/ui/ListModel.js(14,5): error TS2346: Call target does not contain any signatures. node_modules/chrome-devtools-frontend/front_end/ui/ListModel.js(28,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(9,18): error TS2694: Namespace 'UI' has no exported member 'ListWidget'. diff --git a/tests/baselines/reference/varBlock.errors.txt b/tests/baselines/reference/varBlock.errors.txt index 5e80d0846dd..6746a760a44 100644 --- a/tests/baselines/reference/varBlock.errors.txt +++ b/tests/baselines/reference/varBlock.errors.txt @@ -16,7 +16,7 @@ tests/cases/compiler/varBlock.ts(33,25): error TS1039: Initializers are not allo tests/cases/compiler/varBlock.ts(34,19): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/compiler/varBlock.ts(35,25): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/compiler/varBlock.ts(35,35): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/compiler/varBlock.ts(39,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'c' has type 'any' at tests/cases/compiler/varBlock.ts 37:12, but here has type 'number'. +tests/cases/compiler/varBlock.ts(39,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'c' must be of type 'any', but here has type 'number'. tests/cases/compiler/varBlock.ts(39,15): error TS1039: Initializers are not allowed in ambient contexts. @@ -97,6 +97,6 @@ tests/cases/compiler/varBlock.ts(39,15): error TS1039: Initializers are not allo declare var c; declare var c = 10; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'c' has type 'any' at tests/cases/compiler/varBlock.ts 37:12, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'c' must be of type 'any', but here has type 'number'. ~ !!! error TS1039: Initializers are not allowed in ambient contexts. \ No newline at end of file diff --git a/tests/baselines/reference/witness.errors.txt b/tests/baselines/reference/witness.errors.txt index 87eca43ff78..e2475741189 100644 --- a/tests/baselines/reference/witness.errors.txt +++ b/tests/baselines/reference/witness.errors.txt @@ -1,17 +1,17 @@ tests/cases/conformance/types/witness/witness.ts(4,21): error TS2372: Parameter 'pInit' cannot be referenced in its initializer. tests/cases/conformance/types/witness/witness.ts(28,12): error TS2695: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/types/witness/witness.ts(29,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 27:4, but here has type 'number'. +tests/cases/conformance/types/witness/witness.ts(29,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'. tests/cases/conformance/types/witness/witness.ts(30,12): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/types/witness/witness.ts(30,12): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/types/witness/witness.ts(32,12): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/types/witness/witness.ts(32,12): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/types/witness/witness.ts(32,12): error TS2695: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/types/witness/witness.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' has type 'any' at tests/cases/conformance/types/witness/witness.ts 31:4, but here has type 'number'. -tests/cases/conformance/types/witness/witness.ts(37,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 35:4, but here has type 'number'. -tests/cases/conformance/types/witness/witness.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' has type 'any' at tests/cases/conformance/types/witness/witness.ts 37:4, but here has type 'number'. -tests/cases/conformance/types/witness/witness.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'cnd1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 41:4, but here has type 'number'. -tests/cases/conformance/types/witness/witness.ts(57,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'and1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 55:4, but here has type 'string'. -tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 106:4, but here has type '{ m: any; }'. +tests/cases/conformance/types/witness/witness.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' must be of type 'any', but here has type 'number'. +tests/cases/conformance/types/witness/witness.ts(37,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' must be of type 'any', but here has type 'number'. +tests/cases/conformance/types/witness/witness.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' must be of type 'any', but here has type 'number'. +tests/cases/conformance/types/witness/witness.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'cnd1' must be of type 'any', but here has type 'number'. +tests/cases/conformance/types/witness/witness.ts(57,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'and1' must be of type 'any', but here has type 'string'. +tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' must be of type 'any', but here has type '{ m: any; }'. ==== tests/cases/conformance/types/witness/witness.ts (14 errors) ==== @@ -49,7 +49,7 @@ tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequen !!! error TS2695: Left side of comma operator is unused and has no side effects. var co1: number; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 27:4, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'. var co2 = (3, 4, co2); ~ !!! error TS2695: Left side of comma operator is unused and has no side effects. @@ -65,23 +65,23 @@ tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequen !!! error TS2695: Left side of comma operator is unused and has no side effects. var co3: number; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' has type 'any' at tests/cases/conformance/types/witness/witness.ts 31:4, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' must be of type 'any', but here has type 'number'. // Assignment var as1 = (as1 = 2); var as1: number; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 35:4, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' must be of type 'any', but here has type 'number'. var as2 = (as2 = as2 = 2); var as2: number; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' has type 'any' at tests/cases/conformance/types/witness/witness.ts 37:4, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' must be of type 'any', but here has type 'number'. // Conditional var cnd1 = cnd1 ? 0 : 1; var cnd1: number; ~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'cnd1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 41:4, but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'cnd1' must be of type 'any', but here has type 'number'. var cnd2 = cnd1 ? cnd1 ? '' : "" : ''; var cnd2: string; @@ -97,7 +97,7 @@ tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequen var and1 = and1 && ''; var and1: string; ~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'and1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 55:4, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'and1' must be of type 'any', but here has type 'string'. var and2 = '' && and2; var and2: any; var and3 = and3 && and3; @@ -152,7 +152,7 @@ tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequen }; var propAcc1: { m: any; } ~~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 106:4, but here has type '{ m: any; }'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' must be of type 'any', but here has type '{ m: any; }'. // Property access of module member module M2 { diff --git a/tests/cases/compiler/constEnumNamespaceReferenceCausesNoImport.ts b/tests/cases/compiler/constEnumNamespaceReferenceCausesNoImport.ts new file mode 100644 index 00000000000..3df68067ef5 --- /dev/null +++ b/tests/cases/compiler/constEnumNamespaceReferenceCausesNoImport.ts @@ -0,0 +1,16 @@ +// @filename: foo.ts +export const enum ConstFooEnum { + Some, + Values, + Here +}; +export function fooFunc(): void { /* removed */ } +// @filename: index.ts +import * as Foo from "./foo"; + +function check(x: Foo.ConstFooEnum): void { + switch (x) { + case Foo.ConstFooEnum.Some: + break; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts b/tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts new file mode 100644 index 00000000000..459debe63a5 --- /dev/null +++ b/tests/cases/compiler/errorForUsingPropertyOfTypeAsType02.ts @@ -0,0 +1,5 @@ +namespace Test1 { + function foo(x: T) { + let a: T.abc = x.abc; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts b/tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts new file mode 100644 index 00000000000..2ebd0f3c7c3 --- /dev/null +++ b/tests/cases/compiler/errorForUsingPropertyOfTypeAsType03.ts @@ -0,0 +1,26 @@ +namespace Test1 { + enum Color { + Red, + Green, + Blue + } + + type C1 = Color; + type C2 = typeof Color; + + let a1: Color.Red.toString; + let a2: Color.Red["toString"]; + let a3: Color["Red"]["toString"]; + + //let b1: (typeof Color).Red.toString; + //let b2: (typeof Color).Red["toString"]; + let b3: (typeof Color)["Red"]["toString"]; + + let c1: C1.Red.toString; + let c2: C1.Red["toString"]; + let c3: C1["Red"]["toString"]; + + let d1: C2.Red.toString; + let d2: C2.Red["toString"]; + let d3: C2["Red"]["toString"]; +} \ No newline at end of file diff --git a/tests/cases/compiler/instanceofWithPrimitiveUnion.ts b/tests/cases/compiler/instanceofWithPrimitiveUnion.ts new file mode 100644 index 00000000000..ef70aa2602b --- /dev/null +++ b/tests/cases/compiler/instanceofWithPrimitiveUnion.ts @@ -0,0 +1,11 @@ +function test1(x: number | string) { + if (x instanceof Object) { + x; + } +} + +function test2(x: (number | string) | number) { + if (x instanceof Object) { + x; + } +} diff --git a/tests/cases/compiler/jsxMultilineAttributeStringValues.tsx b/tests/cases/compiler/jsxMultilineAttributeStringValues.tsx new file mode 100644 index 00000000000..e5cc60ca653 --- /dev/null +++ b/tests/cases/compiler/jsxMultilineAttributeStringValues.tsx @@ -0,0 +1,7 @@ +// @jsx: preserve +const a = ; +const b = ; diff --git a/tests/cases/compiler/jsxMultilineAttributeValuesReact.tsx b/tests/cases/compiler/jsxMultilineAttributeValuesReact.tsx new file mode 100644 index 00000000000..f2b65bce032 --- /dev/null +++ b/tests/cases/compiler/jsxMultilineAttributeValuesReact.tsx @@ -0,0 +1,11 @@ +// @jsx: react +declare var React: any; +const a = ; +const b = ; +const c = ; diff --git a/tests/cases/conformance/es6/yieldExpressions/generatorNoImplicitReturns.ts b/tests/cases/conformance/es6/yieldExpressions/generatorNoImplicitReturns.ts new file mode 100644 index 00000000000..41445aa4a11 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/generatorNoImplicitReturns.ts @@ -0,0 +1,10 @@ +// @target: esnext +// @noImplicitReturns: true +// @strictNullChecks: false + +function* testGenerator () { + if (Math.random() > 0.5) { + return; + } + yield 'hello'; +} diff --git a/tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx b/tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx index 815cd4abb21..599efc358fc 100644 --- a/tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx +++ b/tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx @@ -1,36 +1,74 @@ // @jsx: preserve +// @filename: 1.tsx declare var React: any; ; +// @filename: 2.tsx ; +// @filename: 3.tsx <:a />; +// @filename: 4.tsx ; +// @filename: 5.tsx ; +// @filename: 6.tsx ; +// @filename: 7.tsx ; +// @filename: 21.tsx ; +// @filename: 22.tsx
; +// @filename: 23.tsx
; +// @filename: 24.tsx
stuff
; + +// @filename: 25.tsx
stuff
; + +// @filename: 26.tsx
>; + +// @filename: 27.tsx >; + +// @filename: 28.tsx ; + +// @filename: 29.tsx ; + +// @filename: 30.tsx }; + +// @filename: 31.tsx ; \ No newline at end of file diff --git a/tests/cases/fourslash/completionForStringLiteralNonrelativeImport8.ts b/tests/cases/fourslash/completionForStringLiteralNonrelativeImport8.ts index 6ba94510e90..603e8d1104d 100644 --- a/tests/cases/fourslash/completionForStringLiteralNonrelativeImport8.ts +++ b/tests/cases/fourslash/completionForStringLiteralNonrelativeImport8.ts @@ -51,5 +51,5 @@ for (const kind of kinds) { verify.completionListContains("1test"); goTo.marker(kind + "2"); - verify.completionListContains("2test", undefined, undefined, undefined, undefined, undefined, { allowDuplicate: true }); // TODO: GH#20042 + verify.completionListContains("2test"); } diff --git a/tests/cases/fourslash/completionInJSDocFunctionNew.ts b/tests/cases/fourslash/completionInJSDocFunctionNew.ts index a3fff51a931..6a06ec76fe5 100644 --- a/tests/cases/fourslash/completionInJSDocFunctionNew.ts +++ b/tests/cases/fourslash/completionInJSDocFunctionNew.ts @@ -6,5 +6,5 @@ ////var f = function () { return new/**/; } goTo.marker(); -verify.completionListCount(118); -verify.completionListContains('new', undefined, undefined, undefined, undefined, undefined, { allowDuplicate: true }); // TODO: GH#20042 +verify.completionListCount(116); +verify.completionListContains('new'); diff --git a/tests/cases/fourslash/completionInJSDocFunctionThis.ts b/tests/cases/fourslash/completionInJSDocFunctionThis.ts index 8f62680205c..0fd771f272b 100644 --- a/tests/cases/fourslash/completionInJSDocFunctionThis.ts +++ b/tests/cases/fourslash/completionInJSDocFunctionThis.ts @@ -5,5 +5,5 @@ ////var f = function (s) { return this/**/; } goTo.marker(); -verify.completionListCount(119); -verify.completionListContains('this', undefined, undefined, undefined, undefined, undefined, { allowDuplicate: true }); // TODO: GH#20042 +verify.completionListCount(117); +verify.completionListContains('this') diff --git a/tests/cases/fourslash/completionListPrimitives.ts b/tests/cases/fourslash/completionListPrimitives.ts index 7442746fa0c..54c518108de 100644 --- a/tests/cases/fourslash/completionListPrimitives.ts +++ b/tests/cases/fourslash/completionListPrimitives.ts @@ -8,5 +8,5 @@ verify.completionListContains("boolean"); verify.completionListContains("null"); verify.completionListContains("number"); verify.completionListContains("string"); -verify.completionListContains("undefined", undefined, undefined, undefined, undefined, undefined, { allowDuplicate: true }); // TODO: GH#20042 +verify.completionListContains("undefined"); verify.completionListContains("void"); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index b38a7f453bc..44c270de4db 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -148,7 +148,7 @@ declare namespace FourSlashInterface { kind?: string, spanIndex?: number, hasAction?: boolean, - options?: { includeExternalModuleExports?: boolean, sourceDisplay?: string, allowDuplicate?: boolean }, + options?: { includeExternalModuleExports?: boolean, sourceDisplay?: string }, ): void; completionListItemsCountIsGreaterThan(count: number): void; completionListIsEmpty(): void; diff --git a/tests/cases/fourslash/getJavaScriptCompletions2.ts b/tests/cases/fourslash/getJavaScriptCompletions2.ts index 736762cd169..b5aab81b434 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions2.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions2.ts @@ -7,4 +7,4 @@ ////v./**/ goTo.marker(); -verify.completionListContains("valueOf", /*displayText:*/ undefined, /*documentation*/ undefined, "method", undefined, undefined, { allowDuplicate: true }); // TODO: GH#20042 +verify.completionListContains("valueOf", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/fourslash/importNameCodeFixNewImportExportEqualsPrimitive.ts b/tests/cases/fourslash/importNameCodeFixNewImportExportEqualsPrimitive.ts new file mode 100644 index 00000000000..0b9dbb489dd --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixNewImportExportEqualsPrimitive.ts @@ -0,0 +1,9 @@ +/// + +////[|valueOf/*0*/();|] + +// @Filename: foo.ts +////declare var x: number; +////export = x; + +verify.not.codeFixAvailable(); // See GH#20191 diff --git a/tests/cases/fourslash/importNameCodeFixNewImportFile5.ts b/tests/cases/fourslash/importNameCodeFixNewImportFile5.ts index 28cf48d8a5f..b92befd9881 100644 --- a/tests/cases/fourslash/importNameCodeFixNewImportFile5.ts +++ b/tests/cases/fourslash/importNameCodeFixNewImportFile5.ts @@ -9,8 +9,8 @@ //// declare var x: MyStatic; //// export = x; -verify.importFixAtPosition([ +-verify.importFixAtPosition([ `import { bar } from "./foo"; bar();` -]); \ No newline at end of file +]); diff --git a/tests/cases/fourslash/navigationBarItemsStaticAndNonStaticNoMerge.ts b/tests/cases/fourslash/navigationBarItemsStaticAndNonStaticNoMerge.ts new file mode 100644 index 00000000000..007a2c79aa3 --- /dev/null +++ b/tests/cases/fourslash/navigationBarItemsStaticAndNonStaticNoMerge.ts @@ -0,0 +1,56 @@ +////class C { +//// static x; +//// x; +////} + +// Anonymous classes are still included. +verify.navigationTree({ + "text": "", + "kind": "script", + "childItems": [ + { + "text": "C", + "kind": "class", + "childItems": [ + { + "text": "x", + "kind": "property", + "kindModifiers": "static" + }, + { + "text": "x", + "kind": "property" + } + ] + } + ] +}); + +verify.navigationBar([ + { + "text": "", + "kind": "script", + "childItems": [ + { + "text": "C", + "kind": "class" + } + ] + }, + { + "text": "C", + "kind": "class", + "childItems": [ + { + "text": "x", + "kind": "property", + "kindModifiers": "static" + }, + { + "text": "x", + "kind": "property" + } + ], + "indent": 1 + } +]); diff --git a/tests/cases/fourslash/refactorInstallTypesForPackage_js.ts b/tests/cases/fourslash/refactorInstallTypesForPackage_js.ts new file mode 100644 index 00000000000..1cce0d33526 --- /dev/null +++ b/tests/cases/fourslash/refactorInstallTypesForPackage_js.ts @@ -0,0 +1,29 @@ +/// + +// @allowJs: true + +// @Filename: /node_modules/abs/index.js +////not read + +// @Filename: /a.js +////import abs = require("/*a*/abs/*b*/"); + +test.setTypesRegistry({ "abs": undefined }); + +goTo.select("a", "b"); +verify.refactor({ + name: "Install missing types package", + actionName: "install", + refactors: [ + { + name: "Install missing types package", + description: "Install missing types package", + actions: [ + { + description: "Install '@types/abs'", + name: "install", + } + ] + } + ], +}); diff --git a/tslint.json b/tslint.json index 718c437b372..737a0ab8318 100644 --- a/tslint.json +++ b/tslint.json @@ -3,6 +3,15 @@ "rulesDirectory": "built/local/tslint/rules", "rules": { "array-type": [true, "array"], + "ban-types": { + "options": [ + ["Object", "Avoid using the `Object` type. Did you mean `object`?"], + ["Function", "Avoid using the `Function` type. Prefer a specific function type, like `() => void`, or use `ts.AnyFunction`."], + ["Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?"], + ["Number", "Avoid using the `Number` type. Did you mean `number`?"], + ["String", "Avoid using the `String` type. Did you mean `string`?"] + ] + }, "boolean-trivia": true, "class-name": true, "comment-format": [true,