From b62ef0d452d0b285cda913665fe360c2b5aa43b5 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 3 Sep 2015 10:49:39 -0700 Subject: [PATCH 01/11] initial revision of reachability checks in binder --- src/compiler/binder.ts | 430 +++++++++++++++++- src/compiler/checker.ts | 58 +-- src/compiler/commandLineParser.ts | 22 +- .../diagnosticInformationMap.generated.ts | 12 +- src/compiler/diagnosticMessages.json | 39 +- src/compiler/types.ts | 8 +- src/harness/harness.ts | 12 + src/services/breakpoints.ts | 5 +- src/services/formatting/smartIndenter.ts | 1 - src/services/navigateTo.ts | 5 +- src/services/services.ts | 6 +- src/services/shims.ts | 1 - .../reference/ParameterList5.errors.txt | 4 +- .../YieldExpression17_es6.errors.txt | 4 +- .../asyncArrowFunction10_es6.errors.txt | 4 +- .../asyncFunctionDeclaration12_es6.errors.txt | 4 +- .../reference/asyncGetter_es6.errors.txt | 4 +- .../computedPropertyNames2_ES5.errors.txt | 8 +- .../computedPropertyNames2_ES6.errors.txt | 8 +- .../computedPropertyNames3_ES5.errors.txt | 8 +- .../computedPropertyNames3_ES6.errors.txt | 8 +- .../conflictingTypeAnnotatedVar.errors.txt | 8 +- ...orOnContextuallyTypedReturnType.errors.txt | 4 +- .../functionImplementationErrors.errors.txt | 9 +- .../functionWithThrowButNoReturn1.errors.txt | 11 - .../functionWithThrowButNoReturn1.symbols | 11 + .../functionWithThrowButNoReturn1.types | 13 + ...gReturnStatementsAndExpressions.errors.txt | 16 +- .../getterMissingReturnError.errors.txt | 4 +- .../invalidReturnStatements.errors.txt | 16 +- .../methodInAmbientClass1.errors.txt | 4 +- .../missingReturnStatement.errors.txt | 4 +- .../missingReturnStatement1.errors.txt | 4 +- .../reference/multiLineErrors.errors.txt | 4 +- ...jectLiteralMemberWithModifiers2.errors.txt | 4 +- .../objectLiteralWithSemicolons5.errors.txt | 4 +- .../reference/parserAccessors1.errors.txt | 4 +- .../reference/parserAccessors10.errors.txt | 4 +- .../reference/parserAccessors3.errors.txt | 4 +- .../reference/parserAccessors7.errors.txt | 4 +- .../parserComputedPropertyName4.errors.txt | 4 +- .../parserComputedPropertyName5.errors.txt | 4 +- .../reference/parserES3Accessors1.errors.txt | 4 +- .../reference/parserES3Accessors3.errors.txt | 4 +- .../parserES5ComputedPropertyName4.errors.txt | 4 +- .../parserErrorRecovery_Block3.errors.txt | 8 +- ...rGetAccessorWithTypeParameters1.errors.txt | 4 +- .../parserMemberAccessor1.errors.txt | 4 +- ...arserMemberAccessorDeclaration1.errors.txt | 4 +- ...rserMemberAccessorDeclaration10.errors.txt | 4 +- ...rserMemberAccessorDeclaration12.errors.txt | 4 +- ...arserMemberAccessorDeclaration2.errors.txt | 4 +- ...arserMemberAccessorDeclaration3.errors.txt | 4 +- ...arserMemberAccessorDeclaration7.errors.txt | 4 +- ...arserMemberAccessorDeclaration8.errors.txt | 4 +- ...arserMemberAccessorDeclaration9.errors.txt | 4 +- .../reference/parserParameterList5.errors.txt | 4 +- .../reference/reachabilityChecks1.errors.txt | 70 +++ .../reference/reachabilityChecks1.js | 100 ++++ .../reference/reachabilityChecks2.js | 9 + .../reference/reachabilityChecks2.symbols | 8 + .../reference/reachabilityChecks2.types | 10 + .../reference/reachabilityChecks3.errors.txt | 16 + .../reference/reachabilityChecks3.js | 22 + .../reference/reachabilityChecks4.errors.txt | 20 + .../reference/reachabilityChecks4.js | 30 ++ .../reference/reachabilityChecks5.errors.txt | 162 +++++++ .../reference/reachabilityChecks5.js | 247 ++++++++++ .../recursiveFunctionTypes.errors.txt | 8 +- .../reference/returnTypeParameter.errors.txt | 4 +- tests/cases/compiler/reachabilityChecks1.ts | 50 ++ tests/cases/compiler/reachabilityChecks2.ts | 6 + tests/cases/compiler/reachabilityChecks3.ts | 11 + tests/cases/compiler/reachabilityChecks4.ts | 15 + tests/cases/compiler/reachabilityChecks5.ts | 131 ++++++ 75 files changed, 1570 insertions(+), 204 deletions(-) delete mode 100644 tests/baselines/reference/functionWithThrowButNoReturn1.errors.txt create mode 100644 tests/baselines/reference/functionWithThrowButNoReturn1.symbols create mode 100644 tests/baselines/reference/functionWithThrowButNoReturn1.types create mode 100644 tests/baselines/reference/reachabilityChecks1.errors.txt create mode 100644 tests/baselines/reference/reachabilityChecks1.js create mode 100644 tests/baselines/reference/reachabilityChecks2.js create mode 100644 tests/baselines/reference/reachabilityChecks2.symbols create mode 100644 tests/baselines/reference/reachabilityChecks2.types create mode 100644 tests/baselines/reference/reachabilityChecks3.errors.txt create mode 100644 tests/baselines/reference/reachabilityChecks3.js create mode 100644 tests/baselines/reference/reachabilityChecks4.errors.txt create mode 100644 tests/baselines/reference/reachabilityChecks4.js create mode 100644 tests/baselines/reference/reachabilityChecks5.errors.txt create mode 100644 tests/baselines/reference/reachabilityChecks5.js create mode 100644 tests/cases/compiler/reachabilityChecks1.ts create mode 100644 tests/cases/compiler/reachabilityChecks2.ts create mode 100644 tests/cases/compiler/reachabilityChecks3.ts create mode 100644 tests/cases/compiler/reachabilityChecks4.ts create mode 100644 tests/cases/compiler/reachabilityChecks5.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 16f2a59a58ddd..c29c761c28aca 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -9,6 +9,21 @@ namespace ts { Instantiated = 1, ConstEnumOnly = 2 } + + const enum Reachability { + Unintialized = 1 << 0, + Reachable = 1 << 1, + Unreachable = 1 << 2, + ReportedUnreachable = 1 << 3 + } + + function or(state1: Reachability, state2: Reachability): Reachability { + return (state1 | state2) & Reachability.Reachable + ? Reachability.Reachable + : (state1 & state2) & Reachability.ReportedUnreachable + ? Reachability.ReportedUnreachable + : Reachability.Unreachable; + } export function getModuleInstanceState(node: Node): ModuleInstanceState { // A module is uninstantiated if it contains only @@ -77,18 +92,25 @@ namespace ts { IsContainerWithLocals = IsContainer | HasLocals } - export function bindSourceFile(file: SourceFile) { + export function bindSourceFile(file: SourceFile, options: CompilerOptions) { let start = new Date().getTime(); - bindSourceFileWorker(file); + bindSourceFileWorker(file, options); bindTime += new Date().getTime() - start; } - function bindSourceFileWorker(file: SourceFile) { + function bindSourceFileWorker(file: SourceFile, options: CompilerOptions) { let parent: Node; let container: Node; let blockScopeContainer: Node; let lastContainer: Node; + // state used by reachability checks + let hasExplicitReturn: boolean; + let currentReachabilityState: Reachability; + let labelStack: Reachability[]; + let labels: Map; + let implicitLabels: number[]; + // If this file is an external module, then it is automatically in strict-mode according to // ES6. If it is not an external module, then we'll determine if it is in strict mode or // not depending on if we see "use strict" in certain places (or if we hit a class/namespace). @@ -329,12 +351,273 @@ namespace ts { blockScopeContainer.locals = undefined; } - forEachChild(node, bind); + bindWithReachabilityChecks(node); container = saveContainer; parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } + + function shouldSaveReachabilityState(n: Node): boolean { + return n.kind === SyntaxKind.SourceFile || n.kind === SyntaxKind.ModuleBlock || isFunctionLike(n); + } + + function bindWithReachabilityChecks(node: Node): void { + let savedReachabilityState: Reachability; + let savedLabelStack: Reachability[]; + let savedLabels: Map; + let savedImplicitLabels: number[]; + let savedHasExplicitReturn: boolean; + + let saveState = shouldSaveReachabilityState(node); + if (saveState) { + savedReachabilityState = currentReachabilityState; + savedLabelStack = labelStack; + savedLabels = labels; + savedImplicitLabels = implicitLabels; + savedHasExplicitReturn = hasExplicitReturn; + + currentReachabilityState = Reachability.Reachable; + hasExplicitReturn = false; + labelStack = labels = implicitLabels = undefined; + } + + if (!bindReachableStatement(node)) { + forEachChild(node, bind); + } + + if (currentReachabilityState === Reachability.Reachable && isFunctionLike(node) && nodeIsPresent((node).body)) { + node.flags |= NodeFlags.HasImplicitReturn; + if (hasExplicitReturn) { + node.flags |= NodeFlags.HasExplicitReturn; + } + } + + if (saveState) { + hasExplicitReturn = savedHasExplicitReturn; + currentReachabilityState = savedReachabilityState; + labelStack = savedLabelStack; + labels = savedLabels; + implicitLabels = savedImplicitLabels; + } + } + + function bindReachableStatement(n: Node): boolean { + if (checkUnreachable(n)) { + return false; + } + + switch(n.kind) { + case SyntaxKind.WhileStatement: + return bindWhileStatement(n); + case SyntaxKind.DoStatement: + return bindDoStatement(n); + case SyntaxKind.ForStatement: + return bindForStatement(n); + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: + return bindForInOrForOfStatement(n); + case SyntaxKind.IfStatement: + return bindIfStatement(n); + case SyntaxKind.ReturnStatement: + case SyntaxKind.ThrowStatement: + return bindReturnOrThrow(n); + case SyntaxKind.BreakStatement: + case SyntaxKind.ContinueStatement: + return bindBreakOrContinueStatement(n); + case SyntaxKind.TryStatement: + return bindTryStatement(n); + case SyntaxKind.SwitchStatement: + return bindSwitchStatement(n); + case SyntaxKind.CaseBlock: + return bindCaseBlock(n); + case SyntaxKind.LabeledStatement: + return bindLabeledStatement(n); + default: + return false; + } + } + + function bindWhileStatement(n: WhileStatement): boolean { + const preWhileState = + n.expression.kind === SyntaxKind.FalseKeyword ? Reachability.Unreachable : currentReachabilityState; + const postWhileState = + n.expression.kind === SyntaxKind.TrueKeyword ? Reachability.Unreachable : currentReachabilityState; + + // bind expressions (don't affect reachability) + bind(n.expression); + + currentReachabilityState = preWhileState; + const postWhileLabel = pushImplicitLabel(); + bind(n.statement); + popImplicitLabel(postWhileLabel, postWhileState) + + return true; + } + + function bindDoStatement(n: DoStatement): boolean { + const preDoState = currentReachabilityState; + + const postDoLabel = pushImplicitLabel(); + bind(n.statement); + var postDoState = n.expression.kind === SyntaxKind.TrueKeyword ? Reachability.Unreachable : preDoState; + popImplicitLabel(postDoLabel, postDoState); + + // bind expressions (don't affect reachability) + bind(n.expression); + + return true; + } + + function bindForStatement(n: ForStatement): boolean { + const preForState = currentReachabilityState; + const postForLabel = pushImplicitLabel(); + + // bind expressions (don't affect reachability) + bind(n.initializer); + bind(n.condition); + bind(n.incrementor); + + bind(n.statement); + + // for statement is considered infinite when it condition is either omitted or is true keyword + // - for(..;;..) + // - for(..;true;..) + const isInfiniteLoop = (!n.condition || n.condition.kind === SyntaxKind.TrueKeyword); + const postForState = isInfiniteLoop ? Reachability.Unreachable : preForState; + popImplicitLabel(postForLabel, postForState); + + return true; + } + + function bindForInOrForOfStatement(n: ForInStatement | ForOfStatement): boolean { + const preStatementState = currentReachabilityState; + const postStatementLabel = pushImplicitLabel(); + + // bind expressions (don't affect reachability) + bind(n.initializer); + bind(n.expression); + + bind(n.statement); + popImplicitLabel(postStatementLabel, preStatementState); + + return true; + } + + function bindIfStatement(n: IfStatement): boolean { + const ifTrueState = n.expression.kind === SyntaxKind.FalseKeyword ? Reachability.Unreachable : currentReachabilityState; + const ifFalseState = n.expression.kind === SyntaxKind.TrueKeyword ? Reachability.Unreachable : currentReachabilityState; + + currentReachabilityState = ifTrueState; + + // bind expression (don't affect reachability) + bind(n.expression); + + bind(n.thenStatement); + if (n.elseStatement) { + const preElseState = currentReachabilityState; + currentReachabilityState = ifFalseState; + bind(n.elseStatement); + currentReachabilityState = or(currentReachabilityState, preElseState); + } + else { + currentReachabilityState = or(currentReachabilityState, ifFalseState); + } + + return true; + } + + function bindReturnOrThrow(n: ReturnStatement | ThrowStatement): boolean { + // bind expression (don't affect reachability) + bind(n.expression); + if (n.kind === SyntaxKind.ReturnStatement) { + hasExplicitReturn = true; + } + currentReachabilityState = Reachability.Unreachable; + + return true; + } + + function bindBreakOrContinueStatement(n: BreakOrContinueStatement): boolean { + // call bind on label (don't affect reachability) + bind(n.label); + if (n.kind === SyntaxKind.BreakStatement) { + jumpToLabel(n.label, currentReachabilityState); + } + else { + jumpToLabel(n.label, Reachability.Unreachable); // touch label so it will be marked a used + } + currentReachabilityState = Reachability.Unreachable; + + return true; + } + + function bindTryStatement(n: TryStatement): boolean { + // catch\finally blocks has the same reachability as try block + const preTryState = currentReachabilityState; + bind(n.tryBlock); + const postTryState = currentReachabilityState; + + currentReachabilityState = preTryState; + bind(n.catchClause); + const postCatchState = currentReachabilityState; + + currentReachabilityState = preTryState; + bind(n.finallyBlock); + + // post catch/finally state is reachable if + // - post try state is reachable - control flow can fall out of try block + // - post catch state is reachable - control flow can fall out of catch block + currentReachabilityState = or(postTryState, postCatchState); + + return true; + } + + function bindSwitchStatement(n: SwitchStatement): boolean { + const preSwitchState = currentReachabilityState; + const postSwitchLabel = pushImplicitLabel(); + + // bind expression (don't affect reachability) + bind(n.expression); + + bind(n.caseBlock); + + const hasDefault = forEach(n.caseBlock.clauses, c => c.kind === SyntaxKind.DefaultClause); + + // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case + var postSwitchState = hasDefault && currentReachabilityState !== Reachability.Reachable ? Reachability.Unreachable : preSwitchState; + + popImplicitLabel(postSwitchLabel, postSwitchState); + + return true; + } + + function bindCaseBlock(n: CaseBlock): boolean { + const startState = currentReachabilityState; + + for(let clause of n.clauses) { + currentReachabilityState = startState; + bind(clause); + if (clause.statements.length && currentReachabilityState === Reachability.Reachable && options.noFallthroughCasesInSwitch) { + errorOnFirstToken(clause, Diagnostics.Fallthrough_case_in_switch); + } + } + + return true; + } + + function bindLabeledStatement(n: LabeledStatement): boolean { + // call bind on label (don't affect reachability) + bind(n.label); + + var ok = pushNamedLabel(n.label); + bind(n.statement); + if (ok) { + popNamedLabel(n.label, currentReachabilityState); + } + + return true; + } function getContainerFlags(node: Node): ContainerFlags { switch (node.kind) { @@ -472,17 +755,6 @@ namespace ts { : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } - function isAmbientContext(node: Node): boolean { - while (node) { - if (node.flags & NodeFlags.Ambient) { - return true; - } - - node = node.parent; - } - return false; - } - function hasExportDeclarations(node: ModuleDeclaration | SourceFile): boolean { let body = node.kind === SyntaxKind.SourceFile ? node : (node).body; if (body.kind === SyntaxKind.SourceFile || body.kind === SyntaxKind.ModuleBlock) { @@ -498,7 +770,7 @@ namespace ts { function setExportContextFlag(node: ModuleDeclaration | SourceFile) { // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular // declarations with export modifiers) is an export context in which declarations are implicitly exported. - if (isAmbientContext(node) && !hasExportDeclarations(node)) { + if (isInAmbientContext(node) && !hasExportDeclarations(node)) { node.flags |= NodeFlags.ExportContext; } else { @@ -750,11 +1022,11 @@ namespace ts { function checkStrictModeWithStatement(node: WithStatement) { // Grammar checking for withStatement if (inStrictMode) { - grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode); + errorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode); } } - function grammarErrorOnFirstToken(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any) { + function errorOnFirstToken(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any) { let span = getSpanOfTokenAtPosition(file, node.pos); file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2)); } @@ -764,6 +1036,10 @@ namespace ts { } function bind(node: Node) { + if (!node) { + return; + } + node.parent = parent; let savedInStrictMode = inStrictMode; @@ -1065,5 +1341,123 @@ namespace ts { ? bindAnonymousDeclaration(node, symbolFlags, "__computed") : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); } + + // reachability checks + + function pushNamedLabel(name: Identifier): boolean { + initializeReachabilityStateIfNecessary(); + + if (hasProperty(labels, name.text)) { + return false; + } + labels[name.text] = labelStack.push(Reachability.Unintialized) - 1; + return true; + } + + function pushImplicitLabel(): number { + initializeReachabilityStateIfNecessary(); + + let index = labelStack.push(Reachability.Unintialized) - 1; + implicitLabels.push(index); + return index; + } + + function popNamedLabel(label: Identifier, outerState: Reachability): void { + initializeReachabilityStateIfNecessary(); + + let index = labels[label.text]; + Debug.assert(index !== undefined); + Debug.assert(labelStack.length == index + 1); + + labels[label.text] = undefined; + + setCurrentStateAtLabel(labelStack.pop(), outerState, label); + } + + function popImplicitLabel(implicitLabelIndex: number, outerState: Reachability): void { + initializeReachabilityStateIfNecessary(); + + Debug.assert(labelStack.length === implicitLabelIndex + 1, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`); + let i = implicitLabels.pop(); + Debug.assert(implicitLabelIndex === i, `i: ${i}, index: ${implicitLabelIndex}`); + setCurrentStateAtLabel(labelStack.pop(), outerState, /*name*/ undefined); + } + + function setCurrentStateAtLabel(innerMergedState: Reachability, outerState: Reachability, label: Identifier): void { + initializeReachabilityStateIfNecessary(); + + if (innerMergedState === Reachability.Unintialized) { + if (label && options.noUnusedLabels) { + file.bindDiagnostics.push(createDiagnosticForNode(label, Diagnostics.Unused_label)); + } + currentReachabilityState = outerState; + } + else { + currentReachabilityState = or(innerMergedState, outerState); + } + } + + function jumpToLabel(label: Identifier, outerState: Reachability): void { + initializeReachabilityStateIfNecessary(); + + const index = label ? labels[label.text] : lastOrUndefined(implicitLabels); + if (index === undefined) { + // reference to unknown label or + // break/continue used outside of loops + return; + } + const stateAtLabel = labelStack[index]; + labelStack[index] = stateAtLabel === Reachability.Unintialized ? outerState : or(stateAtLabel, outerState); + } + + function checkUnreachable(node: Node): boolean { + switch(currentReachabilityState) { + case Reachability.Unreachable: + const reportError = + isStatement(node) || + node.kind === SyntaxKind.ClassDeclaration || + node.kind === SyntaxKind.ModuleDeclaration || + (node.kind === SyntaxKind.EnumDeclaration && (!isConstEnumDeclaration(node) || options.preserveConstEnums)); + + if (reportError) { + currentReachabilityState = Reachability.ReportedUnreachable; + + // unreachable code is reported if + // - user has explicitly asked about it AND + // - statement is in ambient context (statements in ambient context is already an error so we shoult not report extras) AND + // - node is not variable statement OR + // - node is block scoped variable statement OR + // - node is not block scoped variable statement and at least one variable declaration has initializer + // Rationale: we don't want to report errors on non-initialized var's since they are hoisted + // On the other side we do want to report errors on non-initialized 'lets' because of TDZ + const reportUnreachableCode = + options.noUnreachableCode && + !isInAmbientContext(node) && + ( + node.kind !== SyntaxKind.VariableStatement || + getCombinedNodeFlags((node).declarationList) & NodeFlags.BlockScoped || + forEach((node).declarationList.declarations, d => d.initializer) + ) + + if (reportUnreachableCode) { + file.bindDiagnostics.push(createDiagnosticForNode(node, Diagnostics.Unreachable_code_detected)); + } + } + case Reachability.ReportedUnreachable: + return true; + default: + return false; + } + } + + function initializeReachabilityStateIfNecessary(): void { + if (labels) { + return; + } + currentReachabilityState = Reachability.Reachable; + labels = {}; + labelStack = []; + implicitLabels = []; + } } } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f71009c7b650d..0d795be00912a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -158,6 +158,8 @@ namespace ts { let getGlobalPromiseConstructorLikeType: () => ObjectType; let getGlobalThenableType: () => ObjectType; + let jsxElementClassType: Type; + let tupleTypes: Map = {}; let unionTypes: Map = {}; let intersectionTypes: Map = {}; @@ -7560,7 +7562,6 @@ namespace ts { return prop || unknownSymbol; } - let jsxElementClassType: Type = undefined; function getJsxGlobalElementClassType(): Type { if (!jsxElementClassType) { jsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); @@ -9277,21 +9278,11 @@ namespace ts { return aggregatedTypes; } - function bodyContainsAReturnStatement(funcBody: Block) { - return forEachReturnStatement(funcBody, returnStatement => { - return true; - }); - } - - function bodyContainsSingleThrowStatement(body: Block) { - return (body.statements.length === 1) && (body.statements[0].kind === SyntaxKind.ThrowStatement); - } - // TypeScript Specification 1.0 (6.3) - July 2014 // An explicitly typed function whose return type isn't the Void or the Any type // must have at least one return statement somewhere in its body. // An exception to this rule is if the function implementation consists of a single 'throw' statement. - function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func: FunctionLikeDeclaration, returnType: Type): void { + function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func: FunctionLikeDeclaration, returnType: Type): void { if (!produceDiagnostics) { return; } @@ -9302,26 +9293,20 @@ namespace ts { } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. - if (nodeIsMissing(func.body) || func.body.kind !== SyntaxKind.Block) { + // also if HasImplicitReturnValue flags is not set this means that all codepaths in function body end with return of throw + if (nodeIsMissing(func.body) || func.body.kind !== SyntaxKind.Block || !(func.flags & NodeFlags.HasImplicitReturn)) { return; } - - let bodyBlock = func.body; - - // Ensure the body has at least one return expression. - if (bodyContainsAReturnStatement(bodyBlock)) { - return; + + if (func.flags & NodeFlags.HasExplicitReturn) { + if (compilerOptions.noImplicitReturns) { + error(func.type, Diagnostics.Not_all_code_paths_return_a_value); + } } - - // If there are no return expressions, then we need to check if - // the function body consists solely of a throw statement; - // this is to make an exception for unimplemented functions. - if (bodyContainsSingleThrowStatement(bodyBlock)) { - return; + else { + // This function does not conform to the specification. + error(func.type, Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value); } - - // This function does not conform to the specification. - error(func.type, Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement); } function checkFunctionExpressionOrObjectLiteralMethod(node: FunctionExpression | MethodDeclaration, contextualMapper?: TypeMapper): Type { @@ -9401,7 +9386,7 @@ namespace ts { } if (returnType && !node.asteriskToken) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, isAsync ? promisedType : returnType); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType); } if (node.body) { @@ -10579,8 +10564,15 @@ namespace ts { checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); if (node.kind === SyntaxKind.GetAccessor) { - if (!isInAmbientContext(node) && nodeIsPresent(node.body) && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { - error(node.name, Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); + if (!isInAmbientContext(node) && nodeIsPresent(node.body) && (node.flags & NodeFlags.HasImplicitReturn)) { + if (node.flags & NodeFlags.HasExplicitReturn) { + if (compilerOptions.noImplicitReturns) { + error(node.name, Diagnostics.Not_all_code_paths_return_a_value); + } + } + else { + error(node.name, Diagnostics.A_get_accessor_must_return_a_value); + } } } @@ -11505,7 +11497,7 @@ namespace ts { promisedType = checkAsyncFunctionReturnType(node); } - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, isAsync ? promisedType : returnType); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType); } if (produceDiagnostics && !node.type) { @@ -14524,7 +14516,7 @@ namespace ts { function initializeTypeChecker() { // Bind all source files and propagate errors forEach(host.getSourceFiles(), file => { - bindSourceFile(file); + bindSourceFile(file, compilerOptions); }); // Initialize global symbol table diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index c56a18b3ab29d..c773be4dfb894 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -244,7 +244,27 @@ namespace ts { "classic": ModuleResolutionKind.Classic }, description: Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_or_classic_TypeScript_pre_1_6 - } + }, + { + name: "noUnusedLabels", + type: "boolean", + description: Diagnostics.Report_error_on_unused_labels + }, + { + name: "noImplicitReturns", + type: "boolean", + description: Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + description: Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement + }, + { + name: "noUnreachableCode", + type: "boolean", + description: Diagnostics.Report_errors_on_unreachable_code + } ]; /* @internal */ diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index f7351bf6912d0..2fc382c1ea9aa 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -256,7 +256,7 @@ namespace ts { Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: { code: 2353, category: DiagnosticCategory.Error, key: "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'." }, No_best_common_type_exists_among_return_expressions: { code: 2354, category: DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: { code: 2355, category: DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: DiagnosticCategory.Error, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: DiagnosticCategory.Error, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, @@ -277,7 +277,7 @@ namespace ts { Duplicate_number_index_signature: { code: 2375, category: DiagnosticCategory.Error, key: "Duplicate number index signature." }, A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: DiagnosticCategory.Error, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: DiagnosticCategory.Error, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: DiagnosticCategory.Error, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, + A_get_accessor_must_return_a_value: { code: 2378, category: DiagnosticCategory.Error, key: "A 'get' accessor must return a value." }, Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: DiagnosticCategory.Error, key: "Getter and setter accessors do not agree in visibility." }, get_and_set_accessor_must_have_the_same_type: { code: 2380, category: DiagnosticCategory.Error, key: "'get' and 'set' accessor must have the same type." }, A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: DiagnosticCategory.Error, key: "A signature with an implementation cannot use a string literal type." }, @@ -570,6 +570,10 @@ namespace ts { Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: { code: 6070, category: DiagnosticCategory.Message, key: "Initializes a TypeScript project and creates a tsconfig.json file." }, Successfully_created_a_tsconfig_json_file: { code: 6071, category: DiagnosticCategory.Message, key: "Successfully created a tsconfig.json file." }, Suppress_excess_property_checks_for_object_literals: { code: 6072, category: DiagnosticCategory.Message, key: "Suppress excess property checks for object literals." }, + Report_error_on_unused_labels: { code: 6073, category: DiagnosticCategory.Message, key: "Report error on unused labels." }, + Report_error_when_not_all_code_paths_in_function_return_a_value: { code: 6074, category: DiagnosticCategory.Message, key: "Report error when not all code paths in function return a value." }, + Report_errors_for_fallthrough_cases_in_switch_statement: { code: 6075, category: DiagnosticCategory.Message, key: "Report errors for fallthrough cases in switch statement." }, + Report_errors_on_unreachable_code: { code: 6076, category: DiagnosticCategory.Message, key: "Report errors on unreachable code." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -587,6 +591,10 @@ namespace ts { Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: DiagnosticCategory.Error, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { code: 7025, category: DiagnosticCategory.Error, key: "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type." }, JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: { code: 7026, category: DiagnosticCategory.Error, key: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists" }, + Unreachable_code_detected: { code: 7027, category: DiagnosticCategory.Error, key: "Unreachable code detected." }, + Unused_label: { code: 7028, category: DiagnosticCategory.Error, key: "Unused label." }, + Fallthrough_case_in_switch: { code: 7029, category: DiagnosticCategory.Error, key: "Fallthrough case in switch." }, + Not_all_code_paths_return_a_value: { code: 7030, category: DiagnosticCategory.Error, key: "Not all code paths return a value." }, You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." }, You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." }, import_can_only_be_used_in_a_ts_file: { code: 8002, category: DiagnosticCategory.Error, key: "'import ... =' can only be used in a .ts file." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 9fd08ef9bca07..d62b837ea5b65 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1013,7 +1013,7 @@ "category": "Error", "code": 2354 }, - "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.": { + "A function whose declared type is neither 'void' nor 'any' must return a value.": { "category": "Error", "code": 2355 }, @@ -1097,7 +1097,7 @@ "category": "Error", "code": 2377 }, - "A 'get' accessor must return a value or consist of a single 'throw' statement.": { + "A 'get' accessor must return a value.": { "category": "Error", "code": 2378 }, @@ -2270,7 +2270,22 @@ "category": "Message", "code": 6072 }, - + "Report error on unused labels.": { + "category": "Message", + "code": 6073 + }, + "Report error when not all code paths in function return a value.": { + "category": "Message", + "code": 6074 + }, + "Report errors for fallthrough cases in switch statement.": { + "category": "Message", + "code": 6075 + }, + "Report errors on unreachable code.": { + "category": "Message", + "code": 6076 + }, "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", "code": 7005 @@ -2339,8 +2354,22 @@ "category": "Error", "code": 7026 }, - - + "Unreachable code detected.": { + "category": "Error", + "code": 7027 + }, + "Unused label.": { + "category": "Error", + "code": 7028 + }, + "Fallthrough case in switch.": { + "category": "Error", + "code": 7029 + }, + "Not all code paths return a value.": { + "category": "Error", + "code": 7030 + }, "You cannot rename this element.": { "category": "Error", "code": 8000 diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 47182e3952737..0d2526cef98f0 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -376,6 +376,8 @@ namespace ts { OctalLiteral = 0x00010000, // Octal numeric literal Namespace = 0x00020000, // Namespace declaration ExportContext = 0x00040000, // Export context (initialized by binding) + HasImplicitReturn = 0x00080000, // If function implicitly returns on one of codepaths (initialized by binding) + HasExplicitReturn = 0x00100000, // If function has explicit reachable return on one of codepaths (initialized by binding) Modifier = Export | Ambient | Public | Private | Protected | Static | Abstract | Default | Async, AccessibilityModifier = Public | Private | Protected, @@ -2057,7 +2059,11 @@ namespace ts { experimentalDecorators?: boolean; experimentalAsyncFunctions?: boolean; emitDecoratorMetadata?: boolean; - moduleResolution?: ModuleResolutionKind + moduleResolution?: ModuleResolutionKind, + noUnusedLabels?: boolean, + noImplicitReturns?: boolean, + noFallthroughCasesInSwitch?: boolean, + noUnreachableCode?: boolean, /* @internal */ stripInternal?: boolean; // Skip checking lib.d.ts to help speed up tests. diff --git a/src/harness/harness.ts b/src/harness/harness.ts index f65a4f88730fe..a23f19e36b779 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1242,6 +1242,18 @@ module Harness { setting.value.toLowerCase() === "preserve" ? ts.JsxEmit.Preserve : ts.JsxEmit.None; break; + case "nounusedlabels": + options.noUnusedLabels = setting.value === "true" + break; + case "noimplicitreturns": + options.noImplicitReturns = setting.value === "true" + break; + case "nofallthroughcasesinswitch": + options.noFallthroughCasesInSwitch = setting.value === "true" + break; + case "nounreachablecode": + options.noUnreachableCode = setting.value === "true" + break; default: throw new Error("Unsupported compiler setting " + setting.flag); diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 227ba6a79700e..e307b21979e26 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -446,7 +446,7 @@ namespace ts.BreakpointResolver { // fall through. case SyntaxKind.CatchClause: - return spanInNode(lastOrUndefined((node.parent).statements));; + return spanInNode(lastOrUndefined((node.parent).statements)); case SyntaxKind.CaseBlock: // breakpoint in last statement of the last clause @@ -493,9 +493,6 @@ namespace ts.BreakpointResolver { default: return spanInNode(node.parent); } - - // Default to parent node - return spanInNode(node.parent); } function spanInColonToken(node: Node): TextSpan { diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index ebbf09e9feb46..760ee16a50763 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -340,7 +340,6 @@ namespace ts.formatting { return node; } } - return node; } } diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts index bc506bc22f90f..2a0abba8695b7 100644 --- a/src/services/navigateTo.ts +++ b/src/services/navigateTo.ts @@ -6,6 +6,9 @@ namespace ts.NavigateTo { let patternMatcher = createPatternMatcher(searchValue); let rawItems: RawNavigateToItem[] = []; + // This means "compare in a case insensitive manner." + let baseSensitivity: Intl.CollatorOptions = { sensitivity: "base" }; + // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] forEach(program.getSourceFiles(), sourceFile => { cancellationToken.throwIfCancellationRequested(); @@ -162,8 +165,6 @@ namespace ts.NavigateTo { return bestMatchKind; } - // This means "compare in a case insensitive manner." - let baseSensitivity: Intl.CollatorOptions = { sensitivity: "base" }; function compareNavigateToItems(i1: RawNavigateToItem, i2: RawNavigateToItem) { // TODO(cyrusn): get the gamut of comparisons that VS already uses here. // Right now we just sort by kind first, and then by name of the item. diff --git a/src/services/services.ts b/src/services/services.ts index 752fb93cd00e5..44d9786566bcd 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4863,7 +4863,7 @@ namespace ts { else if (!isFunctionLike(node)) { forEachChild(node, aggregate); } - }; + } } /** @@ -4910,7 +4910,7 @@ namespace ts { else if (!isFunctionLike(node)) { forEachChild(node, aggregate); } - }; + } } function ownsBreakOrContinueStatement(owner: Node, statement: BreakOrContinueStatement): boolean { @@ -6219,8 +6219,6 @@ namespace ts { } return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; - - Debug.fail("Unknown declaration type"); } function isTypeReference(node: Node): boolean { diff --git a/src/services/shims.ts b/src/services/shims.ts index 307062cebd8cc..ace438b277833 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -320,7 +320,6 @@ namespace ts { // TODO: should this be '==='? if (settingsJson == null || settingsJson == "") { throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); - return null; } return JSON.parse(settingsJson); } diff --git a/tests/baselines/reference/ParameterList5.errors.txt b/tests/baselines/reference/ParameterList5.errors.txt index 02b86633b950d..618ce74091527 100644 --- a/tests/baselines/reference/ParameterList5.errors.txt +++ b/tests/baselines/reference/ParameterList5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/ParameterList5.ts(1,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/ParameterList5.ts(1,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/ParameterList5.ts(1,16): error TS2369: A parameter property is only allowed in a constructor implementation. tests/cases/compiler/ParameterList5.ts(1,29): error TS2304: Cannot find name 'C'. @@ -6,7 +6,7 @@ tests/cases/compiler/ParameterList5.ts(1,29): error TS2304: Cannot find name 'C' ==== tests/cases/compiler/ParameterList5.ts (3 errors) ==== function A(): (public B) => C { ~~~~~~~~~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. ~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. ~ diff --git a/tests/baselines/reference/YieldExpression17_es6.errors.txt b/tests/baselines/reference/YieldExpression17_es6.errors.txt index bc2622125265e..f987517371f87 100644 --- a/tests/baselines/reference/YieldExpression17_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression17_es6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS2378: A 'get' accessor must return a value. tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,23): error TS1163: A 'yield' expression is only allowed in a generator body. @@ -8,6 +8,6 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,23): err ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. ~~~~~ !!! error TS1163: A 'yield' expression is only allowed in a generator body. \ No newline at end of file diff --git a/tests/baselines/reference/asyncArrowFunction10_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction10_es6.errors.txt index 2476eaec6e360..08e59e69b9f15 100644 --- a/tests/baselines/reference/asyncArrowFunction10_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction10_es6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction10_es6.ts(2,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction10_es6.ts(2,17): error TS1005: ',' expected. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction10_es6.ts(2,20): error TS1005: '=' expected. -tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction10_es6.ts(2,24): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction10_es6.ts(2,24): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction10_es6.ts(4,11): error TS2304: Cannot find name 'await'. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction10_es6.ts ~ !!! error TS1005: '=' expected. ~~~~~~~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. // Legal to use 'await' in a type context. var v: await; ~~~~~ diff --git a/tests/baselines/reference/asyncFunctionDeclaration12_es6.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration12_es6.errors.txt index 978492f0744c8..43df8e21659cd 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration12_es6.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration12_es6.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration12_es6.ts(1,24): error TS1005: '(' expected. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration12_es6.ts(1,29): error TS1005: '=' expected. -tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration12_es6.ts(1,33): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration12_es6.ts(1,33): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration12_es6.ts(1,47): error TS1005: '=>' expected. @@ -11,6 +11,6 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1 ~ !!! error TS1005: '=' expected. ~~~~~~~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. ~ !!! error TS1005: '=>' expected. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGetter_es6.errors.txt b/tests/baselines/reference/asyncGetter_es6.errors.txt index 5f5a9f6b1d7f9..f6deea16d0699 100644 --- a/tests/baselines/reference/asyncGetter_es6.errors.txt +++ b/tests/baselines/reference/asyncGetter_es6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/async/es6/asyncGetter_es6.ts(2,3): error TS1042: 'async' modifier cannot be used here. -tests/cases/conformance/async/es6/asyncGetter_es6.ts(2,13): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/async/es6/asyncGetter_es6.ts(2,13): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/async/es6/asyncGetter_es6.ts (2 errors) ==== @@ -8,6 +8,6 @@ tests/cases/conformance/async/es6/asyncGetter_es6.ts(2,13): error TS2378: A 'get ~~~~~ !!! error TS1042: 'async' modifier cannot be used here. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames2_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames2_ES5.errors.txt index 2fbf68b443770..e704126c055f4 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames2_ES5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(6,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. -tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(8,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(6,9): error TS2378: A 'get' accessor must return a value. +tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(8,16): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts (2 errors) ==== @@ -10,10 +10,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts(8,1 static [methodName]() { } get [accessorName]() { } ~~~~~~~~~~~~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. set [accessorName](v) { } static get [accessorName]() { } ~~~~~~~~~~~~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. static set [accessorName](v) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames2_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames2_ES6.errors.txt index 3f18a8764b40e..6b2949816385f 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames2_ES6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES6.ts(6,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. -tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES6.ts(8,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES6.ts(6,9): error TS2378: A 'get' accessor must return a value. +tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES6.ts(8,16): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES6.ts (2 errors) ==== @@ -10,10 +10,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES6.ts(8,1 static [methodName]() { } get [accessorName]() { } ~~~~~~~~~~~~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. set [accessorName](v) { } static get [accessorName]() { } ~~~~~~~~~~~~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. static set [accessorName](v) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt index a31965dc69e9a..fd6f8e8bdc1c6 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames3_ES5.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,9): error TS2378: A 'get' accessor must return a value. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(5,17): error TS1102: 'delete' cannot be called on an identifier in strict mode. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,16): error TS2378: A 'get' accessor must return a value. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,16): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. @@ -16,7 +16,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,1 !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. get [delete id]() { } ~~~~~~~~~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. ~~~~~~~~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. ~~ @@ -26,7 +26,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES5.ts(7,1 !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. static get [""]() { } ~~~~~~~~~~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. ~~~~~~~~~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. static set [id.toString()](v) { } diff --git a/tests/baselines/reference/computedPropertyNames3_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames3_ES6.errors.txt index b90091123473a..4299437777d5e 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames3_ES6.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(5,9): error TS2378: A 'get' accessor must return a value. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(5,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(5,17): error TS1102: 'delete' cannot be called on an identifier in strict mode. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(6,9): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(7,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(7,16): error TS2378: A 'get' accessor must return a value. tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(7,16): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. @@ -16,7 +16,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(7,1 !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. get [delete id]() { } ~~~~~~~~~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. ~~~~~~~~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. ~~ @@ -26,7 +26,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames3_ES6.ts(7,1 !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. static get [""]() { } ~~~~~~~~~~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. ~~~~~~~~~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. static set [id.toString()](v) { } diff --git a/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt b/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt index 0b667108b5f0d..afae9d4043191 100644 --- a/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt +++ b/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/conflictingTypeAnnotatedVar.ts(1,5): error TS2300: Duplicate identifier 'foo'. tests/cases/compiler/conflictingTypeAnnotatedVar.ts(2,10): error TS2300: Duplicate identifier 'foo'. -tests/cases/compiler/conflictingTypeAnnotatedVar.ts(2,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/conflictingTypeAnnotatedVar.ts(2,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,10): error TS2300: Duplicate identifier 'foo'. -tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. ==== tests/cases/compiler/conflictingTypeAnnotatedVar.ts (5 errors) ==== @@ -13,9 +13,9 @@ tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,17): error TS2355: A funct ~~~ !!! error TS2300: Duplicate identifier 'foo'. ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. function foo(): number { } ~~~ !!! error TS2300: Duplicate identifier 'foo'. ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. \ No newline at end of file +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. \ No newline at end of file diff --git a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt index 5b66a377307cf..403e79b874271 100644 --- a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean'. Type 'void' is not assignable to type 'boolean'. -tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. ==== tests/cases/compiler/errorOnContextuallyTypedReturnType.ts (2 errors) ==== @@ -10,5 +10,5 @@ tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: !!! error TS2322: Type 'void' is not assignable to type 'boolean'. var n2: () => boolean = function ():boolean { }; // expect an error here ~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. \ No newline at end of file diff --git a/tests/baselines/reference/functionImplementationErrors.errors.txt b/tests/baselines/reference/functionImplementationErrors.errors.txt index 0c74588c316f8..1ab438e340bbd 100644 --- a/tests/baselines/reference/functionImplementationErrors.errors.txt +++ b/tests/baselines/reference/functionImplementationErrors.errors.txt @@ -2,10 +2,9 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(2,10): error T tests/cases/conformance/functions/functionImplementationErrors.ts(6,19): error TS2354: No best common type exists among return expressions. tests/cases/conformance/functions/functionImplementationErrors.ts(10,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/functions/functionImplementationErrors.ts(16,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(25,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/conformance/functions/functionImplementationErrors.ts(25,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/functions/functionImplementationErrors.ts(30,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. tests/cases/conformance/functions/functionImplementationErrors.ts(35,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. -tests/cases/conformance/functions/functionImplementationErrors.ts(40,28): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/conformance/functions/functionImplementationErrors.ts(49,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/functions/functionImplementationErrors.ts(53,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/functions/functionImplementationErrors.ts(57,11): error TS2354: No best common type exists among return expressions. @@ -14,7 +13,7 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(65,11): error tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error TS2354: No best common type exists among return expressions. -==== tests/cases/conformance/functions/functionImplementationErrors.ts (14 errors) ==== +==== tests/cases/conformance/functions/functionImplementationErrors.ts (13 errors) ==== // FunctionExpression with no return type annotation with multiple return statements with unrelated types var f1 = function () { ~~~~~~~~ @@ -52,7 +51,7 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error // Function implemetnation with non -void return type annotation with no return function f5(): number { ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. } var m; @@ -72,8 +71,6 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error // FunctionExpression with non -void return type annotation with a throw, no return, and other code // Should be error but isn't undefined === function (): number { - ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. throw undefined; var x = 4; }; diff --git a/tests/baselines/reference/functionWithThrowButNoReturn1.errors.txt b/tests/baselines/reference/functionWithThrowButNoReturn1.errors.txt deleted file mode 100644 index 72f45da8d9719..0000000000000 --- a/tests/baselines/reference/functionWithThrowButNoReturn1.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/compiler/functionWithThrowButNoReturn1.ts(1,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - - -==== tests/cases/compiler/functionWithThrowButNoReturn1.ts (1 errors) ==== - function fn(): number { - ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - throw new Error('NYI'); - var t; - } - \ No newline at end of file diff --git a/tests/baselines/reference/functionWithThrowButNoReturn1.symbols b/tests/baselines/reference/functionWithThrowButNoReturn1.symbols new file mode 100644 index 0000000000000..7dde523701dd6 --- /dev/null +++ b/tests/baselines/reference/functionWithThrowButNoReturn1.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/functionWithThrowButNoReturn1.ts === +function fn(): number { +>fn : Symbol(fn, Decl(functionWithThrowButNoReturn1.ts, 0, 0)) + + throw new Error('NYI'); +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) + + var t; +>t : Symbol(t, Decl(functionWithThrowButNoReturn1.ts, 2, 5)) +} + diff --git a/tests/baselines/reference/functionWithThrowButNoReturn1.types b/tests/baselines/reference/functionWithThrowButNoReturn1.types new file mode 100644 index 0000000000000..c136d8a407602 --- /dev/null +++ b/tests/baselines/reference/functionWithThrowButNoReturn1.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/functionWithThrowButNoReturn1.ts === +function fn(): number { +>fn : () => number + + throw new Error('NYI'); +>new Error('NYI') : Error +>Error : ErrorConstructor +>'NYI' : string + + var t; +>t : any +} + diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt index 2c5ff15f8630a..88b0c8d5e1472 100644 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt +++ b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt @@ -1,15 +1,13 @@ -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(2,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(64,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(94,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(112,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(2,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(94,16): error TS2378: A 'get' accessor must return a value. tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): error TS1003: Identifier expected. -==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (5 errors) ==== +==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (3 errors) ==== function f1(): string { ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. // errors because there are no return statements } @@ -72,8 +70,6 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): e } function f14(): number { - ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. // Not fine, since we can *only* consist of a single throw statement // if no return statements are present but we are annotated. throw undefined; @@ -105,7 +101,7 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): e class C { public get m1() { ~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. // Errors; get accessors must return a value. } @@ -124,8 +120,6 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): e } public get m5() { - ~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. // Not fine, since we can *only* consist of a single throw statement // if no return statements are present but we are a get accessor. throw null; diff --git a/tests/baselines/reference/getterMissingReturnError.errors.txt b/tests/baselines/reference/getterMissingReturnError.errors.txt index 8900cc5e78f6a..e504de07ef423 100644 --- a/tests/baselines/reference/getterMissingReturnError.errors.txt +++ b/tests/baselines/reference/getterMissingReturnError.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/getterMissingReturnError.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/getterMissingReturnError.ts(2,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/compiler/getterMissingReturnError.ts(2,16): error TS2378: A 'get' accessor must return a value. ==== tests/cases/compiler/getterMissingReturnError.ts (2 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/getterMissingReturnError.ts(2,16): error TS2378: A 'get' ac ~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } } diff --git a/tests/baselines/reference/invalidReturnStatements.errors.txt b/tests/baselines/reference/invalidReturnStatements.errors.txt index 780166e07c24b..6fbe961cd54ef 100644 --- a/tests/baselines/reference/invalidReturnStatements.errors.txt +++ b/tests/baselines/reference/invalidReturnStatements.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(2,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(3,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(4,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(5,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(2,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(3,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(4,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(5,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(16,29): error TS2322: Type '{ id: number; }' is not assignable to type 'D'. Property 'name' is missing in type '{ id: number; }'. tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(18,29): error TS2322: Type 'C' is not assignable to type 'D'. @@ -12,16 +12,16 @@ tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(1 // all the following should be error function fn1(): number { } ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. function fn2(): string { } ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. function fn3(): boolean { } ~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. function fn4(): Date { } ~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. function fn7(): any { } // should be valid: any includes void interface I { id: number } diff --git a/tests/baselines/reference/methodInAmbientClass1.errors.txt b/tests/baselines/reference/methodInAmbientClass1.errors.txt index 05183378a853f..7032d71562969 100644 --- a/tests/baselines/reference/methodInAmbientClass1.errors.txt +++ b/tests/baselines/reference/methodInAmbientClass1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/methodInAmbientClass1.ts(2,12): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/methodInAmbientClass1.ts(2,12): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1184: An implementation cannot be declared in ambient contexts. @@ -6,7 +6,7 @@ tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1184: An implementa declare class Foo { fn(): boolean { ~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. ~ !!! error TS1184: An implementation cannot be declared in ambient contexts. } diff --git a/tests/baselines/reference/missingReturnStatement.errors.txt b/tests/baselines/reference/missingReturnStatement.errors.txt index c7cedd793de79..8926d22be3d42 100644 --- a/tests/baselines/reference/missingReturnStatement.errors.txt +++ b/tests/baselines/reference/missingReturnStatement.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/missingReturnStatement.ts(3,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/missingReturnStatement.ts(3,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. ==== tests/cases/compiler/missingReturnStatement.ts (1 errors) ==== @@ -6,7 +6,7 @@ tests/cases/compiler/missingReturnStatement.ts(3,22): error TS2355: A function w export class Bug { public foo():string { ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. } } } diff --git a/tests/baselines/reference/missingReturnStatement1.errors.txt b/tests/baselines/reference/missingReturnStatement1.errors.txt index de471f90ac4db..9d3cf78411edf 100644 --- a/tests/baselines/reference/missingReturnStatement1.errors.txt +++ b/tests/baselines/reference/missingReturnStatement1.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/missingReturnStatement1.ts(2,12): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/missingReturnStatement1.ts(2,12): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. ==== tests/cases/compiler/missingReturnStatement1.ts (1 errors) ==== class Foo { foo(): number { ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. //return 4; } } diff --git a/tests/baselines/reference/multiLineErrors.errors.txt b/tests/baselines/reference/multiLineErrors.errors.txt index 23a6278b4fbbf..70366aeabedcd 100644 --- a/tests/baselines/reference/multiLineErrors.errors.txt +++ b/tests/baselines/reference/multiLineErrors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/multiLineErrors.ts(3,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/multiLineErrors.ts(3,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/multiLineErrors.ts(21,1): error TS2322: Type 'A2' is not assignable to type 'A1'. Types of property 'x' are incompatible. Type '{ y: string; }' is not assignable to type '{ y: number; }'. @@ -17,7 +17,7 @@ tests/cases/compiler/multiLineErrors.ts(21,1): error TS2322: Type 'A2' is not as ~~~~~~~~~~~~~~ } ~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. { var x = 4; var y = 10; diff --git a/tests/baselines/reference/objectLiteralMemberWithModifiers2.errors.txt b/tests/baselines/reference/objectLiteralMemberWithModifiers2.errors.txt index e939725ea6e46..be2bea5e24130 100644 --- a/tests/baselines/reference/objectLiteralMemberWithModifiers2.errors.txt +++ b/tests/baselines/reference/objectLiteralMemberWithModifiers2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/objectLiteralMemberWithModifiers2.ts(1,22): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/objectLiteralMemberWithModifiers2.ts(1,22): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/compiler/objectLiteralMemberWithModifiers2.ts(1,22): error TS2378: A 'get' accessor must return a value. ==== tests/cases/compiler/objectLiteralMemberWithModifiers2.ts (2 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/objectLiteralMemberWithModifiers2.ts(1,22): error TS2378: A ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. \ No newline at end of file +!!! error TS2378: A 'get' accessor must return a value. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralWithSemicolons5.errors.txt b/tests/baselines/reference/objectLiteralWithSemicolons5.errors.txt index 7373c3d535de2..5a24f29252cee 100644 --- a/tests/baselines/reference/objectLiteralWithSemicolons5.errors.txt +++ b/tests/baselines/reference/objectLiteralWithSemicolons5.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/objectLiteralWithSemicolons5.ts(1,20): error TS1005: ',' expected. tests/cases/compiler/objectLiteralWithSemicolons5.ts(1,25): error TS2304: Cannot find name 'b'. tests/cases/compiler/objectLiteralWithSemicolons5.ts(1,26): error TS1005: ',' expected. -tests/cases/compiler/objectLiteralWithSemicolons5.ts(1,32): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/compiler/objectLiteralWithSemicolons5.ts(1,32): error TS2378: A 'get' accessor must return a value. tests/cases/compiler/objectLiteralWithSemicolons5.ts(1,41): error TS1005: ',' expected. @@ -14,6 +14,6 @@ tests/cases/compiler/objectLiteralWithSemicolons5.ts(1,41): error TS1005: ',' ex ~ !!! error TS1005: ',' expected. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. ~ !!! error TS1005: ',' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors1.errors.txt b/tests/baselines/reference/parserAccessors1.errors.txt index 8c5033da0c453..2ef8d4e37aba0 100644 --- a/tests/baselines/reference/parserAccessors1.errors.txt +++ b/tests/baselines/reference/parserAccessors1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors1.ts(2,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors1.ts(2,9): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors1.ts (1 errors) ==== class C { get Foo() { } ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors10.errors.txt b/tests/baselines/reference/parserAccessors10.errors.txt index a5228f4744337..d6a2b99eacaae 100644 --- a/tests/baselines/reference/parserAccessors10.errors.txt +++ b/tests/baselines/reference/parserAccessors10.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors10.ts(2,14): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors10.ts(2,14): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors10.ts (1 errors) ==== var v = { public get foo() { } ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. }; \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors3.errors.txt b/tests/baselines/reference/parserAccessors3.errors.txt index 2987b606451c6..5411cd544ebd2 100644 --- a/tests/baselines/reference/parserAccessors3.errors.txt +++ b/tests/baselines/reference/parserAccessors3.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors3.ts(1,15): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors3.ts(1,15): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors3.ts (1 errors) ==== var v = { get Foo() { } }; ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. \ No newline at end of file +!!! error TS2378: A 'get' accessor must return a value. \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors7.errors.txt b/tests/baselines/reference/parserAccessors7.errors.txt index 857833a7673e3..3938280e6d5f7 100644 --- a/tests/baselines/reference/parserAccessors7.errors.txt +++ b/tests/baselines/reference/parserAccessors7.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors7.ts(1,15): error TS1054: A 'get' accessor cannot have parameters. -tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors7.ts(1,15): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors7.ts(1,15): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors7.ts (2 errors) ==== @@ -7,4 +7,4 @@ tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors7.ts(1,15): ~~~ !!! error TS1054: A 'get' accessor cannot have parameters. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. \ No newline at end of file +!!! error TS2378: A 'get' accessor must return a value. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName4.errors.txt b/tests/baselines/reference/parserComputedPropertyName4.errors.txt index bfc78b162fd5a..3430e75b82f33 100644 --- a/tests/baselines/reference/parserComputedPropertyName4.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName4.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts(1,15): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts(1,15): error TS2378: A 'get' accessor must return a value. tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts(1,16): error TS2304: Cannot find name 'e'. ==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts (2 errors) ==== var v = { get [e]() { } }; ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. ~ !!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName5.errors.txt b/tests/baselines/reference/parserComputedPropertyName5.errors.txt index 07cc6f3a9f000..09c38ecbef512 100644 --- a/tests/baselines/reference/parserComputedPropertyName5.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName5.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,22): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,22): error TS2378: A 'get' accessor must return a value. tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts(1,23): error TS2304: Cannot find name 'e'. ==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts (2 errors) ==== var v = { public get [e]() { } }; ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. ~ !!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/parserES3Accessors1.errors.txt b/tests/baselines/reference/parserES3Accessors1.errors.txt index 5e2ca9f97bca9..9c6dbf0e76f63 100644 --- a/tests/baselines/reference/parserES3Accessors1.errors.txt +++ b/tests/baselines/reference/parserES3Accessors1.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors1.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors1.ts(2,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors1.ts(2,9): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors1.ts (2 errors) ==== @@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors1.ts(2,9) ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES3Accessors3.errors.txt b/tests/baselines/reference/parserES3Accessors3.errors.txt index 6d262e2a85580..70ab3f2072e08 100644 --- a/tests/baselines/reference/parserES3Accessors3.errors.txt +++ b/tests/baselines/reference/parserES3Accessors3.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors3.ts(1,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors3.ts(1,15): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors3.ts(1,15): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors3.ts (2 errors) ==== @@ -7,4 +7,4 @@ tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors3.ts(1,15 ~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. \ No newline at end of file +!!! error TS2378: A 'get' accessor must return a value. \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName4.errors.txt b/tests/baselines/reference/parserES5ComputedPropertyName4.errors.txt index cfb12152c9476..854bb36484279 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName4.errors.txt +++ b/tests/baselines/reference/parserES5ComputedPropertyName4.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts(1,15): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts(1,15): error TS2378: A 'get' accessor must return a value. tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts(1,16): error TS2304: Cannot find name 'e'. ==== tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts (2 errors) ==== var v = { get [e]() { } }; ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. ~ !!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_Block3.errors.txt b/tests/baselines/reference/parserErrorRecovery_Block3.errors.txt index 9d391e39007d9..e6033d05215d9 100644 --- a/tests/baselines/reference/parserErrorRecovery_Block3.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_Block3.errors.txt @@ -1,18 +1,18 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block3.ts(2,18): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block3.ts(2,18): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block3.ts(4,5): error TS1128: Declaration or statement expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block3.ts(4,18): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block3.ts(4,18): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/Blocks/parserErrorRecovery_Block3.ts (3 errors) ==== class C { private a(): boolean { ~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. private b(): boolean { ~~~~~~~ !!! error TS1128: Declaration or statement expected. ~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. } } \ No newline at end of file diff --git a/tests/baselines/reference/parserGetAccessorWithTypeParameters1.errors.txt b/tests/baselines/reference/parserGetAccessorWithTypeParameters1.errors.txt index 0cf731cb516f6..09502f6b888e0 100644 --- a/tests/baselines/reference/parserGetAccessorWithTypeParameters1.errors.txt +++ b/tests/baselines/reference/parserGetAccessorWithTypeParameters1.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/Accessors/parserGetAccessorWithTypeParameters1.ts(2,7): error TS1094: An accessor cannot have type parameters. -tests/cases/conformance/parser/ecmascript5/Accessors/parserGetAccessorWithTypeParameters1.ts(2,7): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/Accessors/parserGetAccessorWithTypeParameters1.ts(2,7): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/Accessors/parserGetAccessorWithTypeParameters1.ts (2 errors) ==== @@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript5/Accessors/parserGetAccessorWithTypePa ~~~ !!! error TS1094: An accessor cannot have type parameters. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessor1.errors.txt b/tests/baselines/reference/parserMemberAccessor1.errors.txt index aa7cdcdafa3c0..2a3fd7d70284d 100644 --- a/tests/baselines/reference/parserMemberAccessor1.errors.txt +++ b/tests/baselines/reference/parserMemberAccessor1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessor1.ts(2,7): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessor1.ts(2,7): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessor1.ts (1 errors) ==== class C { get foo() { } ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. set foo(a) { } } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration1.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration1.errors.txt index ac96e7d94b788..c2db31a53984e 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration1.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration1.ts(2,7): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration1.ts(2,7): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration1.ts (1 errors) ==== class C { get a() { } ~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration10.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration10.errors.txt index 9a04674d6d7f9..ece110db165f3 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration10.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration10.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration10.ts(2,5): error TS1031: 'export' modifier cannot appear on a class element. -tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration10.ts(2,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration10.ts(2,16): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration10.ts (2 errors) ==== @@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemb ~~~~~~ !!! error TS1031: 'export' modifier cannot appear on a class element. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration12.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration12.errors.txt index 0d14a2adab842..a4ea29518d101 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration12.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration12.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration12.ts(2,8): error TS1054: A 'get' accessor cannot have parameters. -tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration12.ts(2,8): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration12.ts(2,8): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration12.ts (2 errors) ==== @@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemb ~~~ !!! error TS1054: A 'get' accessor cannot have parameters. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration2.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration2.errors.txt index 69e87dff6590b..7b66bee844f16 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration2.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration2.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration2.ts(2,7): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration2.ts(2,7): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration2.ts (1 errors) ==== class C { get "b"() { } ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration3.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration3.errors.txt index 93a1a5d14e1fd..a37fe230f76b6 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration3.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration3.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration3.ts(2,7): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration3.ts(2,7): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration3.ts (1 errors) ==== class C { get 0() { } ~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration7.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration7.errors.txt index b7f67da49b7d1..2b0bd40a4f25d 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration7.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration7.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration7.ts(2,12): error TS1028: Accessibility modifier already seen. -tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration7.ts(2,23): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration7.ts(2,23): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration7.ts (2 errors) ==== @@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemb ~~~~~~ !!! error TS1028: Accessibility modifier already seen. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration8.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration8.errors.txt index e5a39c149f604..67ba09b8c725e 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration8.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration8.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration8.ts(2,12): error TS1030: 'static' modifier already seen. -tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration8.ts(2,23): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration8.ts(2,23): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration8.ts (2 errors) ==== @@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemb ~~~~~~ !!! error TS1030: 'static' modifier already seen. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration9.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration9.errors.txt index 2da32a5807bd2..31d001aeafc62 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration9.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration9.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration9.ts(2,12): error TS1029: 'public' modifier must precede 'static' modifier. -tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration9.ts(2,23): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration9.ts(2,23): error TS2378: A 'get' accessor must return a value. ==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration9.ts (2 errors) ==== @@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemb ~~~~~~ !!! error TS1029: 'public' modifier must precede 'static' modifier. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/parserParameterList5.errors.txt b/tests/baselines/reference/parserParameterList5.errors.txt index 231a5bbb16232..5f0899fa1a2a6 100644 --- a/tests/baselines/reference/parserParameterList5.errors.txt +++ b/tests/baselines/reference/parserParameterList5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList5.ts(1,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList5.ts(1,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList5.ts(1,16): error TS2369: A parameter property is only allowed in a constructor implementation. tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList5.ts(1,29): error TS2304: Cannot find name 'C'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList5.t ==== tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList5.ts (3 errors) ==== function A(): (public B) => C { ~~~~~~~~~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. ~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. ~ diff --git a/tests/baselines/reference/reachabilityChecks1.errors.txt b/tests/baselines/reference/reachabilityChecks1.errors.txt new file mode 100644 index 0000000000000..ebf1019e7e958 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks1.errors.txt @@ -0,0 +1,70 @@ +tests/cases/compiler/reachabilityChecks1.ts(3,1): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(7,5): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(22,11): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(28,12): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(35,10): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(44,16): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/reachabilityChecks1.ts (6 errors) ==== + + while (true); + var x = 1; + ~~~~~~~~~~ +!!! error TS7027: Unreachable code detected. + + module A { + while (true); + let x; + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } + + function f1(x) { + if (x) { + return; + } + else { + throw new Error("123"); + } + var x; + } + + function f2() { + return; + class A { + ~ +!!! error TS7027: Unreachable code detected. + } + } + + module B { + for (; ;); + module C { + ~ +!!! error TS7027: Unreachable code detected. + } + } + + function f3() { + do { + } while (true); + enum E { + ~ +!!! error TS7027: Unreachable code detected. + X = 1 + } + } + + function f4() { + if (true) { + throw new Error(); + } + const enum E { + ~ +!!! error TS7027: Unreachable code detected. + X = 1 + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecks1.js b/tests/baselines/reference/reachabilityChecks1.js new file mode 100644 index 0000000000000..3f9ca87422a0a --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks1.js @@ -0,0 +1,100 @@ +//// [reachabilityChecks1.ts] + +while (true); +var x = 1; + +module A { + while (true); + let x; +} + +function f1(x) { + if (x) { + return; + } + else { + throw new Error("123"); + } + var x; +} + +function f2() { + return; + class A { + } +} + +module B { + for (; ;); + module C { + } +} + +function f3() { + do { + } while (true); + enum E { + X = 1 + } +} + +function f4() { + if (true) { + throw new Error(); + } + const enum E { + X = 1 + } +} + + + +//// [reachabilityChecks1.js] +while (true) + ; +var x = 1; +var A; +(function (A) { + while (true) + ; + var x; +})(A || (A = {})); +function f1(x) { + if (x) { + return; + } + else { + throw new Error("123"); + } + var x; +} +function f2() { + return; + var A = (function () { + function A() { + } + return A; + })(); +} +var B; +(function (B) { + for (;;) + ; +})(B || (B = {})); +function f3() { + do { + } while (true); + var E; + (function (E) { + E[E["X"] = 1] = "X"; + })(E || (E = {})); +} +function f4() { + if (true) { + throw new Error(); + } + var E; + (function (E) { + E[E["X"] = 1] = "X"; + })(E || (E = {})); +} diff --git a/tests/baselines/reference/reachabilityChecks2.js b/tests/baselines/reference/reachabilityChecks2.js new file mode 100644 index 0000000000000..80534c0d7de20 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks2.js @@ -0,0 +1,9 @@ +//// [reachabilityChecks2.ts] + +while (true) { } +const enum E { X } + + + +//// [reachabilityChecks2.js] +while (true) { } diff --git a/tests/baselines/reference/reachabilityChecks2.symbols b/tests/baselines/reference/reachabilityChecks2.symbols new file mode 100644 index 0000000000000..d289304dffad8 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks2.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/reachabilityChecks2.ts === + +while (true) { } +const enum E { X } +>E : Symbol(E, Decl(reachabilityChecks2.ts, 1, 16)) +>X : Symbol(E.X, Decl(reachabilityChecks2.ts, 2, 14)) + + diff --git a/tests/baselines/reference/reachabilityChecks2.types b/tests/baselines/reference/reachabilityChecks2.types new file mode 100644 index 0000000000000..38dad87c6a1f3 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks2.types @@ -0,0 +1,10 @@ +=== tests/cases/compiler/reachabilityChecks2.ts === + +while (true) { } +>true : boolean + +const enum E { X } +>E : E +>X : E + + diff --git a/tests/baselines/reference/reachabilityChecks3.errors.txt b/tests/baselines/reference/reachabilityChecks3.errors.txt new file mode 100644 index 0000000000000..993ab571b2e13 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks3.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/reachabilityChecks3.ts(3,1): error TS7028: Unused label. + + +==== tests/cases/compiler/reachabilityChecks3.ts (1 errors) ==== + + let x = 1; + loop: while (true) { + ~~~~ +!!! error TS7028: Unused label. + if (x == 100) { + break; + } + else { + x++; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecks3.js b/tests/baselines/reference/reachabilityChecks3.js new file mode 100644 index 0000000000000..4de316d1ddc50 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks3.js @@ -0,0 +1,22 @@ +//// [reachabilityChecks3.ts] + +let x = 1; +loop: while (true) { + if (x == 100) { + break; + } + else { + x++; + } +} + +//// [reachabilityChecks3.js] +var x = 1; +loop: while (true) { + if (x == 100) { + break; + } + else { + x++; + } +} diff --git a/tests/baselines/reference/reachabilityChecks4.errors.txt b/tests/baselines/reference/reachabilityChecks4.errors.txt new file mode 100644 index 0000000000000..ba9519462e7e8 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks4.errors.txt @@ -0,0 +1,20 @@ +tests/cases/compiler/reachabilityChecks4.ts(7,9): error TS7029: Fallthrough case in switch. + + +==== tests/cases/compiler/reachabilityChecks4.ts (1 errors) ==== + + function foo(x, y) { + switch (x) { + case 1: + case 2: + return 1; + case 3: + ~~~~ +!!! error TS7029: Fallthrough case in switch. + if (y) { + return 2; + } + case 4: + return 3; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecks4.js b/tests/baselines/reference/reachabilityChecks4.js new file mode 100644 index 0000000000000..588644c5a05ea --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks4.js @@ -0,0 +1,30 @@ +//// [reachabilityChecks4.ts] + +function foo(x, y) { + switch (x) { + case 1: + case 2: + return 1; + case 3: + if (y) { + return 2; + } + case 4: + return 3; + } +} + +//// [reachabilityChecks4.js] +function foo(x, y) { + switch (x) { + case 1: + case 2: + return 1; + case 3: + if (y) { + return 2; + } + case 4: + return 3; + } +} diff --git a/tests/baselines/reference/reachabilityChecks5.errors.txt b/tests/baselines/reference/reachabilityChecks5.errors.txt new file mode 100644 index 0000000000000..c30dfa7181719 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks5.errors.txt @@ -0,0 +1,162 @@ +tests/cases/compiler/reachabilityChecks5.ts(6,17): error TS7030: Not all code paths return a value. +tests/cases/compiler/reachabilityChecks5.ts(19,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/compiler/reachabilityChecks5.ts(31,17): error TS7030: Not all code paths return a value. +tests/cases/compiler/reachabilityChecks5.ts(41,17): error TS7030: Not all code paths return a value. +tests/cases/compiler/reachabilityChecks5.ts(52,17): error TS7030: Not all code paths return a value. +tests/cases/compiler/reachabilityChecks5.ts(80,17): error TS7030: Not all code paths return a value. +tests/cases/compiler/reachabilityChecks5.ts(86,13): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks5.ts(94,17): error TS7030: Not all code paths return a value. +tests/cases/compiler/reachabilityChecks5.ts(116,18): error TS7030: Not all code paths return a value. +tests/cases/compiler/reachabilityChecks5.ts(123,13): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/reachabilityChecks5.ts (10 errors) ==== + + function f0(x): number { + while (true); + } + + function f1(x): number { + ~~~~~~ +!!! error TS7030: Not all code paths return a value. + if (x) { + return 1 + } + } + + function f2(x): number { + while (x) { + throw new Error(); + } + return 1; + } + + function f3(x): number { + ~~~~~~ +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. + while (x) { + throw new Error(); + } + } + + function f3_1 (x): number { + while (x) { + } + throw new Error(); + } + + function f4(x): number { + ~~~~~~ +!!! error TS7030: Not all code paths return a value. + try { + if (x) { + return 1; + } + } + catch (e) { + } + } + + function f5(x): number { + ~~~~~~ +!!! error TS7030: Not all code paths return a value. + try { + if (x) { + return 1; + } + } + catch (e) { + return 2; + } + } + + function f6(x): number { + ~~~~~~ +!!! error TS7030: Not all code paths return a value. + try { + if (x) { + return 1; + } + else + { + throw new Error(); + } + } + catch (e) { + } + } + + function f7(x): number { + try { + if (x) { + return 1; + } + else { + throw new Error(); + } + } + catch (e) { + return 1; + } + } + + function f8(x): number { + ~~~~~~ +!!! error TS7030: Not all code paths return a value. + try { + if (true) { + x++; + } + else { + return 1; + ~~~~~~~~~ +!!! error TS7027: Unreachable code detected. + } + } + catch (e) { + return 1; + } + } + + function f9(x): number { + ~~~~~~ +!!! error TS7030: Not all code paths return a value. + try { + while (false) { + return 1; + } + } + catch (e) { + return 1; + } + } + + function f10(x): number { + try { + do { + x++; + } while (true); + } + catch (e) { + return 1; + } + } + + function f11(x): number { + ~~~~~~ +!!! error TS7030: Not all code paths return a value. + test: + try { + do { + do { + break test; + } while (true); + x++; + ~~~~ +!!! error TS7027: Unreachable code detected. + } while (true); + } + catch (e) { + return 1; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecks5.js b/tests/baselines/reference/reachabilityChecks5.js new file mode 100644 index 0000000000000..a6c507ac87b88 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks5.js @@ -0,0 +1,247 @@ +//// [reachabilityChecks5.ts] + +function f0(x): number { + while (true); +} + +function f1(x): number { + if (x) { + return 1 + } +} + +function f2(x): number { + while (x) { + throw new Error(); + } + return 1; +} + +function f3(x): number { + while (x) { + throw new Error(); + } +} + +function f3_1 (x): number { + while (x) { + } + throw new Error(); +} + +function f4(x): number { + try { + if (x) { + return 1; + } + } + catch (e) { + } +} + +function f5(x): number { + try { + if (x) { + return 1; + } + } + catch (e) { + return 2; + } +} + +function f6(x): number { + try { + if (x) { + return 1; + } + else + { + throw new Error(); + } + } + catch (e) { + } +} + +function f7(x): number { + try { + if (x) { + return 1; + } + else { + throw new Error(); + } + } + catch (e) { + return 1; + } +} + +function f8(x): number { + try { + if (true) { + x++; + } + else { + return 1; + } + } + catch (e) { + return 1; + } +} + +function f9(x): number { + try { + while (false) { + return 1; + } + } + catch (e) { + return 1; + } +} + +function f10(x): number { + try { + do { + x++; + } while (true); + } + catch (e) { + return 1; + } +} + +function f11(x): number { + test: + try { + do { + do { + break test; + } while (true); + x++; + } while (true); + } + catch (e) { + return 1; + } +} + +//// [reachabilityChecks5.js] +function f0(x) { + while (true) + ; +} +function f1(x) { + if (x) { + return 1; + } +} +function f2(x) { + while (x) { + throw new Error(); + } + return 1; +} +function f3(x) { + while (x) { + throw new Error(); + } +} +function f3_1(x) { + while (x) { + } + throw new Error(); +} +function f4(x) { + try { + if (x) { + return 1; + } + } + catch (e) { + } +} +function f5(x) { + try { + if (x) { + return 1; + } + } + catch (e) { + return 2; + } +} +function f6(x) { + try { + if (x) { + return 1; + } + else { + throw new Error(); + } + } + catch (e) { + } +} +function f7(x) { + try { + if (x) { + return 1; + } + else { + throw new Error(); + } + } + catch (e) { + return 1; + } +} +function f8(x) { + try { + if (true) { + x++; + } + else { + return 1; + } + } + catch (e) { + return 1; + } +} +function f9(x) { + try { + while (false) { + return 1; + } + } + catch (e) { + return 1; + } +} +function f10(x) { + try { + do { + x++; + } while (true); + } + catch (e) { + return 1; + } +} +function f11(x) { + test: try { + do { + do { + break test; + } while (true); + x++; + } while (true); + } + catch (e) { + return 1; + } +} diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index c69549403c49b..8d5303c066918 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -2,8 +2,8 @@ tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2322: Type 'number tests/cases/compiler/recursiveFunctionTypes.ts(3,5): error TS2322: Type '() => typeof fn' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(4,5): error TS2322: Type '() => typeof fn' is not assignable to type '() => number'. Type '() => typeof fn' is not assignable to type 'number'. -tests/cases/compiler/recursiveFunctionTypes.ts(11,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/compiler/recursiveFunctionTypes.ts(12,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/recursiveFunctionTypes.ts(11,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/compiler/recursiveFunctionTypes.ts(12,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/recursiveFunctionTypes.ts(17,5): error TS2322: Type '() => I' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(22,5): error TS2345: Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'. tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2322: Type 'number' is not assignable to type '() => any'. @@ -34,10 +34,10 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of function f2(): typeof g2 { } ~~~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. function g2(): typeof f2 { } ~~~~~~~~~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. interface I { } function f3(): I { return f3; } diff --git a/tests/baselines/reference/returnTypeParameter.errors.txt b/tests/baselines/reference/returnTypeParameter.errors.txt index 11c0888f47cfa..1bd9f6a63f64a 100644 --- a/tests/baselines/reference/returnTypeParameter.errors.txt +++ b/tests/baselines/reference/returnTypeParameter.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/returnTypeParameter.ts(1,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/returnTypeParameter.ts(1,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/returnTypeParameter.ts(2,34): error TS2304: Cannot find name 'T'. ==== tests/cases/compiler/returnTypeParameter.ts (2 errors) ==== function f(a: T): T { } // error, no return statement ~ -!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. function f2(a: T): T { return T; } // bug was that this satisfied the return statement requirement ~ !!! error TS2304: Cannot find name 'T'. \ No newline at end of file diff --git a/tests/cases/compiler/reachabilityChecks1.ts b/tests/cases/compiler/reachabilityChecks1.ts new file mode 100644 index 0000000000000..bc7662486a621 --- /dev/null +++ b/tests/cases/compiler/reachabilityChecks1.ts @@ -0,0 +1,50 @@ +// @noUnreachableCode: true +// @preserveConstEnums: true + +while (true); +var x = 1; + +module A { + while (true); + let x; +} + +function f1(x) { + if (x) { + return; + } + else { + throw new Error("123"); + } + var x; +} + +function f2() { + return; + class A { + } +} + +module B { + for (; ;); + module C { + } +} + +function f3() { + do { + } while (true); + enum E { + X = 1 + } +} + +function f4() { + if (true) { + throw new Error(); + } + const enum E { + X = 1 + } +} + diff --git a/tests/cases/compiler/reachabilityChecks2.ts b/tests/cases/compiler/reachabilityChecks2.ts new file mode 100644 index 0000000000000..fc8d53bde8f7a --- /dev/null +++ b/tests/cases/compiler/reachabilityChecks2.ts @@ -0,0 +1,6 @@ +// @noUnreachableCode: true +// @preserveConstEnums: false + +while (true) { } +const enum E { X } + diff --git a/tests/cases/compiler/reachabilityChecks3.ts b/tests/cases/compiler/reachabilityChecks3.ts new file mode 100644 index 0000000000000..362c64e13490b --- /dev/null +++ b/tests/cases/compiler/reachabilityChecks3.ts @@ -0,0 +1,11 @@ +// @noUnusedLabels: true + +let x = 1; +loop: while (true) { + if (x == 100) { + break; + } + else { + x++; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/reachabilityChecks4.ts b/tests/cases/compiler/reachabilityChecks4.ts new file mode 100644 index 0000000000000..f07395ac38ec5 --- /dev/null +++ b/tests/cases/compiler/reachabilityChecks4.ts @@ -0,0 +1,15 @@ +// @noFallthroughCasesInSwitch: true + +function foo(x, y) { + switch (x) { + case 1: + case 2: + return 1; + case 3: + if (y) { + return 2; + } + case 4: + return 3; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/reachabilityChecks5.ts b/tests/cases/compiler/reachabilityChecks5.ts new file mode 100644 index 0000000000000..24134e238b9ad --- /dev/null +++ b/tests/cases/compiler/reachabilityChecks5.ts @@ -0,0 +1,131 @@ +// @noUnreachableCode: true +// @noImplicitReturns: true + +function f0(x): number { + while (true); +} + +function f1(x): number { + if (x) { + return 1 + } +} + +function f2(x): number { + while (x) { + throw new Error(); + } + return 1; +} + +function f3(x): number { + while (x) { + throw new Error(); + } +} + +function f3_1 (x): number { + while (x) { + } + throw new Error(); +} + +function f4(x): number { + try { + if (x) { + return 1; + } + } + catch (e) { + } +} + +function f5(x): number { + try { + if (x) { + return 1; + } + } + catch (e) { + return 2; + } +} + +function f6(x): number { + try { + if (x) { + return 1; + } + else + { + throw new Error(); + } + } + catch (e) { + } +} + +function f7(x): number { + try { + if (x) { + return 1; + } + else { + throw new Error(); + } + } + catch (e) { + return 1; + } +} + +function f8(x): number { + try { + if (true) { + x++; + } + else { + return 1; + } + } + catch (e) { + return 1; + } +} + +function f9(x): number { + try { + while (false) { + return 1; + } + } + catch (e) { + return 1; + } +} + +function f10(x): number { + try { + do { + x++; + } while (true); + } + catch (e) { + return 1; + } +} + +function f11(x): number { + test: + try { + do { + do { + break test; + } while (true); + x++; + } while (true); + } + catch (e) { + return 1; + } +} \ No newline at end of file From beb1aa3d0a01291388d8565d1a60f2be281be513 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 15 Sep 2015 10:36:55 -0700 Subject: [PATCH 02/11] addressed PR feedback --- src/compiler/binder.ts | 55 +++++++++++------- .../reference/reachabilityChecks1.errors.txt | 43 +++++++++++--- .../reference/reachabilityChecks1.js | 56 +++++++++++++++++++ .../reference/reachabilityChecks2.errors.txt | 18 ++++++ .../reference/reachabilityChecks2.js | 12 ++++ .../reference/reachabilityChecks2.symbols | 8 --- .../reference/reachabilityChecks2.types | 10 ---- tests/cases/compiler/reachabilityChecks1.ts | 26 +++++++++ tests/cases/compiler/reachabilityChecks2.ts | 7 +++ 9 files changed, 191 insertions(+), 44 deletions(-) create mode 100644 tests/baselines/reference/reachabilityChecks2.errors.txt delete mode 100644 tests/baselines/reference/reachabilityChecks2.symbols delete mode 100644 tests/baselines/reference/reachabilityChecks2.types diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index c29c761c28aca..cebc930d32813 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -108,7 +108,7 @@ namespace ts { let hasExplicitReturn: boolean; let currentReachabilityState: Reachability; let labelStack: Reachability[]; - let labels: Map; + let labelIndexMap: Map; let implicitLabels: number[]; // If this file is an external module, then it is automatically in strict-mode according to @@ -373,13 +373,13 @@ namespace ts { if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; - savedLabels = labels; + savedLabels = labelIndexMap; savedImplicitLabels = implicitLabels; savedHasExplicitReturn = hasExplicitReturn; currentReachabilityState = Reachability.Reachable; hasExplicitReturn = false; - labelStack = labels = implicitLabels = undefined; + labelStack = labelIndexMap = implicitLabels = undefined; } if (!bindReachableStatement(node)) { @@ -397,17 +397,21 @@ namespace ts { hasExplicitReturn = savedHasExplicitReturn; currentReachabilityState = savedReachabilityState; labelStack = savedLabelStack; - labels = savedLabels; + labelIndexMap = savedLabels; implicitLabels = savedImplicitLabels; } } + /** + * Returns true if node and its subnodes were successfully traversed. + * Returning false means that node was not examined and caller needs to dive into the node himself. + */ function bindReachableStatement(n: Node): boolean { if (checkUnreachable(n)) { return false; } - switch(n.kind) { + switch (n.kind) { case SyntaxKind.WhileStatement: return bindWhileStatement(n); case SyntaxKind.DoStatement: @@ -460,7 +464,7 @@ namespace ts { const postDoLabel = pushImplicitLabel(); bind(n.statement); - var postDoState = n.expression.kind === SyntaxKind.TrueKeyword ? Reachability.Unreachable : preDoState; + const postDoState = n.expression.kind === SyntaxKind.TrueKeyword ? Reachability.Unreachable : preDoState; popImplicitLabel(postDoLabel, postDoState); // bind expressions (don't affect reachability) @@ -505,7 +509,11 @@ namespace ts { } function bindIfStatement(n: IfStatement): boolean { + // denotes reachability state when entering 'thenStatement' part of the if statement: + // i.e. if condition is false then thenStatement is unreachable const ifTrueState = n.expression.kind === SyntaxKind.FalseKeyword ? Reachability.Unreachable : currentReachabilityState; + // denotes reachability state when entering 'elseStatement': + // i.e. if condition is true then elseStatement is unreachable const ifFalseState = n.expression.kind === SyntaxKind.TrueKeyword ? Reachability.Unreachable : currentReachabilityState; currentReachabilityState = ifTrueState; @@ -585,7 +593,7 @@ namespace ts { const hasDefault = forEach(n.caseBlock.clauses, c => c.kind === SyntaxKind.DefaultClause); // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case - var postSwitchState = hasDefault && currentReachabilityState !== Reachability.Reachable ? Reachability.Unreachable : preSwitchState; + const postSwitchState = hasDefault && currentReachabilityState !== Reachability.Reachable ? Reachability.Unreachable : preSwitchState; popImplicitLabel(postSwitchLabel, postSwitchState); @@ -595,7 +603,7 @@ namespace ts { function bindCaseBlock(n: CaseBlock): boolean { const startState = currentReachabilityState; - for(let clause of n.clauses) { + for (let clause of n.clauses) { currentReachabilityState = startState; bind(clause); if (clause.statements.length && currentReachabilityState === Reachability.Reachable && options.noFallthroughCasesInSwitch) { @@ -610,7 +618,7 @@ namespace ts { // call bind on label (don't affect reachability) bind(n.label); - var ok = pushNamedLabel(n.label); + const ok = pushNamedLabel(n.label); bind(n.statement); if (ok) { popNamedLabel(n.label, currentReachabilityState); @@ -1347,10 +1355,10 @@ namespace ts { function pushNamedLabel(name: Identifier): boolean { initializeReachabilityStateIfNecessary(); - if (hasProperty(labels, name.text)) { + if (hasProperty(labelIndexMap, name.text)) { return false; } - labels[name.text] = labelStack.push(Reachability.Unintialized) - 1; + labelIndexMap[name.text] = labelStack.push(Reachability.Unintialized) - 1; return true; } @@ -1365,11 +1373,11 @@ namespace ts { function popNamedLabel(label: Identifier, outerState: Reachability): void { initializeReachabilityStateIfNecessary(); - let index = labels[label.text]; + let index = labelIndexMap[label.text]; Debug.assert(index !== undefined); Debug.assert(labelStack.length == index + 1); - labels[label.text] = undefined; + labelIndexMap[label.text] = undefined; setCurrentStateAtLabel(labelStack.pop(), outerState, label); } @@ -1400,7 +1408,7 @@ namespace ts { function jumpToLabel(label: Identifier, outerState: Reachability): void { initializeReachabilityStateIfNecessary(); - const index = label ? labels[label.text] : lastOrUndefined(implicitLabels); + const index = label ? labelIndexMap[label.text] : lastOrUndefined(implicitLabels); if (index === undefined) { // reference to unknown label or // break/continue used outside of loops @@ -1411,12 +1419,16 @@ namespace ts { } function checkUnreachable(node: Node): boolean { - switch(currentReachabilityState) { + switch (currentReachabilityState) { case Reachability.Unreachable: const reportError = + // report error on all statements isStatement(node) || + // report error on class declarations node.kind === SyntaxKind.ClassDeclaration || - node.kind === SyntaxKind.ModuleDeclaration || + // report error on instantiated modules or const-enums only modules if preserveConstEnums is set + (node.kind === SyntaxKind.ModuleDeclaration && shouldReportErrorOnModuleDeclaration(node)) || + // report error on regular enums and const enums if preserveConstEnums is set (node.kind === SyntaxKind.EnumDeclaration && (!isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { @@ -1424,7 +1436,7 @@ namespace ts { // unreachable code is reported if // - user has explicitly asked about it AND - // - statement is in ambient context (statements in ambient context is already an error so we shoult not report extras) AND + // - statement is in not ambient context (statements in ambient context is already an error so we shoult not report extras) AND // - node is not variable statement OR // - node is block scoped variable statement OR // - node is not block scoped variable statement and at least one variable declaration has initializer @@ -1448,14 +1460,19 @@ namespace ts { default: return false; } + + function shouldReportErrorOnModuleDeclaration(node: ModuleDeclaration): boolean { + const instanceState = getModuleInstanceState(node); + return instanceState === ModuleInstanceState.Instantiated || (instanceState === ModuleInstanceState.ConstEnumOnly && options.preserveConstEnums); + } } function initializeReachabilityStateIfNecessary(): void { - if (labels) { + if (labelIndexMap) { return; } currentReachabilityState = Reachability.Reachable; - labels = {}; + labelIndexMap = {}; labelStack = []; implicitLabels = []; } diff --git a/tests/baselines/reference/reachabilityChecks1.errors.txt b/tests/baselines/reference/reachabilityChecks1.errors.txt index ebf1019e7e958..7708867c26c21 100644 --- a/tests/baselines/reference/reachabilityChecks1.errors.txt +++ b/tests/baselines/reference/reachabilityChecks1.errors.txt @@ -1,12 +1,13 @@ tests/cases/compiler/reachabilityChecks1.ts(3,1): error TS7027: Unreachable code detected. tests/cases/compiler/reachabilityChecks1.ts(7,5): error TS7027: Unreachable code detected. -tests/cases/compiler/reachabilityChecks1.ts(22,11): error TS7027: Unreachable code detected. -tests/cases/compiler/reachabilityChecks1.ts(28,12): error TS7027: Unreachable code detected. -tests/cases/compiler/reachabilityChecks1.ts(35,10): error TS7027: Unreachable code detected. -tests/cases/compiler/reachabilityChecks1.ts(44,16): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(19,12): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(31,12): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(48,11): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(61,10): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(70,16): error TS7027: Unreachable code detected. -==== tests/cases/compiler/reachabilityChecks1.ts (6 errors) ==== +==== tests/cases/compiler/reachabilityChecks1.ts (7 errors) ==== while (true); var x = 1; @@ -20,6 +21,36 @@ tests/cases/compiler/reachabilityChecks1.ts(44,16): error TS7027: Unreachable co !!! error TS7027: Unreachable code detected. } + module A1 { + do {} while(true); + module A { + interface F {} + } + } + + module A2 { + while (true); + module A { + ~ +!!! error TS7027: Unreachable code detected. + var x = 1; + } + } + + module A3 { + while (true); + type T = string; + } + + module A4 { + while (true); + module A { + ~ +!!! error TS7027: Unreachable code detected. + const enum E { X } + } + } + function f1(x) { if (x) { return; @@ -41,8 +72,6 @@ tests/cases/compiler/reachabilityChecks1.ts(44,16): error TS7027: Unreachable co module B { for (; ;); module C { - ~ -!!! error TS7027: Unreachable code detected. } } diff --git a/tests/baselines/reference/reachabilityChecks1.js b/tests/baselines/reference/reachabilityChecks1.js index 3f9ca87422a0a..dcbfbe89de41a 100644 --- a/tests/baselines/reference/reachabilityChecks1.js +++ b/tests/baselines/reference/reachabilityChecks1.js @@ -8,6 +8,32 @@ module A { let x; } +module A1 { + do {} while(true); + module A { + interface F {} + } +} + +module A2 { + while (true); + module A { + var x = 1; + } +} + +module A3 { + while (true); + type T = string; +} + +module A4 { + while (true); + module A { + const enum E { X } + } +} + function f1(x) { if (x) { return; @@ -59,6 +85,36 @@ var A; ; var x; })(A || (A = {})); +var A1; +(function (A1) { + do { } while (true); +})(A1 || (A1 = {})); +var A2; +(function (A2) { + while (true) + ; + var A; + (function (A) { + var x = 1; + })(A || (A = {})); +})(A2 || (A2 = {})); +var A3; +(function (A3) { + while (true) + ; +})(A3 || (A3 = {})); +var A4; +(function (A4) { + while (true) + ; + var A; + (function (A) { + var E; + (function (E) { + E[E["X"] = 0] = "X"; + })(E || (E = {})); + })(A || (A = {})); +})(A4 || (A4 = {})); function f1(x) { if (x) { return; diff --git a/tests/baselines/reference/reachabilityChecks2.errors.txt b/tests/baselines/reference/reachabilityChecks2.errors.txt new file mode 100644 index 0000000000000..3de7adc50a646 --- /dev/null +++ b/tests/baselines/reference/reachabilityChecks2.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/reachabilityChecks2.ts(5,8): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/reachabilityChecks2.ts (1 errors) ==== + + while (true) { } + const enum E { X } + + module A4 { + ~~ +!!! error TS7027: Unreachable code detected. + while (true); + module A { + const enum E { X } + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecks2.js b/tests/baselines/reference/reachabilityChecks2.js index 80534c0d7de20..a17b51b4ca61e 100644 --- a/tests/baselines/reference/reachabilityChecks2.js +++ b/tests/baselines/reference/reachabilityChecks2.js @@ -3,7 +3,19 @@ while (true) { } const enum E { X } +module A4 { + while (true); + module A { + const enum E { X } + } +} + //// [reachabilityChecks2.js] while (true) { } +var A4; +(function (A4) { + while (true) + ; +})(A4 || (A4 = {})); diff --git a/tests/baselines/reference/reachabilityChecks2.symbols b/tests/baselines/reference/reachabilityChecks2.symbols deleted file mode 100644 index d289304dffad8..0000000000000 --- a/tests/baselines/reference/reachabilityChecks2.symbols +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/compiler/reachabilityChecks2.ts === - -while (true) { } -const enum E { X } ->E : Symbol(E, Decl(reachabilityChecks2.ts, 1, 16)) ->X : Symbol(E.X, Decl(reachabilityChecks2.ts, 2, 14)) - - diff --git a/tests/baselines/reference/reachabilityChecks2.types b/tests/baselines/reference/reachabilityChecks2.types deleted file mode 100644 index 38dad87c6a1f3..0000000000000 --- a/tests/baselines/reference/reachabilityChecks2.types +++ /dev/null @@ -1,10 +0,0 @@ -=== tests/cases/compiler/reachabilityChecks2.ts === - -while (true) { } ->true : boolean - -const enum E { X } ->E : E ->X : E - - diff --git a/tests/cases/compiler/reachabilityChecks1.ts b/tests/cases/compiler/reachabilityChecks1.ts index bc7662486a621..ce009e13456c6 100644 --- a/tests/cases/compiler/reachabilityChecks1.ts +++ b/tests/cases/compiler/reachabilityChecks1.ts @@ -9,6 +9,32 @@ module A { let x; } +module A1 { + do {} while(true); + module A { + interface F {} + } +} + +module A2 { + while (true); + module A { + var x = 1; + } +} + +module A3 { + while (true); + type T = string; +} + +module A4 { + while (true); + module A { + const enum E { X } + } +} + function f1(x) { if (x) { return; diff --git a/tests/cases/compiler/reachabilityChecks2.ts b/tests/cases/compiler/reachabilityChecks2.ts index fc8d53bde8f7a..9a2b519ca4c3e 100644 --- a/tests/cases/compiler/reachabilityChecks2.ts +++ b/tests/cases/compiler/reachabilityChecks2.ts @@ -4,3 +4,10 @@ while (true) { } const enum E { X } +module A4 { + while (true); + module A { + const enum E { X } + } +} + From 682c14cc7f42dcaeef9cce90644173cea29aebfc Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 16 Sep 2015 12:43:52 -0700 Subject: [PATCH 03/11] addressed PR feedback --- src/compiler/binder.ts | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index cebc930d32813..d22222b785e2a 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -406,37 +406,37 @@ namespace ts { * Returns true if node and its subnodes were successfully traversed. * Returning false means that node was not examined and caller needs to dive into the node himself. */ - function bindReachableStatement(n: Node): boolean { - if (checkUnreachable(n)) { + function bindReachableStatement(node: Node): boolean { + if (checkUnreachable(node)) { return false; } - switch (n.kind) { + switch (node.kind) { case SyntaxKind.WhileStatement: - return bindWhileStatement(n); + return bindWhileStatement(node); case SyntaxKind.DoStatement: - return bindDoStatement(n); + return bindDoStatement(node); case SyntaxKind.ForStatement: - return bindForStatement(n); + return bindForStatement(node); case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement: - return bindForInOrForOfStatement(n); + return bindForInOrForOfStatement(node); case SyntaxKind.IfStatement: - return bindIfStatement(n); + return bindIfStatement(node); case SyntaxKind.ReturnStatement: case SyntaxKind.ThrowStatement: - return bindReturnOrThrow(n); + return bindReturnOrThrow(node); case SyntaxKind.BreakStatement: case SyntaxKind.ContinueStatement: - return bindBreakOrContinueStatement(n); + return bindBreakOrContinueStatement(node); case SyntaxKind.TryStatement: - return bindTryStatement(n); + return bindTryStatement(node); case SyntaxKind.SwitchStatement: - return bindSwitchStatement(n); + return bindSwitchStatement(node); case SyntaxKind.CaseBlock: - return bindCaseBlock(n); + return bindCaseBlock(node); case SyntaxKind.LabeledStatement: - return bindLabeledStatement(n); + return bindLabeledStatement(node); default: return false; } @@ -1436,7 +1436,8 @@ namespace ts { // unreachable code is reported if // - user has explicitly asked about it AND - // - statement is in not ambient context (statements in ambient context is already an error so we shoult not report extras) AND + // - statement is in not ambient context (statements in ambient context is already an error + // so we should not report extras) AND // - node is not variable statement OR // - node is block scoped variable statement OR // - node is not block scoped variable statement and at least one variable declaration has initializer From ca0d580a14e019a05eac41bd7f21a36af0feafaa Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 1 Oct 2015 23:20:24 -0700 Subject: [PATCH 04/11] merge with master, fix linter issues --- src/compiler/binder.ts | 70 ++++++++++++++++++++--------------------- src/compiler/checker.ts | 2 +- src/compiler/types.ts | 10 +++--- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 57e24faa6bf08..8211509f58098 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -9,14 +9,14 @@ namespace ts { Instantiated = 1, ConstEnumOnly = 2 } - + const enum Reachability { Unintialized = 1 << 0, Reachable = 1 << 1, Unreachable = 1 << 2, ReportedUnreachable = 1 << 3 } - + function or(state1: Reachability, state2: Reachability): Reachability { return (state1 | state2) & Reachability.Reachable ? Reachability.Reachable @@ -111,7 +111,7 @@ namespace ts { let labelStack: Reachability[]; let labelIndexMap: Map; let implicitLabels: number[]; - + // If this file is an external module, then it is automatically in strict-mode according to // ES6. If it is not an external module, then we'll determine if it is in strict mode or // not depending on if we see "use strict" in certain places (or if we hit a class/namespace). @@ -365,18 +365,18 @@ namespace ts { parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } - + function shouldSaveReachabilityState(n: Node): boolean { return n.kind === SyntaxKind.SourceFile || n.kind === SyntaxKind.ModuleBlock || isFunctionLike(n); } - + function bindWithReachabilityChecks(node: Node): void { let savedReachabilityState: Reachability; let savedLabelStack: Reachability[]; let savedLabels: Map; let savedImplicitLabels: number[]; let savedHasExplicitReturn: boolean; - + let saveState = shouldSaveReachabilityState(node); if (saveState) { savedReachabilityState = currentReachabilityState; @@ -384,7 +384,7 @@ namespace ts { savedLabels = labelIndexMap; savedImplicitLabels = implicitLabels; savedHasExplicitReturn = hasExplicitReturn; - + currentReachabilityState = Reachability.Reachable; hasExplicitReturn = false; labelStack = labelIndexMap = implicitLabels = undefined; @@ -393,7 +393,7 @@ namespace ts { if (!bindReachableStatement(node)) { forEachChild(node, bind); } - + if (currentReachabilityState === Reachability.Reachable && isFunctionLike(node) && nodeIsPresent((node).body)) { node.flags |= NodeFlags.HasImplicitReturn; if (hasExplicitReturn) { @@ -451,19 +451,19 @@ namespace ts { } function bindWhileStatement(n: WhileStatement): boolean { - const preWhileState = + const preWhileState = n.expression.kind === SyntaxKind.FalseKeyword ? Reachability.Unreachable : currentReachabilityState; - const postWhileState = + const postWhileState = n.expression.kind === SyntaxKind.TrueKeyword ? Reachability.Unreachable : currentReachabilityState; // bind expressions (don't affect reachability) bind(n.expression); - + currentReachabilityState = preWhileState; const postWhileLabel = pushImplicitLabel(); bind(n.statement); - popImplicitLabel(postWhileLabel, postWhileState) - + popImplicitLabel(postWhileLabel, postWhileState); + return true; } @@ -480,7 +480,7 @@ namespace ts { return true; } - + function bindForStatement(n: ForStatement): boolean { const preForState = currentReachabilityState; const postForLabel = pushImplicitLabel(); @@ -505,7 +505,7 @@ namespace ts { function bindForInOrForOfStatement(n: ForInStatement | ForOfStatement): boolean { const preStatementState = currentReachabilityState; const postStatementLabel = pushImplicitLabel(); - + // bind expressions (don't affect reachability) bind(n.initializer); bind(n.expression); @@ -566,7 +566,7 @@ namespace ts { currentReachabilityState = Reachability.Unreachable; return true; - } + } function bindTryStatement(n: TryStatement): boolean { // catch\finally blocks has the same reachability as try block @@ -597,7 +597,7 @@ namespace ts { bind(n.expression); bind(n.caseBlock); - + const hasDefault = forEach(n.caseBlock.clauses, c => c.kind === SyntaxKind.DefaultClause); // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case @@ -1055,7 +1055,7 @@ namespace ts { if (!node) { return; } - + node.parent = parent; let savedInStrictMode = inStrictMode; @@ -1365,46 +1365,46 @@ namespace ts { function pushNamedLabel(name: Identifier): boolean { initializeReachabilityStateIfNecessary(); - + if (hasProperty(labelIndexMap, name.text)) { return false; } labelIndexMap[name.text] = labelStack.push(Reachability.Unintialized) - 1; return true; } - + function pushImplicitLabel(): number { initializeReachabilityStateIfNecessary(); - + let index = labelStack.push(Reachability.Unintialized) - 1; implicitLabels.push(index); return index; } - + function popNamedLabel(label: Identifier, outerState: Reachability): void { initializeReachabilityStateIfNecessary(); - + let index = labelIndexMap[label.text]; Debug.assert(index !== undefined); Debug.assert(labelStack.length == index + 1); - + labelIndexMap[label.text] = undefined; - + setCurrentStateAtLabel(labelStack.pop(), outerState, label); } - + function popImplicitLabel(implicitLabelIndex: number, outerState: Reachability): void { initializeReachabilityStateIfNecessary(); - + Debug.assert(labelStack.length === implicitLabelIndex + 1, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`); let i = implicitLabels.pop(); Debug.assert(implicitLabelIndex === i, `i: ${i}, index: ${implicitLabelIndex}`); setCurrentStateAtLabel(labelStack.pop(), outerState, /*name*/ undefined); } - + function setCurrentStateAtLabel(innerMergedState: Reachability, outerState: Reachability, label: Identifier): void { initializeReachabilityStateIfNecessary(); - + if (innerMergedState === Reachability.Unintialized) { if (label && options.noUnusedLabels) { file.bindDiagnostics.push(createDiagnosticForNode(label, Diagnostics.Unused_label)); @@ -1415,10 +1415,10 @@ namespace ts { currentReachabilityState = or(innerMergedState, outerState); } } - + function jumpToLabel(label: Identifier, outerState: Reachability): void { initializeReachabilityStateIfNecessary(); - + const index = label ? labelIndexMap[label.text] : lastOrUndefined(implicitLabels); if (index === undefined) { // reference to unknown label or @@ -1444,7 +1444,7 @@ namespace ts { if (reportError) { currentReachabilityState = Reachability.ReportedUnreachable; - + // unreachable code is reported if // - user has explicitly asked about it AND // - statement is in not ambient context (statements in ambient context is already an error @@ -1453,15 +1453,15 @@ namespace ts { // - node is block scoped variable statement OR // - node is not block scoped variable statement and at least one variable declaration has initializer // Rationale: we don't want to report errors on non-initialized var's since they are hoisted - // On the other side we do want to report errors on non-initialized 'lets' because of TDZ - const reportUnreachableCode = + // On the other side we do want to report errors on non-initialized 'lets' because of TDZ + const reportUnreachableCode = options.noUnreachableCode && !isInAmbientContext(node) && ( node.kind !== SyntaxKind.VariableStatement || getCombinedNodeFlags((node).declarationList) & NodeFlags.BlockScoped || forEach((node).declarationList.declarations, d => d.initializer) - ) + ); if (reportUnreachableCode) { file.bindDiagnostics.push(createDiagnosticForNode(node, Diagnostics.Unreachable_code_detected)); diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 01f240a80ca86..f31beccf87d46 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9553,7 +9553,7 @@ namespace ts { if (nodeIsMissing(func.body) || func.body.kind !== SyntaxKind.Block || !(func.flags & NodeFlags.HasImplicitReturn)) { return; } - + if (func.flags & NodeFlags.HasExplicitReturn) { if (compilerOptions.noImplicitReturns) { error(func.type, Diagnostics.Not_all_code_paths_return_a_value); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 24a6b11eef0e3..a93a4587c1b45 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2074,11 +2074,11 @@ namespace ts { experimentalDecorators?: boolean; experimentalAsyncFunctions?: boolean; emitDecoratorMetadata?: boolean; - moduleResolution?: ModuleResolutionKind, - noUnusedLabels?: boolean, - noImplicitReturns?: boolean, - noFallthroughCasesInSwitch?: boolean, - noUnreachableCode?: boolean, + moduleResolution?: ModuleResolutionKind; + noUnusedLabels?: boolean; + noImplicitReturns?: boolean; + noFallthroughCasesInSwitch?: boolean; + noUnreachableCode?: boolean; /* @internal */ stripInternal?: boolean; // Skip checking lib.d.ts to help speed up tests. From f0f5a0d71ee9f7966f10459ddf10468b3e4887f9 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Sat, 3 Oct 2015 00:20:15 -0700 Subject: [PATCH 05/11] updated command line options, accepted baselines --- src/compiler/binder.ts | 22 +- src/compiler/commandLineParser.ts | 8 +- src/compiler/diagnosticMessages.json | 4 +- src/compiler/types.ts | 4 +- src/compiler/utilities.ts | 2 +- .../reference/assignmentLHSIsValue.errors.txt | 5 +- .../bestCommonTypeReturnStatement.errors.txt | 18 + .../bestCommonTypeReturnStatement.symbols | 34 - .../bestCommonTypeReturnStatement.types | 39 - .../reference/breakTarget3.errors.txt | 11 + .../baselines/reference/breakTarget3.symbols | 7 - tests/baselines/reference/breakTarget3.types | 13 - .../reference/breakTarget4.errors.txt | 11 + .../baselines/reference/breakTarget4.symbols | 7 - tests/baselines/reference/breakTarget4.types | 13 - .../reference/breakTarget5.errors.txt | 5 +- ...utReturnTypeAnnotationInference.errors.txt | 126 + ...thoutReturnTypeAnnotationInference.symbols | 255 -- ...WithoutReturnTypeAnnotationInference.types | 296 -- tests/baselines/reference/cf.errors.txt | 72 + tests/baselines/reference/cf.symbols | 111 - tests/baselines/reference/cf.types | 169 - .../reference/commentsAtEndOfFile1.errors.txt | 10 + .../reference/commentsAtEndOfFile1.symbols | 6 - .../reference/commentsAtEndOfFile1.types | 7 - .../compoundAssignmentLHSIsValue.errors.txt | 5 +- .../conditionalExpressions2.errors.txt | 15 + .../reference/conditionalExpressions2.symbols | 33 - .../reference/conditionalExpressions2.types | 68 - ...nstDeclarations-invalidContexts.errors.txt | 8 +- .../constDeclarations-scopes.errors.txt | 8 +- ...constDeclarations-validContexts.errors.txt | 8 +- ...torWithIncompleteTypeAnnotation.errors.txt | 8 +- ...ontinueNotInIterationStatement4.errors.txt | 5 +- .../reference/continueTarget3.errors.txt | 11 + .../reference/continueTarget3.symbols | 7 - .../baselines/reference/continueTarget3.types | 13 - .../reference/continueTarget4.errors.txt | 11 + .../reference/continueTarget4.symbols | 7 - .../baselines/reference/continueTarget4.types | 13 - .../reference/continueTarget5.errors.txt | 5 +- .../doWhileBreakStatements.errors.txt | 50 + .../reference/doWhileBreakStatements.symbols | 41 - .../reference/doWhileBreakStatements.types | 80 - .../doWhileContinueStatements.errors.txt | 44 + .../doWhileContinueStatements.symbols | 41 - .../reference/doWhileContinueStatements.types | 80 - .../reference/downlevelLetConst16.errors.txt | 8 +- .../reference/downlevelLetConst17.errors.txt | 73 + .../reference/downlevelLetConst17.symbols | 134 - .../reference/downlevelLetConst17.types | 169 - .../reference/downlevelLetConst18.errors.txt | 5 +- .../reference/duplicateLabel1.errors.txt | 5 +- .../reference/duplicateLabel2.errors.txt | 5 +- .../reference/duplicateLabel3.errors.txt | 17 + .../reference/duplicateLabel3.symbols | 11 - .../baselines/reference/duplicateLabel3.types | 18 - .../reference/duplicateLabel4.errors.txt | 16 + .../reference/duplicateLabel4.symbols | 9 - .../baselines/reference/duplicateLabel4.types | 14 - .../duplicateLocalVariable1.errors.txt | 8 +- .../duplicateVariablesByScope.errors.txt | 37 + .../duplicateVariablesByScope.symbols | 56 - .../reference/duplicateVariablesByScope.types | 72 - .../es6ClassSuperCodegenBug.errors.txt | 19 + .../reference/es6ClassSuperCodegenBug.symbols | 24 - .../reference/es6ClassSuperCodegenBug.types | 32 - .../reference/escapedIdentifiers.errors.txt | 146 + .../reference/escapedIdentifiers.symbols | 260 -- .../reference/escapedIdentifiers.types | 351 -- tests/baselines/reference/for.errors.txt | 5 +- .../reference/forBreakStatements.errors.txt | 49 + .../reference/forBreakStatements.symbols | 40 - .../reference/forBreakStatements.types | 63 - .../forContinueStatements.errors.txt | 43 + .../reference/forContinueStatements.symbols | 40 - .../reference/forContinueStatements.types | 63 - .../reference/forInBreakStatements.errors.txt | 46 + .../reference/forInBreakStatements.symbols | 58 - .../reference/forInBreakStatements.types | 92 - .../forInContinueStatements.errors.txt | 46 + .../reference/forInContinueStatements.symbols | 58 - .../reference/forInContinueStatements.types | 92 - .../reference/forStatements.errors.txt | 52 + .../baselines/reference/forStatements.symbols | 145 - tests/baselines/reference/forStatements.types | 164 - ...orStatementsMultipleInvalidDecl.errors.txt | 5 +- .../forStatementsMultipleValidDecl.errors.txt | 39 + .../forStatementsMultipleValidDecl.symbols | 110 - .../forStatementsMultipleValidDecl.types | 140 - .../functionImplementationErrors.errors.txt | 35 +- .../functionImplementations.errors.txt | 183 + .../reference/functionImplementations.symbols | 344 -- .../reference/functionImplementations.types | 416 -- .../reference/functionOverloads12.errors.txt | 10 + .../reference/functionOverloads12.symbols | 10 - .../reference/functionOverloads12.types | 13 - .../reference/functionReturn.errors.txt | 23 + .../reference/functionReturn.symbols | 30 - .../baselines/reference/functionReturn.types | 35 - ...ionWithMultipleReturnStatements.errors.txt | 17 +- ...onWithMultipleReturnStatements2.errors.txt | 26 +- .../functionWithNoBestCommonType1.errors.txt | 5 +- .../functionWithNoBestCommonType2.errors.txt | 5 +- ...gReturnStatementsAndExpressions.errors.txt | 11 +- .../generatedContextualTyping.errors.txt | 393 ++ .../generatedContextualTyping.symbols | 2831 ------------- .../reference/generatedContextualTyping.types | 3768 ----------------- .../reference/ifDoWhileStatements.errors.txt | 168 + .../reference/ifDoWhileStatements.symbols | 336 -- .../reference/ifDoWhileStatements.types | 433 -- .../ifElseWithStatements1.errors.txt | 8 +- ...edFunctionReturnTypeIsEmptyType.errors.txt | 5 +- ...taticPropertyOverridingAccessor.errors.txt | 5 +- .../interfaceExtendingClass2.errors.txt | 5 +- .../interfaceWithPrivateMember.errors.txt | 5 +- .../invalidDoWhileBreakStatements.errors.txt | 8 +- ...nvalidDoWhileContinueStatements.errors.txt | 8 +- .../invalidForBreakStatements.errors.txt | 8 +- .../invalidForContinueStatements.errors.txt | 8 +- .../invalidForInBreakStatements.errors.txt | 17 +- .../invalidForInContinueStatements.errors.txt | 17 +- .../invalidThrowStatement.errors.txt | 5 +- .../invalidWhileBreakStatements.errors.txt | 8 +- .../invalidWhileContinueStatements.errors.txt | 8 +- .../letAndVarRedeclaration.errors.txt | 5 +- ...letDeclarations-invalidContexts.errors.txt | 8 +- .../letDeclarations-scopes.errors.txt | 11 +- .../letDeclarations-validContexts.errors.txt | 20 +- .../reference/localTypes4.errors.txt | 5 +- tests/baselines/reference/null.errors.txt | 30 + tests/baselines/reference/null.symbols | 44 - tests/baselines/reference/null.types | 59 - ...overloadOnConstAsTypeAnnotation.errors.txt | 7 +- .../reference/parser10.1.1-8gs.errors.txt | 5 +- .../reference/parser768531.errors.txt | 8 + .../baselines/reference/parser768531.symbols | 4 - tests/baselines/reference/parser768531.types | 8 - ...serErrorRecovery_ModuleElement1.errors.txt | 5 +- .../parserLabeledStatement1.d.errors.txt | 5 +- .../reference/parser_breakTarget3.errors.txt | 11 + .../reference/parser_breakTarget3.symbols | 7 - .../reference/parser_breakTarget3.types | 13 - .../reference/parser_breakTarget4.errors.txt | 11 + .../reference/parser_breakTarget4.symbols | 7 - .../reference/parser_breakTarget4.types | 13 - .../reference/parser_breakTarget5.errors.txt | 5 +- ...ontinueNotInIterationStatement4.errors.txt | 5 +- .../parser_continueTarget3.errors.txt | 11 + .../reference/parser_continueTarget3.symbols | 7 - .../reference/parser_continueTarget3.types | 13 - .../parser_continueTarget4.errors.txt | 11 + .../reference/parser_continueTarget4.symbols | 7 - .../reference/parser_continueTarget4.types | 13 - .../parser_continueTarget5.errors.txt | 5 +- .../parser_duplicateLabel1.errors.txt | 5 +- .../parser_duplicateLabel2.errors.txt | 5 +- .../parser_duplicateLabel3.errors.txt | 17 + .../reference/parser_duplicateLabel3.symbols | 11 - .../reference/parser_duplicateLabel3.types | 18 - .../parser_duplicateLabel4.errors.txt | 16 + .../reference/parser_duplicateLabel4.symbols | 9 - .../reference/parser_duplicateLabel4.types | 14 - ...ionCannotNameReturnTypeDeclFile.errors.txt | 38 +- .../reference/reachabilityChecks1.errors.txt | 24 +- .../reference/reachabilityChecks2.errors.txt | 4 +- .../reference/reachabilityChecks3.errors.txt | 15 +- .../reference/reachabilityChecks3.js | 11 +- .../reference/reachabilityChecks5.errors.txt | 4 +- .../reference/recursiveLetConst.errors.txt | 5 +- .../reference/recursiveMods.errors.txt | 29 + .../baselines/reference/recursiveMods.symbols | 47 - tests/baselines/reference/recursiveMods.types | 53 - .../recursiveNamedLambdaCall.errors.txt | 5 +- .../reference/reservedWords2.errors.txt | 5 +- .../reference/returnStatement1.errors.txt | 12 + .../reference/returnStatement1.symbols | 14 - .../reference/returnStatement1.types | 17 - .../reference/scanner10.1.1-8gs.errors.txt | 5 +- .../reference/setterWithReturn.errors.txt | 5 +- .../sourceMapValidationFor.errors.txt | 5 +- .../sourceMapValidationLabeled.errors.txt | 8 + .../sourceMapValidationLabeled.symbols | 5 - .../sourceMapValidationLabeled.types | 8 - .../switchBreakStatements.errors.txt | 67 + .../reference/switchBreakStatements.symbols | 58 - .../reference/switchBreakStatements.types | 126 - .../reference/systemModule8.errors.txt | 36 + .../baselines/reference/systemModule8.symbols | 92 - tests/baselines/reference/systemModule8.types | 143 - .../throwInEnclosingStatements.errors.txt | 52 + .../throwInEnclosingStatements.symbols | 93 - .../throwInEnclosingStatements.types | 109 - .../reference/throwStatements.errors.txt | 91 + .../reference/throwStatements.symbols | 215 - .../baselines/reference/throwStatements.types | 266 -- .../reference/throwWithoutNewLine2.errors.txt | 7 +- .../typeGuardFunctionErrors.errors.txt | 5 +- .../typeofOperatorWithAnyOtherType.errors.txt | 11 +- .../typeofOperatorWithBooleanType.errors.txt | 59 + .../typeofOperatorWithBooleanType.symbols | 130 - .../typeofOperatorWithBooleanType.types | 176 - .../typeofOperatorWithEnumType.errors.txt | 33 + .../typeofOperatorWithEnumType.symbols | 69 - .../typeofOperatorWithEnumType.types | 98 - .../typeofOperatorWithNumberType.errors.txt | 69 + .../typeofOperatorWithNumberType.symbols | 168 - .../typeofOperatorWithNumberType.types | 233 - .../typeofOperatorWithStringType.errors.txt | 69 + .../typeofOperatorWithStringType.symbols | 167 - .../typeofOperatorWithStringType.types | 233 - .../reference/undeclaredVarEmit.errors.txt | 5 +- ...lidMultipleVariableDeclarations.errors.txt | 45 + .../validMultipleVariableDeclarations.symbols | 118 - .../validMultipleVariableDeclarations.types | 152 - .../reference/whileBreakStatements.errors.txt | 54 + .../reference/whileBreakStatements.symbols | 45 - .../reference/whileBreakStatements.types | 89 - .../whileContinueStatements.errors.txt | 59 + .../reference/whileContinueStatements.symbols | 56 - .../reference/whileContinueStatements.types | 110 - tests/cases/compiler/reachabilityChecks1.ts | 2 +- tests/cases/compiler/reachabilityChecks2.ts | 2 +- tests/cases/compiler/reachabilityChecks3.ts | 9 +- tests/cases/compiler/reachabilityChecks5.ts | 2 +- .../unclosedFunctionErrorRecovery3.ts | 1 + tests/webTestServer.ts | 1 - 227 files changed, 3047 insertions(+), 15217 deletions(-) create mode 100644 tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt delete mode 100644 tests/baselines/reference/bestCommonTypeReturnStatement.symbols delete mode 100644 tests/baselines/reference/bestCommonTypeReturnStatement.types create mode 100644 tests/baselines/reference/breakTarget3.errors.txt delete mode 100644 tests/baselines/reference/breakTarget3.symbols delete mode 100644 tests/baselines/reference/breakTarget3.types create mode 100644 tests/baselines/reference/breakTarget4.errors.txt delete mode 100644 tests/baselines/reference/breakTarget4.symbols delete mode 100644 tests/baselines/reference/breakTarget4.types create mode 100644 tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt delete mode 100644 tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols delete mode 100644 tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types create mode 100644 tests/baselines/reference/cf.errors.txt delete mode 100644 tests/baselines/reference/cf.symbols delete mode 100644 tests/baselines/reference/cf.types create mode 100644 tests/baselines/reference/commentsAtEndOfFile1.errors.txt delete mode 100644 tests/baselines/reference/commentsAtEndOfFile1.symbols delete mode 100644 tests/baselines/reference/commentsAtEndOfFile1.types create mode 100644 tests/baselines/reference/conditionalExpressions2.errors.txt delete mode 100644 tests/baselines/reference/conditionalExpressions2.symbols delete mode 100644 tests/baselines/reference/conditionalExpressions2.types create mode 100644 tests/baselines/reference/continueTarget3.errors.txt delete mode 100644 tests/baselines/reference/continueTarget3.symbols delete mode 100644 tests/baselines/reference/continueTarget3.types create mode 100644 tests/baselines/reference/continueTarget4.errors.txt delete mode 100644 tests/baselines/reference/continueTarget4.symbols delete mode 100644 tests/baselines/reference/continueTarget4.types create mode 100644 tests/baselines/reference/doWhileBreakStatements.errors.txt delete mode 100644 tests/baselines/reference/doWhileBreakStatements.symbols delete mode 100644 tests/baselines/reference/doWhileBreakStatements.types create mode 100644 tests/baselines/reference/doWhileContinueStatements.errors.txt delete mode 100644 tests/baselines/reference/doWhileContinueStatements.symbols delete mode 100644 tests/baselines/reference/doWhileContinueStatements.types create mode 100644 tests/baselines/reference/downlevelLetConst17.errors.txt delete mode 100644 tests/baselines/reference/downlevelLetConst17.symbols delete mode 100644 tests/baselines/reference/downlevelLetConst17.types create mode 100644 tests/baselines/reference/duplicateLabel3.errors.txt delete mode 100644 tests/baselines/reference/duplicateLabel3.symbols delete mode 100644 tests/baselines/reference/duplicateLabel3.types create mode 100644 tests/baselines/reference/duplicateLabel4.errors.txt delete mode 100644 tests/baselines/reference/duplicateLabel4.symbols delete mode 100644 tests/baselines/reference/duplicateLabel4.types create mode 100644 tests/baselines/reference/duplicateVariablesByScope.errors.txt delete mode 100644 tests/baselines/reference/duplicateVariablesByScope.symbols delete mode 100644 tests/baselines/reference/duplicateVariablesByScope.types create mode 100644 tests/baselines/reference/es6ClassSuperCodegenBug.errors.txt delete mode 100644 tests/baselines/reference/es6ClassSuperCodegenBug.symbols delete mode 100644 tests/baselines/reference/es6ClassSuperCodegenBug.types create mode 100644 tests/baselines/reference/escapedIdentifiers.errors.txt delete mode 100644 tests/baselines/reference/escapedIdentifiers.symbols delete mode 100644 tests/baselines/reference/escapedIdentifiers.types create mode 100644 tests/baselines/reference/forBreakStatements.errors.txt delete mode 100644 tests/baselines/reference/forBreakStatements.symbols delete mode 100644 tests/baselines/reference/forBreakStatements.types create mode 100644 tests/baselines/reference/forContinueStatements.errors.txt delete mode 100644 tests/baselines/reference/forContinueStatements.symbols delete mode 100644 tests/baselines/reference/forContinueStatements.types create mode 100644 tests/baselines/reference/forInBreakStatements.errors.txt delete mode 100644 tests/baselines/reference/forInBreakStatements.symbols delete mode 100644 tests/baselines/reference/forInBreakStatements.types create mode 100644 tests/baselines/reference/forInContinueStatements.errors.txt delete mode 100644 tests/baselines/reference/forInContinueStatements.symbols delete mode 100644 tests/baselines/reference/forInContinueStatements.types create mode 100644 tests/baselines/reference/forStatements.errors.txt delete mode 100644 tests/baselines/reference/forStatements.symbols delete mode 100644 tests/baselines/reference/forStatements.types create mode 100644 tests/baselines/reference/forStatementsMultipleValidDecl.errors.txt delete mode 100644 tests/baselines/reference/forStatementsMultipleValidDecl.symbols delete mode 100644 tests/baselines/reference/forStatementsMultipleValidDecl.types create mode 100644 tests/baselines/reference/functionImplementations.errors.txt delete mode 100644 tests/baselines/reference/functionImplementations.symbols delete mode 100644 tests/baselines/reference/functionImplementations.types create mode 100644 tests/baselines/reference/functionOverloads12.errors.txt delete mode 100644 tests/baselines/reference/functionOverloads12.symbols delete mode 100644 tests/baselines/reference/functionOverloads12.types create mode 100644 tests/baselines/reference/functionReturn.errors.txt delete mode 100644 tests/baselines/reference/functionReturn.symbols delete mode 100644 tests/baselines/reference/functionReturn.types create mode 100644 tests/baselines/reference/generatedContextualTyping.errors.txt delete mode 100644 tests/baselines/reference/generatedContextualTyping.symbols delete mode 100644 tests/baselines/reference/generatedContextualTyping.types create mode 100644 tests/baselines/reference/ifDoWhileStatements.errors.txt delete mode 100644 tests/baselines/reference/ifDoWhileStatements.symbols delete mode 100644 tests/baselines/reference/ifDoWhileStatements.types create mode 100644 tests/baselines/reference/null.errors.txt delete mode 100644 tests/baselines/reference/null.symbols delete mode 100644 tests/baselines/reference/null.types create mode 100644 tests/baselines/reference/parser768531.errors.txt delete mode 100644 tests/baselines/reference/parser768531.symbols delete mode 100644 tests/baselines/reference/parser768531.types create mode 100644 tests/baselines/reference/parser_breakTarget3.errors.txt delete mode 100644 tests/baselines/reference/parser_breakTarget3.symbols delete mode 100644 tests/baselines/reference/parser_breakTarget3.types create mode 100644 tests/baselines/reference/parser_breakTarget4.errors.txt delete mode 100644 tests/baselines/reference/parser_breakTarget4.symbols delete mode 100644 tests/baselines/reference/parser_breakTarget4.types create mode 100644 tests/baselines/reference/parser_continueTarget3.errors.txt delete mode 100644 tests/baselines/reference/parser_continueTarget3.symbols delete mode 100644 tests/baselines/reference/parser_continueTarget3.types create mode 100644 tests/baselines/reference/parser_continueTarget4.errors.txt delete mode 100644 tests/baselines/reference/parser_continueTarget4.symbols delete mode 100644 tests/baselines/reference/parser_continueTarget4.types create mode 100644 tests/baselines/reference/parser_duplicateLabel3.errors.txt delete mode 100644 tests/baselines/reference/parser_duplicateLabel3.symbols delete mode 100644 tests/baselines/reference/parser_duplicateLabel3.types create mode 100644 tests/baselines/reference/parser_duplicateLabel4.errors.txt delete mode 100644 tests/baselines/reference/parser_duplicateLabel4.symbols delete mode 100644 tests/baselines/reference/parser_duplicateLabel4.types create mode 100644 tests/baselines/reference/recursiveMods.errors.txt delete mode 100644 tests/baselines/reference/recursiveMods.symbols delete mode 100644 tests/baselines/reference/recursiveMods.types create mode 100644 tests/baselines/reference/returnStatement1.errors.txt delete mode 100644 tests/baselines/reference/returnStatement1.symbols delete mode 100644 tests/baselines/reference/returnStatement1.types create mode 100644 tests/baselines/reference/sourceMapValidationLabeled.errors.txt delete mode 100644 tests/baselines/reference/sourceMapValidationLabeled.symbols delete mode 100644 tests/baselines/reference/sourceMapValidationLabeled.types create mode 100644 tests/baselines/reference/switchBreakStatements.errors.txt delete mode 100644 tests/baselines/reference/switchBreakStatements.symbols delete mode 100644 tests/baselines/reference/switchBreakStatements.types create mode 100644 tests/baselines/reference/systemModule8.errors.txt delete mode 100644 tests/baselines/reference/systemModule8.symbols delete mode 100644 tests/baselines/reference/systemModule8.types create mode 100644 tests/baselines/reference/throwInEnclosingStatements.errors.txt delete mode 100644 tests/baselines/reference/throwInEnclosingStatements.symbols delete mode 100644 tests/baselines/reference/throwInEnclosingStatements.types create mode 100644 tests/baselines/reference/throwStatements.errors.txt delete mode 100644 tests/baselines/reference/throwStatements.symbols delete mode 100644 tests/baselines/reference/throwStatements.types create mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt delete mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.symbols delete mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.types create mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.errors.txt delete mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.symbols delete mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.types create mode 100644 tests/baselines/reference/typeofOperatorWithNumberType.errors.txt delete mode 100644 tests/baselines/reference/typeofOperatorWithNumberType.symbols delete mode 100644 tests/baselines/reference/typeofOperatorWithNumberType.types create mode 100644 tests/baselines/reference/typeofOperatorWithStringType.errors.txt delete mode 100644 tests/baselines/reference/typeofOperatorWithStringType.symbols delete mode 100644 tests/baselines/reference/typeofOperatorWithStringType.types create mode 100644 tests/baselines/reference/validMultipleVariableDeclarations.errors.txt delete mode 100644 tests/baselines/reference/validMultipleVariableDeclarations.symbols delete mode 100644 tests/baselines/reference/validMultipleVariableDeclarations.types create mode 100644 tests/baselines/reference/whileBreakStatements.errors.txt delete mode 100644 tests/baselines/reference/whileBreakStatements.symbols delete mode 100644 tests/baselines/reference/whileBreakStatements.types create mode 100644 tests/baselines/reference/whileContinueStatements.errors.txt delete mode 100644 tests/baselines/reference/whileContinueStatements.symbols delete mode 100644 tests/baselines/reference/whileContinueStatements.types diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 8211509f58098..9414b93de3f4b 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -557,14 +557,11 @@ namespace ts { function bindBreakOrContinueStatement(n: BreakOrContinueStatement): boolean { // call bind on label (don't affect reachability) bind(n.label); - if (n.kind === SyntaxKind.BreakStatement) { - jumpToLabel(n.label, currentReachabilityState); + // for continue case touch label so it will be marked a used + const isValidJump = jumpToLabel(n.label, n.kind === SyntaxKind.BreakStatement ? currentReachabilityState : Reachability.Unreachable); + if (isValidJump) { + currentReachabilityState = Reachability.Unreachable; } - else { - jumpToLabel(n.label, Reachability.Unreachable); // touch label so it will be marked a used - } - currentReachabilityState = Reachability.Unreachable; - return true; } @@ -1406,7 +1403,7 @@ namespace ts { initializeReachabilityStateIfNecessary(); if (innerMergedState === Reachability.Unintialized) { - if (label && options.noUnusedLabels) { + if (label && !options.allowUnusedLabels) { file.bindDiagnostics.push(createDiagnosticForNode(label, Diagnostics.Unused_label)); } currentReachabilityState = outerState; @@ -1416,17 +1413,18 @@ namespace ts { } } - function jumpToLabel(label: Identifier, outerState: Reachability): void { + function jumpToLabel(label: Identifier, outerState: Reachability): boolean { initializeReachabilityStateIfNecessary(); const index = label ? labelIndexMap[label.text] : lastOrUndefined(implicitLabels); if (index === undefined) { // reference to unknown label or // break/continue used outside of loops - return; + return false; } const stateAtLabel = labelStack[index]; labelStack[index] = stateAtLabel === Reachability.Unintialized ? outerState : or(stateAtLabel, outerState); + return true; } function checkUnreachable(node: Node): boolean { @@ -1455,7 +1453,7 @@ namespace ts { // Rationale: we don't want to report errors on non-initialized var's since they are hoisted // On the other side we do want to report errors on non-initialized 'lets' because of TDZ const reportUnreachableCode = - options.noUnreachableCode && + !options.allowUnreachableCode && !isInAmbientContext(node) && ( node.kind !== SyntaxKind.VariableStatement || @@ -1464,7 +1462,7 @@ namespace ts { ); if (reportUnreachableCode) { - file.bindDiagnostics.push(createDiagnosticForNode(node, Diagnostics.Unreachable_code_detected)); + errorOnFirstToken(node, Diagnostics.Unreachable_code_detected); } } case Reachability.ReportedUnreachable: diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index a159604c099c7..e9919d310086f 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -248,9 +248,9 @@ namespace ts { error: Diagnostics.Argument_for_moduleResolution_option_must_be_node_or_classic, }, { - name: "noUnusedLabels", + name: "allowUnusedLabels", type: "boolean", - description: Diagnostics.Report_error_on_unused_labels + description: Diagnostics.Do_not_report_errors_on_unused_labels }, { name: "noImplicitReturns", @@ -263,9 +263,9 @@ namespace ts { description: Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, { - name: "noUnreachableCode", + name: "allowUnreachableCode", type: "boolean", - description: Diagnostics.Report_errors_on_unreachable_code + description: Diagnostics.Do_not_report_errors_on_unreachable_code } ]; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 2917d3331383f..3552fec122607 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2302,7 +2302,7 @@ "category": "Message", "code": 6072 }, - "Report error on unused labels.": { + "Do not report errors on unused labels.": { "category": "Message", "code": 6073 }, @@ -2314,7 +2314,7 @@ "category": "Message", "code": 6075 }, - "Report errors on unreachable code.": { + "Do not report errors on unreachable code.": { "category": "Message", "code": 6076 }, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index a93a4587c1b45..efc510d2f1483 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2075,10 +2075,10 @@ namespace ts { experimentalAsyncFunctions?: boolean; emitDecoratorMetadata?: boolean; moduleResolution?: ModuleResolutionKind; - noUnusedLabels?: boolean; + allowUnusedLabels?: boolean; + allowUnreachableCode?: boolean; noImplicitReturns?: boolean; noFallthroughCasesInSwitch?: boolean; - noUnreachableCode?: boolean; /* @internal */ stripInternal?: boolean; // Skip checking lib.d.ts to help speed up tests. diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 452f59f0f03ac..06f7117744787 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1203,7 +1203,7 @@ namespace ts { case SyntaxKind.LabeledStatement: case SyntaxKind.ReturnStatement: case SyntaxKind.SwitchStatement: - case SyntaxKind.ThrowKeyword: + case SyntaxKind.ThrowStatement: case SyntaxKind.TryStatement: case SyntaxKind.VariableStatement: case SyntaxKind.WhileStatement: diff --git a/tests/baselines/reference/assignmentLHSIsValue.errors.txt b/tests/baselines/reference/assignmentLHSIsValue.errors.txt index cf747b44b3e94..bf253df5e70d0 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/assignmentLHSIsValue.errors.txt @@ -13,6 +13,7 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(2 tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(30,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(31,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(32,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(35,3): error TS7028: Unused label. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(35,9): error TS1128: Declaration or statement expected. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(38,2): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(38,6): error TS2364: Invalid left-hand side of assignment expression. @@ -38,7 +39,7 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(6 tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(70,1): error TS2364: Invalid left-hand side of assignment expression. -==== tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts (38 errors) ==== +==== tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts (39 errors) ==== // expected error for all the LHS of assignments var value; @@ -104,6 +105,8 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(7 // object literals { a: 0} = value; + ~ +!!! error TS7028: Unused label. ~ !!! error TS1128: Declaration or statement expected. diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt b/tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt new file mode 100644 index 0000000000000..af83d53a72273 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/bestCommonTypeReturnStatement.ts(7,5): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/bestCommonTypeReturnStatement.ts (1 errors) ==== + interface IPromise { + then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; + } + + function f() { + if (true) return b(); + return d(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } + + + function b(): IPromise { return null; } + function d(): IPromise { return null; } \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.symbols b/tests/baselines/reference/bestCommonTypeReturnStatement.symbols deleted file mode 100644 index 43e04ef037d60..0000000000000 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.symbols +++ /dev/null @@ -1,34 +0,0 @@ -=== tests/cases/compiler/bestCommonTypeReturnStatement.ts === -interface IPromise { ->IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) ->T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 0, 19)) - - then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; ->then : Symbol(then, Decl(bestCommonTypeReturnStatement.ts, 0, 23)) ->successCallback : Symbol(successCallback, Decl(bestCommonTypeReturnStatement.ts, 1, 9)) ->promiseValue : Symbol(promiseValue, Decl(bestCommonTypeReturnStatement.ts, 1, 27)) ->T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 0, 19)) ->errorCallback : Symbol(errorCallback, Decl(bestCommonTypeReturnStatement.ts, 1, 51)) ->reason : Symbol(reason, Decl(bestCommonTypeReturnStatement.ts, 1, 69)) ->IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) -} - -function f() { ->f : Symbol(f, Decl(bestCommonTypeReturnStatement.ts, 2, 1)) - - if (true) return b(); ->b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 7, 1)) - - return d(); ->d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 10, 45)) -} - - -function b(): IPromise { return null; } ->b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 7, 1)) ->IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) - -function d(): IPromise { return null; } ->d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 10, 45)) ->IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) - diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.types b/tests/baselines/reference/bestCommonTypeReturnStatement.types deleted file mode 100644 index 28974f064a541..0000000000000 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.types +++ /dev/null @@ -1,39 +0,0 @@ -=== tests/cases/compiler/bestCommonTypeReturnStatement.ts === -interface IPromise { ->IPromise : IPromise ->T : T - - then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; ->then : (successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any) => IPromise ->successCallback : (promiseValue: T) => any ->promiseValue : T ->T : T ->errorCallback : (reason: any) => any ->reason : any ->IPromise : IPromise -} - -function f() { ->f : () => IPromise - - if (true) return b(); ->true : boolean ->b() : IPromise ->b : () => IPromise - - return d(); ->d() : IPromise ->d : () => IPromise -} - - -function b(): IPromise { return null; } ->b : () => IPromise ->IPromise : IPromise ->null : null - -function d(): IPromise { return null; } ->d : () => IPromise ->IPromise : IPromise ->null : null - diff --git a/tests/baselines/reference/breakTarget3.errors.txt b/tests/baselines/reference/breakTarget3.errors.txt new file mode 100644 index 0000000000000..aff8887c15e73 --- /dev/null +++ b/tests/baselines/reference/breakTarget3.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/breakTarget3.ts(2,1): error TS7028: Unused label. + + +==== tests/cases/compiler/breakTarget3.ts (1 errors) ==== + target1: + target2: + ~~~~~~~ +!!! error TS7028: Unused label. + while (true) { + break target1; + } \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget3.symbols b/tests/baselines/reference/breakTarget3.symbols deleted file mode 100644 index 580706bbd4a46..0000000000000 --- a/tests/baselines/reference/breakTarget3.symbols +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/compiler/breakTarget3.ts === -target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. break target1; -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget3.types b/tests/baselines/reference/breakTarget3.types deleted file mode 100644 index 785bf00ef6e98..0000000000000 --- a/tests/baselines/reference/breakTarget3.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/breakTarget3.ts === -target1: ->target1 : any - -target2: ->target2 : any - -while (true) { ->true : boolean - - break target1; ->target1 : any -} diff --git a/tests/baselines/reference/breakTarget4.errors.txt b/tests/baselines/reference/breakTarget4.errors.txt new file mode 100644 index 0000000000000..d1283de2fa069 --- /dev/null +++ b/tests/baselines/reference/breakTarget4.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/breakTarget4.ts(1,1): error TS7028: Unused label. + + +==== tests/cases/compiler/breakTarget4.ts (1 errors) ==== + target1: + ~~~~~~~ +!!! error TS7028: Unused label. + target2: + while (true) { + break target2; + } \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget4.symbols b/tests/baselines/reference/breakTarget4.symbols deleted file mode 100644 index aba35ddcfdf3d..0000000000000 --- a/tests/baselines/reference/breakTarget4.symbols +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/compiler/breakTarget4.ts === -target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. break target2; -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget4.types b/tests/baselines/reference/breakTarget4.types deleted file mode 100644 index eb4c14f638656..0000000000000 --- a/tests/baselines/reference/breakTarget4.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/breakTarget4.ts === -target1: ->target1 : any - -target2: ->target2 : any - -while (true) { ->true : boolean - - break target2; ->target2 : any -} diff --git a/tests/baselines/reference/breakTarget5.errors.txt b/tests/baselines/reference/breakTarget5.errors.txt index a54a415b9907b..55a454ee68b7a 100644 --- a/tests/baselines/reference/breakTarget5.errors.txt +++ b/tests/baselines/reference/breakTarget5.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/breakTarget5.ts(1,1): error TS7028: Unused label. tests/cases/compiler/breakTarget5.ts(5,7): error TS1107: Jump target cannot cross function boundary. -==== tests/cases/compiler/breakTarget5.ts (1 errors) ==== +==== tests/cases/compiler/breakTarget5.ts (2 errors) ==== target: + ~~~~~~ +!!! error TS7028: Unused label. while (true) { function f() { while (true) { diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt new file mode 100644 index 0000000000000..06eca28b5121b --- /dev/null +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt @@ -0,0 +1,126 @@ +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts(28,9): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts (1 errors) ==== + // Call signatures without a return type should infer one from the function body (if present) + + // Simple types + function foo(x) { + return 1; + } + var r = foo(1); + + function foo2(x) { + return foo(x); + } + var r2 = foo2(1); + + function foo3() { + return foo3(); + } + var r3 = foo3(); + + function foo4(x: T) { + return x; + } + var r4 = foo4(1); + + function foo5(x) { + if (true) { + return 1; + } else { + return 2; + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } + } + var r5 = foo5(1); + + function foo6(x) { + try { + } + catch (e) { + return []; + } + finally { + return []; + } + } + var r6 = foo6(1); + + function foo7(x) { + return typeof x; + } + var r7 = foo7(1); + + // object types + function foo8(x: number) { + return { x: x }; + } + var r8 = foo8(1); + + interface I { + foo: string; + } + function foo9(x: number) { + var i: I; + return i; + } + var r9 = foo9(1); + + class C { + foo: string; + } + function foo10(x: number) { + var c: C; + return c; + } + var r10 = foo10(1); + + module M { + export var x = 1; + export class C { foo: string } + } + function foo11() { + return M; + } + var r11 = foo11(); + + // merged declarations + interface I2 { + x: number; + } + interface I2 { + y: number; + } + function foo12() { + var i2: I2; + return i2; + } + var r12 = foo12(); + + function m1() { return 1; } + module m1 { export var y = 2; } + function foo13() { + return m1; + } + var r13 = foo13(); + + class c1 { + foo: string; + constructor(x) { } + } + module c1 { + export var x = 1; + } + function foo14() { + return c1; + } + var r14 = foo14(); + + enum e1 { A } + module e1 { export var y = 1; } + function foo15() { + return e1; + } + var r15 = foo15(); \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols deleted file mode 100644 index 1c5a6786ab707..0000000000000 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols +++ /dev/null @@ -1,255 +0,0 @@ -=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts === -// Call signatures without a return type should infer one from the function body (if present) - -// Simple types -function foo(x) { ->foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 3, 13)) - - return 1; -} -var r = foo(1); ->r : Symbol(r, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 3)) ->foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) - -function foo2(x) { ->foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 15)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 8, 14)) - - return foo(x); ->foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 8, 14)) -} -var r2 = foo2(1); ->r2 : Symbol(r2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 3)) ->foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 15)) - -function foo3() { ->foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17)) - - return foo3(); ->foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17)) -} -var r3 = foo3(); ->r3 : Symbol(r3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 3)) ->foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17)) - -function foo4(x: T) { ->foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 16)) ->T : Symbol(T, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 14)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 17)) ->T : Symbol(T, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 14)) - - return x; ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 17)) -} -var r4 = foo4(1); ->r4 : Symbol(r4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 3)) ->foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 16)) - -function foo5(x) { ->foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 17)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 23, 14)) - - if (true) { - return 1; - } else { - return 2; - } -} -var r5 = foo5(1); ->r5 : Symbol(r5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 3)) ->foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 17)) - -function foo6(x) { ->foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 17)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 32, 14)) - - try { - } - catch (e) { ->e : Symbol(e, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 35, 11)) - - return []; - } - finally { - return []; - } -} -var r6 = foo6(1); ->r6 : Symbol(r6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 3)) ->foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 17)) - -function foo7(x) { ->foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 17)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 44, 14)) - - return typeof x; ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 44, 14)) -} -var r7 = foo7(1); ->r7 : Symbol(r7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 3)) ->foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 17)) - -// object types -function foo8(x: number) { ->foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 17)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 50, 14)) - - return { x: x }; ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 51, 12)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 50, 14)) -} -var r8 = foo8(1); ->r8 : Symbol(r8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 3)) ->foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 17)) - -interface I { ->I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 17)) - - foo: string; ->foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 55, 13)) -} -function foo9(x: number) { ->foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 57, 1)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 58, 14)) - - var i: I; ->i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 59, 7)) ->I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 17)) - - return i; ->i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 59, 7)) -} -var r9 = foo9(1); ->r9 : Symbol(r9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 3)) ->foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 57, 1)) - -class C { ->C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 17)) - - foo: string; ->foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 64, 9)) -} -function foo10(x: number) { ->foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 66, 1)) ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 67, 15)) - - var c: C; ->c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 68, 7)) ->C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 17)) - - return c; ->c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 68, 7)) -} -var r10 = foo10(1); ->r10 : Symbol(r10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 3)) ->foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 66, 1)) - -module M { ->M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 19)) - - export var x = 1; ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 74, 14)) - - export class C { foo: string } ->C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 74, 21)) ->foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 75, 20)) -} -function foo11() { ->foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 1)) - - return M; ->M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 19)) -} -var r11 = foo11(); ->r11 : Symbol(r11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 3)) ->foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 1)) - -// merged declarations -interface I2 { ->I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1)) - - x: number; ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 83, 14)) -} -interface I2 { ->I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1)) - - y: number; ->y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 14)) -} -function foo12() { ->foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 88, 1)) - - var i2: I2; ->i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 90, 7)) ->I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1)) - - return i2; ->i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 90, 7)) -} -var r12 = foo12(); ->r12 : Symbol(r12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 3)) ->foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 88, 1)) - -function m1() { return 1; } ->m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27)) - -module m1 { export var y = 2; } ->m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27)) ->y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 22)) - -function foo13() { ->foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 31)) - - return m1; ->m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27)) -} -var r13 = foo13(); ->r13 : Symbol(r13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 3)) ->foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 31)) - -class c1 { ->c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1)) - - foo: string; ->foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 102, 10)) - - constructor(x) { } ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 104, 16)) -} -module c1 { ->c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1)) - - export var x = 1; ->x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 107, 14)) -} -function foo14() { ->foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 1)) - - return c1; ->c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1)) -} -var r14 = foo14(); ->r14 : Symbol(r14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 3)) ->foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 1)) - -enum e1 { A } ->e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13)) ->A : Symbol(e1.A, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 9)) - -module e1 { export var y = 1; } ->e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13)) ->y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 22)) - -function foo15() { ->foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 31)) - - return e1; ->e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13)) -} -var r15 = foo15(); ->r15 : Symbol(r15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 119, 3)) ->foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 31)) - diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types deleted file mode 100644 index 760451eb9c155..0000000000000 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types +++ /dev/null @@ -1,296 +0,0 @@ -=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts === -// Call signatures without a return type should infer one from the function body (if present) - -// Simple types -function foo(x) { ->foo : (x: any) => number ->x : any - - return 1; ->1 : number -} -var r = foo(1); ->r : number ->foo(1) : number ->foo : (x: any) => number ->1 : number - -function foo2(x) { ->foo2 : (x: any) => number ->x : any - - return foo(x); ->foo(x) : number ->foo : (x: any) => number ->x : any -} -var r2 = foo2(1); ->r2 : number ->foo2(1) : number ->foo2 : (x: any) => number ->1 : number - -function foo3() { ->foo3 : () => any - - return foo3(); ->foo3() : any ->foo3 : () => any -} -var r3 = foo3(); ->r3 : any ->foo3() : any ->foo3 : () => any - -function foo4(x: T) { ->foo4 : (x: T) => T ->T : T ->x : T ->T : T - - return x; ->x : T -} -var r4 = foo4(1); ->r4 : number ->foo4(1) : number ->foo4 : (x: T) => T ->1 : number - -function foo5(x) { ->foo5 : (x: any) => number ->x : any - - if (true) { ->true : boolean - - return 1; ->1 : number - - } else { - return 2; ->2 : number - } -} -var r5 = foo5(1); ->r5 : number ->foo5(1) : number ->foo5 : (x: any) => number ->1 : number - -function foo6(x) { ->foo6 : (x: any) => any[] ->x : any - - try { - } - catch (e) { ->e : any - - return []; ->[] : undefined[] - } - finally { - return []; ->[] : undefined[] - } -} -var r6 = foo6(1); ->r6 : any[] ->foo6(1) : any[] ->foo6 : (x: any) => any[] ->1 : number - -function foo7(x) { ->foo7 : (x: any) => string ->x : any - - return typeof x; ->typeof x : string ->x : any -} -var r7 = foo7(1); ->r7 : string ->foo7(1) : string ->foo7 : (x: any) => string ->1 : number - -// object types -function foo8(x: number) { ->foo8 : (x: number) => { x: number; } ->x : number - - return { x: x }; ->{ x: x } : { x: number; } ->x : number ->x : number -} -var r8 = foo8(1); ->r8 : { x: number; } ->foo8(1) : { x: number; } ->foo8 : (x: number) => { x: number; } ->1 : number - -interface I { ->I : I - - foo: string; ->foo : string -} -function foo9(x: number) { ->foo9 : (x: number) => I ->x : number - - var i: I; ->i : I ->I : I - - return i; ->i : I -} -var r9 = foo9(1); ->r9 : I ->foo9(1) : I ->foo9 : (x: number) => I ->1 : number - -class C { ->C : C - - foo: string; ->foo : string -} -function foo10(x: number) { ->foo10 : (x: number) => C ->x : number - - var c: C; ->c : C ->C : C - - return c; ->c : C -} -var r10 = foo10(1); ->r10 : C ->foo10(1) : C ->foo10 : (x: number) => C ->1 : number - -module M { ->M : typeof M - - export var x = 1; ->x : number ->1 : number - - export class C { foo: string } ->C : C ->foo : string -} -function foo11() { ->foo11 : () => typeof M - - return M; ->M : typeof M -} -var r11 = foo11(); ->r11 : typeof M ->foo11() : typeof M ->foo11 : () => typeof M - -// merged declarations -interface I2 { ->I2 : I2 - - x: number; ->x : number -} -interface I2 { ->I2 : I2 - - y: number; ->y : number -} -function foo12() { ->foo12 : () => I2 - - var i2: I2; ->i2 : I2 ->I2 : I2 - - return i2; ->i2 : I2 -} -var r12 = foo12(); ->r12 : I2 ->foo12() : I2 ->foo12 : () => I2 - -function m1() { return 1; } ->m1 : typeof m1 ->1 : number - -module m1 { export var y = 2; } ->m1 : typeof m1 ->y : number ->2 : number - -function foo13() { ->foo13 : () => typeof m1 - - return m1; ->m1 : typeof m1 -} -var r13 = foo13(); ->r13 : typeof m1 ->foo13() : typeof m1 ->foo13 : () => typeof m1 - -class c1 { ->c1 : c1 - - foo: string; ->foo : string - - constructor(x) { } ->x : any -} -module c1 { ->c1 : typeof c1 - - export var x = 1; ->x : number ->1 : number -} -function foo14() { ->foo14 : () => typeof c1 - - return c1; ->c1 : typeof c1 -} -var r14 = foo14(); ->r14 : typeof c1 ->foo14() : typeof c1 ->foo14 : () => typeof c1 - -enum e1 { A } ->e1 : e1 ->A : e1 - -module e1 { export var y = 1; } ->e1 : typeof e1 ->y : number ->1 : number - -function foo15() { ->foo15 : () => typeof e1 - - return e1; ->e1 : typeof e1 -} -var r15 = foo15(); ->r15 : typeof e1 ->foo15() : typeof e1 ->foo15 : () => typeof e1 - diff --git a/tests/baselines/reference/cf.errors.txt b/tests/baselines/reference/cf.errors.txt new file mode 100644 index 0000000000000..75b285c37c647 --- /dev/null +++ b/tests/baselines/reference/cf.errors.txt @@ -0,0 +1,72 @@ +tests/cases/compiler/cf.ts(9,13): error TS7027: Unreachable code detected. +tests/cases/compiler/cf.ts(21,17): error TS7027: Unreachable code detected. +tests/cases/compiler/cf.ts(32,13): error TS7027: Unreachable code detected. +tests/cases/compiler/cf.ts(36,13): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/cf.ts (4 errors) ==== + function f() { + var z; + var x=10; + var y=3; + + L1: for (var i=0;i<19;i++) { + if (y==7) { + continue L1; + x=11; + ~ +!!! error TS7027: Unreachable code detected. + } + if (y==3) { + y++; + } + else { + y--; + } + do { + y+=2; + if (y==20) { + break; + x=12; + ~ +!!! error TS7027: Unreachable code detected. + } + } while (y<41); + y++; + } + while (y>2) { + y=y>>1; + } + L2: try { + L3: if (xf : Symbol(f, Decl(cf.ts, 0, 0)) - - var z; ->z : Symbol(z, Decl(cf.ts, 1, 7)) - - var x=10; ->x : Symbol(x, Decl(cf.ts, 2, 7)) - - var y=3; ->y : Symbol(y, Decl(cf.ts, 3, 7)) - - L1: for (var i=0;i<19;i++) { ->i : Symbol(i, Decl(cf.ts, 5, 16)) ->i : Symbol(i, Decl(cf.ts, 5, 16)) ->i : Symbol(i, Decl(cf.ts, 5, 16)) - - if (y==7) { ->y : Symbol(y, Decl(cf.ts, 3, 7)) - - continue L1; - x=11; ->x : Symbol(x, Decl(cf.ts, 2, 7)) - } - if (y==3) { ->y : Symbol(y, Decl(cf.ts, 3, 7)) - - y++; ->y : Symbol(y, Decl(cf.ts, 3, 7)) - } - else { - y--; ->y : Symbol(y, Decl(cf.ts, 3, 7)) - } - do { - y+=2; ->y : Symbol(y, Decl(cf.ts, 3, 7)) - - if (y==20) { ->y : Symbol(y, Decl(cf.ts, 3, 7)) - - break; - x=12; ->x : Symbol(x, Decl(cf.ts, 2, 7)) - } - } while (y<41); ->y : Symbol(y, Decl(cf.ts, 3, 7)) - - y++; ->y : Symbol(y, Decl(cf.ts, 3, 7)) - } - while (y>2) { ->y : Symbol(y, Decl(cf.ts, 3, 7)) - - y=y>>1; ->y : Symbol(y, Decl(cf.ts, 3, 7)) ->y : Symbol(y, Decl(cf.ts, 3, 7)) - } - L2: try { - L3: if (xx : Symbol(x, Decl(cf.ts, 2, 7)) ->y : Symbol(y, Decl(cf.ts, 3, 7)) - - break L2; - x=13; ->x : Symbol(x, Decl(cf.ts, 2, 7)) - } - else { - break L3; - x=14; ->x : Symbol(x, Decl(cf.ts, 2, 7)) - } - } - catch (e) { ->e : Symbol(e, Decl(cf.ts, 38, 11)) - - x++; ->x : Symbol(x, Decl(cf.ts, 2, 7)) - } - finally { - x+=3; ->x : Symbol(x, Decl(cf.ts, 2, 7)) - } - y++; ->y : Symbol(y, Decl(cf.ts, 3, 7)) - - for (var k=0;k<10;k++) { ->k : Symbol(k, Decl(cf.ts, 45, 12)) ->k : Symbol(k, Decl(cf.ts, 45, 12)) ->k : Symbol(k, Decl(cf.ts, 45, 12)) - - z; ->z : Symbol(z, Decl(cf.ts, 1, 7)) - - break; - } - for (k=0;k<10;k++) { ->k : Symbol(k, Decl(cf.ts, 45, 12)) ->k : Symbol(k, Decl(cf.ts, 45, 12)) ->k : Symbol(k, Decl(cf.ts, 45, 12)) - - if (k==6) { ->k : Symbol(k, Decl(cf.ts, 45, 12)) - - continue; - } - break; - } -} - diff --git a/tests/baselines/reference/cf.types b/tests/baselines/reference/cf.types deleted file mode 100644 index 397e3469ece2e..0000000000000 --- a/tests/baselines/reference/cf.types +++ /dev/null @@ -1,169 +0,0 @@ -=== tests/cases/compiler/cf.ts === -function f() { ->f : () => void - - var z; ->z : any - - var x=10; ->x : number ->10 : number - - var y=3; ->y : number ->3 : number - - L1: for (var i=0;i<19;i++) { ->L1 : any ->i : number ->0 : number ->i<19 : boolean ->i : number ->19 : number ->i++ : number ->i : number - - if (y==7) { ->y==7 : boolean ->y : number ->7 : number - - continue L1; ->L1 : any - - x=11; ->x=11 : number ->x : number ->11 : number - } - if (y==3) { ->y==3 : boolean ->y : number ->3 : number - - y++; ->y++ : number ->y : number - } - else { - y--; ->y-- : number ->y : number - } - do { - y+=2; ->y+=2 : number ->y : number ->2 : number - - if (y==20) { ->y==20 : boolean ->y : number ->20 : number - - break; - x=12; ->x=12 : number ->x : number ->12 : number - } - } while (y<41); ->y<41 : boolean ->y : number ->41 : number - - y++; ->y++ : number ->y : number - } - while (y>2) { ->y>2 : boolean ->y : number ->2 : number - - y=y>>1; ->y=y>>1 : number ->y : number ->y>>1 : number ->y : number ->1 : number - } - L2: try { ->L2 : any - - L3: if (xL3 : any ->xx : number ->y : number - - break L2; ->L2 : any - - x=13; ->x=13 : number ->x : number ->13 : number - } - else { - break L3; ->L3 : any - - x=14; ->x=14 : number ->x : number ->14 : number - } - } - catch (e) { ->e : any - - x++; ->x++ : number ->x : number - } - finally { - x+=3; ->x+=3 : number ->x : number ->3 : number - } - y++; ->y++ : number ->y : number - - for (var k=0;k<10;k++) { ->k : number ->0 : number ->k<10 : boolean ->k : number ->10 : number ->k++ : number ->k : number - - z; ->z : any - - break; - } - for (k=0;k<10;k++) { ->k=0 : number ->k : number ->0 : number ->k<10 : boolean ->k : number ->10 : number ->k++ : number ->k : number - - if (k==6) { ->k==6 : boolean ->k : number ->6 : number - - continue; - } - break; - } -} - diff --git a/tests/baselines/reference/commentsAtEndOfFile1.errors.txt b/tests/baselines/reference/commentsAtEndOfFile1.errors.txt new file mode 100644 index 0000000000000..dd689841659f4 --- /dev/null +++ b/tests/baselines/reference/commentsAtEndOfFile1.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/commentsAtEndOfFile1.ts(1,1): error TS7028: Unused label. + + +==== tests/cases/compiler/commentsAtEndOfFile1.ts (1 errors) ==== + Input: + ~~~~~ +!!! error TS7028: Unused label. + ; + //Testing two + \ No newline at end of file diff --git a/tests/baselines/reference/commentsAtEndOfFile1.symbols b/tests/baselines/reference/commentsAtEndOfFile1.symbols deleted file mode 100644 index c09a435f1a7fe..0000000000000 --- a/tests/baselines/reference/commentsAtEndOfFile1.symbols +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/compiler/commentsAtEndOfFile1.ts === -Input: -No type information for this code.; -No type information for this code.//Testing two -No type information for this code. -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/commentsAtEndOfFile1.types b/tests/baselines/reference/commentsAtEndOfFile1.types deleted file mode 100644 index 6bac675706143..0000000000000 --- a/tests/baselines/reference/commentsAtEndOfFile1.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/compiler/commentsAtEndOfFile1.ts === -Input: ->Input : any - -; -//Testing two - diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt index 7b26fc4bf9e04..645e34bcfa7cb 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt @@ -28,6 +28,7 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(53,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(54,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(55,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(58,3): error TS7028: Unused label. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(58,9): error TS1128: Declaration or statement expected. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(59,9): error TS1128: Declaration or statement expected. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(62,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -74,7 +75,7 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(122,1): error TS2364: Invalid left-hand side of assignment expression. -==== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts (74 errors) ==== +==== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts (75 errors) ==== // expected error for all the LHS of compound assignments (arithmetic and addition) var value; @@ -193,6 +194,8 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa // object literals { a: 0} *= value; + ~ +!!! error TS7028: Unused label. ~~ !!! error TS1128: Declaration or statement expected. { a: 0} += value; diff --git a/tests/baselines/reference/conditionalExpressions2.errors.txt b/tests/baselines/reference/conditionalExpressions2.errors.txt new file mode 100644 index 0000000000000..3fb44a840b32b --- /dev/null +++ b/tests/baselines/reference/conditionalExpressions2.errors.txt @@ -0,0 +1,15 @@ +tests/cases/compiler/conditionalExpressions2.ts(9,54): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/conditionalExpressions2.ts (1 errors) ==== + var a = false ? 1 : null; + var b = false ? undefined : 0; + var c = false ? 1 : 0; + var d = false ? false : true; + var e = false ? "foo" : "bar"; + var f = false ? null : undefined; + var g = true ? {g:5} : null; + var h = [{h:5}, null]; + function i() { if (true) { return { x: 5 }; } else { return null; } } + ~~~~~~ +!!! error TS7027: Unreachable code detected. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalExpressions2.symbols b/tests/baselines/reference/conditionalExpressions2.symbols deleted file mode 100644 index 63c8b41747756..0000000000000 --- a/tests/baselines/reference/conditionalExpressions2.symbols +++ /dev/null @@ -1,33 +0,0 @@ -=== tests/cases/compiler/conditionalExpressions2.ts === -var a = false ? 1 : null; ->a : Symbol(a, Decl(conditionalExpressions2.ts, 0, 3)) - -var b = false ? undefined : 0; ->b : Symbol(b, Decl(conditionalExpressions2.ts, 1, 3)) ->undefined : Symbol(undefined) - -var c = false ? 1 : 0; ->c : Symbol(c, Decl(conditionalExpressions2.ts, 2, 3)) - -var d = false ? false : true; ->d : Symbol(d, Decl(conditionalExpressions2.ts, 3, 3)) - -var e = false ? "foo" : "bar"; ->e : Symbol(e, Decl(conditionalExpressions2.ts, 4, 3)) - -var f = false ? null : undefined; ->f : Symbol(f, Decl(conditionalExpressions2.ts, 5, 3)) ->undefined : Symbol(undefined) - -var g = true ? {g:5} : null; ->g : Symbol(g, Decl(conditionalExpressions2.ts, 6, 3)) ->g : Symbol(g, Decl(conditionalExpressions2.ts, 6, 16)) - -var h = [{h:5}, null]; ->h : Symbol(h, Decl(conditionalExpressions2.ts, 7, 3)) ->h : Symbol(h, Decl(conditionalExpressions2.ts, 7, 10)) - -function i() { if (true) { return { x: 5 }; } else { return null; } } ->i : Symbol(i, Decl(conditionalExpressions2.ts, 7, 22)) ->x : Symbol(x, Decl(conditionalExpressions2.ts, 8, 35)) - diff --git a/tests/baselines/reference/conditionalExpressions2.types b/tests/baselines/reference/conditionalExpressions2.types deleted file mode 100644 index 5f49410b1e4ac..0000000000000 --- a/tests/baselines/reference/conditionalExpressions2.types +++ /dev/null @@ -1,68 +0,0 @@ -=== tests/cases/compiler/conditionalExpressions2.ts === -var a = false ? 1 : null; ->a : number ->false ? 1 : null : number ->false : boolean ->1 : number ->null : null - -var b = false ? undefined : 0; ->b : number ->false ? undefined : 0 : number ->false : boolean ->undefined : undefined ->0 : number - -var c = false ? 1 : 0; ->c : number ->false ? 1 : 0 : number ->false : boolean ->1 : number ->0 : number - -var d = false ? false : true; ->d : boolean ->false ? false : true : boolean ->false : boolean ->false : boolean ->true : boolean - -var e = false ? "foo" : "bar"; ->e : string ->false ? "foo" : "bar" : string ->false : boolean ->"foo" : string ->"bar" : string - -var f = false ? null : undefined; ->f : any ->false ? null : undefined : null ->false : boolean ->null : null ->undefined : undefined - -var g = true ? {g:5} : null; ->g : { g: number; } ->true ? {g:5} : null : { g: number; } ->true : boolean ->{g:5} : { g: number; } ->g : number ->5 : number ->null : null - -var h = [{h:5}, null]; ->h : { h: number; }[] ->[{h:5}, null] : { h: number; }[] ->{h:5} : { h: number; } ->h : number ->5 : number ->null : null - -function i() { if (true) { return { x: 5 }; } else { return null; } } ->i : () => { x: number; } ->true : boolean ->{ x: 5 } : { x: number; } ->x : number ->5 : number ->null : null - diff --git a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt index 20ec5b0c25bdd..56273924ac189 100644 --- a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt @@ -1,6 +1,8 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(4,5): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(6,5): error TS7027: Unreachable code detected. tests/cases/compiler/constDeclarations-invalidContexts.ts(6,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(9,5): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(11,1): error TS7027: Unreachable code detected. tests/cases/compiler/constDeclarations-invalidContexts.ts(12,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/compiler/constDeclarations-invalidContexts.ts(20,5): error TS1156: 'const' declarations can only be declared inside a block. @@ -9,7 +11,7 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(26,12): error TS1156: tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: 'const' declarations can only be declared inside a block. -==== tests/cases/compiler/constDeclarations-invalidContexts.ts (9 errors) ==== +==== tests/cases/compiler/constDeclarations-invalidContexts.ts (11 errors) ==== // Errors, const must be defined inside a block if (true) @@ -18,6 +20,8 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: !!! error TS1156: 'const' declarations can only be declared inside a block. else const c2 = 0; + ~~~~~ +!!! error TS7027: Unreachable code detected. ~~~~~~~~~~~~~ !!! error TS1156: 'const' declarations can only be declared inside a block. @@ -27,6 +31,8 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: !!! error TS1156: 'const' declarations can only be declared inside a block. do + ~~ +!!! error TS7027: Unreachable code detected. const c4 = 0; ~~~~~~~~~~~~~ !!! error TS1156: 'const' declarations can only be declared inside a block. diff --git a/tests/baselines/reference/constDeclarations-scopes.errors.txt b/tests/baselines/reference/constDeclarations-scopes.errors.txt index 138acd9b16d1c..4c9f7ce51633f 100644 --- a/tests/baselines/reference/constDeclarations-scopes.errors.txt +++ b/tests/baselines/reference/constDeclarations-scopes.errors.txt @@ -1,7 +1,9 @@ +tests/cases/compiler/constDeclarations-scopes.ts(13,5): error TS7027: Unreachable code detected. +tests/cases/compiler/constDeclarations-scopes.ts(22,1): error TS7027: Unreachable code detected. tests/cases/compiler/constDeclarations-scopes.ts(28,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -==== tests/cases/compiler/constDeclarations-scopes.ts (1 errors) ==== +==== tests/cases/compiler/constDeclarations-scopes.ts (3 errors) ==== // global const c = "string"; @@ -15,6 +17,8 @@ tests/cases/compiler/constDeclarations-scopes.ts(28,7): error TS2410: All symbol } else { const c = 0; + ~~~~~ +!!! error TS7027: Unreachable code detected. n = c; } @@ -24,6 +28,8 @@ tests/cases/compiler/constDeclarations-scopes.ts(28,7): error TS2410: All symbol } do { + ~~ +!!! error TS7027: Unreachable code detected. const c = 0; n = c; } while (true); diff --git a/tests/baselines/reference/constDeclarations-validContexts.errors.txt b/tests/baselines/reference/constDeclarations-validContexts.errors.txt index 7af16a53cbe7e..e55e5f578ba6b 100644 --- a/tests/baselines/reference/constDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-validContexts.errors.txt @@ -1,7 +1,9 @@ +tests/cases/compiler/constDeclarations-validContexts.ts(8,5): error TS7027: Unreachable code detected. +tests/cases/compiler/constDeclarations-validContexts.ts(15,1): error TS7027: Unreachable code detected. tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -==== tests/cases/compiler/constDeclarations-validContexts.ts (1 errors) ==== +==== tests/cases/compiler/constDeclarations-validContexts.ts (3 errors) ==== // Control flow statements with blocks @@ -10,6 +12,8 @@ tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All } else { const c2 = 0; + ~~~~~ +!!! error TS7027: Unreachable code detected. } while (true) { @@ -17,6 +21,8 @@ tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All } do { + ~~ +!!! error TS7027: Unreachable code detected. const c4 = 0; } while (true); diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 12f397ff06c59..56213610b83e4 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -9,6 +9,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,18): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,26): error TS2304: Cannot find name 'bfs'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: '=' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS7027: Unreachable code detected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,26): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,28): error TS2304: Cannot find name 'bfs'. @@ -52,6 +53,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,28): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS2304: Cannot find name 'method2'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS7027: Unreachable code detected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,26): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(241,5): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(246,25): error TS2339: Property 'method1' does not exist on type 'B'. @@ -83,7 +85,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (83 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (85 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -140,6 +142,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ^ ~ !!! error TS1109: Expression expected. + ~ +!!! error TS7027: Unreachable code detected. retValue = bfs.TYPES(); @@ -433,6 +437,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS1128: Declaration or statement expected. ~~~~~~~ !!! error TS2304: Cannot find name 'method2'. + ~~~~~~~ +!!! error TS7027: Unreachable code detected. ~ !!! error TS1005: ';' expected. return 2 * this.method1(2); diff --git a/tests/baselines/reference/continueNotInIterationStatement4.errors.txt b/tests/baselines/reference/continueNotInIterationStatement4.errors.txt index 1c80f7057b878..3f0d57ac45d0e 100644 --- a/tests/baselines/reference/continueNotInIterationStatement4.errors.txt +++ b/tests/baselines/reference/continueNotInIterationStatement4.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/continueNotInIterationStatement4.ts(1,1): error TS7028: Unused label. tests/cases/compiler/continueNotInIterationStatement4.ts(4,5): error TS1107: Jump target cannot cross function boundary. -==== tests/cases/compiler/continueNotInIterationStatement4.ts (1 errors) ==== +==== tests/cases/compiler/continueNotInIterationStatement4.ts (2 errors) ==== TWO: + ~~~ +!!! error TS7028: Unused label. while (true){ var x = () => { continue TWO; diff --git a/tests/baselines/reference/continueTarget3.errors.txt b/tests/baselines/reference/continueTarget3.errors.txt new file mode 100644 index 0000000000000..a3f6b64e7c68a --- /dev/null +++ b/tests/baselines/reference/continueTarget3.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/continueTarget3.ts(2,1): error TS7028: Unused label. + + +==== tests/cases/compiler/continueTarget3.ts (1 errors) ==== + target1: + target2: + ~~~~~~~ +!!! error TS7028: Unused label. + while (true) { + continue target1; + } \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget3.symbols b/tests/baselines/reference/continueTarget3.symbols deleted file mode 100644 index a1b930f2f5ac2..0000000000000 --- a/tests/baselines/reference/continueTarget3.symbols +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/compiler/continueTarget3.ts === -target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. continue target1; -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget3.types b/tests/baselines/reference/continueTarget3.types deleted file mode 100644 index 3336b47772c86..0000000000000 --- a/tests/baselines/reference/continueTarget3.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/continueTarget3.ts === -target1: ->target1 : any - -target2: ->target2 : any - -while (true) { ->true : boolean - - continue target1; ->target1 : any -} diff --git a/tests/baselines/reference/continueTarget4.errors.txt b/tests/baselines/reference/continueTarget4.errors.txt new file mode 100644 index 0000000000000..d8f3cc12892b4 --- /dev/null +++ b/tests/baselines/reference/continueTarget4.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/continueTarget4.ts(1,1): error TS7028: Unused label. + + +==== tests/cases/compiler/continueTarget4.ts (1 errors) ==== + target1: + ~~~~~~~ +!!! error TS7028: Unused label. + target2: + while (true) { + continue target2; + } \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget4.symbols b/tests/baselines/reference/continueTarget4.symbols deleted file mode 100644 index ea1989a3e4d22..0000000000000 --- a/tests/baselines/reference/continueTarget4.symbols +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/compiler/continueTarget4.ts === -target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. continue target2; -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget4.types b/tests/baselines/reference/continueTarget4.types deleted file mode 100644 index 5d2b7c29bbe33..0000000000000 --- a/tests/baselines/reference/continueTarget4.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/continueTarget4.ts === -target1: ->target1 : any - -target2: ->target2 : any - -while (true) { ->true : boolean - - continue target2; ->target2 : any -} diff --git a/tests/baselines/reference/continueTarget5.errors.txt b/tests/baselines/reference/continueTarget5.errors.txt index 401c5874ee043..6f0d3a2f6bffa 100644 --- a/tests/baselines/reference/continueTarget5.errors.txt +++ b/tests/baselines/reference/continueTarget5.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/continueTarget5.ts(1,1): error TS7028: Unused label. tests/cases/compiler/continueTarget5.ts(5,7): error TS1107: Jump target cannot cross function boundary. -==== tests/cases/compiler/continueTarget5.ts (1 errors) ==== +==== tests/cases/compiler/continueTarget5.ts (2 errors) ==== target: + ~~~~~~ +!!! error TS7028: Unused label. while (true) { function f() { while (true) { diff --git a/tests/baselines/reference/doWhileBreakStatements.errors.txt b/tests/baselines/reference/doWhileBreakStatements.errors.txt new file mode 100644 index 0000000000000..e31109858cff8 --- /dev/null +++ b/tests/baselines/reference/doWhileBreakStatements.errors.txt @@ -0,0 +1,50 @@ +tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts(11,1): error TS7028: Unused label. +tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts(19,5): error TS7028: Unused label. +tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts(30,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts (3 errors) ==== + do { + break; + } while(true) + + ONE: + do { + break ONE; + } + while (true) + + TWO: + ~~~ +!!! error TS7028: Unused label. + THREE: + do { + break THREE; + }while (true) + + FOUR: + do { + FIVE: + ~~~~ +!!! error TS7028: Unused label. + do { + break FOUR; + }while (true) + }while (true) + + do { + SIX: + do break SIX; while(true) + }while (true) + + SEVEN: + ~~~~~ +!!! error TS7027: Unreachable code detected. + do do do break SEVEN; while (true) while (true) while (true) + + EIGHT: + do{ + var fn = function () { } + break EIGHT; + }while(true) + \ No newline at end of file diff --git a/tests/baselines/reference/doWhileBreakStatements.symbols b/tests/baselines/reference/doWhileBreakStatements.symbols deleted file mode 100644 index 7d9db9a5ebb51..0000000000000 --- a/tests/baselines/reference/doWhileBreakStatements.symbols +++ /dev/null @@ -1,41 +0,0 @@ -=== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts === -do { - break; -} while(true) - -ONE: -do { - break ONE; -} -while (true) - -TWO: -THREE: -do { - break THREE; -}while (true) - -FOUR: -do { - FIVE: - do { - break FOUR; - }while (true) -}while (true) - -do { - SIX: - do break SIX; while(true) -}while (true) - -SEVEN: -do do do break SEVEN; while (true) while (true) while (true) - -EIGHT: -do{ - var fn = function () { } ->fn : Symbol(fn, Decl(doWhileBreakStatements.ts, 34, 7)) - - break EIGHT; -}while(true) - diff --git a/tests/baselines/reference/doWhileBreakStatements.types b/tests/baselines/reference/doWhileBreakStatements.types deleted file mode 100644 index c3ca932910a5e..0000000000000 --- a/tests/baselines/reference/doWhileBreakStatements.types +++ /dev/null @@ -1,80 +0,0 @@ -=== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts === -do { - break; -} while(true) ->true : boolean - -ONE: ->ONE : any - -do { - break ONE; ->ONE : any -} -while (true) ->true : boolean - -TWO: ->TWO : any - -THREE: ->THREE : any - -do { - break THREE; ->THREE : any - -}while (true) ->true : boolean - -FOUR: ->FOUR : any - -do { - FIVE: ->FIVE : any - - do { - break FOUR; ->FOUR : any - - }while (true) ->true : boolean - -}while (true) ->true : boolean - -do { - SIX: ->SIX : any - - do break SIX; while(true) ->SIX : any ->true : boolean - -}while (true) ->true : boolean - -SEVEN: ->SEVEN : any - -do do do break SEVEN; while (true) while (true) while (true) ->SEVEN : any ->true : boolean ->true : boolean ->true : boolean - -EIGHT: ->EIGHT : any - -do{ - var fn = function () { } ->fn : () => void ->function () { } : () => void - - break EIGHT; ->EIGHT : any - -}while(true) ->true : boolean - diff --git a/tests/baselines/reference/doWhileContinueStatements.errors.txt b/tests/baselines/reference/doWhileContinueStatements.errors.txt new file mode 100644 index 0000000000000..491e1242e2f71 --- /dev/null +++ b/tests/baselines/reference/doWhileContinueStatements.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts(5,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts (1 errors) ==== + do { + continue; + } while(true) + + ONE: + ~~~ +!!! error TS7027: Unreachable code detected. + do { + continue ONE; + } + while (true) + + TWO: + THREE: + do { + continue THREE; + }while (true) + + FOUR: + do { + FIVE: + do { + continue FOUR; + }while (true) + }while (true) + + do { + SIX: + do continue SIX; while(true) + }while (true) + + SEVEN: + do do do continue SEVEN; while (true) while (true) while (true) + + EIGHT: + do{ + var fn = function () { } + continue EIGHT; + }while(true) + \ No newline at end of file diff --git a/tests/baselines/reference/doWhileContinueStatements.symbols b/tests/baselines/reference/doWhileContinueStatements.symbols deleted file mode 100644 index e4c6d577d5aa4..0000000000000 --- a/tests/baselines/reference/doWhileContinueStatements.symbols +++ /dev/null @@ -1,41 +0,0 @@ -=== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts === -do { - continue; -} while(true) - -ONE: -do { - continue ONE; -} -while (true) - -TWO: -THREE: -do { - continue THREE; -}while (true) - -FOUR: -do { - FIVE: - do { - continue FOUR; - }while (true) -}while (true) - -do { - SIX: - do continue SIX; while(true) -}while (true) - -SEVEN: -do do do continue SEVEN; while (true) while (true) while (true) - -EIGHT: -do{ - var fn = function () { } ->fn : Symbol(fn, Decl(doWhileContinueStatements.ts, 34, 7)) - - continue EIGHT; -}while(true) - diff --git a/tests/baselines/reference/doWhileContinueStatements.types b/tests/baselines/reference/doWhileContinueStatements.types deleted file mode 100644 index 90c9f59842a8c..0000000000000 --- a/tests/baselines/reference/doWhileContinueStatements.types +++ /dev/null @@ -1,80 +0,0 @@ -=== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts === -do { - continue; -} while(true) ->true : boolean - -ONE: ->ONE : any - -do { - continue ONE; ->ONE : any -} -while (true) ->true : boolean - -TWO: ->TWO : any - -THREE: ->THREE : any - -do { - continue THREE; ->THREE : any - -}while (true) ->true : boolean - -FOUR: ->FOUR : any - -do { - FIVE: ->FIVE : any - - do { - continue FOUR; ->FOUR : any - - }while (true) ->true : boolean - -}while (true) ->true : boolean - -do { - SIX: ->SIX : any - - do continue SIX; while(true) ->SIX : any ->true : boolean - -}while (true) ->true : boolean - -SEVEN: ->SEVEN : any - -do do do continue SEVEN; while (true) while (true) while (true) ->SEVEN : any ->true : boolean ->true : boolean ->true : boolean - -EIGHT: ->EIGHT : any - -do{ - var fn = function () { } ->fn : () => void ->function () { } : () => void - - continue EIGHT; ->EIGHT : any - -}while(true) ->true : boolean - diff --git a/tests/baselines/reference/downlevelLetConst16.errors.txt b/tests/baselines/reference/downlevelLetConst16.errors.txt index 905d1a607e81d..a6651574b9e27 100644 --- a/tests/baselines/reference/downlevelLetConst16.errors.txt +++ b/tests/baselines/reference/downlevelLetConst16.errors.txt @@ -1,4 +1,6 @@ +tests/cases/compiler/downlevelLetConst16.ts(151,5): error TS7027: Unreachable code detected. tests/cases/compiler/downlevelLetConst16.ts(151,15): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/compiler/downlevelLetConst16.ts(164,5): error TS7027: Unreachable code detected. tests/cases/compiler/downlevelLetConst16.ts(164,17): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/compiler/downlevelLetConst16.ts(195,14): error TS2461: Type 'undefined' is not an array type. tests/cases/compiler/downlevelLetConst16.ts(202,15): error TS2459: Type 'undefined' has no property 'a' and no string index signature. @@ -6,7 +8,7 @@ tests/cases/compiler/downlevelLetConst16.ts(216,16): error TS2461: Type 'undefin tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2459: Type 'undefined' has no property 'a' and no string index signature. -==== tests/cases/compiler/downlevelLetConst16.ts (6 errors) ==== +==== tests/cases/compiler/downlevelLetConst16.ts (8 errors) ==== 'use strict' declare function use(a: any); @@ -158,6 +160,8 @@ tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2459: Type 'undefin use(x); } for (let [y] = []; ;) { + ~~~ +!!! error TS7027: Unreachable code detected. ~ !!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. use(y); @@ -173,6 +177,8 @@ tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2459: Type 'undefin use(x); } for (const [y] = []; ;) { + ~~~ +!!! error TS7027: Unreachable code detected. ~ !!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. use(y); diff --git a/tests/baselines/reference/downlevelLetConst17.errors.txt b/tests/baselines/reference/downlevelLetConst17.errors.txt new file mode 100644 index 0000000000000..0365b638449a7 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst17.errors.txt @@ -0,0 +1,73 @@ +tests/cases/compiler/downlevelLetConst17.ts(9,1): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/downlevelLetConst17.ts (1 errors) ==== + 'use strict' + + declare function use(a: any); + + var x; + for (let x = 10; ;) { + use(x); + } + use(x); + ~~~ +!!! error TS7027: Unreachable code detected. + + for (const x = 10; ;) { + use(x); + } + + for (; ;) { + let x = 10; + use(x); + x = 1; + } + + for (; ;) { + const x = 10; + use(x); + } + + for (let x; ;) { + use(x); + x = 1; + } + + for (; ;) { + let x; + use(x); + x = 1; + } + + while (true) { + let x; + use(x); + } + + while (true) { + const x = true; + use(x); + } + + do { + let x; + use(x); + } while (true); + + do { + let x; + use(x); + } while (true); + + for (let x in []) { + use(x); + } + + for (const x in []) { + use(x); + } + + for (const x of []) { + use(x); + } \ No newline at end of file diff --git a/tests/baselines/reference/downlevelLetConst17.symbols b/tests/baselines/reference/downlevelLetConst17.symbols deleted file mode 100644 index 809a835774c51..0000000000000 --- a/tests/baselines/reference/downlevelLetConst17.symbols +++ /dev/null @@ -1,134 +0,0 @@ -=== tests/cases/compiler/downlevelLetConst17.ts === -'use strict' - -declare function use(a: any); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->a : Symbol(a, Decl(downlevelLetConst17.ts, 2, 21)) - -var x; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 4, 3)) - -for (let x = 10; ;) { ->x : Symbol(x, Decl(downlevelLetConst17.ts, 5, 8)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 5, 8)) -} -use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 4, 3)) - -for (const x = 10; ;) { ->x : Symbol(x, Decl(downlevelLetConst17.ts, 10, 10)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 10, 10)) -} - -for (; ;) { - let x = 10; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) - - x = 1; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) -} - -for (; ;) { - const x = 10; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 21, 9)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 21, 9)) -} - -for (let x; ;) { ->x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) - - x = 1; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) -} - -for (; ;) { - let x; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) - - x = 1; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) -} - -while (true) { - let x; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 37, 7)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 37, 7)) -} - -while (true) { - const x = true; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 42, 9)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 42, 9)) -} - -do { - let x; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 47, 7)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 47, 7)) - -} while (true); - -do { - let x; ->x : Symbol(x, Decl(downlevelLetConst17.ts, 52, 7)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 52, 7)) - -} while (true); - -for (let x in []) { ->x : Symbol(x, Decl(downlevelLetConst17.ts, 56, 8)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 56, 8)) -} - -for (const x in []) { ->x : Symbol(x, Decl(downlevelLetConst17.ts, 60, 10)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 60, 10)) -} - -for (const x of []) { ->x : Symbol(x, Decl(downlevelLetConst17.ts, 64, 10)) - - use(x); ->use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) ->x : Symbol(x, Decl(downlevelLetConst17.ts, 64, 10)) -} diff --git a/tests/baselines/reference/downlevelLetConst17.types b/tests/baselines/reference/downlevelLetConst17.types deleted file mode 100644 index 824abcc76be52..0000000000000 --- a/tests/baselines/reference/downlevelLetConst17.types +++ /dev/null @@ -1,169 +0,0 @@ -=== tests/cases/compiler/downlevelLetConst17.ts === -'use strict' ->'use strict' : string - -declare function use(a: any); ->use : (a: any) => any ->a : any - -var x; ->x : any - -for (let x = 10; ;) { ->x : number ->10 : number - - use(x); ->use(x) : any ->use : (a: any) => any ->x : number -} -use(x); ->use(x) : any ->use : (a: any) => any ->x : any - -for (const x = 10; ;) { ->x : number ->10 : number - - use(x); ->use(x) : any ->use : (a: any) => any ->x : number -} - -for (; ;) { - let x = 10; ->x : number ->10 : number - - use(x); ->use(x) : any ->use : (a: any) => any ->x : number - - x = 1; ->x = 1 : number ->x : number ->1 : number -} - -for (; ;) { - const x = 10; ->x : number ->10 : number - - use(x); ->use(x) : any ->use : (a: any) => any ->x : number -} - -for (let x; ;) { ->x : any - - use(x); ->use(x) : any ->use : (a: any) => any ->x : any - - x = 1; ->x = 1 : number ->x : any ->1 : number -} - -for (; ;) { - let x; ->x : any - - use(x); ->use(x) : any ->use : (a: any) => any ->x : any - - x = 1; ->x = 1 : number ->x : any ->1 : number -} - -while (true) { ->true : boolean - - let x; ->x : any - - use(x); ->use(x) : any ->use : (a: any) => any ->x : any -} - -while (true) { ->true : boolean - - const x = true; ->x : boolean ->true : boolean - - use(x); ->use(x) : any ->use : (a: any) => any ->x : boolean -} - -do { - let x; ->x : any - - use(x); ->use(x) : any ->use : (a: any) => any ->x : any - -} while (true); ->true : boolean - -do { - let x; ->x : any - - use(x); ->use(x) : any ->use : (a: any) => any ->x : any - -} while (true); ->true : boolean - -for (let x in []) { ->x : any ->[] : undefined[] - - use(x); ->use(x) : any ->use : (a: any) => any ->x : any -} - -for (const x in []) { ->x : any ->[] : undefined[] - - use(x); ->use(x) : any ->use : (a: any) => any ->x : any -} - -for (const x of []) { ->x : any ->[] : undefined[] - - use(x); ->use(x) : any ->use : (a: any) => any ->x : any -} diff --git a/tests/baselines/reference/downlevelLetConst18.errors.txt b/tests/baselines/reference/downlevelLetConst18.errors.txt index 8f30b0f802a60..5d9d24a4d6d8b 100644 --- a/tests/baselines/reference/downlevelLetConst18.errors.txt +++ b/tests/baselines/reference/downlevelLetConst18.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/downlevelLetConst18.ts(3,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. tests/cases/compiler/downlevelLetConst18.ts(4,14): error TS2393: Duplicate function implementation. tests/cases/compiler/downlevelLetConst18.ts(7,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. +tests/cases/compiler/downlevelLetConst18.ts(7,1): error TS7027: Unreachable code detected. tests/cases/compiler/downlevelLetConst18.ts(8,14): error TS2393: Duplicate function implementation. tests/cases/compiler/downlevelLetConst18.ts(11,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. tests/cases/compiler/downlevelLetConst18.ts(15,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. @@ -9,7 +10,7 @@ tests/cases/compiler/downlevelLetConst18.ts(23,1): error TS4091: Loop contains b tests/cases/compiler/downlevelLetConst18.ts(27,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. -==== tests/cases/compiler/downlevelLetConst18.ts (9 errors) ==== +==== tests/cases/compiler/downlevelLetConst18.ts (10 errors) ==== 'use strict' for (let x; ;) { @@ -23,6 +24,8 @@ tests/cases/compiler/downlevelLetConst18.ts(27,1): error TS4091: Loop contains b for (let x; ;) { ~~~ !!! error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. + ~~~ +!!! error TS7027: Unreachable code detected. function foo() { x }; ~~~ !!! error TS2393: Duplicate function implementation. diff --git a/tests/baselines/reference/duplicateLabel1.errors.txt b/tests/baselines/reference/duplicateLabel1.errors.txt index b34f1f771e02b..2f89b400e21ab 100644 --- a/tests/baselines/reference/duplicateLabel1.errors.txt +++ b/tests/baselines/reference/duplicateLabel1.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/duplicateLabel1.ts(1,1): error TS7028: Unused label. tests/cases/compiler/duplicateLabel1.ts(2,1): error TS1114: Duplicate label 'target' -==== tests/cases/compiler/duplicateLabel1.ts (1 errors) ==== +==== tests/cases/compiler/duplicateLabel1.ts (2 errors) ==== target: + ~~~~~~ +!!! error TS7028: Unused label. target: ~~~~~~ !!! error TS1114: Duplicate label 'target' diff --git a/tests/baselines/reference/duplicateLabel2.errors.txt b/tests/baselines/reference/duplicateLabel2.errors.txt index 307596cf4e8cc..f150879c010c5 100644 --- a/tests/baselines/reference/duplicateLabel2.errors.txt +++ b/tests/baselines/reference/duplicateLabel2.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/duplicateLabel2.ts(1,1): error TS7028: Unused label. tests/cases/compiler/duplicateLabel2.ts(3,3): error TS1114: Duplicate label 'target' -==== tests/cases/compiler/duplicateLabel2.ts (1 errors) ==== +==== tests/cases/compiler/duplicateLabel2.ts (2 errors) ==== target: + ~~~~~~ +!!! error TS7028: Unused label. while (true) { target: ~~~~~~ diff --git a/tests/baselines/reference/duplicateLabel3.errors.txt b/tests/baselines/reference/duplicateLabel3.errors.txt new file mode 100644 index 0000000000000..f256176f1e084 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel3.errors.txt @@ -0,0 +1,17 @@ +tests/cases/compiler/duplicateLabel3.ts(1,1): error TS7028: Unused label. +tests/cases/compiler/duplicateLabel3.ts(4,5): error TS7028: Unused label. + + +==== tests/cases/compiler/duplicateLabel3.ts (2 errors) ==== + target: + ~~~~~~ +!!! error TS7028: Unused label. + while (true) { + function f() { + target: + ~~~~~~ +!!! error TS7028: Unused label. + while (true) { + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel3.symbols b/tests/baselines/reference/duplicateLabel3.symbols deleted file mode 100644 index 07d0ded29232e..0000000000000 --- a/tests/baselines/reference/duplicateLabel3.symbols +++ /dev/null @@ -1,11 +0,0 @@ -=== tests/cases/compiler/duplicateLabel3.ts === -target: -while (true) { - function f() { ->f : Symbol(f, Decl(duplicateLabel3.ts, 1, 14)) - - target: - while (true) { - } - } -} diff --git a/tests/baselines/reference/duplicateLabel3.types b/tests/baselines/reference/duplicateLabel3.types deleted file mode 100644 index 8d75b08c768d1..0000000000000 --- a/tests/baselines/reference/duplicateLabel3.types +++ /dev/null @@ -1,18 +0,0 @@ -=== tests/cases/compiler/duplicateLabel3.ts === -target: ->target : any - -while (true) { ->true : boolean - - function f() { ->f : () => void - - target: ->target : any - - while (true) { ->true : boolean - } - } -} diff --git a/tests/baselines/reference/duplicateLabel4.errors.txt b/tests/baselines/reference/duplicateLabel4.errors.txt new file mode 100644 index 0000000000000..516a4b2324bba --- /dev/null +++ b/tests/baselines/reference/duplicateLabel4.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/duplicateLabel4.ts(1,1): error TS7028: Unused label. +tests/cases/compiler/duplicateLabel4.ts(5,1): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/duplicateLabel4.ts (2 errors) ==== + target: + ~~~~~~ +!!! error TS7028: Unused label. + while (true) { + } + + target: + ~~~~~~ +!!! error TS7027: Unreachable code detected. + while (true) { + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel4.symbols b/tests/baselines/reference/duplicateLabel4.symbols deleted file mode 100644 index c671abcef35d6..0000000000000 --- a/tests/baselines/reference/duplicateLabel4.symbols +++ /dev/null @@ -1,9 +0,0 @@ -=== tests/cases/compiler/duplicateLabel4.ts === -target: -No type information for this code.while (true) { -No type information for this code.} -No type information for this code. -No type information for this code.target: -No type information for this code.while (true) { -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel4.types b/tests/baselines/reference/duplicateLabel4.types deleted file mode 100644 index 9238986b582be..0000000000000 --- a/tests/baselines/reference/duplicateLabel4.types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/duplicateLabel4.ts === -target: ->target : any - -while (true) { ->true : boolean -} - -target: ->target : any - -while (true) { ->true : boolean -} diff --git a/tests/baselines/reference/duplicateLocalVariable1.errors.txt b/tests/baselines/reference/duplicateLocalVariable1.errors.txt index e4217d4d41126..890470f6c11bf 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable1.errors.txt @@ -1,7 +1,9 @@ +tests/cases/compiler/duplicateLocalVariable1.ts(64,92): error TS7027: Unreachable code detected. +tests/cases/compiler/duplicateLocalVariable1.ts(65,122): error TS7027: Unreachable code detected. tests/cases/compiler/duplicateLocalVariable1.ts(185,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. -==== tests/cases/compiler/duplicateLocalVariable1.ts (1 errors) ==== +==== tests/cases/compiler/duplicateLocalVariable1.ts (3 errors) ==== //import FileManager = require('filemanager'); //import App = require('app'); @@ -66,7 +68,11 @@ tests/cases/compiler/duplicateLocalVariable1.ts(185,22): error TS2403: Subsequen // First 3 are for simple harness validation testRunner.addTest(new TestCase("Basic test", function () { return true; })); testRunner.addTest(new TestCase("Test for any error", function () { throw new Error(); return false; }, "")); + ~~~~~~ +!!! error TS7027: Unreachable code detected. testRunner.addTest(new TestCase("Test RegEx error message match", function () { throw new Error("Should also pass"); return false; }, "Should [also]+ pass")); + ~~~~~~ +!!! error TS7027: Unreachable code detected. testRunner.addTest(new TestCase("Test array compare true", function () { return TestRunner.arrayCompare([1, 2, 3], [1, 2, 3]); })); testRunner.addTest(new TestCase("Test array compare false", function () { return !TestRunner.arrayCompare([3, 2, 3], [1, 2, 3]); })); diff --git a/tests/baselines/reference/duplicateVariablesByScope.errors.txt b/tests/baselines/reference/duplicateVariablesByScope.errors.txt new file mode 100644 index 0000000000000..e101b2b0e0df5 --- /dev/null +++ b/tests/baselines/reference/duplicateVariablesByScope.errors.txt @@ -0,0 +1,37 @@ +tests/cases/compiler/duplicateVariablesByScope.ts(18,9): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/duplicateVariablesByScope.ts (1 errors) ==== + // duplicate local variables are only reported at global scope + + module M { + for (var j = 0; j < 10; j++) { + } + + for (var j = 0; j < 10; j++) { + } + } + + function foo() { + var x = 2; + var x = 1; + if (true) { + var result = 1; + } + else { + var result = 2; + ~~~ +!!! error TS7027: Unreachable code detected. + } + } + + class C { + foo() { + try { + var x = 1; + } + catch (e) { + var x = 2; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVariablesByScope.symbols b/tests/baselines/reference/duplicateVariablesByScope.symbols deleted file mode 100644 index bc94dc9b80779..0000000000000 --- a/tests/baselines/reference/duplicateVariablesByScope.symbols +++ /dev/null @@ -1,56 +0,0 @@ -=== tests/cases/compiler/duplicateVariablesByScope.ts === -// duplicate local variables are only reported at global scope - -module M { ->M : Symbol(M, Decl(duplicateVariablesByScope.ts, 0, 0)) - - for (var j = 0; j < 10; j++) { ->j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) ->j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) ->j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) - } - - for (var j = 0; j < 10; j++) { ->j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) ->j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) ->j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) - } -} - -function foo() { ->foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 8, 1)) - - var x = 2; ->x : Symbol(x, Decl(duplicateVariablesByScope.ts, 11, 7), Decl(duplicateVariablesByScope.ts, 12, 7)) - - var x = 1; ->x : Symbol(x, Decl(duplicateVariablesByScope.ts, 11, 7), Decl(duplicateVariablesByScope.ts, 12, 7)) - - if (true) { - var result = 1; ->result : Symbol(result, Decl(duplicateVariablesByScope.ts, 14, 11), Decl(duplicateVariablesByScope.ts, 17, 11)) - } - else { - var result = 2; ->result : Symbol(result, Decl(duplicateVariablesByScope.ts, 14, 11), Decl(duplicateVariablesByScope.ts, 17, 11)) - } -} - -class C { ->C : Symbol(C, Decl(duplicateVariablesByScope.ts, 19, 1)) - - foo() { ->foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 21, 9)) - - try { - var x = 1; ->x : Symbol(x, Decl(duplicateVariablesByScope.ts, 24, 15), Decl(duplicateVariablesByScope.ts, 27, 15)) - } - catch (e) { ->e : Symbol(e, Decl(duplicateVariablesByScope.ts, 26, 15)) - - var x = 2; ->x : Symbol(x, Decl(duplicateVariablesByScope.ts, 24, 15), Decl(duplicateVariablesByScope.ts, 27, 15)) - } - } -} diff --git a/tests/baselines/reference/duplicateVariablesByScope.types b/tests/baselines/reference/duplicateVariablesByScope.types deleted file mode 100644 index 42d8cae2a3c86..0000000000000 --- a/tests/baselines/reference/duplicateVariablesByScope.types +++ /dev/null @@ -1,72 +0,0 @@ -=== tests/cases/compiler/duplicateVariablesByScope.ts === -// duplicate local variables are only reported at global scope - -module M { ->M : typeof M - - for (var j = 0; j < 10; j++) { ->j : number ->0 : number ->j < 10 : boolean ->j : number ->10 : number ->j++ : number ->j : number - } - - for (var j = 0; j < 10; j++) { ->j : number ->0 : number ->j < 10 : boolean ->j : number ->10 : number ->j++ : number ->j : number - } -} - -function foo() { ->foo : () => void - - var x = 2; ->x : number ->2 : number - - var x = 1; ->x : number ->1 : number - - if (true) { ->true : boolean - - var result = 1; ->result : number ->1 : number - } - else { - var result = 2; ->result : number ->2 : number - } -} - -class C { ->C : C - - foo() { ->foo : () => void - - try { - var x = 1; ->x : number ->1 : number - } - catch (e) { ->e : any - - var x = 2; ->x : number ->2 : number - } - } -} diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.errors.txt b/tests/baselines/reference/es6ClassSuperCodegenBug.errors.txt new file mode 100644 index 0000000000000..f30719a279212 --- /dev/null +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.errors.txt @@ -0,0 +1,19 @@ +tests/cases/compiler/es6ClassSuperCodegenBug.ts(9,10): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/es6ClassSuperCodegenBug.ts (1 errors) ==== + class A { + constructor(str1:string, str2:string) {} + } + class B extends A { + constructor() { + if (true) { + super('a1', 'b1'); + } else { + super('a2', 'b2'); + ~~~~~ +!!! error TS7027: Unreachable code detected. + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.symbols b/tests/baselines/reference/es6ClassSuperCodegenBug.symbols deleted file mode 100644 index d520ec3ceb1c3..0000000000000 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.symbols +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/compiler/es6ClassSuperCodegenBug.ts === -class A { ->A : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) - - constructor(str1:string, str2:string) {} ->str1 : Symbol(str1, Decl(es6ClassSuperCodegenBug.ts, 1, 13)) ->str2 : Symbol(str2, Decl(es6ClassSuperCodegenBug.ts, 1, 25)) -} -class B extends A { ->B : Symbol(B, Decl(es6ClassSuperCodegenBug.ts, 2, 1)) ->A : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) - - constructor() { - if (true) { - super('a1', 'b1'); ->super : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) - - } else { - super('a2', 'b2'); ->super : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) - } - } -} - diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.types b/tests/baselines/reference/es6ClassSuperCodegenBug.types deleted file mode 100644 index bdf8ebde8f23e..0000000000000 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.types +++ /dev/null @@ -1,32 +0,0 @@ -=== tests/cases/compiler/es6ClassSuperCodegenBug.ts === -class A { ->A : A - - constructor(str1:string, str2:string) {} ->str1 : string ->str2 : string -} -class B extends A { ->B : B ->A : A - - constructor() { - if (true) { ->true : boolean - - super('a1', 'b1'); ->super('a1', 'b1') : void ->super : typeof A ->'a1' : string ->'b1' : string - - } else { - super('a2', 'b2'); ->super('a2', 'b2') : void ->super : typeof A ->'a2' : string ->'b2' : string - } - } -} - diff --git a/tests/baselines/reference/escapedIdentifiers.errors.txt b/tests/baselines/reference/escapedIdentifiers.errors.txt new file mode 100644 index 0000000000000..8f7d735ceedaa --- /dev/null +++ b/tests/baselines/reference/escapedIdentifiers.errors.txt @@ -0,0 +1,146 @@ +tests/cases/compiler/escapedIdentifiers.ts(93,1): error TS7028: Unused label. +tests/cases/compiler/escapedIdentifiers.ts(96,8): error TS7027: Unreachable code detected. +tests/cases/compiler/escapedIdentifiers.ts(100,1): error TS7028: Unused label. +tests/cases/compiler/escapedIdentifiers.ts(103,8): error TS7027: Unreachable code detected. +tests/cases/compiler/escapedIdentifiers.ts(107,1): error TS7028: Unused label. +tests/cases/compiler/escapedIdentifiers.ts(110,8): error TS7027: Unreachable code detected. +tests/cases/compiler/escapedIdentifiers.ts(114,1): error TS7028: Unused label. +tests/cases/compiler/escapedIdentifiers.ts(117,8): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/escapedIdentifiers.ts (8 errors) ==== + /* + 0 .. \u0030 + 9 .. \u0039 + + A .. \u0041 + Z .. \u005a + + a .. \u0061 + z .. \u00za + */ + + // var decl + var \u0061 = 1; + a ++; + \u0061 ++; + + var b = 1; + b ++; + \u0062 ++; + + // modules + module moduleType1 { + export var baz1: number; + } + module moduleType\u0032 { + export var baz2: number; + } + + moduleType1.baz1 = 3; + moduleType\u0031.baz1 = 3; + moduleType2.baz2 = 3; + moduleType\u0032.baz2 = 3; + + // classes + + class classType1 { + public foo1: number; + } + class classType\u0032 { + public foo2: number; + } + + var classType1Object1 = new classType1(); + classType1Object1.foo1 = 2; + var classType1Object2 = new classType\u0031(); + classType1Object2.foo1 = 2; + var classType2Object1 = new classType2(); + classType2Object1.foo2 = 2; + var classType2Object2 = new classType\u0032(); + classType2Object2.foo2 = 2; + + // interfaces + interface interfaceType1 { + bar1: number; + } + interface interfaceType\u0032 { + bar2: number; + } + + var interfaceType1Object1 = { bar1: 0 }; + interfaceType1Object1.bar1 = 2; + var interfaceType1Object2 = { bar1: 0 }; + interfaceType1Object2.bar1 = 2; + var interfaceType2Object1 = { bar2: 0 }; + interfaceType2Object1.bar2 = 2; + var interfaceType2Object2 = { bar2: 0 }; + interfaceType2Object2.bar2 = 2; + + + // arguments + class testClass { + public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { + arg\u0031 = 1; + arg2 = 'string'; + arg\u0033 = true; + arg4 = 2; + } + } + + // constructors + class constructorTestClass { + constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { + } + } + var constructorTestObject = new constructorTestClass(1, 'string', true, 2); + constructorTestObject.arg\u0031 = 1; + constructorTestObject.arg2 = 'string'; + constructorTestObject.arg\u0033 = true; + constructorTestObject.arg4 = 2; + + // Lables + + l\u0061bel1: + ~~~~~~~~~~~ +!!! error TS7028: Unused label. + while (false) + { + while(false) + ~~~~~ +!!! error TS7027: Unreachable code detected. + continue label1; // it will go to next iteration of outer loop + } + + label2: + ~~~~~~ +!!! error TS7028: Unused label. + while (false) + { + while(false) + ~~~~~ +!!! error TS7027: Unreachable code detected. + continue l\u0061bel2; // it will go to next iteration of outer loop + } + + label3: + ~~~~~~ +!!! error TS7028: Unused label. + while (false) + { + while(false) + ~~~~~ +!!! error TS7027: Unreachable code detected. + continue label3; // it will go to next iteration of outer loop + } + + l\u0061bel4: + ~~~~~~~~~~~ +!!! error TS7028: Unused label. + while (false) + { + while(false) + ~~~~~ +!!! error TS7027: Unreachable code detected. + continue l\u0061bel4; // it will go to next iteration of outer loop + } \ No newline at end of file diff --git a/tests/baselines/reference/escapedIdentifiers.symbols b/tests/baselines/reference/escapedIdentifiers.symbols deleted file mode 100644 index 6c84b25647f6a..0000000000000 --- a/tests/baselines/reference/escapedIdentifiers.symbols +++ /dev/null @@ -1,260 +0,0 @@ -=== tests/cases/compiler/escapedIdentifiers.ts === -/* - 0 .. \u0030 - 9 .. \u0039 - - A .. \u0041 - Z .. \u005a - - a .. \u0061 - z .. \u00za -*/ - -// var decl -var \u0061 = 1; ->\u0061 : Symbol(\u0061, Decl(escapedIdentifiers.ts, 12, 3)) - -a ++; ->a : Symbol(\u0061, Decl(escapedIdentifiers.ts, 12, 3)) - -\u0061 ++; ->\u0061 : Symbol(\u0061, Decl(escapedIdentifiers.ts, 12, 3)) - -var b = 1; ->b : Symbol(b, Decl(escapedIdentifiers.ts, 16, 3)) - -b ++; ->b : Symbol(b, Decl(escapedIdentifiers.ts, 16, 3)) - -\u0062 ++; ->\u0062 : Symbol(b, Decl(escapedIdentifiers.ts, 16, 3)) - -// modules -module moduleType1 { ->moduleType1 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 18, 10)) - - export var baz1: number; ->baz1 : Symbol(baz1, Decl(escapedIdentifiers.ts, 22, 14)) -} -module moduleType\u0032 { ->moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 23, 1)) - - export var baz2: number; ->baz2 : Symbol(baz2, Decl(escapedIdentifiers.ts, 25, 14)) -} - -moduleType1.baz1 = 3; ->moduleType1.baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) ->moduleType1 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 18, 10)) ->baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) - -moduleType\u0031.baz1 = 3; ->moduleType\u0031.baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) ->moduleType\u0031 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 18, 10)) ->baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) - -moduleType2.baz2 = 3; ->moduleType2.baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) ->moduleType2 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 23, 1)) ->baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) - -moduleType\u0032.baz2 = 3; ->moduleType\u0032.baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) ->moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 23, 1)) ->baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) - -// classes - -class classType1 { ->classType1 : Symbol(classType1, Decl(escapedIdentifiers.ts, 31, 26)) - - public foo1: number; ->foo1 : Symbol(foo1, Decl(escapedIdentifiers.ts, 35, 18)) -} -class classType\u0032 { ->classType\u0032 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 37, 1)) - - public foo2: number; ->foo2 : Symbol(foo2, Decl(escapedIdentifiers.ts, 38, 23)) -} - -var classType1Object1 = new classType1(); ->classType1Object1 : Symbol(classType1Object1, Decl(escapedIdentifiers.ts, 42, 3)) ->classType1 : Symbol(classType1, Decl(escapedIdentifiers.ts, 31, 26)) - -classType1Object1.foo1 = 2; ->classType1Object1.foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) ->classType1Object1 : Symbol(classType1Object1, Decl(escapedIdentifiers.ts, 42, 3)) ->foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) - -var classType1Object2 = new classType\u0031(); ->classType1Object2 : Symbol(classType1Object2, Decl(escapedIdentifiers.ts, 44, 3)) ->classType\u0031 : Symbol(classType1, Decl(escapedIdentifiers.ts, 31, 26)) - -classType1Object2.foo1 = 2; ->classType1Object2.foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) ->classType1Object2 : Symbol(classType1Object2, Decl(escapedIdentifiers.ts, 44, 3)) ->foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) - -var classType2Object1 = new classType2(); ->classType2Object1 : Symbol(classType2Object1, Decl(escapedIdentifiers.ts, 46, 3)) ->classType2 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 37, 1)) - -classType2Object1.foo2 = 2; ->classType2Object1.foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) ->classType2Object1 : Symbol(classType2Object1, Decl(escapedIdentifiers.ts, 46, 3)) ->foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) - -var classType2Object2 = new classType\u0032(); ->classType2Object2 : Symbol(classType2Object2, Decl(escapedIdentifiers.ts, 48, 3)) ->classType\u0032 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 37, 1)) - -classType2Object2.foo2 = 2; ->classType2Object2.foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) ->classType2Object2 : Symbol(classType2Object2, Decl(escapedIdentifiers.ts, 48, 3)) ->foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) - -// interfaces -interface interfaceType1 { ->interfaceType1 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 49, 27)) - - bar1: number; ->bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 52, 26)) -} -interface interfaceType\u0032 { ->interfaceType\u0032 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 54, 1)) - - bar2: number; ->bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 55, 31)) -} - -var interfaceType1Object1 = { bar1: 0 }; ->interfaceType1Object1 : Symbol(interfaceType1Object1, Decl(escapedIdentifiers.ts, 59, 3)) ->interfaceType1 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 49, 27)) ->bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 59, 45)) - -interfaceType1Object1.bar1 = 2; ->interfaceType1Object1.bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) ->interfaceType1Object1 : Symbol(interfaceType1Object1, Decl(escapedIdentifiers.ts, 59, 3)) ->bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) - -var interfaceType1Object2 = { bar1: 0 }; ->interfaceType1Object2 : Symbol(interfaceType1Object2, Decl(escapedIdentifiers.ts, 61, 3)) ->interfaceType\u0031 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 49, 27)) ->bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 61, 50)) - -interfaceType1Object2.bar1 = 2; ->interfaceType1Object2.bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) ->interfaceType1Object2 : Symbol(interfaceType1Object2, Decl(escapedIdentifiers.ts, 61, 3)) ->bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) - -var interfaceType2Object1 = { bar2: 0 }; ->interfaceType2Object1 : Symbol(interfaceType2Object1, Decl(escapedIdentifiers.ts, 63, 3)) ->interfaceType2 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 54, 1)) ->bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 63, 45)) - -interfaceType2Object1.bar2 = 2; ->interfaceType2Object1.bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) ->interfaceType2Object1 : Symbol(interfaceType2Object1, Decl(escapedIdentifiers.ts, 63, 3)) ->bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) - -var interfaceType2Object2 = { bar2: 0 }; ->interfaceType2Object2 : Symbol(interfaceType2Object2, Decl(escapedIdentifiers.ts, 65, 3)) ->interfaceType\u0032 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 54, 1)) ->bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 65, 50)) - -interfaceType2Object2.bar2 = 2; ->interfaceType2Object2.bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) ->interfaceType2Object2 : Symbol(interfaceType2Object2, Decl(escapedIdentifiers.ts, 65, 3)) ->bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) - - -// arguments -class testClass { ->testClass : Symbol(testClass, Decl(escapedIdentifiers.ts, 66, 31)) - - public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { ->func : Symbol(func, Decl(escapedIdentifiers.ts, 70, 17)) ->arg1 : Symbol(arg1, Decl(escapedIdentifiers.ts, 71, 16)) ->arg\u0032 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 71, 29)) ->arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 71, 48)) ->arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 71, 68)) - - arg\u0031 = 1; ->arg\u0031 : Symbol(arg1, Decl(escapedIdentifiers.ts, 71, 16)) - - arg2 = 'string'; ->arg2 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 71, 29)) - - arg\u0033 = true; ->arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 71, 48)) - - arg4 = 2; ->arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 71, 68)) - } -} - -// constructors -class constructorTestClass { ->constructorTestClass : Symbol(constructorTestClass, Decl(escapedIdentifiers.ts, 77, 1)) - - constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { ->arg1 : Symbol(arg1, Decl(escapedIdentifiers.ts, 81, 17)) ->arg\u0032 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 81, 37)) ->arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 81, 62)) ->arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 81, 88)) - } -} -var constructorTestObject = new constructorTestClass(1, 'string', true, 2); ->constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) ->constructorTestClass : Symbol(constructorTestClass, Decl(escapedIdentifiers.ts, 77, 1)) - -constructorTestObject.arg\u0031 = 1; ->constructorTestObject.arg\u0031 : Symbol(constructorTestClass.arg1, Decl(escapedIdentifiers.ts, 81, 17)) ->constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) ->arg\u0031 : Symbol(constructorTestClass.arg1, Decl(escapedIdentifiers.ts, 81, 17)) - -constructorTestObject.arg2 = 'string'; ->constructorTestObject.arg2 : Symbol(constructorTestClass.arg\u0032, Decl(escapedIdentifiers.ts, 81, 37)) ->constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) ->arg2 : Symbol(constructorTestClass.arg\u0032, Decl(escapedIdentifiers.ts, 81, 37)) - -constructorTestObject.arg\u0033 = true; ->constructorTestObject.arg\u0033 : Symbol(constructorTestClass.arg\u0033, Decl(escapedIdentifiers.ts, 81, 62)) ->constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) ->arg\u0033 : Symbol(constructorTestClass.arg\u0033, Decl(escapedIdentifiers.ts, 81, 62)) - -constructorTestObject.arg4 = 2; ->constructorTestObject.arg4 : Symbol(constructorTestClass.arg4, Decl(escapedIdentifiers.ts, 81, 88)) ->constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) ->arg4 : Symbol(constructorTestClass.arg4, Decl(escapedIdentifiers.ts, 81, 88)) - -// Lables - -l\u0061bel1: - while (false) - { - while(false) - continue label1; // it will go to next iteration of outer loop - } - -label2: - while (false) - { - while(false) - continue l\u0061bel2; // it will go to next iteration of outer loop - } - -label3: - while (false) - { - while(false) - continue label3; // it will go to next iteration of outer loop - } - -l\u0061bel4: - while (false) - { - while(false) - continue l\u0061bel4; // it will go to next iteration of outer loop - } diff --git a/tests/baselines/reference/escapedIdentifiers.types b/tests/baselines/reference/escapedIdentifiers.types deleted file mode 100644 index b32d21a48cb5e..0000000000000 --- a/tests/baselines/reference/escapedIdentifiers.types +++ /dev/null @@ -1,351 +0,0 @@ -=== tests/cases/compiler/escapedIdentifiers.ts === -/* - 0 .. \u0030 - 9 .. \u0039 - - A .. \u0041 - Z .. \u005a - - a .. \u0061 - z .. \u00za -*/ - -// var decl -var \u0061 = 1; ->\u0061 : number ->1 : number - -a ++; ->a ++ : number ->a : number - -\u0061 ++; ->\u0061 ++ : number ->\u0061 : number - -var b = 1; ->b : number ->1 : number - -b ++; ->b ++ : number ->b : number - -\u0062 ++; ->\u0062 ++ : number ->\u0062 : number - -// modules -module moduleType1 { ->moduleType1 : typeof moduleType1 - - export var baz1: number; ->baz1 : number -} -module moduleType\u0032 { ->moduleType\u0032 : typeof moduleType\u0032 - - export var baz2: number; ->baz2 : number -} - -moduleType1.baz1 = 3; ->moduleType1.baz1 = 3 : number ->moduleType1.baz1 : number ->moduleType1 : typeof moduleType1 ->baz1 : number ->3 : number - -moduleType\u0031.baz1 = 3; ->moduleType\u0031.baz1 = 3 : number ->moduleType\u0031.baz1 : number ->moduleType\u0031 : typeof moduleType1 ->baz1 : number ->3 : number - -moduleType2.baz2 = 3; ->moduleType2.baz2 = 3 : number ->moduleType2.baz2 : number ->moduleType2 : typeof moduleType\u0032 ->baz2 : number ->3 : number - -moduleType\u0032.baz2 = 3; ->moduleType\u0032.baz2 = 3 : number ->moduleType\u0032.baz2 : number ->moduleType\u0032 : typeof moduleType\u0032 ->baz2 : number ->3 : number - -// classes - -class classType1 { ->classType1 : classType1 - - public foo1: number; ->foo1 : number -} -class classType\u0032 { ->classType\u0032 : classType\u0032 - - public foo2: number; ->foo2 : number -} - -var classType1Object1 = new classType1(); ->classType1Object1 : classType1 ->new classType1() : classType1 ->classType1 : typeof classType1 - -classType1Object1.foo1 = 2; ->classType1Object1.foo1 = 2 : number ->classType1Object1.foo1 : number ->classType1Object1 : classType1 ->foo1 : number ->2 : number - -var classType1Object2 = new classType\u0031(); ->classType1Object2 : classType1 ->new classType\u0031() : classType1 ->classType\u0031 : typeof classType1 - -classType1Object2.foo1 = 2; ->classType1Object2.foo1 = 2 : number ->classType1Object2.foo1 : number ->classType1Object2 : classType1 ->foo1 : number ->2 : number - -var classType2Object1 = new classType2(); ->classType2Object1 : classType\u0032 ->new classType2() : classType\u0032 ->classType2 : typeof classType\u0032 - -classType2Object1.foo2 = 2; ->classType2Object1.foo2 = 2 : number ->classType2Object1.foo2 : number ->classType2Object1 : classType\u0032 ->foo2 : number ->2 : number - -var classType2Object2 = new classType\u0032(); ->classType2Object2 : classType\u0032 ->new classType\u0032() : classType\u0032 ->classType\u0032 : typeof classType\u0032 - -classType2Object2.foo2 = 2; ->classType2Object2.foo2 = 2 : number ->classType2Object2.foo2 : number ->classType2Object2 : classType\u0032 ->foo2 : number ->2 : number - -// interfaces -interface interfaceType1 { ->interfaceType1 : interfaceType1 - - bar1: number; ->bar1 : number -} -interface interfaceType\u0032 { ->interfaceType\u0032 : interfaceType\u0032 - - bar2: number; ->bar2 : number -} - -var interfaceType1Object1 = { bar1: 0 }; ->interfaceType1Object1 : interfaceType1 ->{ bar1: 0 } : interfaceType1 ->interfaceType1 : interfaceType1 ->{ bar1: 0 } : { bar1: number; } ->bar1 : number ->0 : number - -interfaceType1Object1.bar1 = 2; ->interfaceType1Object1.bar1 = 2 : number ->interfaceType1Object1.bar1 : number ->interfaceType1Object1 : interfaceType1 ->bar1 : number ->2 : number - -var interfaceType1Object2 = { bar1: 0 }; ->interfaceType1Object2 : interfaceType1 ->{ bar1: 0 } : interfaceType1 ->interfaceType\u0031 : interfaceType1 ->{ bar1: 0 } : { bar1: number; } ->bar1 : number ->0 : number - -interfaceType1Object2.bar1 = 2; ->interfaceType1Object2.bar1 = 2 : number ->interfaceType1Object2.bar1 : number ->interfaceType1Object2 : interfaceType1 ->bar1 : number ->2 : number - -var interfaceType2Object1 = { bar2: 0 }; ->interfaceType2Object1 : interfaceType\u0032 ->{ bar2: 0 } : interfaceType\u0032 ->interfaceType2 : interfaceType\u0032 ->{ bar2: 0 } : { bar2: number; } ->bar2 : number ->0 : number - -interfaceType2Object1.bar2 = 2; ->interfaceType2Object1.bar2 = 2 : number ->interfaceType2Object1.bar2 : number ->interfaceType2Object1 : interfaceType\u0032 ->bar2 : number ->2 : number - -var interfaceType2Object2 = { bar2: 0 }; ->interfaceType2Object2 : interfaceType\u0032 ->{ bar2: 0 } : interfaceType\u0032 ->interfaceType\u0032 : interfaceType\u0032 ->{ bar2: 0 } : { bar2: number; } ->bar2 : number ->0 : number - -interfaceType2Object2.bar2 = 2; ->interfaceType2Object2.bar2 = 2 : number ->interfaceType2Object2.bar2 : number ->interfaceType2Object2 : interfaceType\u0032 ->bar2 : number ->2 : number - - -// arguments -class testClass { ->testClass : testClass - - public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { ->func : (arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) => void ->arg1 : number ->arg\u0032 : string ->arg\u0033 : boolean ->arg4 : number - - arg\u0031 = 1; ->arg\u0031 = 1 : number ->arg\u0031 : number ->1 : number - - arg2 = 'string'; ->arg2 = 'string' : string ->arg2 : string ->'string' : string - - arg\u0033 = true; ->arg\u0033 = true : boolean ->arg\u0033 : boolean ->true : boolean - - arg4 = 2; ->arg4 = 2 : number ->arg4 : number ->2 : number - } -} - -// constructors -class constructorTestClass { ->constructorTestClass : constructorTestClass - - constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { ->arg1 : number ->arg\u0032 : string ->arg\u0033 : boolean ->arg4 : number - } -} -var constructorTestObject = new constructorTestClass(1, 'string', true, 2); ->constructorTestObject : constructorTestClass ->new constructorTestClass(1, 'string', true, 2) : constructorTestClass ->constructorTestClass : typeof constructorTestClass ->1 : number ->'string' : string ->true : boolean ->2 : number - -constructorTestObject.arg\u0031 = 1; ->constructorTestObject.arg\u0031 = 1 : number ->constructorTestObject.arg\u0031 : number ->constructorTestObject : constructorTestClass ->arg\u0031 : number ->1 : number - -constructorTestObject.arg2 = 'string'; ->constructorTestObject.arg2 = 'string' : string ->constructorTestObject.arg2 : string ->constructorTestObject : constructorTestClass ->arg2 : string ->'string' : string - -constructorTestObject.arg\u0033 = true; ->constructorTestObject.arg\u0033 = true : boolean ->constructorTestObject.arg\u0033 : boolean ->constructorTestObject : constructorTestClass ->arg\u0033 : boolean ->true : boolean - -constructorTestObject.arg4 = 2; ->constructorTestObject.arg4 = 2 : number ->constructorTestObject.arg4 : number ->constructorTestObject : constructorTestClass ->arg4 : number ->2 : number - -// Lables - -l\u0061bel1: ->l\u0061bel1 : any - - while (false) ->false : boolean - { - while(false) ->false : boolean - - continue label1; // it will go to next iteration of outer loop ->label1 : any - } - -label2: ->label2 : any - - while (false) ->false : boolean - { - while(false) ->false : boolean - - continue l\u0061bel2; // it will go to next iteration of outer loop ->l\u0061bel2 : any - } - -label3: ->label3 : any - - while (false) ->false : boolean - { - while(false) ->false : boolean - - continue label3; // it will go to next iteration of outer loop ->label3 : any - } - -l\u0061bel4: ->l\u0061bel4 : any - - while (false) ->false : boolean - { - while(false) ->false : boolean - - continue l\u0061bel4; // it will go to next iteration of outer loop ->l\u0061bel4 : any - } diff --git a/tests/baselines/reference/for.errors.txt b/tests/baselines/reference/for.errors.txt index 41ed5765c9a35..34de6a4b11483 100644 --- a/tests/baselines/reference/for.errors.txt +++ b/tests/baselines/reference/for.errors.txt @@ -1,7 +1,8 @@ +tests/cases/compiler/for.ts(29,1): error TS7027: Unreachable code detected. tests/cases/compiler/for.ts(29,6): error TS1109: Expression expected. -==== tests/cases/compiler/for.ts (1 errors) ==== +==== tests/cases/compiler/for.ts (2 errors) ==== for (var i = 0; i < 10; i++) { // ok var x1 = i; } @@ -31,6 +32,8 @@ tests/cases/compiler/for.ts(29,6): error TS1109: Expression expected. } for () { // error + ~~~ +!!! error TS7027: Unreachable code detected. ~ !!! error TS1109: Expression expected. } \ No newline at end of file diff --git a/tests/baselines/reference/forBreakStatements.errors.txt b/tests/baselines/reference/forBreakStatements.errors.txt new file mode 100644 index 0000000000000..2b42afc9be2e0 --- /dev/null +++ b/tests/baselines/reference/forBreakStatements.errors.txt @@ -0,0 +1,49 @@ +tests/cases/conformance/statements/breakStatements/forBreakStatements.ts(10,1): error TS7028: Unused label. +tests/cases/conformance/statements/breakStatements/forBreakStatements.ts(18,5): error TS7028: Unused label. +tests/cases/conformance/statements/breakStatements/forBreakStatements.ts(29,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts (3 errors) ==== + for (; ;) { + break; + } + + ONE: + for (; ;) { + break ONE; + } + + TWO: + ~~~ +!!! error TS7028: Unused label. + THREE: + for (; ;) { + break THREE; + } + + FOUR: + for (; ;) { + FIVE: + ~~~~ +!!! error TS7028: Unused label. + for (; ;) { + break FOUR; + } + } + + for (; ;) { + SIX: + for (; ;) break SIX; + } + + SEVEN: + ~~~~~ +!!! error TS7027: Unreachable code detected. + for (; ;) for (; ;) for (; ;) break SEVEN; + + EIGHT: + for (; ;) { + var fn = function () { } + break EIGHT; + } + \ No newline at end of file diff --git a/tests/baselines/reference/forBreakStatements.symbols b/tests/baselines/reference/forBreakStatements.symbols deleted file mode 100644 index 76db9309a3969..0000000000000 --- a/tests/baselines/reference/forBreakStatements.symbols +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts === -for (; ;) { - break; -} - -ONE: -for (; ;) { - break ONE; -} - -TWO: -THREE: -for (; ;) { - break THREE; -} - -FOUR: -for (; ;) { - FIVE: - for (; ;) { - break FOUR; - } -} - -for (; ;) { - SIX: - for (; ;) break SIX; -} - -SEVEN: -for (; ;) for (; ;) for (; ;) break SEVEN; - -EIGHT: -for (; ;) { - var fn = function () { } ->fn : Symbol(fn, Decl(forBreakStatements.ts, 33, 7)) - - break EIGHT; -} - diff --git a/tests/baselines/reference/forBreakStatements.types b/tests/baselines/reference/forBreakStatements.types deleted file mode 100644 index 8469a85bd19f7..0000000000000 --- a/tests/baselines/reference/forBreakStatements.types +++ /dev/null @@ -1,63 +0,0 @@ -=== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts === -for (; ;) { - break; -} - -ONE: ->ONE : any - -for (; ;) { - break ONE; ->ONE : any -} - -TWO: ->TWO : any - -THREE: ->THREE : any - -for (; ;) { - break THREE; ->THREE : any -} - -FOUR: ->FOUR : any - -for (; ;) { - FIVE: ->FIVE : any - - for (; ;) { - break FOUR; ->FOUR : any - } -} - -for (; ;) { - SIX: ->SIX : any - - for (; ;) break SIX; ->SIX : any -} - -SEVEN: ->SEVEN : any - -for (; ;) for (; ;) for (; ;) break SEVEN; ->SEVEN : any - -EIGHT: ->EIGHT : any - -for (; ;) { - var fn = function () { } ->fn : () => void ->function () { } : () => void - - break EIGHT; ->EIGHT : any -} - diff --git a/tests/baselines/reference/forContinueStatements.errors.txt b/tests/baselines/reference/forContinueStatements.errors.txt new file mode 100644 index 0000000000000..b7a4cc355466d --- /dev/null +++ b/tests/baselines/reference/forContinueStatements.errors.txt @@ -0,0 +1,43 @@ +tests/cases/conformance/statements/continueStatements/forContinueStatements.ts(5,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts (1 errors) ==== + for (; ;) { + continue; + } + + ONE: + ~~~ +!!! error TS7027: Unreachable code detected. + for (; ;) { + continue ONE; + } + + TWO: + THREE: + for (; ;) { + continue THREE; + } + + FOUR: + for (; ;) { + FIVE: + for (; ;) { + continue FOUR; + } + } + + for (; ;) { + SIX: + for (; ;) continue SIX; + } + + SEVEN: + for (; ;) for (; ;) for (; ;) continue SEVEN; + + EIGHT: + for (; ;) { + var fn = function () { } + continue EIGHT; + } + \ No newline at end of file diff --git a/tests/baselines/reference/forContinueStatements.symbols b/tests/baselines/reference/forContinueStatements.symbols deleted file mode 100644 index e24eb2aaa9252..0000000000000 --- a/tests/baselines/reference/forContinueStatements.symbols +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts === -for (; ;) { - continue; -} - -ONE: -for (; ;) { - continue ONE; -} - -TWO: -THREE: -for (; ;) { - continue THREE; -} - -FOUR: -for (; ;) { - FIVE: - for (; ;) { - continue FOUR; - } -} - -for (; ;) { - SIX: - for (; ;) continue SIX; -} - -SEVEN: -for (; ;) for (; ;) for (; ;) continue SEVEN; - -EIGHT: -for (; ;) { - var fn = function () { } ->fn : Symbol(fn, Decl(forContinueStatements.ts, 33, 7)) - - continue EIGHT; -} - diff --git a/tests/baselines/reference/forContinueStatements.types b/tests/baselines/reference/forContinueStatements.types deleted file mode 100644 index 79b78e83345de..0000000000000 --- a/tests/baselines/reference/forContinueStatements.types +++ /dev/null @@ -1,63 +0,0 @@ -=== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts === -for (; ;) { - continue; -} - -ONE: ->ONE : any - -for (; ;) { - continue ONE; ->ONE : any -} - -TWO: ->TWO : any - -THREE: ->THREE : any - -for (; ;) { - continue THREE; ->THREE : any -} - -FOUR: ->FOUR : any - -for (; ;) { - FIVE: ->FIVE : any - - for (; ;) { - continue FOUR; ->FOUR : any - } -} - -for (; ;) { - SIX: ->SIX : any - - for (; ;) continue SIX; ->SIX : any -} - -SEVEN: ->SEVEN : any - -for (; ;) for (; ;) for (; ;) continue SEVEN; ->SEVEN : any - -EIGHT: ->EIGHT : any - -for (; ;) { - var fn = function () { } ->fn : () => void ->function () { } : () => void - - continue EIGHT; ->EIGHT : any -} - diff --git a/tests/baselines/reference/forInBreakStatements.errors.txt b/tests/baselines/reference/forInBreakStatements.errors.txt new file mode 100644 index 0000000000000..8bbbf2d38eefa --- /dev/null +++ b/tests/baselines/reference/forInBreakStatements.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts(10,1): error TS7028: Unused label. +tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts(18,5): error TS7028: Unused label. + + +==== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts (2 errors) ==== + for(var x in {}) { + break; + } + + ONE: + for(var x in {}) { + break ONE; + } + + TWO: + ~~~ +!!! error TS7028: Unused label. + THREE: + for(var x in {}) { + break THREE; + } + + FOUR: + for(var x in {}) { + FIVE: + ~~~~ +!!! error TS7028: Unused label. + for(var x in {}) { + break FOUR; + } + } + + for(var x in {}) { + SIX: + for(var x in {}) break SIX; + } + + SEVEN: + for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; + + EIGHT: + for (var x in {}){ + var fn = function () { } + break EIGHT; + } + \ No newline at end of file diff --git a/tests/baselines/reference/forInBreakStatements.symbols b/tests/baselines/reference/forInBreakStatements.symbols deleted file mode 100644 index 7984edc3fd699..0000000000000 --- a/tests/baselines/reference/forInBreakStatements.symbols +++ /dev/null @@ -1,58 +0,0 @@ -=== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts === -for(var x in {}) { ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) - - break; -} - -ONE: -for(var x in {}) { ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) - - break ONE; -} - -TWO: -THREE: -for(var x in {}) { ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) - - break THREE; -} - -FOUR: -for(var x in {}) { ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) - - FIVE: - for(var x in {}) { ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) - - break FOUR; - } -} - -for(var x in {}) { ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) - - SIX: - for(var x in {}) break SIX; ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) -} - -SEVEN: -for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) - -EIGHT: -for (var x in {}){ ->x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) - - var fn = function () { } ->fn : Symbol(fn, Decl(forInBreakStatements.ts, 33, 7)) - - break EIGHT; -} - diff --git a/tests/baselines/reference/forInBreakStatements.types b/tests/baselines/reference/forInBreakStatements.types deleted file mode 100644 index 05ea8e35febe1..0000000000000 --- a/tests/baselines/reference/forInBreakStatements.types +++ /dev/null @@ -1,92 +0,0 @@ -=== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts === -for(var x in {}) { ->x : any ->{} : {} - - break; -} - -ONE: ->ONE : any - -for(var x in {}) { ->x : any ->{} : {} - - break ONE; ->ONE : any -} - -TWO: ->TWO : any - -THREE: ->THREE : any - -for(var x in {}) { ->x : any ->{} : {} - - break THREE; ->THREE : any -} - -FOUR: ->FOUR : any - -for(var x in {}) { ->x : any ->{} : {} - - FIVE: ->FIVE : any - - for(var x in {}) { ->x : any ->{} : {} - - break FOUR; ->FOUR : any - } -} - -for(var x in {}) { ->x : any ->{} : {} - - SIX: ->SIX : any - - for(var x in {}) break SIX; ->x : any ->{} : {} ->SIX : any -} - -SEVEN: ->SEVEN : any - -for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; ->x : any ->{} : {} ->x : any ->{} : {} ->x : any ->{} : {} ->SEVEN : any - -EIGHT: ->EIGHT : any - -for (var x in {}){ ->x : any ->{} : {} - - var fn = function () { } ->fn : () => void ->function () { } : () => void - - break EIGHT; ->EIGHT : any -} - diff --git a/tests/baselines/reference/forInContinueStatements.errors.txt b/tests/baselines/reference/forInContinueStatements.errors.txt new file mode 100644 index 0000000000000..7a3a74e5aeeda --- /dev/null +++ b/tests/baselines/reference/forInContinueStatements.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts(10,1): error TS7028: Unused label. +tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts(18,5): error TS7028: Unused label. + + +==== tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts (2 errors) ==== + for(var x in {}) { + continue; + } + + ONE: + for(var x in {}) { + continue ONE; + } + + TWO: + ~~~ +!!! error TS7028: Unused label. + THREE: + for(var x in {}) { + continue THREE; + } + + FOUR: + for(var x in {}) { + FIVE: + ~~~~ +!!! error TS7028: Unused label. + for(var x in {}) { + continue FOUR; + } + } + + for(var x in {}) { + SIX: + for(var x in {}) continue SIX; + } + + SEVEN: + for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; + + EIGHT: + for (var x in {}){ + var fn = function () { } + continue EIGHT; + } + \ No newline at end of file diff --git a/tests/baselines/reference/forInContinueStatements.symbols b/tests/baselines/reference/forInContinueStatements.symbols deleted file mode 100644 index 88129a50d21ce..0000000000000 --- a/tests/baselines/reference/forInContinueStatements.symbols +++ /dev/null @@ -1,58 +0,0 @@ -=== tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts === -for(var x in {}) { ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) - - continue; -} - -ONE: -for(var x in {}) { ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) - - continue ONE; -} - -TWO: -THREE: -for(var x in {}) { ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) - - continue THREE; -} - -FOUR: -for(var x in {}) { ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) - - FIVE: - for(var x in {}) { ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) - - continue FOUR; - } -} - -for(var x in {}) { ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) - - SIX: - for(var x in {}) continue SIX; ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) -} - -SEVEN: -for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) - -EIGHT: -for (var x in {}){ ->x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) - - var fn = function () { } ->fn : Symbol(fn, Decl(forInContinueStatements.ts, 33, 7)) - - continue EIGHT; -} - diff --git a/tests/baselines/reference/forInContinueStatements.types b/tests/baselines/reference/forInContinueStatements.types deleted file mode 100644 index 95637345fa686..0000000000000 --- a/tests/baselines/reference/forInContinueStatements.types +++ /dev/null @@ -1,92 +0,0 @@ -=== tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts === -for(var x in {}) { ->x : any ->{} : {} - - continue; -} - -ONE: ->ONE : any - -for(var x in {}) { ->x : any ->{} : {} - - continue ONE; ->ONE : any -} - -TWO: ->TWO : any - -THREE: ->THREE : any - -for(var x in {}) { ->x : any ->{} : {} - - continue THREE; ->THREE : any -} - -FOUR: ->FOUR : any - -for(var x in {}) { ->x : any ->{} : {} - - FIVE: ->FIVE : any - - for(var x in {}) { ->x : any ->{} : {} - - continue FOUR; ->FOUR : any - } -} - -for(var x in {}) { ->x : any ->{} : {} - - SIX: ->SIX : any - - for(var x in {}) continue SIX; ->x : any ->{} : {} ->SIX : any -} - -SEVEN: ->SEVEN : any - -for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; ->x : any ->{} : {} ->x : any ->{} : {} ->x : any ->{} : {} ->SEVEN : any - -EIGHT: ->EIGHT : any - -for (var x in {}){ ->x : any ->{} : {} - - var fn = function () { } ->fn : () => void ->function () { } : () => void - - continue EIGHT; ->EIGHT : any -} - diff --git a/tests/baselines/reference/forStatements.errors.txt b/tests/baselines/reference/forStatements.errors.txt new file mode 100644 index 0000000000000..5f1e6f10c7911 --- /dev/null +++ b/tests/baselines/reference/forStatements.errors.txt @@ -0,0 +1,52 @@ +tests/cases/conformance/statements/forStatements/forStatements.ts(26,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/forStatements/forStatements.ts (1 errors) ==== + interface I { + id: number; + } + + class C implements I { + id: number; + } + + class D{ + source: T; + recurse: D; + wrapped: D> + } + + function F(x: string): number { return 42; } + + module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } + } + + for(var aNumber: number = 9.9;;){} + for(var aString: string = 'this is a string';;){} + ~~~ +!!! error TS7027: Unreachable code detected. + for(var aDate: Date = new Date(12);;){} + for(var anObject: Object = new Object();;){} + + for(var anAny: any = null;;){} + for(var aSecondAny: any = undefined;;){} + for(var aVoid: void = undefined;;){} + + for(var anInterface: I = new C();;){} + for(var aClass: C = new C();;){} + for(var aGenericClass: D = new D();;){} + for(var anObjectLiteral: I = { id: 12 };;){} + for(var anOtherObjectLiteral: { id: number } = new C();;){} + + for(var aFunction: typeof F = F;;){} + for(var anOtherFunction: (x: string) => number = F;;){} + for(var aLambda: typeof F = (x) => 2;;){} + + for(var aModule: typeof M = M;;){} + for(var aClassInModule: M.A = new M.A();;){} + for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} \ No newline at end of file diff --git a/tests/baselines/reference/forStatements.symbols b/tests/baselines/reference/forStatements.symbols deleted file mode 100644 index 6f7c6d6cdbe3a..0000000000000 --- a/tests/baselines/reference/forStatements.symbols +++ /dev/null @@ -1,145 +0,0 @@ -=== tests/cases/conformance/statements/forStatements/forStatements.ts === -interface I { ->I : Symbol(I, Decl(forStatements.ts, 0, 0)) - - id: number; ->id : Symbol(id, Decl(forStatements.ts, 0, 13)) -} - -class C implements I { ->C : Symbol(C, Decl(forStatements.ts, 2, 1)) ->I : Symbol(I, Decl(forStatements.ts, 0, 0)) - - id: number; ->id : Symbol(id, Decl(forStatements.ts, 4, 22)) -} - -class D{ ->D : Symbol(D, Decl(forStatements.ts, 6, 1)) ->T : Symbol(T, Decl(forStatements.ts, 8, 8)) - - source: T; ->source : Symbol(source, Decl(forStatements.ts, 8, 11)) ->T : Symbol(T, Decl(forStatements.ts, 8, 8)) - - recurse: D; ->recurse : Symbol(recurse, Decl(forStatements.ts, 9, 14)) ->D : Symbol(D, Decl(forStatements.ts, 6, 1)) ->T : Symbol(T, Decl(forStatements.ts, 8, 8)) - - wrapped: D> ->wrapped : Symbol(wrapped, Decl(forStatements.ts, 10, 18)) ->D : Symbol(D, Decl(forStatements.ts, 6, 1)) ->D : Symbol(D, Decl(forStatements.ts, 6, 1)) ->T : Symbol(T, Decl(forStatements.ts, 8, 8)) -} - -function F(x: string): number { return 42; } ->F : Symbol(F, Decl(forStatements.ts, 12, 1)) ->x : Symbol(x, Decl(forStatements.ts, 14, 11)) - -module M { ->M : Symbol(M, Decl(forStatements.ts, 14, 44)) - - export class A { ->A : Symbol(A, Decl(forStatements.ts, 16, 10)) - - name: string; ->name : Symbol(name, Decl(forStatements.ts, 17, 20)) - } - - export function F2(x: number): string { return x.toString(); } ->F2 : Symbol(F2, Decl(forStatements.ts, 19, 5)) ->x : Symbol(x, Decl(forStatements.ts, 21, 23)) ->x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) ->x : Symbol(x, Decl(forStatements.ts, 21, 23)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) -} - -for(var aNumber: number = 9.9;;){} ->aNumber : Symbol(aNumber, Decl(forStatements.ts, 24, 7)) - -for(var aString: string = 'this is a string';;){} ->aString : Symbol(aString, Decl(forStatements.ts, 25, 7)) - -for(var aDate: Date = new Date(12);;){} ->aDate : Symbol(aDate, Decl(forStatements.ts, 26, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) - -for(var anObject: Object = new Object();;){} ->anObject : Symbol(anObject, Decl(forStatements.ts, 27, 7)) ->Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) ->Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) - -for(var anAny: any = null;;){} ->anAny : Symbol(anAny, Decl(forStatements.ts, 29, 7)) - -for(var aSecondAny: any = undefined;;){} ->aSecondAny : Symbol(aSecondAny, Decl(forStatements.ts, 30, 7)) ->undefined : Symbol(undefined) - -for(var aVoid: void = undefined;;){} ->aVoid : Symbol(aVoid, Decl(forStatements.ts, 31, 7)) ->undefined : Symbol(undefined) - -for(var anInterface: I = new C();;){} ->anInterface : Symbol(anInterface, Decl(forStatements.ts, 33, 7)) ->I : Symbol(I, Decl(forStatements.ts, 0, 0)) ->C : Symbol(C, Decl(forStatements.ts, 2, 1)) - -for(var aClass: C = new C();;){} ->aClass : Symbol(aClass, Decl(forStatements.ts, 34, 7)) ->C : Symbol(C, Decl(forStatements.ts, 2, 1)) ->C : Symbol(C, Decl(forStatements.ts, 2, 1)) - -for(var aGenericClass: D = new D();;){} ->aGenericClass : Symbol(aGenericClass, Decl(forStatements.ts, 35, 7)) ->D : Symbol(D, Decl(forStatements.ts, 6, 1)) ->D : Symbol(D, Decl(forStatements.ts, 6, 1)) - -for(var anObjectLiteral: I = { id: 12 };;){} ->anObjectLiteral : Symbol(anObjectLiteral, Decl(forStatements.ts, 36, 7)) ->I : Symbol(I, Decl(forStatements.ts, 0, 0)) ->id : Symbol(id, Decl(forStatements.ts, 36, 30)) - -for(var anOtherObjectLiteral: { id: number } = new C();;){} ->anOtherObjectLiteral : Symbol(anOtherObjectLiteral, Decl(forStatements.ts, 37, 7)) ->id : Symbol(id, Decl(forStatements.ts, 37, 31)) ->C : Symbol(C, Decl(forStatements.ts, 2, 1)) - -for(var aFunction: typeof F = F;;){} ->aFunction : Symbol(aFunction, Decl(forStatements.ts, 39, 7)) ->F : Symbol(F, Decl(forStatements.ts, 12, 1)) ->F : Symbol(F, Decl(forStatements.ts, 12, 1)) - -for(var anOtherFunction: (x: string) => number = F;;){} ->anOtherFunction : Symbol(anOtherFunction, Decl(forStatements.ts, 40, 7)) ->x : Symbol(x, Decl(forStatements.ts, 40, 26)) ->F : Symbol(F, Decl(forStatements.ts, 12, 1)) - -for(var aLambda: typeof F = (x) => 2;;){} ->aLambda : Symbol(aLambda, Decl(forStatements.ts, 41, 7)) ->F : Symbol(F, Decl(forStatements.ts, 12, 1)) ->x : Symbol(x, Decl(forStatements.ts, 41, 29)) - -for(var aModule: typeof M = M;;){} ->aModule : Symbol(aModule, Decl(forStatements.ts, 43, 7)) ->M : Symbol(M, Decl(forStatements.ts, 14, 44)) ->M : Symbol(M, Decl(forStatements.ts, 14, 44)) - -for(var aClassInModule: M.A = new M.A();;){} ->aClassInModule : Symbol(aClassInModule, Decl(forStatements.ts, 44, 7)) ->M : Symbol(M, Decl(forStatements.ts, 14, 44)) ->A : Symbol(M.A, Decl(forStatements.ts, 16, 10)) ->M.A : Symbol(M.A, Decl(forStatements.ts, 16, 10)) ->M : Symbol(M, Decl(forStatements.ts, 14, 44)) ->A : Symbol(M.A, Decl(forStatements.ts, 16, 10)) - -for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} ->aFunctionInModule : Symbol(aFunctionInModule, Decl(forStatements.ts, 45, 7)) ->M.F2 : Symbol(M.F2, Decl(forStatements.ts, 19, 5)) ->M : Symbol(M, Decl(forStatements.ts, 14, 44)) ->F2 : Symbol(M.F2, Decl(forStatements.ts, 19, 5)) ->x : Symbol(x, Decl(forStatements.ts, 45, 42)) - diff --git a/tests/baselines/reference/forStatements.types b/tests/baselines/reference/forStatements.types deleted file mode 100644 index 3fbcf2dbfb2f2..0000000000000 --- a/tests/baselines/reference/forStatements.types +++ /dev/null @@ -1,164 +0,0 @@ -=== tests/cases/conformance/statements/forStatements/forStatements.ts === -interface I { ->I : I - - id: number; ->id : number -} - -class C implements I { ->C : C ->I : I - - id: number; ->id : number -} - -class D{ ->D : D ->T : T - - source: T; ->source : T ->T : T - - recurse: D; ->recurse : D ->D : D ->T : T - - wrapped: D> ->wrapped : D> ->D : D ->D : D ->T : T -} - -function F(x: string): number { return 42; } ->F : (x: string) => number ->x : string ->42 : number - -module M { ->M : typeof M - - export class A { ->A : A - - name: string; ->name : string - } - - export function F2(x: number): string { return x.toString(); } ->F2 : (x: number) => string ->x : number ->x.toString() : string ->x.toString : (radix?: number) => string ->x : number ->toString : (radix?: number) => string -} - -for(var aNumber: number = 9.9;;){} ->aNumber : number ->9.9 : number - -for(var aString: string = 'this is a string';;){} ->aString : string ->'this is a string' : string - -for(var aDate: Date = new Date(12);;){} ->aDate : Date ->Date : Date ->new Date(12) : Date ->Date : DateConstructor ->12 : number - -for(var anObject: Object = new Object();;){} ->anObject : Object ->Object : Object ->new Object() : Object ->Object : ObjectConstructor - -for(var anAny: any = null;;){} ->anAny : any ->null : null - -for(var aSecondAny: any = undefined;;){} ->aSecondAny : any ->undefined : undefined - -for(var aVoid: void = undefined;;){} ->aVoid : void ->undefined : undefined - -for(var anInterface: I = new C();;){} ->anInterface : I ->I : I ->new C() : C ->C : typeof C - -for(var aClass: C = new C();;){} ->aClass : C ->C : C ->new C() : C ->C : typeof C - -for(var aGenericClass: D = new D();;){} ->aGenericClass : D ->D : D ->new D() : D ->D : typeof D - -for(var anObjectLiteral: I = { id: 12 };;){} ->anObjectLiteral : I ->I : I ->{ id: 12 } : { id: number; } ->id : number ->12 : number - -for(var anOtherObjectLiteral: { id: number } = new C();;){} ->anOtherObjectLiteral : { id: number; } ->id : number ->new C() : C ->C : typeof C - -for(var aFunction: typeof F = F;;){} ->aFunction : (x: string) => number ->F : (x: string) => number ->F : (x: string) => number - -for(var anOtherFunction: (x: string) => number = F;;){} ->anOtherFunction : (x: string) => number ->x : string ->F : (x: string) => number - -for(var aLambda: typeof F = (x) => 2;;){} ->aLambda : (x: string) => number ->F : (x: string) => number ->(x) => 2 : (x: string) => number ->x : string ->2 : number - -for(var aModule: typeof M = M;;){} ->aModule : typeof M ->M : typeof M ->M : typeof M - -for(var aClassInModule: M.A = new M.A();;){} ->aClassInModule : M.A ->M : any ->A : M.A ->new M.A() : M.A ->M.A : typeof M.A ->M : typeof M ->A : typeof M.A - -for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} ->aFunctionInModule : (x: number) => string ->M.F2 : (x: number) => string ->M : typeof M ->F2 : (x: number) => string ->(x) => 'this is a string' : (x: number) => string ->x : number ->'this is a string' : string - diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt index 53ecb88363df4..fa1c87824d7f4 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt @@ -1,3 +1,4 @@ +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(32,1): error TS7027: Unreachable code detected. 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'. @@ -12,7 +13,7 @@ tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDec 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) ==== +==== tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts (13 errors) ==== interface I { id: number; } @@ -45,6 +46,8 @@ tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDec // all of these are errors for( var a: any;;){} for( var a = 1;;){} + ~~~ +!!! error TS7027: Unreachable code detected. ~ !!! 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';;){} diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.errors.txt b/tests/baselines/reference/forStatementsMultipleValidDecl.errors.txt new file mode 100644 index 0000000000000..eb871af31c074 --- /dev/null +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.errors.txt @@ -0,0 +1,39 @@ +tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts(4,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts (1 errors) ==== + // all expected to be valid + + for (var x: number; ;) { } + for (var x = 2; ;) { } + ~~~ +!!! error TS7027: Unreachable code detected. + + for (var x = undefined; ;) { } + // new declaration space, making redeclaring x as a string valid + function declSpace() { + for (var x = 'this is a string'; ;) { } + } + interface Point { x: number; y: number; } + + for (var p: Point; ;) { } + for (var p = { x: 1, y: 2 }; ;) { } + for (var p: Point = { x: 0, y: undefined }; ;) { } + for (var p = { x: 1, y: undefined }; ;) { } + for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } + for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } + for (var p: typeof p; ;) { } + + for (var fn = function (s: string) { return 42; }; ;) { } + for (var fn = (s: string) => 3; ;) { } + for (var fn: (s: string) => number; ;) { } + for (var fn: { (s: string): number }; ;) { } + for (var fn = <(s: string) => number> null; ;) { } + for (var fn: typeof fn; ;) { } + + for (var a: string[]; ;) { } + for (var a = ['a', 'b']; ;) { } + for (var a = []; ;) { } + for (var a: string[] = []; ;) { } + for (var a = new Array(); ;) { } + for (var a: typeof a; ;) { } \ No newline at end of file diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.symbols b/tests/baselines/reference/forStatementsMultipleValidDecl.symbols deleted file mode 100644 index 6a98fbf133ea1..0000000000000 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.symbols +++ /dev/null @@ -1,110 +0,0 @@ -=== tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts === -// all expected to be valid - -for (var x: number; ;) { } ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 2, 8), Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 5, 8)) - -for (var x = 2; ;) { } ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 2, 8), Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 5, 8)) - -for (var x = undefined; ;) { } ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 2, 8), Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 5, 8)) ->undefined : Symbol(undefined) - -// new declaration space, making redeclaring x as a string valid -function declSpace() { ->declSpace : Symbol(declSpace, Decl(forStatementsMultipleValidDecl.ts, 5, 38)) - - for (var x = 'this is a string'; ;) { } ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 8, 12)) -} -interface Point { x: number; y: number; } ->Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 9, 1)) ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 10, 17)) ->y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 10, 28)) - -for (var p: Point; ;) { } ->p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) ->Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 9, 1)) - -for (var p = { x: 1, y: 2 }; ;) { } ->p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 13, 14)) ->y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 13, 20)) - -for (var p: Point = { x: 0, y: undefined }; ;) { } ->p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) ->Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 9, 1)) ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 14, 21)) ->y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 14, 27)) ->undefined : Symbol(undefined) - -for (var p = { x: 1, y: undefined }; ;) { } ->p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 15, 14)) ->y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 15, 20)) ->undefined : Symbol(undefined) - -for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } ->p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 16, 13)) ->y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 16, 24)) ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 16, 41)) ->y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 16, 47)) - -for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } ->p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 17, 15)) ->y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 17, 26)) ->x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 17, 41)) ->y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 17, 47)) ->undefined : Symbol(undefined) - -for (var p: typeof p; ;) { } ->p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) ->p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) - -for (var fn = function (s: string) { return 42; }; ;) { } ->fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) ->s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 20, 24)) - -for (var fn = (s: string) => 3; ;) { } ->fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) ->s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 21, 15)) - -for (var fn: (s: string) => number; ;) { } ->fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) ->s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 22, 14)) - -for (var fn: { (s: string): number }; ;) { } ->fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) ->s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 23, 16)) - -for (var fn = <(s: string) => number> null; ;) { } ->fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) ->s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 24, 16)) - -for (var fn: typeof fn; ;) { } ->fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) ->fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) - -for (var a: string[]; ;) { } ->a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) - -for (var a = ['a', 'b']; ;) { } ->a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) - -for (var a = []; ;) { } ->a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) - -for (var a: string[] = []; ;) { } ->a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) - -for (var a = new Array(); ;) { } ->a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) - -for (var a: typeof a; ;) { } ->a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) ->a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) - diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.types b/tests/baselines/reference/forStatementsMultipleValidDecl.types deleted file mode 100644 index 9b9af5b850e02..0000000000000 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.types +++ /dev/null @@ -1,140 +0,0 @@ -=== tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts === -// all expected to be valid - -for (var x: number; ;) { } ->x : number - -for (var x = 2; ;) { } ->x : number ->2 : number - -for (var x = undefined; ;) { } ->x : number ->undefined : number ->undefined : undefined - -// new declaration space, making redeclaring x as a string valid -function declSpace() { ->declSpace : () => void - - for (var x = 'this is a string'; ;) { } ->x : string ->'this is a string' : string -} -interface Point { x: number; y: number; } ->Point : Point ->x : number ->y : number - -for (var p: Point; ;) { } ->p : Point ->Point : Point - -for (var p = { x: 1, y: 2 }; ;) { } ->p : Point ->{ x: 1, y: 2 } : { x: number; y: number; } ->x : number ->1 : number ->y : number ->2 : number - -for (var p: Point = { x: 0, y: undefined }; ;) { } ->p : Point ->Point : Point ->{ x: 0, y: undefined } : { x: number; y: undefined; } ->x : number ->0 : number ->y : undefined ->undefined : undefined - -for (var p = { x: 1, y: undefined }; ;) { } ->p : Point ->{ x: 1, y: undefined } : { x: number; y: number; } ->x : number ->1 : number ->y : number ->undefined : number ->undefined : undefined - -for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } ->p : Point ->x : number ->y : number ->{ x: 1, y: 2 } : { x: number; y: number; } ->x : number ->1 : number ->y : number ->2 : number - -for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } ->p : Point -><{ x: number; y: number; }>{ x: 0, y: undefined } : { x: number; y: number; } ->x : number ->y : number ->{ x: 0, y: undefined } : { x: number; y: undefined; } ->x : number ->0 : number ->y : undefined ->undefined : undefined - -for (var p: typeof p; ;) { } ->p : Point ->p : Point - -for (var fn = function (s: string) { return 42; }; ;) { } ->fn : (s: string) => number ->function (s: string) { return 42; } : (s: string) => number ->s : string ->42 : number - -for (var fn = (s: string) => 3; ;) { } ->fn : (s: string) => number ->(s: string) => 3 : (s: string) => number ->s : string ->3 : number - -for (var fn: (s: string) => number; ;) { } ->fn : (s: string) => number ->s : string - -for (var fn: { (s: string): number }; ;) { } ->fn : (s: string) => number ->s : string - -for (var fn = <(s: string) => number> null; ;) { } ->fn : (s: string) => number -><(s: string) => number> null : (s: string) => number ->s : string ->null : null - -for (var fn: typeof fn; ;) { } ->fn : (s: string) => number ->fn : (s: string) => number - -for (var a: string[]; ;) { } ->a : string[] - -for (var a = ['a', 'b']; ;) { } ->a : string[] ->['a', 'b'] : string[] ->'a' : string ->'b' : string - -for (var a = []; ;) { } ->a : string[] ->[] : string[] ->[] : undefined[] - -for (var a: string[] = []; ;) { } ->a : string[] ->[] : undefined[] - -for (var a = new Array(); ;) { } ->a : string[] ->new Array() : string[] ->Array : ArrayConstructor - -for (var a: typeof a; ;) { } ->a : string[] ->a : string[] - diff --git a/tests/baselines/reference/functionImplementationErrors.errors.txt b/tests/baselines/reference/functionImplementationErrors.errors.txt index 1ab438e340bbd..bde939a15786b 100644 --- a/tests/baselines/reference/functionImplementationErrors.errors.txt +++ b/tests/baselines/reference/functionImplementationErrors.errors.txt @@ -1,31 +1,46 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(2,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(4,5): error TS7027: Unreachable code detected. tests/cases/conformance/functions/functionImplementationErrors.ts(6,19): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(8,5): error TS7027: Unreachable code detected. tests/cases/conformance/functions/functionImplementationErrors.ts(10,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(12,5): error TS7027: Unreachable code detected. tests/cases/conformance/functions/functionImplementationErrors.ts(16,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(20,9): error TS7027: Unreachable code detected. tests/cases/conformance/functions/functionImplementationErrors.ts(25,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/functions/functionImplementationErrors.ts(30,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. tests/cases/conformance/functions/functionImplementationErrors.ts(35,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. +tests/cases/conformance/functions/functionImplementationErrors.ts(42,5): error TS7027: Unreachable code detected. tests/cases/conformance/functions/functionImplementationErrors.ts(49,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(51,5): error TS7027: Unreachable code detected. tests/cases/conformance/functions/functionImplementationErrors.ts(53,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(55,5): error TS7027: Unreachable code detected. tests/cases/conformance/functions/functionImplementationErrors.ts(57,11): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(59,5): error TS7027: Unreachable code detected. tests/cases/conformance/functions/functionImplementationErrors.ts(61,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(63,5): error TS7027: Unreachable code detected. tests/cases/conformance/functions/functionImplementationErrors.ts(65,11): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(67,5): error TS7027: Unreachable code detected. tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(71,5): error TS7027: Unreachable code detected. -==== tests/cases/conformance/functions/functionImplementationErrors.ts (13 errors) ==== +==== tests/cases/conformance/functions/functionImplementationErrors.ts (24 errors) ==== // FunctionExpression with no return type annotation with multiple return statements with unrelated types var f1 = function () { ~~~~~~~~ !!! error TS2354: No best common type exists among return expressions. return ''; return 3; + ~~~~~~ +!!! error TS7027: Unreachable code detected. }; var f2 = function x() { ~ !!! error TS2354: No best common type exists among return expressions. return ''; return 3; + ~~~~~~ +!!! error TS7027: Unreachable code detected. }; var f3 = () => { ~~~~~~~ @@ -33,6 +48,8 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error ~~~~~~~~~~~~~~ return 3; ~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS7027: Unreachable code detected. }; ~ !!! error TS2354: No best common type exists among return expressions. @@ -45,6 +62,8 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error return ['']; } else { return [1]; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } @@ -73,6 +92,8 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error undefined === function (): number { throw undefined; var x = 4; + ~~~ +!!! error TS7027: Unreachable code detected. }; class Base { private x; } @@ -84,12 +105,16 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error !!! error TS2354: No best common type exists among return expressions. return new Derived1(); return new Derived2(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. } var f9 = function () { ~~~~~~~~ !!! error TS2354: No best common type exists among return expressions. return new Derived1(); return new Derived2(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. }; var f10 = () => { ~~~~~~~ @@ -97,6 +122,8 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error ~~~~~~~~~~~~~~~~~~~~~~~~~~ return new Derived2(); ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS7027: Unreachable code detected. }; ~ !!! error TS2354: No best common type exists among return expressions. @@ -105,12 +132,16 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error !!! error TS2354: No best common type exists among return expressions. return new Base(); return new AnotherClass(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. } var f12 = function () { ~~~~~~~~ !!! error TS2354: No best common type exists among return expressions. return new Base(); return new AnotherClass(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. }; var f13 = () => { ~~~~~~~ @@ -118,6 +149,8 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error ~~~~~~~~~~~~~~~~~~~~~~ return new AnotherClass(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS7027: Unreachable code detected. }; ~ !!! error TS2354: No best common type exists among return expressions. diff --git a/tests/baselines/reference/functionImplementations.errors.txt b/tests/baselines/reference/functionImplementations.errors.txt new file mode 100644 index 0000000000000..f3e4d6404c66f --- /dev/null +++ b/tests/baselines/reference/functionImplementations.errors.txt @@ -0,0 +1,183 @@ +tests/cases/conformance/functions/functionImplementations.ts(69,5): error TS7027: Unreachable code detected. +tests/cases/conformance/functions/functionImplementations.ts(81,24): error TS7027: Unreachable code detected. +tests/cases/conformance/functions/functionImplementations.ts(86,24): error TS7027: Unreachable code detected. +tests/cases/conformance/functions/functionImplementations.ts(137,5): error TS7027: Unreachable code detected. +tests/cases/conformance/functions/functionImplementations.ts(141,5): error TS7027: Unreachable code detected. +tests/cases/conformance/functions/functionImplementations.ts(146,5): error TS7027: Unreachable code detected. +tests/cases/conformance/functions/functionImplementations.ts(150,5): error TS7027: Unreachable code detected. +tests/cases/conformance/functions/functionImplementations.ts(154,5): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/functions/functionImplementations.ts (8 errors) ==== + // FunctionExpression with no return type annotation and no return statement returns void + var v: void = function () { } (); + + // FunctionExpression f with no return type annotation and directly references f in its body returns any + var a: any = function f() { + return f; + }; + var a: any = function f() { + return f(); + }; + + // FunctionExpression f with no return type annotation and indirectly references f in its body returns any + var a: any = function f() { + var x = f; + return x; + }; + + // Two mutually recursive function implementations with no return type annotations + function rec1() { + return rec2(); + } + function rec2() { + return rec1(); + } + var a = rec1(); + var a = rec2(); + + // Two mutually recursive function implementations with return type annotation in one + function rec3(): number { + return rec4(); + } + function rec4() { + return rec3(); + } + var n: number; + var n = rec3(); + var n = rec4(); + + // FunctionExpression with no return type annotation and returns a number + var n = function () { + return 3; + } (); + + // FunctionExpression with no return type annotation and returns null + var nu = null; + var nu = function () { + return null; + } (); + + // FunctionExpression with no return type annotation and returns undefined + var un = undefined; + var un = function () { + return undefined; + } (); + + // FunctionExpression with no return type annotation and returns a type parameter type + var n = function (x: T) { + return x; + } (4); + + // FunctionExpression with no return type annotation and returns a constrained type parameter type + var n = function (x: T) { + return x; + } (4); + + // FunctionExpression with no return type annotation with multiple return statements with identical types + var n = function () { + return 3; + return 5; + ~~~~~~ +!!! error TS7027: Unreachable code detected. + }(); + + // Otherwise, the inferred return type is the first of the types of the return statement expressions + // in the function body that is a supertype of each of the others, + // ignoring return statements with no expressions. + // A compile - time error occurs if no return statement expression has a type that is a supertype of each of the others. + // FunctionExpression with no return type annotation with multiple return statements with subtype relation between returns + class Base { private m; } + class Derived extends Base { private q; } + var b: Base; + var b = function () { + return new Base(); return new Derived(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } (); + + // FunctionExpression with no return type annotation with multiple return statements with one a recursive call + var a = function f() { + return new Base(); return new Derived(); return f(); // ? + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } (); + + // FunctionExpression with non -void return type annotation with a single throw statement + undefined === function (): number { + throw undefined; + }; + + // Type of 'this' in function implementation is 'any' + function thisFunc() { + var x = this; + var x: any; + } + + // Function signature with optional parameter, no type annotation and initializer has initializer's type + function opt1(n = 4) { + var m = n; + var m: number; + } + + // Function signature with optional parameter, no type annotation and initializer has initializer's widened type + function opt2(n = { x: null, y: undefined }) { + var m = n; + var m: { x: any; y: any }; + } + + // Function signature with initializer referencing other parameter to the left + function opt3(n: number, m = n) { + var y = m; + var y: number; + } + + // Function signature with optional parameter has correct codegen + // (tested above) + + // FunctionExpression with non -void return type annotation return with no expression + function f6(): number { + return; + } + + class Derived2 extends Base { private r: string; } + class AnotherClass { private x } + // if f is a contextually typed function expression, the inferred return type is the union type + // of the types of the return statement expressions in the function body, + // ignoring return statements with no expressions. + var f7: (x: number) => string | number = x => { // should be (x: number) => number | string + if (x < 0) { return x; } + return x.toString(); + } + var f8: (x: number) => any = x => { // should be (x: number) => Base + return new Base(); + return new Derived2(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } + var f9: (x: number) => any = x => { // should be (x: number) => Base + return new Base(); + return new Derived(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. + return new Derived2(); + } + var f10: (x: number) => any = x => { // should be (x: number) => Derived | Derived1 + return new Derived(); + return new Derived2(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } + var f11: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass + return new Base(); + return new AnotherClass(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } + var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass + return new Base(); + return; // should be ignored + ~~~~~~ +!!! error TS7027: Unreachable code detected. + return new AnotherClass(); + } \ No newline at end of file diff --git a/tests/baselines/reference/functionImplementations.symbols b/tests/baselines/reference/functionImplementations.symbols deleted file mode 100644 index f9205f3765077..0000000000000 --- a/tests/baselines/reference/functionImplementations.symbols +++ /dev/null @@ -1,344 +0,0 @@ -=== tests/cases/conformance/functions/functionImplementations.ts === -// FunctionExpression with no return type annotation and no return statement returns void -var v: void = function () { } (); ->v : Symbol(v, Decl(functionImplementations.ts, 1, 3)) - -// FunctionExpression f with no return type annotation and directly references f in its body returns any -var a: any = function f() { ->a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) ->f : Symbol(f, Decl(functionImplementations.ts, 4, 12)) - - return f; ->f : Symbol(f, Decl(functionImplementations.ts, 4, 12)) - -}; -var a: any = function f() { ->a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) ->f : Symbol(f, Decl(functionImplementations.ts, 7, 12)) - - return f(); ->f : Symbol(f, Decl(functionImplementations.ts, 7, 12)) - -}; - -// FunctionExpression f with no return type annotation and indirectly references f in its body returns any -var a: any = function f() { ->a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) ->f : Symbol(f, Decl(functionImplementations.ts, 12, 12)) - - var x = f; ->x : Symbol(x, Decl(functionImplementations.ts, 13, 7)) ->f : Symbol(f, Decl(functionImplementations.ts, 12, 12)) - - return x; ->x : Symbol(x, Decl(functionImplementations.ts, 13, 7)) - -}; - -// Two mutually recursive function implementations with no return type annotations -function rec1() { ->rec1 : Symbol(rec1, Decl(functionImplementations.ts, 15, 2)) - - return rec2(); ->rec2 : Symbol(rec2, Decl(functionImplementations.ts, 20, 1)) -} -function rec2() { ->rec2 : Symbol(rec2, Decl(functionImplementations.ts, 20, 1)) - - return rec1(); ->rec1 : Symbol(rec1, Decl(functionImplementations.ts, 15, 2)) -} -var a = rec1(); ->a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) ->rec1 : Symbol(rec1, Decl(functionImplementations.ts, 15, 2)) - -var a = rec2(); ->a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) ->rec2 : Symbol(rec2, Decl(functionImplementations.ts, 20, 1)) - -// Two mutually recursive function implementations with return type annotation in one -function rec3(): number { ->rec3 : Symbol(rec3, Decl(functionImplementations.ts, 25, 15)) - - return rec4(); ->rec4 : Symbol(rec4, Decl(functionImplementations.ts, 30, 1)) -} -function rec4() { ->rec4 : Symbol(rec4, Decl(functionImplementations.ts, 30, 1)) - - return rec3(); ->rec3 : Symbol(rec3, Decl(functionImplementations.ts, 25, 15)) -} -var n: number; ->n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) - -var n = rec3(); ->n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) ->rec3 : Symbol(rec3, Decl(functionImplementations.ts, 25, 15)) - -var n = rec4(); ->n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) ->rec4 : Symbol(rec4, Decl(functionImplementations.ts, 30, 1)) - -// FunctionExpression with no return type annotation and returns a number -var n = function () { ->n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) - - return 3; -} (); - -// FunctionExpression with no return type annotation and returns null -var nu = null; ->nu : Symbol(nu, Decl(functionImplementations.ts, 44, 3), Decl(functionImplementations.ts, 45, 3)) - -var nu = function () { ->nu : Symbol(nu, Decl(functionImplementations.ts, 44, 3), Decl(functionImplementations.ts, 45, 3)) - - return null; -} (); - -// FunctionExpression with no return type annotation and returns undefined -var un = undefined; ->un : Symbol(un, Decl(functionImplementations.ts, 50, 3), Decl(functionImplementations.ts, 51, 3)) ->undefined : Symbol(undefined) - -var un = function () { ->un : Symbol(un, Decl(functionImplementations.ts, 50, 3), Decl(functionImplementations.ts, 51, 3)) - - return undefined; ->undefined : Symbol(undefined) - -} (); - -// FunctionExpression with no return type annotation and returns a type parameter type -var n = function (x: T) { ->n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) ->T : Symbol(T, Decl(functionImplementations.ts, 56, 18)) ->x : Symbol(x, Decl(functionImplementations.ts, 56, 21)) ->T : Symbol(T, Decl(functionImplementations.ts, 56, 18)) - - return x; ->x : Symbol(x, Decl(functionImplementations.ts, 56, 21)) - -} (4); - -// FunctionExpression with no return type annotation and returns a constrained type parameter type -var n = function (x: T) { ->n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) ->T : Symbol(T, Decl(functionImplementations.ts, 61, 18)) ->x : Symbol(x, Decl(functionImplementations.ts, 61, 32)) ->T : Symbol(T, Decl(functionImplementations.ts, 61, 18)) - - return x; ->x : Symbol(x, Decl(functionImplementations.ts, 61, 32)) - -} (4); - -// FunctionExpression with no return type annotation with multiple return statements with identical types -var n = function () { ->n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) - - return 3; - return 5; -}(); - -// Otherwise, the inferred return type is the first of the types of the return statement expressions -// in the function body that is a supertype of each of the others, -// ignoring return statements with no expressions. -// A compile - time error occurs if no return statement expression has a type that is a supertype of each of the others. -// FunctionExpression with no return type annotation with multiple return statements with subtype relation between returns -class Base { private m; } ->Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) ->m : Symbol(m, Decl(functionImplementations.ts, 76, 12)) - -class Derived extends Base { private q; } ->Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) ->Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) ->q : Symbol(q, Decl(functionImplementations.ts, 77, 28)) - -var b: Base; ->b : Symbol(b, Decl(functionImplementations.ts, 78, 3), Decl(functionImplementations.ts, 79, 3)) ->Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) - -var b = function () { ->b : Symbol(b, Decl(functionImplementations.ts, 78, 3), Decl(functionImplementations.ts, 79, 3)) - - return new Base(); return new Derived(); ->Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) ->Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) - -} (); - -// FunctionExpression with no return type annotation with multiple return statements with one a recursive call -var a = function f() { ->a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) ->f : Symbol(f, Decl(functionImplementations.ts, 84, 7)) - - return new Base(); return new Derived(); return f(); // ? ->Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) ->Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) ->f : Symbol(f, Decl(functionImplementations.ts, 84, 7)) - -} (); - -// FunctionExpression with non -void return type annotation with a single throw statement -undefined === function (): number { ->undefined : Symbol(undefined) - - throw undefined; ->undefined : Symbol(undefined) - -}; - -// Type of 'this' in function implementation is 'any' -function thisFunc() { ->thisFunc : Symbol(thisFunc, Decl(functionImplementations.ts, 91, 2)) - - var x = this; ->x : Symbol(x, Decl(functionImplementations.ts, 95, 7), Decl(functionImplementations.ts, 96, 7)) - - var x: any; ->x : Symbol(x, Decl(functionImplementations.ts, 95, 7), Decl(functionImplementations.ts, 96, 7)) -} - -// Function signature with optional parameter, no type annotation and initializer has initializer's type -function opt1(n = 4) { ->opt1 : Symbol(opt1, Decl(functionImplementations.ts, 97, 1)) ->n : Symbol(n, Decl(functionImplementations.ts, 100, 14)) - - var m = n; ->m : Symbol(m, Decl(functionImplementations.ts, 101, 7), Decl(functionImplementations.ts, 102, 7)) ->n : Symbol(n, Decl(functionImplementations.ts, 100, 14)) - - var m: number; ->m : Symbol(m, Decl(functionImplementations.ts, 101, 7), Decl(functionImplementations.ts, 102, 7)) -} - -// Function signature with optional parameter, no type annotation and initializer has initializer's widened type -function opt2(n = { x: null, y: undefined }) { ->opt2 : Symbol(opt2, Decl(functionImplementations.ts, 103, 1)) ->n : Symbol(n, Decl(functionImplementations.ts, 106, 14)) ->x : Symbol(x, Decl(functionImplementations.ts, 106, 19)) ->y : Symbol(y, Decl(functionImplementations.ts, 106, 28)) ->undefined : Symbol(undefined) - - var m = n; ->m : Symbol(m, Decl(functionImplementations.ts, 107, 7), Decl(functionImplementations.ts, 108, 7)) ->n : Symbol(n, Decl(functionImplementations.ts, 106, 14)) - - var m: { x: any; y: any }; ->m : Symbol(m, Decl(functionImplementations.ts, 107, 7), Decl(functionImplementations.ts, 108, 7)) ->x : Symbol(x, Decl(functionImplementations.ts, 108, 12)) ->y : Symbol(y, Decl(functionImplementations.ts, 108, 20)) -} - -// Function signature with initializer referencing other parameter to the left -function opt3(n: number, m = n) { ->opt3 : Symbol(opt3, Decl(functionImplementations.ts, 109, 1)) ->n : Symbol(n, Decl(functionImplementations.ts, 112, 14)) ->m : Symbol(m, Decl(functionImplementations.ts, 112, 24)) ->n : Symbol(n, Decl(functionImplementations.ts, 112, 14)) - - var y = m; ->y : Symbol(y, Decl(functionImplementations.ts, 113, 7), Decl(functionImplementations.ts, 114, 7)) ->m : Symbol(m, Decl(functionImplementations.ts, 112, 24)) - - var y: number; ->y : Symbol(y, Decl(functionImplementations.ts, 113, 7), Decl(functionImplementations.ts, 114, 7)) -} - -// Function signature with optional parameter has correct codegen -// (tested above) - -// FunctionExpression with non -void return type annotation return with no expression -function f6(): number { ->f6 : Symbol(f6, Decl(functionImplementations.ts, 115, 1)) - - return; -} - -class Derived2 extends Base { private r: string; } ->Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) ->Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) ->r : Symbol(r, Decl(functionImplementations.ts, 125, 29)) - -class AnotherClass { private x } ->AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 125, 50)) ->x : Symbol(x, Decl(functionImplementations.ts, 126, 20)) - -// if f is a contextually typed function expression, the inferred return type is the union type -// of the types of the return statement expressions in the function body, -// ignoring return statements with no expressions. -var f7: (x: number) => string | number = x => { // should be (x: number) => number | string ->f7 : Symbol(f7, Decl(functionImplementations.ts, 130, 3)) ->x : Symbol(x, Decl(functionImplementations.ts, 130, 9)) ->x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) - - if (x < 0) { return x; } ->x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) ->x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) - - return x.toString(); ->x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) ->x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) -} -var f8: (x: number) => any = x => { // should be (x: number) => Base ->f8 : Symbol(f8, Decl(functionImplementations.ts, 134, 3)) ->x : Symbol(x, Decl(functionImplementations.ts, 134, 9)) ->x : Symbol(x, Decl(functionImplementations.ts, 134, 28)) - - return new Base(); ->Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) - - return new Derived2(); ->Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) -} -var f9: (x: number) => any = x => { // should be (x: number) => Base ->f9 : Symbol(f9, Decl(functionImplementations.ts, 138, 3)) ->x : Symbol(x, Decl(functionImplementations.ts, 138, 9)) ->x : Symbol(x, Decl(functionImplementations.ts, 138, 28)) - - return new Base(); ->Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) - - return new Derived(); ->Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) - - return new Derived2(); ->Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) -} -var f10: (x: number) => any = x => { // should be (x: number) => Derived | Derived1 ->f10 : Symbol(f10, Decl(functionImplementations.ts, 143, 3)) ->x : Symbol(x, Decl(functionImplementations.ts, 143, 10)) ->x : Symbol(x, Decl(functionImplementations.ts, 143, 29)) - - return new Derived(); ->Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) - - return new Derived2(); ->Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) -} -var f11: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass ->f11 : Symbol(f11, Decl(functionImplementations.ts, 147, 3)) ->x : Symbol(x, Decl(functionImplementations.ts, 147, 10)) ->x : Symbol(x, Decl(functionImplementations.ts, 147, 29)) - - return new Base(); ->Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) - - return new AnotherClass(); ->AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 125, 50)) -} -var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass ->f12 : Symbol(f12, Decl(functionImplementations.ts, 151, 3)) ->x : Symbol(x, Decl(functionImplementations.ts, 151, 10)) ->x : Symbol(x, Decl(functionImplementations.ts, 151, 29)) - - return new Base(); ->Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) - - return; // should be ignored - return new AnotherClass(); ->AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 125, 50)) -} diff --git a/tests/baselines/reference/functionImplementations.types b/tests/baselines/reference/functionImplementations.types deleted file mode 100644 index 1398e2974f09b..0000000000000 --- a/tests/baselines/reference/functionImplementations.types +++ /dev/null @@ -1,416 +0,0 @@ -=== tests/cases/conformance/functions/functionImplementations.ts === -// FunctionExpression with no return type annotation and no return statement returns void -var v: void = function () { } (); ->v : void ->function () { } () : void ->function () { } : () => void - -// FunctionExpression f with no return type annotation and directly references f in its body returns any -var a: any = function f() { ->a : any ->function f() { return f;} : () => any ->f : () => any - - return f; ->f : () => any - -}; -var a: any = function f() { ->a : any ->function f() { return f();} : () => any ->f : () => any - - return f(); ->f() : any ->f : () => any - -}; - -// FunctionExpression f with no return type annotation and indirectly references f in its body returns any -var a: any = function f() { ->a : any ->function f() { var x = f; return x;} : () => any ->f : () => any - - var x = f; ->x : () => any ->f : () => any - - return x; ->x : () => any - -}; - -// Two mutually recursive function implementations with no return type annotations -function rec1() { ->rec1 : () => any - - return rec2(); ->rec2() : any ->rec2 : () => any -} -function rec2() { ->rec2 : () => any - - return rec1(); ->rec1() : any ->rec1 : () => any -} -var a = rec1(); ->a : any ->rec1() : any ->rec1 : () => any - -var a = rec2(); ->a : any ->rec2() : any ->rec2 : () => any - -// Two mutually recursive function implementations with return type annotation in one -function rec3(): number { ->rec3 : () => number - - return rec4(); ->rec4() : number ->rec4 : () => number -} -function rec4() { ->rec4 : () => number - - return rec3(); ->rec3() : number ->rec3 : () => number -} -var n: number; ->n : number - -var n = rec3(); ->n : number ->rec3() : number ->rec3 : () => number - -var n = rec4(); ->n : number ->rec4() : number ->rec4 : () => number - -// FunctionExpression with no return type annotation and returns a number -var n = function () { ->n : number ->function () { return 3;} () : number ->function () { return 3;} : () => number - - return 3; ->3 : number - -} (); - -// FunctionExpression with no return type annotation and returns null -var nu = null; ->nu : any ->null : null - -var nu = function () { ->nu : any ->function () { return null;} () : any ->function () { return null;} : () => any - - return null; ->null : null - -} (); - -// FunctionExpression with no return type annotation and returns undefined -var un = undefined; ->un : any ->undefined : undefined - -var un = function () { ->un : any ->function () { return undefined;} () : any ->function () { return undefined;} : () => any - - return undefined; ->undefined : undefined - -} (); - -// FunctionExpression with no return type annotation and returns a type parameter type -var n = function (x: T) { ->n : number ->function (x: T) { return x;} (4) : number ->function (x: T) { return x;} : (x: T) => T ->T : T ->x : T ->T : T - - return x; ->x : T - -} (4); ->4 : number - -// FunctionExpression with no return type annotation and returns a constrained type parameter type -var n = function (x: T) { ->n : number ->function (x: T) { return x;} (4) : number ->function (x: T) { return x;} : (x: T) => T ->T : T ->x : T ->T : T - - return x; ->x : T - -} (4); ->4 : number - -// FunctionExpression with no return type annotation with multiple return statements with identical types -var n = function () { ->n : number ->function () { return 3; return 5;}() : number ->function () { return 3; return 5;} : () => number - - return 3; ->3 : number - - return 5; ->5 : number - -}(); - -// Otherwise, the inferred return type is the first of the types of the return statement expressions -// in the function body that is a supertype of each of the others, -// ignoring return statements with no expressions. -// A compile - time error occurs if no return statement expression has a type that is a supertype of each of the others. -// FunctionExpression with no return type annotation with multiple return statements with subtype relation between returns -class Base { private m; } ->Base : Base ->m : any - -class Derived extends Base { private q; } ->Derived : Derived ->Base : Base ->q : any - -var b: Base; ->b : Base ->Base : Base - -var b = function () { ->b : Base ->function () { return new Base(); return new Derived();} () : Base ->function () { return new Base(); return new Derived();} : () => Base - - return new Base(); return new Derived(); ->new Base() : Base ->Base : typeof Base ->new Derived() : Derived ->Derived : typeof Derived - -} (); - -// FunctionExpression with no return type annotation with multiple return statements with one a recursive call -var a = function f() { ->a : any ->function f() { return new Base(); return new Derived(); return f(); // ?} () : any ->function f() { return new Base(); return new Derived(); return f(); // ?} : () => any ->f : () => any - - return new Base(); return new Derived(); return f(); // ? ->new Base() : Base ->Base : typeof Base ->new Derived() : Derived ->Derived : typeof Derived ->f() : any ->f : () => any - -} (); - -// FunctionExpression with non -void return type annotation with a single throw statement -undefined === function (): number { ->undefined === function (): number { throw undefined;} : boolean ->undefined : undefined ->function (): number { throw undefined;} : () => number - - throw undefined; ->undefined : undefined - -}; - -// Type of 'this' in function implementation is 'any' -function thisFunc() { ->thisFunc : () => void - - var x = this; ->x : any ->this : any - - var x: any; ->x : any -} - -// Function signature with optional parameter, no type annotation and initializer has initializer's type -function opt1(n = 4) { ->opt1 : (n?: number) => void ->n : number ->4 : number - - var m = n; ->m : number ->n : number - - var m: number; ->m : number -} - -// Function signature with optional parameter, no type annotation and initializer has initializer's widened type -function opt2(n = { x: null, y: undefined }) { ->opt2 : (n?: { x: any; y: any; }) => void ->n : { x: any; y: any; } ->{ x: null, y: undefined } : { x: null; y: undefined; } ->x : null ->null : null ->y : undefined ->undefined : undefined - - var m = n; ->m : { x: any; y: any; } ->n : { x: any; y: any; } - - var m: { x: any; y: any }; ->m : { x: any; y: any; } ->x : any ->y : any -} - -// Function signature with initializer referencing other parameter to the left -function opt3(n: number, m = n) { ->opt3 : (n: number, m?: number) => void ->n : number ->m : number ->n : number - - var y = m; ->y : number ->m : number - - var y: number; ->y : number -} - -// Function signature with optional parameter has correct codegen -// (tested above) - -// FunctionExpression with non -void return type annotation return with no expression -function f6(): number { ->f6 : () => number - - return; -} - -class Derived2 extends Base { private r: string; } ->Derived2 : Derived2 ->Base : Base ->r : string - -class AnotherClass { private x } ->AnotherClass : AnotherClass ->x : any - -// if f is a contextually typed function expression, the inferred return type is the union type -// of the types of the return statement expressions in the function body, -// ignoring return statements with no expressions. -var f7: (x: number) => string | number = x => { // should be (x: number) => number | string ->f7 : (x: number) => string | number ->x : number ->x => { // should be (x: number) => number | string if (x < 0) { return x; } return x.toString();} : (x: number) => number | string ->x : number - - if (x < 0) { return x; } ->x < 0 : boolean ->x : number ->0 : number ->x : number - - return x.toString(); ->x.toString() : string ->x.toString : (radix?: number) => string ->x : number ->toString : (radix?: number) => string -} -var f8: (x: number) => any = x => { // should be (x: number) => Base ->f8 : (x: number) => any ->x : number ->x => { // should be (x: number) => Base return new Base(); return new Derived2();} : (x: number) => Base ->x : number - - return new Base(); ->new Base() : Base ->Base : typeof Base - - return new Derived2(); ->new Derived2() : Derived2 ->Derived2 : typeof Derived2 -} -var f9: (x: number) => any = x => { // should be (x: number) => Base ->f9 : (x: number) => any ->x : number ->x => { // should be (x: number) => Base return new Base(); return new Derived(); return new Derived2();} : (x: number) => Base ->x : number - - return new Base(); ->new Base() : Base ->Base : typeof Base - - return new Derived(); ->new Derived() : Derived ->Derived : typeof Derived - - return new Derived2(); ->new Derived2() : Derived2 ->Derived2 : typeof Derived2 -} -var f10: (x: number) => any = x => { // should be (x: number) => Derived | Derived1 ->f10 : (x: number) => any ->x : number ->x => { // should be (x: number) => Derived | Derived1 return new Derived(); return new Derived2();} : (x: number) => Derived | Derived2 ->x : number - - return new Derived(); ->new Derived() : Derived ->Derived : typeof Derived - - return new Derived2(); ->new Derived2() : Derived2 ->Derived2 : typeof Derived2 -} -var f11: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass ->f11 : (x: number) => any ->x : number ->x => { // should be (x: number) => Base | AnotherClass return new Base(); return new AnotherClass();} : (x: number) => Base | AnotherClass ->x : number - - return new Base(); ->new Base() : Base ->Base : typeof Base - - return new AnotherClass(); ->new AnotherClass() : AnotherClass ->AnotherClass : typeof AnotherClass -} -var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass ->f12 : (x: number) => any ->x : number ->x => { // should be (x: number) => Base | AnotherClass return new Base(); return; // should be ignored return new AnotherClass();} : (x: number) => Base | AnotherClass ->x : number - - return new Base(); ->new Base() : Base ->Base : typeof Base - - return; // should be ignored - return new AnotherClass(); ->new AnotherClass() : AnotherClass ->AnotherClass : typeof AnotherClass -} diff --git a/tests/baselines/reference/functionOverloads12.errors.txt b/tests/baselines/reference/functionOverloads12.errors.txt new file mode 100644 index 0000000000000..fac5cd71afe72 --- /dev/null +++ b/tests/baselines/reference/functionOverloads12.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/functionOverloads12.ts(3,48): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/functionOverloads12.ts (1 errors) ==== + function foo():string; + function foo():number; + function foo():any { if (true) return ""; else return 0;} + ~~~~~~ +!!! error TS7027: Unreachable code detected. + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads12.symbols b/tests/baselines/reference/functionOverloads12.symbols deleted file mode 100644 index 583e7f5c04572..0000000000000 --- a/tests/baselines/reference/functionOverloads12.symbols +++ /dev/null @@ -1,10 +0,0 @@ -=== tests/cases/compiler/functionOverloads12.ts === -function foo():string; ->foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 0, 22), Decl(functionOverloads12.ts, 1, 22)) - -function foo():number; ->foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 0, 22), Decl(functionOverloads12.ts, 1, 22)) - -function foo():any { if (true) return ""; else return 0;} ->foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 0, 22), Decl(functionOverloads12.ts, 1, 22)) - diff --git a/tests/baselines/reference/functionOverloads12.types b/tests/baselines/reference/functionOverloads12.types deleted file mode 100644 index 20f5ee5d5561f..0000000000000 --- a/tests/baselines/reference/functionOverloads12.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/functionOverloads12.ts === -function foo():string; ->foo : { (): string; (): number; } - -function foo():number; ->foo : { (): string; (): number; } - -function foo():any { if (true) return ""; else return 0;} ->foo : { (): string; (): number; } ->true : boolean ->"" : string ->0 : number - diff --git a/tests/baselines/reference/functionReturn.errors.txt b/tests/baselines/reference/functionReturn.errors.txt new file mode 100644 index 0000000000000..d5f78b2534d16 --- /dev/null +++ b/tests/baselines/reference/functionReturn.errors.txt @@ -0,0 +1,23 @@ +tests/cases/compiler/functionReturn.ts(9,5): error TS7027: Unreachable code detected. +tests/cases/compiler/functionReturn.ts(13,5): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/functionReturn.ts (2 errors) ==== + function f0(): void { } + function f1() { + var n: any = f0(); + } + function f2(): any { } + function f3(): string { return; } + function f4(): string { + return ''; + return; + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } + function f5(): string { + return ''; + return undefined; + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } \ No newline at end of file diff --git a/tests/baselines/reference/functionReturn.symbols b/tests/baselines/reference/functionReturn.symbols deleted file mode 100644 index 9c6b794b3d005..0000000000000 --- a/tests/baselines/reference/functionReturn.symbols +++ /dev/null @@ -1,30 +0,0 @@ -=== tests/cases/compiler/functionReturn.ts === -function f0(): void { } ->f0 : Symbol(f0, Decl(functionReturn.ts, 0, 0)) - -function f1() { ->f1 : Symbol(f1, Decl(functionReturn.ts, 0, 23)) - - var n: any = f0(); ->n : Symbol(n, Decl(functionReturn.ts, 2, 7)) ->f0 : Symbol(f0, Decl(functionReturn.ts, 0, 0)) -} -function f2(): any { } ->f2 : Symbol(f2, Decl(functionReturn.ts, 3, 1)) - -function f3(): string { return; } ->f3 : Symbol(f3, Decl(functionReturn.ts, 4, 22)) - -function f4(): string { ->f4 : Symbol(f4, Decl(functionReturn.ts, 5, 33)) - - return ''; - return; -} -function f5(): string { ->f5 : Symbol(f5, Decl(functionReturn.ts, 9, 1)) - - return ''; - return undefined; ->undefined : Symbol(undefined) -} diff --git a/tests/baselines/reference/functionReturn.types b/tests/baselines/reference/functionReturn.types deleted file mode 100644 index 6fc9d680db90c..0000000000000 --- a/tests/baselines/reference/functionReturn.types +++ /dev/null @@ -1,35 +0,0 @@ -=== tests/cases/compiler/functionReturn.ts === -function f0(): void { } ->f0 : () => void - -function f1() { ->f1 : () => void - - var n: any = f0(); ->n : any ->f0() : void ->f0 : () => void -} -function f2(): any { } ->f2 : () => any - -function f3(): string { return; } ->f3 : () => string - -function f4(): string { ->f4 : () => string - - return ''; ->'' : string - - return; -} -function f5(): string { ->f5 : () => string - - return ''; ->'' : string - - return undefined; ->undefined : undefined -} diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt index 8a57d8e08e663..4c21fc6814cb3 100644 --- a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt @@ -1,15 +1,20 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(4,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(8,9): error TS7027: Unreachable code detected. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(12,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(15,12): error TS7027: Unreachable code detected. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(22,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(31,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(43,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(45,5): error TS7027: Unreachable code detected. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(48,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(52,9): error TS7027: Unreachable code detected. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(56,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(56,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(56,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(60,9): error TS7027: Unreachable code detected. -==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts (9 errors) ==== +==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts (14 errors) ==== // return type of a function with multiple returns is the BCT of each return statement // it is an error if there is no single BCT, these are error cases @@ -20,6 +25,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return 1; } else { return ''; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } @@ -29,6 +36,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti if (true) { return 1; } else if (false) { + ~~ +!!! error TS7027: Unreachable code detected. return 2; } else { return ''; @@ -65,6 +74,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti !!! error TS2354: No best common type exists among return expressions. return 1; return ''; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } function f6(x: T, y:U) { @@ -74,6 +85,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return x; } else { return y; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } @@ -88,6 +101,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return x; } else { return y; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt index bbaa5a855786c..a965a1a9a99af 100644 --- a/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt @@ -1,8 +1,16 @@ +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(8,9): error TS7027: Unreachable code detected. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(15,12): error TS7027: Unreachable code detected. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(36,5): error TS7027: Unreachable code detected. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(43,9): error TS7027: Unreachable code detected. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(58,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(62,9): error TS7027: Unreachable code detected. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(67,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(71,9): error TS7027: Unreachable code detected. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(80,9): error TS7027: Unreachable code detected. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(89,9): error TS7027: Unreachable code detected. -==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts (2 errors) ==== +==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts (10 errors) ==== // return type of a function with multiple returns is the BCT of each return statement // no errors expected here @@ -11,6 +19,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return 1; } else { return null; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } @@ -18,6 +28,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti if (true) { return 1; } else if (false) { + ~~ +!!! error TS7027: Unreachable code detected. return null; } else { return 2; @@ -39,6 +51,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti function f5() { return 1; return new Object(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. } function f6(x: T) { @@ -46,6 +60,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return x; } else { return null; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } @@ -67,6 +83,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return a; } else { return b; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } @@ -78,6 +96,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return b; } else { return a; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } @@ -87,6 +107,8 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return (x: number) => { } } else { return (x: Object) => { } + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } @@ -96,5 +118,7 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return (x: Object) => { } } else { return (x: number) => { } + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt b/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt index 3c8fef3eb4998..4cc440ee3971c 100644 --- a/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt +++ b/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt @@ -1,12 +1,15 @@ tests/cases/compiler/functionWithNoBestCommonType1.ts(1,10): error TS2354: No best common type exists among return expressions. +tests/cases/compiler/functionWithNoBestCommonType1.ts(3,5): error TS7027: Unreachable code detected. -==== tests/cases/compiler/functionWithNoBestCommonType1.ts (1 errors) ==== +==== tests/cases/compiler/functionWithNoBestCommonType1.ts (2 errors) ==== function foo() { ~~~ !!! error TS2354: No best common type exists among return expressions. return true; return bar(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. } function bar(): void { diff --git a/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt b/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt index 981e330d9b521..a93161b27b833 100644 --- a/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt +++ b/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt @@ -1,12 +1,15 @@ tests/cases/compiler/functionWithNoBestCommonType2.ts(1,9): error TS2354: No best common type exists among return expressions. +tests/cases/compiler/functionWithNoBestCommonType2.ts(3,4): error TS7027: Unreachable code detected. -==== tests/cases/compiler/functionWithNoBestCommonType2.ts (1 errors) ==== +==== tests/cases/compiler/functionWithNoBestCommonType2.ts (2 errors) ==== var v = function () { ~~~~~~~~ !!! error TS2354: No best common type exists among return expressions. return true; return bar(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. }; function bar(): void { diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt index 88b0c8d5e1472..3a128de4ceed4 100644 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt +++ b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt @@ -1,9 +1,12 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(2,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(68,5): error TS7027: Unreachable code detected. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(74,5): error TS7027: Unreachable code detected. tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(94,16): error TS2378: A 'get' accessor must return a value. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(116,9): error TS7027: Unreachable code detected. tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): error TS1003: Identifier expected. -==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (3 errors) ==== +==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (6 errors) ==== function f1(): string { ~~~~~~ @@ -74,12 +77,16 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): e // if no return statements are present but we are annotated. throw undefined; throw null; + ~~~~~ +!!! error TS7027: Unreachable code detected. } function f15(): number { // Fine, since we have a return statement somewhere. throw undefined; throw null; + ~~~~~ +!!! error TS7027: Unreachable code detected. return; } @@ -124,6 +131,8 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): e // if no return statements are present but we are a get accessor. throw null; throw undefined. + ~~~~~ +!!! error TS7027: Unreachable code detected. } ~ !!! error TS1003: Identifier expected. diff --git a/tests/baselines/reference/generatedContextualTyping.errors.txt b/tests/baselines/reference/generatedContextualTyping.errors.txt new file mode 100644 index 0000000000000..a2f95cdcb2373 --- /dev/null +++ b/tests/baselines/reference/generatedContextualTyping.errors.txt @@ -0,0 +1,393 @@ +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(150,56): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(151,72): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(152,78): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(153,59): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(154,75): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(155,81): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(156,44): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(157,49): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(158,60): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(159,59): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(160,84): error TS7027: Unreachable code detected. +tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(161,77): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts (12 errors) ==== + class Base { private p; } + class Derived1 extends Base { private m; } + class Derived2 extends Base { private n; } + interface Genric { func(n: T[]); } + var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); + var x1: () => Base[] = () => [d1, d2]; + var x2: () => Base[] = function() { return [d1, d2] }; + var x3: () => Base[] = function named() { return [d1, d2] }; + var x4: { (): Base[]; } = () => [d1, d2]; + var x5: { (): Base[]; } = function() { return [d1, d2] }; + var x6: { (): Base[]; } = function named() { return [d1, d2] }; + var x7: Base[] = [d1, d2]; + var x8: Array = [d1, d2]; + var x9: { [n: number]: Base; } = [d1, d2]; + var x10: {n: Base[]; } = { n: [d1, d2] }; + var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; + var x12: Genric = { func: n => { return [d1, d2]; } }; + class x13 { member: () => Base[] = () => [d1, d2] } + class x14 { member: () => Base[] = function() { return [d1, d2] } } + class x15 { member: () => Base[] = function named() { return [d1, d2] } } + class x16 { member: { (): Base[]; } = () => [d1, d2] } + class x17 { member: { (): Base[]; } = function() { return [d1, d2] } } + class x18 { member: { (): Base[]; } = function named() { return [d1, d2] } } + class x19 { member: Base[] = [d1, d2] } + class x20 { member: Array = [d1, d2] } + class x21 { member: { [n: number]: Base; } = [d1, d2] } + class x22 { member: {n: Base[]; } = { n: [d1, d2] } } + class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } + class x24 { member: Genric = { func: n => { return [d1, d2]; } } } + class x25 { private member: () => Base[] = () => [d1, d2] } + class x26 { private member: () => Base[] = function() { return [d1, d2] } } + class x27 { private member: () => Base[] = function named() { return [d1, d2] } } + class x28 { private member: { (): Base[]; } = () => [d1, d2] } + class x29 { private member: { (): Base[]; } = function() { return [d1, d2] } } + class x30 { private member: { (): Base[]; } = function named() { return [d1, d2] } } + class x31 { private member: Base[] = [d1, d2] } + class x32 { private member: Array = [d1, d2] } + class x33 { private member: { [n: number]: Base; } = [d1, d2] } + class x34 { private member: {n: Base[]; } = { n: [d1, d2] } } + class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return null; } } + class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } + class x37 { public member: () => Base[] = () => [d1, d2] } + class x38 { public member: () => Base[] = function() { return [d1, d2] } } + class x39 { public member: () => Base[] = function named() { return [d1, d2] } } + class x40 { public member: { (): Base[]; } = () => [d1, d2] } + class x41 { public member: { (): Base[]; } = function() { return [d1, d2] } } + class x42 { public member: { (): Base[]; } = function named() { return [d1, d2] } } + class x43 { public member: Base[] = [d1, d2] } + class x44 { public member: Array = [d1, d2] } + class x45 { public member: { [n: number]: Base; } = [d1, d2] } + class x46 { public member: {n: Base[]; } = { n: [d1, d2] } } + class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return null; } } + class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } + class x49 { static member: () => Base[] = () => [d1, d2] } + class x50 { static member: () => Base[] = function() { return [d1, d2] } } + class x51 { static member: () => Base[] = function named() { return [d1, d2] } } + class x52 { static member: { (): Base[]; } = () => [d1, d2] } + class x53 { static member: { (): Base[]; } = function() { return [d1, d2] } } + class x54 { static member: { (): Base[]; } = function named() { return [d1, d2] } } + class x55 { static member: Base[] = [d1, d2] } + class x56 { static member: Array = [d1, d2] } + class x57 { static member: { [n: number]: Base; } = [d1, d2] } + class x58 { static member: {n: Base[]; } = { n: [d1, d2] } } + class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } + class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } + class x61 { private static member: () => Base[] = () => [d1, d2] } + class x62 { private static member: () => Base[] = function() { return [d1, d2] } } + class x63 { private static member: () => Base[] = function named() { return [d1, d2] } } + class x64 { private static member: { (): Base[]; } = () => [d1, d2] } + class x65 { private static member: { (): Base[]; } = function() { return [d1, d2] } } + class x66 { private static member: { (): Base[]; } = function named() { return [d1, d2] } } + class x67 { private static member: Base[] = [d1, d2] } + class x68 { private static member: Array = [d1, d2] } + class x69 { private static member: { [n: number]: Base; } = [d1, d2] } + class x70 { private static member: {n: Base[]; } = { n: [d1, d2] } } + class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } + class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } + class x73 { public static member: () => Base[] = () => [d1, d2] } + class x74 { public static member: () => Base[] = function() { return [d1, d2] } } + class x75 { public static member: () => Base[] = function named() { return [d1, d2] } } + class x76 { public static member: { (): Base[]; } = () => [d1, d2] } + class x77 { public static member: { (): Base[]; } = function() { return [d1, d2] } } + class x78 { public static member: { (): Base[]; } = function named() { return [d1, d2] } } + class x79 { public static member: Base[] = [d1, d2] } + class x80 { public static member: Array = [d1, d2] } + class x81 { public static member: { [n: number]: Base; } = [d1, d2] } + class x82 { public static member: {n: Base[]; } = { n: [d1, d2] } } + class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } + class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } + class x85 { constructor(parm: () => Base[] = () => [d1, d2]) { } } + class x86 { constructor(parm: () => Base[] = function() { return [d1, d2] }) { } } + class x87 { constructor(parm: () => Base[] = function named() { return [d1, d2] }) { } } + class x88 { constructor(parm: { (): Base[]; } = () => [d1, d2]) { } } + class x89 { constructor(parm: { (): Base[]; } = function() { return [d1, d2] }) { } } + class x90 { constructor(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } + class x91 { constructor(parm: Base[] = [d1, d2]) { } } + class x92 { constructor(parm: Array = [d1, d2]) { } } + class x93 { constructor(parm: { [n: number]: Base; } = [d1, d2]) { } } + class x94 { constructor(parm: {n: Base[]; } = { n: [d1, d2] }) { } } + class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } + class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } + class x97 { constructor(public parm: () => Base[] = () => [d1, d2]) { } } + class x98 { constructor(public parm: () => Base[] = function() { return [d1, d2] }) { } } + class x99 { constructor(public parm: () => Base[] = function named() { return [d1, d2] }) { } } + class x100 { constructor(public parm: { (): Base[]; } = () => [d1, d2]) { } } + class x101 { constructor(public parm: { (): Base[]; } = function() { return [d1, d2] }) { } } + class x102 { constructor(public parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } + class x103 { constructor(public parm: Base[] = [d1, d2]) { } } + class x104 { constructor(public parm: Array = [d1, d2]) { } } + class x105 { constructor(public parm: { [n: number]: Base; } = [d1, d2]) { } } + class x106 { constructor(public parm: {n: Base[]; } = { n: [d1, d2] }) { } } + class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } + class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } + class x109 { constructor(private parm: () => Base[] = () => [d1, d2]) { } } + class x110 { constructor(private parm: () => Base[] = function() { return [d1, d2] }) { } } + class x111 { constructor(private parm: () => Base[] = function named() { return [d1, d2] }) { } } + class x112 { constructor(private parm: { (): Base[]; } = () => [d1, d2]) { } } + class x113 { constructor(private parm: { (): Base[]; } = function() { return [d1, d2] }) { } } + class x114 { constructor(private parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } + class x115 { constructor(private parm: Base[] = [d1, d2]) { } } + class x116 { constructor(private parm: Array = [d1, d2]) { } } + class x117 { constructor(private parm: { [n: number]: Base; } = [d1, d2]) { } } + class x118 { constructor(private parm: {n: Base[]; } = { n: [d1, d2] }) { } } + class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } + class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } + function x121(parm: () => Base[] = () => [d1, d2]) { } + function x122(parm: () => Base[] = function() { return [d1, d2] }) { } + function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } + function x124(parm: { (): Base[]; } = () => [d1, d2]) { } + function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } + function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } + function x127(parm: Base[] = [d1, d2]) { } + function x128(parm: Array = [d1, d2]) { } + function x129(parm: { [n: number]: Base; } = [d1, d2]) { } + function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } + function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } + function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } + function x133(): () => Base[] { return () => [d1, d2]; } + function x134(): () => Base[] { return function() { return [d1, d2] }; } + function x135(): () => Base[] { return function named() { return [d1, d2] }; } + function x136(): { (): Base[]; } { return () => [d1, d2]; } + function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } + function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } + function x139(): Base[] { return [d1, d2]; } + function x140(): Array { return [d1, d2]; } + function x141(): { [n: number]: Base; } { return [d1, d2]; } + function x142(): {n: Base[]; } { return { n: [d1, d2] }; } + function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; } + function x144(): Genric { return { func: n => { return [d1, d2]; } }; } + function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x151(): Base[] { return [d1, d2]; return [d1, d2]; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x152(): Array { return [d1, d2]; return [d1, d2]; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] }; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; return n => { var n: Base[]; return null; }; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } + ~~~~~~ +!!! error TS7027: Unreachable code detected. + var x157: () => () => Base[] = () => { return () => [d1, d2]; }; + var x158: () => () => Base[] = () => { return function() { return [d1, d2] }; }; + var x159: () => () => Base[] = () => { return function named() { return [d1, d2] }; }; + var x160: () => { (): Base[]; } = () => { return () => [d1, d2]; }; + var x161: () => { (): Base[]; } = () => { return function() { return [d1, d2] }; }; + var x162: () => { (): Base[]; } = () => { return function named() { return [d1, d2] }; }; + var x163: () => Base[] = () => { return [d1, d2]; }; + var x164: () => Array = () => { return [d1, d2]; }; + var x165: () => { [n: number]: Base; } = () => { return [d1, d2]; }; + var x166: () => {n: Base[]; } = () => { return { n: [d1, d2] }; }; + var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return null; }; }; + var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; + var x169: () => () => Base[] = function() { return () => [d1, d2]; }; + var x170: () => () => Base[] = function() { return function() { return [d1, d2] }; }; + var x171: () => () => Base[] = function() { return function named() { return [d1, d2] }; }; + var x172: () => { (): Base[]; } = function() { return () => [d1, d2]; }; + var x173: () => { (): Base[]; } = function() { return function() { return [d1, d2] }; }; + var x174: () => { (): Base[]; } = function() { return function named() { return [d1, d2] }; }; + var x175: () => Base[] = function() { return [d1, d2]; }; + var x176: () => Array = function() { return [d1, d2]; }; + var x177: () => { [n: number]: Base; } = function() { return [d1, d2]; }; + var x178: () => {n: Base[]; } = function() { return { n: [d1, d2] }; }; + var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; return null; }; }; + var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; + module x181 { var t: () => Base[] = () => [d1, d2]; } + module x182 { var t: () => Base[] = function() { return [d1, d2] }; } + module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } + module x184 { var t: { (): Base[]; } = () => [d1, d2]; } + module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } + module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } + module x187 { var t: Base[] = [d1, d2]; } + module x188 { var t: Array = [d1, d2]; } + module x189 { var t: { [n: number]: Base; } = [d1, d2]; } + module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } + module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } + module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } + module x193 { export var t: () => Base[] = () => [d1, d2]; } + module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } + module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; } + module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } + module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } + module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] }; } + module x199 { export var t: Base[] = [d1, d2]; } + module x200 { export var t: Array = [d1, d2]; } + module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } + module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } + module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } + module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } + var x206 = <() => Base[]>function() { return [d1, d2] }; + var x207 = <() => Base[]>function named() { return [d1, d2] }; + var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; + var x210 = <{ (): Base[]; }>function named() { return [d1, d2] }; + var x211 = [d1, d2]; + var x212 = >[d1, d2]; + var x213 = <{ [n: number]: Base; }>[d1, d2]; + var x214 = <{n: Base[]; } >{ n: [d1, d2] }; + var x216 = >{ func: n => { return [d1, d2]; } }; + var x217 = (<() => Base[]>undefined) || function() { return [d1, d2] }; + var x218 = (<() => Base[]>undefined) || function named() { return [d1, d2] }; + var x219 = (<{ (): Base[]; }>undefined) || function() { return [d1, d2] }; + var x220 = (<{ (): Base[]; }>undefined) || function named() { return [d1, d2] }; + var x221 = (undefined) || [d1, d2]; + var x222 = (>undefined) || [d1, d2]; + var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2]; + var x224 = (<{n: Base[]; } >undefined) || { n: [d1, d2] }; + var x225: () => Base[]; x225 = () => [d1, d2]; + var x226: () => Base[]; x226 = function() { return [d1, d2] }; + var x227: () => Base[]; x227 = function named() { return [d1, d2] }; + var x228: { (): Base[]; }; x228 = () => [d1, d2]; + var x229: { (): Base[]; }; x229 = function() { return [d1, d2] }; + var x230: { (): Base[]; }; x230 = function named() { return [d1, d2] }; + var x231: Base[]; x231 = [d1, d2]; + var x232: Array; x232 = [d1, d2]; + var x233: { [n: number]: Base; }; x233 = [d1, d2]; + var x234: {n: Base[]; } ; x234 = { n: [d1, d2] }; + var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; + var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; + var x237: { n: () => Base[]; } = { n: () => [d1, d2] }; + var x238: { n: () => Base[]; } = { n: function() { return [d1, d2] } }; + var x239: { n: () => Base[]; } = { n: function named() { return [d1, d2] } }; + var x240: { n: { (): Base[]; }; } = { n: () => [d1, d2] }; + var x241: { n: { (): Base[]; }; } = { n: function() { return [d1, d2] } }; + var x242: { n: { (): Base[]; }; } = { n: function named() { return [d1, d2] } }; + var x243: { n: Base[]; } = { n: [d1, d2] }; + var x244: { n: Array; } = { n: [d1, d2] }; + var x245: { n: { [n: number]: Base; }; } = { n: [d1, d2] }; + var x246: { n: {n: Base[]; } ; } = { n: { n: [d1, d2] } }; + var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } }; + var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; + var x252: { (): Base[]; }[] = [() => [d1, d2]]; + var x253: { (): Base[]; }[] = [function() { return [d1, d2] }]; + var x254: { (): Base[]; }[] = [function named() { return [d1, d2] }]; + var x255: Base[][] = [[d1, d2]]; + var x256: Array[] = [[d1, d2]]; + var x257: { [n: number]: Base; }[] = [[d1, d2]]; + var x258: {n: Base[]; } [] = [{ n: [d1, d2] }]; + var x260: Genric[] = [{ func: n => { return [d1, d2]; } }]; + var x261: () => Base[] = function() { return [d1, d2] } || undefined; + var x262: () => Base[] = function named() { return [d1, d2] } || undefined; + var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; + var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; + var x265: Base[] = [d1, d2] || undefined; + var x266: Array = [d1, d2] || undefined; + var x267: { [n: number]: Base; } = [d1, d2] || undefined; + var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; + var x269: () => Base[] = undefined || function() { return [d1, d2] }; + var x270: () => Base[] = undefined || function named() { return [d1, d2] }; + var x271: { (): Base[]; } = undefined || function() { return [d1, d2] }; + var x272: { (): Base[]; } = undefined || function named() { return [d1, d2] }; + var x273: Base[] = undefined || [d1, d2]; + var x274: Array = undefined || [d1, d2]; + var x275: { [n: number]: Base; } = undefined || [d1, d2]; + var x276: {n: Base[]; } = undefined || { n: [d1, d2] }; + var x277: () => Base[] = function() { return [d1, d2] } || function() { return [d1, d2] }; + var x278: () => Base[] = function named() { return [d1, d2] } || function named() { return [d1, d2] }; + var x279: { (): Base[]; } = function() { return [d1, d2] } || function() { return [d1, d2] }; + var x280: { (): Base[]; } = function named() { return [d1, d2] } || function named() { return [d1, d2] }; + var x281: Base[] = [d1, d2] || [d1, d2]; + var x282: Array = [d1, d2] || [d1, d2]; + var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2]; + var x284: {n: Base[]; } = { n: [d1, d2] } || { n: [d1, d2] }; + var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; + var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; + var x287: () => Base[] = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; + var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; + var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; + var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; + var x291: Base[] = true ? [d1, d2] : [d1, d2]; + var x292: Array = true ? [d1, d2] : [d1, d2]; + var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; + var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; + var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; }; + var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; + var x297: () => Base[] = true ? undefined : () => [d1, d2]; + var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; + var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] }; + var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; + var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; + var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2] }; + var x303: Base[] = true ? undefined : [d1, d2]; + var x304: Array = true ? undefined : [d1, d2]; + var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; + var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; + var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return null; }; + var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; + var x309: () => Base[] = true ? () => [d1, d2] : undefined; + var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; + var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined; + var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; + var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; + var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefined; + var x315: Base[] = true ? [d1, d2] : undefined; + var x316: Array = true ? [d1, d2] : undefined; + var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; + var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; + var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : undefined; + var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; + function x321(n: () => Base[]) { }; x321(() => [d1, d2]); + function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); + function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); + function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); + function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); + function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] }); + function x327(n: Base[]) { }; x327([d1, d2]); + function x328(n: Array) { }; x328([d1, d2]); + function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); + function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); + function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null; }); + function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); + var x333 = (n: () => Base[]) => n; x333(() => [d1, d2]); + var x334 = (n: () => Base[]) => n; x334(function() { return [d1, d2] }); + var x335 = (n: () => Base[]) => n; x335(function named() { return [d1, d2] }); + var x336 = (n: { (): Base[]; }) => n; x336(() => [d1, d2]); + var x337 = (n: { (): Base[]; }) => n; x337(function() { return [d1, d2] }); + var x338 = (n: { (): Base[]; }) => n; x338(function named() { return [d1, d2] }); + var x339 = (n: Base[]) => n; x339([d1, d2]); + var x340 = (n: Array) => n; x340([d1, d2]); + var x341 = (n: { [n: number]: Base; }) => n; x341([d1, d2]); + var x342 = (n: {n: Base[]; } ) => n; x342({ n: [d1, d2] }); + var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; }); + var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); + var x345 = function(n: () => Base[]) { }; x345(() => [d1, d2]); + var x346 = function(n: () => Base[]) { }; x346(function() { return [d1, d2] }); + var x347 = function(n: () => Base[]) { }; x347(function named() { return [d1, d2] }); + var x348 = function(n: { (): Base[]; }) { }; x348(() => [d1, d2]); + var x349 = function(n: { (): Base[]; }) { }; x349(function() { return [d1, d2] }); + var x350 = function(n: { (): Base[]; }) { }; x350(function named() { return [d1, d2] }); + var x351 = function(n: Base[]) { }; x351([d1, d2]); + var x352 = function(n: Array) { }; x352([d1, d2]); + var x353 = function(n: { [n: number]: Base; }) { }; x353([d1, d2]); + var x354 = function(n: {n: Base[]; } ) { }; x354({ n: [d1, d2] }); + var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; return null; }); + var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); \ No newline at end of file diff --git a/tests/baselines/reference/generatedContextualTyping.symbols b/tests/baselines/reference/generatedContextualTyping.symbols deleted file mode 100644 index 287b7be66d091..0000000000000 --- a/tests/baselines/reference/generatedContextualTyping.symbols +++ /dev/null @@ -1,2831 +0,0 @@ -=== tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts === -class Base { private p; } ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->p : Symbol(p, Decl(generatedContextualTyping.ts, 0, 12)) - -class Derived1 extends Base { private m; } ->Derived1 : Symbol(Derived1, Decl(generatedContextualTyping.ts, 0, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->m : Symbol(m, Decl(generatedContextualTyping.ts, 1, 29)) - -class Derived2 extends Base { private n; } ->Derived2 : Symbol(Derived2, Decl(generatedContextualTyping.ts, 1, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 2, 29)) - -interface Genric { func(n: T[]); } ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->T : Symbol(T, Decl(generatedContextualTyping.ts, 3, 17)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 3, 21)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 3, 27)) ->T : Symbol(T, Decl(generatedContextualTyping.ts, 3, 17)) - -var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); ->b : Symbol(b, Decl(generatedContextualTyping.ts, 4, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->Derived1 : Symbol(Derived1, Decl(generatedContextualTyping.ts, 0, 25)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->Derived2 : Symbol(Derived2, Decl(generatedContextualTyping.ts, 1, 42)) - -var x1: () => Base[] = () => [d1, d2]; ->x1 : Symbol(x1, Decl(generatedContextualTyping.ts, 5, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x2: () => Base[] = function() { return [d1, d2] }; ->x2 : Symbol(x2, Decl(generatedContextualTyping.ts, 6, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x3: () => Base[] = function named() { return [d1, d2] }; ->x3 : Symbol(x3, Decl(generatedContextualTyping.ts, 7, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 7, 22)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x4: { (): Base[]; } = () => [d1, d2]; ->x4 : Symbol(x4, Decl(generatedContextualTyping.ts, 8, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x5: { (): Base[]; } = function() { return [d1, d2] }; ->x5 : Symbol(x5, Decl(generatedContextualTyping.ts, 9, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x6: { (): Base[]; } = function named() { return [d1, d2] }; ->x6 : Symbol(x6, Decl(generatedContextualTyping.ts, 10, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 10, 25)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x7: Base[] = [d1, d2]; ->x7 : Symbol(x7, Decl(generatedContextualTyping.ts, 11, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x8: Array = [d1, d2]; ->x8 : Symbol(x8, Decl(generatedContextualTyping.ts, 12, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x9: { [n: number]: Base; } = [d1, d2]; ->x9 : Symbol(x9, Decl(generatedContextualTyping.ts, 13, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 13, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x10: {n: Base[]; } = { n: [d1, d2] }; ->x10 : Symbol(x10, Decl(generatedContextualTyping.ts, 14, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 14, 10)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 14, 27)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; ->x11 : Symbol(x11, Decl(generatedContextualTyping.ts, 15, 3)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 15, 10)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 15, 29), Decl(generatedContextualTyping.ts, 15, 40)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 15, 29), Decl(generatedContextualTyping.ts, 15, 40)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -var x12: Genric = { func: n => { return [d1, d2]; } }; ->x12 : Symbol(x12, Decl(generatedContextualTyping.ts, 16, 3)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 16, 25)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 16, 31)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x13 { member: () => Base[] = () => [d1, d2] } ->x13 : Symbol(x13, Decl(generatedContextualTyping.ts, 16, 60)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 17, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x14 { member: () => Base[] = function() { return [d1, d2] } } ->x14 : Symbol(x14, Decl(generatedContextualTyping.ts, 17, 51)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 18, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x15 { member: () => Base[] = function named() { return [d1, d2] } } ->x15 : Symbol(x15, Decl(generatedContextualTyping.ts, 18, 67)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 19, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 19, 34)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x16 { member: { (): Base[]; } = () => [d1, d2] } ->x16 : Symbol(x16, Decl(generatedContextualTyping.ts, 19, 73)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 20, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x17 { member: { (): Base[]; } = function() { return [d1, d2] } } ->x17 : Symbol(x17, Decl(generatedContextualTyping.ts, 20, 54)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 21, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x18 { member: { (): Base[]; } = function named() { return [d1, d2] } } ->x18 : Symbol(x18, Decl(generatedContextualTyping.ts, 21, 70)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 22, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 22, 37)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x19 { member: Base[] = [d1, d2] } ->x19 : Symbol(x19, Decl(generatedContextualTyping.ts, 22, 76)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 23, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x20 { member: Array = [d1, d2] } ->x20 : Symbol(x20, Decl(generatedContextualTyping.ts, 23, 39)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 24, 11)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x21 { member: { [n: number]: Base; } = [d1, d2] } ->x21 : Symbol(x21, Decl(generatedContextualTyping.ts, 24, 44)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 25, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 25, 23)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x22 { member: {n: Base[]; } = { n: [d1, d2] } } ->x22 : Symbol(x22, Decl(generatedContextualTyping.ts, 25, 55)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 26, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 26, 21)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 26, 38)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x23 : Symbol(x23, Decl(generatedContextualTyping.ts, 26, 54)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 27, 11)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 27, 21)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 27, 40), Decl(generatedContextualTyping.ts, 27, 51)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 27, 40), Decl(generatedContextualTyping.ts, 27, 51)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -class x24 { member: Genric = { func: n => { return [d1, d2]; } } } ->x24 : Symbol(x24, Decl(generatedContextualTyping.ts, 27, 79)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 28, 11)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 28, 36)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 28, 42)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x25 { private member: () => Base[] = () => [d1, d2] } ->x25 : Symbol(x25, Decl(generatedContextualTyping.ts, 28, 72)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 29, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x26 { private member: () => Base[] = function() { return [d1, d2] } } ->x26 : Symbol(x26, Decl(generatedContextualTyping.ts, 29, 59)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 30, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x27 { private member: () => Base[] = function named() { return [d1, d2] } } ->x27 : Symbol(x27, Decl(generatedContextualTyping.ts, 30, 75)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 31, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 31, 42)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x28 { private member: { (): Base[]; } = () => [d1, d2] } ->x28 : Symbol(x28, Decl(generatedContextualTyping.ts, 31, 81)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 32, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x29 { private member: { (): Base[]; } = function() { return [d1, d2] } } ->x29 : Symbol(x29, Decl(generatedContextualTyping.ts, 32, 62)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 33, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x30 { private member: { (): Base[]; } = function named() { return [d1, d2] } } ->x30 : Symbol(x30, Decl(generatedContextualTyping.ts, 33, 78)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 34, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 34, 45)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x31 { private member: Base[] = [d1, d2] } ->x31 : Symbol(x31, Decl(generatedContextualTyping.ts, 34, 84)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 35, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x32 { private member: Array = [d1, d2] } ->x32 : Symbol(x32, Decl(generatedContextualTyping.ts, 35, 47)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 36, 11)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x33 { private member: { [n: number]: Base; } = [d1, d2] } ->x33 : Symbol(x33, Decl(generatedContextualTyping.ts, 36, 52)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 37, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 37, 31)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x34 { private member: {n: Base[]; } = { n: [d1, d2] } } ->x34 : Symbol(x34, Decl(generatedContextualTyping.ts, 37, 63)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 38, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 38, 29)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 38, 46)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x35 : Symbol(x35, Decl(generatedContextualTyping.ts, 38, 62)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 39, 11)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 39, 29)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 39, 48), Decl(generatedContextualTyping.ts, 39, 59)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 39, 48), Decl(generatedContextualTyping.ts, 39, 59)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } ->x36 : Symbol(x36, Decl(generatedContextualTyping.ts, 39, 87)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 40, 11)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 40, 44)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 40, 50)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x37 { public member: () => Base[] = () => [d1, d2] } ->x37 : Symbol(x37, Decl(generatedContextualTyping.ts, 40, 80)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 41, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x38 { public member: () => Base[] = function() { return [d1, d2] } } ->x38 : Symbol(x38, Decl(generatedContextualTyping.ts, 41, 58)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 42, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x39 { public member: () => Base[] = function named() { return [d1, d2] } } ->x39 : Symbol(x39, Decl(generatedContextualTyping.ts, 42, 74)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 43, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 43, 41)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x40 { public member: { (): Base[]; } = () => [d1, d2] } ->x40 : Symbol(x40, Decl(generatedContextualTyping.ts, 43, 80)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 44, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x41 { public member: { (): Base[]; } = function() { return [d1, d2] } } ->x41 : Symbol(x41, Decl(generatedContextualTyping.ts, 44, 61)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 45, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x42 { public member: { (): Base[]; } = function named() { return [d1, d2] } } ->x42 : Symbol(x42, Decl(generatedContextualTyping.ts, 45, 77)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 46, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 46, 44)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x43 { public member: Base[] = [d1, d2] } ->x43 : Symbol(x43, Decl(generatedContextualTyping.ts, 46, 83)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 47, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x44 { public member: Array = [d1, d2] } ->x44 : Symbol(x44, Decl(generatedContextualTyping.ts, 47, 46)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 48, 11)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x45 { public member: { [n: number]: Base; } = [d1, d2] } ->x45 : Symbol(x45, Decl(generatedContextualTyping.ts, 48, 51)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 49, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 49, 30)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x46 { public member: {n: Base[]; } = { n: [d1, d2] } } ->x46 : Symbol(x46, Decl(generatedContextualTyping.ts, 49, 62)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 50, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 50, 28)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 50, 45)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x47 : Symbol(x47, Decl(generatedContextualTyping.ts, 50, 61)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 51, 11)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 51, 28)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 51, 47), Decl(generatedContextualTyping.ts, 51, 58)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 51, 47), Decl(generatedContextualTyping.ts, 51, 58)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } ->x48 : Symbol(x48, Decl(generatedContextualTyping.ts, 51, 86)) ->member : Symbol(member, Decl(generatedContextualTyping.ts, 52, 11)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 52, 43)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 52, 49)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x49 { static member: () => Base[] = () => [d1, d2] } ->x49 : Symbol(x49, Decl(generatedContextualTyping.ts, 52, 79)) ->member : Symbol(x49.member, Decl(generatedContextualTyping.ts, 53, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x50 { static member: () => Base[] = function() { return [d1, d2] } } ->x50 : Symbol(x50, Decl(generatedContextualTyping.ts, 53, 58)) ->member : Symbol(x50.member, Decl(generatedContextualTyping.ts, 54, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x51 { static member: () => Base[] = function named() { return [d1, d2] } } ->x51 : Symbol(x51, Decl(generatedContextualTyping.ts, 54, 74)) ->member : Symbol(x51.member, Decl(generatedContextualTyping.ts, 55, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 55, 41)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x52 { static member: { (): Base[]; } = () => [d1, d2] } ->x52 : Symbol(x52, Decl(generatedContextualTyping.ts, 55, 80)) ->member : Symbol(x52.member, Decl(generatedContextualTyping.ts, 56, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x53 { static member: { (): Base[]; } = function() { return [d1, d2] } } ->x53 : Symbol(x53, Decl(generatedContextualTyping.ts, 56, 61)) ->member : Symbol(x53.member, Decl(generatedContextualTyping.ts, 57, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x54 { static member: { (): Base[]; } = function named() { return [d1, d2] } } ->x54 : Symbol(x54, Decl(generatedContextualTyping.ts, 57, 77)) ->member : Symbol(x54.member, Decl(generatedContextualTyping.ts, 58, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 58, 44)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x55 { static member: Base[] = [d1, d2] } ->x55 : Symbol(x55, Decl(generatedContextualTyping.ts, 58, 83)) ->member : Symbol(x55.member, Decl(generatedContextualTyping.ts, 59, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x56 { static member: Array = [d1, d2] } ->x56 : Symbol(x56, Decl(generatedContextualTyping.ts, 59, 46)) ->member : Symbol(x56.member, Decl(generatedContextualTyping.ts, 60, 11)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x57 { static member: { [n: number]: Base; } = [d1, d2] } ->x57 : Symbol(x57, Decl(generatedContextualTyping.ts, 60, 51)) ->member : Symbol(x57.member, Decl(generatedContextualTyping.ts, 61, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 61, 30)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x58 { static member: {n: Base[]; } = { n: [d1, d2] } } ->x58 : Symbol(x58, Decl(generatedContextualTyping.ts, 61, 62)) ->member : Symbol(x58.member, Decl(generatedContextualTyping.ts, 62, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 62, 28)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 62, 45)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x59 : Symbol(x59, Decl(generatedContextualTyping.ts, 62, 61)) ->member : Symbol(x59.member, Decl(generatedContextualTyping.ts, 63, 11)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 63, 28)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 63, 47), Decl(generatedContextualTyping.ts, 63, 58)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 63, 47), Decl(generatedContextualTyping.ts, 63, 58)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } ->x60 : Symbol(x60, Decl(generatedContextualTyping.ts, 63, 86)) ->member : Symbol(x60.member, Decl(generatedContextualTyping.ts, 64, 11)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 64, 43)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 64, 49)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x61 { private static member: () => Base[] = () => [d1, d2] } ->x61 : Symbol(x61, Decl(generatedContextualTyping.ts, 64, 79)) ->member : Symbol(x61.member, Decl(generatedContextualTyping.ts, 65, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x62 { private static member: () => Base[] = function() { return [d1, d2] } } ->x62 : Symbol(x62, Decl(generatedContextualTyping.ts, 65, 66)) ->member : Symbol(x62.member, Decl(generatedContextualTyping.ts, 66, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x63 { private static member: () => Base[] = function named() { return [d1, d2] } } ->x63 : Symbol(x63, Decl(generatedContextualTyping.ts, 66, 82)) ->member : Symbol(x63.member, Decl(generatedContextualTyping.ts, 67, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 67, 49)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x64 { private static member: { (): Base[]; } = () => [d1, d2] } ->x64 : Symbol(x64, Decl(generatedContextualTyping.ts, 67, 88)) ->member : Symbol(x64.member, Decl(generatedContextualTyping.ts, 68, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x65 { private static member: { (): Base[]; } = function() { return [d1, d2] } } ->x65 : Symbol(x65, Decl(generatedContextualTyping.ts, 68, 69)) ->member : Symbol(x65.member, Decl(generatedContextualTyping.ts, 69, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x66 { private static member: { (): Base[]; } = function named() { return [d1, d2] } } ->x66 : Symbol(x66, Decl(generatedContextualTyping.ts, 69, 85)) ->member : Symbol(x66.member, Decl(generatedContextualTyping.ts, 70, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 70, 52)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x67 { private static member: Base[] = [d1, d2] } ->x67 : Symbol(x67, Decl(generatedContextualTyping.ts, 70, 91)) ->member : Symbol(x67.member, Decl(generatedContextualTyping.ts, 71, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x68 { private static member: Array = [d1, d2] } ->x68 : Symbol(x68, Decl(generatedContextualTyping.ts, 71, 54)) ->member : Symbol(x68.member, Decl(generatedContextualTyping.ts, 72, 11)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x69 { private static member: { [n: number]: Base; } = [d1, d2] } ->x69 : Symbol(x69, Decl(generatedContextualTyping.ts, 72, 59)) ->member : Symbol(x69.member, Decl(generatedContextualTyping.ts, 73, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 73, 38)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x70 { private static member: {n: Base[]; } = { n: [d1, d2] } } ->x70 : Symbol(x70, Decl(generatedContextualTyping.ts, 73, 70)) ->member : Symbol(x70.member, Decl(generatedContextualTyping.ts, 74, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 74, 36)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 74, 53)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x71 : Symbol(x71, Decl(generatedContextualTyping.ts, 74, 69)) ->member : Symbol(x71.member, Decl(generatedContextualTyping.ts, 75, 11)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 75, 36)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 75, 55), Decl(generatedContextualTyping.ts, 75, 66)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 75, 55), Decl(generatedContextualTyping.ts, 75, 66)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } ->x72 : Symbol(x72, Decl(generatedContextualTyping.ts, 75, 94)) ->member : Symbol(x72.member, Decl(generatedContextualTyping.ts, 76, 11)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 76, 51)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 76, 57)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x73 { public static member: () => Base[] = () => [d1, d2] } ->x73 : Symbol(x73, Decl(generatedContextualTyping.ts, 76, 87)) ->member : Symbol(x73.member, Decl(generatedContextualTyping.ts, 77, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x74 { public static member: () => Base[] = function() { return [d1, d2] } } ->x74 : Symbol(x74, Decl(generatedContextualTyping.ts, 77, 65)) ->member : Symbol(x74.member, Decl(generatedContextualTyping.ts, 78, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x75 { public static member: () => Base[] = function named() { return [d1, d2] } } ->x75 : Symbol(x75, Decl(generatedContextualTyping.ts, 78, 81)) ->member : Symbol(x75.member, Decl(generatedContextualTyping.ts, 79, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 79, 48)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x76 { public static member: { (): Base[]; } = () => [d1, d2] } ->x76 : Symbol(x76, Decl(generatedContextualTyping.ts, 79, 87)) ->member : Symbol(x76.member, Decl(generatedContextualTyping.ts, 80, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x77 { public static member: { (): Base[]; } = function() { return [d1, d2] } } ->x77 : Symbol(x77, Decl(generatedContextualTyping.ts, 80, 68)) ->member : Symbol(x77.member, Decl(generatedContextualTyping.ts, 81, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x78 { public static member: { (): Base[]; } = function named() { return [d1, d2] } } ->x78 : Symbol(x78, Decl(generatedContextualTyping.ts, 81, 84)) ->member : Symbol(x78.member, Decl(generatedContextualTyping.ts, 82, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 82, 51)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x79 { public static member: Base[] = [d1, d2] } ->x79 : Symbol(x79, Decl(generatedContextualTyping.ts, 82, 90)) ->member : Symbol(x79.member, Decl(generatedContextualTyping.ts, 83, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x80 { public static member: Array = [d1, d2] } ->x80 : Symbol(x80, Decl(generatedContextualTyping.ts, 83, 53)) ->member : Symbol(x80.member, Decl(generatedContextualTyping.ts, 84, 11)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x81 { public static member: { [n: number]: Base; } = [d1, d2] } ->x81 : Symbol(x81, Decl(generatedContextualTyping.ts, 84, 58)) ->member : Symbol(x81.member, Decl(generatedContextualTyping.ts, 85, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 85, 37)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x82 { public static member: {n: Base[]; } = { n: [d1, d2] } } ->x82 : Symbol(x82, Decl(generatedContextualTyping.ts, 85, 69)) ->member : Symbol(x82.member, Decl(generatedContextualTyping.ts, 86, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 86, 35)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 86, 52)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x83 : Symbol(x83, Decl(generatedContextualTyping.ts, 86, 68)) ->member : Symbol(x83.member, Decl(generatedContextualTyping.ts, 87, 11)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 87, 35)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 87, 54), Decl(generatedContextualTyping.ts, 87, 65)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 87, 54), Decl(generatedContextualTyping.ts, 87, 65)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } ->x84 : Symbol(x84, Decl(generatedContextualTyping.ts, 87, 93)) ->member : Symbol(x84.member, Decl(generatedContextualTyping.ts, 88, 11)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 88, 50)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 88, 56)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x85 { constructor(parm: () => Base[] = () => [d1, d2]) { } } ->x85 : Symbol(x85, Decl(generatedContextualTyping.ts, 88, 86)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 89, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x86 { constructor(parm: () => Base[] = function() { return [d1, d2] }) { } } ->x86 : Symbol(x86, Decl(generatedContextualTyping.ts, 89, 66)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 90, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x87 { constructor(parm: () => Base[] = function named() { return [d1, d2] }) { } } ->x87 : Symbol(x87, Decl(generatedContextualTyping.ts, 90, 82)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 91, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 91, 44)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x88 { constructor(parm: { (): Base[]; } = () => [d1, d2]) { } } ->x88 : Symbol(x88, Decl(generatedContextualTyping.ts, 91, 88)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 92, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x89 { constructor(parm: { (): Base[]; } = function() { return [d1, d2] }) { } } ->x89 : Symbol(x89, Decl(generatedContextualTyping.ts, 92, 69)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 93, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x90 { constructor(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } ->x90 : Symbol(x90, Decl(generatedContextualTyping.ts, 93, 85)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 94, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 94, 47)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x91 { constructor(parm: Base[] = [d1, d2]) { } } ->x91 : Symbol(x91, Decl(generatedContextualTyping.ts, 94, 91)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 95, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x92 { constructor(parm: Array = [d1, d2]) { } } ->x92 : Symbol(x92, Decl(generatedContextualTyping.ts, 95, 54)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 96, 24)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x93 { constructor(parm: { [n: number]: Base; } = [d1, d2]) { } } ->x93 : Symbol(x93, Decl(generatedContextualTyping.ts, 96, 59)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 97, 24)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 97, 33)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x94 { constructor(parm: {n: Base[]; } = { n: [d1, d2] }) { } } ->x94 : Symbol(x94, Decl(generatedContextualTyping.ts, 97, 70)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 98, 24)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 98, 31)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 98, 48)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } ->x95 : Symbol(x95, Decl(generatedContextualTyping.ts, 98, 69)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 99, 24)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 99, 31)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 99, 50), Decl(generatedContextualTyping.ts, 99, 61)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 99, 50), Decl(generatedContextualTyping.ts, 99, 61)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } ->x96 : Symbol(x96, Decl(generatedContextualTyping.ts, 99, 94)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 100, 24)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 100, 46)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 100, 52)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x97 { constructor(public parm: () => Base[] = () => [d1, d2]) { } } ->x97 : Symbol(x97, Decl(generatedContextualTyping.ts, 100, 87)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 101, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x98 { constructor(public parm: () => Base[] = function() { return [d1, d2] }) { } } ->x98 : Symbol(x98, Decl(generatedContextualTyping.ts, 101, 73)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 102, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x99 { constructor(public parm: () => Base[] = function named() { return [d1, d2] }) { } } ->x99 : Symbol(x99, Decl(generatedContextualTyping.ts, 102, 89)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 103, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 103, 51)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x100 { constructor(public parm: { (): Base[]; } = () => [d1, d2]) { } } ->x100 : Symbol(x100, Decl(generatedContextualTyping.ts, 103, 95)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 104, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x101 { constructor(public parm: { (): Base[]; } = function() { return [d1, d2] }) { } } ->x101 : Symbol(x101, Decl(generatedContextualTyping.ts, 104, 77)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 105, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x102 { constructor(public parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } ->x102 : Symbol(x102, Decl(generatedContextualTyping.ts, 105, 93)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 106, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 106, 55)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x103 { constructor(public parm: Base[] = [d1, d2]) { } } ->x103 : Symbol(x103, Decl(generatedContextualTyping.ts, 106, 99)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 107, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x104 { constructor(public parm: Array = [d1, d2]) { } } ->x104 : Symbol(x104, Decl(generatedContextualTyping.ts, 107, 62)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 108, 25)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x105 { constructor(public parm: { [n: number]: Base; } = [d1, d2]) { } } ->x105 : Symbol(x105, Decl(generatedContextualTyping.ts, 108, 67)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 109, 25)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 109, 41)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x106 { constructor(public parm: {n: Base[]; } = { n: [d1, d2] }) { } } ->x106 : Symbol(x106, Decl(generatedContextualTyping.ts, 109, 78)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 110, 25)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 110, 39)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 110, 56)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } ->x107 : Symbol(x107, Decl(generatedContextualTyping.ts, 110, 77)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 111, 25)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 111, 39)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 111, 58), Decl(generatedContextualTyping.ts, 111, 69)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 111, 58), Decl(generatedContextualTyping.ts, 111, 69)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } ->x108 : Symbol(x108, Decl(generatedContextualTyping.ts, 111, 102)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 112, 25)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 112, 54)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 112, 60)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x109 { constructor(private parm: () => Base[] = () => [d1, d2]) { } } ->x109 : Symbol(x109, Decl(generatedContextualTyping.ts, 112, 95)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 113, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x110 { constructor(private parm: () => Base[] = function() { return [d1, d2] }) { } } ->x110 : Symbol(x110, Decl(generatedContextualTyping.ts, 113, 75)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 114, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x111 { constructor(private parm: () => Base[] = function named() { return [d1, d2] }) { } } ->x111 : Symbol(x111, Decl(generatedContextualTyping.ts, 114, 91)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 115, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 115, 53)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x112 { constructor(private parm: { (): Base[]; } = () => [d1, d2]) { } } ->x112 : Symbol(x112, Decl(generatedContextualTyping.ts, 115, 97)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 116, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x113 { constructor(private parm: { (): Base[]; } = function() { return [d1, d2] }) { } } ->x113 : Symbol(x113, Decl(generatedContextualTyping.ts, 116, 78)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 117, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x114 { constructor(private parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } ->x114 : Symbol(x114, Decl(generatedContextualTyping.ts, 117, 94)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 118, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 118, 56)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x115 { constructor(private parm: Base[] = [d1, d2]) { } } ->x115 : Symbol(x115, Decl(generatedContextualTyping.ts, 118, 100)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 119, 25)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x116 { constructor(private parm: Array = [d1, d2]) { } } ->x116 : Symbol(x116, Decl(generatedContextualTyping.ts, 119, 63)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 120, 25)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x117 { constructor(private parm: { [n: number]: Base; } = [d1, d2]) { } } ->x117 : Symbol(x117, Decl(generatedContextualTyping.ts, 120, 68)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 121, 25)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 121, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x118 { constructor(private parm: {n: Base[]; } = { n: [d1, d2] }) { } } ->x118 : Symbol(x118, Decl(generatedContextualTyping.ts, 121, 79)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 122, 25)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 122, 40)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 122, 57)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } ->x119 : Symbol(x119, Decl(generatedContextualTyping.ts, 122, 78)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 123, 25)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 123, 40)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 123, 59), Decl(generatedContextualTyping.ts, 123, 70)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 123, 59), Decl(generatedContextualTyping.ts, 123, 70)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } ->x120 : Symbol(x120, Decl(generatedContextualTyping.ts, 123, 103)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 124, 25)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 124, 55)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 124, 61)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x121(parm: () => Base[] = () => [d1, d2]) { } ->x121 : Symbol(x121, Decl(generatedContextualTyping.ts, 124, 96)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 125, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x122(parm: () => Base[] = function() { return [d1, d2] }) { } ->x122 : Symbol(x122, Decl(generatedContextualTyping.ts, 125, 54)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 126, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } ->x123 : Symbol(x123, Decl(generatedContextualTyping.ts, 126, 70)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 127, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 127, 34)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x124(parm: { (): Base[]; } = () => [d1, d2]) { } ->x124 : Symbol(x124, Decl(generatedContextualTyping.ts, 127, 76)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 128, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } ->x125 : Symbol(x125, Decl(generatedContextualTyping.ts, 128, 57)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 129, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } ->x126 : Symbol(x126, Decl(generatedContextualTyping.ts, 129, 73)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 130, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 130, 37)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x127(parm: Base[] = [d1, d2]) { } ->x127 : Symbol(x127, Decl(generatedContextualTyping.ts, 130, 79)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 131, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x128(parm: Array = [d1, d2]) { } ->x128 : Symbol(x128, Decl(generatedContextualTyping.ts, 131, 42)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 132, 14)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x129(parm: { [n: number]: Base; } = [d1, d2]) { } ->x129 : Symbol(x129, Decl(generatedContextualTyping.ts, 132, 47)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 133, 14)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 133, 23)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } ->x130 : Symbol(x130, Decl(generatedContextualTyping.ts, 133, 58)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 134, 14)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 134, 21)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 134, 38)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } ->x131 : Symbol(x131, Decl(generatedContextualTyping.ts, 134, 57)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 135, 14)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 135, 21)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 135, 40), Decl(generatedContextualTyping.ts, 135, 51)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 135, 40), Decl(generatedContextualTyping.ts, 135, 51)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } ->x132 : Symbol(x132, Decl(generatedContextualTyping.ts, 135, 82)) ->parm : Symbol(parm, Decl(generatedContextualTyping.ts, 136, 14)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 136, 36)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 136, 42)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x133(): () => Base[] { return () => [d1, d2]; } ->x133 : Symbol(x133, Decl(generatedContextualTyping.ts, 136, 75)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x134(): () => Base[] { return function() { return [d1, d2] }; } ->x134 : Symbol(x134, Decl(generatedContextualTyping.ts, 137, 56)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x135(): () => Base[] { return function named() { return [d1, d2] }; } ->x135 : Symbol(x135, Decl(generatedContextualTyping.ts, 138, 72)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 139, 38)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x136(): { (): Base[]; } { return () => [d1, d2]; } ->x136 : Symbol(x136, Decl(generatedContextualTyping.ts, 139, 78)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } ->x137 : Symbol(x137, Decl(generatedContextualTyping.ts, 140, 59)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } ->x138 : Symbol(x138, Decl(generatedContextualTyping.ts, 141, 75)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 142, 41)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x139(): Base[] { return [d1, d2]; } ->x139 : Symbol(x139, Decl(generatedContextualTyping.ts, 142, 81)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x140(): Array { return [d1, d2]; } ->x140 : Symbol(x140, Decl(generatedContextualTyping.ts, 143, 44)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x141(): { [n: number]: Base; } { return [d1, d2]; } ->x141 : Symbol(x141, Decl(generatedContextualTyping.ts, 144, 49)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 145, 20)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x142(): {n: Base[]; } { return { n: [d1, d2] }; } ->x142 : Symbol(x142, Decl(generatedContextualTyping.ts, 145, 60)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 146, 18)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 146, 42)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; } ->x143 : Symbol(x143, Decl(generatedContextualTyping.ts, 146, 59)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 147, 18)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 147, 44), Decl(generatedContextualTyping.ts, 147, 55)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 147, 44), Decl(generatedContextualTyping.ts, 147, 55)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -function x144(): Genric { return { func: n => { return [d1, d2]; } }; } ->x144 : Symbol(x144, Decl(generatedContextualTyping.ts, 147, 84)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 148, 40)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 148, 46)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } ->x145 : Symbol(x145, Decl(generatedContextualTyping.ts, 148, 77)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } ->x146 : Symbol(x146, Decl(generatedContextualTyping.ts, 149, 79)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } ->x147 : Symbol(x147, Decl(generatedContextualTyping.ts, 150, 111)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 151, 38)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 151, 83)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } ->x148 : Symbol(x148, Decl(generatedContextualTyping.ts, 151, 123)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } ->x149 : Symbol(x149, Decl(generatedContextualTyping.ts, 152, 82)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } ->x150 : Symbol(x150, Decl(generatedContextualTyping.ts, 153, 114)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 154, 41)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 154, 86)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x151(): Base[] { return [d1, d2]; return [d1, d2]; } ->x151 : Symbol(x151, Decl(generatedContextualTyping.ts, 154, 126)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x152(): Array { return [d1, d2]; return [d1, d2]; } ->x152 : Symbol(x152, Decl(generatedContextualTyping.ts, 155, 61)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } ->x153 : Symbol(x153, Decl(generatedContextualTyping.ts, 156, 66)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 157, 20)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] }; } ->x154 : Symbol(x154, Decl(generatedContextualTyping.ts, 157, 77)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 158, 18)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 158, 42)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 158, 66)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; return n => { var n: Base[]; return null; }; } ->x155 : Symbol(x155, Decl(generatedContextualTyping.ts, 158, 83)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 159, 18)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 44), Decl(generatedContextualTyping.ts, 159, 55)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 44), Decl(generatedContextualTyping.ts, 159, 55)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 89), Decl(generatedContextualTyping.ts, 159, 100)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 89), Decl(generatedContextualTyping.ts, 159, 100)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } ->x156 : Symbol(x156, Decl(generatedContextualTyping.ts, 159, 129)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 160, 40)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 160, 46)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 160, 84)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 160, 90)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x157: () => () => Base[] = () => { return () => [d1, d2]; }; ->x157 : Symbol(x157, Decl(generatedContextualTyping.ts, 161, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x158: () => () => Base[] = () => { return function() { return [d1, d2] }; }; ->x158 : Symbol(x158, Decl(generatedContextualTyping.ts, 162, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x159: () => () => Base[] = () => { return function named() { return [d1, d2] }; }; ->x159 : Symbol(x159, Decl(generatedContextualTyping.ts, 163, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 163, 45)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x160: () => { (): Base[]; } = () => { return () => [d1, d2]; }; ->x160 : Symbol(x160, Decl(generatedContextualTyping.ts, 164, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x161: () => { (): Base[]; } = () => { return function() { return [d1, d2] }; }; ->x161 : Symbol(x161, Decl(generatedContextualTyping.ts, 165, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x162: () => { (): Base[]; } = () => { return function named() { return [d1, d2] }; }; ->x162 : Symbol(x162, Decl(generatedContextualTyping.ts, 166, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 166, 48)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x163: () => Base[] = () => { return [d1, d2]; }; ->x163 : Symbol(x163, Decl(generatedContextualTyping.ts, 167, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x164: () => Array = () => { return [d1, d2]; }; ->x164 : Symbol(x164, Decl(generatedContextualTyping.ts, 168, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x165: () => { [n: number]: Base; } = () => { return [d1, d2]; }; ->x165 : Symbol(x165, Decl(generatedContextualTyping.ts, 169, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 169, 19)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x166: () => {n: Base[]; } = () => { return { n: [d1, d2] }; }; ->x166 : Symbol(x166, Decl(generatedContextualTyping.ts, 170, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 170, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 170, 49)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return null; }; }; ->x167 : Symbol(x167, Decl(generatedContextualTyping.ts, 171, 3)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 171, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 171, 51), Decl(generatedContextualTyping.ts, 171, 62)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 171, 51), Decl(generatedContextualTyping.ts, 171, 62)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; ->x168 : Symbol(x168, Decl(generatedContextualTyping.ts, 172, 3)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 172, 47)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 172, 53)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x169: () => () => Base[] = function() { return () => [d1, d2]; }; ->x169 : Symbol(x169, Decl(generatedContextualTyping.ts, 173, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x170: () => () => Base[] = function() { return function() { return [d1, d2] }; }; ->x170 : Symbol(x170, Decl(generatedContextualTyping.ts, 174, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x171: () => () => Base[] = function() { return function named() { return [d1, d2] }; }; ->x171 : Symbol(x171, Decl(generatedContextualTyping.ts, 175, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 175, 50)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x172: () => { (): Base[]; } = function() { return () => [d1, d2]; }; ->x172 : Symbol(x172, Decl(generatedContextualTyping.ts, 176, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x173: () => { (): Base[]; } = function() { return function() { return [d1, d2] }; }; ->x173 : Symbol(x173, Decl(generatedContextualTyping.ts, 177, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x174: () => { (): Base[]; } = function() { return function named() { return [d1, d2] }; }; ->x174 : Symbol(x174, Decl(generatedContextualTyping.ts, 178, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 178, 53)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x175: () => Base[] = function() { return [d1, d2]; }; ->x175 : Symbol(x175, Decl(generatedContextualTyping.ts, 179, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x176: () => Array = function() { return [d1, d2]; }; ->x176 : Symbol(x176, Decl(generatedContextualTyping.ts, 180, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x177: () => { [n: number]: Base; } = function() { return [d1, d2]; }; ->x177 : Symbol(x177, Decl(generatedContextualTyping.ts, 181, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 181, 19)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x178: () => {n: Base[]; } = function() { return { n: [d1, d2] }; }; ->x178 : Symbol(x178, Decl(generatedContextualTyping.ts, 182, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 182, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 182, 54)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; return null; }; }; ->x179 : Symbol(x179, Decl(generatedContextualTyping.ts, 183, 3)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 183, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 183, 56), Decl(generatedContextualTyping.ts, 183, 67)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 183, 56), Decl(generatedContextualTyping.ts, 183, 67)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; ->x180 : Symbol(x180, Decl(generatedContextualTyping.ts, 184, 3)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 184, 52)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 184, 58)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x181 { var t: () => Base[] = () => [d1, d2]; } ->x181 : Symbol(x181, Decl(generatedContextualTyping.ts, 184, 90)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 185, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x182 { var t: () => Base[] = function() { return [d1, d2] }; } ->x182 : Symbol(x182, Decl(generatedContextualTyping.ts, 185, 53)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 186, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } ->x183 : Symbol(x183, Decl(generatedContextualTyping.ts, 186, 69)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 187, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 187, 35)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x184 { var t: { (): Base[]; } = () => [d1, d2]; } ->x184 : Symbol(x184, Decl(generatedContextualTyping.ts, 187, 75)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 188, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } ->x185 : Symbol(x185, Decl(generatedContextualTyping.ts, 188, 56)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 189, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } ->x186 : Symbol(x186, Decl(generatedContextualTyping.ts, 189, 72)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 190, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 190, 38)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x187 { var t: Base[] = [d1, d2]; } ->x187 : Symbol(x187, Decl(generatedContextualTyping.ts, 190, 78)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 191, 17)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x188 { var t: Array = [d1, d2]; } ->x188 : Symbol(x188, Decl(generatedContextualTyping.ts, 191, 41)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 192, 17)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x189 { var t: { [n: number]: Base; } = [d1, d2]; } ->x189 : Symbol(x189, Decl(generatedContextualTyping.ts, 192, 46)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 193, 17)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 193, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } ->x190 : Symbol(x190, Decl(generatedContextualTyping.ts, 193, 57)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 194, 17)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 194, 22)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 194, 39)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } ->x191 : Symbol(x191, Decl(generatedContextualTyping.ts, 194, 56)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 195, 17)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 195, 22)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 195, 41), Decl(generatedContextualTyping.ts, 195, 52)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 195, 41), Decl(generatedContextualTyping.ts, 195, 52)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } ->x192 : Symbol(x192, Decl(generatedContextualTyping.ts, 195, 81)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 196, 17)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 196, 37)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 196, 43)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x193 { export var t: () => Base[] = () => [d1, d2]; } ->x193 : Symbol(x193, Decl(generatedContextualTyping.ts, 196, 74)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 197, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } ->x194 : Symbol(x194, Decl(generatedContextualTyping.ts, 197, 60)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 198, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; } ->x195 : Symbol(x195, Decl(generatedContextualTyping.ts, 198, 76)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 199, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 199, 42)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } ->x196 : Symbol(x196, Decl(generatedContextualTyping.ts, 199, 82)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 200, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } ->x197 : Symbol(x197, Decl(generatedContextualTyping.ts, 200, 63)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 201, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] }; } ->x198 : Symbol(x198, Decl(generatedContextualTyping.ts, 201, 79)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 202, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 202, 45)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x199 { export var t: Base[] = [d1, d2]; } ->x199 : Symbol(x199, Decl(generatedContextualTyping.ts, 202, 85)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 203, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x200 { export var t: Array = [d1, d2]; } ->x200 : Symbol(x200, Decl(generatedContextualTyping.ts, 203, 48)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 204, 24)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } ->x201 : Symbol(x201, Decl(generatedContextualTyping.ts, 204, 53)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 205, 24)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 205, 31)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } ->x202 : Symbol(x202, Decl(generatedContextualTyping.ts, 205, 64)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 206, 24)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 206, 29)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 206, 46)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } ->x203 : Symbol(x203, Decl(generatedContextualTyping.ts, 206, 63)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 207, 24)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 207, 29)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 207, 48), Decl(generatedContextualTyping.ts, 207, 59)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 207, 48), Decl(generatedContextualTyping.ts, 207, 59)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } ->x204 : Symbol(x204, Decl(generatedContextualTyping.ts, 207, 88)) ->t : Symbol(t, Decl(generatedContextualTyping.ts, 208, 24)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 208, 44)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 208, 50)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x206 = <() => Base[]>function() { return [d1, d2] }; ->x206 : Symbol(x206, Decl(generatedContextualTyping.ts, 209, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x207 = <() => Base[]>function named() { return [d1, d2] }; ->x207 : Symbol(x207, Decl(generatedContextualTyping.ts, 210, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 210, 25)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; ->x209 : Symbol(x209, Decl(generatedContextualTyping.ts, 211, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x210 = <{ (): Base[]; }>function named() { return [d1, d2] }; ->x210 : Symbol(x210, Decl(generatedContextualTyping.ts, 212, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 212, 28)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x211 = [d1, d2]; ->x211 : Symbol(x211, Decl(generatedContextualTyping.ts, 213, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x212 = >[d1, d2]; ->x212 : Symbol(x212, Decl(generatedContextualTyping.ts, 214, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x213 = <{ [n: number]: Base; }>[d1, d2]; ->x213 : Symbol(x213, Decl(generatedContextualTyping.ts, 215, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 215, 15)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x214 = <{n: Base[]; } >{ n: [d1, d2] }; ->x214 : Symbol(x214, Decl(generatedContextualTyping.ts, 216, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 216, 13)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 216, 28)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x216 = >{ func: n => { return [d1, d2]; } }; ->x216 : Symbol(x216, Decl(generatedContextualTyping.ts, 217, 3)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 217, 26)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 217, 32)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x217 = (<() => Base[]>undefined) || function() { return [d1, d2] }; ->x217 : Symbol(x217, Decl(generatedContextualTyping.ts, 218, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x218 = (<() => Base[]>undefined) || function named() { return [d1, d2] }; ->x218 : Symbol(x218, Decl(generatedContextualTyping.ts, 219, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 219, 39)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x219 = (<{ (): Base[]; }>undefined) || function() { return [d1, d2] }; ->x219 : Symbol(x219, Decl(generatedContextualTyping.ts, 220, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x220 = (<{ (): Base[]; }>undefined) || function named() { return [d1, d2] }; ->x220 : Symbol(x220, Decl(generatedContextualTyping.ts, 221, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 221, 42)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x221 = (undefined) || [d1, d2]; ->x221 : Symbol(x221, Decl(generatedContextualTyping.ts, 222, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x222 = (>undefined) || [d1, d2]; ->x222 : Symbol(x222, Decl(generatedContextualTyping.ts, 223, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2]; ->x223 : Symbol(x223, Decl(generatedContextualTyping.ts, 224, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 224, 16)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x224 = (<{n: Base[]; } >undefined) || { n: [d1, d2] }; ->x224 : Symbol(x224, Decl(generatedContextualTyping.ts, 225, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 225, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 225, 43)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x225: () => Base[]; x225 = () => [d1, d2]; ->x225 : Symbol(x225, Decl(generatedContextualTyping.ts, 226, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x225 : Symbol(x225, Decl(generatedContextualTyping.ts, 226, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x226: () => Base[]; x226 = function() { return [d1, d2] }; ->x226 : Symbol(x226, Decl(generatedContextualTyping.ts, 227, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x226 : Symbol(x226, Decl(generatedContextualTyping.ts, 227, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x227: () => Base[]; x227 = function named() { return [d1, d2] }; ->x227 : Symbol(x227, Decl(generatedContextualTyping.ts, 228, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x227 : Symbol(x227, Decl(generatedContextualTyping.ts, 228, 3)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 228, 30)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x228: { (): Base[]; }; x228 = () => [d1, d2]; ->x228 : Symbol(x228, Decl(generatedContextualTyping.ts, 229, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x228 : Symbol(x228, Decl(generatedContextualTyping.ts, 229, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x229: { (): Base[]; }; x229 = function() { return [d1, d2] }; ->x229 : Symbol(x229, Decl(generatedContextualTyping.ts, 230, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x229 : Symbol(x229, Decl(generatedContextualTyping.ts, 230, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x230: { (): Base[]; }; x230 = function named() { return [d1, d2] }; ->x230 : Symbol(x230, Decl(generatedContextualTyping.ts, 231, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x230 : Symbol(x230, Decl(generatedContextualTyping.ts, 231, 3)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 231, 33)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x231: Base[]; x231 = [d1, d2]; ->x231 : Symbol(x231, Decl(generatedContextualTyping.ts, 232, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x231 : Symbol(x231, Decl(generatedContextualTyping.ts, 232, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x232: Array; x232 = [d1, d2]; ->x232 : Symbol(x232, Decl(generatedContextualTyping.ts, 233, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x232 : Symbol(x232, Decl(generatedContextualTyping.ts, 233, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x233: { [n: number]: Base; }; x233 = [d1, d2]; ->x233 : Symbol(x233, Decl(generatedContextualTyping.ts, 234, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 234, 13)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x233 : Symbol(x233, Decl(generatedContextualTyping.ts, 234, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x234: {n: Base[]; } ; x234 = { n: [d1, d2] }; ->x234 : Symbol(x234, Decl(generatedContextualTyping.ts, 235, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 235, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x234 : Symbol(x234, Decl(generatedContextualTyping.ts, 235, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 235, 34)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; ->x235 : Symbol(x235, Decl(generatedContextualTyping.ts, 236, 3)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 236, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x235 : Symbol(x235, Decl(generatedContextualTyping.ts, 236, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 236, 36), Decl(generatedContextualTyping.ts, 236, 47)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 236, 36), Decl(generatedContextualTyping.ts, 236, 47)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; ->x236 : Symbol(x236, Decl(generatedContextualTyping.ts, 237, 3)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x236 : Symbol(x236, Decl(generatedContextualTyping.ts, 237, 3)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 237, 32)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 237, 38)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x237: { n: () => Base[]; } = { n: () => [d1, d2] }; ->x237 : Symbol(x237, Decl(generatedContextualTyping.ts, 238, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 238, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 238, 34)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x238: { n: () => Base[]; } = { n: function() { return [d1, d2] } }; ->x238 : Symbol(x238, Decl(generatedContextualTyping.ts, 239, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 239, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 239, 34)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x239: { n: () => Base[]; } = { n: function named() { return [d1, d2] } }; ->x239 : Symbol(x239, Decl(generatedContextualTyping.ts, 240, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 240, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 240, 34)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 240, 37)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x240: { n: { (): Base[]; }; } = { n: () => [d1, d2] }; ->x240 : Symbol(x240, Decl(generatedContextualTyping.ts, 241, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 241, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 241, 37)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x241: { n: { (): Base[]; }; } = { n: function() { return [d1, d2] } }; ->x241 : Symbol(x241, Decl(generatedContextualTyping.ts, 242, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 242, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 242, 37)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x242: { n: { (): Base[]; }; } = { n: function named() { return [d1, d2] } }; ->x242 : Symbol(x242, Decl(generatedContextualTyping.ts, 243, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 243, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 243, 37)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 243, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x243: { n: Base[]; } = { n: [d1, d2] }; ->x243 : Symbol(x243, Decl(generatedContextualTyping.ts, 244, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 244, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 244, 28)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x244: { n: Array; } = { n: [d1, d2] }; ->x244 : Symbol(x244, Decl(generatedContextualTyping.ts, 245, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 245, 11)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 245, 33)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x245: { n: { [n: number]: Base; }; } = { n: [d1, d2] }; ->x245 : Symbol(x245, Decl(generatedContextualTyping.ts, 246, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 18)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 44)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x246: { n: {n: Base[]; } ; } = { n: { n: [d1, d2] } }; ->x246 : Symbol(x246, Decl(generatedContextualTyping.ts, 247, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 11)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 16)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 36)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 41)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } }; ->x247 : Symbol(x247, Decl(generatedContextualTyping.ts, 248, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 11)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 248, 16)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 40)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 43), Decl(generatedContextualTyping.ts, 248, 54)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 43), Decl(generatedContextualTyping.ts, 248, 54)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; ->x248 : Symbol(x248, Decl(generatedContextualTyping.ts, 249, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 11)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 34)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 249, 39)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 45)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x252: { (): Base[]; }[] = [() => [d1, d2]]; ->x252 : Symbol(x252, Decl(generatedContextualTyping.ts, 250, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x253: { (): Base[]; }[] = [function() { return [d1, d2] }]; ->x253 : Symbol(x253, Decl(generatedContextualTyping.ts, 251, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x254: { (): Base[]; }[] = [function named() { return [d1, d2] }]; ->x254 : Symbol(x254, Decl(generatedContextualTyping.ts, 252, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 252, 31)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x255: Base[][] = [[d1, d2]]; ->x255 : Symbol(x255, Decl(generatedContextualTyping.ts, 253, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x256: Array[] = [[d1, d2]]; ->x256 : Symbol(x256, Decl(generatedContextualTyping.ts, 254, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x257: { [n: number]: Base; }[] = [[d1, d2]]; ->x257 : Symbol(x257, Decl(generatedContextualTyping.ts, 255, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 255, 13)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x258: {n: Base[]; } [] = [{ n: [d1, d2] }]; ->x258 : Symbol(x258, Decl(generatedContextualTyping.ts, 256, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 256, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 256, 31)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x260: Genric[] = [{ func: n => { return [d1, d2]; } }]; ->x260 : Symbol(x260, Decl(generatedContextualTyping.ts, 257, 3)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 257, 29)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 257, 35)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x261: () => Base[] = function() { return [d1, d2] } || undefined; ->x261 : Symbol(x261, Decl(generatedContextualTyping.ts, 258, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x262: () => Base[] = function named() { return [d1, d2] } || undefined; ->x262 : Symbol(x262, Decl(generatedContextualTyping.ts, 259, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 259, 24)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; ->x263 : Symbol(x263, Decl(generatedContextualTyping.ts, 260, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; ->x264 : Symbol(x264, Decl(generatedContextualTyping.ts, 261, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 261, 27)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x265: Base[] = [d1, d2] || undefined; ->x265 : Symbol(x265, Decl(generatedContextualTyping.ts, 262, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x266: Array = [d1, d2] || undefined; ->x266 : Symbol(x266, Decl(generatedContextualTyping.ts, 263, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x267: { [n: number]: Base; } = [d1, d2] || undefined; ->x267 : Symbol(x267, Decl(generatedContextualTyping.ts, 264, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 264, 13)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; ->x268 : Symbol(x268, Decl(generatedContextualTyping.ts, 265, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 265, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 265, 28)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x269: () => Base[] = undefined || function() { return [d1, d2] }; ->x269 : Symbol(x269, Decl(generatedContextualTyping.ts, 266, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x270: () => Base[] = undefined || function named() { return [d1, d2] }; ->x270 : Symbol(x270, Decl(generatedContextualTyping.ts, 267, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 267, 37)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x271: { (): Base[]; } = undefined || function() { return [d1, d2] }; ->x271 : Symbol(x271, Decl(generatedContextualTyping.ts, 268, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x272: { (): Base[]; } = undefined || function named() { return [d1, d2] }; ->x272 : Symbol(x272, Decl(generatedContextualTyping.ts, 269, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 269, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x273: Base[] = undefined || [d1, d2]; ->x273 : Symbol(x273, Decl(generatedContextualTyping.ts, 270, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x274: Array = undefined || [d1, d2]; ->x274 : Symbol(x274, Decl(generatedContextualTyping.ts, 271, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x275: { [n: number]: Base; } = undefined || [d1, d2]; ->x275 : Symbol(x275, Decl(generatedContextualTyping.ts, 272, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 272, 13)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x276: {n: Base[]; } = undefined || { n: [d1, d2] }; ->x276 : Symbol(x276, Decl(generatedContextualTyping.ts, 273, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 273, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 273, 41)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x277: () => Base[] = function() { return [d1, d2] } || function() { return [d1, d2] }; ->x277 : Symbol(x277, Decl(generatedContextualTyping.ts, 274, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x278: () => Base[] = function named() { return [d1, d2] } || function named() { return [d1, d2] }; ->x278 : Symbol(x278, Decl(generatedContextualTyping.ts, 275, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 275, 24)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 275, 64)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x279: { (): Base[]; } = function() { return [d1, d2] } || function() { return [d1, d2] }; ->x279 : Symbol(x279, Decl(generatedContextualTyping.ts, 276, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x280: { (): Base[]; } = function named() { return [d1, d2] } || function named() { return [d1, d2] }; ->x280 : Symbol(x280, Decl(generatedContextualTyping.ts, 277, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 277, 27)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 277, 67)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x281: Base[] = [d1, d2] || [d1, d2]; ->x281 : Symbol(x281, Decl(generatedContextualTyping.ts, 278, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x282: Array = [d1, d2] || [d1, d2]; ->x282 : Symbol(x282, Decl(generatedContextualTyping.ts, 279, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2]; ->x283 : Symbol(x283, Decl(generatedContextualTyping.ts, 280, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 280, 13)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x284: {n: Base[]; } = { n: [d1, d2] } || { n: [d1, d2] }; ->x284 : Symbol(x284, Decl(generatedContextualTyping.ts, 281, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 281, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 281, 28)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 281, 47)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; ->x285 : Symbol(x285, Decl(generatedContextualTyping.ts, 282, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; ->x286 : Symbol(x286, Decl(generatedContextualTyping.ts, 283, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x287: () => Base[] = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; ->x287 : Symbol(x287, Decl(generatedContextualTyping.ts, 284, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 284, 31)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 284, 70)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; ->x288 : Symbol(x288, Decl(generatedContextualTyping.ts, 285, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; ->x289 : Symbol(x289, Decl(generatedContextualTyping.ts, 286, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; ->x290 : Symbol(x290, Decl(generatedContextualTyping.ts, 287, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 287, 34)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 287, 73)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x291: Base[] = true ? [d1, d2] : [d1, d2]; ->x291 : Symbol(x291, Decl(generatedContextualTyping.ts, 288, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x292: Array = true ? [d1, d2] : [d1, d2]; ->x292 : Symbol(x292, Decl(generatedContextualTyping.ts, 289, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; ->x293 : Symbol(x293, Decl(generatedContextualTyping.ts, 290, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 290, 13)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; ->x294 : Symbol(x294, Decl(generatedContextualTyping.ts, 291, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 291, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 291, 35)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 291, 53)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; }; ->x295 : Symbol(x295, Decl(generatedContextualTyping.ts, 292, 3)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 292, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 37), Decl(generatedContextualTyping.ts, 292, 48)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 37), Decl(generatedContextualTyping.ts, 292, 48)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 76), Decl(generatedContextualTyping.ts, 292, 87)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 76), Decl(generatedContextualTyping.ts, 292, 87)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; ->x296 : Symbol(x296, Decl(generatedContextualTyping.ts, 293, 3)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 293, 33)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 293, 39)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 293, 71)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 293, 77)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x297: () => Base[] = true ? undefined : () => [d1, d2]; ->x297 : Symbol(x297, Decl(generatedContextualTyping.ts, 294, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; ->x298 : Symbol(x298, Decl(generatedContextualTyping.ts, 295, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] }; ->x299 : Symbol(x299, Decl(generatedContextualTyping.ts, 296, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 296, 43)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; ->x300 : Symbol(x300, Decl(generatedContextualTyping.ts, 297, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; ->x301 : Symbol(x301, Decl(generatedContextualTyping.ts, 298, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2] }; ->x302 : Symbol(x302, Decl(generatedContextualTyping.ts, 299, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 299, 46)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x303: Base[] = true ? undefined : [d1, d2]; ->x303 : Symbol(x303, Decl(generatedContextualTyping.ts, 300, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x304: Array = true ? undefined : [d1, d2]; ->x304 : Symbol(x304, Decl(generatedContextualTyping.ts, 301, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; ->x305 : Symbol(x305, Decl(generatedContextualTyping.ts, 302, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 302, 13)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; ->x306 : Symbol(x306, Decl(generatedContextualTyping.ts, 303, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 303, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 303, 47)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return null; }; ->x307 : Symbol(x307, Decl(generatedContextualTyping.ts, 304, 3)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 304, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 304, 49), Decl(generatedContextualTyping.ts, 304, 60)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 304, 49), Decl(generatedContextualTyping.ts, 304, 60)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; ->x308 : Symbol(x308, Decl(generatedContextualTyping.ts, 305, 3)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 305, 45)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 305, 51)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x309: () => Base[] = true ? () => [d1, d2] : undefined; ->x309 : Symbol(x309, Decl(generatedContextualTyping.ts, 306, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; ->x310 : Symbol(x310, Decl(generatedContextualTyping.ts, 307, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined; ->x311 : Symbol(x311, Decl(generatedContextualTyping.ts, 308, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 308, 31)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; ->x312 : Symbol(x312, Decl(generatedContextualTyping.ts, 309, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; ->x313 : Symbol(x313, Decl(generatedContextualTyping.ts, 310, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefined; ->x314 : Symbol(x314, Decl(generatedContextualTyping.ts, 311, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 311, 34)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x315: Base[] = true ? [d1, d2] : undefined; ->x315 : Symbol(x315, Decl(generatedContextualTyping.ts, 312, 3)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x316: Array = true ? [d1, d2] : undefined; ->x316 : Symbol(x316, Decl(generatedContextualTyping.ts, 313, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; ->x317 : Symbol(x317, Decl(generatedContextualTyping.ts, 314, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 314, 13)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; ->x318 : Symbol(x318, Decl(generatedContextualTyping.ts, 315, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 315, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 315, 35)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : undefined; ->x319 : Symbol(x319, Decl(generatedContextualTyping.ts, 316, 3)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 316, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 316, 37), Decl(generatedContextualTyping.ts, 316, 48)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 316, 37), Decl(generatedContextualTyping.ts, 316, 48)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->undefined : Symbol(undefined) - -var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; ->x320 : Symbol(x320, Decl(generatedContextualTyping.ts, 317, 3)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 317, 33)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 317, 39)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) ->undefined : Symbol(undefined) - -function x321(n: () => Base[]) { }; x321(() => [d1, d2]); ->x321 : Symbol(x321, Decl(generatedContextualTyping.ts, 317, 80)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 318, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x321 : Symbol(x321, Decl(generatedContextualTyping.ts, 317, 80)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); ->x322 : Symbol(x322, Decl(generatedContextualTyping.ts, 318, 57)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 319, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x322 : Symbol(x322, Decl(generatedContextualTyping.ts, 318, 57)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); ->x323 : Symbol(x323, Decl(generatedContextualTyping.ts, 319, 73)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 320, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x323 : Symbol(x323, Decl(generatedContextualTyping.ts, 319, 73)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 320, 41)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); ->x324 : Symbol(x324, Decl(generatedContextualTyping.ts, 320, 79)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 321, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x324 : Symbol(x324, Decl(generatedContextualTyping.ts, 320, 79)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); ->x325 : Symbol(x325, Decl(generatedContextualTyping.ts, 321, 60)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 322, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x325 : Symbol(x325, Decl(generatedContextualTyping.ts, 321, 60)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] }); ->x326 : Symbol(x326, Decl(generatedContextualTyping.ts, 322, 76)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 323, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x326 : Symbol(x326, Decl(generatedContextualTyping.ts, 322, 76)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 323, 44)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x327(n: Base[]) { }; x327([d1, d2]); ->x327 : Symbol(x327, Decl(generatedContextualTyping.ts, 323, 82)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 324, 14)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x327 : Symbol(x327, Decl(generatedContextualTyping.ts, 323, 82)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x328(n: Array) { }; x328([d1, d2]); ->x328 : Symbol(x328, Decl(generatedContextualTyping.ts, 324, 45)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 325, 14)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x328 : Symbol(x328, Decl(generatedContextualTyping.ts, 324, 45)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); ->x329 : Symbol(x329, Decl(generatedContextualTyping.ts, 325, 50)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 326, 14)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 326, 20)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x329 : Symbol(x329, Decl(generatedContextualTyping.ts, 325, 50)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); ->x330 : Symbol(x330, Decl(generatedContextualTyping.ts, 326, 61)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 14)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 18)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x330 : Symbol(x330, Decl(generatedContextualTyping.ts, 326, 61)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 44)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null; }); ->x331 : Symbol(x331, Decl(generatedContextualTyping.ts, 327, 60)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 14)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 328, 18)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x331 : Symbol(x331, Decl(generatedContextualTyping.ts, 327, 60)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 47), Decl(generatedContextualTyping.ts, 328, 57)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 47), Decl(generatedContextualTyping.ts, 328, 57)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); ->x332 : Symbol(x332, Decl(generatedContextualTyping.ts, 328, 85)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 329, 14)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x332 : Symbol(x332, Decl(generatedContextualTyping.ts, 328, 85)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 329, 42)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 329, 48)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x333 = (n: () => Base[]) => n; x333(() => [d1, d2]); ->x333 : Symbol(x333, Decl(generatedContextualTyping.ts, 330, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 330, 12)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 330, 12)) ->x333 : Symbol(x333, Decl(generatedContextualTyping.ts, 330, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x334 = (n: () => Base[]) => n; x334(function() { return [d1, d2] }); ->x334 : Symbol(x334, Decl(generatedContextualTyping.ts, 331, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 331, 12)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 331, 12)) ->x334 : Symbol(x334, Decl(generatedContextualTyping.ts, 331, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x335 = (n: () => Base[]) => n; x335(function named() { return [d1, d2] }); ->x335 : Symbol(x335, Decl(generatedContextualTyping.ts, 332, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 332, 12)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 332, 12)) ->x335 : Symbol(x335, Decl(generatedContextualTyping.ts, 332, 3)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 332, 40)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x336 = (n: { (): Base[]; }) => n; x336(() => [d1, d2]); ->x336 : Symbol(x336, Decl(generatedContextualTyping.ts, 333, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 333, 12)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 333, 12)) ->x336 : Symbol(x336, Decl(generatedContextualTyping.ts, 333, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x337 = (n: { (): Base[]; }) => n; x337(function() { return [d1, d2] }); ->x337 : Symbol(x337, Decl(generatedContextualTyping.ts, 334, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 334, 12)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 334, 12)) ->x337 : Symbol(x337, Decl(generatedContextualTyping.ts, 334, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x338 = (n: { (): Base[]; }) => n; x338(function named() { return [d1, d2] }); ->x338 : Symbol(x338, Decl(generatedContextualTyping.ts, 335, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 335, 12)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 335, 12)) ->x338 : Symbol(x338, Decl(generatedContextualTyping.ts, 335, 3)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 335, 43)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x339 = (n: Base[]) => n; x339([d1, d2]); ->x339 : Symbol(x339, Decl(generatedContextualTyping.ts, 336, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 336, 12)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 336, 12)) ->x339 : Symbol(x339, Decl(generatedContextualTyping.ts, 336, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x340 = (n: Array) => n; x340([d1, d2]); ->x340 : Symbol(x340, Decl(generatedContextualTyping.ts, 337, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 337, 12)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 337, 12)) ->x340 : Symbol(x340, Decl(generatedContextualTyping.ts, 337, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x341 = (n: { [n: number]: Base; }) => n; x341([d1, d2]); ->x341 : Symbol(x341, Decl(generatedContextualTyping.ts, 338, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 12)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 18)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 12)) ->x341 : Symbol(x341, Decl(generatedContextualTyping.ts, 338, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x342 = (n: {n: Base[]; } ) => n; x342({ n: [d1, d2] }); ->x342 : Symbol(x342, Decl(generatedContextualTyping.ts, 339, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 12)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 16)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 12)) ->x342 : Symbol(x342, Decl(generatedContextualTyping.ts, 339, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 43)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; }); ->x343 : Symbol(x343, Decl(generatedContextualTyping.ts, 340, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 12)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 340, 16)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 12)) ->x343 : Symbol(x343, Decl(generatedContextualTyping.ts, 340, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 46), Decl(generatedContextualTyping.ts, 340, 56)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 46), Decl(generatedContextualTyping.ts, 340, 56)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); ->x344 : Symbol(x344, Decl(generatedContextualTyping.ts, 341, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 12)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 12)) ->x344 : Symbol(x344, Decl(generatedContextualTyping.ts, 341, 3)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 341, 41)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 47)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x345 = function(n: () => Base[]) { }; x345(() => [d1, d2]); ->x345 : Symbol(x345, Decl(generatedContextualTyping.ts, 342, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 342, 20)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x345 : Symbol(x345, Decl(generatedContextualTyping.ts, 342, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x346 = function(n: () => Base[]) { }; x346(function() { return [d1, d2] }); ->x346 : Symbol(x346, Decl(generatedContextualTyping.ts, 343, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 343, 20)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x346 : Symbol(x346, Decl(generatedContextualTyping.ts, 343, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x347 = function(n: () => Base[]) { }; x347(function named() { return [d1, d2] }); ->x347 : Symbol(x347, Decl(generatedContextualTyping.ts, 344, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 344, 20)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x347 : Symbol(x347, Decl(generatedContextualTyping.ts, 344, 3)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 344, 47)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x348 = function(n: { (): Base[]; }) { }; x348(() => [d1, d2]); ->x348 : Symbol(x348, Decl(generatedContextualTyping.ts, 345, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 345, 20)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x348 : Symbol(x348, Decl(generatedContextualTyping.ts, 345, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x349 = function(n: { (): Base[]; }) { }; x349(function() { return [d1, d2] }); ->x349 : Symbol(x349, Decl(generatedContextualTyping.ts, 346, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 346, 20)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x349 : Symbol(x349, Decl(generatedContextualTyping.ts, 346, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x350 = function(n: { (): Base[]; }) { }; x350(function named() { return [d1, d2] }); ->x350 : Symbol(x350, Decl(generatedContextualTyping.ts, 347, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 347, 20)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x350 : Symbol(x350, Decl(generatedContextualTyping.ts, 347, 3)) ->named : Symbol(named, Decl(generatedContextualTyping.ts, 347, 50)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x351 = function(n: Base[]) { }; x351([d1, d2]); ->x351 : Symbol(x351, Decl(generatedContextualTyping.ts, 348, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 348, 20)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x351 : Symbol(x351, Decl(generatedContextualTyping.ts, 348, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x352 = function(n: Array) { }; x352([d1, d2]); ->x352 : Symbol(x352, Decl(generatedContextualTyping.ts, 349, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 349, 20)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x352 : Symbol(x352, Decl(generatedContextualTyping.ts, 349, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x353 = function(n: { [n: number]: Base; }) { }; x353([d1, d2]); ->x353 : Symbol(x353, Decl(generatedContextualTyping.ts, 350, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 350, 20)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 350, 26)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x353 : Symbol(x353, Decl(generatedContextualTyping.ts, 350, 3)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x354 = function(n: {n: Base[]; } ) { }; x354({ n: [d1, d2] }); ->x354 : Symbol(x354, Decl(generatedContextualTyping.ts, 351, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 20)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x354 : Symbol(x354, Decl(generatedContextualTyping.ts, 351, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 50)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - -var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; return null; }); ->x355 : Symbol(x355, Decl(generatedContextualTyping.ts, 352, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 20)) ->s : Symbol(s, Decl(generatedContextualTyping.ts, 352, 24)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x355 : Symbol(x355, Decl(generatedContextualTyping.ts, 352, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 53), Decl(generatedContextualTyping.ts, 352, 63)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 53), Decl(generatedContextualTyping.ts, 352, 63)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) - -var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); ->x356 : Symbol(x356, Decl(generatedContextualTyping.ts, 353, 3)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 353, 20)) ->Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) ->Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) ->x356 : Symbol(x356, Decl(generatedContextualTyping.ts, 353, 3)) ->func : Symbol(func, Decl(generatedContextualTyping.ts, 353, 48)) ->n : Symbol(n, Decl(generatedContextualTyping.ts, 353, 54)) ->d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) ->d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) - diff --git a/tests/baselines/reference/generatedContextualTyping.types b/tests/baselines/reference/generatedContextualTyping.types deleted file mode 100644 index e8f434d31a88c..0000000000000 --- a/tests/baselines/reference/generatedContextualTyping.types +++ /dev/null @@ -1,3768 +0,0 @@ -=== tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts === -class Base { private p; } ->Base : Base ->p : any - -class Derived1 extends Base { private m; } ->Derived1 : Derived1 ->Base : Base ->m : any - -class Derived2 extends Base { private n; } ->Derived2 : Derived2 ->Base : Base ->n : any - -interface Genric { func(n: T[]); } ->Genric : Genric ->T : T ->func : (n: T[]) => any ->n : T[] ->T : T - -var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); ->b : Base ->new Base() : Base ->Base : typeof Base ->d1 : Derived1 ->new Derived1() : Derived1 ->Derived1 : typeof Derived1 ->d2 : Derived2 ->new Derived2() : Derived2 ->Derived2 : typeof Derived2 - -var x1: () => Base[] = () => [d1, d2]; ->x1 : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x2: () => Base[] = function() { return [d1, d2] }; ->x2 : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x3: () => Base[] = function named() { return [d1, d2] }; ->x3 : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x4: { (): Base[]; } = () => [d1, d2]; ->x4 : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x5: { (): Base[]; } = function() { return [d1, d2] }; ->x5 : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x6: { (): Base[]; } = function named() { return [d1, d2] }; ->x6 : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x7: Base[] = [d1, d2]; ->x7 : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x8: Array = [d1, d2]; ->x8 : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x9: { [n: number]: Base; } = [d1, d2]; ->x9 : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x10: {n: Base[]; } = { n: [d1, d2] }; ->x10 : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; ->x11 : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -var x12: Genric = { func: n => { return [d1, d2]; } }; ->x12 : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x13 { member: () => Base[] = () => [d1, d2] } ->x13 : x13 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x14 { member: () => Base[] = function() { return [d1, d2] } } ->x14 : x14 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x15 { member: () => Base[] = function named() { return [d1, d2] } } ->x15 : x15 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x16 { member: { (): Base[]; } = () => [d1, d2] } ->x16 : x16 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x17 { member: { (): Base[]; } = function() { return [d1, d2] } } ->x17 : x17 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x18 { member: { (): Base[]; } = function named() { return [d1, d2] } } ->x18 : x18 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x19 { member: Base[] = [d1, d2] } ->x19 : x19 ->member : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x20 { member: Array = [d1, d2] } ->x20 : x20 ->member : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x21 { member: { [n: number]: Base; } = [d1, d2] } ->x21 : x21 ->member : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x22 { member: {n: Base[]; } = { n: [d1, d2] } } ->x22 : x22 ->member : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x23 : x23 ->member : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -class x24 { member: Genric = { func: n => { return [d1, d2]; } } } ->x24 : x24 ->member : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x25 { private member: () => Base[] = () => [d1, d2] } ->x25 : x25 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x26 { private member: () => Base[] = function() { return [d1, d2] } } ->x26 : x26 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x27 { private member: () => Base[] = function named() { return [d1, d2] } } ->x27 : x27 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x28 { private member: { (): Base[]; } = () => [d1, d2] } ->x28 : x28 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x29 { private member: { (): Base[]; } = function() { return [d1, d2] } } ->x29 : x29 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x30 { private member: { (): Base[]; } = function named() { return [d1, d2] } } ->x30 : x30 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x31 { private member: Base[] = [d1, d2] } ->x31 : x31 ->member : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x32 { private member: Array = [d1, d2] } ->x32 : x32 ->member : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x33 { private member: { [n: number]: Base; } = [d1, d2] } ->x33 : x33 ->member : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x34 { private member: {n: Base[]; } = { n: [d1, d2] } } ->x34 : x34 ->member : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x35 : x35 ->member : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } ->x36 : x36 ->member : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x37 { public member: () => Base[] = () => [d1, d2] } ->x37 : x37 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x38 { public member: () => Base[] = function() { return [d1, d2] } } ->x38 : x38 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x39 { public member: () => Base[] = function named() { return [d1, d2] } } ->x39 : x39 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x40 { public member: { (): Base[]; } = () => [d1, d2] } ->x40 : x40 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x41 { public member: { (): Base[]; } = function() { return [d1, d2] } } ->x41 : x41 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x42 { public member: { (): Base[]; } = function named() { return [d1, d2] } } ->x42 : x42 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x43 { public member: Base[] = [d1, d2] } ->x43 : x43 ->member : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x44 { public member: Array = [d1, d2] } ->x44 : x44 ->member : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x45 { public member: { [n: number]: Base; } = [d1, d2] } ->x45 : x45 ->member : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x46 { public member: {n: Base[]; } = { n: [d1, d2] } } ->x46 : x46 ->member : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x47 : x47 ->member : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } ->x48 : x48 ->member : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x49 { static member: () => Base[] = () => [d1, d2] } ->x49 : x49 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x50 { static member: () => Base[] = function() { return [d1, d2] } } ->x50 : x50 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x51 { static member: () => Base[] = function named() { return [d1, d2] } } ->x51 : x51 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x52 { static member: { (): Base[]; } = () => [d1, d2] } ->x52 : x52 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x53 { static member: { (): Base[]; } = function() { return [d1, d2] } } ->x53 : x53 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x54 { static member: { (): Base[]; } = function named() { return [d1, d2] } } ->x54 : x54 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x55 { static member: Base[] = [d1, d2] } ->x55 : x55 ->member : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x56 { static member: Array = [d1, d2] } ->x56 : x56 ->member : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x57 { static member: { [n: number]: Base; } = [d1, d2] } ->x57 : x57 ->member : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x58 { static member: {n: Base[]; } = { n: [d1, d2] } } ->x58 : x58 ->member : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x59 : x59 ->member : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } ->x60 : x60 ->member : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x61 { private static member: () => Base[] = () => [d1, d2] } ->x61 : x61 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x62 { private static member: () => Base[] = function() { return [d1, d2] } } ->x62 : x62 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x63 { private static member: () => Base[] = function named() { return [d1, d2] } } ->x63 : x63 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x64 { private static member: { (): Base[]; } = () => [d1, d2] } ->x64 : x64 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x65 { private static member: { (): Base[]; } = function() { return [d1, d2] } } ->x65 : x65 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x66 { private static member: { (): Base[]; } = function named() { return [d1, d2] } } ->x66 : x66 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x67 { private static member: Base[] = [d1, d2] } ->x67 : x67 ->member : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x68 { private static member: Array = [d1, d2] } ->x68 : x68 ->member : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x69 { private static member: { [n: number]: Base; } = [d1, d2] } ->x69 : x69 ->member : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x70 { private static member: {n: Base[]; } = { n: [d1, d2] } } ->x70 : x70 ->member : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x71 : x71 ->member : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } ->x72 : x72 ->member : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x73 { public static member: () => Base[] = () => [d1, d2] } ->x73 : x73 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x74 { public static member: () => Base[] = function() { return [d1, d2] } } ->x74 : x74 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x75 { public static member: () => Base[] = function named() { return [d1, d2] } } ->x75 : x75 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x76 { public static member: { (): Base[]; } = () => [d1, d2] } ->x76 : x76 ->member : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x77 { public static member: { (): Base[]; } = function() { return [d1, d2] } } ->x77 : x77 ->member : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x78 { public static member: { (): Base[]; } = function named() { return [d1, d2] } } ->x78 : x78 ->member : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x79 { public static member: Base[] = [d1, d2] } ->x79 : x79 ->member : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x80 { public static member: Array = [d1, d2] } ->x80 : x80 ->member : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x81 { public static member: { [n: number]: Base; } = [d1, d2] } ->x81 : x81 ->member : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x82 { public static member: {n: Base[]; } = { n: [d1, d2] } } ->x82 : x82 ->member : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } ->x83 : x83 ->member : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } ->x84 : x84 ->member : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x85 { constructor(parm: () => Base[] = () => [d1, d2]) { } } ->x85 : x85 ->parm : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x86 { constructor(parm: () => Base[] = function() { return [d1, d2] }) { } } ->x86 : x86 ->parm : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x87 { constructor(parm: () => Base[] = function named() { return [d1, d2] }) { } } ->x87 : x87 ->parm : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x88 { constructor(parm: { (): Base[]; } = () => [d1, d2]) { } } ->x88 : x88 ->parm : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x89 { constructor(parm: { (): Base[]; } = function() { return [d1, d2] }) { } } ->x89 : x89 ->parm : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x90 { constructor(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } ->x90 : x90 ->parm : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x91 { constructor(parm: Base[] = [d1, d2]) { } } ->x91 : x91 ->parm : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x92 { constructor(parm: Array = [d1, d2]) { } } ->x92 : x92 ->parm : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x93 { constructor(parm: { [n: number]: Base; } = [d1, d2]) { } } ->x93 : x93 ->parm : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x94 { constructor(parm: {n: Base[]; } = { n: [d1, d2] }) { } } ->x94 : x94 ->parm : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } ->x95 : x95 ->parm : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } ->x96 : x96 ->parm : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x97 { constructor(public parm: () => Base[] = () => [d1, d2]) { } } ->x97 : x97 ->parm : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x98 { constructor(public parm: () => Base[] = function() { return [d1, d2] }) { } } ->x98 : x98 ->parm : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x99 { constructor(public parm: () => Base[] = function named() { return [d1, d2] }) { } } ->x99 : x99 ->parm : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x100 { constructor(public parm: { (): Base[]; } = () => [d1, d2]) { } } ->x100 : x100 ->parm : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x101 { constructor(public parm: { (): Base[]; } = function() { return [d1, d2] }) { } } ->x101 : x101 ->parm : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x102 { constructor(public parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } ->x102 : x102 ->parm : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x103 { constructor(public parm: Base[] = [d1, d2]) { } } ->x103 : x103 ->parm : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x104 { constructor(public parm: Array = [d1, d2]) { } } ->x104 : x104 ->parm : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x105 { constructor(public parm: { [n: number]: Base; } = [d1, d2]) { } } ->x105 : x105 ->parm : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x106 { constructor(public parm: {n: Base[]; } = { n: [d1, d2] }) { } } ->x106 : x106 ->parm : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } ->x107 : x107 ->parm : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } ->x108 : x108 ->parm : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x109 { constructor(private parm: () => Base[] = () => [d1, d2]) { } } ->x109 : x109 ->parm : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x110 { constructor(private parm: () => Base[] = function() { return [d1, d2] }) { } } ->x110 : x110 ->parm : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x111 { constructor(private parm: () => Base[] = function named() { return [d1, d2] }) { } } ->x111 : x111 ->parm : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x112 { constructor(private parm: { (): Base[]; } = () => [d1, d2]) { } } ->x112 : x112 ->parm : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x113 { constructor(private parm: { (): Base[]; } = function() { return [d1, d2] }) { } } ->x113 : x113 ->parm : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x114 { constructor(private parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } ->x114 : x114 ->parm : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x115 { constructor(private parm: Base[] = [d1, d2]) { } } ->x115 : x115 ->parm : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x116 { constructor(private parm: Array = [d1, d2]) { } } ->x116 : x116 ->parm : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x117 { constructor(private parm: { [n: number]: Base; } = [d1, d2]) { } } ->x117 : x117 ->parm : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x118 { constructor(private parm: {n: Base[]; } = { n: [d1, d2] }) { } } ->x118 : x118 ->parm : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } ->x119 : x119 ->parm : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } ->x120 : x120 ->parm : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x121(parm: () => Base[] = () => [d1, d2]) { } ->x121 : (parm?: () => Base[]) => void ->parm : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x122(parm: () => Base[] = function() { return [d1, d2] }) { } ->x122 : (parm?: () => Base[]) => void ->parm : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } ->x123 : (parm?: () => Base[]) => void ->parm : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x124(parm: { (): Base[]; } = () => [d1, d2]) { } ->x124 : (parm?: () => Base[]) => void ->parm : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } ->x125 : (parm?: () => Base[]) => void ->parm : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } ->x126 : (parm?: () => Base[]) => void ->parm : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x127(parm: Base[] = [d1, d2]) { } ->x127 : (parm?: Base[]) => void ->parm : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x128(parm: Array = [d1, d2]) { } ->x128 : (parm?: Base[]) => void ->parm : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x129(parm: { [n: number]: Base; } = [d1, d2]) { } ->x129 : (parm?: { [n: number]: Base; }) => void ->parm : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } ->x130 : (parm?: { n: Base[]; }) => void ->parm : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } ->x131 : (parm?: (s: Base[]) => any) => void ->parm : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } ->x132 : (parm?: Genric) => void ->parm : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x133(): () => Base[] { return () => [d1, d2]; } ->x133 : () => () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x134(): () => Base[] { return function() { return [d1, d2] }; } ->x134 : () => () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x135(): () => Base[] { return function named() { return [d1, d2] }; } ->x135 : () => () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x136(): { (): Base[]; } { return () => [d1, d2]; } ->x136 : () => () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } ->x137 : () => () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } ->x138 : () => () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x139(): Base[] { return [d1, d2]; } ->x139 : () => Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x140(): Array { return [d1, d2]; } ->x140 : () => Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x141(): { [n: number]: Base; } { return [d1, d2]; } ->x141 : () => { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x142(): {n: Base[]; } { return { n: [d1, d2] }; } ->x142 : () => { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; } ->x143 : () => (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -function x144(): Genric { return { func: n => { return [d1, d2]; } }; } ->x144 : () => Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } ->x145 : () => () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } ->x146 : () => () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } ->x147 : () => () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } ->x148 : () => () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } ->x149 : () => () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } ->x150 : () => () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x151(): Base[] { return [d1, d2]; return [d1, d2]; } ->x151 : () => Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x152(): Array { return [d1, d2]; return [d1, d2]; } ->x152 : () => Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } ->x153 : () => { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] }; } ->x154 : () => { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; return n => { var n: Base[]; return null; }; } ->x155 : () => (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } ->x156 : () => Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x157: () => () => Base[] = () => { return () => [d1, d2]; }; ->x157 : () => () => Base[] ->Base : Base ->() => { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x158: () => () => Base[] = () => { return function() { return [d1, d2] }; }; ->x158 : () => () => Base[] ->Base : Base ->() => { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x159: () => () => Base[] = () => { return function named() { return [d1, d2] }; }; ->x159 : () => () => Base[] ->Base : Base ->() => { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x160: () => { (): Base[]; } = () => { return () => [d1, d2]; }; ->x160 : () => () => Base[] ->Base : Base ->() => { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x161: () => { (): Base[]; } = () => { return function() { return [d1, d2] }; }; ->x161 : () => () => Base[] ->Base : Base ->() => { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x162: () => { (): Base[]; } = () => { return function named() { return [d1, d2] }; }; ->x162 : () => () => Base[] ->Base : Base ->() => { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x163: () => Base[] = () => { return [d1, d2]; }; ->x163 : () => Base[] ->Base : Base ->() => { return [d1, d2]; } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x164: () => Array = () => { return [d1, d2]; }; ->x164 : () => Base[] ->Array : T[] ->Base : Base ->() => { return [d1, d2]; } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x165: () => { [n: number]: Base; } = () => { return [d1, d2]; }; ->x165 : () => { [n: number]: Base; } ->n : number ->Base : Base ->() => { return [d1, d2]; } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x166: () => {n: Base[]; } = () => { return { n: [d1, d2] }; }; ->x166 : () => { n: Base[]; } ->n : Base[] ->Base : Base ->() => { return { n: [d1, d2] }; } : () => { n: (Derived1 | Derived2)[]; } ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return null; }; }; ->x167 : () => (s: Base[]) => any ->s : Base[] ->Base : Base ->() => { return n => { var n: Base[]; return null; }; } : () => (n: Base[]) => any ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; ->x168 : () => Genric ->Genric : Genric ->Base : Base ->() => { return { func: n => { return [d1, d2]; } }; } : () => { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x169: () => () => Base[] = function() { return () => [d1, d2]; }; ->x169 : () => () => Base[] ->Base : Base ->function() { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x170: () => () => Base[] = function() { return function() { return [d1, d2] }; }; ->x170 : () => () => Base[] ->Base : Base ->function() { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x171: () => () => Base[] = function() { return function named() { return [d1, d2] }; }; ->x171 : () => () => Base[] ->Base : Base ->function() { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x172: () => { (): Base[]; } = function() { return () => [d1, d2]; }; ->x172 : () => () => Base[] ->Base : Base ->function() { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x173: () => { (): Base[]; } = function() { return function() { return [d1, d2] }; }; ->x173 : () => () => Base[] ->Base : Base ->function() { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x174: () => { (): Base[]; } = function() { return function named() { return [d1, d2] }; }; ->x174 : () => () => Base[] ->Base : Base ->function() { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x175: () => Base[] = function() { return [d1, d2]; }; ->x175 : () => Base[] ->Base : Base ->function() { return [d1, d2]; } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x176: () => Array = function() { return [d1, d2]; }; ->x176 : () => Base[] ->Array : T[] ->Base : Base ->function() { return [d1, d2]; } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x177: () => { [n: number]: Base; } = function() { return [d1, d2]; }; ->x177 : () => { [n: number]: Base; } ->n : number ->Base : Base ->function() { return [d1, d2]; } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x178: () => {n: Base[]; } = function() { return { n: [d1, d2] }; }; ->x178 : () => { n: Base[]; } ->n : Base[] ->Base : Base ->function() { return { n: [d1, d2] }; } : () => { n: (Derived1 | Derived2)[]; } ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; return null; }; }; ->x179 : () => (s: Base[]) => any ->s : Base[] ->Base : Base ->function() { return n => { var n: Base[]; return null; }; } : () => (n: Base[]) => any ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; ->x180 : () => Genric ->Genric : Genric ->Base : Base ->function() { return { func: n => { return [d1, d2]; } }; } : () => { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x181 { var t: () => Base[] = () => [d1, d2]; } ->x181 : typeof x181 ->t : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x182 { var t: () => Base[] = function() { return [d1, d2] }; } ->x182 : typeof x182 ->t : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } ->x183 : typeof x183 ->t : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x184 { var t: { (): Base[]; } = () => [d1, d2]; } ->x184 : typeof x184 ->t : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } ->x185 : typeof x185 ->t : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } ->x186 : typeof x186 ->t : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x187 { var t: Base[] = [d1, d2]; } ->x187 : typeof x187 ->t : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x188 { var t: Array = [d1, d2]; } ->x188 : typeof x188 ->t : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x189 { var t: { [n: number]: Base; } = [d1, d2]; } ->x189 : typeof x189 ->t : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } ->x190 : typeof x190 ->t : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } ->x191 : typeof x191 ->t : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } ->x192 : typeof x192 ->t : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x193 { export var t: () => Base[] = () => [d1, d2]; } ->x193 : typeof x193 ->t : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } ->x194 : typeof x194 ->t : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; } ->x195 : typeof x195 ->t : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } ->x196 : typeof x196 ->t : () => Base[] ->Base : Base ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } ->x197 : typeof x197 ->t : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] }; } ->x198 : typeof x198 ->t : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x199 { export var t: Base[] = [d1, d2]; } ->x199 : typeof x199 ->t : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x200 { export var t: Array = [d1, d2]; } ->x200 : typeof x200 ->t : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } ->x201 : typeof x201 ->t : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } ->x202 : typeof x202 ->t : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } ->x203 : typeof x203 ->t : (s: Base[]) => any ->s : Base[] ->Base : Base ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } ->x204 : typeof x204 ->t : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x206 = <() => Base[]>function() { return [d1, d2] }; ->x206 : () => Base[] -><() => Base[]>function() { return [d1, d2] } : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x207 = <() => Base[]>function named() { return [d1, d2] }; ->x207 : () => Base[] -><() => Base[]>function named() { return [d1, d2] } : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; ->x209 : () => Base[] -><{ (): Base[]; }>function() { return [d1, d2] } : () => Base[] ->Base : Base ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x210 = <{ (): Base[]; }>function named() { return [d1, d2] }; ->x210 : () => Base[] -><{ (): Base[]; }>function named() { return [d1, d2] } : () => Base[] ->Base : Base ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x211 = [d1, d2]; ->x211 : Base[] ->[d1, d2] : Base[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x212 = >[d1, d2]; ->x212 : Base[] ->>[d1, d2] : Base[] ->Array : T[] ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x213 = <{ [n: number]: Base; }>[d1, d2]; ->x213 : { [n: number]: Base; } -><{ [n: number]: Base; }>[d1, d2] : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x214 = <{n: Base[]; } >{ n: [d1, d2] }; ->x214 : { n: Base[]; } -><{n: Base[]; } >{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x216 = >{ func: n => { return [d1, d2]; } }; ->x216 : Genric ->>{ func: n => { return [d1, d2]; } } : Genric ->Genric : Genric ->Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x217 = (<() => Base[]>undefined) || function() { return [d1, d2] }; ->x217 : () => Base[] ->(<() => Base[]>undefined) || function() { return [d1, d2] } : () => Base[] ->(<() => Base[]>undefined) : () => Base[] -><() => Base[]>undefined : () => Base[] ->Base : Base ->undefined : undefined ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x218 = (<() => Base[]>undefined) || function named() { return [d1, d2] }; ->x218 : () => Base[] ->(<() => Base[]>undefined) || function named() { return [d1, d2] } : () => Base[] ->(<() => Base[]>undefined) : () => Base[] -><() => Base[]>undefined : () => Base[] ->Base : Base ->undefined : undefined ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x219 = (<{ (): Base[]; }>undefined) || function() { return [d1, d2] }; ->x219 : () => Base[] ->(<{ (): Base[]; }>undefined) || function() { return [d1, d2] } : () => Base[] ->(<{ (): Base[]; }>undefined) : () => Base[] -><{ (): Base[]; }>undefined : () => Base[] ->Base : Base ->undefined : undefined ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x220 = (<{ (): Base[]; }>undefined) || function named() { return [d1, d2] }; ->x220 : () => Base[] ->(<{ (): Base[]; }>undefined) || function named() { return [d1, d2] } : () => Base[] ->(<{ (): Base[]; }>undefined) : () => Base[] -><{ (): Base[]; }>undefined : () => Base[] ->Base : Base ->undefined : undefined ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x221 = (undefined) || [d1, d2]; ->x221 : Base[] ->(undefined) || [d1, d2] : Base[] ->(undefined) : Base[] ->undefined : Base[] ->Base : Base ->undefined : undefined ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x222 = (>undefined) || [d1, d2]; ->x222 : Base[] ->(>undefined) || [d1, d2] : Base[] ->(>undefined) : Base[] ->>undefined : Base[] ->Array : T[] ->Base : Base ->undefined : undefined ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2]; ->x223 : { [n: number]: Base; } ->(<{ [n: number]: Base; }>undefined) || [d1, d2] : { [n: number]: Base; } ->(<{ [n: number]: Base; }>undefined) : { [n: number]: Base; } -><{ [n: number]: Base; }>undefined : { [n: number]: Base; } ->n : number ->Base : Base ->undefined : undefined ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x224 = (<{n: Base[]; } >undefined) || { n: [d1, d2] }; ->x224 : { n: Base[]; } ->(<{n: Base[]; } >undefined) || { n: [d1, d2] } : { n: Base[]; } ->(<{n: Base[]; } >undefined) : { n: Base[]; } -><{n: Base[]; } >undefined : { n: Base[]; } ->n : Base[] ->Base : Base ->undefined : undefined ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x225: () => Base[]; x225 = () => [d1, d2]; ->x225 : () => Base[] ->Base : Base ->x225 = () => [d1, d2] : () => (Derived1 | Derived2)[] ->x225 : () => Base[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x226: () => Base[]; x226 = function() { return [d1, d2] }; ->x226 : () => Base[] ->Base : Base ->x226 = function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->x226 : () => Base[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x227: () => Base[]; x227 = function named() { return [d1, d2] }; ->x227 : () => Base[] ->Base : Base ->x227 = function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->x227 : () => Base[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x228: { (): Base[]; }; x228 = () => [d1, d2]; ->x228 : () => Base[] ->Base : Base ->x228 = () => [d1, d2] : () => (Derived1 | Derived2)[] ->x228 : () => Base[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x229: { (): Base[]; }; x229 = function() { return [d1, d2] }; ->x229 : () => Base[] ->Base : Base ->x229 = function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->x229 : () => Base[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x230: { (): Base[]; }; x230 = function named() { return [d1, d2] }; ->x230 : () => Base[] ->Base : Base ->x230 = function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->x230 : () => Base[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x231: Base[]; x231 = [d1, d2]; ->x231 : Base[] ->Base : Base ->x231 = [d1, d2] : (Derived1 | Derived2)[] ->x231 : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x232: Array; x232 = [d1, d2]; ->x232 : Base[] ->Array : T[] ->Base : Base ->x232 = [d1, d2] : (Derived1 | Derived2)[] ->x232 : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x233: { [n: number]: Base; }; x233 = [d1, d2]; ->x233 : { [n: number]: Base; } ->n : number ->Base : Base ->x233 = [d1, d2] : (Derived1 | Derived2)[] ->x233 : { [n: number]: Base; } ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x234: {n: Base[]; } ; x234 = { n: [d1, d2] }; ->x234 : { n: Base[]; } ->n : Base[] ->Base : Base ->x234 = { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->x234 : { n: Base[]; } ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; ->x235 : (s: Base[]) => any ->s : Base[] ->Base : Base ->x235 = n => { var n: Base[]; return null; } : (n: Base[]) => any ->x235 : (s: Base[]) => any ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; ->x236 : Genric ->Genric : Genric ->Base : Base ->x236 = { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->x236 : Genric ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x237: { n: () => Base[]; } = { n: () => [d1, d2] }; ->x237 : { n: () => Base[]; } ->n : () => Base[] ->Base : Base ->{ n: () => [d1, d2] } : { n: () => (Derived1 | Derived2)[]; } ->n : () => (Derived1 | Derived2)[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x238: { n: () => Base[]; } = { n: function() { return [d1, d2] } }; ->x238 : { n: () => Base[]; } ->n : () => Base[] ->Base : Base ->{ n: function() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } ->n : () => (Derived1 | Derived2)[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x239: { n: () => Base[]; } = { n: function named() { return [d1, d2] } }; ->x239 : { n: () => Base[]; } ->n : () => Base[] ->Base : Base ->{ n: function named() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } ->n : () => (Derived1 | Derived2)[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x240: { n: { (): Base[]; }; } = { n: () => [d1, d2] }; ->x240 : { n: () => Base[]; } ->n : () => Base[] ->Base : Base ->{ n: () => [d1, d2] } : { n: () => (Derived1 | Derived2)[]; } ->n : () => (Derived1 | Derived2)[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x241: { n: { (): Base[]; }; } = { n: function() { return [d1, d2] } }; ->x241 : { n: () => Base[]; } ->n : () => Base[] ->Base : Base ->{ n: function() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } ->n : () => (Derived1 | Derived2)[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x242: { n: { (): Base[]; }; } = { n: function named() { return [d1, d2] } }; ->x242 : { n: () => Base[]; } ->n : () => Base[] ->Base : Base ->{ n: function named() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } ->n : () => (Derived1 | Derived2)[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x243: { n: Base[]; } = { n: [d1, d2] }; ->x243 : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x244: { n: Array; } = { n: [d1, d2] }; ->x244 : { n: Base[]; } ->n : Base[] ->Array : T[] ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x245: { n: { [n: number]: Base; }; } = { n: [d1, d2] }; ->x245 : { n: { [n: number]: Base; }; } ->n : { [n: number]: Base; } ->n : number ->Base : Base ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x246: { n: {n: Base[]; } ; } = { n: { n: [d1, d2] } }; ->x246 : { n: { n: Base[]; }; } ->n : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: { n: [d1, d2] } } : { n: { n: (Derived1 | Derived2)[]; }; } ->n : { n: (Derived1 | Derived2)[]; } ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } }; ->x247 : { n: (s: Base[]) => any; } ->n : (s: Base[]) => any ->s : Base[] ->Base : Base ->{ n: n => { var n: Base[]; return null; } } : { n: (n: Base[]) => any; } ->n : (n: Base[]) => any ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; ->x248 : { n: Genric; } ->n : Genric ->Genric : Genric ->Base : Base ->{ n: { func: n => { return [d1, d2]; } } } : { n: { func: (n: Base[]) => (Derived1 | Derived2)[]; }; } ->n : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x252: { (): Base[]; }[] = [() => [d1, d2]]; ->x252 : (() => Base[])[] ->Base : Base ->[() => [d1, d2]] : (() => (Derived1 | Derived2)[])[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x253: { (): Base[]; }[] = [function() { return [d1, d2] }]; ->x253 : (() => Base[])[] ->Base : Base ->[function() { return [d1, d2] }] : (() => (Derived1 | Derived2)[])[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x254: { (): Base[]; }[] = [function named() { return [d1, d2] }]; ->x254 : (() => Base[])[] ->Base : Base ->[function named() { return [d1, d2] }] : (() => (Derived1 | Derived2)[])[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x255: Base[][] = [[d1, d2]]; ->x255 : Base[][] ->Base : Base ->[[d1, d2]] : (Derived1 | Derived2)[][] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x256: Array[] = [[d1, d2]]; ->x256 : Base[][] ->Array : T[] ->Base : Base ->[[d1, d2]] : (Derived1 | Derived2)[][] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x257: { [n: number]: Base; }[] = [[d1, d2]]; ->x257 : { [n: number]: Base; }[] ->n : number ->Base : Base ->[[d1, d2]] : (Derived1 | Derived2)[][] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x258: {n: Base[]; } [] = [{ n: [d1, d2] }]; ->x258 : { n: Base[]; }[] ->n : Base[] ->Base : Base ->[{ n: [d1, d2] }] : { n: (Derived1 | Derived2)[]; }[] ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x260: Genric[] = [{ func: n => { return [d1, d2]; } }]; ->x260 : Genric[] ->Genric : Genric ->Base : Base ->[{ func: n => { return [d1, d2]; } }] : { func: (n: Base[]) => (Derived1 | Derived2)[]; }[] ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x261: () => Base[] = function() { return [d1, d2] } || undefined; ->x261 : () => Base[] ->Base : Base ->function() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x262: () => Base[] = function named() { return [d1, d2] } || undefined; ->x262 : () => Base[] ->Base : Base ->function named() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; ->x263 : () => Base[] ->Base : Base ->function() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; ->x264 : () => Base[] ->Base : Base ->function named() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x265: Base[] = [d1, d2] || undefined; ->x265 : Base[] ->Base : Base ->[d1, d2] || undefined : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x266: Array = [d1, d2] || undefined; ->x266 : Base[] ->Array : T[] ->Base : Base ->[d1, d2] || undefined : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x267: { [n: number]: Base; } = [d1, d2] || undefined; ->x267 : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] || undefined : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; ->x268 : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } || undefined : { n: (Derived1 | Derived2)[]; } ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x269: () => Base[] = undefined || function() { return [d1, d2] }; ->x269 : () => Base[] ->Base : Base ->undefined || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->undefined : undefined ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x270: () => Base[] = undefined || function named() { return [d1, d2] }; ->x270 : () => Base[] ->Base : Base ->undefined || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->undefined : undefined ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x271: { (): Base[]; } = undefined || function() { return [d1, d2] }; ->x271 : () => Base[] ->Base : Base ->undefined || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->undefined : undefined ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x272: { (): Base[]; } = undefined || function named() { return [d1, d2] }; ->x272 : () => Base[] ->Base : Base ->undefined || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->undefined : undefined ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x273: Base[] = undefined || [d1, d2]; ->x273 : Base[] ->Base : Base ->undefined || [d1, d2] : (Derived1 | Derived2)[] ->undefined : undefined ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x274: Array = undefined || [d1, d2]; ->x274 : Base[] ->Array : T[] ->Base : Base ->undefined || [d1, d2] : (Derived1 | Derived2)[] ->undefined : undefined ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x275: { [n: number]: Base; } = undefined || [d1, d2]; ->x275 : { [n: number]: Base; } ->n : number ->Base : Base ->undefined || [d1, d2] : (Derived1 | Derived2)[] ->undefined : undefined ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x276: {n: Base[]; } = undefined || { n: [d1, d2] }; ->x276 : { n: Base[]; } ->n : Base[] ->Base : Base ->undefined || { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->undefined : undefined ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x277: () => Base[] = function() { return [d1, d2] } || function() { return [d1, d2] }; ->x277 : () => Base[] ->Base : Base ->function() { return [d1, d2] } || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x278: () => Base[] = function named() { return [d1, d2] } || function named() { return [d1, d2] }; ->x278 : () => Base[] ->Base : Base ->function named() { return [d1, d2] } || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x279: { (): Base[]; } = function() { return [d1, d2] } || function() { return [d1, d2] }; ->x279 : () => Base[] ->Base : Base ->function() { return [d1, d2] } || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x280: { (): Base[]; } = function named() { return [d1, d2] } || function named() { return [d1, d2] }; ->x280 : () => Base[] ->Base : Base ->function named() { return [d1, d2] } || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x281: Base[] = [d1, d2] || [d1, d2]; ->x281 : Base[] ->Base : Base ->[d1, d2] || [d1, d2] : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x282: Array = [d1, d2] || [d1, d2]; ->x282 : Base[] ->Array : T[] ->Base : Base ->[d1, d2] || [d1, d2] : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2]; ->x283 : { [n: number]: Base; } ->n : number ->Base : Base ->[d1, d2] || [d1, d2] : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x284: {n: Base[]; } = { n: [d1, d2] } || { n: [d1, d2] }; ->x284 : { n: Base[]; } ->n : Base[] ->Base : Base ->{ n: [d1, d2] } || { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; ->x285 : () => Base[] ->Base : Base ->true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; ->x286 : () => Base[] ->Base : Base ->true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x287: () => Base[] = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; ->x287 : () => Base[] ->Base : Base ->true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; ->x288 : () => Base[] ->Base : Base ->true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; ->x289 : () => Base[] ->Base : Base ->true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; ->x290 : () => Base[] ->Base : Base ->true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x291: Base[] = true ? [d1, d2] : [d1, d2]; ->x291 : Base[] ->Base : Base ->true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x292: Array = true ? [d1, d2] : [d1, d2]; ->x292 : Base[] ->Array : T[] ->Base : Base ->true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; ->x293 : { [n: number]: Base; } ->n : number ->Base : Base ->true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; ->x294 : { n: Base[]; } ->n : Base[] ->Base : Base ->true ? { n: [d1, d2] } : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->true : boolean ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; }; ->x295 : (s: Base[]) => any ->s : Base[] ->Base : Base ->true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; } : (n: Base[]) => any ->true : boolean ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; ->x296 : Genric ->Genric : Genric ->Base : Base ->true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->true : boolean ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x297: () => Base[] = true ? undefined : () => [d1, d2]; ->x297 : () => Base[] ->Base : Base ->true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean ->undefined : undefined ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; ->x298 : () => Base[] ->Base : Base ->true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean ->undefined : undefined ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] }; ->x299 : () => Base[] ->Base : Base ->true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean ->undefined : undefined ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; ->x300 : () => Base[] ->Base : Base ->true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean ->undefined : undefined ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; ->x301 : () => Base[] ->Base : Base ->true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean ->undefined : undefined ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2] }; ->x302 : () => Base[] ->Base : Base ->true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean ->undefined : undefined ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x303: Base[] = true ? undefined : [d1, d2]; ->x303 : Base[] ->Base : Base ->true ? undefined : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean ->undefined : undefined ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x304: Array = true ? undefined : [d1, d2]; ->x304 : Base[] ->Array : T[] ->Base : Base ->true ? undefined : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean ->undefined : undefined ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; ->x305 : { [n: number]: Base; } ->n : number ->Base : Base ->true ? undefined : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean ->undefined : undefined ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; ->x306 : { n: Base[]; } ->n : Base[] ->Base : Base ->true ? undefined : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->true : boolean ->undefined : undefined ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return null; }; ->x307 : (s: Base[]) => any ->s : Base[] ->Base : Base ->true ? undefined : n => { var n: Base[]; return null; } : (n: Base[]) => any ->true : boolean ->undefined : undefined ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; ->x308 : Genric ->Genric : Genric ->Base : Base ->true ? undefined : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->true : boolean ->undefined : undefined ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x309: () => Base[] = true ? () => [d1, d2] : undefined; ->x309 : () => Base[] ->Base : Base ->true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] ->true : boolean ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; ->x310 : () => Base[] ->Base : Base ->true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined; ->x311 : () => Base[] ->Base : Base ->true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; ->x312 : () => Base[] ->Base : Base ->true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] ->true : boolean ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; ->x313 : () => Base[] ->Base : Base ->true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefined; ->x314 : () => Base[] ->Base : Base ->true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x315: Base[] = true ? [d1, d2] : undefined; ->x315 : Base[] ->Base : Base ->true ? [d1, d2] : undefined : (Derived1 | Derived2)[] ->true : boolean ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x316: Array = true ? [d1, d2] : undefined; ->x316 : Base[] ->Array : T[] ->Base : Base ->true ? [d1, d2] : undefined : (Derived1 | Derived2)[] ->true : boolean ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; ->x317 : { [n: number]: Base; } ->n : number ->Base : Base ->true ? [d1, d2] : undefined : (Derived1 | Derived2)[] ->true : boolean ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; ->x318 : { n: Base[]; } ->n : Base[] ->Base : Base ->true ? { n: [d1, d2] } : undefined : { n: (Derived1 | Derived2)[]; } ->true : boolean ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : undefined; ->x319 : (s: Base[]) => any ->s : Base[] ->Base : Base ->true ? n => { var n: Base[]; return null; } : undefined : (n: Base[]) => any ->true : boolean ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null ->undefined : undefined - -var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; ->x320 : Genric ->Genric : Genric ->Base : Base ->true ? { func: n => { return [d1, d2]; } } : undefined : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->true : boolean ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 ->undefined : undefined - -function x321(n: () => Base[]) { }; x321(() => [d1, d2]); ->x321 : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x321(() => [d1, d2]) : void ->x321 : (n: () => Base[]) => void ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); ->x322 : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x322(function() { return [d1, d2] }) : void ->x322 : (n: () => Base[]) => void ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); ->x323 : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x323(function named() { return [d1, d2] }) : void ->x323 : (n: () => Base[]) => void ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); ->x324 : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x324(() => [d1, d2]) : void ->x324 : (n: () => Base[]) => void ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); ->x325 : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x325(function() { return [d1, d2] }) : void ->x325 : (n: () => Base[]) => void ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] }); ->x326 : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x326(function named() { return [d1, d2] }) : void ->x326 : (n: () => Base[]) => void ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x327(n: Base[]) { }; x327([d1, d2]); ->x327 : (n: Base[]) => void ->n : Base[] ->Base : Base ->x327([d1, d2]) : void ->x327 : (n: Base[]) => void ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x328(n: Array) { }; x328([d1, d2]); ->x328 : (n: Base[]) => void ->n : Base[] ->Array : T[] ->Base : Base ->x328([d1, d2]) : void ->x328 : (n: Base[]) => void ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); ->x329 : (n: { [n: number]: Base; }) => void ->n : { [n: number]: Base; } ->n : number ->Base : Base ->x329([d1, d2]) : void ->x329 : (n: { [n: number]: Base; }) => void ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); ->x330 : (n: { n: Base[]; }) => void ->n : { n: Base[]; } ->n : Base[] ->Base : Base ->x330({ n: [d1, d2] }) : void ->x330 : (n: { n: Base[]; }) => void ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null; }); ->x331 : (n: (s: Base[]) => any) => void ->n : (s: Base[]) => any ->s : Base[] ->Base : Base ->x331(n => { var n: Base[]; return null; }) : void ->x331 : (n: (s: Base[]) => any) => void ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); ->x332 : (n: Genric) => void ->n : Genric ->Genric : Genric ->Base : Base ->x332({ func: n => { return [d1, d2]; } }) : void ->x332 : (n: Genric) => void ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x333 = (n: () => Base[]) => n; x333(() => [d1, d2]); ->x333 : (n: () => Base[]) => () => Base[] ->(n: () => Base[]) => n : (n: () => Base[]) => () => Base[] ->n : () => Base[] ->Base : Base ->n : () => Base[] ->x333(() => [d1, d2]) : () => Base[] ->x333 : (n: () => Base[]) => () => Base[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x334 = (n: () => Base[]) => n; x334(function() { return [d1, d2] }); ->x334 : (n: () => Base[]) => () => Base[] ->(n: () => Base[]) => n : (n: () => Base[]) => () => Base[] ->n : () => Base[] ->Base : Base ->n : () => Base[] ->x334(function() { return [d1, d2] }) : () => Base[] ->x334 : (n: () => Base[]) => () => Base[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x335 = (n: () => Base[]) => n; x335(function named() { return [d1, d2] }); ->x335 : (n: () => Base[]) => () => Base[] ->(n: () => Base[]) => n : (n: () => Base[]) => () => Base[] ->n : () => Base[] ->Base : Base ->n : () => Base[] ->x335(function named() { return [d1, d2] }) : () => Base[] ->x335 : (n: () => Base[]) => () => Base[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x336 = (n: { (): Base[]; }) => n; x336(() => [d1, d2]); ->x336 : (n: () => Base[]) => () => Base[] ->(n: { (): Base[]; }) => n : (n: () => Base[]) => () => Base[] ->n : () => Base[] ->Base : Base ->n : () => Base[] ->x336(() => [d1, d2]) : () => Base[] ->x336 : (n: () => Base[]) => () => Base[] ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x337 = (n: { (): Base[]; }) => n; x337(function() { return [d1, d2] }); ->x337 : (n: () => Base[]) => () => Base[] ->(n: { (): Base[]; }) => n : (n: () => Base[]) => () => Base[] ->n : () => Base[] ->Base : Base ->n : () => Base[] ->x337(function() { return [d1, d2] }) : () => Base[] ->x337 : (n: () => Base[]) => () => Base[] ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x338 = (n: { (): Base[]; }) => n; x338(function named() { return [d1, d2] }); ->x338 : (n: () => Base[]) => () => Base[] ->(n: { (): Base[]; }) => n : (n: () => Base[]) => () => Base[] ->n : () => Base[] ->Base : Base ->n : () => Base[] ->x338(function named() { return [d1, d2] }) : () => Base[] ->x338 : (n: () => Base[]) => () => Base[] ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x339 = (n: Base[]) => n; x339([d1, d2]); ->x339 : (n: Base[]) => Base[] ->(n: Base[]) => n : (n: Base[]) => Base[] ->n : Base[] ->Base : Base ->n : Base[] ->x339([d1, d2]) : Base[] ->x339 : (n: Base[]) => Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x340 = (n: Array) => n; x340([d1, d2]); ->x340 : (n: Base[]) => Base[] ->(n: Array) => n : (n: Base[]) => Base[] ->n : Base[] ->Array : T[] ->Base : Base ->n : Base[] ->x340([d1, d2]) : Base[] ->x340 : (n: Base[]) => Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x341 = (n: { [n: number]: Base; }) => n; x341([d1, d2]); ->x341 : (n: { [n: number]: Base; }) => { [n: number]: Base; } ->(n: { [n: number]: Base; }) => n : (n: { [n: number]: Base; }) => { [n: number]: Base; } ->n : { [n: number]: Base; } ->n : number ->Base : Base ->n : { [n: number]: Base; } ->x341([d1, d2]) : { [n: number]: Base; } ->x341 : (n: { [n: number]: Base; }) => { [n: number]: Base; } ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x342 = (n: {n: Base[]; } ) => n; x342({ n: [d1, d2] }); ->x342 : (n: { n: Base[]; }) => { n: Base[]; } ->(n: {n: Base[]; } ) => n : (n: { n: Base[]; }) => { n: Base[]; } ->n : { n: Base[]; } ->n : Base[] ->Base : Base ->n : { n: Base[]; } ->x342({ n: [d1, d2] }) : { n: Base[]; } ->x342 : (n: { n: Base[]; }) => { n: Base[]; } ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; }); ->x343 : (n: (s: Base[]) => any) => (s: Base[]) => any ->(n: (s: Base[]) => any) => n : (n: (s: Base[]) => any) => (s: Base[]) => any ->n : (s: Base[]) => any ->s : Base[] ->Base : Base ->n : (s: Base[]) => any ->x343(n => { var n: Base[]; return null; }) : (s: Base[]) => any ->x343 : (n: (s: Base[]) => any) => (s: Base[]) => any ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); ->x344 : (n: Genric) => Genric ->(n: Genric) => n : (n: Genric) => Genric ->n : Genric ->Genric : Genric ->Base : Base ->n : Genric ->x344({ func: n => { return [d1, d2]; } }) : Genric ->x344 : (n: Genric) => Genric ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x345 = function(n: () => Base[]) { }; x345(() => [d1, d2]); ->x345 : (n: () => Base[]) => void ->function(n: () => Base[]) { } : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x345(() => [d1, d2]) : void ->x345 : (n: () => Base[]) => void ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x346 = function(n: () => Base[]) { }; x346(function() { return [d1, d2] }); ->x346 : (n: () => Base[]) => void ->function(n: () => Base[]) { } : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x346(function() { return [d1, d2] }) : void ->x346 : (n: () => Base[]) => void ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x347 = function(n: () => Base[]) { }; x347(function named() { return [d1, d2] }); ->x347 : (n: () => Base[]) => void ->function(n: () => Base[]) { } : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x347(function named() { return [d1, d2] }) : void ->x347 : (n: () => Base[]) => void ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x348 = function(n: { (): Base[]; }) { }; x348(() => [d1, d2]); ->x348 : (n: () => Base[]) => void ->function(n: { (): Base[]; }) { } : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x348(() => [d1, d2]) : void ->x348 : (n: () => Base[]) => void ->() => [d1, d2] : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x349 = function(n: { (): Base[]; }) { }; x349(function() { return [d1, d2] }); ->x349 : (n: () => Base[]) => void ->function(n: { (): Base[]; }) { } : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x349(function() { return [d1, d2] }) : void ->x349 : (n: () => Base[]) => void ->function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x350 = function(n: { (): Base[]; }) { }; x350(function named() { return [d1, d2] }); ->x350 : (n: () => Base[]) => void ->function(n: { (): Base[]; }) { } : (n: () => Base[]) => void ->n : () => Base[] ->Base : Base ->x350(function named() { return [d1, d2] }) : void ->x350 : (n: () => Base[]) => void ->function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->named : () => (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x351 = function(n: Base[]) { }; x351([d1, d2]); ->x351 : (n: Base[]) => void ->function(n: Base[]) { } : (n: Base[]) => void ->n : Base[] ->Base : Base ->x351([d1, d2]) : void ->x351 : (n: Base[]) => void ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x352 = function(n: Array) { }; x352([d1, d2]); ->x352 : (n: Base[]) => void ->function(n: Array) { } : (n: Base[]) => void ->n : Base[] ->Array : T[] ->Base : Base ->x352([d1, d2]) : void ->x352 : (n: Base[]) => void ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x353 = function(n: { [n: number]: Base; }) { }; x353([d1, d2]); ->x353 : (n: { [n: number]: Base; }) => void ->function(n: { [n: number]: Base; }) { } : (n: { [n: number]: Base; }) => void ->n : { [n: number]: Base; } ->n : number ->Base : Base ->x353([d1, d2]) : void ->x353 : (n: { [n: number]: Base; }) => void ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x354 = function(n: {n: Base[]; } ) { }; x354({ n: [d1, d2] }); ->x354 : (n: { n: Base[]; }) => void ->function(n: {n: Base[]; } ) { } : (n: { n: Base[]; }) => void ->n : { n: Base[]; } ->n : Base[] ->Base : Base ->x354({ n: [d1, d2] }) : void ->x354 : (n: { n: Base[]; }) => void ->{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->n : (Derived1 | Derived2)[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - -var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; return null; }); ->x355 : (n: (s: Base[]) => any) => void ->function(n: (s: Base[]) => any) { } : (n: (s: Base[]) => any) => void ->n : (s: Base[]) => any ->s : Base[] ->Base : Base ->x355(n => { var n: Base[]; return null; }) : void ->x355 : (n: (s: Base[]) => any) => void ->n => { var n: Base[]; return null; } : (n: Base[]) => any ->n : Base[] ->n : Base[] ->Base : Base ->null : null - -var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); ->x356 : (n: Genric) => void ->function(n: Genric) { } : (n: Genric) => void ->n : Genric ->Genric : Genric ->Base : Base ->x356({ func: n => { return [d1, d2]; } }) : void ->x356 : (n: Genric) => void ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->func : (n: Base[]) => (Derived1 | Derived2)[] ->n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] ->n : Base[] ->[d1, d2] : (Derived1 | Derived2)[] ->d1 : Derived1 ->d2 : Derived2 - diff --git a/tests/baselines/reference/ifDoWhileStatements.errors.txt b/tests/baselines/reference/ifDoWhileStatements.errors.txt new file mode 100644 index 0000000000000..fb8985e634bfc --- /dev/null +++ b/tests/baselines/reference/ifDoWhileStatements.errors.txt @@ -0,0 +1,168 @@ +tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts(42,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts (1 errors) ==== + interface I { + id: number; + } + + class C implements I { + id: number; + name: string; + } + + class C2 extends C { + valid: boolean; + } + + class D{ + source: T; + recurse: D; + wrapped: D> + } + + function F(x: string): number { return 42; } + function F2(x: number): boolean { return x < 42; } + + module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } + } + + module N { + export class A { + id: number; + } + + export function F2(x: number): string { return x.toString(); } + } + + // literals + if (true) { } + while (true) { } + do { }while(true) + ~~ +!!! error TS7027: Unreachable code detected. + + if (null) { } + while (null) { } + do { }while(null) + + if (undefined) { } + while (undefined) { } + do { }while(undefined) + + if (0.0) { } + while (0.0) { } + do { }while(0.0) + + if ('a string') { } + while ('a string') { } + do { }while('a string') + + if ('') { } + while ('') { } + do { }while('') + + if (/[a-z]/) { } + while (/[a-z]/) { } + do { }while(/[a-z]/) + + if ([]) { } + while ([]) { } + do { }while([]) + + if ([1, 2]) { } + while ([1, 2]) { } + do { }while([1, 2]) + + if ({}) { } + while ({}) { } + do { }while({}) + + if ({ x: 1, y: 'a' }) { } + while ({ x: 1, y: 'a' }) { } + do { }while({ x: 1, y: 'a' }) + + if (() => 43) { } + while (() => 43) { } + do { }while(() => 43) + + if (new C()) { } + while (new C()) { } + do { }while(new C()) + + if (new D()) { } + while (new D()) { } + do { }while(new D()) + + // references + var a = true; + if (a) { } + while (a) { } + do { }while(a) + + var b = null; + if (b) { } + while (b) { } + do { }while(b) + + var c = undefined; + if (c) { } + while (c) { } + do { }while(c) + + var d = 0.0; + if (d) { } + while (d) { } + do { }while(d) + + var e = 'a string'; + if (e) { } + while (e) { } + do { }while(e) + + var f = ''; + if (f) { } + while (f) { } + do { }while(f) + + var g = /[a-z]/ + if (g) { } + while (g) { } + do { }while(g) + + var h = []; + if (h) { } + while (h) { } + do { }while(h) + + var i = [1, 2]; + if (i) { } + while (i) { } + do { }while(i) + + var j = {}; + if (j) { } + while (j) { } + do { }while(j) + + var k = { x: 1, y: 'a' }; + if (k) { } + while (k) { } + do { }while(k) + + function fn(x?: string): I { return null; } + if (fn()) { } + while (fn()) { } + do { }while(fn()) + + if (fn) { } + while (fn) { } + do { }while(fn) + + + \ No newline at end of file diff --git a/tests/baselines/reference/ifDoWhileStatements.symbols b/tests/baselines/reference/ifDoWhileStatements.symbols deleted file mode 100644 index 36a990010efe4..0000000000000 --- a/tests/baselines/reference/ifDoWhileStatements.symbols +++ /dev/null @@ -1,336 +0,0 @@ -=== tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts === -interface I { ->I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) - - id: number; ->id : Symbol(id, Decl(ifDoWhileStatements.ts, 0, 13)) -} - -class C implements I { ->C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) ->I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) - - id: number; ->id : Symbol(id, Decl(ifDoWhileStatements.ts, 4, 22)) - - name: string; ->name : Symbol(name, Decl(ifDoWhileStatements.ts, 5, 15)) -} - -class C2 extends C { ->C2 : Symbol(C2, Decl(ifDoWhileStatements.ts, 7, 1)) ->C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) - - valid: boolean; ->valid : Symbol(valid, Decl(ifDoWhileStatements.ts, 9, 20)) -} - -class D{ ->D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) ->T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) - - source: T; ->source : Symbol(source, Decl(ifDoWhileStatements.ts, 13, 11)) ->T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) - - recurse: D; ->recurse : Symbol(recurse, Decl(ifDoWhileStatements.ts, 14, 14)) ->D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) ->T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) - - wrapped: D> ->wrapped : Symbol(wrapped, Decl(ifDoWhileStatements.ts, 15, 18)) ->D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) ->D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) ->T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) -} - -function F(x: string): number { return 42; } ->F : Symbol(F, Decl(ifDoWhileStatements.ts, 17, 1)) ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 19, 11)) - -function F2(x: number): boolean { return x < 42; } ->F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 19, 44)) ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 20, 12)) ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 20, 12)) - -module M { ->M : Symbol(M, Decl(ifDoWhileStatements.ts, 20, 50)) - - export class A { ->A : Symbol(A, Decl(ifDoWhileStatements.ts, 22, 10)) - - name: string; ->name : Symbol(name, Decl(ifDoWhileStatements.ts, 23, 20)) - } - - export function F2(x: number): string { return x.toString(); } ->F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 25, 5)) ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 27, 23)) ->x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 27, 23)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) -} - -module N { ->N : Symbol(N, Decl(ifDoWhileStatements.ts, 28, 1)) - - export class A { ->A : Symbol(A, Decl(ifDoWhileStatements.ts, 30, 10)) - - id: number; ->id : Symbol(id, Decl(ifDoWhileStatements.ts, 31, 20)) - } - - export function F2(x: number): string { return x.toString(); } ->F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 33, 5)) ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 35, 23)) ->x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 35, 23)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) -} - -// literals -if (true) { } -while (true) { } -do { }while(true) - -if (null) { } -while (null) { } -do { }while(null) - -if (undefined) { } ->undefined : Symbol(undefined) - -while (undefined) { } ->undefined : Symbol(undefined) - -do { }while(undefined) ->undefined : Symbol(undefined) - -if (0.0) { } -while (0.0) { } -do { }while(0.0) - -if ('a string') { } -while ('a string') { } -do { }while('a string') - -if ('') { } -while ('') { } -do { }while('') - -if (/[a-z]/) { } -while (/[a-z]/) { } -do { }while(/[a-z]/) - -if ([]) { } -while ([]) { } -do { }while([]) - -if ([1, 2]) { } -while ([1, 2]) { } -do { }while([1, 2]) - -if ({}) { } -while ({}) { } -do { }while({}) - -if ({ x: 1, y: 'a' }) { } ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 79, 5)) ->y : Symbol(y, Decl(ifDoWhileStatements.ts, 79, 11)) - -while ({ x: 1, y: 'a' }) { } ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 80, 8)) ->y : Symbol(y, Decl(ifDoWhileStatements.ts, 80, 14)) - -do { }while({ x: 1, y: 'a' }) ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 81, 13)) ->y : Symbol(y, Decl(ifDoWhileStatements.ts, 81, 19)) - -if (() => 43) { } -while (() => 43) { } -do { }while(() => 43) - -if (new C()) { } ->C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) - -while (new C()) { } ->C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) - -do { }while(new C()) ->C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) - -if (new D()) { } ->D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) ->C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) - -while (new D()) { } ->D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) ->C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) - -do { }while(new D()) ->D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) ->C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) - -// references -var a = true; ->a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) - -if (a) { } ->a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) - -while (a) { } ->a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) - -do { }while(a) ->a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) - -var b = null; ->b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) - -if (b) { } ->b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) - -while (b) { } ->b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) - -do { }while(b) ->b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) - -var c = undefined; ->c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) ->undefined : Symbol(undefined) - -if (c) { } ->c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) - -while (c) { } ->c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) - -do { }while(c) ->c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) - -var d = 0.0; ->d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) - -if (d) { } ->d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) - -while (d) { } ->d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) - -do { }while(d) ->d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) - -var e = 'a string'; ->e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) - -if (e) { } ->e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) - -while (e) { } ->e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) - -do { }while(e) ->e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) - -var f = ''; ->f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) - -if (f) { } ->f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) - -while (f) { } ->f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) - -do { }while(f) ->f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) - -var g = /[a-z]/ ->g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) - -if (g) { } ->g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) - -while (g) { } ->g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) - -do { }while(g) ->g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) - -var h = []; ->h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) - -if (h) { } ->h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) - -while (h) { } ->h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) - -do { }while(h) ->h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) - -var i = [1, 2]; ->i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) - -if (i) { } ->i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) - -while (i) { } ->i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) - -do { }while(i) ->i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) - -var j = {}; ->j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) - -if (j) { } ->j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) - -while (j) { } ->j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) - -do { }while(j) ->j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) - -var k = { x: 1, y: 'a' }; ->k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 146, 9)) ->y : Symbol(y, Decl(ifDoWhileStatements.ts, 146, 15)) - -if (k) { } ->k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) - -while (k) { } ->k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) - -do { }while(k) ->k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) - -function fn(x?: string): I { return null; } ->fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) ->x : Symbol(x, Decl(ifDoWhileStatements.ts, 151, 12)) ->I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) - -if (fn()) { } ->fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) - -while (fn()) { } ->fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) - -do { }while(fn()) ->fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) - -if (fn) { } ->fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) - -while (fn) { } ->fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) - -do { }while(fn) ->fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) - - - diff --git a/tests/baselines/reference/ifDoWhileStatements.types b/tests/baselines/reference/ifDoWhileStatements.types deleted file mode 100644 index 92a9df6a4dd7f..0000000000000 --- a/tests/baselines/reference/ifDoWhileStatements.types +++ /dev/null @@ -1,433 +0,0 @@ -=== tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts === -interface I { ->I : I - - id: number; ->id : number -} - -class C implements I { ->C : C ->I : I - - id: number; ->id : number - - name: string; ->name : string -} - -class C2 extends C { ->C2 : C2 ->C : C - - valid: boolean; ->valid : boolean -} - -class D{ ->D : D ->T : T - - source: T; ->source : T ->T : T - - recurse: D; ->recurse : D ->D : D ->T : T - - wrapped: D> ->wrapped : D> ->D : D ->D : D ->T : T -} - -function F(x: string): number { return 42; } ->F : (x: string) => number ->x : string ->42 : number - -function F2(x: number): boolean { return x < 42; } ->F2 : (x: number) => boolean ->x : number ->x < 42 : boolean ->x : number ->42 : number - -module M { ->M : typeof M - - export class A { ->A : A - - name: string; ->name : string - } - - export function F2(x: number): string { return x.toString(); } ->F2 : (x: number) => string ->x : number ->x.toString() : string ->x.toString : (radix?: number) => string ->x : number ->toString : (radix?: number) => string -} - -module N { ->N : typeof N - - export class A { ->A : A - - id: number; ->id : number - } - - export function F2(x: number): string { return x.toString(); } ->F2 : (x: number) => string ->x : number ->x.toString() : string ->x.toString : (radix?: number) => string ->x : number ->toString : (radix?: number) => string -} - -// literals -if (true) { } ->true : boolean - -while (true) { } ->true : boolean - -do { }while(true) ->true : boolean - -if (null) { } ->null : null - -while (null) { } ->null : null - -do { }while(null) ->null : null - -if (undefined) { } ->undefined : undefined - -while (undefined) { } ->undefined : undefined - -do { }while(undefined) ->undefined : undefined - -if (0.0) { } ->0.0 : number - -while (0.0) { } ->0.0 : number - -do { }while(0.0) ->0.0 : number - -if ('a string') { } ->'a string' : string - -while ('a string') { } ->'a string' : string - -do { }while('a string') ->'a string' : string - -if ('') { } ->'' : string - -while ('') { } ->'' : string - -do { }while('') ->'' : string - -if (/[a-z]/) { } ->/[a-z]/ : RegExp - -while (/[a-z]/) { } ->/[a-z]/ : RegExp - -do { }while(/[a-z]/) ->/[a-z]/ : RegExp - -if ([]) { } ->[] : undefined[] - -while ([]) { } ->[] : undefined[] - -do { }while([]) ->[] : undefined[] - -if ([1, 2]) { } ->[1, 2] : number[] ->1 : number ->2 : number - -while ([1, 2]) { } ->[1, 2] : number[] ->1 : number ->2 : number - -do { }while([1, 2]) ->[1, 2] : number[] ->1 : number ->2 : number - -if ({}) { } ->{} : {} - -while ({}) { } ->{} : {} - -do { }while({}) ->{} : {} - -if ({ x: 1, y: 'a' }) { } ->{ x: 1, y: 'a' } : { x: number; y: string; } ->x : number ->1 : number ->y : string ->'a' : string - -while ({ x: 1, y: 'a' }) { } ->{ x: 1, y: 'a' } : { x: number; y: string; } ->x : number ->1 : number ->y : string ->'a' : string - -do { }while({ x: 1, y: 'a' }) ->{ x: 1, y: 'a' } : { x: number; y: string; } ->x : number ->1 : number ->y : string ->'a' : string - -if (() => 43) { } ->() => 43 : () => number ->43 : number - -while (() => 43) { } ->() => 43 : () => number ->43 : number - -do { }while(() => 43) ->() => 43 : () => number ->43 : number - -if (new C()) { } ->new C() : C ->C : typeof C - -while (new C()) { } ->new C() : C ->C : typeof C - -do { }while(new C()) ->new C() : C ->C : typeof C - -if (new D()) { } ->new D() : D ->D : typeof D ->C : C - -while (new D()) { } ->new D() : D ->D : typeof D ->C : C - -do { }while(new D()) ->new D() : D ->D : typeof D ->C : C - -// references -var a = true; ->a : boolean ->true : boolean - -if (a) { } ->a : boolean - -while (a) { } ->a : boolean - -do { }while(a) ->a : boolean - -var b = null; ->b : any ->null : null - -if (b) { } ->b : any - -while (b) { } ->b : any - -do { }while(b) ->b : any - -var c = undefined; ->c : any ->undefined : undefined - -if (c) { } ->c : any - -while (c) { } ->c : any - -do { }while(c) ->c : any - -var d = 0.0; ->d : number ->0.0 : number - -if (d) { } ->d : number - -while (d) { } ->d : number - -do { }while(d) ->d : number - -var e = 'a string'; ->e : string ->'a string' : string - -if (e) { } ->e : string - -while (e) { } ->e : string - -do { }while(e) ->e : string - -var f = ''; ->f : string ->'' : string - -if (f) { } ->f : string - -while (f) { } ->f : string - -do { }while(f) ->f : string - -var g = /[a-z]/ ->g : RegExp ->/[a-z]/ : RegExp - -if (g) { } ->g : RegExp - -while (g) { } ->g : RegExp - -do { }while(g) ->g : RegExp - -var h = []; ->h : any[] ->[] : undefined[] - -if (h) { } ->h : any[] - -while (h) { } ->h : any[] - -do { }while(h) ->h : any[] - -var i = [1, 2]; ->i : number[] ->[1, 2] : number[] ->1 : number ->2 : number - -if (i) { } ->i : number[] - -while (i) { } ->i : number[] - -do { }while(i) ->i : number[] - -var j = {}; ->j : {} ->{} : {} - -if (j) { } ->j : {} - -while (j) { } ->j : {} - -do { }while(j) ->j : {} - -var k = { x: 1, y: 'a' }; ->k : { x: number; y: string; } ->{ x: 1, y: 'a' } : { x: number; y: string; } ->x : number ->1 : number ->y : string ->'a' : string - -if (k) { } ->k : { x: number; y: string; } - -while (k) { } ->k : { x: number; y: string; } - -do { }while(k) ->k : { x: number; y: string; } - -function fn(x?: string): I { return null; } ->fn : (x?: string) => I ->x : string ->I : I ->null : null - -if (fn()) { } ->fn() : I ->fn : (x?: string) => I - -while (fn()) { } ->fn() : I ->fn : (x?: string) => I - -do { }while(fn()) ->fn() : I ->fn : (x?: string) => I - -if (fn) { } ->fn : (x?: string) => I - -while (fn) { } ->fn : (x?: string) => I - -do { }while(fn) ->fn : (x?: string) => I - - - diff --git a/tests/baselines/reference/ifElseWithStatements1.errors.txt b/tests/baselines/reference/ifElseWithStatements1.errors.txt index 186cff5924139..f9fcb33113a96 100644 --- a/tests/baselines/reference/ifElseWithStatements1.errors.txt +++ b/tests/baselines/reference/ifElseWithStatements1.errors.txt @@ -1,8 +1,10 @@ tests/cases/compiler/ifElseWithStatements1.ts(2,5): error TS2304: Cannot find name 'f'. tests/cases/compiler/ifElseWithStatements1.ts(4,5): error TS2304: Cannot find name 'f'. +tests/cases/compiler/ifElseWithStatements1.ts(4,5): error TS7027: Unreachable code detected. +tests/cases/compiler/ifElseWithStatements1.ts(10,9): error TS7027: Unreachable code detected. -==== tests/cases/compiler/ifElseWithStatements1.ts (2 errors) ==== +==== tests/cases/compiler/ifElseWithStatements1.ts (4 errors) ==== if (true) f(); ~ @@ -11,11 +13,15 @@ tests/cases/compiler/ifElseWithStatements1.ts(4,5): error TS2304: Cannot find na f(); ~ !!! error TS2304: Cannot find name 'f'. + ~ +!!! error TS7027: Unreachable code detected. function foo(): boolean { if (true) return true; else return false; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } \ No newline at end of file diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt index 99819ecad2c96..b1d4a1ba6ba8c 100644 --- a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt +++ b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt @@ -1,7 +1,8 @@ tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(1,10): error TS2354: No best common type exists among return expressions. +tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(6,9): error TS7027: Unreachable code detected. -==== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts (1 errors) ==== +==== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts (2 errors) ==== function foo() { ~~~ !!! error TS2354: No best common type exists among return expressions. @@ -10,6 +11,8 @@ tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(1,10): error TS235 } else { return "42"; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } }; \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt index 08aab5b1158c5..251938cc9c7c7 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt @@ -1,13 +1,16 @@ tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts(3,21): error TS7027: Unreachable code detected. tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts (2 errors) ==== +==== tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts (3 errors) ==== class a { static get x(): () => string { ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null;; + ~ +!!! error TS7027: Unreachable code detected. } static set x(aValue: () => string) { ~ diff --git a/tests/baselines/reference/interfaceExtendingClass2.errors.txt b/tests/baselines/reference/interfaceExtendingClass2.errors.txt index 3b394d4922ab7..68bd5e845acdd 100644 --- a/tests/baselines/reference/interfaceExtendingClass2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClass2.errors.txt @@ -1,10 +1,11 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(11,5): error TS2411: Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(13,13): error TS1131: Property or signature expected. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(14,9): error TS1128: Declaration or statement expected. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(14,10): error TS7027: Unreachable code detected. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(15,5): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (4 errors) ==== +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (5 errors) ==== class Foo { x: string; y() { } @@ -26,6 +27,8 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending }; ~ !!! error TS1128: Declaration or statement expected. + ~ +!!! error TS7027: Unreachable code detected. } ~ !!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithPrivateMember.errors.txt b/tests/baselines/reference/interfaceWithPrivateMember.errors.txt index 7f2542b45a11c..aa6dfdc103216 100644 --- a/tests/baselines/reference/interfaceWithPrivateMember.errors.txt +++ b/tests/baselines/reference/interfaceWithPrivateMember.errors.txt @@ -1,11 +1,12 @@ tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(4,5): error TS1131: Property or signature expected. tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(8,5): error TS1131: Property or signature expected. tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(12,5): error TS1131: Property or signature expected. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(12,13): error TS7028: Unused label. tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(12,16): error TS2304: Cannot find name 'string'. tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(13,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts (5 errors) ==== +==== tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts (6 errors) ==== // interfaces do not permit private members, these are errors interface I { @@ -24,6 +25,8 @@ tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(13,1): er private y: string; ~~~~~~~ !!! error TS1131: Property or signature expected. + ~ +!!! error TS7028: Unused label. ~~~~~~ !!! error TS2304: Cannot find name 'string'. } diff --git a/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt b/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt index 65fd55b763baa..2a26190534e81 100644 --- a/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt +++ b/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt @@ -1,12 +1,14 @@ tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(7,1): error TS7028: Unused label. tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(8,4): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(11,1): error TS7027: Unreachable code detected. tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -==== tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts (6 errors) ==== +==== tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts (8 errors) ==== // All errors // naked break not allowed @@ -16,12 +18,16 @@ tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements // non-existent label ONE: + ~~~ +!!! error TS7028: Unused label. do break TWO; while (true) ~~~~~~~~~~ !!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. // break from inside function TWO: + ~~~ +!!! error TS7027: Unreachable code detected. do { var x = () => { break TWO; diff --git a/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt b/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt index e9643394d1215..b3938d9ba8b48 100644 --- a/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt @@ -1,12 +1,14 @@ tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(7,1): error TS7028: Unused label. tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(8,4): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(11,1): error TS7027: Unreachable code detected. tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -==== tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts (6 errors) ==== +==== tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts (8 errors) ==== // All errors // naked continue not allowed @@ -16,12 +18,16 @@ tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStat // non-existent label ONE: + ~~~ +!!! error TS7028: Unused label. do continue TWO; while (true) ~~~~~~~~~~~~~ !!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: + ~~~ +!!! error TS7027: Unreachable code detected. do { var x = () => { continue TWO; diff --git a/tests/baselines/reference/invalidForBreakStatements.errors.txt b/tests/baselines/reference/invalidForBreakStatements.errors.txt index 50e4013c0eac4..f803cad08e157 100644 --- a/tests/baselines/reference/invalidForBreakStatements.errors.txt +++ b/tests/baselines/reference/invalidForBreakStatements.errors.txt @@ -1,12 +1,14 @@ tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(7,1): error TS7028: Unused label. tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(8,9): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(11,1): error TS7027: Unreachable code detected. tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(36,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -==== tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts (6 errors) ==== +==== tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts (8 errors) ==== // All errors // naked break not allowed @@ -16,12 +18,16 @@ tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts( // non-existent label ONE: + ~~~ +!!! error TS7028: Unused label. for(;;) break TWO; ~~~~~~~~~~ !!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. // break from inside function TWO: + ~~~ +!!! error TS7027: Unreachable code detected. for(;;) { var x = () => { break TWO; diff --git a/tests/baselines/reference/invalidForContinueStatements.errors.txt b/tests/baselines/reference/invalidForContinueStatements.errors.txt index 3af47370df156..9a252a2c5726c 100644 --- a/tests/baselines/reference/invalidForContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidForContinueStatements.errors.txt @@ -1,12 +1,14 @@ tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(7,1): error TS7028: Unused label. tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(8,9): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(11,1): error TS7027: Unreachable code detected. tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(36,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -==== tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts (6 errors) ==== +==== tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts (8 errors) ==== // All errors // naked continue not allowed @@ -16,12 +18,16 @@ tests/cases/conformance/statements/continueStatements/invalidForContinueStatemen // non-existent label ONE: + ~~~ +!!! error TS7028: Unused label. for(;;) continue TWO; ~~~~~~~~~~~~~ !!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: + ~~~ +!!! error TS7027: Unreachable code detected. for(;;) { var x = () => { continue TWO; diff --git a/tests/baselines/reference/invalidForInBreakStatements.errors.txt b/tests/baselines/reference/invalidForInBreakStatements.errors.txt index d83304ab1c674..a575970ff889d 100644 --- a/tests/baselines/reference/invalidForInBreakStatements.errors.txt +++ b/tests/baselines/reference/invalidForInBreakStatements.errors.txt @@ -1,12 +1,17 @@ tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(7,1): error TS7028: Unused label. tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(8,19): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(11,1): error TS7028: Unused label. tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(18,1): error TS7028: Unused label. tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(28,5): error TS7028: Unused label. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(33,1): error TS7028: Unused label. tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -==== tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts (6 errors) ==== +==== tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts (11 errors) ==== // All errors // naked break not allowed @@ -16,12 +21,16 @@ tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.t // non-existent label ONE: + ~~~ +!!! error TS7028: Unused label. for (var x in {}) break TWO; ~~~~~~~~~~ !!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. // break from inside function TWO: + ~~~ +!!! error TS7028: Unused label. for (var x in {}) { var fn = () => { break TWO; @@ -31,6 +40,8 @@ tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.t } THREE: + ~~~~~ +!!! error TS7028: Unused label. for (var x in {}) { var fn = function () { break THREE; @@ -45,11 +56,15 @@ tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.t ~~~~~~~~~~~ !!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. FIVE: + ~~~~ +!!! error TS7028: Unused label. for (var x in {}) { } } // label on non-loop statement NINE: + ~~~~ +!!! error TS7028: Unused label. var y = 12; for (var x in {}) { diff --git a/tests/baselines/reference/invalidForInContinueStatements.errors.txt b/tests/baselines/reference/invalidForInContinueStatements.errors.txt index 7353a22d9cd8a..15b515742a91d 100644 --- a/tests/baselines/reference/invalidForInContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidForInContinueStatements.errors.txt @@ -1,12 +1,17 @@ tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(7,1): error TS7028: Unused label. tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(8,19): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(11,1): error TS7028: Unused label. tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(18,1): error TS7028: Unused label. tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(28,5): error TS7028: Unused label. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(33,1): error TS7028: Unused label. tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -==== tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts (6 errors) ==== +==== tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts (11 errors) ==== // All errors // naked continue not allowed @@ -16,12 +21,16 @@ tests/cases/conformance/statements/continueStatements/invalidForInContinueStatem // non-existent label ONE: + ~~~ +!!! error TS7028: Unused label. for (var x in {}) continue TWO; ~~~~~~~~~~~~~ !!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: + ~~~ +!!! error TS7028: Unused label. for (var x in {}) { var fn = () => { continue TWO; @@ -31,6 +40,8 @@ tests/cases/conformance/statements/continueStatements/invalidForInContinueStatem } THREE: + ~~~~~ +!!! error TS7028: Unused label. for (var x in {}) { var fn = function () { continue THREE; @@ -45,11 +56,15 @@ tests/cases/conformance/statements/continueStatements/invalidForInContinueStatem ~~~~~~~~~~~~~~ !!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. FIVE: + ~~~~ +!!! error TS7028: Unused label. for (var x in {}) { } } // label on non-loop statement NINE: + ~~~~ +!!! error TS7028: Unused label. var y = 12; for (var x in {}) { diff --git a/tests/baselines/reference/invalidThrowStatement.errors.txt b/tests/baselines/reference/invalidThrowStatement.errors.txt index b30549a217c27..d72fd7e2acd6b 100644 --- a/tests/baselines/reference/invalidThrowStatement.errors.txt +++ b/tests/baselines/reference/invalidThrowStatement.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts(1,6): error TS1109: Expression expected. tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts(3,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts(3,8): error TS7027: Unreachable code detected. -==== tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts (2 errors) ==== +==== tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts (3 errors) ==== throw; ~ !!! error TS1109: Expression expected. @@ -10,4 +11,6 @@ tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts(3,1) export throw null; ~~~~~~ !!! error TS1128: Declaration or statement expected. + ~~~~~ +!!! error TS7027: Unreachable code detected. \ No newline at end of file diff --git a/tests/baselines/reference/invalidWhileBreakStatements.errors.txt b/tests/baselines/reference/invalidWhileBreakStatements.errors.txt index 54adc2856d7ef..7d4f86b3e9d15 100644 --- a/tests/baselines/reference/invalidWhileBreakStatements.errors.txt +++ b/tests/baselines/reference/invalidWhileBreakStatements.errors.txt @@ -1,12 +1,14 @@ tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. +tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.ts(7,1): error TS7028: Unused label. tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.ts(8,14): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.ts(11,1): error TS7027: Unreachable code detected. tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -==== tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.ts (6 errors) ==== +==== tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.ts (8 errors) ==== // All errors // naked break not allowed @@ -16,12 +18,16 @@ tests/cases/conformance/statements/breakStatements/invalidWhileBreakStatements.t // non-existent label ONE: + ~~~ +!!! error TS7028: Unused label. while (true) break TWO; ~~~~~~~~~~ !!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. // break from inside function TWO: + ~~~ +!!! error TS7027: Unreachable code detected. while (true){ var x = () => { break TWO; diff --git a/tests/baselines/reference/invalidWhileContinueStatements.errors.txt b/tests/baselines/reference/invalidWhileContinueStatements.errors.txt index 462b244efd43a..fdc84d84f2e97 100644 --- a/tests/baselines/reference/invalidWhileContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidWhileContinueStatements.errors.txt @@ -1,12 +1,14 @@ tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(7,1): error TS7028: Unused label. tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(8,14): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(11,1): error TS7027: Unreachable code detected. tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -==== tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts (6 errors) ==== +==== tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts (8 errors) ==== // All errors // naked continue not allowed @@ -16,12 +18,16 @@ tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatem // non-existent label ONE: + ~~~ +!!! error TS7028: Unused label. while (true) continue TWO; ~~~~~~~~~~~~~ !!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: + ~~~ +!!! error TS7027: Unreachable code detected. while (true){ var x = () => { continue TWO; diff --git a/tests/baselines/reference/letAndVarRedeclaration.errors.txt b/tests/baselines/reference/letAndVarRedeclaration.errors.txt index 48704f61040d4..3c523154c3f6e 100644 --- a/tests/baselines/reference/letAndVarRedeclaration.errors.txt +++ b/tests/baselines/reference/letAndVarRedeclaration.errors.txt @@ -17,11 +17,12 @@ tests/cases/compiler/letAndVarRedeclaration.ts(38,5): error TS2451: Cannot redec tests/cases/compiler/letAndVarRedeclaration.ts(39,10): error TS2451: Cannot redeclare block-scoped variable 'x11'. tests/cases/compiler/letAndVarRedeclaration.ts(43,9): error TS2451: Cannot redeclare block-scoped variable 'x11'. tests/cases/compiler/letAndVarRedeclaration.ts(44,14): error TS2451: Cannot redeclare block-scoped variable 'x11'. +tests/cases/compiler/letAndVarRedeclaration.ts(48,1): error TS7027: Unreachable code detected. tests/cases/compiler/letAndVarRedeclaration.ts(49,9): error TS2451: Cannot redeclare block-scoped variable 'x11'. tests/cases/compiler/letAndVarRedeclaration.ts(50,14): error TS2451: Cannot redeclare block-scoped variable 'x11'. -==== tests/cases/compiler/letAndVarRedeclaration.ts (21 errors) ==== +==== tests/cases/compiler/letAndVarRedeclaration.ts (22 errors) ==== let e0 ~~ @@ -108,6 +109,8 @@ tests/cases/compiler/letAndVarRedeclaration.ts(50,14): error TS2451: Cannot rede } module M2 { + ~~~~~~ +!!! error TS7027: Unreachable code detected. let x11; ~~~ !!! error TS2451: Cannot redeclare block-scoped variable 'x11'. diff --git a/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt index 1ece1f31433cd..f3144b525006d 100644 --- a/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt @@ -1,6 +1,8 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(4,5): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(6,5): error TS7027: Unreachable code detected. tests/cases/compiler/letDeclarations-invalidContexts.ts(6,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(9,5): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(11,1): error TS7027: Unreachable code detected. tests/cases/compiler/letDeclarations-invalidContexts.ts(12,5): error TS1157: 'let' declarations can only be declared inside a block. tests/cases/compiler/letDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/compiler/letDeclarations-invalidContexts.ts(20,5): error TS1157: 'let' declarations can only be declared inside a block. @@ -9,7 +11,7 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(26,12): error TS1157: 'l tests/cases/compiler/letDeclarations-invalidContexts.ts(29,29): error TS1157: 'let' declarations can only be declared inside a block. -==== tests/cases/compiler/letDeclarations-invalidContexts.ts (9 errors) ==== +==== tests/cases/compiler/letDeclarations-invalidContexts.ts (11 errors) ==== // Errors, let must be defined inside a block if (true) @@ -18,6 +20,8 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(29,29): error TS1157: 'l !!! error TS1157: 'let' declarations can only be declared inside a block. else let l2 = 0; + ~~~ +!!! error TS7027: Unreachable code detected. ~~~~~~~~~~~ !!! error TS1157: 'let' declarations can only be declared inside a block. @@ -27,6 +31,8 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(29,29): error TS1157: 'l !!! error TS1157: 'let' declarations can only be declared inside a block. do + ~~ +!!! error TS7027: Unreachable code detected. let l4 = 0; ~~~~~~~~~~~ !!! error TS1157: 'let' declarations can only be declared inside a block. diff --git a/tests/baselines/reference/letDeclarations-scopes.errors.txt b/tests/baselines/reference/letDeclarations-scopes.errors.txt index 5c89ea98049a6..49072f30e9835 100644 --- a/tests/baselines/reference/letDeclarations-scopes.errors.txt +++ b/tests/baselines/reference/letDeclarations-scopes.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/letDeclarations-scopes.ts(13,5): error TS7027: Unreachable code detected. +tests/cases/compiler/letDeclarations-scopes.ts(22,1): error TS7027: Unreachable code detected. tests/cases/compiler/letDeclarations-scopes.ts(28,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/letDeclarations-scopes.ts(120,5): error TS7028: Unused label. -==== tests/cases/compiler/letDeclarations-scopes.ts (1 errors) ==== +==== tests/cases/compiler/letDeclarations-scopes.ts (4 errors) ==== // global let l = "string"; @@ -15,6 +18,8 @@ tests/cases/compiler/letDeclarations-scopes.ts(28,7): error TS2410: All symbols } else { let l = 0; + ~~~ +!!! error TS7027: Unreachable code detected. n = l; } @@ -24,6 +29,8 @@ tests/cases/compiler/letDeclarations-scopes.ts(28,7): error TS2410: All symbols } do { + ~~ +!!! error TS7027: Unreachable code detected. let l = 0; n = l; } while (true); @@ -124,6 +131,8 @@ tests/cases/compiler/letDeclarations-scopes.ts(28,7): error TS2410: All symbols } lable: let l2 = 0; + ~~~~~ +!!! error TS7028: Unused label. } // methods diff --git a/tests/baselines/reference/letDeclarations-validContexts.errors.txt b/tests/baselines/reference/letDeclarations-validContexts.errors.txt index 3f3b7a2634f09..f5e8022191b0e 100644 --- a/tests/baselines/reference/letDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/letDeclarations-validContexts.errors.txt @@ -1,7 +1,13 @@ +tests/cases/compiler/letDeclarations-validContexts.ts(8,5): error TS7027: Unreachable code detected. +tests/cases/compiler/letDeclarations-validContexts.ts(15,1): error TS7027: Unreachable code detected. tests/cases/compiler/letDeclarations-validContexts.ts(20,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/letDeclarations-validContexts.ts(132,5): error TS7028: Unused label. +tests/cases/compiler/letDeclarations-validContexts.ts(134,9): error TS7028: Unused label. +tests/cases/compiler/letDeclarations-validContexts.ts(139,5): error TS7028: Unused label. +tests/cases/compiler/letDeclarations-validContexts.ts(141,9): error TS7028: Unused label. -==== tests/cases/compiler/letDeclarations-validContexts.ts (1 errors) ==== +==== tests/cases/compiler/letDeclarations-validContexts.ts (7 errors) ==== // Control flow statements with blocks @@ -10,6 +16,8 @@ tests/cases/compiler/letDeclarations-validContexts.ts(20,7): error TS2410: All s } else { let l2 = 0; + ~~~ +!!! error TS7027: Unreachable code detected. } while (true) { @@ -17,6 +25,8 @@ tests/cases/compiler/letDeclarations-validContexts.ts(20,7): error TS2410: All s } do { + ~~ +!!! error TS7027: Unreachable code detected. let l4 = 0; } while (true); @@ -136,14 +146,22 @@ tests/cases/compiler/letDeclarations-validContexts.ts(20,7): error TS2410: All s function f3() { label: let l32 = 0; + ~~~~~ +!!! error TS7028: Unused label. { label2: let l33 = 0; + ~~~~~~ +!!! error TS7028: Unused label. } } module m3 { label: let l34 = 0; + ~~~~~ +!!! error TS7028: Unused label. { label2: let l35 = 0; + ~~~~~~ +!!! error TS7028: Unused label. } } \ No newline at end of file diff --git a/tests/baselines/reference/localTypes4.errors.txt b/tests/baselines/reference/localTypes4.errors.txt index cad9d30c933b0..d6a3f0ce69998 100644 --- a/tests/baselines/reference/localTypes4.errors.txt +++ b/tests/baselines/reference/localTypes4.errors.txt @@ -2,9 +2,10 @@ tests/cases/conformance/types/localTypes/localTypes4.ts(10,19): error TS2304: Ca tests/cases/conformance/types/localTypes/localTypes4.ts(10,23): error TS2304: Cannot find name 'T'. tests/cases/conformance/types/localTypes/localTypes4.ts(18,16): error TS2300: Duplicate identifier 'T'. tests/cases/conformance/types/localTypes/localTypes4.ts(19,19): error TS2300: Duplicate identifier 'T'. +tests/cases/conformance/types/localTypes/localTypes4.ts(35,9): error TS7027: Unreachable code detected. -==== tests/cases/conformance/types/localTypes/localTypes4.ts (4 errors) ==== +==== tests/cases/conformance/types/localTypes/localTypes4.ts (5 errors) ==== function f1() { // Type parameters are in scope in parameters and return types function f(x: T): T { @@ -48,6 +49,8 @@ tests/cases/conformance/types/localTypes/localTypes4.ts(19,19): error TS2300: Du } else { v.x = 20; + ~ +!!! error TS7027: Unreachable code detected. } } \ No newline at end of file diff --git a/tests/baselines/reference/null.errors.txt b/tests/baselines/reference/null.errors.txt new file mode 100644 index 0000000000000..b516720b2412f --- /dev/null +++ b/tests/baselines/reference/null.errors.txt @@ -0,0 +1,30 @@ +tests/cases/compiler/null.ts(8,5): error TS7027: Unreachable code detected. +tests/cases/compiler/null.ts(12,5): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/null.ts (2 errors) ==== + var x=null; + var y=3+x; + var z=3+null; + class C { + } + function f() { + return null; + return new C(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } + function g() { + return null; + return 3; + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } + interface I { + x:any; + y:number; + } + var w:I={x:null,y:3}; + + + \ No newline at end of file diff --git a/tests/baselines/reference/null.symbols b/tests/baselines/reference/null.symbols deleted file mode 100644 index 148cd1586b275..0000000000000 --- a/tests/baselines/reference/null.symbols +++ /dev/null @@ -1,44 +0,0 @@ -=== tests/cases/compiler/null.ts === -var x=null; ->x : Symbol(x, Decl(null.ts, 0, 3)) - -var y=3+x; ->y : Symbol(y, Decl(null.ts, 1, 3)) ->x : Symbol(x, Decl(null.ts, 0, 3)) - -var z=3+null; ->z : Symbol(z, Decl(null.ts, 2, 3)) - -class C { ->C : Symbol(C, Decl(null.ts, 2, 13)) -} -function f() { ->f : Symbol(f, Decl(null.ts, 4, 1)) - - return null; - return new C(); ->C : Symbol(C, Decl(null.ts, 2, 13)) -} -function g() { ->g : Symbol(g, Decl(null.ts, 8, 1)) - - return null; - return 3; -} -interface I { ->I : Symbol(I, Decl(null.ts, 12, 1)) - - x:any; ->x : Symbol(x, Decl(null.ts, 13, 13)) - - y:number; ->y : Symbol(y, Decl(null.ts, 14, 10)) -} -var w:I={x:null,y:3}; ->w : Symbol(w, Decl(null.ts, 17, 3)) ->I : Symbol(I, Decl(null.ts, 12, 1)) ->x : Symbol(x, Decl(null.ts, 17, 9)) ->y : Symbol(y, Decl(null.ts, 17, 16)) - - - diff --git a/tests/baselines/reference/null.types b/tests/baselines/reference/null.types deleted file mode 100644 index 7df551b1bde23..0000000000000 --- a/tests/baselines/reference/null.types +++ /dev/null @@ -1,59 +0,0 @@ -=== tests/cases/compiler/null.ts === -var x=null; ->x : any ->null : null - -var y=3+x; ->y : any ->3+x : any ->3 : number ->x : any - -var z=3+null; ->z : number ->3+null : number ->3 : number ->null : null - -class C { ->C : C -} -function f() { ->f : () => C - - return null; ->null : null - - return new C(); ->new C() : C ->C : typeof C -} -function g() { ->g : () => number - - return null; ->null : null - - return 3; ->3 : number -} -interface I { ->I : I - - x:any; ->x : any - - y:number; ->y : number -} -var w:I={x:null,y:3}; ->w : I ->I : I ->{x:null,y:3} : { x: null; y: number; } ->x : null ->null : null ->y : number ->3 : number - - - diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt index 079951880ab75..48f1ce1bd1367 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt @@ -1,10 +1,13 @@ tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,8): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,37): error TS1005: ';' expected. +tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,53): error TS7027: Unreachable code detected. -==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (2 errors) ==== +==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (3 errors) ==== var f: (x: 'hi') => number = ('hi') => { return 1; }; ~~~~~~~~~~~~~~~~~~~ !!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. ~~ -!!! error TS1005: ';' expected. \ No newline at end of file +!!! error TS1005: ';' expected. + ~ +!!! error TS7027: Unreachable code detected. \ No newline at end of file diff --git a/tests/baselines/reference/parser10.1.1-8gs.errors.txt b/tests/baselines/reference/parser10.1.1-8gs.errors.txt index 185665d23daac..c321ca1fff894 100644 --- a/tests/baselines/reference/parser10.1.1-8gs.errors.txt +++ b/tests/baselines/reference/parser10.1.1-8gs.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(16,7): error TS2304: Cannot find name 'NotEarlyError'. +tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,1): error TS7027: Unreachable code detected. tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,5): error TS1212: Identifier expected. 'public' is a reserved word in strict mode -==== tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts (3 errors) ==== /// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the @@ -22,6 +23,8 @@ tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,5): error TS12 ~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'NotEarlyError'. var public = 1; + ~~~ +!!! error TS7027: Unreachable code detected. ~~~~~~ !!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode \ No newline at end of file diff --git a/tests/baselines/reference/parser768531.errors.txt b/tests/baselines/reference/parser768531.errors.txt new file mode 100644 index 0000000000000..8298431e0e031 --- /dev/null +++ b/tests/baselines/reference/parser768531.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts(1,2): error TS7028: Unused label. + + +==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts (1 errors) ==== + {a: 3} + ~ +!!! error TS7028: Unused label. + /x/ \ No newline at end of file diff --git a/tests/baselines/reference/parser768531.symbols b/tests/baselines/reference/parser768531.symbols deleted file mode 100644 index 2da2298c8e207..0000000000000 --- a/tests/baselines/reference/parser768531.symbols +++ /dev/null @@ -1,4 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts === -{a: 3} -No type information for this code./x/ -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser768531.types b/tests/baselines/reference/parser768531.types deleted file mode 100644 index f1bcedefae9be..0000000000000 --- a/tests/baselines/reference/parser768531.types +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts === -{a: 3} ->a : any ->3 : number - -/x/ ->/x/ : RegExp - diff --git a/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt b/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt index 4b8be3e17ad6e..05b31b7af8e56 100644 --- a/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt @@ -1,13 +1,16 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(2,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(3,1): error TS7027: Unreachable code detected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(4,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts (3 errors) ==== return foo; } ~ !!! error TS1128: Declaration or statement expected. return bar; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } ~ !!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserLabeledStatement1.d.errors.txt b/tests/baselines/reference/parserLabeledStatement1.d.errors.txt index 11de61548a366..2ce51b0bb4c6f 100644 --- a/tests/baselines/reference/parserLabeledStatement1.d.errors.txt +++ b/tests/baselines/reference/parserLabeledStatement1.d.errors.txt @@ -1,11 +1,14 @@ tests/cases/conformance/parser/ecmascript5/Statements/parserLabeledStatement1.d.ts(1,1): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/conformance/parser/ecmascript5/Statements/parserLabeledStatement1.d.ts(1,1): error TS7028: Unused label. tests/cases/conformance/parser/ecmascript5/Statements/parserLabeledStatement1.d.ts(2,3): error TS2304: Cannot find name 'bar'. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserLabeledStatement1.d.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserLabeledStatement1.d.ts (3 errors) ==== foo: ~~~ !!! error TS1036: Statements are not allowed in ambient contexts. + ~~~ +!!! error TS7028: Unused label. bar(); ~~~ !!! error TS2304: Cannot find name 'bar'. \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget3.errors.txt b/tests/baselines/reference/parser_breakTarget3.errors.txt new file mode 100644 index 0000000000000..ad3123eda79aa --- /dev/null +++ b/tests/baselines/reference/parser_breakTarget3.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts(2,1): error TS7028: Unused label. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts (1 errors) ==== + target1: + target2: + ~~~~~~~ +!!! error TS7028: Unused label. + while (true) { + break target1; + } \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget3.symbols b/tests/baselines/reference/parser_breakTarget3.symbols deleted file mode 100644 index 99ec413987af8..0000000000000 --- a/tests/baselines/reference/parser_breakTarget3.symbols +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts === -target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. break target1; -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget3.types b/tests/baselines/reference/parser_breakTarget3.types deleted file mode 100644 index 7cdcb74d7da9d..0000000000000 --- a/tests/baselines/reference/parser_breakTarget3.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts === -target1: ->target1 : any - -target2: ->target2 : any - -while (true) { ->true : boolean - - break target1; ->target1 : any -} diff --git a/tests/baselines/reference/parser_breakTarget4.errors.txt b/tests/baselines/reference/parser_breakTarget4.errors.txt new file mode 100644 index 0000000000000..8c61b20b0ed73 --- /dev/null +++ b/tests/baselines/reference/parser_breakTarget4.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts(1,1): error TS7028: Unused label. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts (1 errors) ==== + target1: + ~~~~~~~ +!!! error TS7028: Unused label. + target2: + while (true) { + break target2; + } \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget4.symbols b/tests/baselines/reference/parser_breakTarget4.symbols deleted file mode 100644 index 042df67d9b282..0000000000000 --- a/tests/baselines/reference/parser_breakTarget4.symbols +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts === -target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. break target2; -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget4.types b/tests/baselines/reference/parser_breakTarget4.types deleted file mode 100644 index 7315175800e66..0000000000000 --- a/tests/baselines/reference/parser_breakTarget4.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts === -target1: ->target1 : any - -target2: ->target2 : any - -while (true) { ->true : boolean - - break target2; ->target2 : any -} diff --git a/tests/baselines/reference/parser_breakTarget5.errors.txt b/tests/baselines/reference/parser_breakTarget5.errors.txt index 8221cbebb4c70..5943649c97b45 100644 --- a/tests/baselines/reference/parser_breakTarget5.errors.txt +++ b/tests/baselines/reference/parser_breakTarget5.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget5.ts(1,1): error TS7028: Unused label. tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget5.ts(5,7): error TS1107: Jump target cannot cross function boundary. -==== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget5.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget5.ts (2 errors) ==== target: + ~~~~~~ +!!! error TS7028: Unused label. while (true) { function f() { while (true) { diff --git a/tests/baselines/reference/parser_continueNotInIterationStatement4.errors.txt b/tests/baselines/reference/parser_continueNotInIterationStatement4.errors.txt index efade17a52a03..9439225956897 100644 --- a/tests/baselines/reference/parser_continueNotInIterationStatement4.errors.txt +++ b/tests/baselines/reference/parser_continueNotInIterationStatement4.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueNotInIterationStatement4.ts(1,1): error TS7028: Unused label. tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueNotInIterationStatement4.ts(4,5): error TS1107: Jump target cannot cross function boundary. -==== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueNotInIterationStatement4.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueNotInIterationStatement4.ts (2 errors) ==== TWO: + ~~~ +!!! error TS7028: Unused label. while (true){ var x = () => { continue TWO; diff --git a/tests/baselines/reference/parser_continueTarget3.errors.txt b/tests/baselines/reference/parser_continueTarget3.errors.txt new file mode 100644 index 0000000000000..4871cb275e770 --- /dev/null +++ b/tests/baselines/reference/parser_continueTarget3.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts(2,1): error TS7028: Unused label. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts (1 errors) ==== + target1: + target2: + ~~~~~~~ +!!! error TS7028: Unused label. + while (true) { + continue target1; + } \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget3.symbols b/tests/baselines/reference/parser_continueTarget3.symbols deleted file mode 100644 index 2038671d215a6..0000000000000 --- a/tests/baselines/reference/parser_continueTarget3.symbols +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts === -target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. continue target1; -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget3.types b/tests/baselines/reference/parser_continueTarget3.types deleted file mode 100644 index 33c931c79596a..0000000000000 --- a/tests/baselines/reference/parser_continueTarget3.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts === -target1: ->target1 : any - -target2: ->target2 : any - -while (true) { ->true : boolean - - continue target1; ->target1 : any -} diff --git a/tests/baselines/reference/parser_continueTarget4.errors.txt b/tests/baselines/reference/parser_continueTarget4.errors.txt new file mode 100644 index 0000000000000..6089ea60cf7f3 --- /dev/null +++ b/tests/baselines/reference/parser_continueTarget4.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts(1,1): error TS7028: Unused label. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts (1 errors) ==== + target1: + ~~~~~~~ +!!! error TS7028: Unused label. + target2: + while (true) { + continue target2; + } \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget4.symbols b/tests/baselines/reference/parser_continueTarget4.symbols deleted file mode 100644 index 2b47099715ee1..0000000000000 --- a/tests/baselines/reference/parser_continueTarget4.symbols +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts === -target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. continue target2; -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget4.types b/tests/baselines/reference/parser_continueTarget4.types deleted file mode 100644 index cb0367283ce8e..0000000000000 --- a/tests/baselines/reference/parser_continueTarget4.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts === -target1: ->target1 : any - -target2: ->target2 : any - -while (true) { ->true : boolean - - continue target2; ->target2 : any -} diff --git a/tests/baselines/reference/parser_continueTarget5.errors.txt b/tests/baselines/reference/parser_continueTarget5.errors.txt index ffeee7a07b311..b9b1f2edb945d 100644 --- a/tests/baselines/reference/parser_continueTarget5.errors.txt +++ b/tests/baselines/reference/parser_continueTarget5.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget5.ts(1,1): error TS7028: Unused label. tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget5.ts(5,7): error TS1107: Jump target cannot cross function boundary. -==== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget5.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget5.ts (2 errors) ==== target: + ~~~~~~ +!!! error TS7028: Unused label. while (true) { function f() { while (true) { diff --git a/tests/baselines/reference/parser_duplicateLabel1.errors.txt b/tests/baselines/reference/parser_duplicateLabel1.errors.txt index 4733a240e3658..a4319aaa7b9e9 100644 --- a/tests/baselines/reference/parser_duplicateLabel1.errors.txt +++ b/tests/baselines/reference/parser_duplicateLabel1.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel1.ts(1,1): error TS7028: Unused label. tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel1.ts(2,1): error TS1114: Duplicate label 'target' -==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel1.ts (2 errors) ==== target: + ~~~~~~ +!!! error TS7028: Unused label. target: ~~~~~~ !!! error TS1114: Duplicate label 'target' diff --git a/tests/baselines/reference/parser_duplicateLabel2.errors.txt b/tests/baselines/reference/parser_duplicateLabel2.errors.txt index 92078593e4702..123949fa5aab3 100644 --- a/tests/baselines/reference/parser_duplicateLabel2.errors.txt +++ b/tests/baselines/reference/parser_duplicateLabel2.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel2.ts(1,1): error TS7028: Unused label. tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel2.ts(3,3): error TS1114: Duplicate label 'target' -==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel2.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel2.ts (2 errors) ==== target: + ~~~~~~ +!!! error TS7028: Unused label. while (true) { target: ~~~~~~ diff --git a/tests/baselines/reference/parser_duplicateLabel3.errors.txt b/tests/baselines/reference/parser_duplicateLabel3.errors.txt new file mode 100644 index 0000000000000..a933588f538bc --- /dev/null +++ b/tests/baselines/reference/parser_duplicateLabel3.errors.txt @@ -0,0 +1,17 @@ +tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts(1,1): error TS7028: Unused label. +tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts(4,5): error TS7028: Unused label. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts (2 errors) ==== + target: + ~~~~~~ +!!! error TS7028: Unused label. + while (true) { + function f() { + target: + ~~~~~~ +!!! error TS7028: Unused label. + while (true) { + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/parser_duplicateLabel3.symbols b/tests/baselines/reference/parser_duplicateLabel3.symbols deleted file mode 100644 index 20627a0e2b8f8..0000000000000 --- a/tests/baselines/reference/parser_duplicateLabel3.symbols +++ /dev/null @@ -1,11 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts === -target: -while (true) { - function f() { ->f : Symbol(f, Decl(parser_duplicateLabel3.ts, 1, 14)) - - target: - while (true) { - } - } -} diff --git a/tests/baselines/reference/parser_duplicateLabel3.types b/tests/baselines/reference/parser_duplicateLabel3.types deleted file mode 100644 index 05cfe708161fe..0000000000000 --- a/tests/baselines/reference/parser_duplicateLabel3.types +++ /dev/null @@ -1,18 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts === -target: ->target : any - -while (true) { ->true : boolean - - function f() { ->f : () => void - - target: ->target : any - - while (true) { ->true : boolean - } - } -} diff --git a/tests/baselines/reference/parser_duplicateLabel4.errors.txt b/tests/baselines/reference/parser_duplicateLabel4.errors.txt new file mode 100644 index 0000000000000..4a0108ebe069b --- /dev/null +++ b/tests/baselines/reference/parser_duplicateLabel4.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts(1,1): error TS7028: Unused label. +tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts(5,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts (2 errors) ==== + target: + ~~~~~~ +!!! error TS7028: Unused label. + while (true) { + } + + target: + ~~~~~~ +!!! error TS7027: Unreachable code detected. + while (true) { + } \ No newline at end of file diff --git a/tests/baselines/reference/parser_duplicateLabel4.symbols b/tests/baselines/reference/parser_duplicateLabel4.symbols deleted file mode 100644 index 564531bf71bd8..0000000000000 --- a/tests/baselines/reference/parser_duplicateLabel4.symbols +++ /dev/null @@ -1,9 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts === -target: -No type information for this code.while (true) { -No type information for this code.} -No type information for this code. -No type information for this code.target: -No type information for this code.while (true) { -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_duplicateLabel4.types b/tests/baselines/reference/parser_duplicateLabel4.types deleted file mode 100644 index d09529301ca3c..0000000000000 --- a/tests/baselines/reference/parser_duplicateLabel4.types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts === -target: ->target : any - -while (true) { ->true : boolean -} - -target: ->target : any - -while (true) { ->true : boolean -} diff --git a/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.errors.txt index bc6229815f5a8..0f148b6a20e49 100644 --- a/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.errors.txt +++ b/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.errors.txt @@ -1,7 +1,19 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(3,12): error TS4050: Return type of public static method from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(7,49): error TS7027: Unreachable code detected. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(9,5): error TS4053: Return type of public method from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(10,49): error TS7027: Unreachable code detected. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(13,49): error TS7027: Unreachable code detected. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(15,12): error TS4050: Return type of public static method from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(19,49): error TS7027: Unreachable code detected. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(21,5): error TS4053: Return type of public method from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(22,49): error TS7027: Unreachable code detected. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(25,49): error TS7027: Unreachable code detected. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(34,49): error TS7027: Unreachable code detected. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(37,49): error TS7027: Unreachable code detected. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(40,49): error TS7027: Unreachable code detected. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(46,49): error TS7027: Unreachable code detected. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(49,49): error TS7027: Unreachable code detected. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(52,49): error TS7027: Unreachable code detected. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(56,17): error TS4058: Return type of exported function has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(62,17): error TS4058: Return type of exported function has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(70,12): error TS4050: Return type of public static method from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named. @@ -12,7 +24,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(83,17): error tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(86,17): error TS4058: Return type of exported function has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named. -==== tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts (12 errors) ==== +==== tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts (24 errors) ==== import exporter = require("./privacyFunctionReturnTypeDeclFile_exporter"); export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod() { // Error @@ -22,14 +34,20 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(86,17): error } private static myPrivateStaticMethod() { return exporter.createExportedWidget1();; + ~ +!!! error TS7027: Unreachable code detected. } myPublicMethod() { // Error ~~~~~~~~~~~~~~ !!! error TS4053: Return type of public method from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named. return exporter.createExportedWidget1();; + ~ +!!! error TS7027: Unreachable code detected. } private myPrivateMethod() { return exporter.createExportedWidget1();; + ~ +!!! error TS7027: Unreachable code detected. } static myPublicStaticMethod1() { // Error ~~~~~~~~~~~~~~~~~~~~~ @@ -38,14 +56,20 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(86,17): error } private static myPrivateStaticMethod1() { return exporter.createExportedWidget3();; + ~ +!!! error TS7027: Unreachable code detected. } myPublicMethod1() { // Error ~~~~~~~~~~~~~~~ !!! error TS4053: Return type of public method from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named. return exporter.createExportedWidget3();; + ~ +!!! error TS7027: Unreachable code detected. } private myPrivateMethod1() { return exporter.createExportedWidget3();; + ~ +!!! error TS7027: Unreachable code detected. } } @@ -55,24 +79,36 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts(86,17): error } private static myPrivateStaticMethod() { return exporter.createExportedWidget1();; + ~ +!!! error TS7027: Unreachable code detected. } myPublicMethod() { return exporter.createExportedWidget1();; + ~ +!!! error TS7027: Unreachable code detected. } private myPrivateMethod() { return exporter.createExportedWidget1();; + ~ +!!! error TS7027: Unreachable code detected. } static myPublicStaticMethod1() { return exporter.createExportedWidget3(); } private static myPrivateStaticMethod1() { return exporter.createExportedWidget3();; + ~ +!!! error TS7027: Unreachable code detected. } myPublicMethod1() { return exporter.createExportedWidget3();; + ~ +!!! error TS7027: Unreachable code detected. } private myPrivateMethod1() { return exporter.createExportedWidget3();; + ~ +!!! error TS7027: Unreachable code detected. } } diff --git a/tests/baselines/reference/reachabilityChecks1.errors.txt b/tests/baselines/reference/reachabilityChecks1.errors.txt index 7708867c26c21..18a453969a17f 100644 --- a/tests/baselines/reference/reachabilityChecks1.errors.txt +++ b/tests/baselines/reference/reachabilityChecks1.errors.txt @@ -1,23 +1,23 @@ tests/cases/compiler/reachabilityChecks1.ts(3,1): error TS7027: Unreachable code detected. tests/cases/compiler/reachabilityChecks1.ts(7,5): error TS7027: Unreachable code detected. -tests/cases/compiler/reachabilityChecks1.ts(19,12): error TS7027: Unreachable code detected. -tests/cases/compiler/reachabilityChecks1.ts(31,12): error TS7027: Unreachable code detected. -tests/cases/compiler/reachabilityChecks1.ts(48,11): error TS7027: Unreachable code detected. -tests/cases/compiler/reachabilityChecks1.ts(61,10): error TS7027: Unreachable code detected. -tests/cases/compiler/reachabilityChecks1.ts(70,16): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(19,5): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(31,5): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(48,5): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(61,5): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks1.ts(70,5): error TS7027: Unreachable code detected. ==== tests/cases/compiler/reachabilityChecks1.ts (7 errors) ==== while (true); var x = 1; - ~~~~~~~~~~ + ~~~ !!! error TS7027: Unreachable code detected. module A { while (true); let x; - ~~~~~~ + ~~~ !!! error TS7027: Unreachable code detected. } @@ -31,7 +31,7 @@ tests/cases/compiler/reachabilityChecks1.ts(70,16): error TS7027: Unreachable co module A2 { while (true); module A { - ~ + ~~~~~~ !!! error TS7027: Unreachable code detected. var x = 1; } @@ -45,7 +45,7 @@ tests/cases/compiler/reachabilityChecks1.ts(70,16): error TS7027: Unreachable co module A4 { while (true); module A { - ~ + ~~~~~~ !!! error TS7027: Unreachable code detected. const enum E { X } } @@ -64,7 +64,7 @@ tests/cases/compiler/reachabilityChecks1.ts(70,16): error TS7027: Unreachable co function f2() { return; class A { - ~ + ~~~~~ !!! error TS7027: Unreachable code detected. } } @@ -79,7 +79,7 @@ tests/cases/compiler/reachabilityChecks1.ts(70,16): error TS7027: Unreachable co do { } while (true); enum E { - ~ + ~~~~ !!! error TS7027: Unreachable code detected. X = 1 } @@ -90,7 +90,7 @@ tests/cases/compiler/reachabilityChecks1.ts(70,16): error TS7027: Unreachable co throw new Error(); } const enum E { - ~ + ~~~~~ !!! error TS7027: Unreachable code detected. X = 1 } diff --git a/tests/baselines/reference/reachabilityChecks2.errors.txt b/tests/baselines/reference/reachabilityChecks2.errors.txt index 3de7adc50a646..cd48f84f8e151 100644 --- a/tests/baselines/reference/reachabilityChecks2.errors.txt +++ b/tests/baselines/reference/reachabilityChecks2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/reachabilityChecks2.ts(5,8): error TS7027: Unreachable code detected. +tests/cases/compiler/reachabilityChecks2.ts(5,1): error TS7027: Unreachable code detected. ==== tests/cases/compiler/reachabilityChecks2.ts (1 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/reachabilityChecks2.ts(5,8): error TS7027: Unreachable code const enum E { X } module A4 { - ~~ + ~~~~~~ !!! error TS7027: Unreachable code detected. while (true); module A { diff --git a/tests/baselines/reference/reachabilityChecks3.errors.txt b/tests/baselines/reference/reachabilityChecks3.errors.txt index 993ab571b2e13..1114f245f44c6 100644 --- a/tests/baselines/reference/reachabilityChecks3.errors.txt +++ b/tests/baselines/reference/reachabilityChecks3.errors.txt @@ -1,7 +1,9 @@ tests/cases/compiler/reachabilityChecks3.ts(3,1): error TS7028: Unused label. +tests/cases/compiler/reachabilityChecks3.ts(12,5): error TS7028: Unused label. +tests/cases/compiler/reachabilityChecks3.ts(15,17): error TS7028: Unused label. -==== tests/cases/compiler/reachabilityChecks3.ts (1 errors) ==== +==== tests/cases/compiler/reachabilityChecks3.ts (3 errors) ==== let x = 1; loop: while (true) { @@ -13,4 +15,13 @@ tests/cases/compiler/reachabilityChecks3.ts(3,1): error TS7028: Unused label. else { x++; } - } \ No newline at end of file + } + { + x: 100 + ~ +!!! error TS7028: Unused label. + } + + var y = () => { f: 1 } + ~ +!!! error TS7028: Unused label. \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecks3.js b/tests/baselines/reference/reachabilityChecks3.js index 4de316d1ddc50..dd22453938d12 100644 --- a/tests/baselines/reference/reachabilityChecks3.js +++ b/tests/baselines/reference/reachabilityChecks3.js @@ -8,7 +8,12 @@ loop: while (true) { else { x++; } -} +} +{ + x: 100 +} + +var y = () => { f: 1 } //// [reachabilityChecks3.js] var x = 1; @@ -20,3 +25,7 @@ loop: while (true) { x++; } } +{ + x: 100; +} +var y = function () { f: 1; }; diff --git a/tests/baselines/reference/reachabilityChecks5.errors.txt b/tests/baselines/reference/reachabilityChecks5.errors.txt index c30dfa7181719..147dbe264a36c 100644 --- a/tests/baselines/reference/reachabilityChecks5.errors.txt +++ b/tests/baselines/reference/reachabilityChecks5.errors.txt @@ -109,7 +109,7 @@ tests/cases/compiler/reachabilityChecks5.ts(123,13): error TS7027: Unreachable c } else { return 1; - ~~~~~~~~~ + ~~~~~~ !!! error TS7027: Unreachable code detected. } } @@ -152,7 +152,7 @@ tests/cases/compiler/reachabilityChecks5.ts(123,13): error TS7027: Unreachable c break test; } while (true); x++; - ~~~~ + ~ !!! error TS7027: Unreachable code detected. } while (true); } diff --git a/tests/baselines/reference/recursiveLetConst.errors.txt b/tests/baselines/reference/recursiveLetConst.errors.txt index b02d0819a3f46..88ecb379e5ef8 100644 --- a/tests/baselines/reference/recursiveLetConst.errors.txt +++ b/tests/baselines/reference/recursiveLetConst.errors.txt @@ -3,6 +3,7 @@ tests/cases/compiler/recursiveLetConst.ts(3,12): error TS2448: Block-scoped vari tests/cases/compiler/recursiveLetConst.ts(4,11): error TS2448: Block-scoped variable 'y' used before its declaration. tests/cases/compiler/recursiveLetConst.ts(5,14): error TS2448: Block-scoped variable 'y1' used before its declaration. tests/cases/compiler/recursiveLetConst.ts(6,14): error TS2448: Block-scoped variable 'v' used before its declaration. +tests/cases/compiler/recursiveLetConst.ts(7,1): error TS7027: Unreachable code detected. tests/cases/compiler/recursiveLetConst.ts(7,16): error TS2448: Block-scoped variable 'v' used before its declaration. tests/cases/compiler/recursiveLetConst.ts(8,15): error TS2448: Block-scoped variable 'v' used before its declaration. tests/cases/compiler/recursiveLetConst.ts(9,15): error TS2448: Block-scoped variable 'v' used before its declaration. @@ -10,7 +11,7 @@ tests/cases/compiler/recursiveLetConst.ts(10,17): error TS2448: Block-scoped var tests/cases/compiler/recursiveLetConst.ts(11,11): error TS2448: Block-scoped variable 'x2' used before its declaration. -==== tests/cases/compiler/recursiveLetConst.ts (10 errors) ==== +==== tests/cases/compiler/recursiveLetConst.ts (11 errors) ==== 'use strict' let x = x + 1; ~ @@ -28,6 +29,8 @@ tests/cases/compiler/recursiveLetConst.ts(11,11): error TS2448: Block-scoped var ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. for (let [v] = v; ;) { } + ~~~ +!!! error TS7027: Unreachable code detected. ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. for (let v in v) { } diff --git a/tests/baselines/reference/recursiveMods.errors.txt b/tests/baselines/reference/recursiveMods.errors.txt new file mode 100644 index 0000000000000..6adba78d0049b --- /dev/null +++ b/tests/baselines/reference/recursiveMods.errors.txt @@ -0,0 +1,29 @@ +tests/cases/compiler/recursiveMods.ts(9,3): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/recursiveMods.ts (1 errors) ==== + export module Foo { + export class C {} + } + + export module Foo { + + function Bar() : C { + if (true) { return Bar();} + return new C(); + ~~~~~~ +!!! error TS7027: Unreachable code detected. + } + + function Baz() : C { + var c = Baz(); + return Bar(); + } + + function Gar() { + var c : C = Baz(); + return; + } + + } + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveMods.symbols b/tests/baselines/reference/recursiveMods.symbols deleted file mode 100644 index 1e7e8fa1c8418..0000000000000 --- a/tests/baselines/reference/recursiveMods.symbols +++ /dev/null @@ -1,47 +0,0 @@ -=== tests/cases/compiler/recursiveMods.ts === -export module Foo { ->Foo : Symbol(Foo, Decl(recursiveMods.ts, 0, 0), Decl(recursiveMods.ts, 2, 1)) - - export class C {} ->C : Symbol(C, Decl(recursiveMods.ts, 0, 19)) -} - -export module Foo { ->Foo : Symbol(Foo, Decl(recursiveMods.ts, 0, 0), Decl(recursiveMods.ts, 2, 1)) - - function Bar() : C { ->Bar : Symbol(Bar, Decl(recursiveMods.ts, 4, 19)) ->C : Symbol(C, Decl(recursiveMods.ts, 0, 19)) - - if (true) { return Bar();} ->Bar : Symbol(Bar, Decl(recursiveMods.ts, 4, 19)) - - return new C(); ->C : Symbol(C, Decl(recursiveMods.ts, 0, 19)) - } - - function Baz() : C { ->Baz : Symbol(Baz, Decl(recursiveMods.ts, 9, 2)) ->C : Symbol(C, Decl(recursiveMods.ts, 0, 19)) - - var c = Baz(); ->c : Symbol(c, Decl(recursiveMods.ts, 12, 5)) ->Baz : Symbol(Baz, Decl(recursiveMods.ts, 9, 2)) - - return Bar(); ->Bar : Symbol(Bar, Decl(recursiveMods.ts, 4, 19)) - } - - function Gar() { ->Gar : Symbol(Gar, Decl(recursiveMods.ts, 14, 2)) - - var c : C = Baz(); ->c : Symbol(c, Decl(recursiveMods.ts, 17, 5)) ->C : Symbol(C, Decl(recursiveMods.ts, 0, 19)) ->Baz : Symbol(Baz, Decl(recursiveMods.ts, 9, 2)) - - return; - } - -} - diff --git a/tests/baselines/reference/recursiveMods.types b/tests/baselines/reference/recursiveMods.types deleted file mode 100644 index d7f28f8497556..0000000000000 --- a/tests/baselines/reference/recursiveMods.types +++ /dev/null @@ -1,53 +0,0 @@ -=== tests/cases/compiler/recursiveMods.ts === -export module Foo { ->Foo : typeof Foo - - export class C {} ->C : C -} - -export module Foo { ->Foo : typeof Foo - - function Bar() : C { ->Bar : () => C ->C : C - - if (true) { return Bar();} ->true : boolean ->Bar() : C ->Bar : () => C - - return new C(); ->new C() : C ->C : typeof C - } - - function Baz() : C { ->Baz : () => C ->C : C - - var c = Baz(); ->c : C ->Baz() : C ->Baz : () => C - - return Bar(); ->Bar() : C ->Bar : () => C - } - - function Gar() { ->Gar : () => void - - var c : C = Baz(); ->c : C ->C : C ->Baz() : C ->Baz : () => C - - return; - } - -} - diff --git a/tests/baselines/reference/recursiveNamedLambdaCall.errors.txt b/tests/baselines/reference/recursiveNamedLambdaCall.errors.txt index 7729d1e780fad..04ddc371ac710 100644 --- a/tests/baselines/reference/recursiveNamedLambdaCall.errors.txt +++ b/tests/baselines/reference/recursiveNamedLambdaCall.errors.txt @@ -1,11 +1,12 @@ tests/cases/compiler/recursiveNamedLambdaCall.ts(3,8): error TS2304: Cannot find name 'top'. tests/cases/compiler/recursiveNamedLambdaCall.ts(3,15): error TS2304: Cannot find name 'top'. +tests/cases/compiler/recursiveNamedLambdaCall.ts(7,6): error TS7027: Unreachable code detected. tests/cases/compiler/recursiveNamedLambdaCall.ts(8,7): error TS2304: Cannot find name 'top'. tests/cases/compiler/recursiveNamedLambdaCall.ts(10,14): error TS2304: Cannot find name 'setTimeout'. tests/cases/compiler/recursiveNamedLambdaCall.ts(14,6): error TS2304: Cannot find name 'detach'. -==== tests/cases/compiler/recursiveNamedLambdaCall.ts (5 errors) ==== +==== tests/cases/compiler/recursiveNamedLambdaCall.ts (6 errors) ==== var promise = function( obj ) { if ( top && top.doScroll ) { @@ -17,6 +18,8 @@ tests/cases/compiler/recursiveNamedLambdaCall.ts(14,6): error TS2304: Cannot fin if ( false ) { try { + ~~~ +!!! error TS7027: Unreachable code detected. top.doScroll("left"); ~~~ !!! error TS2304: Cannot find name 'top'. diff --git a/tests/baselines/reference/reservedWords2.errors.txt b/tests/baselines/reference/reservedWords2.errors.txt index 090b2d0d43eab..d6e2d04073d9d 100644 --- a/tests/baselines/reference/reservedWords2.errors.txt +++ b/tests/baselines/reference/reservedWords2.errors.txt @@ -14,6 +14,7 @@ tests/cases/compiler/reservedWords2.ts(5,9): error TS2300: Duplicate identifier tests/cases/compiler/reservedWords2.ts(5,10): error TS1003: Identifier expected. tests/cases/compiler/reservedWords2.ts(5,18): error TS1005: '=>' expected. tests/cases/compiler/reservedWords2.ts(6,1): error TS2304: Cannot find name 'module'. +tests/cases/compiler/reservedWords2.ts(6,1): error TS7027: Unreachable code detected. tests/cases/compiler/reservedWords2.ts(6,8): error TS1005: ';' expected. tests/cases/compiler/reservedWords2.ts(7,11): error TS2300: Duplicate identifier '(Missing)'. tests/cases/compiler/reservedWords2.ts(7,11): error TS1005: ':' expected. @@ -31,7 +32,7 @@ tests/cases/compiler/reservedWords2.ts(10,5): error TS2300: Duplicate identifier tests/cases/compiler/reservedWords2.ts(10,6): error TS1003: Identifier expected. -==== tests/cases/compiler/reservedWords2.ts (31 errors) ==== +==== tests/cases/compiler/reservedWords2.ts (32 errors) ==== import while = require("dfdf"); ~~~~~~ !!! error TS1148: Cannot compile modules unless the '--module' flag is provided. @@ -70,6 +71,8 @@ tests/cases/compiler/reservedWords2.ts(10,6): error TS1003: Identifier expected. module void {} ~~~~~~ !!! error TS2304: Cannot find name 'module'. + ~~~~~~ +!!! error TS7027: Unreachable code detected. ~~~~ !!! error TS1005: ';' expected. var {while, return} = { while: 1, return: 2 }; diff --git a/tests/baselines/reference/returnStatement1.errors.txt b/tests/baselines/reference/returnStatement1.errors.txt new file mode 100644 index 0000000000000..af17564a8744e --- /dev/null +++ b/tests/baselines/reference/returnStatement1.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/returnStatement1.ts(5,5): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/returnStatement1.ts (1 errors) ==== + function f() { + return function (s) { + var x = s; + }; + ("harmless extra line"); + ~ +!!! error TS7027: Unreachable code detected. + } \ No newline at end of file diff --git a/tests/baselines/reference/returnStatement1.symbols b/tests/baselines/reference/returnStatement1.symbols deleted file mode 100644 index acec9f7600374..0000000000000 --- a/tests/baselines/reference/returnStatement1.symbols +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/returnStatement1.ts === -function f() { ->f : Symbol(f, Decl(returnStatement1.ts, 0, 0)) - - return function (s) { ->s : Symbol(s, Decl(returnStatement1.ts, 1, 21)) - - var x = s; ->x : Symbol(x, Decl(returnStatement1.ts, 2, 11)) ->s : Symbol(s, Decl(returnStatement1.ts, 1, 21)) - - }; - ("harmless extra line"); -} diff --git a/tests/baselines/reference/returnStatement1.types b/tests/baselines/reference/returnStatement1.types deleted file mode 100644 index ff30148af5ae9..0000000000000 --- a/tests/baselines/reference/returnStatement1.types +++ /dev/null @@ -1,17 +0,0 @@ -=== tests/cases/compiler/returnStatement1.ts === -function f() { ->f : () => (s: any) => void - - return function (s) { ->function (s) { var x = s; } : (s: any) => void ->s : any - - var x = s; ->x : any ->s : any - - }; - ("harmless extra line"); ->("harmless extra line") : string ->"harmless extra line" : string -} diff --git a/tests/baselines/reference/scanner10.1.1-8gs.errors.txt b/tests/baselines/reference/scanner10.1.1-8gs.errors.txt index 54cd92dc0ca6b..23d89cdf7ff7c 100644 --- a/tests/baselines/reference/scanner10.1.1-8gs.errors.txt +++ b/tests/baselines/reference/scanner10.1.1-8gs.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/scanner/ecmascript5/scanner10.1.1-8gs.ts(16,7): error TS2304: Cannot find name 'NotEarlyError'. +tests/cases/conformance/scanner/ecmascript5/scanner10.1.1-8gs.ts(17,1): error TS7027: Unreachable code detected. tests/cases/conformance/scanner/ecmascript5/scanner10.1.1-8gs.ts(17,5): error TS1212: Identifier expected. 'public' is a reserved word in strict mode -==== tests/cases/conformance/scanner/ecmascript5/scanner10.1.1-8gs.ts (2 errors) ==== +==== tests/cases/conformance/scanner/ecmascript5/scanner10.1.1-8gs.ts (3 errors) ==== /// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the @@ -22,6 +23,8 @@ tests/cases/conformance/scanner/ecmascript5/scanner10.1.1-8gs.ts(17,5): error TS ~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'NotEarlyError'. var public = 1; + ~~~ +!!! error TS7027: Unreachable code detected. ~~~~~~ !!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode \ No newline at end of file diff --git a/tests/baselines/reference/setterWithReturn.errors.txt b/tests/baselines/reference/setterWithReturn.errors.txt index 481116327b88d..6aed49105b82b 100644 --- a/tests/baselines/reference/setterWithReturn.errors.txt +++ b/tests/baselines/reference/setterWithReturn.errors.txt @@ -1,9 +1,10 @@ tests/cases/compiler/setterWithReturn.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/setterWithReturn.ts(4,20): error TS2408: Setters cannot return a value. +tests/cases/compiler/setterWithReturn.ts(7,13): error TS7027: Unreachable code detected. tests/cases/compiler/setterWithReturn.ts(7,20): error TS2408: Setters cannot return a value. -==== tests/cases/compiler/setterWithReturn.ts (3 errors) ==== +==== tests/cases/compiler/setterWithReturn.ts (4 errors) ==== class C234 { public set p1(arg1) { ~~ @@ -15,6 +16,8 @@ tests/cases/compiler/setterWithReturn.ts(7,20): error TS2408: Setters cannot ret } else { return 0; + ~~~~~~ +!!! error TS7027: Unreachable code detected. ~ !!! error TS2408: Setters cannot return a value. } diff --git a/tests/baselines/reference/sourceMapValidationFor.errors.txt b/tests/baselines/reference/sourceMapValidationFor.errors.txt index 7fe75d640d277..6949d7545ed2d 100644 --- a/tests/baselines/reference/sourceMapValidationFor.errors.txt +++ b/tests/baselines/reference/sourceMapValidationFor.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/sourceMapValidationFor.ts(2,5): error TS2304: Cannot find name 'WScript'. tests/cases/compiler/sourceMapValidationFor.ts(6,5): error TS2304: Cannot find name 'WScript'. +tests/cases/compiler/sourceMapValidationFor.ts(20,1): error TS7027: Unreachable code detected. -==== tests/cases/compiler/sourceMapValidationFor.ts (2 errors) ==== +==== tests/cases/compiler/sourceMapValidationFor.ts (3 errors) ==== for (var i = 0; i < 10; i++) { WScript.Echo("i: " + i); ~~~~~~~ @@ -27,6 +28,8 @@ tests/cases/compiler/sourceMapValidationFor.ts(6,5): error TS2304: Cannot find n for (var k = 0;; k++) { } for (k = 0;; k++) + ~~~ +!!! error TS7027: Unreachable code detected. { } for (; k < 10; k++) { diff --git a/tests/baselines/reference/sourceMapValidationLabeled.errors.txt b/tests/baselines/reference/sourceMapValidationLabeled.errors.txt new file mode 100644 index 0000000000000..e9cf1fb3db8bc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLabeled.errors.txt @@ -0,0 +1,8 @@ +tests/cases/compiler/sourceMapValidationLabeled.ts(1,1): error TS7028: Unused label. + + +==== tests/cases/compiler/sourceMapValidationLabeled.ts (1 errors) ==== + x: + ~ +!!! error TS7028: Unused label. + var b = 10; \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLabeled.symbols b/tests/baselines/reference/sourceMapValidationLabeled.symbols deleted file mode 100644 index 2a3c4f5606c38..0000000000000 --- a/tests/baselines/reference/sourceMapValidationLabeled.symbols +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/compiler/sourceMapValidationLabeled.ts === -x: -var b = 10; ->b : Symbol(b, Decl(sourceMapValidationLabeled.ts, 1, 3)) - diff --git a/tests/baselines/reference/sourceMapValidationLabeled.types b/tests/baselines/reference/sourceMapValidationLabeled.types deleted file mode 100644 index 3058869cb0bbb..0000000000000 --- a/tests/baselines/reference/sourceMapValidationLabeled.types +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/compiler/sourceMapValidationLabeled.ts === -x: ->x : any - -var b = 10; ->b : number ->10 : number - diff --git a/tests/baselines/reference/switchBreakStatements.errors.txt b/tests/baselines/reference/switchBreakStatements.errors.txt new file mode 100644 index 0000000000000..77577e485da33 --- /dev/null +++ b/tests/baselines/reference/switchBreakStatements.errors.txt @@ -0,0 +1,67 @@ +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(12,1): error TS7028: Unused label. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(22,9): error TS7028: Unused label. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(46,25): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts (3 errors) ==== + switch ('') { + case 'a': + break; + } + + ONE: + switch ('') { + case 'a': + break ONE; + } + + TWO: + ~~~ +!!! error TS7028: Unused label. + THREE: + switch ('') { + case 'a': + break THREE; + } + + FOUR: + switch ('') { + case 'a': + FIVE: + ~~~~ +!!! error TS7028: Unused label. + switch ('') { + case 'a': + break FOUR; + } + } + + switch ('') { + case 'a': + SIX: + switch ('') { + case 'a': + break SIX; + } + } + + SEVEN: + switch ('') { + case 'a': + switch ('') { + case 'a': + switch ('') { + case 'a': + break SEVEN; + EIGHT: + ~~~~~ +!!! error TS7027: Unreachable code detected. + switch ('') { + case 'a': + var fn = function () { } + break EIGHT; + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/switchBreakStatements.symbols b/tests/baselines/reference/switchBreakStatements.symbols deleted file mode 100644 index 226262418818a..0000000000000 --- a/tests/baselines/reference/switchBreakStatements.symbols +++ /dev/null @@ -1,58 +0,0 @@ -=== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts === -switch ('') { - case 'a': - break; -} - -ONE: -switch ('') { - case 'a': - break ONE; -} - -TWO: -THREE: -switch ('') { - case 'a': - break THREE; -} - -FOUR: -switch ('') { - case 'a': - FIVE: - switch ('') { - case 'a': - break FOUR; - } -} - -switch ('') { - case 'a': - SIX: - switch ('') { - case 'a': - break SIX; - } -} - -SEVEN: -switch ('') { - case 'a': - switch ('') { - case 'a': - switch ('') { - case 'a': - break SEVEN; - EIGHT: - switch ('') { - case 'a': - var fn = function () { } ->fn : Symbol(fn, Decl(switchBreakStatements.ts, 48, 35)) - - break EIGHT; - } - } - } -} - diff --git a/tests/baselines/reference/switchBreakStatements.types b/tests/baselines/reference/switchBreakStatements.types deleted file mode 100644 index c8847a5dc3476..0000000000000 --- a/tests/baselines/reference/switchBreakStatements.types +++ /dev/null @@ -1,126 +0,0 @@ -=== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts === -switch ('') { ->'' : string - - case 'a': ->'a' : string - - break; -} - -ONE: ->ONE : any - -switch ('') { ->'' : string - - case 'a': ->'a' : string - - break ONE; ->ONE : any -} - -TWO: ->TWO : any - -THREE: ->THREE : any - -switch ('') { ->'' : string - - case 'a': ->'a' : string - - break THREE; ->THREE : any -} - -FOUR: ->FOUR : any - -switch ('') { ->'' : string - - case 'a': ->'a' : string - - FIVE: ->FIVE : any - - switch ('') { ->'' : string - - case 'a': ->'a' : string - - break FOUR; ->FOUR : any - } -} - -switch ('') { ->'' : string - - case 'a': ->'a' : string - - SIX: ->SIX : any - - switch ('') { ->'' : string - - case 'a': ->'a' : string - - break SIX; ->SIX : any - } -} - -SEVEN: ->SEVEN : any - -switch ('') { ->'' : string - - case 'a': ->'a' : string - - switch ('') { ->'' : string - - case 'a': ->'a' : string - - switch ('') { ->'' : string - - case 'a': ->'a' : string - - break SEVEN; ->SEVEN : any - - EIGHT: ->EIGHT : any - - switch ('') { ->'' : string - - case 'a': ->'a' : string - - var fn = function () { } ->fn : () => void ->function () { } : () => void - - break EIGHT; ->EIGHT : any - } - } - } -} - diff --git a/tests/baselines/reference/systemModule8.errors.txt b/tests/baselines/reference/systemModule8.errors.txt new file mode 100644 index 0000000000000..17a37e57d2400 --- /dev/null +++ b/tests/baselines/reference/systemModule8.errors.txt @@ -0,0 +1,36 @@ +tests/cases/compiler/systemModule8.ts(19,1): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/systemModule8.ts (1 errors) ==== + + export var x; + x = 1; + x++; + x--; + ++x; + --x; + x += 1; + x -= 1; + x *= 1; + x /= 1; + x |= 1; + x &= 1; + x + 1; + x - 1; + x & 1; + x | 1; + for (x = 5;;x++) {} + for (x = 8;;x--) {} + ~~~ +!!! error TS7027: Unreachable code detected. + for (x = 15;;++x) {} + for (x = 18;;--x) {} + + for (let x = 50;;) {} + function foo() { + x = 100; + } + + export let [y] = [1]; + export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; + for ([x] of [[1]]) {} \ No newline at end of file diff --git a/tests/baselines/reference/systemModule8.symbols b/tests/baselines/reference/systemModule8.symbols deleted file mode 100644 index 719d48e4592db..0000000000000 --- a/tests/baselines/reference/systemModule8.symbols +++ /dev/null @@ -1,92 +0,0 @@ -=== tests/cases/compiler/systemModule8.ts === - -export var x; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x = 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x++; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x--; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -++x; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - ---x; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x += 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x -= 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x *= 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x /= 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x |= 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x &= 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x + 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x - 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x & 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -x | 1; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -for (x = 5;;x++) {} ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -for (x = 8;;x--) {} ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -for (x = 15;;++x) {} ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -for (x = 18;;--x) {} ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - -for (let x = 50;;) {} ->x : Symbol(x, Decl(systemModule8.ts, 22, 8)) - -function foo() { ->foo : Symbol(foo, Decl(systemModule8.ts, 22, 21)) - - x = 100; ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) -} - -export let [y] = [1]; ->y : Symbol(y, Decl(systemModule8.ts, 27, 12)) - -export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; ->a : Symbol(a, Decl(systemModule8.ts, 28, 36)) ->z0 : Symbol(z0, Decl(systemModule8.ts, 28, 14)) ->b : Symbol(b, Decl(systemModule8.ts, 28, 44)) ->c : Symbol(c, Decl(systemModule8.ts, 28, 49)) ->z1 : Symbol(z1, Decl(systemModule8.ts, 28, 25)) ->a : Symbol(a, Decl(systemModule8.ts, 28, 36)) ->b : Symbol(b, Decl(systemModule8.ts, 28, 44)) ->c : Symbol(c, Decl(systemModule8.ts, 28, 49)) - -for ([x] of [[1]]) {} ->x : Symbol(x, Decl(systemModule8.ts, 1, 10)) - diff --git a/tests/baselines/reference/systemModule8.types b/tests/baselines/reference/systemModule8.types deleted file mode 100644 index 2c3dd1e48bb04..0000000000000 --- a/tests/baselines/reference/systemModule8.types +++ /dev/null @@ -1,143 +0,0 @@ -=== tests/cases/compiler/systemModule8.ts === - -export var x; ->x : any - -x = 1; ->x = 1 : number ->x : any ->1 : number - -x++; ->x++ : number ->x : any - -x--; ->x-- : number ->x : any - -++x; ->++x : number ->x : any - ---x; ->--x : number ->x : any - -x += 1; ->x += 1 : any ->x : any ->1 : number - -x -= 1; ->x -= 1 : number ->x : any ->1 : number - -x *= 1; ->x *= 1 : number ->x : any ->1 : number - -x /= 1; ->x /= 1 : number ->x : any ->1 : number - -x |= 1; ->x |= 1 : number ->x : any ->1 : number - -x &= 1; ->x &= 1 : number ->x : any ->1 : number - -x + 1; ->x + 1 : any ->x : any ->1 : number - -x - 1; ->x - 1 : number ->x : any ->1 : number - -x & 1; ->x & 1 : number ->x : any ->1 : number - -x | 1; ->x | 1 : number ->x : any ->1 : number - -for (x = 5;;x++) {} ->x = 5 : number ->x : any ->5 : number ->x++ : number ->x : any - -for (x = 8;;x--) {} ->x = 8 : number ->x : any ->8 : number ->x-- : number ->x : any - -for (x = 15;;++x) {} ->x = 15 : number ->x : any ->15 : number ->++x : number ->x : any - -for (x = 18;;--x) {} ->x = 18 : number ->x : any ->18 : number ->--x : number ->x : any - -for (let x = 50;;) {} ->x : number ->50 : number - -function foo() { ->foo : () => void - - x = 100; ->x = 100 : number ->x : any ->100 : number -} - -export let [y] = [1]; ->y : number ->[1] : [number] ->1 : number - -export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; ->a : any ->z0 : boolean ->b : any ->c : any ->z1 : string ->{a: true, b: {c: "123"}} : { a: boolean; b: { c: string; }; } ->a : boolean ->true : boolean ->b : { c: string; } ->{c: "123"} : { c: string; } ->c : string ->"123" : string - -for ([x] of [[1]]) {} ->[x] : any[] ->x : any ->[[1]] : number[][] ->[1] : number[] ->1 : number - diff --git a/tests/baselines/reference/throwInEnclosingStatements.errors.txt b/tests/baselines/reference/throwInEnclosingStatements.errors.txt new file mode 100644 index 0000000000000..1d225a45fe835 --- /dev/null +++ b/tests/baselines/reference/throwInEnclosingStatements.errors.txt @@ -0,0 +1,52 @@ +tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts(15,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts (1 errors) ==== + function fn(x) { + throw x; + } + + (x: T) => { throw x; } + + var y: string; + switch (y) { + case 'a': + throw y; + default: + throw y; + } + + var z = 0; + ~~~ +!!! error TS7027: Unreachable code detected. + while (z < 10) { + throw z; + } + + for (var i = 0; ;) { throw i; } + + for (var idx in {}) { throw idx; } + + do { throw null; }while(true) + + var j = 0; + while (j < 0) { throw j; } + + class C { + private value: T; + biz() { + throw this.value; + } + + constructor() { + throw this; + } + } + + var aa = { + id:12, + biz() { + throw this; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/throwInEnclosingStatements.symbols b/tests/baselines/reference/throwInEnclosingStatements.symbols deleted file mode 100644 index 007894047dee4..0000000000000 --- a/tests/baselines/reference/throwInEnclosingStatements.symbols +++ /dev/null @@ -1,93 +0,0 @@ -=== tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts === -function fn(x) { ->fn : Symbol(fn, Decl(throwInEnclosingStatements.ts, 0, 0)) ->x : Symbol(x, Decl(throwInEnclosingStatements.ts, 0, 12)) - - throw x; ->x : Symbol(x, Decl(throwInEnclosingStatements.ts, 0, 12)) -} - -(x: T) => { throw x; } ->T : Symbol(T, Decl(throwInEnclosingStatements.ts, 4, 1)) ->x : Symbol(x, Decl(throwInEnclosingStatements.ts, 4, 4)) ->T : Symbol(T, Decl(throwInEnclosingStatements.ts, 4, 1)) ->x : Symbol(x, Decl(throwInEnclosingStatements.ts, 4, 4)) - -var y: string; ->y : Symbol(y, Decl(throwInEnclosingStatements.ts, 6, 3)) - -switch (y) { ->y : Symbol(y, Decl(throwInEnclosingStatements.ts, 6, 3)) - - case 'a': - throw y; ->y : Symbol(y, Decl(throwInEnclosingStatements.ts, 6, 3)) - - default: - throw y; ->y : Symbol(y, Decl(throwInEnclosingStatements.ts, 6, 3)) -} - -var z = 0; ->z : Symbol(z, Decl(throwInEnclosingStatements.ts, 14, 3)) - -while (z < 10) { ->z : Symbol(z, Decl(throwInEnclosingStatements.ts, 14, 3)) - - throw z; ->z : Symbol(z, Decl(throwInEnclosingStatements.ts, 14, 3)) -} - -for (var i = 0; ;) { throw i; } ->i : Symbol(i, Decl(throwInEnclosingStatements.ts, 19, 8)) ->i : Symbol(i, Decl(throwInEnclosingStatements.ts, 19, 8)) - -for (var idx in {}) { throw idx; } ->idx : Symbol(idx, Decl(throwInEnclosingStatements.ts, 21, 8)) ->idx : Symbol(idx, Decl(throwInEnclosingStatements.ts, 21, 8)) - -do { throw null; }while(true) - -var j = 0; ->j : Symbol(j, Decl(throwInEnclosingStatements.ts, 25, 3)) - -while (j < 0) { throw j; } ->j : Symbol(j, Decl(throwInEnclosingStatements.ts, 25, 3)) ->j : Symbol(j, Decl(throwInEnclosingStatements.ts, 25, 3)) - -class C { ->C : Symbol(C, Decl(throwInEnclosingStatements.ts, 26, 26)) ->T : Symbol(T, Decl(throwInEnclosingStatements.ts, 28, 8)) - - private value: T; ->value : Symbol(value, Decl(throwInEnclosingStatements.ts, 28, 12)) ->T : Symbol(T, Decl(throwInEnclosingStatements.ts, 28, 8)) - - biz() { ->biz : Symbol(biz, Decl(throwInEnclosingStatements.ts, 29, 21)) - - throw this.value; ->this.value : Symbol(value, Decl(throwInEnclosingStatements.ts, 28, 12)) ->this : Symbol(C, Decl(throwInEnclosingStatements.ts, 26, 26)) ->value : Symbol(value, Decl(throwInEnclosingStatements.ts, 28, 12)) - } - - constructor() { - throw this; ->this : Symbol(C, Decl(throwInEnclosingStatements.ts, 26, 26)) - } -} - -var aa = { ->aa : Symbol(aa, Decl(throwInEnclosingStatements.ts, 39, 3)) - - id:12, ->id : Symbol(id, Decl(throwInEnclosingStatements.ts, 39, 10)) - - biz() { ->biz : Symbol(biz, Decl(throwInEnclosingStatements.ts, 40, 10)) - - throw this; - } -} - diff --git a/tests/baselines/reference/throwInEnclosingStatements.types b/tests/baselines/reference/throwInEnclosingStatements.types deleted file mode 100644 index bcff8653d52f7..0000000000000 --- a/tests/baselines/reference/throwInEnclosingStatements.types +++ /dev/null @@ -1,109 +0,0 @@ -=== tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts === -function fn(x) { ->fn : (x: any) => void ->x : any - - throw x; ->x : any -} - -(x: T) => { throw x; } ->(x: T) => { throw x; } : (x: T) => void ->T : T ->x : T ->T : T ->x : T - -var y: string; ->y : string - -switch (y) { ->y : string - - case 'a': ->'a' : string - - throw y; ->y : string - - default: - throw y; ->y : string -} - -var z = 0; ->z : number ->0 : number - -while (z < 10) { ->z < 10 : boolean ->z : number ->10 : number - - throw z; ->z : number -} - -for (var i = 0; ;) { throw i; } ->i : number ->0 : number ->i : number - -for (var idx in {}) { throw idx; } ->idx : any ->{} : {} ->idx : any - -do { throw null; }while(true) ->null : null ->true : boolean - -var j = 0; ->j : number ->0 : number - -while (j < 0) { throw j; } ->j < 0 : boolean ->j : number ->0 : number ->j : number - -class C { ->C : C ->T : T - - private value: T; ->value : T ->T : T - - biz() { ->biz : () => void - - throw this.value; ->this.value : T ->this : this ->value : T - } - - constructor() { - throw this; ->this : this - } -} - -var aa = { ->aa : { id: number; biz(): void; } ->{ id:12, biz() { throw this; }} : { id: number; biz(): void; } - - id:12, ->id : number ->12 : number - - biz() { ->biz : () => void - - throw this; ->this : any - } -} - diff --git a/tests/baselines/reference/throwStatements.errors.txt b/tests/baselines/reference/throwStatements.errors.txt new file mode 100644 index 0000000000000..e2e15bd503a27 --- /dev/null +++ b/tests/baselines/reference/throwStatements.errors.txt @@ -0,0 +1,91 @@ +tests/cases/conformance/statements/throwStatements/throwStatements.ts(29,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/throwStatements/throwStatements.ts (1 errors) ==== + // all legal + + interface I { + id: number; + } + + class C implements I { + id: number; + } + + class D{ + source: T; + recurse: D; + wrapped: D> + } + + function F(x: string): number { return 42; } + + module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } + } + + var aNumber = 9.9; + throw aNumber; + var aString = 'this is a string'; + ~~~ +!!! error TS7027: Unreachable code detected. + throw aString; + var aDate = new Date(12); + throw aDate; + var anObject = new Object(); + throw anObject; + + var anAny = null; + throw anAny; + var anOtherAny = new C(); + throw anOtherAny; + var anUndefined = undefined; + throw anUndefined; + + var aClass = new C(); + throw aClass; + var aGenericClass = new D(); + throw aGenericClass; + var anObjectLiteral = { id: 12 }; + throw anObjectLiteral; + + var aFunction = F; + throw aFunction; + throw aFunction(''); + var aLambda = (x) => 2; + throw aLambda; + throw aLambda(1); + + var aModule = M; + throw aModule; + throw typeof M; + var aClassInModule = new M.A(); + throw aClassInModule; + var aFunctionInModule = M.F2; + throw aFunctionInModule; + + // no initializer or annotation, so this is an 'any' + var x; + throw x; + + // literals + throw 0.0; + throw false; + throw null; + throw undefined; + throw 'a string'; + throw function () { return 'a string' }; + throw (x:T) => 42; + throw { x: 12, y: 13 }; + throw []; + throw ['a', ['b']]; + throw /[a-z]/; + throw new Date(); + throw new C(); + throw new Object(); + throw new D(); + \ No newline at end of file diff --git a/tests/baselines/reference/throwStatements.symbols b/tests/baselines/reference/throwStatements.symbols deleted file mode 100644 index cb65755a145aa..0000000000000 --- a/tests/baselines/reference/throwStatements.symbols +++ /dev/null @@ -1,215 +0,0 @@ -=== tests/cases/conformance/statements/throwStatements/throwStatements.ts === -// all legal - -interface I { ->I : Symbol(I, Decl(throwStatements.ts, 0, 0)) - - id: number; ->id : Symbol(id, Decl(throwStatements.ts, 2, 13)) -} - -class C implements I { ->C : Symbol(C, Decl(throwStatements.ts, 4, 1)) ->I : Symbol(I, Decl(throwStatements.ts, 0, 0)) - - id: number; ->id : Symbol(id, Decl(throwStatements.ts, 6, 22)) -} - -class D{ ->D : Symbol(D, Decl(throwStatements.ts, 8, 1)) ->T : Symbol(T, Decl(throwStatements.ts, 10, 8)) - - source: T; ->source : Symbol(source, Decl(throwStatements.ts, 10, 11)) ->T : Symbol(T, Decl(throwStatements.ts, 10, 8)) - - recurse: D; ->recurse : Symbol(recurse, Decl(throwStatements.ts, 11, 14)) ->D : Symbol(D, Decl(throwStatements.ts, 8, 1)) ->T : Symbol(T, Decl(throwStatements.ts, 10, 8)) - - wrapped: D> ->wrapped : Symbol(wrapped, Decl(throwStatements.ts, 12, 18)) ->D : Symbol(D, Decl(throwStatements.ts, 8, 1)) ->D : Symbol(D, Decl(throwStatements.ts, 8, 1)) ->T : Symbol(T, Decl(throwStatements.ts, 10, 8)) -} - -function F(x: string): number { return 42; } ->F : Symbol(F, Decl(throwStatements.ts, 14, 1)) ->x : Symbol(x, Decl(throwStatements.ts, 16, 11)) - -module M { ->M : Symbol(M, Decl(throwStatements.ts, 16, 44)) - - export class A { ->A : Symbol(A, Decl(throwStatements.ts, 18, 10)) - - name: string; ->name : Symbol(name, Decl(throwStatements.ts, 19, 20)) - } - - export function F2(x: number): string { return x.toString(); } ->F2 : Symbol(F2, Decl(throwStatements.ts, 21, 5)) ->x : Symbol(x, Decl(throwStatements.ts, 23, 23)) ->x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) ->x : Symbol(x, Decl(throwStatements.ts, 23, 23)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) -} - -var aNumber = 9.9; ->aNumber : Symbol(aNumber, Decl(throwStatements.ts, 26, 3)) - -throw aNumber; ->aNumber : Symbol(aNumber, Decl(throwStatements.ts, 26, 3)) - -var aString = 'this is a string'; ->aString : Symbol(aString, Decl(throwStatements.ts, 28, 3)) - -throw aString; ->aString : Symbol(aString, Decl(throwStatements.ts, 28, 3)) - -var aDate = new Date(12); ->aDate : Symbol(aDate, Decl(throwStatements.ts, 30, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) - -throw aDate; ->aDate : Symbol(aDate, Decl(throwStatements.ts, 30, 3)) - -var anObject = new Object(); ->anObject : Symbol(anObject, Decl(throwStatements.ts, 32, 3)) ->Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) - -throw anObject; ->anObject : Symbol(anObject, Decl(throwStatements.ts, 32, 3)) - -var anAny = null; ->anAny : Symbol(anAny, Decl(throwStatements.ts, 35, 3)) - -throw anAny; ->anAny : Symbol(anAny, Decl(throwStatements.ts, 35, 3)) - -var anOtherAny = new C(); ->anOtherAny : Symbol(anOtherAny, Decl(throwStatements.ts, 37, 3)) ->C : Symbol(C, Decl(throwStatements.ts, 4, 1)) - -throw anOtherAny; ->anOtherAny : Symbol(anOtherAny, Decl(throwStatements.ts, 37, 3)) - -var anUndefined = undefined; ->anUndefined : Symbol(anUndefined, Decl(throwStatements.ts, 39, 3)) ->undefined : Symbol(undefined) - -throw anUndefined; ->anUndefined : Symbol(anUndefined, Decl(throwStatements.ts, 39, 3)) - -var aClass = new C(); ->aClass : Symbol(aClass, Decl(throwStatements.ts, 42, 3)) ->C : Symbol(C, Decl(throwStatements.ts, 4, 1)) - -throw aClass; ->aClass : Symbol(aClass, Decl(throwStatements.ts, 42, 3)) - -var aGenericClass = new D(); ->aGenericClass : Symbol(aGenericClass, Decl(throwStatements.ts, 44, 3)) ->D : Symbol(D, Decl(throwStatements.ts, 8, 1)) - -throw aGenericClass; ->aGenericClass : Symbol(aGenericClass, Decl(throwStatements.ts, 44, 3)) - -var anObjectLiteral = { id: 12 }; ->anObjectLiteral : Symbol(anObjectLiteral, Decl(throwStatements.ts, 46, 3)) ->id : Symbol(id, Decl(throwStatements.ts, 46, 23)) - -throw anObjectLiteral; ->anObjectLiteral : Symbol(anObjectLiteral, Decl(throwStatements.ts, 46, 3)) - -var aFunction = F; ->aFunction : Symbol(aFunction, Decl(throwStatements.ts, 49, 3)) ->F : Symbol(F, Decl(throwStatements.ts, 14, 1)) - -throw aFunction; ->aFunction : Symbol(aFunction, Decl(throwStatements.ts, 49, 3)) - -throw aFunction(''); ->aFunction : Symbol(aFunction, Decl(throwStatements.ts, 49, 3)) - -var aLambda = (x) => 2; ->aLambda : Symbol(aLambda, Decl(throwStatements.ts, 52, 3)) ->x : Symbol(x, Decl(throwStatements.ts, 52, 15)) - -throw aLambda; ->aLambda : Symbol(aLambda, Decl(throwStatements.ts, 52, 3)) - -throw aLambda(1); ->aLambda : Symbol(aLambda, Decl(throwStatements.ts, 52, 3)) - -var aModule = M; ->aModule : Symbol(aModule, Decl(throwStatements.ts, 56, 3)) ->M : Symbol(M, Decl(throwStatements.ts, 16, 44)) - -throw aModule; ->aModule : Symbol(aModule, Decl(throwStatements.ts, 56, 3)) - -throw typeof M; ->M : Symbol(M, Decl(throwStatements.ts, 16, 44)) - -var aClassInModule = new M.A(); ->aClassInModule : Symbol(aClassInModule, Decl(throwStatements.ts, 59, 3)) ->M.A : Symbol(M.A, Decl(throwStatements.ts, 18, 10)) ->M : Symbol(M, Decl(throwStatements.ts, 16, 44)) ->A : Symbol(M.A, Decl(throwStatements.ts, 18, 10)) - -throw aClassInModule; ->aClassInModule : Symbol(aClassInModule, Decl(throwStatements.ts, 59, 3)) - -var aFunctionInModule = M.F2; ->aFunctionInModule : Symbol(aFunctionInModule, Decl(throwStatements.ts, 61, 3)) ->M.F2 : Symbol(M.F2, Decl(throwStatements.ts, 21, 5)) ->M : Symbol(M, Decl(throwStatements.ts, 16, 44)) ->F2 : Symbol(M.F2, Decl(throwStatements.ts, 21, 5)) - -throw aFunctionInModule; ->aFunctionInModule : Symbol(aFunctionInModule, Decl(throwStatements.ts, 61, 3)) - -// no initializer or annotation, so this is an 'any' -var x; ->x : Symbol(x, Decl(throwStatements.ts, 65, 3)) - -throw x; ->x : Symbol(x, Decl(throwStatements.ts, 65, 3)) - -// literals -throw 0.0; -throw false; -throw null; -throw undefined; ->undefined : Symbol(undefined) - -throw 'a string'; -throw function () { return 'a string' }; -throw (x:T) => 42; ->T : Symbol(T, Decl(throwStatements.ts, 75, 7)) ->x : Symbol(x, Decl(throwStatements.ts, 75, 10)) ->T : Symbol(T, Decl(throwStatements.ts, 75, 7)) - -throw { x: 12, y: 13 }; ->x : Symbol(x, Decl(throwStatements.ts, 76, 7)) ->y : Symbol(y, Decl(throwStatements.ts, 76, 14)) - -throw []; -throw ['a', ['b']]; -throw /[a-z]/; -throw new Date(); ->Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) - -throw new C(); ->C : Symbol(C, Decl(throwStatements.ts, 4, 1)) - -throw new Object(); ->Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) - -throw new D(); ->D : Symbol(D, Decl(throwStatements.ts, 8, 1)) - diff --git a/tests/baselines/reference/throwStatements.types b/tests/baselines/reference/throwStatements.types deleted file mode 100644 index 3d365a1b65a0c..0000000000000 --- a/tests/baselines/reference/throwStatements.types +++ /dev/null @@ -1,266 +0,0 @@ -=== tests/cases/conformance/statements/throwStatements/throwStatements.ts === -// all legal - -interface I { ->I : I - - id: number; ->id : number -} - -class C implements I { ->C : C ->I : I - - id: number; ->id : number -} - -class D{ ->D : D ->T : T - - source: T; ->source : T ->T : T - - recurse: D; ->recurse : D ->D : D ->T : T - - wrapped: D> ->wrapped : D> ->D : D ->D : D ->T : T -} - -function F(x: string): number { return 42; } ->F : (x: string) => number ->x : string ->42 : number - -module M { ->M : typeof M - - export class A { ->A : A - - name: string; ->name : string - } - - export function F2(x: number): string { return x.toString(); } ->F2 : (x: number) => string ->x : number ->x.toString() : string ->x.toString : (radix?: number) => string ->x : number ->toString : (radix?: number) => string -} - -var aNumber = 9.9; ->aNumber : number ->9.9 : number - -throw aNumber; ->aNumber : number - -var aString = 'this is a string'; ->aString : string ->'this is a string' : string - -throw aString; ->aString : string - -var aDate = new Date(12); ->aDate : Date ->new Date(12) : Date ->Date : DateConstructor ->12 : number - -throw aDate; ->aDate : Date - -var anObject = new Object(); ->anObject : Object ->new Object() : Object ->Object : ObjectConstructor - -throw anObject; ->anObject : Object - -var anAny = null; ->anAny : any ->null : null - -throw anAny; ->anAny : any - -var anOtherAny = new C(); ->anOtherAny : any -> new C() : any ->new C() : C ->C : typeof C - -throw anOtherAny; ->anOtherAny : any - -var anUndefined = undefined; ->anUndefined : any ->undefined : undefined - -throw anUndefined; ->anUndefined : any - -var aClass = new C(); ->aClass : C ->new C() : C ->C : typeof C - -throw aClass; ->aClass : C - -var aGenericClass = new D(); ->aGenericClass : D ->new D() : D ->D : typeof D - -throw aGenericClass; ->aGenericClass : D - -var anObjectLiteral = { id: 12 }; ->anObjectLiteral : { id: number; } ->{ id: 12 } : { id: number; } ->id : number ->12 : number - -throw anObjectLiteral; ->anObjectLiteral : { id: number; } - -var aFunction = F; ->aFunction : (x: string) => number ->F : (x: string) => number - -throw aFunction; ->aFunction : (x: string) => number - -throw aFunction(''); ->aFunction('') : number ->aFunction : (x: string) => number ->'' : string - -var aLambda = (x) => 2; ->aLambda : (x: any) => number ->(x) => 2 : (x: any) => number ->x : any ->2 : number - -throw aLambda; ->aLambda : (x: any) => number - -throw aLambda(1); ->aLambda(1) : number ->aLambda : (x: any) => number ->1 : number - -var aModule = M; ->aModule : typeof M ->M : typeof M - -throw aModule; ->aModule : typeof M - -throw typeof M; ->typeof M : string ->M : typeof M - -var aClassInModule = new M.A(); ->aClassInModule : M.A ->new M.A() : M.A ->M.A : typeof M.A ->M : typeof M ->A : typeof M.A - -throw aClassInModule; ->aClassInModule : M.A - -var aFunctionInModule = M.F2; ->aFunctionInModule : (x: number) => string ->M.F2 : (x: number) => string ->M : typeof M ->F2 : (x: number) => string - -throw aFunctionInModule; ->aFunctionInModule : (x: number) => string - -// no initializer or annotation, so this is an 'any' -var x; ->x : any - -throw x; ->x : any - -// literals -throw 0.0; ->0.0 : number - -throw false; ->false : boolean - -throw null; ->null : null - -throw undefined; ->undefined : undefined - -throw 'a string'; ->'a string' : string - -throw function () { return 'a string' }; ->function () { return 'a string' } : () => string ->'a string' : string - -throw (x:T) => 42; ->(x:T) => 42 : (x: T) => number ->T : T ->x : T ->T : T ->42 : number - -throw { x: 12, y: 13 }; ->{ x: 12, y: 13 } : { x: number; y: number; } ->x : number ->12 : number ->y : number ->13 : number - -throw []; ->[] : undefined[] - -throw ['a', ['b']]; ->['a', ['b']] : (string | string[])[] ->'a' : string ->['b'] : string[] ->'b' : string - -throw /[a-z]/; ->/[a-z]/ : RegExp - -throw new Date(); ->new Date() : Date ->Date : DateConstructor - -throw new C(); ->new C() : C ->C : typeof C - -throw new Object(); ->new Object() : Object ->Object : ObjectConstructor - -throw new D(); ->new D() : D ->D : typeof D - diff --git a/tests/baselines/reference/throwWithoutNewLine2.errors.txt b/tests/baselines/reference/throwWithoutNewLine2.errors.txt index 6930d240e7b82..83f4e4cc24627 100644 --- a/tests/baselines/reference/throwWithoutNewLine2.errors.txt +++ b/tests/baselines/reference/throwWithoutNewLine2.errors.txt @@ -1,11 +1,14 @@ tests/cases/compiler/throwWithoutNewLine2.ts(1,6): error TS1142: Line break not permitted here. tests/cases/compiler/throwWithoutNewLine2.ts(2,1): error TS2304: Cannot find name 'a'. +tests/cases/compiler/throwWithoutNewLine2.ts(2,1): error TS7027: Unreachable code detected. -==== tests/cases/compiler/throwWithoutNewLine2.ts (2 errors) ==== +==== tests/cases/compiler/throwWithoutNewLine2.ts (3 errors) ==== throw !!! error TS1142: Line break not permitted here. a; ~ -!!! error TS2304: Cannot find name 'a'. \ No newline at end of file +!!! error TS2304: Cannot find name 'a'. + ~ +!!! error TS7027: Unreachable code detected. \ No newline at end of file diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index b178b02c6b457..ca06e4f63a2eb 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -9,6 +9,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(38,51) Property 'propA' is missing in type 'B'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(42,56): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(46,56): error TS2322: Type 'T[]' is not assignable to type 'string'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(50,1): error TS7027: Unreachable code detected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(60,7): error TS2339: Property 'propB' does not exist on type 'A'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(65,7): error TS2339: Property 'propB' does not exist on type 'A'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(70,7): error TS2339: Property 'propB' does not exist on type 'A'. @@ -37,7 +38,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(133,34 tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39): error TS1230: A type predicate cannot reference element 'p1' in a binding pattern. -==== tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts (31 errors) ==== +==== tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts (32 errors) ==== class A { propA: number; @@ -109,6 +110,8 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 } let a: A; + ~~~ +!!! error TS7027: Unreachable code detected. let b: B; declare function isB(p1): p1 is B; diff --git a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt index 6112b61ceb639..0139c96b3f998 100644 --- a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt @@ -1,9 +1,12 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(46,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(47,32): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(48,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(68,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(69,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(70,1): error TS7028: Unused label. -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (3 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (6 errors) ==== // typeof operator on any type var ANY: any; @@ -78,8 +81,14 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator var x: any[]; var r: () => any; z: typeof ANY; + ~ +!!! error TS7028: Unused label. x: typeof ANY2; + ~ +!!! error TS7028: Unused label. r: typeof foo; + ~ +!!! error TS7028: Unused label. z: typeof objA.a; z: typeof A.foo; z: typeof M.n; diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt new file mode 100644 index 0000000000000..9c4e249566056 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt @@ -0,0 +1,59 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(44,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(45,1): error TS7028: Unused label. + + +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts (2 errors) ==== + // typeof operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsString1 = typeof BOOLEAN; + + // boolean type literal + var ResultIsString2 = typeof true; + var ResultIsString3 = typeof { x: true, y: false }; + + // boolean type expressions + var ResultIsString4 = typeof objA.a; + var ResultIsString5 = typeof M.n; + var ResultIsString6 = typeof foo(); + var ResultIsString7 = typeof A.foo(); + + // multiple typeof operator + var ResultIsString8 = typeof typeof BOOLEAN; + + // miss assignment operators + typeof true; + typeof BOOLEAN; + typeof foo(); + typeof true, false; + typeof objA.a; + typeof M.n; + + // use typeof in type query + var z: boolean; + var x: boolean[]; + var r: () => boolean; + z: typeof BOOLEAN; + ~ +!!! error TS7028: Unused label. + r: typeof foo; + ~ +!!! error TS7028: Unused label. + var y = { a: true, b: false}; + z: typeof y.a; + z: typeof objA.a; + z: typeof A.foo; + z: typeof M.n; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.symbols b/tests/baselines/reference/typeofOperatorWithBooleanType.symbols deleted file mode 100644 index 39276e6162562..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.symbols +++ /dev/null @@ -1,130 +0,0 @@ -=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts === -// typeof operator on boolean type -var BOOLEAN: boolean; ->BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 1, 3)) - -function foo(): boolean { return true; } ->foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 1, 21)) - -class A { ->A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 3, 40)) - - public a: boolean; ->a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 5, 9)) - - static foo() { return false; } ->foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 6, 22)) -} -module M { ->M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 8, 1)) - - export var n: boolean; ->n : Symbol(n, Decl(typeofOperatorWithBooleanType.ts, 10, 14)) -} - -var objA = new A(); ->objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 13, 3)) ->A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 3, 40)) - -// boolean type var -var ResultIsString1 = typeof BOOLEAN; ->ResultIsString1 : Symbol(ResultIsString1, Decl(typeofOperatorWithBooleanType.ts, 16, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 1, 3)) - -// boolean type literal -var ResultIsString2 = typeof true; ->ResultIsString2 : Symbol(ResultIsString2, Decl(typeofOperatorWithBooleanType.ts, 19, 3)) - -var ResultIsString3 = typeof { x: true, y: false }; ->ResultIsString3 : Symbol(ResultIsString3, Decl(typeofOperatorWithBooleanType.ts, 20, 3)) ->x : Symbol(x, Decl(typeofOperatorWithBooleanType.ts, 20, 30)) ->y : Symbol(y, Decl(typeofOperatorWithBooleanType.ts, 20, 39)) - -// boolean type expressions -var ResultIsString4 = typeof objA.a; ->ResultIsString4 : Symbol(ResultIsString4, Decl(typeofOperatorWithBooleanType.ts, 23, 3)) ->objA.a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 5, 9)) ->objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 13, 3)) ->a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 5, 9)) - -var ResultIsString5 = typeof M.n; ->ResultIsString5 : Symbol(ResultIsString5, Decl(typeofOperatorWithBooleanType.ts, 24, 3)) ->M.n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 10, 14)) ->M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 8, 1)) ->n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 10, 14)) - -var ResultIsString6 = typeof foo(); ->ResultIsString6 : Symbol(ResultIsString6, Decl(typeofOperatorWithBooleanType.ts, 25, 3)) ->foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 1, 21)) - -var ResultIsString7 = typeof A.foo(); ->ResultIsString7 : Symbol(ResultIsString7, Decl(typeofOperatorWithBooleanType.ts, 26, 3)) ->A.foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 6, 22)) ->A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 3, 40)) ->foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 6, 22)) - -// multiple typeof operator -var ResultIsString8 = typeof typeof BOOLEAN; ->ResultIsString8 : Symbol(ResultIsString8, Decl(typeofOperatorWithBooleanType.ts, 29, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 1, 3)) - -// miss assignment operators -typeof true; -typeof BOOLEAN; ->BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 1, 3)) - -typeof foo(); ->foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 1, 21)) - -typeof true, false; -typeof objA.a; ->objA.a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 5, 9)) ->objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 13, 3)) ->a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 5, 9)) - -typeof M.n; ->M.n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 10, 14)) ->M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 8, 1)) ->n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 10, 14)) - -// use typeof in type query -var z: boolean; ->z : Symbol(z, Decl(typeofOperatorWithBooleanType.ts, 40, 3)) - -var x: boolean[]; ->x : Symbol(x, Decl(typeofOperatorWithBooleanType.ts, 41, 3)) - -var r: () => boolean; ->r : Symbol(r, Decl(typeofOperatorWithBooleanType.ts, 42, 3)) - -z: typeof BOOLEAN; ->BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 1, 3)) - -r: typeof foo; ->foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 1, 21)) - -var y = { a: true, b: false}; ->y : Symbol(y, Decl(typeofOperatorWithBooleanType.ts, 45, 3)) ->a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 45, 9)) ->b : Symbol(b, Decl(typeofOperatorWithBooleanType.ts, 45, 18)) - -z: typeof y.a; ->y.a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 45, 9)) ->y : Symbol(y, Decl(typeofOperatorWithBooleanType.ts, 45, 3)) ->a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 45, 9)) - -z: typeof objA.a; ->objA.a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 5, 9)) ->objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 13, 3)) ->a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 5, 9)) - -z: typeof A.foo; ->A.foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 6, 22)) ->A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 3, 40)) ->foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 6, 22)) - -z: typeof M.n; ->M.n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 10, 14)) ->M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 8, 1)) ->n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 10, 14)) - diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.types b/tests/baselines/reference/typeofOperatorWithBooleanType.types deleted file mode 100644 index 06cd7466a1830..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.types +++ /dev/null @@ -1,176 +0,0 @@ -=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts === -// typeof operator on boolean type -var BOOLEAN: boolean; ->BOOLEAN : boolean - -function foo(): boolean { return true; } ->foo : () => boolean ->true : boolean - -class A { ->A : A - - public a: boolean; ->a : boolean - - static foo() { return false; } ->foo : () => boolean ->false : boolean -} -module M { ->M : typeof M - - export var n: boolean; ->n : boolean -} - -var objA = new A(); ->objA : A ->new A() : A ->A : typeof A - -// boolean type var -var ResultIsString1 = typeof BOOLEAN; ->ResultIsString1 : string ->typeof BOOLEAN : string ->BOOLEAN : boolean - -// boolean type literal -var ResultIsString2 = typeof true; ->ResultIsString2 : string ->typeof true : string ->true : boolean - -var ResultIsString3 = typeof { x: true, y: false }; ->ResultIsString3 : string ->typeof { x: true, y: false } : string ->{ x: true, y: false } : { x: boolean; y: boolean; } ->x : boolean ->true : boolean ->y : boolean ->false : boolean - -// boolean type expressions -var ResultIsString4 = typeof objA.a; ->ResultIsString4 : string ->typeof objA.a : string ->objA.a : boolean ->objA : A ->a : boolean - -var ResultIsString5 = typeof M.n; ->ResultIsString5 : string ->typeof M.n : string ->M.n : boolean ->M : typeof M ->n : boolean - -var ResultIsString6 = typeof foo(); ->ResultIsString6 : string ->typeof foo() : string ->foo() : boolean ->foo : () => boolean - -var ResultIsString7 = typeof A.foo(); ->ResultIsString7 : string ->typeof A.foo() : string ->A.foo() : boolean ->A.foo : () => boolean ->A : typeof A ->foo : () => boolean - -// multiple typeof operator -var ResultIsString8 = typeof typeof BOOLEAN; ->ResultIsString8 : string ->typeof typeof BOOLEAN : string ->typeof BOOLEAN : string ->BOOLEAN : boolean - -// miss assignment operators -typeof true; ->typeof true : string ->true : boolean - -typeof BOOLEAN; ->typeof BOOLEAN : string ->BOOLEAN : boolean - -typeof foo(); ->typeof foo() : string ->foo() : boolean ->foo : () => boolean - -typeof true, false; ->typeof true, false : boolean ->typeof true : string ->true : boolean ->false : boolean - -typeof objA.a; ->typeof objA.a : string ->objA.a : boolean ->objA : A ->a : boolean - -typeof M.n; ->typeof M.n : string ->M.n : boolean ->M : typeof M ->n : boolean - -// use typeof in type query -var z: boolean; ->z : boolean - -var x: boolean[]; ->x : boolean[] - -var r: () => boolean; ->r : () => boolean - -z: typeof BOOLEAN; ->z : any ->typeof BOOLEAN : string ->BOOLEAN : boolean - -r: typeof foo; ->r : any ->typeof foo : string ->foo : () => boolean - -var y = { a: true, b: false}; ->y : { a: boolean; b: boolean; } ->{ a: true, b: false} : { a: boolean; b: boolean; } ->a : boolean ->true : boolean ->b : boolean ->false : boolean - -z: typeof y.a; ->z : any ->typeof y.a : string ->y.a : boolean ->y : { a: boolean; b: boolean; } ->a : boolean - -z: typeof objA.a; ->z : any ->typeof objA.a : string ->objA.a : boolean ->objA : A ->a : boolean - -z: typeof A.foo; ->z : any ->typeof A.foo : string ->A.foo : () => boolean ->A : typeof A ->foo : () => boolean - -z: typeof M.n; ->z : any ->typeof M.n : string ->M.n : boolean ->M : typeof M ->n : boolean - diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt new file mode 100644 index 0000000000000..6e473b7487d68 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt @@ -0,0 +1,33 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts(26,1): error TS7028: Unused label. + + +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts (1 errors) ==== + // typeof operator on enum type + + enum ENUM { }; + enum ENUM1 { A, B, "" }; + + // enum type var + var ResultIsString1 = typeof ENUM; + var ResultIsString2 = typeof ENUM1; + + // enum type expressions + var ResultIsString3 = typeof ENUM1["A"]; + var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); + + // multiple typeof operators + var ResultIsString5 = typeof typeof ENUM; + var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); + + // miss assignment operators + typeof ENUM; + typeof ENUM1; + typeof ENUM1["B"]; + typeof ENUM, ENUM1; + + // use typeof in type query + enum z { }; + z: typeof ENUM; + ~ +!!! error TS7028: Unused label. + z: typeof ENUM1; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.symbols b/tests/baselines/reference/typeofOperatorWithEnumType.symbols deleted file mode 100644 index 3ae150ece0310..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithEnumType.symbols +++ /dev/null @@ -1,69 +0,0 @@ -=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts === -// typeof operator on enum type - -enum ENUM { }; ->ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) - -enum ENUM1 { A, B, "" }; ->ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 2, 14)) ->A : Symbol(ENUM1.A, Decl(typeofOperatorWithEnumType.ts, 3, 12)) ->B : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 3, 15)) - -// enum type var -var ResultIsString1 = typeof ENUM; ->ResultIsString1 : Symbol(ResultIsString1, Decl(typeofOperatorWithEnumType.ts, 6, 3)) ->ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) - -var ResultIsString2 = typeof ENUM1; ->ResultIsString2 : Symbol(ResultIsString2, Decl(typeofOperatorWithEnumType.ts, 7, 3)) ->ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 2, 14)) - -// enum type expressions -var ResultIsString3 = typeof ENUM1["A"]; ->ResultIsString3 : Symbol(ResultIsString3, Decl(typeofOperatorWithEnumType.ts, 10, 3)) ->ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 2, 14)) ->"A" : Symbol(ENUM1.A, Decl(typeofOperatorWithEnumType.ts, 3, 12)) - -var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); ->ResultIsString4 : Symbol(ResultIsString4, Decl(typeofOperatorWithEnumType.ts, 11, 3)) ->ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) ->ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 2, 14)) ->"B" : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 3, 15)) - -// multiple typeof operators -var ResultIsString5 = typeof typeof ENUM; ->ResultIsString5 : Symbol(ResultIsString5, Decl(typeofOperatorWithEnumType.ts, 14, 3)) ->ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) - -var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); ->ResultIsString6 : Symbol(ResultIsString6, Decl(typeofOperatorWithEnumType.ts, 15, 3)) ->ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) ->ENUM1.B : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 3, 15)) ->ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 2, 14)) ->B : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 3, 15)) - -// miss assignment operators -typeof ENUM; ->ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) - -typeof ENUM1; ->ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 2, 14)) - -typeof ENUM1["B"]; ->ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 2, 14)) ->"B" : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 3, 15)) - -typeof ENUM, ENUM1; ->ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) ->ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 2, 14)) - -// use typeof in type query -enum z { }; ->z : Symbol(z, Decl(typeofOperatorWithEnumType.ts, 21, 19)) - -z: typeof ENUM; ->ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) - -z: typeof ENUM1; ->ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 2, 14)) - diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.types b/tests/baselines/reference/typeofOperatorWithEnumType.types deleted file mode 100644 index 82bf699a22f20..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithEnumType.types +++ /dev/null @@ -1,98 +0,0 @@ -=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts === -// typeof operator on enum type - -enum ENUM { }; ->ENUM : ENUM - -enum ENUM1 { A, B, "" }; ->ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 - -// enum type var -var ResultIsString1 = typeof ENUM; ->ResultIsString1 : string ->typeof ENUM : string ->ENUM : typeof ENUM - -var ResultIsString2 = typeof ENUM1; ->ResultIsString2 : string ->typeof ENUM1 : string ->ENUM1 : typeof ENUM1 - -// enum type expressions -var ResultIsString3 = typeof ENUM1["A"]; ->ResultIsString3 : string ->typeof ENUM1["A"] : string ->ENUM1["A"] : ENUM1 ->ENUM1 : typeof ENUM1 ->"A" : string - -var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); ->ResultIsString4 : string ->typeof (ENUM[0] + ENUM1["B"]) : string ->(ENUM[0] + ENUM1["B"]) : string ->ENUM[0] + ENUM1["B"] : string ->ENUM[0] : string ->ENUM : typeof ENUM ->0 : number ->ENUM1["B"] : ENUM1 ->ENUM1 : typeof ENUM1 ->"B" : string - -// multiple typeof operators -var ResultIsString5 = typeof typeof ENUM; ->ResultIsString5 : string ->typeof typeof ENUM : string ->typeof ENUM : string ->ENUM : typeof ENUM - -var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); ->ResultIsString6 : string ->typeof typeof typeof (ENUM[0] + ENUM1.B) : string ->typeof typeof (ENUM[0] + ENUM1.B) : string ->typeof (ENUM[0] + ENUM1.B) : string ->(ENUM[0] + ENUM1.B) : string ->ENUM[0] + ENUM1.B : string ->ENUM[0] : string ->ENUM : typeof ENUM ->0 : number ->ENUM1.B : ENUM1 ->ENUM1 : typeof ENUM1 ->B : ENUM1 - -// miss assignment operators -typeof ENUM; ->typeof ENUM : string ->ENUM : typeof ENUM - -typeof ENUM1; ->typeof ENUM1 : string ->ENUM1 : typeof ENUM1 - -typeof ENUM1["B"]; ->typeof ENUM1["B"] : string ->ENUM1["B"] : ENUM1 ->ENUM1 : typeof ENUM1 ->"B" : string - -typeof ENUM, ENUM1; ->typeof ENUM, ENUM1 : typeof ENUM1 ->typeof ENUM : string ->ENUM : typeof ENUM ->ENUM1 : typeof ENUM1 - -// use typeof in type query -enum z { }; ->z : z - -z: typeof ENUM; ->z : any ->typeof ENUM : string ->ENUM : typeof ENUM - -z: typeof ENUM1; ->z : any ->typeof ENUM1 : string ->ENUM1 : typeof ENUM1 - diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt new file mode 100644 index 0000000000000..b84d3798ab07c --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt @@ -0,0 +1,69 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(50,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(51,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(52,1): error TS7028: Unused label. + + +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts (3 errors) ==== + // typeof operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsString1 = typeof NUMBER; + var ResultIsString2 = typeof NUMBER1; + + // number type literal + var ResultIsString3 = typeof 1; + var ResultIsString4 = typeof { x: 1, y: 2}; + var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } }; + + // number type expressions + var ResultIsString6 = typeof objA.a; + var ResultIsString7 = typeof M.n; + var ResultIsString8 = typeof NUMBER1[0]; + var ResultIsString9 = typeof foo(); + var ResultIsString10 = typeof A.foo(); + var ResultIsString11 = typeof (NUMBER + NUMBER); + + // multiple typeof operators + var ResultIsString12 = typeof typeof NUMBER; + var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER); + + // miss assignment operators + typeof 1; + typeof NUMBER; + typeof NUMBER1; + typeof foo(); + typeof objA.a; + typeof M.n; + typeof objA.a, M.n; + + // use typeof in type query + var z: number; + var x: number[]; + z: typeof NUMBER; + ~ +!!! error TS7028: Unused label. + x: typeof NUMBER1; + ~ +!!! error TS7028: Unused label. + r: typeof foo; + ~ +!!! error TS7028: Unused label. + var y = { a: 1, b: 2 }; + z: typeof y.a; + z: typeof objA.a; + z: typeof A.foo; + z: typeof M.n; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.symbols b/tests/baselines/reference/typeofOperatorWithNumberType.symbols deleted file mode 100644 index df49b7dccb6f0..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithNumberType.symbols +++ /dev/null @@ -1,168 +0,0 @@ -=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts === -// typeof operator on number type -var NUMBER: number; ->NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) - -var NUMBER1: number[] = [1, 2]; ->NUMBER1 : Symbol(NUMBER1, Decl(typeofOperatorWithNumberType.ts, 2, 3)) - -function foo(): number { return 1; } ->foo : Symbol(foo, Decl(typeofOperatorWithNumberType.ts, 2, 31)) - -class A { ->A : Symbol(A, Decl(typeofOperatorWithNumberType.ts, 4, 36)) - - public a: number; ->a : Symbol(a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) - - static foo() { return 1; } ->foo : Symbol(A.foo, Decl(typeofOperatorWithNumberType.ts, 7, 21)) -} -module M { ->M : Symbol(M, Decl(typeofOperatorWithNumberType.ts, 9, 1)) - - export var n: number; ->n : Symbol(n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) -} - -var objA = new A(); ->objA : Symbol(objA, Decl(typeofOperatorWithNumberType.ts, 14, 3)) ->A : Symbol(A, Decl(typeofOperatorWithNumberType.ts, 4, 36)) - -// number type var -var ResultIsString1 = typeof NUMBER; ->ResultIsString1 : Symbol(ResultIsString1, Decl(typeofOperatorWithNumberType.ts, 17, 3)) ->NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) - -var ResultIsString2 = typeof NUMBER1; ->ResultIsString2 : Symbol(ResultIsString2, Decl(typeofOperatorWithNumberType.ts, 18, 3)) ->NUMBER1 : Symbol(NUMBER1, Decl(typeofOperatorWithNumberType.ts, 2, 3)) - -// number type literal -var ResultIsString3 = typeof 1; ->ResultIsString3 : Symbol(ResultIsString3, Decl(typeofOperatorWithNumberType.ts, 21, 3)) - -var ResultIsString4 = typeof { x: 1, y: 2}; ->ResultIsString4 : Symbol(ResultIsString4, Decl(typeofOperatorWithNumberType.ts, 22, 3)) ->x : Symbol(x, Decl(typeofOperatorWithNumberType.ts, 22, 30)) ->y : Symbol(y, Decl(typeofOperatorWithNumberType.ts, 22, 36)) - -var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } }; ->ResultIsString5 : Symbol(ResultIsString5, Decl(typeofOperatorWithNumberType.ts, 23, 3)) ->x : Symbol(x, Decl(typeofOperatorWithNumberType.ts, 23, 30)) ->y : Symbol(y, Decl(typeofOperatorWithNumberType.ts, 23, 36)) ->n : Symbol(n, Decl(typeofOperatorWithNumberType.ts, 23, 41)) ->n : Symbol(n, Decl(typeofOperatorWithNumberType.ts, 23, 41)) - -// number type expressions -var ResultIsString6 = typeof objA.a; ->ResultIsString6 : Symbol(ResultIsString6, Decl(typeofOperatorWithNumberType.ts, 26, 3)) ->objA.a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) ->objA : Symbol(objA, Decl(typeofOperatorWithNumberType.ts, 14, 3)) ->a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) - -var ResultIsString7 = typeof M.n; ->ResultIsString7 : Symbol(ResultIsString7, Decl(typeofOperatorWithNumberType.ts, 27, 3)) ->M.n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) ->M : Symbol(M, Decl(typeofOperatorWithNumberType.ts, 9, 1)) ->n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) - -var ResultIsString8 = typeof NUMBER1[0]; ->ResultIsString8 : Symbol(ResultIsString8, Decl(typeofOperatorWithNumberType.ts, 28, 3)) ->NUMBER1 : Symbol(NUMBER1, Decl(typeofOperatorWithNumberType.ts, 2, 3)) - -var ResultIsString9 = typeof foo(); ->ResultIsString9 : Symbol(ResultIsString9, Decl(typeofOperatorWithNumberType.ts, 29, 3)) ->foo : Symbol(foo, Decl(typeofOperatorWithNumberType.ts, 2, 31)) - -var ResultIsString10 = typeof A.foo(); ->ResultIsString10 : Symbol(ResultIsString10, Decl(typeofOperatorWithNumberType.ts, 30, 3)) ->A.foo : Symbol(A.foo, Decl(typeofOperatorWithNumberType.ts, 7, 21)) ->A : Symbol(A, Decl(typeofOperatorWithNumberType.ts, 4, 36)) ->foo : Symbol(A.foo, Decl(typeofOperatorWithNumberType.ts, 7, 21)) - -var ResultIsString11 = typeof (NUMBER + NUMBER); ->ResultIsString11 : Symbol(ResultIsString11, Decl(typeofOperatorWithNumberType.ts, 31, 3)) ->NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) ->NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) - -// multiple typeof operators -var ResultIsString12 = typeof typeof NUMBER; ->ResultIsString12 : Symbol(ResultIsString12, Decl(typeofOperatorWithNumberType.ts, 34, 3)) ->NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) - -var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER); ->ResultIsString13 : Symbol(ResultIsString13, Decl(typeofOperatorWithNumberType.ts, 35, 3)) ->NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) ->NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) - -// miss assignment operators -typeof 1; -typeof NUMBER; ->NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) - -typeof NUMBER1; ->NUMBER1 : Symbol(NUMBER1, Decl(typeofOperatorWithNumberType.ts, 2, 3)) - -typeof foo(); ->foo : Symbol(foo, Decl(typeofOperatorWithNumberType.ts, 2, 31)) - -typeof objA.a; ->objA.a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) ->objA : Symbol(objA, Decl(typeofOperatorWithNumberType.ts, 14, 3)) ->a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) - -typeof M.n; ->M.n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) ->M : Symbol(M, Decl(typeofOperatorWithNumberType.ts, 9, 1)) ->n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) - -typeof objA.a, M.n; ->objA.a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) ->objA : Symbol(objA, Decl(typeofOperatorWithNumberType.ts, 14, 3)) ->a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) ->M.n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) ->M : Symbol(M, Decl(typeofOperatorWithNumberType.ts, 9, 1)) ->n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) - -// use typeof in type query -var z: number; ->z : Symbol(z, Decl(typeofOperatorWithNumberType.ts, 47, 3)) - -var x: number[]; ->x : Symbol(x, Decl(typeofOperatorWithNumberType.ts, 48, 3)) - -z: typeof NUMBER; ->NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) - -x: typeof NUMBER1; ->NUMBER1 : Symbol(NUMBER1, Decl(typeofOperatorWithNumberType.ts, 2, 3)) - -r: typeof foo; ->foo : Symbol(foo, Decl(typeofOperatorWithNumberType.ts, 2, 31)) - -var y = { a: 1, b: 2 }; ->y : Symbol(y, Decl(typeofOperatorWithNumberType.ts, 52, 3)) ->a : Symbol(a, Decl(typeofOperatorWithNumberType.ts, 52, 9)) ->b : Symbol(b, Decl(typeofOperatorWithNumberType.ts, 52, 15)) - -z: typeof y.a; ->y.a : Symbol(a, Decl(typeofOperatorWithNumberType.ts, 52, 9)) ->y : Symbol(y, Decl(typeofOperatorWithNumberType.ts, 52, 3)) ->a : Symbol(a, Decl(typeofOperatorWithNumberType.ts, 52, 9)) - -z: typeof objA.a; ->objA.a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) ->objA : Symbol(objA, Decl(typeofOperatorWithNumberType.ts, 14, 3)) ->a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) - -z: typeof A.foo; ->A.foo : Symbol(A.foo, Decl(typeofOperatorWithNumberType.ts, 7, 21)) ->A : Symbol(A, Decl(typeofOperatorWithNumberType.ts, 4, 36)) ->foo : Symbol(A.foo, Decl(typeofOperatorWithNumberType.ts, 7, 21)) - -z: typeof M.n; ->M.n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) ->M : Symbol(M, Decl(typeofOperatorWithNumberType.ts, 9, 1)) ->n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) - diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.types b/tests/baselines/reference/typeofOperatorWithNumberType.types deleted file mode 100644 index b80e6b1d4a8f4..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithNumberType.types +++ /dev/null @@ -1,233 +0,0 @@ -=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts === -// typeof operator on number type -var NUMBER: number; ->NUMBER : number - -var NUMBER1: number[] = [1, 2]; ->NUMBER1 : number[] ->[1, 2] : number[] ->1 : number ->2 : number - -function foo(): number { return 1; } ->foo : () => number ->1 : number - -class A { ->A : A - - public a: number; ->a : number - - static foo() { return 1; } ->foo : () => number ->1 : number -} -module M { ->M : typeof M - - export var n: number; ->n : number -} - -var objA = new A(); ->objA : A ->new A() : A ->A : typeof A - -// number type var -var ResultIsString1 = typeof NUMBER; ->ResultIsString1 : string ->typeof NUMBER : string ->NUMBER : number - -var ResultIsString2 = typeof NUMBER1; ->ResultIsString2 : string ->typeof NUMBER1 : string ->NUMBER1 : number[] - -// number type literal -var ResultIsString3 = typeof 1; ->ResultIsString3 : string ->typeof 1 : string ->1 : number - -var ResultIsString4 = typeof { x: 1, y: 2}; ->ResultIsString4 : string ->typeof { x: 1, y: 2} : string ->{ x: 1, y: 2} : { x: number; y: number; } ->x : number ->1 : number ->y : number ->2 : number - -var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } }; ->ResultIsString5 : string ->typeof { x: 1, y: (n: number) => { return n; } } : string ->{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } ->x : number ->1 : number ->y : (n: number) => number ->(n: number) => { return n; } : (n: number) => number ->n : number ->n : number - -// number type expressions -var ResultIsString6 = typeof objA.a; ->ResultIsString6 : string ->typeof objA.a : string ->objA.a : number ->objA : A ->a : number - -var ResultIsString7 = typeof M.n; ->ResultIsString7 : string ->typeof M.n : string ->M.n : number ->M : typeof M ->n : number - -var ResultIsString8 = typeof NUMBER1[0]; ->ResultIsString8 : string ->typeof NUMBER1[0] : string ->NUMBER1[0] : number ->NUMBER1 : number[] ->0 : number - -var ResultIsString9 = typeof foo(); ->ResultIsString9 : string ->typeof foo() : string ->foo() : number ->foo : () => number - -var ResultIsString10 = typeof A.foo(); ->ResultIsString10 : string ->typeof A.foo() : string ->A.foo() : number ->A.foo : () => number ->A : typeof A ->foo : () => number - -var ResultIsString11 = typeof (NUMBER + NUMBER); ->ResultIsString11 : string ->typeof (NUMBER + NUMBER) : string ->(NUMBER + NUMBER) : number ->NUMBER + NUMBER : number ->NUMBER : number ->NUMBER : number - -// multiple typeof operators -var ResultIsString12 = typeof typeof NUMBER; ->ResultIsString12 : string ->typeof typeof NUMBER : string ->typeof NUMBER : string ->NUMBER : number - -var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER); ->ResultIsString13 : string ->typeof typeof typeof (NUMBER + NUMBER) : string ->typeof typeof (NUMBER + NUMBER) : string ->typeof (NUMBER + NUMBER) : string ->(NUMBER + NUMBER) : number ->NUMBER + NUMBER : number ->NUMBER : number ->NUMBER : number - -// miss assignment operators -typeof 1; ->typeof 1 : string ->1 : number - -typeof NUMBER; ->typeof NUMBER : string ->NUMBER : number - -typeof NUMBER1; ->typeof NUMBER1 : string ->NUMBER1 : number[] - -typeof foo(); ->typeof foo() : string ->foo() : number ->foo : () => number - -typeof objA.a; ->typeof objA.a : string ->objA.a : number ->objA : A ->a : number - -typeof M.n; ->typeof M.n : string ->M.n : number ->M : typeof M ->n : number - -typeof objA.a, M.n; ->typeof objA.a, M.n : number ->typeof objA.a : string ->objA.a : number ->objA : A ->a : number ->M.n : number ->M : typeof M ->n : number - -// use typeof in type query -var z: number; ->z : number - -var x: number[]; ->x : number[] - -z: typeof NUMBER; ->z : any ->typeof NUMBER : string ->NUMBER : number - -x: typeof NUMBER1; ->x : any ->typeof NUMBER1 : string ->NUMBER1 : number[] - -r: typeof foo; ->r : any ->typeof foo : string ->foo : () => number - -var y = { a: 1, b: 2 }; ->y : { a: number; b: number; } ->{ a: 1, b: 2 } : { a: number; b: number; } ->a : number ->1 : number ->b : number ->2 : number - -z: typeof y.a; ->z : any ->typeof y.a : string ->y.a : number ->y : { a: number; b: number; } ->a : number - -z: typeof objA.a; ->z : any ->typeof objA.a : string ->objA.a : number ->objA : A ->a : number - -z: typeof A.foo; ->z : any ->typeof A.foo : string ->A.foo : () => number ->A : typeof A ->foo : () => number - -z: typeof M.n; ->z : any ->typeof M.n : string ->M.n : number ->M : typeof M ->n : number - diff --git a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt new file mode 100644 index 0000000000000..37b2cafab370c --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt @@ -0,0 +1,69 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(50,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(51,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(52,1): error TS7028: Unused label. + + +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (3 errors) ==== + // typeof operator on string type + var STRING: string; + var STRING1: string[] = ["", "abc"]; + + function foo(): string { return "abc"; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsString1 = typeof STRING; + var ResultIsString2 = typeof STRING1; + + // string type literal + var ResultIsString3 = typeof ""; + var ResultIsString4 = typeof { x: "", y: "" }; + var ResultIsString5 = typeof { x: "", y: (s: string) => { return s; } }; + + // string type expressions + var ResultIsString6 = typeof objA.a; + var ResultIsString7 = typeof M.n; + var ResultIsString8 = typeof STRING1[0]; + var ResultIsString9 = typeof foo(); + var ResultIsString10 = typeof A.foo(); + var ResultIsString11 = typeof (STRING + STRING); + var ResultIsString12 = typeof STRING.charAt(0); + + // multiple typeof operators + var ResultIsString13 = typeof typeof STRING; + var ResultIsString14 = typeof typeof typeof (STRING + STRING); + + // miss assignment operators + typeof ""; + typeof STRING; + typeof STRING1; + typeof foo(); + typeof objA.a, M.n; + + // use typeof in type query + var z: string; + var x: string[]; + var r: () => string; + z: typeof STRING; + ~ +!!! error TS7028: Unused label. + x: typeof STRING1; + ~ +!!! error TS7028: Unused label. + r: typeof foo; + ~ +!!! error TS7028: Unused label. + var y = { a: "", b: "" }; + z: typeof y.a; + z: typeof objA.a; + z: typeof A.foo; + z: typeof M.n; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithStringType.symbols b/tests/baselines/reference/typeofOperatorWithStringType.symbols deleted file mode 100644 index 6da22469f839f..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithStringType.symbols +++ /dev/null @@ -1,167 +0,0 @@ -=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts === -// typeof operator on string type -var STRING: string; ->STRING : Symbol(STRING, Decl(typeofOperatorWithStringType.ts, 1, 3)) - -var STRING1: string[] = ["", "abc"]; ->STRING1 : Symbol(STRING1, Decl(typeofOperatorWithStringType.ts, 2, 3)) - -function foo(): string { return "abc"; } ->foo : Symbol(foo, Decl(typeofOperatorWithStringType.ts, 2, 36)) - -class A { ->A : Symbol(A, Decl(typeofOperatorWithStringType.ts, 4, 40)) - - public a: string; ->a : Symbol(a, Decl(typeofOperatorWithStringType.ts, 6, 9)) - - static foo() { return ""; } ->foo : Symbol(A.foo, Decl(typeofOperatorWithStringType.ts, 7, 21)) -} -module M { ->M : Symbol(M, Decl(typeofOperatorWithStringType.ts, 9, 1)) - - export var n: string; ->n : Symbol(n, Decl(typeofOperatorWithStringType.ts, 11, 14)) -} - -var objA = new A(); ->objA : Symbol(objA, Decl(typeofOperatorWithStringType.ts, 14, 3)) ->A : Symbol(A, Decl(typeofOperatorWithStringType.ts, 4, 40)) - -// string type var -var ResultIsString1 = typeof STRING; ->ResultIsString1 : Symbol(ResultIsString1, Decl(typeofOperatorWithStringType.ts, 17, 3)) ->STRING : Symbol(STRING, Decl(typeofOperatorWithStringType.ts, 1, 3)) - -var ResultIsString2 = typeof STRING1; ->ResultIsString2 : Symbol(ResultIsString2, Decl(typeofOperatorWithStringType.ts, 18, 3)) ->STRING1 : Symbol(STRING1, Decl(typeofOperatorWithStringType.ts, 2, 3)) - -// string type literal -var ResultIsString3 = typeof ""; ->ResultIsString3 : Symbol(ResultIsString3, Decl(typeofOperatorWithStringType.ts, 21, 3)) - -var ResultIsString4 = typeof { x: "", y: "" }; ->ResultIsString4 : Symbol(ResultIsString4, Decl(typeofOperatorWithStringType.ts, 22, 3)) ->x : Symbol(x, Decl(typeofOperatorWithStringType.ts, 22, 30)) ->y : Symbol(y, Decl(typeofOperatorWithStringType.ts, 22, 37)) - -var ResultIsString5 = typeof { x: "", y: (s: string) => { return s; } }; ->ResultIsString5 : Symbol(ResultIsString5, Decl(typeofOperatorWithStringType.ts, 23, 3)) ->x : Symbol(x, Decl(typeofOperatorWithStringType.ts, 23, 30)) ->y : Symbol(y, Decl(typeofOperatorWithStringType.ts, 23, 37)) ->s : Symbol(s, Decl(typeofOperatorWithStringType.ts, 23, 42)) ->s : Symbol(s, Decl(typeofOperatorWithStringType.ts, 23, 42)) - -// string type expressions -var ResultIsString6 = typeof objA.a; ->ResultIsString6 : Symbol(ResultIsString6, Decl(typeofOperatorWithStringType.ts, 26, 3)) ->objA.a : Symbol(A.a, Decl(typeofOperatorWithStringType.ts, 6, 9)) ->objA : Symbol(objA, Decl(typeofOperatorWithStringType.ts, 14, 3)) ->a : Symbol(A.a, Decl(typeofOperatorWithStringType.ts, 6, 9)) - -var ResultIsString7 = typeof M.n; ->ResultIsString7 : Symbol(ResultIsString7, Decl(typeofOperatorWithStringType.ts, 27, 3)) ->M.n : Symbol(M.n, Decl(typeofOperatorWithStringType.ts, 11, 14)) ->M : Symbol(M, Decl(typeofOperatorWithStringType.ts, 9, 1)) ->n : Symbol(M.n, Decl(typeofOperatorWithStringType.ts, 11, 14)) - -var ResultIsString8 = typeof STRING1[0]; ->ResultIsString8 : Symbol(ResultIsString8, Decl(typeofOperatorWithStringType.ts, 28, 3)) ->STRING1 : Symbol(STRING1, Decl(typeofOperatorWithStringType.ts, 2, 3)) - -var ResultIsString9 = typeof foo(); ->ResultIsString9 : Symbol(ResultIsString9, Decl(typeofOperatorWithStringType.ts, 29, 3)) ->foo : Symbol(foo, Decl(typeofOperatorWithStringType.ts, 2, 36)) - -var ResultIsString10 = typeof A.foo(); ->ResultIsString10 : Symbol(ResultIsString10, Decl(typeofOperatorWithStringType.ts, 30, 3)) ->A.foo : Symbol(A.foo, Decl(typeofOperatorWithStringType.ts, 7, 21)) ->A : Symbol(A, Decl(typeofOperatorWithStringType.ts, 4, 40)) ->foo : Symbol(A.foo, Decl(typeofOperatorWithStringType.ts, 7, 21)) - -var ResultIsString11 = typeof (STRING + STRING); ->ResultIsString11 : Symbol(ResultIsString11, Decl(typeofOperatorWithStringType.ts, 31, 3)) ->STRING : Symbol(STRING, Decl(typeofOperatorWithStringType.ts, 1, 3)) ->STRING : Symbol(STRING, Decl(typeofOperatorWithStringType.ts, 1, 3)) - -var ResultIsString12 = typeof STRING.charAt(0); ->ResultIsString12 : Symbol(ResultIsString12, Decl(typeofOperatorWithStringType.ts, 32, 3)) ->STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) ->STRING : Symbol(STRING, Decl(typeofOperatorWithStringType.ts, 1, 3)) ->charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) - -// multiple typeof operators -var ResultIsString13 = typeof typeof STRING; ->ResultIsString13 : Symbol(ResultIsString13, Decl(typeofOperatorWithStringType.ts, 35, 3)) ->STRING : Symbol(STRING, Decl(typeofOperatorWithStringType.ts, 1, 3)) - -var ResultIsString14 = typeof typeof typeof (STRING + STRING); ->ResultIsString14 : Symbol(ResultIsString14, Decl(typeofOperatorWithStringType.ts, 36, 3)) ->STRING : Symbol(STRING, Decl(typeofOperatorWithStringType.ts, 1, 3)) ->STRING : Symbol(STRING, Decl(typeofOperatorWithStringType.ts, 1, 3)) - -// miss assignment operators -typeof ""; -typeof STRING; ->STRING : Symbol(STRING, Decl(typeofOperatorWithStringType.ts, 1, 3)) - -typeof STRING1; ->STRING1 : Symbol(STRING1, Decl(typeofOperatorWithStringType.ts, 2, 3)) - -typeof foo(); ->foo : Symbol(foo, Decl(typeofOperatorWithStringType.ts, 2, 36)) - -typeof objA.a, M.n; ->objA.a : Symbol(A.a, Decl(typeofOperatorWithStringType.ts, 6, 9)) ->objA : Symbol(objA, Decl(typeofOperatorWithStringType.ts, 14, 3)) ->a : Symbol(A.a, Decl(typeofOperatorWithStringType.ts, 6, 9)) ->M.n : Symbol(M.n, Decl(typeofOperatorWithStringType.ts, 11, 14)) ->M : Symbol(M, Decl(typeofOperatorWithStringType.ts, 9, 1)) ->n : Symbol(M.n, Decl(typeofOperatorWithStringType.ts, 11, 14)) - -// use typeof in type query -var z: string; ->z : Symbol(z, Decl(typeofOperatorWithStringType.ts, 46, 3)) - -var x: string[]; ->x : Symbol(x, Decl(typeofOperatorWithStringType.ts, 47, 3)) - -var r: () => string; ->r : Symbol(r, Decl(typeofOperatorWithStringType.ts, 48, 3)) - -z: typeof STRING; ->STRING : Symbol(STRING, Decl(typeofOperatorWithStringType.ts, 1, 3)) - -x: typeof STRING1; ->STRING1 : Symbol(STRING1, Decl(typeofOperatorWithStringType.ts, 2, 3)) - -r: typeof foo; ->foo : Symbol(foo, Decl(typeofOperatorWithStringType.ts, 2, 36)) - -var y = { a: "", b: "" }; ->y : Symbol(y, Decl(typeofOperatorWithStringType.ts, 52, 3)) ->a : Symbol(a, Decl(typeofOperatorWithStringType.ts, 52, 9)) ->b : Symbol(b, Decl(typeofOperatorWithStringType.ts, 52, 16)) - -z: typeof y.a; ->y.a : Symbol(a, Decl(typeofOperatorWithStringType.ts, 52, 9)) ->y : Symbol(y, Decl(typeofOperatorWithStringType.ts, 52, 3)) ->a : Symbol(a, Decl(typeofOperatorWithStringType.ts, 52, 9)) - -z: typeof objA.a; ->objA.a : Symbol(A.a, Decl(typeofOperatorWithStringType.ts, 6, 9)) ->objA : Symbol(objA, Decl(typeofOperatorWithStringType.ts, 14, 3)) ->a : Symbol(A.a, Decl(typeofOperatorWithStringType.ts, 6, 9)) - -z: typeof A.foo; ->A.foo : Symbol(A.foo, Decl(typeofOperatorWithStringType.ts, 7, 21)) ->A : Symbol(A, Decl(typeofOperatorWithStringType.ts, 4, 40)) ->foo : Symbol(A.foo, Decl(typeofOperatorWithStringType.ts, 7, 21)) - -z: typeof M.n; ->M.n : Symbol(M.n, Decl(typeofOperatorWithStringType.ts, 11, 14)) ->M : Symbol(M, Decl(typeofOperatorWithStringType.ts, 9, 1)) ->n : Symbol(M.n, Decl(typeofOperatorWithStringType.ts, 11, 14)) - diff --git a/tests/baselines/reference/typeofOperatorWithStringType.types b/tests/baselines/reference/typeofOperatorWithStringType.types deleted file mode 100644 index 3ae657a995100..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithStringType.types +++ /dev/null @@ -1,233 +0,0 @@ -=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts === -// typeof operator on string type -var STRING: string; ->STRING : string - -var STRING1: string[] = ["", "abc"]; ->STRING1 : string[] ->["", "abc"] : string[] ->"" : string ->"abc" : string - -function foo(): string { return "abc"; } ->foo : () => string ->"abc" : string - -class A { ->A : A - - public a: string; ->a : string - - static foo() { return ""; } ->foo : () => string ->"" : string -} -module M { ->M : typeof M - - export var n: string; ->n : string -} - -var objA = new A(); ->objA : A ->new A() : A ->A : typeof A - -// string type var -var ResultIsString1 = typeof STRING; ->ResultIsString1 : string ->typeof STRING : string ->STRING : string - -var ResultIsString2 = typeof STRING1; ->ResultIsString2 : string ->typeof STRING1 : string ->STRING1 : string[] - -// string type literal -var ResultIsString3 = typeof ""; ->ResultIsString3 : string ->typeof "" : string ->"" : string - -var ResultIsString4 = typeof { x: "", y: "" }; ->ResultIsString4 : string ->typeof { x: "", y: "" } : string ->{ x: "", y: "" } : { x: string; y: string; } ->x : string ->"" : string ->y : string ->"" : string - -var ResultIsString5 = typeof { x: "", y: (s: string) => { return s; } }; ->ResultIsString5 : string ->typeof { x: "", y: (s: string) => { return s; } } : string ->{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } ->x : string ->"" : string ->y : (s: string) => string ->(s: string) => { return s; } : (s: string) => string ->s : string ->s : string - -// string type expressions -var ResultIsString6 = typeof objA.a; ->ResultIsString6 : string ->typeof objA.a : string ->objA.a : string ->objA : A ->a : string - -var ResultIsString7 = typeof M.n; ->ResultIsString7 : string ->typeof M.n : string ->M.n : string ->M : typeof M ->n : string - -var ResultIsString8 = typeof STRING1[0]; ->ResultIsString8 : string ->typeof STRING1[0] : string ->STRING1[0] : string ->STRING1 : string[] ->0 : number - -var ResultIsString9 = typeof foo(); ->ResultIsString9 : string ->typeof foo() : string ->foo() : string ->foo : () => string - -var ResultIsString10 = typeof A.foo(); ->ResultIsString10 : string ->typeof A.foo() : string ->A.foo() : string ->A.foo : () => string ->A : typeof A ->foo : () => string - -var ResultIsString11 = typeof (STRING + STRING); ->ResultIsString11 : string ->typeof (STRING + STRING) : string ->(STRING + STRING) : string ->STRING + STRING : string ->STRING : string ->STRING : string - -var ResultIsString12 = typeof STRING.charAt(0); ->ResultIsString12 : string ->typeof STRING.charAt(0) : string ->STRING.charAt(0) : string ->STRING.charAt : (pos: number) => string ->STRING : string ->charAt : (pos: number) => string ->0 : number - -// multiple typeof operators -var ResultIsString13 = typeof typeof STRING; ->ResultIsString13 : string ->typeof typeof STRING : string ->typeof STRING : string ->STRING : string - -var ResultIsString14 = typeof typeof typeof (STRING + STRING); ->ResultIsString14 : string ->typeof typeof typeof (STRING + STRING) : string ->typeof typeof (STRING + STRING) : string ->typeof (STRING + STRING) : string ->(STRING + STRING) : string ->STRING + STRING : string ->STRING : string ->STRING : string - -// miss assignment operators -typeof ""; ->typeof "" : string ->"" : string - -typeof STRING; ->typeof STRING : string ->STRING : string - -typeof STRING1; ->typeof STRING1 : string ->STRING1 : string[] - -typeof foo(); ->typeof foo() : string ->foo() : string ->foo : () => string - -typeof objA.a, M.n; ->typeof objA.a, M.n : string ->typeof objA.a : string ->objA.a : string ->objA : A ->a : string ->M.n : string ->M : typeof M ->n : string - -// use typeof in type query -var z: string; ->z : string - -var x: string[]; ->x : string[] - -var r: () => string; ->r : () => string - -z: typeof STRING; ->z : any ->typeof STRING : string ->STRING : string - -x: typeof STRING1; ->x : any ->typeof STRING1 : string ->STRING1 : string[] - -r: typeof foo; ->r : any ->typeof foo : string ->foo : () => string - -var y = { a: "", b: "" }; ->y : { a: string; b: string; } ->{ a: "", b: "" } : { a: string; b: string; } ->a : string ->"" : string ->b : string ->"" : string - -z: typeof y.a; ->z : any ->typeof y.a : string ->y.a : string ->y : { a: string; b: string; } ->a : string - -z: typeof objA.a; ->z : any ->typeof objA.a : string ->objA.a : string ->objA : A ->a : string - -z: typeof A.foo; ->z : any ->typeof A.foo : string ->A.foo : () => string ->A : typeof A ->foo : () => string - -z: typeof M.n; ->z : any ->typeof M.n : string ->M.n : string ->M : typeof M ->n : string - diff --git a/tests/baselines/reference/undeclaredVarEmit.errors.txt b/tests/baselines/reference/undeclaredVarEmit.errors.txt index af6298b61d2d8..a95323aa362a0 100644 --- a/tests/baselines/reference/undeclaredVarEmit.errors.txt +++ b/tests/baselines/reference/undeclaredVarEmit.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/undeclaredVarEmit.ts(1,1): error TS7028: Unused label. tests/cases/compiler/undeclaredVarEmit.ts(1,4): error TS2304: Cannot find name 'number'. -==== tests/cases/compiler/undeclaredVarEmit.ts (1 errors) ==== +==== tests/cases/compiler/undeclaredVarEmit.ts (2 errors) ==== f: number; + ~ +!!! error TS7028: Unused label. ~~~~~~ !!! error TS2304: Cannot find name 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/validMultipleVariableDeclarations.errors.txt b/tests/baselines/reference/validMultipleVariableDeclarations.errors.txt new file mode 100644 index 0000000000000..8f751e9efeead --- /dev/null +++ b/tests/baselines/reference/validMultipleVariableDeclarations.errors.txt @@ -0,0 +1,45 @@ +tests/cases/conformance/statements/VariableStatements/validMultipleVariableDeclarations.ts(9,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/VariableStatements/validMultipleVariableDeclarations.ts (1 errors) ==== + // all expected to be valid + + var x: number; + var x = 2; + if (true) { + var x = 3; + for (var x = 0; ;) { } + } + var x = undefined; + ~~~ +!!! error TS7027: Unreachable code detected. + + // new declaration space, making redeclaring x as a string valid + function declSpace() { + var x = 'this is a string'; + } + + interface Point { x: number; y: number; } + + var p: Point; + var p = { x: 1, y: 2 }; + var p: Point = { x: 0, y: undefined }; + var p = { x: 1, y: undefined }; + var p: { x: number; y: number; } = { x: 1, y: 2 }; + var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; + var p: typeof p; + + var fn = function (s: string) { return 42; } + var fn = (s: string) => 3; + var fn: (s: string) => number; + var fn: { (s: string): number }; + var fn = <(s: string) => number> null; + var fn: typeof fn; + + var a: string[]; + var a = ['a', 'b'] + var a = []; + var a: string[] = []; + var a = new Array(); + var a: typeof a; + \ No newline at end of file diff --git a/tests/baselines/reference/validMultipleVariableDeclarations.symbols b/tests/baselines/reference/validMultipleVariableDeclarations.symbols deleted file mode 100644 index 467c061c6fa88..0000000000000 --- a/tests/baselines/reference/validMultipleVariableDeclarations.symbols +++ /dev/null @@ -1,118 +0,0 @@ -=== tests/cases/conformance/statements/VariableStatements/validMultipleVariableDeclarations.ts === -// all expected to be valid - -var x: number; ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 2, 3), Decl(validMultipleVariableDeclarations.ts, 3, 3), Decl(validMultipleVariableDeclarations.ts, 5, 7), Decl(validMultipleVariableDeclarations.ts, 6, 12), Decl(validMultipleVariableDeclarations.ts, 8, 3)) - -var x = 2; ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 2, 3), Decl(validMultipleVariableDeclarations.ts, 3, 3), Decl(validMultipleVariableDeclarations.ts, 5, 7), Decl(validMultipleVariableDeclarations.ts, 6, 12), Decl(validMultipleVariableDeclarations.ts, 8, 3)) - -if (true) { - var x = 3; ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 2, 3), Decl(validMultipleVariableDeclarations.ts, 3, 3), Decl(validMultipleVariableDeclarations.ts, 5, 7), Decl(validMultipleVariableDeclarations.ts, 6, 12), Decl(validMultipleVariableDeclarations.ts, 8, 3)) - - for (var x = 0; ;) { } ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 2, 3), Decl(validMultipleVariableDeclarations.ts, 3, 3), Decl(validMultipleVariableDeclarations.ts, 5, 7), Decl(validMultipleVariableDeclarations.ts, 6, 12), Decl(validMultipleVariableDeclarations.ts, 8, 3)) -} -var x = undefined; ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 2, 3), Decl(validMultipleVariableDeclarations.ts, 3, 3), Decl(validMultipleVariableDeclarations.ts, 5, 7), Decl(validMultipleVariableDeclarations.ts, 6, 12), Decl(validMultipleVariableDeclarations.ts, 8, 3)) ->undefined : Symbol(undefined) - -// new declaration space, making redeclaring x as a string valid -function declSpace() { ->declSpace : Symbol(declSpace, Decl(validMultipleVariableDeclarations.ts, 8, 26)) - - var x = 'this is a string'; ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 12, 7)) -} - -interface Point { x: number; y: number; } ->Point : Symbol(Point, Decl(validMultipleVariableDeclarations.ts, 13, 1)) ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 15, 17)) ->y : Symbol(y, Decl(validMultipleVariableDeclarations.ts, 15, 28)) - -var p: Point; ->p : Symbol(p, Decl(validMultipleVariableDeclarations.ts, 17, 3), Decl(validMultipleVariableDeclarations.ts, 18, 3), Decl(validMultipleVariableDeclarations.ts, 19, 3), Decl(validMultipleVariableDeclarations.ts, 20, 3), Decl(validMultipleVariableDeclarations.ts, 21, 3), Decl(validMultipleVariableDeclarations.ts, 22, 3), Decl(validMultipleVariableDeclarations.ts, 23, 3)) ->Point : Symbol(Point, Decl(validMultipleVariableDeclarations.ts, 13, 1)) - -var p = { x: 1, y: 2 }; ->p : Symbol(p, Decl(validMultipleVariableDeclarations.ts, 17, 3), Decl(validMultipleVariableDeclarations.ts, 18, 3), Decl(validMultipleVariableDeclarations.ts, 19, 3), Decl(validMultipleVariableDeclarations.ts, 20, 3), Decl(validMultipleVariableDeclarations.ts, 21, 3), Decl(validMultipleVariableDeclarations.ts, 22, 3), Decl(validMultipleVariableDeclarations.ts, 23, 3)) ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 18, 9)) ->y : Symbol(y, Decl(validMultipleVariableDeclarations.ts, 18, 15)) - -var p: Point = { x: 0, y: undefined }; ->p : Symbol(p, Decl(validMultipleVariableDeclarations.ts, 17, 3), Decl(validMultipleVariableDeclarations.ts, 18, 3), Decl(validMultipleVariableDeclarations.ts, 19, 3), Decl(validMultipleVariableDeclarations.ts, 20, 3), Decl(validMultipleVariableDeclarations.ts, 21, 3), Decl(validMultipleVariableDeclarations.ts, 22, 3), Decl(validMultipleVariableDeclarations.ts, 23, 3)) ->Point : Symbol(Point, Decl(validMultipleVariableDeclarations.ts, 13, 1)) ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 19, 16)) ->y : Symbol(y, Decl(validMultipleVariableDeclarations.ts, 19, 22)) ->undefined : Symbol(undefined) - -var p = { x: 1, y: undefined }; ->p : Symbol(p, Decl(validMultipleVariableDeclarations.ts, 17, 3), Decl(validMultipleVariableDeclarations.ts, 18, 3), Decl(validMultipleVariableDeclarations.ts, 19, 3), Decl(validMultipleVariableDeclarations.ts, 20, 3), Decl(validMultipleVariableDeclarations.ts, 21, 3), Decl(validMultipleVariableDeclarations.ts, 22, 3), Decl(validMultipleVariableDeclarations.ts, 23, 3)) ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 20, 9)) ->y : Symbol(y, Decl(validMultipleVariableDeclarations.ts, 20, 15)) ->undefined : Symbol(undefined) - -var p: { x: number; y: number; } = { x: 1, y: 2 }; ->p : Symbol(p, Decl(validMultipleVariableDeclarations.ts, 17, 3), Decl(validMultipleVariableDeclarations.ts, 18, 3), Decl(validMultipleVariableDeclarations.ts, 19, 3), Decl(validMultipleVariableDeclarations.ts, 20, 3), Decl(validMultipleVariableDeclarations.ts, 21, 3), Decl(validMultipleVariableDeclarations.ts, 22, 3), Decl(validMultipleVariableDeclarations.ts, 23, 3)) ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 21, 8)) ->y : Symbol(y, Decl(validMultipleVariableDeclarations.ts, 21, 19)) ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 21, 36)) ->y : Symbol(y, Decl(validMultipleVariableDeclarations.ts, 21, 42)) - -var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ->p : Symbol(p, Decl(validMultipleVariableDeclarations.ts, 17, 3), Decl(validMultipleVariableDeclarations.ts, 18, 3), Decl(validMultipleVariableDeclarations.ts, 19, 3), Decl(validMultipleVariableDeclarations.ts, 20, 3), Decl(validMultipleVariableDeclarations.ts, 21, 3), Decl(validMultipleVariableDeclarations.ts, 22, 3), Decl(validMultipleVariableDeclarations.ts, 23, 3)) ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 22, 10)) ->y : Symbol(y, Decl(validMultipleVariableDeclarations.ts, 22, 21)) ->x : Symbol(x, Decl(validMultipleVariableDeclarations.ts, 22, 36)) ->y : Symbol(y, Decl(validMultipleVariableDeclarations.ts, 22, 42)) ->undefined : Symbol(undefined) - -var p: typeof p; ->p : Symbol(p, Decl(validMultipleVariableDeclarations.ts, 17, 3), Decl(validMultipleVariableDeclarations.ts, 18, 3), Decl(validMultipleVariableDeclarations.ts, 19, 3), Decl(validMultipleVariableDeclarations.ts, 20, 3), Decl(validMultipleVariableDeclarations.ts, 21, 3), Decl(validMultipleVariableDeclarations.ts, 22, 3), Decl(validMultipleVariableDeclarations.ts, 23, 3)) ->p : Symbol(p, Decl(validMultipleVariableDeclarations.ts, 17, 3), Decl(validMultipleVariableDeclarations.ts, 18, 3), Decl(validMultipleVariableDeclarations.ts, 19, 3), Decl(validMultipleVariableDeclarations.ts, 20, 3), Decl(validMultipleVariableDeclarations.ts, 21, 3), Decl(validMultipleVariableDeclarations.ts, 22, 3), Decl(validMultipleVariableDeclarations.ts, 23, 3)) - -var fn = function (s: string) { return 42; } ->fn : Symbol(fn, Decl(validMultipleVariableDeclarations.ts, 25, 3), Decl(validMultipleVariableDeclarations.ts, 26, 3), Decl(validMultipleVariableDeclarations.ts, 27, 3), Decl(validMultipleVariableDeclarations.ts, 28, 3), Decl(validMultipleVariableDeclarations.ts, 29, 3), Decl(validMultipleVariableDeclarations.ts, 30, 3)) ->s : Symbol(s, Decl(validMultipleVariableDeclarations.ts, 25, 19)) - -var fn = (s: string) => 3; ->fn : Symbol(fn, Decl(validMultipleVariableDeclarations.ts, 25, 3), Decl(validMultipleVariableDeclarations.ts, 26, 3), Decl(validMultipleVariableDeclarations.ts, 27, 3), Decl(validMultipleVariableDeclarations.ts, 28, 3), Decl(validMultipleVariableDeclarations.ts, 29, 3), Decl(validMultipleVariableDeclarations.ts, 30, 3)) ->s : Symbol(s, Decl(validMultipleVariableDeclarations.ts, 26, 10)) - -var fn: (s: string) => number; ->fn : Symbol(fn, Decl(validMultipleVariableDeclarations.ts, 25, 3), Decl(validMultipleVariableDeclarations.ts, 26, 3), Decl(validMultipleVariableDeclarations.ts, 27, 3), Decl(validMultipleVariableDeclarations.ts, 28, 3), Decl(validMultipleVariableDeclarations.ts, 29, 3), Decl(validMultipleVariableDeclarations.ts, 30, 3)) ->s : Symbol(s, Decl(validMultipleVariableDeclarations.ts, 27, 9)) - -var fn: { (s: string): number }; ->fn : Symbol(fn, Decl(validMultipleVariableDeclarations.ts, 25, 3), Decl(validMultipleVariableDeclarations.ts, 26, 3), Decl(validMultipleVariableDeclarations.ts, 27, 3), Decl(validMultipleVariableDeclarations.ts, 28, 3), Decl(validMultipleVariableDeclarations.ts, 29, 3), Decl(validMultipleVariableDeclarations.ts, 30, 3)) ->s : Symbol(s, Decl(validMultipleVariableDeclarations.ts, 28, 11)) - -var fn = <(s: string) => number> null; ->fn : Symbol(fn, Decl(validMultipleVariableDeclarations.ts, 25, 3), Decl(validMultipleVariableDeclarations.ts, 26, 3), Decl(validMultipleVariableDeclarations.ts, 27, 3), Decl(validMultipleVariableDeclarations.ts, 28, 3), Decl(validMultipleVariableDeclarations.ts, 29, 3), Decl(validMultipleVariableDeclarations.ts, 30, 3)) ->s : Symbol(s, Decl(validMultipleVariableDeclarations.ts, 29, 11)) - -var fn: typeof fn; ->fn : Symbol(fn, Decl(validMultipleVariableDeclarations.ts, 25, 3), Decl(validMultipleVariableDeclarations.ts, 26, 3), Decl(validMultipleVariableDeclarations.ts, 27, 3), Decl(validMultipleVariableDeclarations.ts, 28, 3), Decl(validMultipleVariableDeclarations.ts, 29, 3), Decl(validMultipleVariableDeclarations.ts, 30, 3)) ->fn : Symbol(fn, Decl(validMultipleVariableDeclarations.ts, 25, 3), Decl(validMultipleVariableDeclarations.ts, 26, 3), Decl(validMultipleVariableDeclarations.ts, 27, 3), Decl(validMultipleVariableDeclarations.ts, 28, 3), Decl(validMultipleVariableDeclarations.ts, 29, 3), Decl(validMultipleVariableDeclarations.ts, 30, 3)) - -var a: string[]; ->a : Symbol(a, Decl(validMultipleVariableDeclarations.ts, 32, 3), Decl(validMultipleVariableDeclarations.ts, 33, 3), Decl(validMultipleVariableDeclarations.ts, 34, 3), Decl(validMultipleVariableDeclarations.ts, 35, 3), Decl(validMultipleVariableDeclarations.ts, 36, 3), Decl(validMultipleVariableDeclarations.ts, 37, 3)) - -var a = ['a', 'b'] ->a : Symbol(a, Decl(validMultipleVariableDeclarations.ts, 32, 3), Decl(validMultipleVariableDeclarations.ts, 33, 3), Decl(validMultipleVariableDeclarations.ts, 34, 3), Decl(validMultipleVariableDeclarations.ts, 35, 3), Decl(validMultipleVariableDeclarations.ts, 36, 3), Decl(validMultipleVariableDeclarations.ts, 37, 3)) - -var a = []; ->a : Symbol(a, Decl(validMultipleVariableDeclarations.ts, 32, 3), Decl(validMultipleVariableDeclarations.ts, 33, 3), Decl(validMultipleVariableDeclarations.ts, 34, 3), Decl(validMultipleVariableDeclarations.ts, 35, 3), Decl(validMultipleVariableDeclarations.ts, 36, 3), Decl(validMultipleVariableDeclarations.ts, 37, 3)) - -var a: string[] = []; ->a : Symbol(a, Decl(validMultipleVariableDeclarations.ts, 32, 3), Decl(validMultipleVariableDeclarations.ts, 33, 3), Decl(validMultipleVariableDeclarations.ts, 34, 3), Decl(validMultipleVariableDeclarations.ts, 35, 3), Decl(validMultipleVariableDeclarations.ts, 36, 3), Decl(validMultipleVariableDeclarations.ts, 37, 3)) - -var a = new Array(); ->a : Symbol(a, Decl(validMultipleVariableDeclarations.ts, 32, 3), Decl(validMultipleVariableDeclarations.ts, 33, 3), Decl(validMultipleVariableDeclarations.ts, 34, 3), Decl(validMultipleVariableDeclarations.ts, 35, 3), Decl(validMultipleVariableDeclarations.ts, 36, 3), Decl(validMultipleVariableDeclarations.ts, 37, 3)) ->Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) - -var a: typeof a; ->a : Symbol(a, Decl(validMultipleVariableDeclarations.ts, 32, 3), Decl(validMultipleVariableDeclarations.ts, 33, 3), Decl(validMultipleVariableDeclarations.ts, 34, 3), Decl(validMultipleVariableDeclarations.ts, 35, 3), Decl(validMultipleVariableDeclarations.ts, 36, 3), Decl(validMultipleVariableDeclarations.ts, 37, 3)) ->a : Symbol(a, Decl(validMultipleVariableDeclarations.ts, 32, 3), Decl(validMultipleVariableDeclarations.ts, 33, 3), Decl(validMultipleVariableDeclarations.ts, 34, 3), Decl(validMultipleVariableDeclarations.ts, 35, 3), Decl(validMultipleVariableDeclarations.ts, 36, 3), Decl(validMultipleVariableDeclarations.ts, 37, 3)) - diff --git a/tests/baselines/reference/validMultipleVariableDeclarations.types b/tests/baselines/reference/validMultipleVariableDeclarations.types deleted file mode 100644 index 966128350b018..0000000000000 --- a/tests/baselines/reference/validMultipleVariableDeclarations.types +++ /dev/null @@ -1,152 +0,0 @@ -=== tests/cases/conformance/statements/VariableStatements/validMultipleVariableDeclarations.ts === -// all expected to be valid - -var x: number; ->x : number - -var x = 2; ->x : number ->2 : number - -if (true) { ->true : boolean - - var x = 3; ->x : number ->3 : number - - for (var x = 0; ;) { } ->x : number ->0 : number -} -var x = undefined; ->x : number ->undefined : number ->undefined : undefined - -// new declaration space, making redeclaring x as a string valid -function declSpace() { ->declSpace : () => void - - var x = 'this is a string'; ->x : string ->'this is a string' : string -} - -interface Point { x: number; y: number; } ->Point : Point ->x : number ->y : number - -var p: Point; ->p : Point ->Point : Point - -var p = { x: 1, y: 2 }; ->p : Point ->{ x: 1, y: 2 } : { x: number; y: number; } ->x : number ->1 : number ->y : number ->2 : number - -var p: Point = { x: 0, y: undefined }; ->p : Point ->Point : Point ->{ x: 0, y: undefined } : { x: number; y: undefined; } ->x : number ->0 : number ->y : undefined ->undefined : undefined - -var p = { x: 1, y: undefined }; ->p : Point ->{ x: 1, y: undefined } : { x: number; y: number; } ->x : number ->1 : number ->y : number ->undefined : number ->undefined : undefined - -var p: { x: number; y: number; } = { x: 1, y: 2 }; ->p : Point ->x : number ->y : number ->{ x: 1, y: 2 } : { x: number; y: number; } ->x : number ->1 : number ->y : number ->2 : number - -var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ->p : Point -><{ x: number; y: number; }>{ x: 0, y: undefined } : { x: number; y: number; } ->x : number ->y : number ->{ x: 0, y: undefined } : { x: number; y: undefined; } ->x : number ->0 : number ->y : undefined ->undefined : undefined - -var p: typeof p; ->p : Point ->p : Point - -var fn = function (s: string) { return 42; } ->fn : (s: string) => number ->function (s: string) { return 42; } : (s: string) => number ->s : string ->42 : number - -var fn = (s: string) => 3; ->fn : (s: string) => number ->(s: string) => 3 : (s: string) => number ->s : string ->3 : number - -var fn: (s: string) => number; ->fn : (s: string) => number ->s : string - -var fn: { (s: string): number }; ->fn : (s: string) => number ->s : string - -var fn = <(s: string) => number> null; ->fn : (s: string) => number -><(s: string) => number> null : (s: string) => number ->s : string ->null : null - -var fn: typeof fn; ->fn : (s: string) => number ->fn : (s: string) => number - -var a: string[]; ->a : string[] - -var a = ['a', 'b'] ->a : string[] ->['a', 'b'] : string[] ->'a' : string ->'b' : string - -var a = []; ->a : string[] ->[] : string[] ->[] : undefined[] - -var a: string[] = []; ->a : string[] ->[] : undefined[] - -var a = new Array(); ->a : string[] ->new Array() : string[] ->Array : ArrayConstructor - -var a: typeof a; ->a : string[] ->a : string[] - diff --git a/tests/baselines/reference/whileBreakStatements.errors.txt b/tests/baselines/reference/whileBreakStatements.errors.txt new file mode 100644 index 0000000000000..7c63dc59d3cb2 --- /dev/null +++ b/tests/baselines/reference/whileBreakStatements.errors.txt @@ -0,0 +1,54 @@ +tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts(11,1): error TS7028: Unused label. +tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts(19,5): error TS7028: Unused label. +tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts(31,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts (3 errors) ==== + while(true) { + break; + } + + ONE: + + while (true) { + break ONE; + } + + TWO: + ~~~ +!!! error TS7028: Unused label. + THREE: + while (true) { + break THREE; + } + + FOUR: + while (true) { + FIVE: + ~~~~ +!!! error TS7028: Unused label. + while (true) { + break FOUR; + } + } + + while (true) { + SIX: + while (true) + break SIX; + } + + SEVEN: + ~~~~~ +!!! error TS7027: Unreachable code detected. + while (true) + while (true) + while (true) + break SEVEN; + + EIGHT: + while (true) { + var fn = function () { } + break EIGHT; + } + \ No newline at end of file diff --git a/tests/baselines/reference/whileBreakStatements.symbols b/tests/baselines/reference/whileBreakStatements.symbols deleted file mode 100644 index 2ac7721621da5..0000000000000 --- a/tests/baselines/reference/whileBreakStatements.symbols +++ /dev/null @@ -1,45 +0,0 @@ -=== tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts === -while(true) { - break; -} - -ONE: - -while (true) { - break ONE; -} - -TWO: -THREE: -while (true) { - break THREE; -} - -FOUR: -while (true) { - FIVE: - while (true) { - break FOUR; - } -} - -while (true) { - SIX: - while (true) - break SIX; -} - -SEVEN: -while (true) - while (true) - while (true) - break SEVEN; - -EIGHT: -while (true) { - var fn = function () { } ->fn : Symbol(fn, Decl(whileBreakStatements.ts, 38, 7)) - - break EIGHT; -} - diff --git a/tests/baselines/reference/whileBreakStatements.types b/tests/baselines/reference/whileBreakStatements.types deleted file mode 100644 index e7ca0a5322fdd..0000000000000 --- a/tests/baselines/reference/whileBreakStatements.types +++ /dev/null @@ -1,89 +0,0 @@ -=== tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts === -while(true) { ->true : boolean - - break; -} - -ONE: ->ONE : any - -while (true) { ->true : boolean - - break ONE; ->ONE : any -} - -TWO: ->TWO : any - -THREE: ->THREE : any - -while (true) { ->true : boolean - - break THREE; ->THREE : any -} - -FOUR: ->FOUR : any - -while (true) { ->true : boolean - - FIVE: ->FIVE : any - - while (true) { ->true : boolean - - break FOUR; ->FOUR : any - } -} - -while (true) { ->true : boolean - - SIX: ->SIX : any - - while (true) ->true : boolean - - break SIX; ->SIX : any -} - -SEVEN: ->SEVEN : any - -while (true) ->true : boolean - - while (true) ->true : boolean - - while (true) ->true : boolean - - break SEVEN; ->SEVEN : any - -EIGHT: ->EIGHT : any - -while (true) { ->true : boolean - - var fn = function () { } ->fn : () => void ->function () { } : () => void - - break EIGHT; ->EIGHT : any -} - diff --git a/tests/baselines/reference/whileContinueStatements.errors.txt b/tests/baselines/reference/whileContinueStatements.errors.txt new file mode 100644 index 0000000000000..c2009b02600ec --- /dev/null +++ b/tests/baselines/reference/whileContinueStatements.errors.txt @@ -0,0 +1,59 @@ +tests/cases/conformance/statements/continueStatements/whileContinueStatements.ts(5,1): error TS7027: Unreachable code detected. + + +==== tests/cases/conformance/statements/continueStatements/whileContinueStatements.ts (1 errors) ==== + while(true) { + continue; + } + + while (true) { + ~~~~~ +!!! error TS7027: Unreachable code detected. + if (true) { + continue; + } + } + + ONE: + + while (true) { + continue ONE; + } + + TWO: + THREE: + while (true) { + continue THREE; + } + + FOUR: + while (true) { + FIVE: + while (true) { + continue FOUR; + } + } + + while (true) { + SIX: + while (true) + continue SIX; + } + + SEVEN: + while (true) + while (true) + while (true) + continue SEVEN; + + EIGHT: + while (true) { + var fn = function () { } + continue EIGHT; + } + + NINE: + while (true) { + if (true) { continue NINE; } + } + \ No newline at end of file diff --git a/tests/baselines/reference/whileContinueStatements.symbols b/tests/baselines/reference/whileContinueStatements.symbols deleted file mode 100644 index 67508556f70cf..0000000000000 --- a/tests/baselines/reference/whileContinueStatements.symbols +++ /dev/null @@ -1,56 +0,0 @@ -=== tests/cases/conformance/statements/continueStatements/whileContinueStatements.ts === -while(true) { - continue; -} - -while (true) { - if (true) { - continue; - } -} - -ONE: - -while (true) { - continue ONE; -} - -TWO: -THREE: -while (true) { - continue THREE; -} - -FOUR: -while (true) { - FIVE: - while (true) { - continue FOUR; - } -} - -while (true) { - SIX: - while (true) - continue SIX; -} - -SEVEN: -while (true) - while (true) - while (true) - continue SEVEN; - -EIGHT: -while (true) { - var fn = function () { } ->fn : Symbol(fn, Decl(whileContinueStatements.ts, 44, 7)) - - continue EIGHT; -} - -NINE: -while (true) { - if (true) { continue NINE; } -} - diff --git a/tests/baselines/reference/whileContinueStatements.types b/tests/baselines/reference/whileContinueStatements.types deleted file mode 100644 index 6bf371cde9edb..0000000000000 --- a/tests/baselines/reference/whileContinueStatements.types +++ /dev/null @@ -1,110 +0,0 @@ -=== tests/cases/conformance/statements/continueStatements/whileContinueStatements.ts === -while(true) { ->true : boolean - - continue; -} - -while (true) { ->true : boolean - - if (true) { ->true : boolean - - continue; - } -} - -ONE: ->ONE : any - -while (true) { ->true : boolean - - continue ONE; ->ONE : any -} - -TWO: ->TWO : any - -THREE: ->THREE : any - -while (true) { ->true : boolean - - continue THREE; ->THREE : any -} - -FOUR: ->FOUR : any - -while (true) { ->true : boolean - - FIVE: ->FIVE : any - - while (true) { ->true : boolean - - continue FOUR; ->FOUR : any - } -} - -while (true) { ->true : boolean - - SIX: ->SIX : any - - while (true) ->true : boolean - - continue SIX; ->SIX : any -} - -SEVEN: ->SEVEN : any - -while (true) ->true : boolean - - while (true) ->true : boolean - - while (true) ->true : boolean - - continue SEVEN; ->SEVEN : any - -EIGHT: ->EIGHT : any - -while (true) { ->true : boolean - - var fn = function () { } ->fn : () => void ->function () { } : () => void - - continue EIGHT; ->EIGHT : any -} - -NINE: ->NINE : any - -while (true) { ->true : boolean - - if (true) { continue NINE; } ->true : boolean ->NINE : any -} - diff --git a/tests/cases/compiler/reachabilityChecks1.ts b/tests/cases/compiler/reachabilityChecks1.ts index ce009e13456c6..6430556a203b7 100644 --- a/tests/cases/compiler/reachabilityChecks1.ts +++ b/tests/cases/compiler/reachabilityChecks1.ts @@ -1,4 +1,4 @@ -// @noUnreachableCode: true +// @allowUnreachableCode: false // @preserveConstEnums: true while (true); diff --git a/tests/cases/compiler/reachabilityChecks2.ts b/tests/cases/compiler/reachabilityChecks2.ts index 9a2b519ca4c3e..5a7a8aaab58e3 100644 --- a/tests/cases/compiler/reachabilityChecks2.ts +++ b/tests/cases/compiler/reachabilityChecks2.ts @@ -1,4 +1,4 @@ -// @noUnreachableCode: true +// @allowUnreachableCode: false // @preserveConstEnums: false while (true) { } diff --git a/tests/cases/compiler/reachabilityChecks3.ts b/tests/cases/compiler/reachabilityChecks3.ts index 362c64e13490b..19f57e55b6738 100644 --- a/tests/cases/compiler/reachabilityChecks3.ts +++ b/tests/cases/compiler/reachabilityChecks3.ts @@ -1,4 +1,4 @@ -// @noUnusedLabels: true +// @allowUnusedLabels: false let x = 1; loop: while (true) { @@ -8,4 +8,9 @@ loop: while (true) { else { x++; } -} \ No newline at end of file +} +{ + x: 100 +} + +var y = () => { f: 1 } \ No newline at end of file diff --git a/tests/cases/compiler/reachabilityChecks5.ts b/tests/cases/compiler/reachabilityChecks5.ts index 24134e238b9ad..97df11ccb79bb 100644 --- a/tests/cases/compiler/reachabilityChecks5.ts +++ b/tests/cases/compiler/reachabilityChecks5.ts @@ -1,4 +1,4 @@ -// @noUnreachableCode: true +// @allowUnreachableCode: false // @noImplicitReturns: true function f0(x): number { diff --git a/tests/cases/fourslash/unclosedFunctionErrorRecovery3.ts b/tests/cases/fourslash/unclosedFunctionErrorRecovery3.ts index bcb79811a6276..7a52ddc2c328a 100644 --- a/tests/cases/fourslash/unclosedFunctionErrorRecovery3.ts +++ b/tests/cases/fourslash/unclosedFunctionErrorRecovery3.ts @@ -1,4 +1,5 @@ /// +// @allowUnreachableCode: true //// class alpha { static beta() return 5; } } //// /**/ var gamma = alpha.beta() * 5; diff --git a/tests/webTestServer.ts b/tests/webTestServer.ts index 6d3144eeaec52..aba6dd8198282 100644 --- a/tests/webTestServer.ts +++ b/tests/webTestServer.ts @@ -191,7 +191,6 @@ function getRequestOperation(req: http.ServerRequest, filename: string) { } return RequestType.Unknown } - return RequestType.Unknown } function handleRequestOperation(req: http.ServerRequest, res: http.ServerResponse, operation: RequestType, reqPath: string) { From 17716fb54015a0672af3b4c0b897d35b1471ee6d Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 13 Oct 2015 09:06:58 -0700 Subject: [PATCH 06/11] accepted baselines --- .../compoundExponentiationAssignmentLHSIsValue.errors.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt index bee6f75ff5cbe..23720468bb7d5 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt @@ -13,6 +13,7 @@ tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignm tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(38,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(39,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(40,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(43,3): error TS7028: Unused label. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(43,10): error TS1128: Declaration or statement expected. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(46,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(52,15): error TS1034: 'super' must be followed by an argument list or member access. @@ -37,7 +38,7 @@ tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignm tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(85,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -==== tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts (37 errors) ==== +==== tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts (38 errors) ==== // expected error for all the LHS of compound assignments (arithmetic and addition) var value; @@ -111,6 +112,8 @@ tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignm // object literals { a: 0 } **= value; + ~ +!!! error TS7028: Unused label. ~~~ !!! error TS1128: Declaration or statement expected. From bc02341e9932411e01b36134f611d511f00d1cc8 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 13 Oct 2015 10:15:39 -0700 Subject: [PATCH 07/11] addressed PR feedback, updated tests to suppress reachability errors where they are not needed --- src/compiler/binder.ts | 103 +- src/compiler/types.ts | 4 +- .../bestCommonTypeReturnStatement.errors.txt | 18 - .../bestCommonTypeReturnStatement.js | 1 + .../bestCommonTypeReturnStatement.symbols | 35 + .../bestCommonTypeReturnStatement.types | 40 + .../reference/breakTarget3.errors.txt | 11 - tests/baselines/reference/breakTarget3.js | 1 + .../baselines/reference/breakTarget3.symbols | 8 + tests/baselines/reference/breakTarget3.types | 14 + .../reference/breakTarget4.errors.txt | 11 - tests/baselines/reference/breakTarget4.js | 1 + .../baselines/reference/breakTarget4.symbols | 8 + tests/baselines/reference/breakTarget4.types | 14 + .../reference/breakTarget5.errors.txt | 8 +- tests/baselines/reference/breakTarget5.js | 1 + ...utReturnTypeAnnotationInference.errors.txt | 126 - ...ureWithoutReturnTypeAnnotationInference.js | 1 + ...thoutReturnTypeAnnotationInference.symbols | 256 ++ ...WithoutReturnTypeAnnotationInference.types | 297 ++ .../reference/commentEmitAtEndOfFile1.js | 1 + .../reference/commentEmitAtEndOfFile1.symbols | 9 +- .../reference/commentEmitAtEndOfFile1.types | 1 + .../compoundAssignmentLHSIsValue.errors.txt | 122 +- .../reference/compoundAssignmentLHSIsValue.js | 1 + .../conditionalExpressions2.errors.txt | 15 - .../reference/conditionalExpressions2.js | 1 + .../reference/conditionalExpressions2.symbols | 34 + .../reference/conditionalExpressions2.types | 69 + ...nstDeclarations-invalidContexts.errors.txt | 8 +- ...constDeclarations-validContexts.errors.txt | 8 +- ...torWithIncompleteTypeAnnotation.errors.txt | 171 +- ...constructorWithIncompleteTypeAnnotation.js | 1 + ...ontinueNotInIterationStatement4.errors.txt | 8 +- .../continueNotInIterationStatement4.js | 1 + .../reference/continueTarget3.errors.txt | 11 - tests/baselines/reference/continueTarget3.js | 1 + .../reference/continueTarget3.symbols | 8 + .../baselines/reference/continueTarget3.types | 14 + .../reference/continueTarget4.errors.txt | 11 - tests/baselines/reference/continueTarget4.js | 1 + .../reference/continueTarget4.symbols | 8 + .../baselines/reference/continueTarget4.types | 14 + .../reference/continueTarget5.errors.txt | 8 +- tests/baselines/reference/continueTarget5.js | 1 + .../doWhileBreakStatements.errors.txt | 50 - .../reference/doWhileBreakStatements.js | 1 + .../reference/doWhileBreakStatements.symbols | 42 + .../reference/doWhileBreakStatements.types | 81 + .../doWhileContinueStatements.errors.txt | 44 - .../reference/doWhileContinueStatements.js | 1 + .../doWhileContinueStatements.symbols | 42 + .../reference/doWhileContinueStatements.types | 81 + .../reference/downlevelLetConst16.errors.txt | 21 +- .../reference/downlevelLetConst16.js | 1 + .../reference/downlevelLetConst17.errors.txt | 73 - .../reference/downlevelLetConst17.symbols | 134 + .../reference/downlevelLetConst17.types | 169 + .../reference/downlevelLetConst18.errors.txt | 24 +- .../reference/downlevelLetConst18.js | 1 + .../reference/duplicateLabel1.errors.txt | 8 +- tests/baselines/reference/duplicateLabel1.js | 1 + .../reference/duplicateLabel2.errors.txt | 8 +- tests/baselines/reference/duplicateLabel2.js | 1 + .../reference/duplicateLabel3.errors.txt | 17 - tests/baselines/reference/duplicateLabel3.js | 1 + .../reference/duplicateLabel3.symbols | 12 + .../baselines/reference/duplicateLabel3.types | 19 + .../reference/duplicateLabel4.errors.txt | 16 - tests/baselines/reference/duplicateLabel4.js | 1 + .../reference/duplicateLabel4.symbols | 10 + .../baselines/reference/duplicateLabel4.types | 15 + .../duplicateLocalVariable1.errors.txt | 24 +- .../reference/duplicateLocalVariable1.js | 6 +- .../duplicateVariablesByScope.errors.txt | 37 - .../reference/duplicateVariablesByScope.js | 1 + .../duplicateVariablesByScope.symbols | 57 + .../reference/duplicateVariablesByScope.types | 73 + .../es6ClassSuperCodegenBug.errors.txt | 19 - .../reference/es6ClassSuperCodegenBug.js | 1 + .../reference/es6ClassSuperCodegenBug.symbols | 25 + .../reference/es6ClassSuperCodegenBug.types | 33 + .../reference/escapedIdentifiers.errors.txt | 146 - .../baselines/reference/escapedIdentifiers.js | 1 + .../reference/escapedIdentifiers.symbols | 261 ++ .../reference/escapedIdentifiers.types | 352 ++ tests/baselines/reference/for.errors.txt | 8 +- tests/baselines/reference/for.js | 1 + .../reference/forBreakStatements.errors.txt | 49 - .../baselines/reference/forBreakStatements.js | 1 + .../reference/forBreakStatements.symbols | 41 + .../reference/forBreakStatements.types | 64 + .../forContinueStatements.errors.txt | 43 - .../reference/forContinueStatements.js | 1 + .../reference/forContinueStatements.symbols | 41 + .../reference/forContinueStatements.types | 64 + .../reference/forInBreakStatements.errors.txt | 46 - .../reference/forInBreakStatements.js | 1 + .../reference/forInBreakStatements.symbols | 59 + .../reference/forInBreakStatements.types | 93 + .../forInContinueStatements.errors.txt | 46 - .../reference/forInContinueStatements.js | 1 + .../reference/forInContinueStatements.symbols | 59 + .../reference/forInContinueStatements.types | 93 + .../reference/forStatements.errors.txt | 52 - tests/baselines/reference/forStatements.js | 1 + .../baselines/reference/forStatements.symbols | 146 + tests/baselines/reference/forStatements.types | 165 + ...orStatementsMultipleInvalidDecl.errors.txt | 30 +- .../forStatementsMultipleInvalidDecl.js | 1 + .../forStatementsMultipleValidDecl.errors.txt | 39 - .../forStatementsMultipleValidDecl.js | 1 + .../forStatementsMultipleValidDecl.symbols | 111 + .../forStatementsMultipleValidDecl.types | 141 + .../functionImplementationErrors.errors.txt | 62 +- .../reference/functionImplementationErrors.js | 1 + .../functionImplementations.errors.txt | 183 - .../reference/functionImplementations.js | 1 + .../reference/functionImplementations.symbols | 345 ++ .../reference/functionImplementations.types | 417 ++ .../reference/functionOverloads12.errors.txt | 10 - .../reference/functionOverloads12.js | 1 + .../reference/functionOverloads12.symbols | 11 + .../reference/functionOverloads12.types | 14 + .../reference/functionReturn.errors.txt | 23 - tests/baselines/reference/functionReturn.js | 1 + .../reference/functionReturn.symbols | 31 + .../baselines/reference/functionReturn.types | 36 + ...ionWithMultipleReturnStatements.errors.txt | 36 +- .../functionWithMultipleReturnStatements.js | 1 + ...onWithMultipleReturnStatements2.errors.txt | 31 +- .../functionWithMultipleReturnStatements2.js | 1 + .../functionWithNoBestCommonType1.errors.txt | 8 +- .../functionWithNoBestCommonType1.js | 1 + .../functionWithNoBestCommonType2.errors.txt | 8 +- .../functionWithNoBestCommonType2.js | 1 + ...gReturnStatementsAndExpressions.errors.txt | 18 +- ...nsMissingReturnStatementsAndExpressions.js | 1 + .../generatedContextualTyping.errors.txt | 393 -- .../reference/generatedContextualTyping.js | 1 + .../generatedContextualTyping.symbols | 2832 +++++++++++++ .../reference/generatedContextualTyping.types | 3769 +++++++++++++++++ .../reference/ifDoWhileStatements.errors.txt | 168 - .../reference/ifDoWhileStatements.js | 1 + .../reference/ifDoWhileStatements.symbols | 337 ++ .../reference/ifDoWhileStatements.types | 434 ++ .../ifElseWithStatements1.errors.txt | 13 +- .../reference/ifElseWithStatements1.js | 1 + ...edFunctionReturnTypeIsEmptyType.errors.txt | 8 +- .../inferredFunctionReturnTypeIsEmptyType.js | 1 + ...taticPropertyOverridingAccessor.errors.txt | 10 +- ...ritanceStaticPropertyOverridingAccessor.js | 1 + .../interfaceExtendingClass2.errors.txt | 14 +- .../reference/interfaceExtendingClass2.js | 1 + .../interfaceWithPrivateMember.errors.txt | 16 +- .../reference/interfaceWithPrivateMember.js | 1 + .../invalidDoWhileBreakStatements.errors.txt | 21 +- .../invalidDoWhileBreakStatements.js | 1 + ...nvalidDoWhileContinueStatements.errors.txt | 21 +- .../invalidDoWhileContinueStatements.js | 1 + .../invalidForBreakStatements.errors.txt | 21 +- .../reference/invalidForBreakStatements.js | 1 + .../invalidForContinueStatements.errors.txt | 21 +- .../reference/invalidForContinueStatements.js | 1 + .../invalidForInBreakStatements.errors.txt | 30 +- .../reference/invalidForInBreakStatements.js | 1 + .../invalidForInContinueStatements.errors.txt | 30 +- .../invalidForInContinueStatements.js | 1 + .../invalidThrowStatement.errors.txt | 10 +- .../reference/invalidThrowStatement.js | 1 + .../invalidWhileContinueStatements.errors.txt | 21 +- .../invalidWhileContinueStatements.js | 1 + .../letAndVarRedeclaration.errors.txt | 42 +- .../reference/letAndVarRedeclaration.js | 1 + ...letDeclarations-invalidContexts.errors.txt | 27 +- .../letDeclarations-invalidContexts.js | 1 + .../letDeclarations-scopes.errors.txt | 14 +- .../reference/letDeclarations-scopes.js | 1 + .../letDeclarations-validContexts.errors.txt | 23 +- .../letDeclarations-validContexts.js | 1 + .../reference/localTypes4.errors.txt | 14 +- tests/baselines/reference/localTypes4.js | 1 + tests/baselines/reference/null.errors.txt | 30 - tests/baselines/reference/null.js | 1 + tests/baselines/reference/null.symbols | 45 + tests/baselines/reference/null.types | 60 + ...overloadOnConstAsTypeAnnotation.errors.txt | 12 +- .../overloadOnConstAsTypeAnnotation.js | 1 + .../reference/parser10.1.1-8gs.errors.txt | 10 +- tests/baselines/reference/parser10.1.1-8gs.js | 1 + .../reference/parser768531.errors.txt | 8 - tests/baselines/reference/parser768531.js | 1 + .../baselines/reference/parser768531.symbols | 5 + tests/baselines/reference/parser768531.types | 9 + .../reference/whileBreakStatements.errors.txt | 54 - .../reference/whileBreakStatements.js | 1 + .../reference/whileBreakStatements.symbols | 46 + .../reference/whileBreakStatements.types | 90 + .../compiler/bestCommonTypeReturnStatement.ts | 2 + tests/cases/compiler/breakTarget3.ts | 2 + tests/cases/compiler/breakTarget4.ts | 2 + tests/cases/compiler/breakTarget5.ts | 2 + .../cases/compiler/commentEmitAtEndOfFile1.ts | 2 + .../cases/compiler/conditionalExpressions2.ts | 2 + .../constDeclarations-invalidContexts.ts | 1 + .../constDeclarations-validContexts.ts | 1 + ...constructorWithIncompleteTypeAnnotation.ts | 2 + .../continueNotInIterationStatement4.ts | 2 + tests/cases/compiler/continueTarget3.ts | 2 + tests/cases/compiler/continueTarget4.ts | 2 + tests/cases/compiler/continueTarget5.ts | 2 + tests/cases/compiler/downlevelLetConst16.ts | 2 + tests/cases/compiler/downlevelLetConst17.ts | 1 + tests/cases/compiler/downlevelLetConst18.ts | 2 + tests/cases/compiler/duplicateLabel1.ts | 2 + tests/cases/compiler/duplicateLabel2.ts | 2 + tests/cases/compiler/duplicateLabel3.ts | 2 + tests/cases/compiler/duplicateLabel4.ts | 3 + .../cases/compiler/duplicateLocalVariable1.ts | 4 +- .../compiler/duplicateVariablesByScope.ts | 2 + .../cases/compiler/es6ClassSuperCodegenBug.ts | 2 + tests/cases/compiler/escapedIdentifiers.ts | 3 + tests/cases/compiler/for.ts | 2 + tests/cases/compiler/functionOverloads12.ts | 2 + tests/cases/compiler/functionReturn.ts | 2 + .../compiler/functionWithNoBestCommonType1.ts | 2 + .../compiler/functionWithNoBestCommonType2.ts | 2 + ...nsMissingReturnStatementsAndExpressions.ts | 2 + tests/cases/compiler/ifElseWithStatements1.ts | 2 + .../inferredFunctionReturnTypeIsEmptyType.ts | 2 + ...ritanceStaticPropertyOverridingAccessor.ts | 2 + .../cases/compiler/letAndVarRedeclaration.ts | 2 + .../letDeclarations-invalidContexts.ts | 2 + .../cases/compiler/letDeclarations-scopes.ts | 3 + .../compiler/letDeclarations-validContexts.ts | 3 + tests/cases/compiler/null.ts | 2 + .../overloadOnConstAsTypeAnnotation.ts | 2 + .../compoundAssignmentLHSIsValue.ts | 2 + .../generatedContextualTyping.ts | 2 + .../functions/functionImplementationErrors.ts | 2 + .../functions/functionImplementations.ts | 2 + .../interfaceExtendingClass2.ts | 2 + .../parser/ecmascript5/Fuzz/parser768531.ts | 2 + .../parser/ecmascript5/parser10.1.1-8gs.ts | 2 + .../breakStatements/doWhileBreakStatements.ts | 3 + .../breakStatements/forBreakStatements.ts | 3 + .../breakStatements/forInBreakStatements.ts | 2 + .../invalidDoWhileBreakStatements.ts | 3 + .../invalidForBreakStatements.ts | 3 + .../invalidForInBreakStatements.ts | 3 + .../breakStatements/whileBreakStatements.ts | 3 + .../doWhileContinueStatements.ts | 2 + .../forContinueStatements.ts | 2 + .../forInContinueStatements.ts | 2 + .../invalidDoWhileContinueStatements.ts | 3 + .../invalidForContinueStatements.ts | 3 + .../invalidForInContinueStatements.ts | 3 + .../invalidWhileContinueStatements.ts | 3 + .../statements/forStatements/forStatements.ts | 2 + .../forStatementsMultipleInvalidDecl.ts | 2 + .../forStatementsMultipleValidDecl.ts | 2 + .../ifDoWhileStatements.ts | 2 + .../throwStatements/invalidThrowStatement.ts | 2 + .../types/localTypes/localTypes4.ts | 2 + .../namedTypes/interfaceWithPrivateMember.ts | 2 + ...ureWithoutReturnTypeAnnotationInference.ts | 2 + .../functionWithMultipleReturnStatements.ts | 2 + .../functionWithMultipleReturnStatements2.ts | 2 + 268 files changed, 12446 insertions(+), 2425 deletions(-) delete mode 100644 tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt create mode 100644 tests/baselines/reference/bestCommonTypeReturnStatement.symbols create mode 100644 tests/baselines/reference/bestCommonTypeReturnStatement.types delete mode 100644 tests/baselines/reference/breakTarget3.errors.txt create mode 100644 tests/baselines/reference/breakTarget3.symbols create mode 100644 tests/baselines/reference/breakTarget3.types delete mode 100644 tests/baselines/reference/breakTarget4.errors.txt create mode 100644 tests/baselines/reference/breakTarget4.symbols create mode 100644 tests/baselines/reference/breakTarget4.types delete mode 100644 tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt create mode 100644 tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols create mode 100644 tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types delete mode 100644 tests/baselines/reference/conditionalExpressions2.errors.txt create mode 100644 tests/baselines/reference/conditionalExpressions2.symbols create mode 100644 tests/baselines/reference/conditionalExpressions2.types delete mode 100644 tests/baselines/reference/continueTarget3.errors.txt create mode 100644 tests/baselines/reference/continueTarget3.symbols create mode 100644 tests/baselines/reference/continueTarget3.types delete mode 100644 tests/baselines/reference/continueTarget4.errors.txt create mode 100644 tests/baselines/reference/continueTarget4.symbols create mode 100644 tests/baselines/reference/continueTarget4.types delete mode 100644 tests/baselines/reference/doWhileBreakStatements.errors.txt create mode 100644 tests/baselines/reference/doWhileBreakStatements.symbols create mode 100644 tests/baselines/reference/doWhileBreakStatements.types delete mode 100644 tests/baselines/reference/doWhileContinueStatements.errors.txt create mode 100644 tests/baselines/reference/doWhileContinueStatements.symbols create mode 100644 tests/baselines/reference/doWhileContinueStatements.types delete mode 100644 tests/baselines/reference/downlevelLetConst17.errors.txt create mode 100644 tests/baselines/reference/downlevelLetConst17.symbols create mode 100644 tests/baselines/reference/downlevelLetConst17.types delete mode 100644 tests/baselines/reference/duplicateLabel3.errors.txt create mode 100644 tests/baselines/reference/duplicateLabel3.symbols create mode 100644 tests/baselines/reference/duplicateLabel3.types delete mode 100644 tests/baselines/reference/duplicateLabel4.errors.txt create mode 100644 tests/baselines/reference/duplicateLabel4.symbols create mode 100644 tests/baselines/reference/duplicateLabel4.types delete mode 100644 tests/baselines/reference/duplicateVariablesByScope.errors.txt create mode 100644 tests/baselines/reference/duplicateVariablesByScope.symbols create mode 100644 tests/baselines/reference/duplicateVariablesByScope.types delete mode 100644 tests/baselines/reference/es6ClassSuperCodegenBug.errors.txt create mode 100644 tests/baselines/reference/es6ClassSuperCodegenBug.symbols create mode 100644 tests/baselines/reference/es6ClassSuperCodegenBug.types delete mode 100644 tests/baselines/reference/escapedIdentifiers.errors.txt create mode 100644 tests/baselines/reference/escapedIdentifiers.symbols create mode 100644 tests/baselines/reference/escapedIdentifiers.types delete mode 100644 tests/baselines/reference/forBreakStatements.errors.txt create mode 100644 tests/baselines/reference/forBreakStatements.symbols create mode 100644 tests/baselines/reference/forBreakStatements.types delete mode 100644 tests/baselines/reference/forContinueStatements.errors.txt create mode 100644 tests/baselines/reference/forContinueStatements.symbols create mode 100644 tests/baselines/reference/forContinueStatements.types delete mode 100644 tests/baselines/reference/forInBreakStatements.errors.txt create mode 100644 tests/baselines/reference/forInBreakStatements.symbols create mode 100644 tests/baselines/reference/forInBreakStatements.types delete mode 100644 tests/baselines/reference/forInContinueStatements.errors.txt create mode 100644 tests/baselines/reference/forInContinueStatements.symbols create mode 100644 tests/baselines/reference/forInContinueStatements.types delete mode 100644 tests/baselines/reference/forStatements.errors.txt create mode 100644 tests/baselines/reference/forStatements.symbols create mode 100644 tests/baselines/reference/forStatements.types delete mode 100644 tests/baselines/reference/forStatementsMultipleValidDecl.errors.txt create mode 100644 tests/baselines/reference/forStatementsMultipleValidDecl.symbols create mode 100644 tests/baselines/reference/forStatementsMultipleValidDecl.types delete mode 100644 tests/baselines/reference/functionImplementations.errors.txt create mode 100644 tests/baselines/reference/functionImplementations.symbols create mode 100644 tests/baselines/reference/functionImplementations.types delete mode 100644 tests/baselines/reference/functionOverloads12.errors.txt create mode 100644 tests/baselines/reference/functionOverloads12.symbols create mode 100644 tests/baselines/reference/functionOverloads12.types delete mode 100644 tests/baselines/reference/functionReturn.errors.txt create mode 100644 tests/baselines/reference/functionReturn.symbols create mode 100644 tests/baselines/reference/functionReturn.types delete mode 100644 tests/baselines/reference/generatedContextualTyping.errors.txt create mode 100644 tests/baselines/reference/generatedContextualTyping.symbols create mode 100644 tests/baselines/reference/generatedContextualTyping.types delete mode 100644 tests/baselines/reference/ifDoWhileStatements.errors.txt create mode 100644 tests/baselines/reference/ifDoWhileStatements.symbols create mode 100644 tests/baselines/reference/ifDoWhileStatements.types delete mode 100644 tests/baselines/reference/null.errors.txt create mode 100644 tests/baselines/reference/null.symbols create mode 100644 tests/baselines/reference/null.types delete mode 100644 tests/baselines/reference/parser768531.errors.txt create mode 100644 tests/baselines/reference/parser768531.symbols create mode 100644 tests/baselines/reference/parser768531.types delete mode 100644 tests/baselines/reference/whileBreakStatements.errors.txt create mode 100644 tests/baselines/reference/whileBreakStatements.symbols create mode 100644 tests/baselines/reference/whileBreakStatements.types diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index a520e3cd58a02..8e764947ee8bc 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -374,10 +374,6 @@ namespace ts { blockScopeContainer = savedBlockScopeContainer; } - function shouldSaveReachabilityState(n: Node): boolean { - return n.kind === SyntaxKind.SourceFile || n.kind === SyntaxKind.ModuleBlock || isFunctionLike(n); - } - function bindWithReachabilityChecks(node: Node): void { let savedReachabilityState: Reachability; let savedLabelStack: Reachability[]; @@ -385,7 +381,10 @@ namespace ts { let savedImplicitLabels: number[]; let savedHasExplicitReturn: boolean; - let saveState = shouldSaveReachabilityState(node); + // reset all reachability check related flags on node (for incremental scenarios) + node.flags &= ~NodeFlags.ReachabilityCheckFlags; + + let saveState = node.kind === SyntaxKind.SourceFile || node.kind === SyntaxKind.ModuleBlock || isFunctionLike(node); if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; @@ -398,9 +397,7 @@ namespace ts { labelStack = labelIndexMap = implicitLabels = undefined; } - if (!bindReachableStatement(node)) { - forEachChild(node, bind); - } + bindReachableStatement(node); if (currentReachabilityState === Reachability.Reachable && isFunctionLike(node) && nodeIsPresent((node).body)) { node.flags |= NodeFlags.HasImplicitReturn; @@ -422,43 +419,56 @@ namespace ts { * Returns true if node and its subnodes were successfully traversed. * Returning false means that node was not examined and caller needs to dive into the node himself. */ - function bindReachableStatement(node: Node): boolean { + function bindReachableStatement(node: Node): void { if (checkUnreachable(node)) { - return false; + forEachChild(node, bind); + return; } switch (node.kind) { case SyntaxKind.WhileStatement: - return bindWhileStatement(node); + bindWhileStatement(node); + break; case SyntaxKind.DoStatement: - return bindDoStatement(node); + bindDoStatement(node); + break; case SyntaxKind.ForStatement: - return bindForStatement(node); + bindForStatement(node); + break; case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement: - return bindForInOrForOfStatement(node); + bindForInOrForOfStatement(node); + break; case SyntaxKind.IfStatement: - return bindIfStatement(node); + bindIfStatement(node); + break; case SyntaxKind.ReturnStatement: case SyntaxKind.ThrowStatement: - return bindReturnOrThrow(node); + bindReturnOrThrow(node); + break; case SyntaxKind.BreakStatement: case SyntaxKind.ContinueStatement: - return bindBreakOrContinueStatement(node); + bindBreakOrContinueStatement(node); + break; case SyntaxKind.TryStatement: - return bindTryStatement(node); + bindTryStatement(node); + break; case SyntaxKind.SwitchStatement: - return bindSwitchStatement(node); + bindSwitchStatement(node); + break; case SyntaxKind.CaseBlock: - return bindCaseBlock(node); + bindCaseBlock(node); + break; case SyntaxKind.LabeledStatement: - return bindLabeledStatement(node); + bindLabeledStatement(node); + break; default: - return false; + forEachChild(node, bind); + break; } } - function bindWhileStatement(n: WhileStatement): boolean { + function bindWhileStatement(n: WhileStatement): void { const preWhileState = n.expression.kind === SyntaxKind.FalseKeyword ? Reachability.Unreachable : currentReachabilityState; const postWhileState = @@ -471,11 +481,9 @@ namespace ts { const postWhileLabel = pushImplicitLabel(); bind(n.statement); popImplicitLabel(postWhileLabel, postWhileState); - - return true; } - function bindDoStatement(n: DoStatement): boolean { + function bindDoStatement(n: DoStatement): void { const preDoState = currentReachabilityState; const postDoLabel = pushImplicitLabel(); @@ -485,11 +493,9 @@ namespace ts { // bind expressions (don't affect reachability) bind(n.expression); - - return true; } - function bindForStatement(n: ForStatement): boolean { + function bindForStatement(n: ForStatement): void { const preForState = currentReachabilityState; const postForLabel = pushImplicitLabel(); @@ -506,11 +512,9 @@ namespace ts { const isInfiniteLoop = (!n.condition || n.condition.kind === SyntaxKind.TrueKeyword); const postForState = isInfiniteLoop ? Reachability.Unreachable : preForState; popImplicitLabel(postForLabel, postForState); - - return true; } - function bindForInOrForOfStatement(n: ForInStatement | ForOfStatement): boolean { + function bindForInOrForOfStatement(n: ForInStatement | ForOfStatement): void { const preStatementState = currentReachabilityState; const postStatementLabel = pushImplicitLabel(); @@ -520,11 +524,9 @@ namespace ts { bind(n.statement); popImplicitLabel(postStatementLabel, preStatementState); - - return true; } - function bindIfStatement(n: IfStatement): boolean { + function bindIfStatement(n: IfStatement): void { // denotes reachability state when entering 'thenStatement' part of the if statement: // i.e. if condition is false then thenStatement is unreachable const ifTrueState = n.expression.kind === SyntaxKind.FalseKeyword ? Reachability.Unreachable : currentReachabilityState; @@ -547,22 +549,18 @@ namespace ts { else { currentReachabilityState = or(currentReachabilityState, ifFalseState); } - - return true; } - function bindReturnOrThrow(n: ReturnStatement | ThrowStatement): boolean { + function bindReturnOrThrow(n: ReturnStatement | ThrowStatement): void { // bind expression (don't affect reachability) bind(n.expression); if (n.kind === SyntaxKind.ReturnStatement) { hasExplicitReturn = true; } currentReachabilityState = Reachability.Unreachable; - - return true; } - function bindBreakOrContinueStatement(n: BreakOrContinueStatement): boolean { + function bindBreakOrContinueStatement(n: BreakOrContinueStatement): void { // call bind on label (don't affect reachability) bind(n.label); // for continue case touch label so it will be marked a used @@ -570,10 +568,9 @@ namespace ts { if (isValidJump) { currentReachabilityState = Reachability.Unreachable; } - return true; } - function bindTryStatement(n: TryStatement): boolean { + function bindTryStatement(n: TryStatement): void { // catch\finally blocks has the same reachability as try block const preTryState = currentReachabilityState; bind(n.tryBlock); @@ -590,11 +587,9 @@ namespace ts { // - post try state is reachable - control flow can fall out of try block // - post catch state is reachable - control flow can fall out of catch block currentReachabilityState = or(postTryState, postCatchState); - - return true; } - function bindSwitchStatement(n: SwitchStatement): boolean { + function bindSwitchStatement(n: SwitchStatement): void { const preSwitchState = currentReachabilityState; const postSwitchLabel = pushImplicitLabel(); @@ -609,11 +604,9 @@ namespace ts { const postSwitchState = hasDefault && currentReachabilityState !== Reachability.Reachable ? Reachability.Unreachable : preSwitchState; popImplicitLabel(postSwitchLabel, postSwitchState); - - return true; } - function bindCaseBlock(n: CaseBlock): boolean { + function bindCaseBlock(n: CaseBlock): void { const startState = currentReachabilityState; for (let clause of n.clauses) { @@ -623,11 +616,9 @@ namespace ts { errorOnFirstToken(clause, Diagnostics.Fallthrough_case_in_switch); } } - - return true; } - function bindLabeledStatement(n: LabeledStatement): boolean { + function bindLabeledStatement(n: LabeledStatement): void { // call bind on label (don't affect reachability) bind(n.label); @@ -636,8 +627,6 @@ namespace ts { if (ok) { popNamedLabel(n.label, currentReachabilityState); } - - return true; } function getContainerFlags(node: Node): ContainerFlags { @@ -1387,8 +1376,6 @@ namespace ts { } function popNamedLabel(label: Identifier, outerState: Reachability): void { - initializeReachabilityStateIfNecessary(); - let index = labelIndexMap[label.text]; Debug.assert(index !== undefined); Debug.assert(labelStack.length == index + 1); @@ -1399,8 +1386,6 @@ namespace ts { } function popImplicitLabel(implicitLabelIndex: number, outerState: Reachability): void { - initializeReachabilityStateIfNecessary(); - Debug.assert(labelStack.length === implicitLabelIndex + 1, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`); let i = implicitLabels.pop(); Debug.assert(implicitLabelIndex === i, `i: ${i}, index: ${implicitLabelIndex}`); @@ -1408,8 +1393,6 @@ namespace ts { } function setCurrentStateAtLabel(innerMergedState: Reachability, outerState: Reachability, label: Identifier): void { - initializeReachabilityStateIfNecessary(); - if (innerMergedState === Reachability.Unintialized) { if (label && !options.allowUnusedLabels) { file.bindDiagnostics.push(createDiagnosticForNode(label, Diagnostics.Unused_label)); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c3afe56a2e93b..fef3f071125f7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -384,7 +384,9 @@ namespace ts { Modifier = Export | Ambient | Public | Private | Protected | Static | Abstract | Default | Async, AccessibilityModifier = Public | Private | Protected, - BlockScoped = Let | Const + BlockScoped = Let | Const, + + ReachabilityCheckFlags = HasImplicitReturn | HasExplicitReturn } /* @internal */ diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt b/tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt deleted file mode 100644 index af83d53a72273..0000000000000 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt +++ /dev/null @@ -1,18 +0,0 @@ -tests/cases/compiler/bestCommonTypeReturnStatement.ts(7,5): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/bestCommonTypeReturnStatement.ts (1 errors) ==== - interface IPromise { - then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; - } - - function f() { - if (true) return b(); - return d(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } - - - function b(): IPromise { return null; } - function d(): IPromise { return null; } \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.js b/tests/baselines/reference/bestCommonTypeReturnStatement.js index f4ab98ed1c68a..6d6f73bc0cfd6 100644 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.js +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.js @@ -1,4 +1,5 @@ //// [bestCommonTypeReturnStatement.ts] + interface IPromise { then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; } diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.symbols b/tests/baselines/reference/bestCommonTypeReturnStatement.symbols new file mode 100644 index 0000000000000..14e770ae2554b --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/bestCommonTypeReturnStatement.ts === + +interface IPromise { +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) +>T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 1, 19)) + + then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; +>then : Symbol(then, Decl(bestCommonTypeReturnStatement.ts, 1, 23)) +>successCallback : Symbol(successCallback, Decl(bestCommonTypeReturnStatement.ts, 2, 9)) +>promiseValue : Symbol(promiseValue, Decl(bestCommonTypeReturnStatement.ts, 2, 27)) +>T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 1, 19)) +>errorCallback : Symbol(errorCallback, Decl(bestCommonTypeReturnStatement.ts, 2, 51)) +>reason : Symbol(reason, Decl(bestCommonTypeReturnStatement.ts, 2, 69)) +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) +} + +function f() { +>f : Symbol(f, Decl(bestCommonTypeReturnStatement.ts, 3, 1)) + + if (true) return b(); +>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 8, 1)) + + return d(); +>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 11, 45)) +} + + +function b(): IPromise { return null; } +>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 8, 1)) +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) + +function d(): IPromise { return null; } +>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 11, 45)) +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) + diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.types b/tests/baselines/reference/bestCommonTypeReturnStatement.types new file mode 100644 index 0000000000000..31f72ab93b4da --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.types @@ -0,0 +1,40 @@ +=== tests/cases/compiler/bestCommonTypeReturnStatement.ts === + +interface IPromise { +>IPromise : IPromise +>T : T + + then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; +>then : (successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any) => IPromise +>successCallback : (promiseValue: T) => any +>promiseValue : T +>T : T +>errorCallback : (reason: any) => any +>reason : any +>IPromise : IPromise +} + +function f() { +>f : () => IPromise + + if (true) return b(); +>true : boolean +>b() : IPromise +>b : () => IPromise + + return d(); +>d() : IPromise +>d : () => IPromise +} + + +function b(): IPromise { return null; } +>b : () => IPromise +>IPromise : IPromise +>null : null + +function d(): IPromise { return null; } +>d : () => IPromise +>IPromise : IPromise +>null : null + diff --git a/tests/baselines/reference/breakTarget3.errors.txt b/tests/baselines/reference/breakTarget3.errors.txt deleted file mode 100644 index aff8887c15e73..0000000000000 --- a/tests/baselines/reference/breakTarget3.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/compiler/breakTarget3.ts(2,1): error TS7028: Unused label. - - -==== tests/cases/compiler/breakTarget3.ts (1 errors) ==== - target1: - target2: - ~~~~~~~ -!!! error TS7028: Unused label. - while (true) { - break target1; - } \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget3.js b/tests/baselines/reference/breakTarget3.js index 0fa6cd2d2988a..b36eeb3902b75 100644 --- a/tests/baselines/reference/breakTarget3.js +++ b/tests/baselines/reference/breakTarget3.js @@ -1,4 +1,5 @@ //// [breakTarget3.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/breakTarget3.symbols b/tests/baselines/reference/breakTarget3.symbols new file mode 100644 index 0000000000000..a0b1743550481 --- /dev/null +++ b/tests/baselines/reference/breakTarget3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/breakTarget3.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget3.types b/tests/baselines/reference/breakTarget3.types new file mode 100644 index 0000000000000..e4b5f8a1c6110 --- /dev/null +++ b/tests/baselines/reference/breakTarget3.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/breakTarget3.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + break target1; +>target1 : any +} diff --git a/tests/baselines/reference/breakTarget4.errors.txt b/tests/baselines/reference/breakTarget4.errors.txt deleted file mode 100644 index d1283de2fa069..0000000000000 --- a/tests/baselines/reference/breakTarget4.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/compiler/breakTarget4.ts(1,1): error TS7028: Unused label. - - -==== tests/cases/compiler/breakTarget4.ts (1 errors) ==== - target1: - ~~~~~~~ -!!! error TS7028: Unused label. - target2: - while (true) { - break target2; - } \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget4.js b/tests/baselines/reference/breakTarget4.js index 4586301d71b7c..0c91e44ecbdf9 100644 --- a/tests/baselines/reference/breakTarget4.js +++ b/tests/baselines/reference/breakTarget4.js @@ -1,4 +1,5 @@ //// [breakTarget4.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/breakTarget4.symbols b/tests/baselines/reference/breakTarget4.symbols new file mode 100644 index 0000000000000..d4edcb17e1afd --- /dev/null +++ b/tests/baselines/reference/breakTarget4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/breakTarget4.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget4.types b/tests/baselines/reference/breakTarget4.types new file mode 100644 index 0000000000000..8b6ccf600ad32 --- /dev/null +++ b/tests/baselines/reference/breakTarget4.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/breakTarget4.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + break target2; +>target2 : any +} diff --git a/tests/baselines/reference/breakTarget5.errors.txt b/tests/baselines/reference/breakTarget5.errors.txt index 55a454ee68b7a..d92f29d67eea7 100644 --- a/tests/baselines/reference/breakTarget5.errors.txt +++ b/tests/baselines/reference/breakTarget5.errors.txt @@ -1,11 +1,9 @@ -tests/cases/compiler/breakTarget5.ts(1,1): error TS7028: Unused label. -tests/cases/compiler/breakTarget5.ts(5,7): error TS1107: Jump target cannot cross function boundary. +tests/cases/compiler/breakTarget5.ts(6,7): error TS1107: Jump target cannot cross function boundary. -==== tests/cases/compiler/breakTarget5.ts (2 errors) ==== +==== tests/cases/compiler/breakTarget5.ts (1 errors) ==== + target: - ~~~~~~ -!!! error TS7028: Unused label. while (true) { function f() { while (true) { diff --git a/tests/baselines/reference/breakTarget5.js b/tests/baselines/reference/breakTarget5.js index 197e4e147bd7e..9f6b063a8c4ea 100644 --- a/tests/baselines/reference/breakTarget5.js +++ b/tests/baselines/reference/breakTarget5.js @@ -1,4 +1,5 @@ //// [breakTarget5.ts] + target: while (true) { function f() { diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt deleted file mode 100644 index 06eca28b5121b..0000000000000 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt +++ /dev/null @@ -1,126 +0,0 @@ -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts(28,9): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts (1 errors) ==== - // Call signatures without a return type should infer one from the function body (if present) - - // Simple types - function foo(x) { - return 1; - } - var r = foo(1); - - function foo2(x) { - return foo(x); - } - var r2 = foo2(1); - - function foo3() { - return foo3(); - } - var r3 = foo3(); - - function foo4(x: T) { - return x; - } - var r4 = foo4(1); - - function foo5(x) { - if (true) { - return 1; - } else { - return 2; - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } - } - var r5 = foo5(1); - - function foo6(x) { - try { - } - catch (e) { - return []; - } - finally { - return []; - } - } - var r6 = foo6(1); - - function foo7(x) { - return typeof x; - } - var r7 = foo7(1); - - // object types - function foo8(x: number) { - return { x: x }; - } - var r8 = foo8(1); - - interface I { - foo: string; - } - function foo9(x: number) { - var i: I; - return i; - } - var r9 = foo9(1); - - class C { - foo: string; - } - function foo10(x: number) { - var c: C; - return c; - } - var r10 = foo10(1); - - module M { - export var x = 1; - export class C { foo: string } - } - function foo11() { - return M; - } - var r11 = foo11(); - - // merged declarations - interface I2 { - x: number; - } - interface I2 { - y: number; - } - function foo12() { - var i2: I2; - return i2; - } - var r12 = foo12(); - - function m1() { return 1; } - module m1 { export var y = 2; } - function foo13() { - return m1; - } - var r13 = foo13(); - - class c1 { - foo: string; - constructor(x) { } - } - module c1 { - export var x = 1; - } - function foo14() { - return c1; - } - var r14 = foo14(); - - enum e1 { A } - module e1 { export var y = 1; } - function foo15() { - return e1; - } - var r15 = foo15(); \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js index 0e78aac2b1b42..73270c240cb34 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js @@ -1,4 +1,5 @@ //// [callSignatureWithoutReturnTypeAnnotationInference.ts] + // Call signatures without a return type should infer one from the function body (if present) // Simple types diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols new file mode 100644 index 0000000000000..faba4e427ec18 --- /dev/null +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols @@ -0,0 +1,256 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts === + +// Call signatures without a return type should infer one from the function body (if present) + +// Simple types +function foo(x) { +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 4, 13)) + + return 1; +} +var r = foo(1); +>r : Symbol(r, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 7, 3)) +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) + +function foo2(x) { +>foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 7, 15)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 9, 14)) + + return foo(x); +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 9, 14)) +} +var r2 = foo2(1); +>r2 : Symbol(r2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 3)) +>foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 7, 15)) + +function foo3() { +>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 17)) + + return foo3(); +>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 17)) +} +var r3 = foo3(); +>r3 : Symbol(r3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 17, 3)) +>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 17)) + +function foo4(x: T) { +>foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 17, 16)) +>T : Symbol(T, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 19, 14)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 19, 17)) +>T : Symbol(T, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 19, 14)) + + return x; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 19, 17)) +} +var r4 = foo4(1); +>r4 : Symbol(r4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 22, 3)) +>foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 17, 16)) + +function foo5(x) { +>foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 22, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 24, 14)) + + if (true) { + return 1; + } else { + return 2; + } +} +var r5 = foo5(1); +>r5 : Symbol(r5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 31, 3)) +>foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 22, 17)) + +function foo6(x) { +>foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 31, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 33, 14)) + + try { + } + catch (e) { +>e : Symbol(e, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 36, 11)) + + return []; + } + finally { + return []; + } +} +var r6 = foo6(1); +>r6 : Symbol(r6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 43, 3)) +>foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 31, 17)) + +function foo7(x) { +>foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 43, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 45, 14)) + + return typeof x; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 45, 14)) +} +var r7 = foo7(1); +>r7 : Symbol(r7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 48, 3)) +>foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 43, 17)) + +// object types +function foo8(x: number) { +>foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 48, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 51, 14)) + + return { x: x }; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 52, 12)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 51, 14)) +} +var r8 = foo8(1); +>r8 : Symbol(r8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 54, 3)) +>foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 48, 17)) + +interface I { +>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 54, 17)) + + foo: string; +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 56, 13)) +} +function foo9(x: number) { +>foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 58, 1)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 59, 14)) + + var i: I; +>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 60, 7)) +>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 54, 17)) + + return i; +>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 60, 7)) +} +var r9 = foo9(1); +>r9 : Symbol(r9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 63, 3)) +>foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 58, 1)) + +class C { +>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 63, 17)) + + foo: string; +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 65, 9)) +} +function foo10(x: number) { +>foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 67, 1)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 68, 15)) + + var c: C; +>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 69, 7)) +>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 63, 17)) + + return c; +>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 69, 7)) +} +var r10 = foo10(1); +>r10 : Symbol(r10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 72, 3)) +>foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 67, 1)) + +module M { +>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 72, 19)) + + export var x = 1; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 75, 14)) + + export class C { foo: string } +>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 75, 21)) +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 20)) +} +function foo11() { +>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 77, 1)) + + return M; +>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 72, 19)) +} +var r11 = foo11(); +>r11 : Symbol(r11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 81, 3)) +>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 77, 1)) + +// merged declarations +interface I2 { +>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 81, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 1)) + + x: number; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 84, 14)) +} +interface I2 { +>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 81, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 1)) + + y: number; +>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 87, 14)) +} +function foo12() { +>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 89, 1)) + + var i2: I2; +>i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 91, 7)) +>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 81, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 1)) + + return i2; +>i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 91, 7)) +} +var r12 = foo12(); +>r12 : Symbol(r12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 94, 3)) +>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 89, 1)) + +function m1() { return 1; } +>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 94, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 27)) + +module m1 { export var y = 2; } +>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 94, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 27)) +>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 97, 22)) + +function foo13() { +>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 97, 31)) + + return m1; +>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 94, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 27)) +} +var r13 = foo13(); +>r13 : Symbol(r13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 3)) +>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 97, 31)) + +class c1 { +>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 106, 1)) + + foo: string; +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 103, 10)) + + constructor(x) { } +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 16)) +} +module c1 { +>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 106, 1)) + + export var x = 1; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 14)) +} +function foo14() { +>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 109, 1)) + + return c1; +>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 106, 1)) +} +var r14 = foo14(); +>r14 : Symbol(r14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 113, 3)) +>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 109, 1)) + +enum e1 { A } +>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 113, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 13)) +>A : Symbol(e1.A, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 9)) + +module e1 { export var y = 1; } +>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 113, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 13)) +>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 116, 22)) + +function foo15() { +>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 116, 31)) + + return e1; +>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 113, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 13)) +} +var r15 = foo15(); +>r15 : Symbol(r15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 120, 3)) +>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 116, 31)) + diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types new file mode 100644 index 0000000000000..689ac62c35b68 --- /dev/null +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types @@ -0,0 +1,297 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts === + +// Call signatures without a return type should infer one from the function body (if present) + +// Simple types +function foo(x) { +>foo : (x: any) => number +>x : any + + return 1; +>1 : number +} +var r = foo(1); +>r : number +>foo(1) : number +>foo : (x: any) => number +>1 : number + +function foo2(x) { +>foo2 : (x: any) => number +>x : any + + return foo(x); +>foo(x) : number +>foo : (x: any) => number +>x : any +} +var r2 = foo2(1); +>r2 : number +>foo2(1) : number +>foo2 : (x: any) => number +>1 : number + +function foo3() { +>foo3 : () => any + + return foo3(); +>foo3() : any +>foo3 : () => any +} +var r3 = foo3(); +>r3 : any +>foo3() : any +>foo3 : () => any + +function foo4(x: T) { +>foo4 : (x: T) => T +>T : T +>x : T +>T : T + + return x; +>x : T +} +var r4 = foo4(1); +>r4 : number +>foo4(1) : number +>foo4 : (x: T) => T +>1 : number + +function foo5(x) { +>foo5 : (x: any) => number +>x : any + + if (true) { +>true : boolean + + return 1; +>1 : number + + } else { + return 2; +>2 : number + } +} +var r5 = foo5(1); +>r5 : number +>foo5(1) : number +>foo5 : (x: any) => number +>1 : number + +function foo6(x) { +>foo6 : (x: any) => any[] +>x : any + + try { + } + catch (e) { +>e : any + + return []; +>[] : undefined[] + } + finally { + return []; +>[] : undefined[] + } +} +var r6 = foo6(1); +>r6 : any[] +>foo6(1) : any[] +>foo6 : (x: any) => any[] +>1 : number + +function foo7(x) { +>foo7 : (x: any) => string +>x : any + + return typeof x; +>typeof x : string +>x : any +} +var r7 = foo7(1); +>r7 : string +>foo7(1) : string +>foo7 : (x: any) => string +>1 : number + +// object types +function foo8(x: number) { +>foo8 : (x: number) => { x: number; } +>x : number + + return { x: x }; +>{ x: x } : { x: number; } +>x : number +>x : number +} +var r8 = foo8(1); +>r8 : { x: number; } +>foo8(1) : { x: number; } +>foo8 : (x: number) => { x: number; } +>1 : number + +interface I { +>I : I + + foo: string; +>foo : string +} +function foo9(x: number) { +>foo9 : (x: number) => I +>x : number + + var i: I; +>i : I +>I : I + + return i; +>i : I +} +var r9 = foo9(1); +>r9 : I +>foo9(1) : I +>foo9 : (x: number) => I +>1 : number + +class C { +>C : C + + foo: string; +>foo : string +} +function foo10(x: number) { +>foo10 : (x: number) => C +>x : number + + var c: C; +>c : C +>C : C + + return c; +>c : C +} +var r10 = foo10(1); +>r10 : C +>foo10(1) : C +>foo10 : (x: number) => C +>1 : number + +module M { +>M : typeof M + + export var x = 1; +>x : number +>1 : number + + export class C { foo: string } +>C : C +>foo : string +} +function foo11() { +>foo11 : () => typeof M + + return M; +>M : typeof M +} +var r11 = foo11(); +>r11 : typeof M +>foo11() : typeof M +>foo11 : () => typeof M + +// merged declarations +interface I2 { +>I2 : I2 + + x: number; +>x : number +} +interface I2 { +>I2 : I2 + + y: number; +>y : number +} +function foo12() { +>foo12 : () => I2 + + var i2: I2; +>i2 : I2 +>I2 : I2 + + return i2; +>i2 : I2 +} +var r12 = foo12(); +>r12 : I2 +>foo12() : I2 +>foo12 : () => I2 + +function m1() { return 1; } +>m1 : typeof m1 +>1 : number + +module m1 { export var y = 2; } +>m1 : typeof m1 +>y : number +>2 : number + +function foo13() { +>foo13 : () => typeof m1 + + return m1; +>m1 : typeof m1 +} +var r13 = foo13(); +>r13 : typeof m1 +>foo13() : typeof m1 +>foo13 : () => typeof m1 + +class c1 { +>c1 : c1 + + foo: string; +>foo : string + + constructor(x) { } +>x : any +} +module c1 { +>c1 : typeof c1 + + export var x = 1; +>x : number +>1 : number +} +function foo14() { +>foo14 : () => typeof c1 + + return c1; +>c1 : typeof c1 +} +var r14 = foo14(); +>r14 : typeof c1 +>foo14() : typeof c1 +>foo14 : () => typeof c1 + +enum e1 { A } +>e1 : e1 +>A : e1 + +module e1 { export var y = 1; } +>e1 : typeof e1 +>y : number +>1 : number + +function foo15() { +>foo15 : () => typeof e1 + + return e1; +>e1 : typeof e1 +} +var r15 = foo15(); +>r15 : typeof e1 +>foo15() : typeof e1 +>foo15 : () => typeof e1 + diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.js b/tests/baselines/reference/commentEmitAtEndOfFile1.js index 1be031fa84af6..cada7754002a7 100644 --- a/tests/baselines/reference/commentEmitAtEndOfFile1.js +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.js @@ -1,4 +1,5 @@ //// [commentEmitAtEndOfFile1.ts] + // test var f = '' // test #2 diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.symbols b/tests/baselines/reference/commentEmitAtEndOfFile1.symbols index 1fc0ad0955348..cb06d088307c7 100644 --- a/tests/baselines/reference/commentEmitAtEndOfFile1.symbols +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.symbols @@ -1,17 +1,18 @@ === tests/cases/compiler/commentEmitAtEndOfFile1.ts === + // test var f = '' ->f : Symbol(f, Decl(commentEmitAtEndOfFile1.ts, 1, 3)) +>f : Symbol(f, Decl(commentEmitAtEndOfFile1.ts, 2, 3)) // test #2 module foo { ->foo : Symbol(foo, Decl(commentEmitAtEndOfFile1.ts, 1, 10)) +>foo : Symbol(foo, Decl(commentEmitAtEndOfFile1.ts, 2, 10)) function bar() { } ->bar : Symbol(bar, Decl(commentEmitAtEndOfFile1.ts, 3, 12)) +>bar : Symbol(bar, Decl(commentEmitAtEndOfFile1.ts, 4, 12)) } // test #3 module empty { ->empty : Symbol(empty, Decl(commentEmitAtEndOfFile1.ts, 5, 1)) +>empty : Symbol(empty, Decl(commentEmitAtEndOfFile1.ts, 6, 1)) } // test #4 diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.types b/tests/baselines/reference/commentEmitAtEndOfFile1.types index d88d7ffa5fcda..f96a1069a06cf 100644 --- a/tests/baselines/reference/commentEmitAtEndOfFile1.types +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.types @@ -1,4 +1,5 @@ === tests/cases/compiler/commentEmitAtEndOfFile1.ts === + // test var f = '' >f : string diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt index 645e34bcfa7cb..392e1781dd5f5 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt @@ -1,81 +1,81 @@ -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(7,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(8,9): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(11,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(12,9): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(15,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(16,9): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(21,5): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(8,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(9,9): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(12,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(13,9): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(16,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(17,9): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(22,5): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(25,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(23,5): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(26,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(30,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(31,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(33,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(34,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(37,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(38,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(40,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(41,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(44,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(27,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(31,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(32,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(34,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(35,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(38,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(39,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(41,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(42,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(45,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(46,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(47,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(48,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(49,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(46,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(47,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(48,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(49,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(50,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(51,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(52,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(53,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(54,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(55,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(58,3): error TS7028: Unused label. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(58,9): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(52,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(53,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(54,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(55,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(56,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(59,9): error TS1128: Declaration or statement expected. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(62,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(63,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(69,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(60,9): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(63,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(64,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(70,15): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(74,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(71,15): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(75,15): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(79,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(76,15): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(80,15): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(85,21): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(81,15): error TS1034: 'super' must be followed by an argument list or member access. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(86,21): error TS1128: Declaration or statement expected. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(87,11): error TS1005: ';' expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(87,21): error TS1128: Declaration or statement expected. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(88,11): error TS1005: ';' expected. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(91,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(92,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(95,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(89,11): error TS1005: ';' expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(92,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(93,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(96,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(97,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(98,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(99,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(100,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(101,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(102,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(103,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(104,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(97,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(98,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(99,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(100,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(101,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(102,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(103,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(104,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(105,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(106,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(107,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(108,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(107,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(108,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(109,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(110,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(111,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(112,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(113,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(114,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(115,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(116,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(117,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(118,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(119,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(120,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(121,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(122,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(111,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(112,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(113,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(114,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(115,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(116,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(117,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(118,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(119,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(120,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(121,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(122,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(123,1): error TS2364: Invalid left-hand side of assignment expression. -==== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts (75 errors) ==== +==== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts (74 errors) ==== + // expected error for all the LHS of compound assignments (arithmetic and addition) var value; @@ -194,8 +194,6 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa // object literals { a: 0} *= value; - ~ -!!! error TS7028: Unused label. ~~ !!! error TS1128: Declaration or statement expected. { a: 0} += value; diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index 833c1e1ea7c1e..bf66183b70a62 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -1,4 +1,5 @@ //// [compoundAssignmentLHSIsValue.ts] + // expected error for all the LHS of compound assignments (arithmetic and addition) var value; diff --git a/tests/baselines/reference/conditionalExpressions2.errors.txt b/tests/baselines/reference/conditionalExpressions2.errors.txt deleted file mode 100644 index 3fb44a840b32b..0000000000000 --- a/tests/baselines/reference/conditionalExpressions2.errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -tests/cases/compiler/conditionalExpressions2.ts(9,54): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/conditionalExpressions2.ts (1 errors) ==== - var a = false ? 1 : null; - var b = false ? undefined : 0; - var c = false ? 1 : 0; - var d = false ? false : true; - var e = false ? "foo" : "bar"; - var f = false ? null : undefined; - var g = true ? {g:5} : null; - var h = [{h:5}, null]; - function i() { if (true) { return { x: 5 }; } else { return null; } } - ~~~~~~ -!!! error TS7027: Unreachable code detected. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalExpressions2.js b/tests/baselines/reference/conditionalExpressions2.js index 6749a2c0ac080..8ac7df12cfa25 100644 --- a/tests/baselines/reference/conditionalExpressions2.js +++ b/tests/baselines/reference/conditionalExpressions2.js @@ -1,4 +1,5 @@ //// [conditionalExpressions2.ts] + var a = false ? 1 : null; var b = false ? undefined : 0; var c = false ? 1 : 0; diff --git a/tests/baselines/reference/conditionalExpressions2.symbols b/tests/baselines/reference/conditionalExpressions2.symbols new file mode 100644 index 0000000000000..e6edd635b4043 --- /dev/null +++ b/tests/baselines/reference/conditionalExpressions2.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/conditionalExpressions2.ts === + +var a = false ? 1 : null; +>a : Symbol(a, Decl(conditionalExpressions2.ts, 1, 3)) + +var b = false ? undefined : 0; +>b : Symbol(b, Decl(conditionalExpressions2.ts, 2, 3)) +>undefined : Symbol(undefined) + +var c = false ? 1 : 0; +>c : Symbol(c, Decl(conditionalExpressions2.ts, 3, 3)) + +var d = false ? false : true; +>d : Symbol(d, Decl(conditionalExpressions2.ts, 4, 3)) + +var e = false ? "foo" : "bar"; +>e : Symbol(e, Decl(conditionalExpressions2.ts, 5, 3)) + +var f = false ? null : undefined; +>f : Symbol(f, Decl(conditionalExpressions2.ts, 6, 3)) +>undefined : Symbol(undefined) + +var g = true ? {g:5} : null; +>g : Symbol(g, Decl(conditionalExpressions2.ts, 7, 3)) +>g : Symbol(g, Decl(conditionalExpressions2.ts, 7, 16)) + +var h = [{h:5}, null]; +>h : Symbol(h, Decl(conditionalExpressions2.ts, 8, 3)) +>h : Symbol(h, Decl(conditionalExpressions2.ts, 8, 10)) + +function i() { if (true) { return { x: 5 }; } else { return null; } } +>i : Symbol(i, Decl(conditionalExpressions2.ts, 8, 22)) +>x : Symbol(x, Decl(conditionalExpressions2.ts, 9, 35)) + diff --git a/tests/baselines/reference/conditionalExpressions2.types b/tests/baselines/reference/conditionalExpressions2.types new file mode 100644 index 0000000000000..77714e664fb01 --- /dev/null +++ b/tests/baselines/reference/conditionalExpressions2.types @@ -0,0 +1,69 @@ +=== tests/cases/compiler/conditionalExpressions2.ts === + +var a = false ? 1 : null; +>a : number +>false ? 1 : null : number +>false : boolean +>1 : number +>null : null + +var b = false ? undefined : 0; +>b : number +>false ? undefined : 0 : number +>false : boolean +>undefined : undefined +>0 : number + +var c = false ? 1 : 0; +>c : number +>false ? 1 : 0 : number +>false : boolean +>1 : number +>0 : number + +var d = false ? false : true; +>d : boolean +>false ? false : true : boolean +>false : boolean +>false : boolean +>true : boolean + +var e = false ? "foo" : "bar"; +>e : string +>false ? "foo" : "bar" : string +>false : boolean +>"foo" : string +>"bar" : string + +var f = false ? null : undefined; +>f : any +>false ? null : undefined : null +>false : boolean +>null : null +>undefined : undefined + +var g = true ? {g:5} : null; +>g : { g: number; } +>true ? {g:5} : null : { g: number; } +>true : boolean +>{g:5} : { g: number; } +>g : number +>5 : number +>null : null + +var h = [{h:5}, null]; +>h : { h: number; }[] +>[{h:5}, null] : { h: number; }[] +>{h:5} : { h: number; } +>h : number +>5 : number +>null : null + +function i() { if (true) { return { x: 5 }; } else { return null; } } +>i : () => { x: number; } +>true : boolean +>{ x: 5 } : { x: number; } +>x : number +>5 : number +>null : null + diff --git a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt index 56273924ac189..20ec5b0c25bdd 100644 --- a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt @@ -1,8 +1,6 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(4,5): error TS1156: 'const' declarations can only be declared inside a block. -tests/cases/compiler/constDeclarations-invalidContexts.ts(6,5): error TS7027: Unreachable code detected. tests/cases/compiler/constDeclarations-invalidContexts.ts(6,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(9,5): error TS1156: 'const' declarations can only be declared inside a block. -tests/cases/compiler/constDeclarations-invalidContexts.ts(11,1): error TS7027: Unreachable code detected. tests/cases/compiler/constDeclarations-invalidContexts.ts(12,5): error TS1156: 'const' declarations can only be declared inside a block. tests/cases/compiler/constDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/compiler/constDeclarations-invalidContexts.ts(20,5): error TS1156: 'const' declarations can only be declared inside a block. @@ -11,7 +9,7 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(26,12): error TS1156: tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: 'const' declarations can only be declared inside a block. -==== tests/cases/compiler/constDeclarations-invalidContexts.ts (11 errors) ==== +==== tests/cases/compiler/constDeclarations-invalidContexts.ts (9 errors) ==== // Errors, const must be defined inside a block if (true) @@ -20,8 +18,6 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: !!! error TS1156: 'const' declarations can only be declared inside a block. else const c2 = 0; - ~~~~~ -!!! error TS7027: Unreachable code detected. ~~~~~~~~~~~~~ !!! error TS1156: 'const' declarations can only be declared inside a block. @@ -31,8 +27,6 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: !!! error TS1156: 'const' declarations can only be declared inside a block. do - ~~ -!!! error TS7027: Unreachable code detected. const c4 = 0; ~~~~~~~~~~~~~ !!! error TS1156: 'const' declarations can only be declared inside a block. diff --git a/tests/baselines/reference/constDeclarations-validContexts.errors.txt b/tests/baselines/reference/constDeclarations-validContexts.errors.txt index e55e5f578ba6b..7af16a53cbe7e 100644 --- a/tests/baselines/reference/constDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-validContexts.errors.txt @@ -1,9 +1,7 @@ -tests/cases/compiler/constDeclarations-validContexts.ts(8,5): error TS7027: Unreachable code detected. -tests/cases/compiler/constDeclarations-validContexts.ts(15,1): error TS7027: Unreachable code detected. tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -==== tests/cases/compiler/constDeclarations-validContexts.ts (3 errors) ==== +==== tests/cases/compiler/constDeclarations-validContexts.ts (1 errors) ==== // Control flow statements with blocks @@ -12,8 +10,6 @@ tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All } else { const c2 = 0; - ~~~~~ -!!! error TS7027: Unreachable code detected. } while (true) { @@ -21,8 +17,6 @@ tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All } do { - ~~ -!!! error TS7027: Unreachable code detected. const c4 = 0; } while (true); diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 56213610b83e4..b9804b1b6dbcb 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -1,91 +1,90 @@ -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2304: Cannot find name 'module'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,28): error TS1005: ':' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,29): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,18): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,26): error TS2304: Cannot find name 'bfs'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: '=' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS7027: Unreachable code detected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,26): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,28): error TS2304: Cannot find name 'bfs'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(38,17): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,28): error TS2304: Cannot find name 'bfs'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,41): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,45): error TS1002: Unterminated string literal. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS2304: Cannot find name 'console'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(49,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2304: Cannot find name 'console'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(81,13): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(90,13): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(105,29): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(106,13): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(138,13): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(141,32): error TS1005: '{' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(143,13): error TS1005: 'try' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,24): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '(' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(166,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(205,28): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(213,16): error TS2304: Cannot find name 'bool'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(223,23): error TS2304: Cannot find name 'bool'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(227,13): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(234,14): error TS1005: '{' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,9): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,16): error TS2304: Cannot find name 'method1'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,24): error TS2304: Cannot find name 'val'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,28): error TS2304: Cannot find name 'number'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS2304: Cannot find name 'method2'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS7027: Unreachable code detected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,26): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(241,5): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(246,25): error TS2339: Property 'method1' does not exist on type 'B'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,9): error TS2390: Constructor implementation is missing. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,21): error TS2369: A parameter property is only allowed in a constructor implementation. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,44): error TS2369: A parameter property is only allowed in a constructor implementation. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,69): error TS1110: Type expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,9): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,16): error TS2304: Cannot find name 'Overloads'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,26): error TS2304: Cannot find name 'value'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,31): error TS1005: ',' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(12,13): error TS2304: Cannot find name 'module'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(12,13): error TS2503: Cannot find namespace 'module'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(12,19): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(23,35): error TS1005: ')' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(23,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(25,28): error TS1005: ':' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(25,29): error TS1005: ',' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,18): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,26): error TS2304: Cannot find name 'bfs'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(29,30): error TS1005: '=' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(32,18): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,26): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,28): error TS2304: Cannot find name 'bfs'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(36,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(39,17): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,28): error TS2304: Cannot find name 'bfs'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,41): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,45): error TS1002: Unterminated string literal. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(42,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(48,17): error TS2304: Cannot find name 'console'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(50,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(54,13): error TS2304: Cannot find name 'console'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(59,5): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(70,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(73,37): error TS1127: Invalid character. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(82,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(90,23): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(91,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(106,29): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(107,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(109,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(139,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(142,32): error TS1005: '{' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(144,13): error TS1005: 'try' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,24): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,30): error TS1005: '(' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,31): error TS2304: Cannot find name 'Property'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(167,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(181,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(206,28): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(214,16): error TS2304: Cannot find name 'bool'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(219,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(224,23): error TS2304: Cannot find name 'bool'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(228,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,14): error TS1005: '{' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,16): error TS2304: Cannot find name 'method1'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,24): error TS2304: Cannot find name 'val'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,27): error TS1005: ',' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,28): error TS2304: Cannot find name 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,36): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(239,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(239,16): error TS2304: Cannot find name 'method2'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(239,26): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(242,5): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(247,25): error TS2339: Property 'method1' does not exist on type 'B'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(255,9): error TS2390: Constructor implementation is missing. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(255,21): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(255,44): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(255,69): error TS1110: Type expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,16): error TS2304: Cannot find name 'Overloads'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error TS1135: Argument expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2304: Cannot find name 'string'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2304: Cannot find name 'string'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS2304: Cannot find name 'public'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS2304: Cannot find name 'DefaultValue'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error TS2304: Cannot find name 'value'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,26): error TS2304: Cannot find name 'value'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,31): error TS1005: ',' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,16): error TS2304: Cannot find name 'Overloads'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,27): error TS1135: Argument expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,33): error TS1005: '(' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,35): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,43): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,52): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,60): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,65): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,9): error TS2304: Cannot find name 'public'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,16): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,16): error TS2304: Cannot find name 'DefaultValue'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,29): error TS2304: Cannot find name 'value'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,35): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,37): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,55): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS1128: Declaration or statement expected. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (85 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (83 errors) ==== + declare module "fs" { export class File { constructor(filename: string); @@ -142,8 +141,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ^ ~ !!! error TS1109: Expression expected. - ~ -!!! error TS7027: Unreachable code detected. retValue = bfs.TYPES(); @@ -437,8 +434,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS !!! error TS1128: Declaration or statement expected. ~~~~~~~ !!! error TS2304: Cannot find name 'method2'. - ~~~~~~~ -!!! error TS7027: Unreachable code detected. ~ !!! error TS1005: ';' expected. return 2 * this.method1(2); diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 5a61d4d5d7e96..4765d1de28344 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -1,4 +1,5 @@ //// [constructorWithIncompleteTypeAnnotation.ts] + declare module "fs" { export class File { constructor(filename: string); diff --git a/tests/baselines/reference/continueNotInIterationStatement4.errors.txt b/tests/baselines/reference/continueNotInIterationStatement4.errors.txt index 3f0d57ac45d0e..dec899c7218f7 100644 --- a/tests/baselines/reference/continueNotInIterationStatement4.errors.txt +++ b/tests/baselines/reference/continueNotInIterationStatement4.errors.txt @@ -1,11 +1,9 @@ -tests/cases/compiler/continueNotInIterationStatement4.ts(1,1): error TS7028: Unused label. -tests/cases/compiler/continueNotInIterationStatement4.ts(4,5): error TS1107: Jump target cannot cross function boundary. +tests/cases/compiler/continueNotInIterationStatement4.ts(5,5): error TS1107: Jump target cannot cross function boundary. -==== tests/cases/compiler/continueNotInIterationStatement4.ts (2 errors) ==== +==== tests/cases/compiler/continueNotInIterationStatement4.ts (1 errors) ==== + TWO: - ~~~ -!!! error TS7028: Unused label. while (true){ var x = () => { continue TWO; diff --git a/tests/baselines/reference/continueNotInIterationStatement4.js b/tests/baselines/reference/continueNotInIterationStatement4.js index f3f52ecb48ca3..50261be23b188 100644 --- a/tests/baselines/reference/continueNotInIterationStatement4.js +++ b/tests/baselines/reference/continueNotInIterationStatement4.js @@ -1,4 +1,5 @@ //// [continueNotInIterationStatement4.ts] + TWO: while (true){ var x = () => { diff --git a/tests/baselines/reference/continueTarget3.errors.txt b/tests/baselines/reference/continueTarget3.errors.txt deleted file mode 100644 index a3f6b64e7c68a..0000000000000 --- a/tests/baselines/reference/continueTarget3.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/compiler/continueTarget3.ts(2,1): error TS7028: Unused label. - - -==== tests/cases/compiler/continueTarget3.ts (1 errors) ==== - target1: - target2: - ~~~~~~~ -!!! error TS7028: Unused label. - while (true) { - continue target1; - } \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget3.js b/tests/baselines/reference/continueTarget3.js index 052b7b593c31d..70c2d2590e570 100644 --- a/tests/baselines/reference/continueTarget3.js +++ b/tests/baselines/reference/continueTarget3.js @@ -1,4 +1,5 @@ //// [continueTarget3.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/continueTarget3.symbols b/tests/baselines/reference/continueTarget3.symbols new file mode 100644 index 0000000000000..a5decfe16d102 --- /dev/null +++ b/tests/baselines/reference/continueTarget3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/continueTarget3.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget3.types b/tests/baselines/reference/continueTarget3.types new file mode 100644 index 0000000000000..d55f1c3f6d223 --- /dev/null +++ b/tests/baselines/reference/continueTarget3.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/continueTarget3.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + continue target1; +>target1 : any +} diff --git a/tests/baselines/reference/continueTarget4.errors.txt b/tests/baselines/reference/continueTarget4.errors.txt deleted file mode 100644 index d8f3cc12892b4..0000000000000 --- a/tests/baselines/reference/continueTarget4.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/compiler/continueTarget4.ts(1,1): error TS7028: Unused label. - - -==== tests/cases/compiler/continueTarget4.ts (1 errors) ==== - target1: - ~~~~~~~ -!!! error TS7028: Unused label. - target2: - while (true) { - continue target2; - } \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget4.js b/tests/baselines/reference/continueTarget4.js index 0f6211f9202cb..23c20a03260f9 100644 --- a/tests/baselines/reference/continueTarget4.js +++ b/tests/baselines/reference/continueTarget4.js @@ -1,4 +1,5 @@ //// [continueTarget4.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/continueTarget4.symbols b/tests/baselines/reference/continueTarget4.symbols new file mode 100644 index 0000000000000..fc69a881a60a3 --- /dev/null +++ b/tests/baselines/reference/continueTarget4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/continueTarget4.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget4.types b/tests/baselines/reference/continueTarget4.types new file mode 100644 index 0000000000000..e3e3ae82dfee8 --- /dev/null +++ b/tests/baselines/reference/continueTarget4.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/continueTarget4.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + continue target2; +>target2 : any +} diff --git a/tests/baselines/reference/continueTarget5.errors.txt b/tests/baselines/reference/continueTarget5.errors.txt index 6f0d3a2f6bffa..854f57017b620 100644 --- a/tests/baselines/reference/continueTarget5.errors.txt +++ b/tests/baselines/reference/continueTarget5.errors.txt @@ -1,11 +1,9 @@ -tests/cases/compiler/continueTarget5.ts(1,1): error TS7028: Unused label. -tests/cases/compiler/continueTarget5.ts(5,7): error TS1107: Jump target cannot cross function boundary. +tests/cases/compiler/continueTarget5.ts(6,7): error TS1107: Jump target cannot cross function boundary. -==== tests/cases/compiler/continueTarget5.ts (2 errors) ==== +==== tests/cases/compiler/continueTarget5.ts (1 errors) ==== + target: - ~~~~~~ -!!! error TS7028: Unused label. while (true) { function f() { while (true) { diff --git a/tests/baselines/reference/continueTarget5.js b/tests/baselines/reference/continueTarget5.js index 5bf309d2690e8..030a1c2589c59 100644 --- a/tests/baselines/reference/continueTarget5.js +++ b/tests/baselines/reference/continueTarget5.js @@ -1,4 +1,5 @@ //// [continueTarget5.ts] + target: while (true) { function f() { diff --git a/tests/baselines/reference/doWhileBreakStatements.errors.txt b/tests/baselines/reference/doWhileBreakStatements.errors.txt deleted file mode 100644 index e31109858cff8..0000000000000 --- a/tests/baselines/reference/doWhileBreakStatements.errors.txt +++ /dev/null @@ -1,50 +0,0 @@ -tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts(11,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts(19,5): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts(30,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts (3 errors) ==== - do { - break; - } while(true) - - ONE: - do { - break ONE; - } - while (true) - - TWO: - ~~~ -!!! error TS7028: Unused label. - THREE: - do { - break THREE; - }while (true) - - FOUR: - do { - FIVE: - ~~~~ -!!! error TS7028: Unused label. - do { - break FOUR; - }while (true) - }while (true) - - do { - SIX: - do break SIX; while(true) - }while (true) - - SEVEN: - ~~~~~ -!!! error TS7027: Unreachable code detected. - do do do break SEVEN; while (true) while (true) while (true) - - EIGHT: - do{ - var fn = function () { } - break EIGHT; - }while(true) - \ No newline at end of file diff --git a/tests/baselines/reference/doWhileBreakStatements.js b/tests/baselines/reference/doWhileBreakStatements.js index a2bc0d3c549af..8e272ceed0a55 100644 --- a/tests/baselines/reference/doWhileBreakStatements.js +++ b/tests/baselines/reference/doWhileBreakStatements.js @@ -1,4 +1,5 @@ //// [doWhileBreakStatements.ts] + do { break; } while(true) diff --git a/tests/baselines/reference/doWhileBreakStatements.symbols b/tests/baselines/reference/doWhileBreakStatements.symbols new file mode 100644 index 0000000000000..14db540598df2 --- /dev/null +++ b/tests/baselines/reference/doWhileBreakStatements.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts === + +do { + break; +} while(true) + +ONE: +do { + break ONE; +} +while (true) + +TWO: +THREE: +do { + break THREE; +}while (true) + +FOUR: +do { + FIVE: + do { + break FOUR; + }while (true) +}while (true) + +do { + SIX: + do break SIX; while(true) +}while (true) + +SEVEN: +do do do break SEVEN; while (true) while (true) while (true) + +EIGHT: +do{ + var fn = function () { } +>fn : Symbol(fn, Decl(doWhileBreakStatements.ts, 35, 7)) + + break EIGHT; +}while(true) + diff --git a/tests/baselines/reference/doWhileBreakStatements.types b/tests/baselines/reference/doWhileBreakStatements.types new file mode 100644 index 0000000000000..f143cb17d0884 --- /dev/null +++ b/tests/baselines/reference/doWhileBreakStatements.types @@ -0,0 +1,81 @@ +=== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts === + +do { + break; +} while(true) +>true : boolean + +ONE: +>ONE : any + +do { + break ONE; +>ONE : any +} +while (true) +>true : boolean + +TWO: +>TWO : any + +THREE: +>THREE : any + +do { + break THREE; +>THREE : any + +}while (true) +>true : boolean + +FOUR: +>FOUR : any + +do { + FIVE: +>FIVE : any + + do { + break FOUR; +>FOUR : any + + }while (true) +>true : boolean + +}while (true) +>true : boolean + +do { + SIX: +>SIX : any + + do break SIX; while(true) +>SIX : any +>true : boolean + +}while (true) +>true : boolean + +SEVEN: +>SEVEN : any + +do do do break SEVEN; while (true) while (true) while (true) +>SEVEN : any +>true : boolean +>true : boolean +>true : boolean + +EIGHT: +>EIGHT : any + +do{ + var fn = function () { } +>fn : () => void +>function () { } : () => void + + break EIGHT; +>EIGHT : any + +}while(true) +>true : boolean + diff --git a/tests/baselines/reference/doWhileContinueStatements.errors.txt b/tests/baselines/reference/doWhileContinueStatements.errors.txt deleted file mode 100644 index 491e1242e2f71..0000000000000 --- a/tests/baselines/reference/doWhileContinueStatements.errors.txt +++ /dev/null @@ -1,44 +0,0 @@ -tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts(5,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts (1 errors) ==== - do { - continue; - } while(true) - - ONE: - ~~~ -!!! error TS7027: Unreachable code detected. - do { - continue ONE; - } - while (true) - - TWO: - THREE: - do { - continue THREE; - }while (true) - - FOUR: - do { - FIVE: - do { - continue FOUR; - }while (true) - }while (true) - - do { - SIX: - do continue SIX; while(true) - }while (true) - - SEVEN: - do do do continue SEVEN; while (true) while (true) while (true) - - EIGHT: - do{ - var fn = function () { } - continue EIGHT; - }while(true) - \ No newline at end of file diff --git a/tests/baselines/reference/doWhileContinueStatements.js b/tests/baselines/reference/doWhileContinueStatements.js index 7f73157fd994f..51bac3c4e0913 100644 --- a/tests/baselines/reference/doWhileContinueStatements.js +++ b/tests/baselines/reference/doWhileContinueStatements.js @@ -1,4 +1,5 @@ //// [doWhileContinueStatements.ts] + do { continue; } while(true) diff --git a/tests/baselines/reference/doWhileContinueStatements.symbols b/tests/baselines/reference/doWhileContinueStatements.symbols new file mode 100644 index 0000000000000..36ca2dde764d7 --- /dev/null +++ b/tests/baselines/reference/doWhileContinueStatements.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts === + +do { + continue; +} while(true) + +ONE: +do { + continue ONE; +} +while (true) + +TWO: +THREE: +do { + continue THREE; +}while (true) + +FOUR: +do { + FIVE: + do { + continue FOUR; + }while (true) +}while (true) + +do { + SIX: + do continue SIX; while(true) +}while (true) + +SEVEN: +do do do continue SEVEN; while (true) while (true) while (true) + +EIGHT: +do{ + var fn = function () { } +>fn : Symbol(fn, Decl(doWhileContinueStatements.ts, 35, 7)) + + continue EIGHT; +}while(true) + diff --git a/tests/baselines/reference/doWhileContinueStatements.types b/tests/baselines/reference/doWhileContinueStatements.types new file mode 100644 index 0000000000000..e4d3191d040d6 --- /dev/null +++ b/tests/baselines/reference/doWhileContinueStatements.types @@ -0,0 +1,81 @@ +=== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts === + +do { + continue; +} while(true) +>true : boolean + +ONE: +>ONE : any + +do { + continue ONE; +>ONE : any +} +while (true) +>true : boolean + +TWO: +>TWO : any + +THREE: +>THREE : any + +do { + continue THREE; +>THREE : any + +}while (true) +>true : boolean + +FOUR: +>FOUR : any + +do { + FIVE: +>FIVE : any + + do { + continue FOUR; +>FOUR : any + + }while (true) +>true : boolean + +}while (true) +>true : boolean + +do { + SIX: +>SIX : any + + do continue SIX; while(true) +>SIX : any +>true : boolean + +}while (true) +>true : boolean + +SEVEN: +>SEVEN : any + +do do do continue SEVEN; while (true) while (true) while (true) +>SEVEN : any +>true : boolean +>true : boolean +>true : boolean + +EIGHT: +>EIGHT : any + +do{ + var fn = function () { } +>fn : () => void +>function () { } : () => void + + continue EIGHT; +>EIGHT : any + +}while(true) +>true : boolean + diff --git a/tests/baselines/reference/downlevelLetConst16.errors.txt b/tests/baselines/reference/downlevelLetConst16.errors.txt index a6651574b9e27..a6ada633016ff 100644 --- a/tests/baselines/reference/downlevelLetConst16.errors.txt +++ b/tests/baselines/reference/downlevelLetConst16.errors.txt @@ -1,14 +1,13 @@ -tests/cases/compiler/downlevelLetConst16.ts(151,5): error TS7027: Unreachable code detected. -tests/cases/compiler/downlevelLetConst16.ts(151,15): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/compiler/downlevelLetConst16.ts(164,5): error TS7027: Unreachable code detected. -tests/cases/compiler/downlevelLetConst16.ts(164,17): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/compiler/downlevelLetConst16.ts(195,14): error TS2461: Type 'undefined' is not an array type. -tests/cases/compiler/downlevelLetConst16.ts(202,15): error TS2459: Type 'undefined' has no property 'a' and no string index signature. -tests/cases/compiler/downlevelLetConst16.ts(216,16): error TS2461: Type 'undefined' is not an array type. -tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2459: Type 'undefined' has no property 'a' and no string index signature. +tests/cases/compiler/downlevelLetConst16.ts(152,15): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/compiler/downlevelLetConst16.ts(165,17): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/compiler/downlevelLetConst16.ts(196,14): error TS2461: Type 'undefined' is not an array type. +tests/cases/compiler/downlevelLetConst16.ts(203,15): error TS2459: Type 'undefined' has no property 'a' and no string index signature. +tests/cases/compiler/downlevelLetConst16.ts(217,16): error TS2461: Type 'undefined' is not an array type. +tests/cases/compiler/downlevelLetConst16.ts(224,17): error TS2459: Type 'undefined' has no property 'a' and no string index signature. -==== tests/cases/compiler/downlevelLetConst16.ts (8 errors) ==== +==== tests/cases/compiler/downlevelLetConst16.ts (6 errors) ==== + 'use strict' declare function use(a: any); @@ -160,8 +159,6 @@ tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2459: Type 'undefin use(x); } for (let [y] = []; ;) { - ~~~ -!!! error TS7027: Unreachable code detected. ~ !!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. use(y); @@ -177,8 +174,6 @@ tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2459: Type 'undefin use(x); } for (const [y] = []; ;) { - ~~~ -!!! error TS7027: Unreachable code detected. ~ !!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. use(y); diff --git a/tests/baselines/reference/downlevelLetConst16.js b/tests/baselines/reference/downlevelLetConst16.js index 874fc12119128..d6f05f7584a7c 100644 --- a/tests/baselines/reference/downlevelLetConst16.js +++ b/tests/baselines/reference/downlevelLetConst16.js @@ -1,4 +1,5 @@ //// [downlevelLetConst16.ts] + 'use strict' declare function use(a: any); diff --git a/tests/baselines/reference/downlevelLetConst17.errors.txt b/tests/baselines/reference/downlevelLetConst17.errors.txt deleted file mode 100644 index 0365b638449a7..0000000000000 --- a/tests/baselines/reference/downlevelLetConst17.errors.txt +++ /dev/null @@ -1,73 +0,0 @@ -tests/cases/compiler/downlevelLetConst17.ts(9,1): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/downlevelLetConst17.ts (1 errors) ==== - 'use strict' - - declare function use(a: any); - - var x; - for (let x = 10; ;) { - use(x); - } - use(x); - ~~~ -!!! error TS7027: Unreachable code detected. - - for (const x = 10; ;) { - use(x); - } - - for (; ;) { - let x = 10; - use(x); - x = 1; - } - - for (; ;) { - const x = 10; - use(x); - } - - for (let x; ;) { - use(x); - x = 1; - } - - for (; ;) { - let x; - use(x); - x = 1; - } - - while (true) { - let x; - use(x); - } - - while (true) { - const x = true; - use(x); - } - - do { - let x; - use(x); - } while (true); - - do { - let x; - use(x); - } while (true); - - for (let x in []) { - use(x); - } - - for (const x in []) { - use(x); - } - - for (const x of []) { - use(x); - } \ No newline at end of file diff --git a/tests/baselines/reference/downlevelLetConst17.symbols b/tests/baselines/reference/downlevelLetConst17.symbols new file mode 100644 index 0000000000000..809a835774c51 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst17.symbols @@ -0,0 +1,134 @@ +=== tests/cases/compiler/downlevelLetConst17.ts === +'use strict' + +declare function use(a: any); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>a : Symbol(a, Decl(downlevelLetConst17.ts, 2, 21)) + +var x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 4, 3)) + +for (let x = 10; ;) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 5, 8)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 5, 8)) +} +use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 4, 3)) + +for (const x = 10; ;) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 10, 10)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 10, 10)) +} + +for (; ;) { + let x = 10; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) + + x = 1; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) +} + +for (; ;) { + const x = 10; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 21, 9)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 21, 9)) +} + +for (let x; ;) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) + + x = 1; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) +} + +for (; ;) { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) + + x = 1; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) +} + +while (true) { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 37, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 37, 7)) +} + +while (true) { + const x = true; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 42, 9)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 42, 9)) +} + +do { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 47, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 47, 7)) + +} while (true); + +do { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 52, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 52, 7)) + +} while (true); + +for (let x in []) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 56, 8)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 56, 8)) +} + +for (const x in []) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 60, 10)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 60, 10)) +} + +for (const x of []) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 64, 10)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 64, 10)) +} diff --git a/tests/baselines/reference/downlevelLetConst17.types b/tests/baselines/reference/downlevelLetConst17.types new file mode 100644 index 0000000000000..824abcc76be52 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst17.types @@ -0,0 +1,169 @@ +=== tests/cases/compiler/downlevelLetConst17.ts === +'use strict' +>'use strict' : string + +declare function use(a: any); +>use : (a: any) => any +>a : any + +var x; +>x : any + +for (let x = 10; ;) { +>x : number +>10 : number + + use(x); +>use(x) : any +>use : (a: any) => any +>x : number +} +use(x); +>use(x) : any +>use : (a: any) => any +>x : any + +for (const x = 10; ;) { +>x : number +>10 : number + + use(x); +>use(x) : any +>use : (a: any) => any +>x : number +} + +for (; ;) { + let x = 10; +>x : number +>10 : number + + use(x); +>use(x) : any +>use : (a: any) => any +>x : number + + x = 1; +>x = 1 : number +>x : number +>1 : number +} + +for (; ;) { + const x = 10; +>x : number +>10 : number + + use(x); +>use(x) : any +>use : (a: any) => any +>x : number +} + +for (let x; ;) { +>x : any + + use(x); +>use(x) : any +>use : (a: any) => any +>x : any + + x = 1; +>x = 1 : number +>x : any +>1 : number +} + +for (; ;) { + let x; +>x : any + + use(x); +>use(x) : any +>use : (a: any) => any +>x : any + + x = 1; +>x = 1 : number +>x : any +>1 : number +} + +while (true) { +>true : boolean + + let x; +>x : any + + use(x); +>use(x) : any +>use : (a: any) => any +>x : any +} + +while (true) { +>true : boolean + + const x = true; +>x : boolean +>true : boolean + + use(x); +>use(x) : any +>use : (a: any) => any +>x : boolean +} + +do { + let x; +>x : any + + use(x); +>use(x) : any +>use : (a: any) => any +>x : any + +} while (true); +>true : boolean + +do { + let x; +>x : any + + use(x); +>use(x) : any +>use : (a: any) => any +>x : any + +} while (true); +>true : boolean + +for (let x in []) { +>x : any +>[] : undefined[] + + use(x); +>use(x) : any +>use : (a: any) => any +>x : any +} + +for (const x in []) { +>x : any +>[] : undefined[] + + use(x); +>use(x) : any +>use : (a: any) => any +>x : any +} + +for (const x of []) { +>x : any +>[] : undefined[] + + use(x); +>use(x) : any +>use : (a: any) => any +>x : any +} diff --git a/tests/baselines/reference/downlevelLetConst18.errors.txt b/tests/baselines/reference/downlevelLetConst18.errors.txt index 5d9d24a4d6d8b..9f9700dbb7e31 100644 --- a/tests/baselines/reference/downlevelLetConst18.errors.txt +++ b/tests/baselines/reference/downlevelLetConst18.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/downlevelLetConst18.ts(3,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. -tests/cases/compiler/downlevelLetConst18.ts(4,14): error TS2393: Duplicate function implementation. -tests/cases/compiler/downlevelLetConst18.ts(7,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. -tests/cases/compiler/downlevelLetConst18.ts(7,1): error TS7027: Unreachable code detected. -tests/cases/compiler/downlevelLetConst18.ts(8,14): error TS2393: Duplicate function implementation. -tests/cases/compiler/downlevelLetConst18.ts(11,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. -tests/cases/compiler/downlevelLetConst18.ts(15,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. -tests/cases/compiler/downlevelLetConst18.ts(19,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. -tests/cases/compiler/downlevelLetConst18.ts(23,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. -tests/cases/compiler/downlevelLetConst18.ts(27,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. +tests/cases/compiler/downlevelLetConst18.ts(4,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. +tests/cases/compiler/downlevelLetConst18.ts(5,14): error TS2393: Duplicate function implementation. +tests/cases/compiler/downlevelLetConst18.ts(8,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. +tests/cases/compiler/downlevelLetConst18.ts(9,14): error TS2393: Duplicate function implementation. +tests/cases/compiler/downlevelLetConst18.ts(12,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. +tests/cases/compiler/downlevelLetConst18.ts(16,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. +tests/cases/compiler/downlevelLetConst18.ts(20,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. +tests/cases/compiler/downlevelLetConst18.ts(24,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. +tests/cases/compiler/downlevelLetConst18.ts(28,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. -==== tests/cases/compiler/downlevelLetConst18.ts (10 errors) ==== +==== tests/cases/compiler/downlevelLetConst18.ts (9 errors) ==== + 'use strict' for (let x; ;) { @@ -24,8 +24,6 @@ tests/cases/compiler/downlevelLetConst18.ts(27,1): error TS4091: Loop contains b for (let x; ;) { ~~~ !!! error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher. - ~~~ -!!! error TS7027: Unreachable code detected. function foo() { x }; ~~~ !!! error TS2393: Duplicate function implementation. diff --git a/tests/baselines/reference/downlevelLetConst18.js b/tests/baselines/reference/downlevelLetConst18.js index 70b8cb9e34653..0674929d2250a 100644 --- a/tests/baselines/reference/downlevelLetConst18.js +++ b/tests/baselines/reference/downlevelLetConst18.js @@ -1,4 +1,5 @@ //// [downlevelLetConst18.ts] + 'use strict' for (let x; ;) { diff --git a/tests/baselines/reference/duplicateLabel1.errors.txt b/tests/baselines/reference/duplicateLabel1.errors.txt index 2f89b400e21ab..cf116f656fc22 100644 --- a/tests/baselines/reference/duplicateLabel1.errors.txt +++ b/tests/baselines/reference/duplicateLabel1.errors.txt @@ -1,11 +1,9 @@ -tests/cases/compiler/duplicateLabel1.ts(1,1): error TS7028: Unused label. -tests/cases/compiler/duplicateLabel1.ts(2,1): error TS1114: Duplicate label 'target' +tests/cases/compiler/duplicateLabel1.ts(3,1): error TS1114: Duplicate label 'target' -==== tests/cases/compiler/duplicateLabel1.ts (2 errors) ==== +==== tests/cases/compiler/duplicateLabel1.ts (1 errors) ==== + target: - ~~~~~~ -!!! error TS7028: Unused label. target: ~~~~~~ !!! error TS1114: Duplicate label 'target' diff --git a/tests/baselines/reference/duplicateLabel1.js b/tests/baselines/reference/duplicateLabel1.js index e7976895c94d8..5251cec3e3683 100644 --- a/tests/baselines/reference/duplicateLabel1.js +++ b/tests/baselines/reference/duplicateLabel1.js @@ -1,4 +1,5 @@ //// [duplicateLabel1.ts] + target: target: while (true) { diff --git a/tests/baselines/reference/duplicateLabel2.errors.txt b/tests/baselines/reference/duplicateLabel2.errors.txt index f150879c010c5..2a87ed966485d 100644 --- a/tests/baselines/reference/duplicateLabel2.errors.txt +++ b/tests/baselines/reference/duplicateLabel2.errors.txt @@ -1,11 +1,9 @@ -tests/cases/compiler/duplicateLabel2.ts(1,1): error TS7028: Unused label. -tests/cases/compiler/duplicateLabel2.ts(3,3): error TS1114: Duplicate label 'target' +tests/cases/compiler/duplicateLabel2.ts(4,3): error TS1114: Duplicate label 'target' -==== tests/cases/compiler/duplicateLabel2.ts (2 errors) ==== +==== tests/cases/compiler/duplicateLabel2.ts (1 errors) ==== + target: - ~~~~~~ -!!! error TS7028: Unused label. while (true) { target: ~~~~~~ diff --git a/tests/baselines/reference/duplicateLabel2.js b/tests/baselines/reference/duplicateLabel2.js index 9ee9671d59de8..40a5ee4595e76 100644 --- a/tests/baselines/reference/duplicateLabel2.js +++ b/tests/baselines/reference/duplicateLabel2.js @@ -1,4 +1,5 @@ //// [duplicateLabel2.ts] + target: while (true) { target: diff --git a/tests/baselines/reference/duplicateLabel3.errors.txt b/tests/baselines/reference/duplicateLabel3.errors.txt deleted file mode 100644 index f256176f1e084..0000000000000 --- a/tests/baselines/reference/duplicateLabel3.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/compiler/duplicateLabel3.ts(1,1): error TS7028: Unused label. -tests/cases/compiler/duplicateLabel3.ts(4,5): error TS7028: Unused label. - - -==== tests/cases/compiler/duplicateLabel3.ts (2 errors) ==== - target: - ~~~~~~ -!!! error TS7028: Unused label. - while (true) { - function f() { - target: - ~~~~~~ -!!! error TS7028: Unused label. - while (true) { - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel3.js b/tests/baselines/reference/duplicateLabel3.js index 37e9619e8f6bb..a1d33e46fc19b 100644 --- a/tests/baselines/reference/duplicateLabel3.js +++ b/tests/baselines/reference/duplicateLabel3.js @@ -1,4 +1,5 @@ //// [duplicateLabel3.ts] + target: while (true) { function f() { diff --git a/tests/baselines/reference/duplicateLabel3.symbols b/tests/baselines/reference/duplicateLabel3.symbols new file mode 100644 index 0000000000000..89f2d5ee48a69 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel3.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/duplicateLabel3.ts === + +target: +while (true) { + function f() { +>f : Symbol(f, Decl(duplicateLabel3.ts, 2, 14)) + + target: + while (true) { + } + } +} diff --git a/tests/baselines/reference/duplicateLabel3.types b/tests/baselines/reference/duplicateLabel3.types new file mode 100644 index 0000000000000..920a077aa9ef2 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel3.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/duplicateLabel3.ts === + +target: +>target : any + +while (true) { +>true : boolean + + function f() { +>f : () => void + + target: +>target : any + + while (true) { +>true : boolean + } + } +} diff --git a/tests/baselines/reference/duplicateLabel4.errors.txt b/tests/baselines/reference/duplicateLabel4.errors.txt deleted file mode 100644 index 516a4b2324bba..0000000000000 --- a/tests/baselines/reference/duplicateLabel4.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/compiler/duplicateLabel4.ts(1,1): error TS7028: Unused label. -tests/cases/compiler/duplicateLabel4.ts(5,1): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/duplicateLabel4.ts (2 errors) ==== - target: - ~~~~~~ -!!! error TS7028: Unused label. - while (true) { - } - - target: - ~~~~~~ -!!! error TS7027: Unreachable code detected. - while (true) { - } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel4.js b/tests/baselines/reference/duplicateLabel4.js index 22d072d38d730..d5b81b1e5bb8f 100644 --- a/tests/baselines/reference/duplicateLabel4.js +++ b/tests/baselines/reference/duplicateLabel4.js @@ -1,4 +1,5 @@ //// [duplicateLabel4.ts] + target: while (true) { } diff --git a/tests/baselines/reference/duplicateLabel4.symbols b/tests/baselines/reference/duplicateLabel4.symbols new file mode 100644 index 0000000000000..5660782e2ecdd --- /dev/null +++ b/tests/baselines/reference/duplicateLabel4.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/duplicateLabel4.ts === + +No type information for this code.target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. +No type information for this code.target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel4.types b/tests/baselines/reference/duplicateLabel4.types new file mode 100644 index 0000000000000..a10a06fe7a2fe --- /dev/null +++ b/tests/baselines/reference/duplicateLabel4.types @@ -0,0 +1,15 @@ +=== tests/cases/compiler/duplicateLabel4.ts === + +target: +>target : any + +while (true) { +>true : boolean +} + +target: +>target : any + +while (true) { +>true : boolean +} diff --git a/tests/baselines/reference/duplicateLocalVariable1.errors.txt b/tests/baselines/reference/duplicateLocalVariable1.errors.txt index 890470f6c11bf..bd6d535d88eaa 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable1.errors.txt @@ -1,9 +1,19 @@ -tests/cases/compiler/duplicateLocalVariable1.ts(64,92): error TS7027: Unreachable code detected. -tests/cases/compiler/duplicateLocalVariable1.ts(65,122): error TS7027: Unreachable code detected. -tests/cases/compiler/duplicateLocalVariable1.ts(185,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. +tests/cases/compiler/duplicateLocalVariable1.ts(2,4): error TS1005: ';' expected. +tests/cases/compiler/duplicateLocalVariable1.ts(2,11): error TS1146: Declaration expected. +tests/cases/compiler/duplicateLocalVariable1.ts(2,13): error TS2304: Cannot find name 'commonjs'. +tests/cases/compiler/duplicateLocalVariable1.ts(12,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. +tests/cases/compiler/duplicateLocalVariable1.ts(187,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. -==== tests/cases/compiler/duplicateLocalVariable1.ts (3 errors) ==== +==== tests/cases/compiler/duplicateLocalVariable1.ts (5 errors) ==== + + / /@module: commonjs + ~ +!!! error TS1005: ';' expected. + +!!! error TS1146: Declaration expected. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'commonjs'. //import FileManager = require('filemanager'); //import App = require('app'); @@ -14,6 +24,8 @@ tests/cases/compiler/duplicateLocalVariable1.ts(185,22): error TS2403: Subsequen var TestFileDir = ".\\TempTestFiles"; export class TestCase { + ~~~~~~~~ +!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) { } } @@ -68,11 +80,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(185,22): error TS2403: Subsequen // First 3 are for simple harness validation testRunner.addTest(new TestCase("Basic test", function () { return true; })); testRunner.addTest(new TestCase("Test for any error", function () { throw new Error(); return false; }, "")); - ~~~~~~ -!!! error TS7027: Unreachable code detected. testRunner.addTest(new TestCase("Test RegEx error message match", function () { throw new Error("Should also pass"); return false; }, "Should [also]+ pass")); - ~~~~~~ -!!! error TS7027: Unreachable code detected. testRunner.addTest(new TestCase("Test array compare true", function () { return TestRunner.arrayCompare([1, 2, 3], [1, 2, 3]); })); testRunner.addTest(new TestCase("Test array compare false", function () { return !TestRunner.arrayCompare([3, 2, 3], [1, 2, 3]); })); diff --git a/tests/baselines/reference/duplicateLocalVariable1.js b/tests/baselines/reference/duplicateLocalVariable1.js index 62e291f28c083..ecde1ff24077e 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.js +++ b/tests/baselines/reference/duplicateLocalVariable1.js @@ -1,5 +1,7 @@ //// [duplicateLocalVariable1.ts] +/ /@module: commonjs + //import FileManager = require('filemanager'); //import App = require('app'); @@ -344,8 +346,8 @@ export var tests: TestRunner = (function () { })(); //// [duplicateLocalVariable1.js] -//import FileManager = require('filemanager'); -//import App = require('app'); +/ /; +commonjs; var TestFileDir = ".\\TempTestFiles"; var TestCase = (function () { function TestCase(name, test, errorMessageRegEx) { diff --git a/tests/baselines/reference/duplicateVariablesByScope.errors.txt b/tests/baselines/reference/duplicateVariablesByScope.errors.txt deleted file mode 100644 index e101b2b0e0df5..0000000000000 --- a/tests/baselines/reference/duplicateVariablesByScope.errors.txt +++ /dev/null @@ -1,37 +0,0 @@ -tests/cases/compiler/duplicateVariablesByScope.ts(18,9): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/duplicateVariablesByScope.ts (1 errors) ==== - // duplicate local variables are only reported at global scope - - module M { - for (var j = 0; j < 10; j++) { - } - - for (var j = 0; j < 10; j++) { - } - } - - function foo() { - var x = 2; - var x = 1; - if (true) { - var result = 1; - } - else { - var result = 2; - ~~~ -!!! error TS7027: Unreachable code detected. - } - } - - class C { - foo() { - try { - var x = 1; - } - catch (e) { - var x = 2; - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVariablesByScope.js b/tests/baselines/reference/duplicateVariablesByScope.js index d87fd966f32b7..43b6e89d412db 100644 --- a/tests/baselines/reference/duplicateVariablesByScope.js +++ b/tests/baselines/reference/duplicateVariablesByScope.js @@ -1,4 +1,5 @@ //// [duplicateVariablesByScope.ts] + // duplicate local variables are only reported at global scope module M { diff --git a/tests/baselines/reference/duplicateVariablesByScope.symbols b/tests/baselines/reference/duplicateVariablesByScope.symbols new file mode 100644 index 0000000000000..9dd280d2756f1 --- /dev/null +++ b/tests/baselines/reference/duplicateVariablesByScope.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/duplicateVariablesByScope.ts === + +// duplicate local variables are only reported at global scope + +module M { +>M : Symbol(M, Decl(duplicateVariablesByScope.ts, 0, 0)) + + for (var j = 0; j < 10; j++) { +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12)) + } + + for (var j = 0; j < 10; j++) { +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12)) + } +} + +function foo() { +>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 9, 1)) + + var x = 2; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 12, 7), Decl(duplicateVariablesByScope.ts, 13, 7)) + + var x = 1; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 12, 7), Decl(duplicateVariablesByScope.ts, 13, 7)) + + if (true) { + var result = 1; +>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 15, 11), Decl(duplicateVariablesByScope.ts, 18, 11)) + } + else { + var result = 2; +>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 15, 11), Decl(duplicateVariablesByScope.ts, 18, 11)) + } +} + +class C { +>C : Symbol(C, Decl(duplicateVariablesByScope.ts, 20, 1)) + + foo() { +>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 22, 9)) + + try { + var x = 1; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 25, 15), Decl(duplicateVariablesByScope.ts, 28, 15)) + } + catch (e) { +>e : Symbol(e, Decl(duplicateVariablesByScope.ts, 27, 15)) + + var x = 2; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 25, 15), Decl(duplicateVariablesByScope.ts, 28, 15)) + } + } +} diff --git a/tests/baselines/reference/duplicateVariablesByScope.types b/tests/baselines/reference/duplicateVariablesByScope.types new file mode 100644 index 0000000000000..30e68d921caff --- /dev/null +++ b/tests/baselines/reference/duplicateVariablesByScope.types @@ -0,0 +1,73 @@ +=== tests/cases/compiler/duplicateVariablesByScope.ts === + +// duplicate local variables are only reported at global scope + +module M { +>M : typeof M + + for (var j = 0; j < 10; j++) { +>j : number +>0 : number +>j < 10 : boolean +>j : number +>10 : number +>j++ : number +>j : number + } + + for (var j = 0; j < 10; j++) { +>j : number +>0 : number +>j < 10 : boolean +>j : number +>10 : number +>j++ : number +>j : number + } +} + +function foo() { +>foo : () => void + + var x = 2; +>x : number +>2 : number + + var x = 1; +>x : number +>1 : number + + if (true) { +>true : boolean + + var result = 1; +>result : number +>1 : number + } + else { + var result = 2; +>result : number +>2 : number + } +} + +class C { +>C : C + + foo() { +>foo : () => void + + try { + var x = 1; +>x : number +>1 : number + } + catch (e) { +>e : any + + var x = 2; +>x : number +>2 : number + } + } +} diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.errors.txt b/tests/baselines/reference/es6ClassSuperCodegenBug.errors.txt deleted file mode 100644 index f30719a279212..0000000000000 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.errors.txt +++ /dev/null @@ -1,19 +0,0 @@ -tests/cases/compiler/es6ClassSuperCodegenBug.ts(9,10): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/es6ClassSuperCodegenBug.ts (1 errors) ==== - class A { - constructor(str1:string, str2:string) {} - } - class B extends A { - constructor() { - if (true) { - super('a1', 'b1'); - } else { - super('a2', 'b2'); - ~~~~~ -!!! error TS7027: Unreachable code detected. - } - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.js b/tests/baselines/reference/es6ClassSuperCodegenBug.js index 62c96f6260d6c..9f15af96be810 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.js +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.js @@ -1,4 +1,5 @@ //// [es6ClassSuperCodegenBug.ts] + class A { constructor(str1:string, str2:string) {} } diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.symbols b/tests/baselines/reference/es6ClassSuperCodegenBug.symbols new file mode 100644 index 0000000000000..bb500a1d2c286 --- /dev/null +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/es6ClassSuperCodegenBug.ts === + +class A { +>A : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + + constructor(str1:string, str2:string) {} +>str1 : Symbol(str1, Decl(es6ClassSuperCodegenBug.ts, 2, 13)) +>str2 : Symbol(str2, Decl(es6ClassSuperCodegenBug.ts, 2, 25)) +} +class B extends A { +>B : Symbol(B, Decl(es6ClassSuperCodegenBug.ts, 3, 1)) +>A : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + + constructor() { + if (true) { + super('a1', 'b1'); +>super : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + + } else { + super('a2', 'b2'); +>super : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + } + } +} + diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.types b/tests/baselines/reference/es6ClassSuperCodegenBug.types new file mode 100644 index 0000000000000..65269c99997ae --- /dev/null +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.types @@ -0,0 +1,33 @@ +=== tests/cases/compiler/es6ClassSuperCodegenBug.ts === + +class A { +>A : A + + constructor(str1:string, str2:string) {} +>str1 : string +>str2 : string +} +class B extends A { +>B : B +>A : A + + constructor() { + if (true) { +>true : boolean + + super('a1', 'b1'); +>super('a1', 'b1') : void +>super : typeof A +>'a1' : string +>'b1' : string + + } else { + super('a2', 'b2'); +>super('a2', 'b2') : void +>super : typeof A +>'a2' : string +>'b2' : string + } + } +} + diff --git a/tests/baselines/reference/escapedIdentifiers.errors.txt b/tests/baselines/reference/escapedIdentifiers.errors.txt deleted file mode 100644 index 8f7d735ceedaa..0000000000000 --- a/tests/baselines/reference/escapedIdentifiers.errors.txt +++ /dev/null @@ -1,146 +0,0 @@ -tests/cases/compiler/escapedIdentifiers.ts(93,1): error TS7028: Unused label. -tests/cases/compiler/escapedIdentifiers.ts(96,8): error TS7027: Unreachable code detected. -tests/cases/compiler/escapedIdentifiers.ts(100,1): error TS7028: Unused label. -tests/cases/compiler/escapedIdentifiers.ts(103,8): error TS7027: Unreachable code detected. -tests/cases/compiler/escapedIdentifiers.ts(107,1): error TS7028: Unused label. -tests/cases/compiler/escapedIdentifiers.ts(110,8): error TS7027: Unreachable code detected. -tests/cases/compiler/escapedIdentifiers.ts(114,1): error TS7028: Unused label. -tests/cases/compiler/escapedIdentifiers.ts(117,8): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/escapedIdentifiers.ts (8 errors) ==== - /* - 0 .. \u0030 - 9 .. \u0039 - - A .. \u0041 - Z .. \u005a - - a .. \u0061 - z .. \u00za - */ - - // var decl - var \u0061 = 1; - a ++; - \u0061 ++; - - var b = 1; - b ++; - \u0062 ++; - - // modules - module moduleType1 { - export var baz1: number; - } - module moduleType\u0032 { - export var baz2: number; - } - - moduleType1.baz1 = 3; - moduleType\u0031.baz1 = 3; - moduleType2.baz2 = 3; - moduleType\u0032.baz2 = 3; - - // classes - - class classType1 { - public foo1: number; - } - class classType\u0032 { - public foo2: number; - } - - var classType1Object1 = new classType1(); - classType1Object1.foo1 = 2; - var classType1Object2 = new classType\u0031(); - classType1Object2.foo1 = 2; - var classType2Object1 = new classType2(); - classType2Object1.foo2 = 2; - var classType2Object2 = new classType\u0032(); - classType2Object2.foo2 = 2; - - // interfaces - interface interfaceType1 { - bar1: number; - } - interface interfaceType\u0032 { - bar2: number; - } - - var interfaceType1Object1 = { bar1: 0 }; - interfaceType1Object1.bar1 = 2; - var interfaceType1Object2 = { bar1: 0 }; - interfaceType1Object2.bar1 = 2; - var interfaceType2Object1 = { bar2: 0 }; - interfaceType2Object1.bar2 = 2; - var interfaceType2Object2 = { bar2: 0 }; - interfaceType2Object2.bar2 = 2; - - - // arguments - class testClass { - public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { - arg\u0031 = 1; - arg2 = 'string'; - arg\u0033 = true; - arg4 = 2; - } - } - - // constructors - class constructorTestClass { - constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { - } - } - var constructorTestObject = new constructorTestClass(1, 'string', true, 2); - constructorTestObject.arg\u0031 = 1; - constructorTestObject.arg2 = 'string'; - constructorTestObject.arg\u0033 = true; - constructorTestObject.arg4 = 2; - - // Lables - - l\u0061bel1: - ~~~~~~~~~~~ -!!! error TS7028: Unused label. - while (false) - { - while(false) - ~~~~~ -!!! error TS7027: Unreachable code detected. - continue label1; // it will go to next iteration of outer loop - } - - label2: - ~~~~~~ -!!! error TS7028: Unused label. - while (false) - { - while(false) - ~~~~~ -!!! error TS7027: Unreachable code detected. - continue l\u0061bel2; // it will go to next iteration of outer loop - } - - label3: - ~~~~~~ -!!! error TS7028: Unused label. - while (false) - { - while(false) - ~~~~~ -!!! error TS7027: Unreachable code detected. - continue label3; // it will go to next iteration of outer loop - } - - l\u0061bel4: - ~~~~~~~~~~~ -!!! error TS7028: Unused label. - while (false) - { - while(false) - ~~~~~ -!!! error TS7027: Unreachable code detected. - continue l\u0061bel4; // it will go to next iteration of outer loop - } \ No newline at end of file diff --git a/tests/baselines/reference/escapedIdentifiers.js b/tests/baselines/reference/escapedIdentifiers.js index 5ab7dcc5a5a57..64eaaa5784fde 100644 --- a/tests/baselines/reference/escapedIdentifiers.js +++ b/tests/baselines/reference/escapedIdentifiers.js @@ -1,4 +1,5 @@ //// [escapedIdentifiers.ts] + /* 0 .. \u0030 9 .. \u0039 diff --git a/tests/baselines/reference/escapedIdentifiers.symbols b/tests/baselines/reference/escapedIdentifiers.symbols new file mode 100644 index 0000000000000..a99e067b898f9 --- /dev/null +++ b/tests/baselines/reference/escapedIdentifiers.symbols @@ -0,0 +1,261 @@ +=== tests/cases/compiler/escapedIdentifiers.ts === + +/* + 0 .. \u0030 + 9 .. \u0039 + + A .. \u0041 + Z .. \u005a + + a .. \u0061 + z .. \u00za +*/ + +// var decl +var \u0061 = 1; +>\u0061 : Symbol(\u0061, Decl(escapedIdentifiers.ts, 13, 3)) + +a ++; +>a : Symbol(\u0061, Decl(escapedIdentifiers.ts, 13, 3)) + +\u0061 ++; +>\u0061 : Symbol(\u0061, Decl(escapedIdentifiers.ts, 13, 3)) + +var b = 1; +>b : Symbol(b, Decl(escapedIdentifiers.ts, 17, 3)) + +b ++; +>b : Symbol(b, Decl(escapedIdentifiers.ts, 17, 3)) + +\u0062 ++; +>\u0062 : Symbol(b, Decl(escapedIdentifiers.ts, 17, 3)) + +// modules +module moduleType1 { +>moduleType1 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 19, 10)) + + export var baz1: number; +>baz1 : Symbol(baz1, Decl(escapedIdentifiers.ts, 23, 14)) +} +module moduleType\u0032 { +>moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 24, 1)) + + export var baz2: number; +>baz2 : Symbol(baz2, Decl(escapedIdentifiers.ts, 26, 14)) +} + +moduleType1.baz1 = 3; +>moduleType1.baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 23, 14)) +>moduleType1 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 19, 10)) +>baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 23, 14)) + +moduleType\u0031.baz1 = 3; +>moduleType\u0031.baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 23, 14)) +>moduleType\u0031 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 19, 10)) +>baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 23, 14)) + +moduleType2.baz2 = 3; +>moduleType2.baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 26, 14)) +>moduleType2 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 24, 1)) +>baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 26, 14)) + +moduleType\u0032.baz2 = 3; +>moduleType\u0032.baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 26, 14)) +>moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 24, 1)) +>baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 26, 14)) + +// classes + +class classType1 { +>classType1 : Symbol(classType1, Decl(escapedIdentifiers.ts, 32, 26)) + + public foo1: number; +>foo1 : Symbol(foo1, Decl(escapedIdentifiers.ts, 36, 18)) +} +class classType\u0032 { +>classType\u0032 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 38, 1)) + + public foo2: number; +>foo2 : Symbol(foo2, Decl(escapedIdentifiers.ts, 39, 23)) +} + +var classType1Object1 = new classType1(); +>classType1Object1 : Symbol(classType1Object1, Decl(escapedIdentifiers.ts, 43, 3)) +>classType1 : Symbol(classType1, Decl(escapedIdentifiers.ts, 32, 26)) + +classType1Object1.foo1 = 2; +>classType1Object1.foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 36, 18)) +>classType1Object1 : Symbol(classType1Object1, Decl(escapedIdentifiers.ts, 43, 3)) +>foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 36, 18)) + +var classType1Object2 = new classType\u0031(); +>classType1Object2 : Symbol(classType1Object2, Decl(escapedIdentifiers.ts, 45, 3)) +>classType\u0031 : Symbol(classType1, Decl(escapedIdentifiers.ts, 32, 26)) + +classType1Object2.foo1 = 2; +>classType1Object2.foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 36, 18)) +>classType1Object2 : Symbol(classType1Object2, Decl(escapedIdentifiers.ts, 45, 3)) +>foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 36, 18)) + +var classType2Object1 = new classType2(); +>classType2Object1 : Symbol(classType2Object1, Decl(escapedIdentifiers.ts, 47, 3)) +>classType2 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 38, 1)) + +classType2Object1.foo2 = 2; +>classType2Object1.foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 39, 23)) +>classType2Object1 : Symbol(classType2Object1, Decl(escapedIdentifiers.ts, 47, 3)) +>foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 39, 23)) + +var classType2Object2 = new classType\u0032(); +>classType2Object2 : Symbol(classType2Object2, Decl(escapedIdentifiers.ts, 49, 3)) +>classType\u0032 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 38, 1)) + +classType2Object2.foo2 = 2; +>classType2Object2.foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 39, 23)) +>classType2Object2 : Symbol(classType2Object2, Decl(escapedIdentifiers.ts, 49, 3)) +>foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 39, 23)) + +// interfaces +interface interfaceType1 { +>interfaceType1 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 50, 27)) + + bar1: number; +>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 53, 26)) +} +interface interfaceType\u0032 { +>interfaceType\u0032 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 55, 1)) + + bar2: number; +>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 56, 31)) +} + +var interfaceType1Object1 = { bar1: 0 }; +>interfaceType1Object1 : Symbol(interfaceType1Object1, Decl(escapedIdentifiers.ts, 60, 3)) +>interfaceType1 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 50, 27)) +>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 60, 45)) + +interfaceType1Object1.bar1 = 2; +>interfaceType1Object1.bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 53, 26)) +>interfaceType1Object1 : Symbol(interfaceType1Object1, Decl(escapedIdentifiers.ts, 60, 3)) +>bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 53, 26)) + +var interfaceType1Object2 = { bar1: 0 }; +>interfaceType1Object2 : Symbol(interfaceType1Object2, Decl(escapedIdentifiers.ts, 62, 3)) +>interfaceType\u0031 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 50, 27)) +>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 62, 50)) + +interfaceType1Object2.bar1 = 2; +>interfaceType1Object2.bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 53, 26)) +>interfaceType1Object2 : Symbol(interfaceType1Object2, Decl(escapedIdentifiers.ts, 62, 3)) +>bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 53, 26)) + +var interfaceType2Object1 = { bar2: 0 }; +>interfaceType2Object1 : Symbol(interfaceType2Object1, Decl(escapedIdentifiers.ts, 64, 3)) +>interfaceType2 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 55, 1)) +>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 64, 45)) + +interfaceType2Object1.bar2 = 2; +>interfaceType2Object1.bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 56, 31)) +>interfaceType2Object1 : Symbol(interfaceType2Object1, Decl(escapedIdentifiers.ts, 64, 3)) +>bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 56, 31)) + +var interfaceType2Object2 = { bar2: 0 }; +>interfaceType2Object2 : Symbol(interfaceType2Object2, Decl(escapedIdentifiers.ts, 66, 3)) +>interfaceType\u0032 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 55, 1)) +>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 66, 50)) + +interfaceType2Object2.bar2 = 2; +>interfaceType2Object2.bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 56, 31)) +>interfaceType2Object2 : Symbol(interfaceType2Object2, Decl(escapedIdentifiers.ts, 66, 3)) +>bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 56, 31)) + + +// arguments +class testClass { +>testClass : Symbol(testClass, Decl(escapedIdentifiers.ts, 67, 31)) + + public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { +>func : Symbol(func, Decl(escapedIdentifiers.ts, 71, 17)) +>arg1 : Symbol(arg1, Decl(escapedIdentifiers.ts, 72, 16)) +>arg\u0032 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 72, 29)) +>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 72, 48)) +>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 72, 68)) + + arg\u0031 = 1; +>arg\u0031 : Symbol(arg1, Decl(escapedIdentifiers.ts, 72, 16)) + + arg2 = 'string'; +>arg2 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 72, 29)) + + arg\u0033 = true; +>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 72, 48)) + + arg4 = 2; +>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 72, 68)) + } +} + +// constructors +class constructorTestClass { +>constructorTestClass : Symbol(constructorTestClass, Decl(escapedIdentifiers.ts, 78, 1)) + + constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { +>arg1 : Symbol(arg1, Decl(escapedIdentifiers.ts, 82, 17)) +>arg\u0032 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 82, 37)) +>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 82, 62)) +>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 82, 88)) + } +} +var constructorTestObject = new constructorTestClass(1, 'string', true, 2); +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 85, 3)) +>constructorTestClass : Symbol(constructorTestClass, Decl(escapedIdentifiers.ts, 78, 1)) + +constructorTestObject.arg\u0031 = 1; +>constructorTestObject.arg\u0031 : Symbol(constructorTestClass.arg1, Decl(escapedIdentifiers.ts, 82, 17)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 85, 3)) +>arg\u0031 : Symbol(constructorTestClass.arg1, Decl(escapedIdentifiers.ts, 82, 17)) + +constructorTestObject.arg2 = 'string'; +>constructorTestObject.arg2 : Symbol(constructorTestClass.arg\u0032, Decl(escapedIdentifiers.ts, 82, 37)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 85, 3)) +>arg2 : Symbol(constructorTestClass.arg\u0032, Decl(escapedIdentifiers.ts, 82, 37)) + +constructorTestObject.arg\u0033 = true; +>constructorTestObject.arg\u0033 : Symbol(constructorTestClass.arg\u0033, Decl(escapedIdentifiers.ts, 82, 62)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 85, 3)) +>arg\u0033 : Symbol(constructorTestClass.arg\u0033, Decl(escapedIdentifiers.ts, 82, 62)) + +constructorTestObject.arg4 = 2; +>constructorTestObject.arg4 : Symbol(constructorTestClass.arg4, Decl(escapedIdentifiers.ts, 82, 88)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 85, 3)) +>arg4 : Symbol(constructorTestClass.arg4, Decl(escapedIdentifiers.ts, 82, 88)) + +// Lables + +l\u0061bel1: + while (false) + { + while(false) + continue label1; // it will go to next iteration of outer loop + } + +label2: + while (false) + { + while(false) + continue l\u0061bel2; // it will go to next iteration of outer loop + } + +label3: + while (false) + { + while(false) + continue label3; // it will go to next iteration of outer loop + } + +l\u0061bel4: + while (false) + { + while(false) + continue l\u0061bel4; // it will go to next iteration of outer loop + } diff --git a/tests/baselines/reference/escapedIdentifiers.types b/tests/baselines/reference/escapedIdentifiers.types new file mode 100644 index 0000000000000..67713976bd6ee --- /dev/null +++ b/tests/baselines/reference/escapedIdentifiers.types @@ -0,0 +1,352 @@ +=== tests/cases/compiler/escapedIdentifiers.ts === + +/* + 0 .. \u0030 + 9 .. \u0039 + + A .. \u0041 + Z .. \u005a + + a .. \u0061 + z .. \u00za +*/ + +// var decl +var \u0061 = 1; +>\u0061 : number +>1 : number + +a ++; +>a ++ : number +>a : number + +\u0061 ++; +>\u0061 ++ : number +>\u0061 : number + +var b = 1; +>b : number +>1 : number + +b ++; +>b ++ : number +>b : number + +\u0062 ++; +>\u0062 ++ : number +>\u0062 : number + +// modules +module moduleType1 { +>moduleType1 : typeof moduleType1 + + export var baz1: number; +>baz1 : number +} +module moduleType\u0032 { +>moduleType\u0032 : typeof moduleType\u0032 + + export var baz2: number; +>baz2 : number +} + +moduleType1.baz1 = 3; +>moduleType1.baz1 = 3 : number +>moduleType1.baz1 : number +>moduleType1 : typeof moduleType1 +>baz1 : number +>3 : number + +moduleType\u0031.baz1 = 3; +>moduleType\u0031.baz1 = 3 : number +>moduleType\u0031.baz1 : number +>moduleType\u0031 : typeof moduleType1 +>baz1 : number +>3 : number + +moduleType2.baz2 = 3; +>moduleType2.baz2 = 3 : number +>moduleType2.baz2 : number +>moduleType2 : typeof moduleType\u0032 +>baz2 : number +>3 : number + +moduleType\u0032.baz2 = 3; +>moduleType\u0032.baz2 = 3 : number +>moduleType\u0032.baz2 : number +>moduleType\u0032 : typeof moduleType\u0032 +>baz2 : number +>3 : number + +// classes + +class classType1 { +>classType1 : classType1 + + public foo1: number; +>foo1 : number +} +class classType\u0032 { +>classType\u0032 : classType\u0032 + + public foo2: number; +>foo2 : number +} + +var classType1Object1 = new classType1(); +>classType1Object1 : classType1 +>new classType1() : classType1 +>classType1 : typeof classType1 + +classType1Object1.foo1 = 2; +>classType1Object1.foo1 = 2 : number +>classType1Object1.foo1 : number +>classType1Object1 : classType1 +>foo1 : number +>2 : number + +var classType1Object2 = new classType\u0031(); +>classType1Object2 : classType1 +>new classType\u0031() : classType1 +>classType\u0031 : typeof classType1 + +classType1Object2.foo1 = 2; +>classType1Object2.foo1 = 2 : number +>classType1Object2.foo1 : number +>classType1Object2 : classType1 +>foo1 : number +>2 : number + +var classType2Object1 = new classType2(); +>classType2Object1 : classType\u0032 +>new classType2() : classType\u0032 +>classType2 : typeof classType\u0032 + +classType2Object1.foo2 = 2; +>classType2Object1.foo2 = 2 : number +>classType2Object1.foo2 : number +>classType2Object1 : classType\u0032 +>foo2 : number +>2 : number + +var classType2Object2 = new classType\u0032(); +>classType2Object2 : classType\u0032 +>new classType\u0032() : classType\u0032 +>classType\u0032 : typeof classType\u0032 + +classType2Object2.foo2 = 2; +>classType2Object2.foo2 = 2 : number +>classType2Object2.foo2 : number +>classType2Object2 : classType\u0032 +>foo2 : number +>2 : number + +// interfaces +interface interfaceType1 { +>interfaceType1 : interfaceType1 + + bar1: number; +>bar1 : number +} +interface interfaceType\u0032 { +>interfaceType\u0032 : interfaceType\u0032 + + bar2: number; +>bar2 : number +} + +var interfaceType1Object1 = { bar1: 0 }; +>interfaceType1Object1 : interfaceType1 +>{ bar1: 0 } : interfaceType1 +>interfaceType1 : interfaceType1 +>{ bar1: 0 } : { bar1: number; } +>bar1 : number +>0 : number + +interfaceType1Object1.bar1 = 2; +>interfaceType1Object1.bar1 = 2 : number +>interfaceType1Object1.bar1 : number +>interfaceType1Object1 : interfaceType1 +>bar1 : number +>2 : number + +var interfaceType1Object2 = { bar1: 0 }; +>interfaceType1Object2 : interfaceType1 +>{ bar1: 0 } : interfaceType1 +>interfaceType\u0031 : interfaceType1 +>{ bar1: 0 } : { bar1: number; } +>bar1 : number +>0 : number + +interfaceType1Object2.bar1 = 2; +>interfaceType1Object2.bar1 = 2 : number +>interfaceType1Object2.bar1 : number +>interfaceType1Object2 : interfaceType1 +>bar1 : number +>2 : number + +var interfaceType2Object1 = { bar2: 0 }; +>interfaceType2Object1 : interfaceType\u0032 +>{ bar2: 0 } : interfaceType\u0032 +>interfaceType2 : interfaceType\u0032 +>{ bar2: 0 } : { bar2: number; } +>bar2 : number +>0 : number + +interfaceType2Object1.bar2 = 2; +>interfaceType2Object1.bar2 = 2 : number +>interfaceType2Object1.bar2 : number +>interfaceType2Object1 : interfaceType\u0032 +>bar2 : number +>2 : number + +var interfaceType2Object2 = { bar2: 0 }; +>interfaceType2Object2 : interfaceType\u0032 +>{ bar2: 0 } : interfaceType\u0032 +>interfaceType\u0032 : interfaceType\u0032 +>{ bar2: 0 } : { bar2: number; } +>bar2 : number +>0 : number + +interfaceType2Object2.bar2 = 2; +>interfaceType2Object2.bar2 = 2 : number +>interfaceType2Object2.bar2 : number +>interfaceType2Object2 : interfaceType\u0032 +>bar2 : number +>2 : number + + +// arguments +class testClass { +>testClass : testClass + + public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { +>func : (arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) => void +>arg1 : number +>arg\u0032 : string +>arg\u0033 : boolean +>arg4 : number + + arg\u0031 = 1; +>arg\u0031 = 1 : number +>arg\u0031 : number +>1 : number + + arg2 = 'string'; +>arg2 = 'string' : string +>arg2 : string +>'string' : string + + arg\u0033 = true; +>arg\u0033 = true : boolean +>arg\u0033 : boolean +>true : boolean + + arg4 = 2; +>arg4 = 2 : number +>arg4 : number +>2 : number + } +} + +// constructors +class constructorTestClass { +>constructorTestClass : constructorTestClass + + constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { +>arg1 : number +>arg\u0032 : string +>arg\u0033 : boolean +>arg4 : number + } +} +var constructorTestObject = new constructorTestClass(1, 'string', true, 2); +>constructorTestObject : constructorTestClass +>new constructorTestClass(1, 'string', true, 2) : constructorTestClass +>constructorTestClass : typeof constructorTestClass +>1 : number +>'string' : string +>true : boolean +>2 : number + +constructorTestObject.arg\u0031 = 1; +>constructorTestObject.arg\u0031 = 1 : number +>constructorTestObject.arg\u0031 : number +>constructorTestObject : constructorTestClass +>arg\u0031 : number +>1 : number + +constructorTestObject.arg2 = 'string'; +>constructorTestObject.arg2 = 'string' : string +>constructorTestObject.arg2 : string +>constructorTestObject : constructorTestClass +>arg2 : string +>'string' : string + +constructorTestObject.arg\u0033 = true; +>constructorTestObject.arg\u0033 = true : boolean +>constructorTestObject.arg\u0033 : boolean +>constructorTestObject : constructorTestClass +>arg\u0033 : boolean +>true : boolean + +constructorTestObject.arg4 = 2; +>constructorTestObject.arg4 = 2 : number +>constructorTestObject.arg4 : number +>constructorTestObject : constructorTestClass +>arg4 : number +>2 : number + +// Lables + +l\u0061bel1: +>l\u0061bel1 : any + + while (false) +>false : boolean + { + while(false) +>false : boolean + + continue label1; // it will go to next iteration of outer loop +>label1 : any + } + +label2: +>label2 : any + + while (false) +>false : boolean + { + while(false) +>false : boolean + + continue l\u0061bel2; // it will go to next iteration of outer loop +>l\u0061bel2 : any + } + +label3: +>label3 : any + + while (false) +>false : boolean + { + while(false) +>false : boolean + + continue label3; // it will go to next iteration of outer loop +>label3 : any + } + +l\u0061bel4: +>l\u0061bel4 : any + + while (false) +>false : boolean + { + while(false) +>false : boolean + + continue l\u0061bel4; // it will go to next iteration of outer loop +>l\u0061bel4 : any + } diff --git a/tests/baselines/reference/for.errors.txt b/tests/baselines/reference/for.errors.txt index 34de6a4b11483..d2caefbcdae5a 100644 --- a/tests/baselines/reference/for.errors.txt +++ b/tests/baselines/reference/for.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/for.ts(29,1): error TS7027: Unreachable code detected. -tests/cases/compiler/for.ts(29,6): error TS1109: Expression expected. +tests/cases/compiler/for.ts(30,6): error TS1109: Expression expected. -==== tests/cases/compiler/for.ts (2 errors) ==== +==== tests/cases/compiler/for.ts (1 errors) ==== + for (var i = 0; i < 10; i++) { // ok var x1 = i; } @@ -32,8 +32,6 @@ tests/cases/compiler/for.ts(29,6): error TS1109: Expression expected. } for () { // error - ~~~ -!!! error TS7027: Unreachable code detected. ~ !!! error TS1109: Expression expected. } \ No newline at end of file diff --git a/tests/baselines/reference/for.js b/tests/baselines/reference/for.js index a77b68d8b6e45..857d42bafdbbc 100644 --- a/tests/baselines/reference/for.js +++ b/tests/baselines/reference/for.js @@ -1,4 +1,5 @@ //// [for.ts] + for (var i = 0; i < 10; i++) { // ok var x1 = i; } diff --git a/tests/baselines/reference/forBreakStatements.errors.txt b/tests/baselines/reference/forBreakStatements.errors.txt deleted file mode 100644 index 2b42afc9be2e0..0000000000000 --- a/tests/baselines/reference/forBreakStatements.errors.txt +++ /dev/null @@ -1,49 +0,0 @@ -tests/cases/conformance/statements/breakStatements/forBreakStatements.ts(10,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/forBreakStatements.ts(18,5): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/forBreakStatements.ts(29,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts (3 errors) ==== - for (; ;) { - break; - } - - ONE: - for (; ;) { - break ONE; - } - - TWO: - ~~~ -!!! error TS7028: Unused label. - THREE: - for (; ;) { - break THREE; - } - - FOUR: - for (; ;) { - FIVE: - ~~~~ -!!! error TS7028: Unused label. - for (; ;) { - break FOUR; - } - } - - for (; ;) { - SIX: - for (; ;) break SIX; - } - - SEVEN: - ~~~~~ -!!! error TS7027: Unreachable code detected. - for (; ;) for (; ;) for (; ;) break SEVEN; - - EIGHT: - for (; ;) { - var fn = function () { } - break EIGHT; - } - \ No newline at end of file diff --git a/tests/baselines/reference/forBreakStatements.js b/tests/baselines/reference/forBreakStatements.js index 9ed65627c9c6a..da4fccdfd2ab0 100644 --- a/tests/baselines/reference/forBreakStatements.js +++ b/tests/baselines/reference/forBreakStatements.js @@ -1,4 +1,5 @@ //// [forBreakStatements.ts] + for (; ;) { break; } diff --git a/tests/baselines/reference/forBreakStatements.symbols b/tests/baselines/reference/forBreakStatements.symbols new file mode 100644 index 0000000000000..6d869b45934fa --- /dev/null +++ b/tests/baselines/reference/forBreakStatements.symbols @@ -0,0 +1,41 @@ +=== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts === + +for (; ;) { + break; +} + +ONE: +for (; ;) { + break ONE; +} + +TWO: +THREE: +for (; ;) { + break THREE; +} + +FOUR: +for (; ;) { + FIVE: + for (; ;) { + break FOUR; + } +} + +for (; ;) { + SIX: + for (; ;) break SIX; +} + +SEVEN: +for (; ;) for (; ;) for (; ;) break SEVEN; + +EIGHT: +for (; ;) { + var fn = function () { } +>fn : Symbol(fn, Decl(forBreakStatements.ts, 34, 7)) + + break EIGHT; +} + diff --git a/tests/baselines/reference/forBreakStatements.types b/tests/baselines/reference/forBreakStatements.types new file mode 100644 index 0000000000000..c494f6be30a21 --- /dev/null +++ b/tests/baselines/reference/forBreakStatements.types @@ -0,0 +1,64 @@ +=== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts === + +for (; ;) { + break; +} + +ONE: +>ONE : any + +for (; ;) { + break ONE; +>ONE : any +} + +TWO: +>TWO : any + +THREE: +>THREE : any + +for (; ;) { + break THREE; +>THREE : any +} + +FOUR: +>FOUR : any + +for (; ;) { + FIVE: +>FIVE : any + + for (; ;) { + break FOUR; +>FOUR : any + } +} + +for (; ;) { + SIX: +>SIX : any + + for (; ;) break SIX; +>SIX : any +} + +SEVEN: +>SEVEN : any + +for (; ;) for (; ;) for (; ;) break SEVEN; +>SEVEN : any + +EIGHT: +>EIGHT : any + +for (; ;) { + var fn = function () { } +>fn : () => void +>function () { } : () => void + + break EIGHT; +>EIGHT : any +} + diff --git a/tests/baselines/reference/forContinueStatements.errors.txt b/tests/baselines/reference/forContinueStatements.errors.txt deleted file mode 100644 index b7a4cc355466d..0000000000000 --- a/tests/baselines/reference/forContinueStatements.errors.txt +++ /dev/null @@ -1,43 +0,0 @@ -tests/cases/conformance/statements/continueStatements/forContinueStatements.ts(5,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts (1 errors) ==== - for (; ;) { - continue; - } - - ONE: - ~~~ -!!! error TS7027: Unreachable code detected. - for (; ;) { - continue ONE; - } - - TWO: - THREE: - for (; ;) { - continue THREE; - } - - FOUR: - for (; ;) { - FIVE: - for (; ;) { - continue FOUR; - } - } - - for (; ;) { - SIX: - for (; ;) continue SIX; - } - - SEVEN: - for (; ;) for (; ;) for (; ;) continue SEVEN; - - EIGHT: - for (; ;) { - var fn = function () { } - continue EIGHT; - } - \ No newline at end of file diff --git a/tests/baselines/reference/forContinueStatements.js b/tests/baselines/reference/forContinueStatements.js index 34f70bb1fc137..fc5aa0434b350 100644 --- a/tests/baselines/reference/forContinueStatements.js +++ b/tests/baselines/reference/forContinueStatements.js @@ -1,4 +1,5 @@ //// [forContinueStatements.ts] + for (; ;) { continue; } diff --git a/tests/baselines/reference/forContinueStatements.symbols b/tests/baselines/reference/forContinueStatements.symbols new file mode 100644 index 0000000000000..9e0c396acfbe8 --- /dev/null +++ b/tests/baselines/reference/forContinueStatements.symbols @@ -0,0 +1,41 @@ +=== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts === + +for (; ;) { + continue; +} + +ONE: +for (; ;) { + continue ONE; +} + +TWO: +THREE: +for (; ;) { + continue THREE; +} + +FOUR: +for (; ;) { + FIVE: + for (; ;) { + continue FOUR; + } +} + +for (; ;) { + SIX: + for (; ;) continue SIX; +} + +SEVEN: +for (; ;) for (; ;) for (; ;) continue SEVEN; + +EIGHT: +for (; ;) { + var fn = function () { } +>fn : Symbol(fn, Decl(forContinueStatements.ts, 34, 7)) + + continue EIGHT; +} + diff --git a/tests/baselines/reference/forContinueStatements.types b/tests/baselines/reference/forContinueStatements.types new file mode 100644 index 0000000000000..0b52bdd5d473e --- /dev/null +++ b/tests/baselines/reference/forContinueStatements.types @@ -0,0 +1,64 @@ +=== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts === + +for (; ;) { + continue; +} + +ONE: +>ONE : any + +for (; ;) { + continue ONE; +>ONE : any +} + +TWO: +>TWO : any + +THREE: +>THREE : any + +for (; ;) { + continue THREE; +>THREE : any +} + +FOUR: +>FOUR : any + +for (; ;) { + FIVE: +>FIVE : any + + for (; ;) { + continue FOUR; +>FOUR : any + } +} + +for (; ;) { + SIX: +>SIX : any + + for (; ;) continue SIX; +>SIX : any +} + +SEVEN: +>SEVEN : any + +for (; ;) for (; ;) for (; ;) continue SEVEN; +>SEVEN : any + +EIGHT: +>EIGHT : any + +for (; ;) { + var fn = function () { } +>fn : () => void +>function () { } : () => void + + continue EIGHT; +>EIGHT : any +} + diff --git a/tests/baselines/reference/forInBreakStatements.errors.txt b/tests/baselines/reference/forInBreakStatements.errors.txt deleted file mode 100644 index 8bbbf2d38eefa..0000000000000 --- a/tests/baselines/reference/forInBreakStatements.errors.txt +++ /dev/null @@ -1,46 +0,0 @@ -tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts(10,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts(18,5): error TS7028: Unused label. - - -==== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts (2 errors) ==== - for(var x in {}) { - break; - } - - ONE: - for(var x in {}) { - break ONE; - } - - TWO: - ~~~ -!!! error TS7028: Unused label. - THREE: - for(var x in {}) { - break THREE; - } - - FOUR: - for(var x in {}) { - FIVE: - ~~~~ -!!! error TS7028: Unused label. - for(var x in {}) { - break FOUR; - } - } - - for(var x in {}) { - SIX: - for(var x in {}) break SIX; - } - - SEVEN: - for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; - - EIGHT: - for (var x in {}){ - var fn = function () { } - break EIGHT; - } - \ No newline at end of file diff --git a/tests/baselines/reference/forInBreakStatements.js b/tests/baselines/reference/forInBreakStatements.js index 24b7cc57b8d43..ebbadb31277a1 100644 --- a/tests/baselines/reference/forInBreakStatements.js +++ b/tests/baselines/reference/forInBreakStatements.js @@ -1,4 +1,5 @@ //// [forInBreakStatements.ts] + for(var x in {}) { break; } diff --git a/tests/baselines/reference/forInBreakStatements.symbols b/tests/baselines/reference/forInBreakStatements.symbols new file mode 100644 index 0000000000000..5f48e110835cf --- /dev/null +++ b/tests/baselines/reference/forInBreakStatements.symbols @@ -0,0 +1,59 @@ +=== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts === + +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) + + break; +} + +ONE: +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) + + break ONE; +} + +TWO: +THREE: +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) + + break THREE; +} + +FOUR: +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) + + FIVE: + for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) + + break FOUR; + } +} + +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) + + SIX: + for(var x in {}) break SIX; +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) +} + +SEVEN: +for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) + +EIGHT: +for (var x in {}){ +>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8)) + + var fn = function () { } +>fn : Symbol(fn, Decl(forInBreakStatements.ts, 34, 7)) + + break EIGHT; +} + diff --git a/tests/baselines/reference/forInBreakStatements.types b/tests/baselines/reference/forInBreakStatements.types new file mode 100644 index 0000000000000..7714429e5af42 --- /dev/null +++ b/tests/baselines/reference/forInBreakStatements.types @@ -0,0 +1,93 @@ +=== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts === + +for(var x in {}) { +>x : any +>{} : {} + + break; +} + +ONE: +>ONE : any + +for(var x in {}) { +>x : any +>{} : {} + + break ONE; +>ONE : any +} + +TWO: +>TWO : any + +THREE: +>THREE : any + +for(var x in {}) { +>x : any +>{} : {} + + break THREE; +>THREE : any +} + +FOUR: +>FOUR : any + +for(var x in {}) { +>x : any +>{} : {} + + FIVE: +>FIVE : any + + for(var x in {}) { +>x : any +>{} : {} + + break FOUR; +>FOUR : any + } +} + +for(var x in {}) { +>x : any +>{} : {} + + SIX: +>SIX : any + + for(var x in {}) break SIX; +>x : any +>{} : {} +>SIX : any +} + +SEVEN: +>SEVEN : any + +for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; +>x : any +>{} : {} +>x : any +>{} : {} +>x : any +>{} : {} +>SEVEN : any + +EIGHT: +>EIGHT : any + +for (var x in {}){ +>x : any +>{} : {} + + var fn = function () { } +>fn : () => void +>function () { } : () => void + + break EIGHT; +>EIGHT : any +} + diff --git a/tests/baselines/reference/forInContinueStatements.errors.txt b/tests/baselines/reference/forInContinueStatements.errors.txt deleted file mode 100644 index 7a3a74e5aeeda..0000000000000 --- a/tests/baselines/reference/forInContinueStatements.errors.txt +++ /dev/null @@ -1,46 +0,0 @@ -tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts(10,1): error TS7028: Unused label. -tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts(18,5): error TS7028: Unused label. - - -==== tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts (2 errors) ==== - for(var x in {}) { - continue; - } - - ONE: - for(var x in {}) { - continue ONE; - } - - TWO: - ~~~ -!!! error TS7028: Unused label. - THREE: - for(var x in {}) { - continue THREE; - } - - FOUR: - for(var x in {}) { - FIVE: - ~~~~ -!!! error TS7028: Unused label. - for(var x in {}) { - continue FOUR; - } - } - - for(var x in {}) { - SIX: - for(var x in {}) continue SIX; - } - - SEVEN: - for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; - - EIGHT: - for (var x in {}){ - var fn = function () { } - continue EIGHT; - } - \ No newline at end of file diff --git a/tests/baselines/reference/forInContinueStatements.js b/tests/baselines/reference/forInContinueStatements.js index 8b036c5972179..ca530dd5d6cd5 100644 --- a/tests/baselines/reference/forInContinueStatements.js +++ b/tests/baselines/reference/forInContinueStatements.js @@ -1,4 +1,5 @@ //// [forInContinueStatements.ts] + for(var x in {}) { continue; } diff --git a/tests/baselines/reference/forInContinueStatements.symbols b/tests/baselines/reference/forInContinueStatements.symbols new file mode 100644 index 0000000000000..a0edea53f3ef3 --- /dev/null +++ b/tests/baselines/reference/forInContinueStatements.symbols @@ -0,0 +1,59 @@ +=== tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts === + +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) + + continue; +} + +ONE: +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) + + continue ONE; +} + +TWO: +THREE: +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) + + continue THREE; +} + +FOUR: +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) + + FIVE: + for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) + + continue FOUR; + } +} + +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) + + SIX: + for(var x in {}) continue SIX; +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) +} + +SEVEN: +for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) + +EIGHT: +for (var x in {}){ +>x : Symbol(x, Decl(forInContinueStatements.ts, 1, 7), Decl(forInContinueStatements.ts, 6, 7), Decl(forInContinueStatements.ts, 12, 7), Decl(forInContinueStatements.ts, 17, 7), Decl(forInContinueStatements.ts, 19, 11), Decl(forInContinueStatements.ts, 24, 7), Decl(forInContinueStatements.ts, 26, 11), Decl(forInContinueStatements.ts, 30, 8), Decl(forInContinueStatements.ts, 30, 26), Decl(forInContinueStatements.ts, 30, 44), Decl(forInContinueStatements.ts, 33, 8)) + + var fn = function () { } +>fn : Symbol(fn, Decl(forInContinueStatements.ts, 34, 7)) + + continue EIGHT; +} + diff --git a/tests/baselines/reference/forInContinueStatements.types b/tests/baselines/reference/forInContinueStatements.types new file mode 100644 index 0000000000000..572fd16053d33 --- /dev/null +++ b/tests/baselines/reference/forInContinueStatements.types @@ -0,0 +1,93 @@ +=== tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts === + +for(var x in {}) { +>x : any +>{} : {} + + continue; +} + +ONE: +>ONE : any + +for(var x in {}) { +>x : any +>{} : {} + + continue ONE; +>ONE : any +} + +TWO: +>TWO : any + +THREE: +>THREE : any + +for(var x in {}) { +>x : any +>{} : {} + + continue THREE; +>THREE : any +} + +FOUR: +>FOUR : any + +for(var x in {}) { +>x : any +>{} : {} + + FIVE: +>FIVE : any + + for(var x in {}) { +>x : any +>{} : {} + + continue FOUR; +>FOUR : any + } +} + +for(var x in {}) { +>x : any +>{} : {} + + SIX: +>SIX : any + + for(var x in {}) continue SIX; +>x : any +>{} : {} +>SIX : any +} + +SEVEN: +>SEVEN : any + +for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; +>x : any +>{} : {} +>x : any +>{} : {} +>x : any +>{} : {} +>SEVEN : any + +EIGHT: +>EIGHT : any + +for (var x in {}){ +>x : any +>{} : {} + + var fn = function () { } +>fn : () => void +>function () { } : () => void + + continue EIGHT; +>EIGHT : any +} + diff --git a/tests/baselines/reference/forStatements.errors.txt b/tests/baselines/reference/forStatements.errors.txt deleted file mode 100644 index 5f1e6f10c7911..0000000000000 --- a/tests/baselines/reference/forStatements.errors.txt +++ /dev/null @@ -1,52 +0,0 @@ -tests/cases/conformance/statements/forStatements/forStatements.ts(26,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/forStatements/forStatements.ts (1 errors) ==== - interface I { - id: number; - } - - class C implements I { - id: number; - } - - class D{ - source: T; - recurse: D; - wrapped: D> - } - - function F(x: string): number { return 42; } - - module M { - export class A { - name: string; - } - - export function F2(x: number): string { return x.toString(); } - } - - for(var aNumber: number = 9.9;;){} - for(var aString: string = 'this is a string';;){} - ~~~ -!!! error TS7027: Unreachable code detected. - for(var aDate: Date = new Date(12);;){} - for(var anObject: Object = new Object();;){} - - for(var anAny: any = null;;){} - for(var aSecondAny: any = undefined;;){} - for(var aVoid: void = undefined;;){} - - for(var anInterface: I = new C();;){} - for(var aClass: C = new C();;){} - for(var aGenericClass: D = new D();;){} - for(var anObjectLiteral: I = { id: 12 };;){} - for(var anOtherObjectLiteral: { id: number } = new C();;){} - - for(var aFunction: typeof F = F;;){} - for(var anOtherFunction: (x: string) => number = F;;){} - for(var aLambda: typeof F = (x) => 2;;){} - - for(var aModule: typeof M = M;;){} - for(var aClassInModule: M.A = new M.A();;){} - for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} \ No newline at end of file diff --git a/tests/baselines/reference/forStatements.js b/tests/baselines/reference/forStatements.js index 39fdb6c8871f6..253fafc81e85c 100644 --- a/tests/baselines/reference/forStatements.js +++ b/tests/baselines/reference/forStatements.js @@ -1,4 +1,5 @@ //// [forStatements.ts] + interface I { id: number; } diff --git a/tests/baselines/reference/forStatements.symbols b/tests/baselines/reference/forStatements.symbols new file mode 100644 index 0000000000000..2d5250217f97c --- /dev/null +++ b/tests/baselines/reference/forStatements.symbols @@ -0,0 +1,146 @@ +=== tests/cases/conformance/statements/forStatements/forStatements.ts === + +interface I { +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(forStatements.ts, 1, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(forStatements.ts, 3, 1)) +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(forStatements.ts, 5, 22)) +} + +class D{ +>D : Symbol(D, Decl(forStatements.ts, 7, 1)) +>T : Symbol(T, Decl(forStatements.ts, 9, 8)) + + source: T; +>source : Symbol(source, Decl(forStatements.ts, 9, 11)) +>T : Symbol(T, Decl(forStatements.ts, 9, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(forStatements.ts, 10, 14)) +>D : Symbol(D, Decl(forStatements.ts, 7, 1)) +>T : Symbol(T, Decl(forStatements.ts, 9, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(forStatements.ts, 11, 18)) +>D : Symbol(D, Decl(forStatements.ts, 7, 1)) +>D : Symbol(D, Decl(forStatements.ts, 7, 1)) +>T : Symbol(T, Decl(forStatements.ts, 9, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(forStatements.ts, 13, 1)) +>x : Symbol(x, Decl(forStatements.ts, 15, 11)) + +module M { +>M : Symbol(M, Decl(forStatements.ts, 15, 44)) + + export class A { +>A : Symbol(A, Decl(forStatements.ts, 17, 10)) + + name: string; +>name : Symbol(name, Decl(forStatements.ts, 18, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(forStatements.ts, 20, 5)) +>x : Symbol(x, Decl(forStatements.ts, 22, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(forStatements.ts, 22, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +} + +for(var aNumber: number = 9.9;;){} +>aNumber : Symbol(aNumber, Decl(forStatements.ts, 25, 7)) + +for(var aString: string = 'this is a string';;){} +>aString : Symbol(aString, Decl(forStatements.ts, 26, 7)) + +for(var aDate: Date = new Date(12);;){} +>aDate : Symbol(aDate, Decl(forStatements.ts, 27, 7)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +for(var anObject: Object = new Object();;){} +>anObject : Symbol(anObject, Decl(forStatements.ts, 28, 7)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +for(var anAny: any = null;;){} +>anAny : Symbol(anAny, Decl(forStatements.ts, 30, 7)) + +for(var aSecondAny: any = undefined;;){} +>aSecondAny : Symbol(aSecondAny, Decl(forStatements.ts, 31, 7)) +>undefined : Symbol(undefined) + +for(var aVoid: void = undefined;;){} +>aVoid : Symbol(aVoid, Decl(forStatements.ts, 32, 7)) +>undefined : Symbol(undefined) + +for(var anInterface: I = new C();;){} +>anInterface : Symbol(anInterface, Decl(forStatements.ts, 34, 7)) +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) +>C : Symbol(C, Decl(forStatements.ts, 3, 1)) + +for(var aClass: C = new C();;){} +>aClass : Symbol(aClass, Decl(forStatements.ts, 35, 7)) +>C : Symbol(C, Decl(forStatements.ts, 3, 1)) +>C : Symbol(C, Decl(forStatements.ts, 3, 1)) + +for(var aGenericClass: D = new D();;){} +>aGenericClass : Symbol(aGenericClass, Decl(forStatements.ts, 36, 7)) +>D : Symbol(D, Decl(forStatements.ts, 7, 1)) +>D : Symbol(D, Decl(forStatements.ts, 7, 1)) + +for(var anObjectLiteral: I = { id: 12 };;){} +>anObjectLiteral : Symbol(anObjectLiteral, Decl(forStatements.ts, 37, 7)) +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) +>id : Symbol(id, Decl(forStatements.ts, 37, 30)) + +for(var anOtherObjectLiteral: { id: number } = new C();;){} +>anOtherObjectLiteral : Symbol(anOtherObjectLiteral, Decl(forStatements.ts, 38, 7)) +>id : Symbol(id, Decl(forStatements.ts, 38, 31)) +>C : Symbol(C, Decl(forStatements.ts, 3, 1)) + +for(var aFunction: typeof F = F;;){} +>aFunction : Symbol(aFunction, Decl(forStatements.ts, 40, 7)) +>F : Symbol(F, Decl(forStatements.ts, 13, 1)) +>F : Symbol(F, Decl(forStatements.ts, 13, 1)) + +for(var anOtherFunction: (x: string) => number = F;;){} +>anOtherFunction : Symbol(anOtherFunction, Decl(forStatements.ts, 41, 7)) +>x : Symbol(x, Decl(forStatements.ts, 41, 26)) +>F : Symbol(F, Decl(forStatements.ts, 13, 1)) + +for(var aLambda: typeof F = (x) => 2;;){} +>aLambda : Symbol(aLambda, Decl(forStatements.ts, 42, 7)) +>F : Symbol(F, Decl(forStatements.ts, 13, 1)) +>x : Symbol(x, Decl(forStatements.ts, 42, 29)) + +for(var aModule: typeof M = M;;){} +>aModule : Symbol(aModule, Decl(forStatements.ts, 44, 7)) +>M : Symbol(M, Decl(forStatements.ts, 15, 44)) +>M : Symbol(M, Decl(forStatements.ts, 15, 44)) + +for(var aClassInModule: M.A = new M.A();;){} +>aClassInModule : Symbol(aClassInModule, Decl(forStatements.ts, 45, 7)) +>M : Symbol(M, Decl(forStatements.ts, 15, 44)) +>A : Symbol(M.A, Decl(forStatements.ts, 17, 10)) +>M.A : Symbol(M.A, Decl(forStatements.ts, 17, 10)) +>M : Symbol(M, Decl(forStatements.ts, 15, 44)) +>A : Symbol(M.A, Decl(forStatements.ts, 17, 10)) + +for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} +>aFunctionInModule : Symbol(aFunctionInModule, Decl(forStatements.ts, 46, 7)) +>M.F2 : Symbol(M.F2, Decl(forStatements.ts, 20, 5)) +>M : Symbol(M, Decl(forStatements.ts, 15, 44)) +>F2 : Symbol(M.F2, Decl(forStatements.ts, 20, 5)) +>x : Symbol(x, Decl(forStatements.ts, 46, 42)) + diff --git a/tests/baselines/reference/forStatements.types b/tests/baselines/reference/forStatements.types new file mode 100644 index 0000000000000..95b198a7fec7a --- /dev/null +++ b/tests/baselines/reference/forStatements.types @@ -0,0 +1,165 @@ +=== tests/cases/conformance/statements/forStatements/forStatements.ts === + +interface I { +>I : I + + id: number; +>id : number +} + +class C implements I { +>C : C +>I : I + + id: number; +>id : number +} + +class D{ +>D : D +>T : T + + source: T; +>source : T +>T : T + + recurse: D; +>recurse : D +>D : D +>T : T + + wrapped: D> +>wrapped : D> +>D : D +>D : D +>T : T +} + +function F(x: string): number { return 42; } +>F : (x: string) => number +>x : string +>42 : number + +module M { +>M : typeof M + + export class A { +>A : A + + name: string; +>name : string + } + + export function F2(x: number): string { return x.toString(); } +>F2 : (x: number) => string +>x : number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string +} + +for(var aNumber: number = 9.9;;){} +>aNumber : number +>9.9 : number + +for(var aString: string = 'this is a string';;){} +>aString : string +>'this is a string' : string + +for(var aDate: Date = new Date(12);;){} +>aDate : Date +>Date : Date +>new Date(12) : Date +>Date : DateConstructor +>12 : number + +for(var anObject: Object = new Object();;){} +>anObject : Object +>Object : Object +>new Object() : Object +>Object : ObjectConstructor + +for(var anAny: any = null;;){} +>anAny : any +>null : null + +for(var aSecondAny: any = undefined;;){} +>aSecondAny : any +>undefined : undefined + +for(var aVoid: void = undefined;;){} +>aVoid : void +>undefined : undefined + +for(var anInterface: I = new C();;){} +>anInterface : I +>I : I +>new C() : C +>C : typeof C + +for(var aClass: C = new C();;){} +>aClass : C +>C : C +>new C() : C +>C : typeof C + +for(var aGenericClass: D = new D();;){} +>aGenericClass : D +>D : D +>new D() : D +>D : typeof D + +for(var anObjectLiteral: I = { id: 12 };;){} +>anObjectLiteral : I +>I : I +>{ id: 12 } : { id: number; } +>id : number +>12 : number + +for(var anOtherObjectLiteral: { id: number } = new C();;){} +>anOtherObjectLiteral : { id: number; } +>id : number +>new C() : C +>C : typeof C + +for(var aFunction: typeof F = F;;){} +>aFunction : (x: string) => number +>F : (x: string) => number +>F : (x: string) => number + +for(var anOtherFunction: (x: string) => number = F;;){} +>anOtherFunction : (x: string) => number +>x : string +>F : (x: string) => number + +for(var aLambda: typeof F = (x) => 2;;){} +>aLambda : (x: string) => number +>F : (x: string) => number +>(x) => 2 : (x: string) => number +>x : string +>2 : number + +for(var aModule: typeof M = M;;){} +>aModule : typeof M +>M : typeof M +>M : typeof M + +for(var aClassInModule: M.A = new M.A();;){} +>aClassInModule : M.A +>M : any +>A : M.A +>new M.A() : M.A +>M.A : typeof M.A +>M : typeof M +>A : typeof M.A + +for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} +>aFunctionInModule : (x: number) => string +>M.F2 : (x: number) => string +>M : typeof M +>F2 : (x: number) => string +>(x) => 'this is a string' : (x: number) => string +>x : number +>'this is a string' : string + diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt index fa1c87824d7f4..f1869ae7fca29 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt @@ -1,19 +1,19 @@ -tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(32,1): error TS7027: Unreachable code detected. -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(33,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(34,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(35,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(36,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(37,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(40,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(41,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(44,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(47,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(48,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(51,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(54,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 (13 errors) ==== +==== tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts (12 errors) ==== + interface I { id: number; } @@ -46,8 +46,6 @@ tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDec // all of these are errors for( var a: any;;){} for( var a = 1;;){} - ~~~ -!!! error TS7027: Unreachable code detected. ~ !!! 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';;){} diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js index 1dde99818800d..20639c687cbf6 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js @@ -1,4 +1,5 @@ //// [forStatementsMultipleInvalidDecl.ts] + interface I { id: number; } diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.errors.txt b/tests/baselines/reference/forStatementsMultipleValidDecl.errors.txt deleted file mode 100644 index eb871af31c074..0000000000000 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.errors.txt +++ /dev/null @@ -1,39 +0,0 @@ -tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts(4,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts (1 errors) ==== - // all expected to be valid - - for (var x: number; ;) { } - for (var x = 2; ;) { } - ~~~ -!!! error TS7027: Unreachable code detected. - - for (var x = undefined; ;) { } - // new declaration space, making redeclaring x as a string valid - function declSpace() { - for (var x = 'this is a string'; ;) { } - } - interface Point { x: number; y: number; } - - for (var p: Point; ;) { } - for (var p = { x: 1, y: 2 }; ;) { } - for (var p: Point = { x: 0, y: undefined }; ;) { } - for (var p = { x: 1, y: undefined }; ;) { } - for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } - for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } - for (var p: typeof p; ;) { } - - for (var fn = function (s: string) { return 42; }; ;) { } - for (var fn = (s: string) => 3; ;) { } - for (var fn: (s: string) => number; ;) { } - for (var fn: { (s: string): number }; ;) { } - for (var fn = <(s: string) => number> null; ;) { } - for (var fn: typeof fn; ;) { } - - for (var a: string[]; ;) { } - for (var a = ['a', 'b']; ;) { } - for (var a = []; ;) { } - for (var a: string[] = []; ;) { } - for (var a = new Array(); ;) { } - for (var a: typeof a; ;) { } \ No newline at end of file diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.js b/tests/baselines/reference/forStatementsMultipleValidDecl.js index e95e37d63ac5c..6913894a15f5d 100644 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.js @@ -1,4 +1,5 @@ //// [forStatementsMultipleValidDecl.ts] + // all expected to be valid for (var x: number; ;) { } diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.symbols b/tests/baselines/reference/forStatementsMultipleValidDecl.symbols new file mode 100644 index 0000000000000..d2d8ac0100399 --- /dev/null +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.symbols @@ -0,0 +1,111 @@ +=== tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts === + +// all expected to be valid + +for (var x: number; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 4, 8), Decl(forStatementsMultipleValidDecl.ts, 6, 8)) + +for (var x = 2; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 4, 8), Decl(forStatementsMultipleValidDecl.ts, 6, 8)) + +for (var x = undefined; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 4, 8), Decl(forStatementsMultipleValidDecl.ts, 6, 8)) +>undefined : Symbol(undefined) + +// new declaration space, making redeclaring x as a string valid +function declSpace() { +>declSpace : Symbol(declSpace, Decl(forStatementsMultipleValidDecl.ts, 6, 38)) + + for (var x = 'this is a string'; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 9, 12)) +} +interface Point { x: number; y: number; } +>Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 10, 1)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 11, 17)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 11, 28)) + +for (var p: Point; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8), Decl(forStatementsMultipleValidDecl.ts, 19, 8)) +>Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 10, 1)) + +for (var p = { x: 1, y: 2 }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8), Decl(forStatementsMultipleValidDecl.ts, 19, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 14, 14)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 14, 20)) + +for (var p: Point = { x: 0, y: undefined }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8), Decl(forStatementsMultipleValidDecl.ts, 19, 8)) +>Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 10, 1)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 15, 21)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 15, 27)) +>undefined : Symbol(undefined) + +for (var p = { x: 1, y: undefined }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8), Decl(forStatementsMultipleValidDecl.ts, 19, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 16, 14)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 16, 20)) +>undefined : Symbol(undefined) + +for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8), Decl(forStatementsMultipleValidDecl.ts, 19, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 17, 13)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 17, 24)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 17, 41)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 17, 47)) + +for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8), Decl(forStatementsMultipleValidDecl.ts, 19, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 18, 15)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 18, 26)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 18, 41)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 18, 47)) +>undefined : Symbol(undefined) + +for (var p: typeof p; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8), Decl(forStatementsMultipleValidDecl.ts, 19, 8)) +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8), Decl(forStatementsMultipleValidDecl.ts, 19, 8)) + +for (var fn = function (s: string) { return 42; }; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8), Decl(forStatementsMultipleValidDecl.ts, 26, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 21, 24)) + +for (var fn = (s: string) => 3; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8), Decl(forStatementsMultipleValidDecl.ts, 26, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 22, 15)) + +for (var fn: (s: string) => number; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8), Decl(forStatementsMultipleValidDecl.ts, 26, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 23, 14)) + +for (var fn: { (s: string): number }; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8), Decl(forStatementsMultipleValidDecl.ts, 26, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 24, 16)) + +for (var fn = <(s: string) => number> null; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8), Decl(forStatementsMultipleValidDecl.ts, 26, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 25, 16)) + +for (var fn: typeof fn; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8), Decl(forStatementsMultipleValidDecl.ts, 26, 8)) +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8), Decl(forStatementsMultipleValidDecl.ts, 26, 8)) + +for (var a: string[]; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8), Decl(forStatementsMultipleValidDecl.ts, 33, 8)) + +for (var a = ['a', 'b']; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8), Decl(forStatementsMultipleValidDecl.ts, 33, 8)) + +for (var a = []; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8), Decl(forStatementsMultipleValidDecl.ts, 33, 8)) + +for (var a: string[] = []; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8), Decl(forStatementsMultipleValidDecl.ts, 33, 8)) + +for (var a = new Array(); ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8), Decl(forStatementsMultipleValidDecl.ts, 33, 8)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +for (var a: typeof a; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8), Decl(forStatementsMultipleValidDecl.ts, 33, 8)) +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8), Decl(forStatementsMultipleValidDecl.ts, 33, 8)) + diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.types b/tests/baselines/reference/forStatementsMultipleValidDecl.types new file mode 100644 index 0000000000000..acb26f173120b --- /dev/null +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.types @@ -0,0 +1,141 @@ +=== tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts === + +// all expected to be valid + +for (var x: number; ;) { } +>x : number + +for (var x = 2; ;) { } +>x : number +>2 : number + +for (var x = undefined; ;) { } +>x : number +>undefined : number +>undefined : undefined + +// new declaration space, making redeclaring x as a string valid +function declSpace() { +>declSpace : () => void + + for (var x = 'this is a string'; ;) { } +>x : string +>'this is a string' : string +} +interface Point { x: number; y: number; } +>Point : Point +>x : number +>y : number + +for (var p: Point; ;) { } +>p : Point +>Point : Point + +for (var p = { x: 1, y: 2 }; ;) { } +>p : Point +>{ x: 1, y: 2 } : { x: number; y: number; } +>x : number +>1 : number +>y : number +>2 : number + +for (var p: Point = { x: 0, y: undefined }; ;) { } +>p : Point +>Point : Point +>{ x: 0, y: undefined } : { x: number; y: undefined; } +>x : number +>0 : number +>y : undefined +>undefined : undefined + +for (var p = { x: 1, y: undefined }; ;) { } +>p : Point +>{ x: 1, y: undefined } : { x: number; y: number; } +>x : number +>1 : number +>y : number +>undefined : number +>undefined : undefined + +for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } +>p : Point +>x : number +>y : number +>{ x: 1, y: 2 } : { x: number; y: number; } +>x : number +>1 : number +>y : number +>2 : number + +for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } +>p : Point +><{ x: number; y: number; }>{ x: 0, y: undefined } : { x: number; y: number; } +>x : number +>y : number +>{ x: 0, y: undefined } : { x: number; y: undefined; } +>x : number +>0 : number +>y : undefined +>undefined : undefined + +for (var p: typeof p; ;) { } +>p : Point +>p : Point + +for (var fn = function (s: string) { return 42; }; ;) { } +>fn : (s: string) => number +>function (s: string) { return 42; } : (s: string) => number +>s : string +>42 : number + +for (var fn = (s: string) => 3; ;) { } +>fn : (s: string) => number +>(s: string) => 3 : (s: string) => number +>s : string +>3 : number + +for (var fn: (s: string) => number; ;) { } +>fn : (s: string) => number +>s : string + +for (var fn: { (s: string): number }; ;) { } +>fn : (s: string) => number +>s : string + +for (var fn = <(s: string) => number> null; ;) { } +>fn : (s: string) => number +><(s: string) => number> null : (s: string) => number +>s : string +>null : null + +for (var fn: typeof fn; ;) { } +>fn : (s: string) => number +>fn : (s: string) => number + +for (var a: string[]; ;) { } +>a : string[] + +for (var a = ['a', 'b']; ;) { } +>a : string[] +>['a', 'b'] : string[] +>'a' : string +>'b' : string + +for (var a = []; ;) { } +>a : string[] +>[] : string[] +>[] : undefined[] + +for (var a: string[] = []; ;) { } +>a : string[] +>[] : undefined[] + +for (var a = new Array(); ;) { } +>a : string[] +>new Array() : string[] +>Array : ArrayConstructor + +for (var a: typeof a; ;) { } +>a : string[] +>a : string[] + diff --git a/tests/baselines/reference/functionImplementationErrors.errors.txt b/tests/baselines/reference/functionImplementationErrors.errors.txt index bde939a15786b..86ecb6a60576f 100644 --- a/tests/baselines/reference/functionImplementationErrors.errors.txt +++ b/tests/baselines/reference/functionImplementationErrors.errors.txt @@ -1,46 +1,32 @@ -tests/cases/conformance/functions/functionImplementationErrors.ts(2,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(4,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementationErrors.ts(6,19): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(8,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementationErrors.ts(10,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(12,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementationErrors.ts(16,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(20,9): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementationErrors.ts(25,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. -tests/cases/conformance/functions/functionImplementationErrors.ts(30,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. -tests/cases/conformance/functions/functionImplementationErrors.ts(35,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. -tests/cases/conformance/functions/functionImplementationErrors.ts(42,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementationErrors.ts(49,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(51,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementationErrors.ts(53,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(55,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementationErrors.ts(57,11): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(59,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementationErrors.ts(61,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(63,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementationErrors.ts(65,11): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(67,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementationErrors.ts(69,11): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(71,5): error TS7027: Unreachable code detected. +tests/cases/conformance/functions/functionImplementationErrors.ts(3,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(7,19): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(11,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(17,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(26,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/conformance/functions/functionImplementationErrors.ts(31,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. +tests/cases/conformance/functions/functionImplementationErrors.ts(36,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. +tests/cases/conformance/functions/functionImplementationErrors.ts(50,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(54,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(58,11): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(62,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(66,11): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(70,11): error TS2354: No best common type exists among return expressions. -==== tests/cases/conformance/functions/functionImplementationErrors.ts (24 errors) ==== +==== tests/cases/conformance/functions/functionImplementationErrors.ts (13 errors) ==== + // FunctionExpression with no return type annotation with multiple return statements with unrelated types var f1 = function () { ~~~~~~~~ !!! error TS2354: No best common type exists among return expressions. return ''; return 3; - ~~~~~~ -!!! error TS7027: Unreachable code detected. }; var f2 = function x() { ~ !!! error TS2354: No best common type exists among return expressions. return ''; return 3; - ~~~~~~ -!!! error TS7027: Unreachable code detected. }; var f3 = () => { ~~~~~~~ @@ -48,8 +34,6 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(71,5): error T ~~~~~~~~~~~~~~ return 3; ~~~~~~~~~~~~~ - ~~~~~~ -!!! error TS7027: Unreachable code detected. }; ~ !!! error TS2354: No best common type exists among return expressions. @@ -62,8 +46,6 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(71,5): error T return ['']; } else { return [1]; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } } @@ -92,8 +74,6 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(71,5): error T undefined === function (): number { throw undefined; var x = 4; - ~~~ -!!! error TS7027: Unreachable code detected. }; class Base { private x; } @@ -105,16 +85,12 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(71,5): error T !!! error TS2354: No best common type exists among return expressions. return new Derived1(); return new Derived2(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. } var f9 = function () { ~~~~~~~~ !!! error TS2354: No best common type exists among return expressions. return new Derived1(); return new Derived2(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. }; var f10 = () => { ~~~~~~~ @@ -122,8 +98,6 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(71,5): error T ~~~~~~~~~~~~~~~~~~~~~~~~~~ return new Derived2(); ~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~~~~~~ -!!! error TS7027: Unreachable code detected. }; ~ !!! error TS2354: No best common type exists among return expressions. @@ -132,16 +106,12 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(71,5): error T !!! error TS2354: No best common type exists among return expressions. return new Base(); return new AnotherClass(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. } var f12 = function () { ~~~~~~~~ !!! error TS2354: No best common type exists among return expressions. return new Base(); return new AnotherClass(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. }; var f13 = () => { ~~~~~~~ @@ -149,8 +119,6 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(71,5): error T ~~~~~~~~~~~~~~~~~~~~~~ return new AnotherClass(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~~~~~~ -!!! error TS7027: Unreachable code detected. }; ~ !!! error TS2354: No best common type exists among return expressions. diff --git a/tests/baselines/reference/functionImplementationErrors.js b/tests/baselines/reference/functionImplementationErrors.js index 42be5f21458ea..4436f1bc94f3f 100644 --- a/tests/baselines/reference/functionImplementationErrors.js +++ b/tests/baselines/reference/functionImplementationErrors.js @@ -1,4 +1,5 @@ //// [functionImplementationErrors.ts] + // FunctionExpression with no return type annotation with multiple return statements with unrelated types var f1 = function () { return ''; diff --git a/tests/baselines/reference/functionImplementations.errors.txt b/tests/baselines/reference/functionImplementations.errors.txt deleted file mode 100644 index f3e4d6404c66f..0000000000000 --- a/tests/baselines/reference/functionImplementations.errors.txt +++ /dev/null @@ -1,183 +0,0 @@ -tests/cases/conformance/functions/functionImplementations.ts(69,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementations.ts(81,24): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementations.ts(86,24): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementations.ts(137,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementations.ts(141,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementations.ts(146,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementations.ts(150,5): error TS7027: Unreachable code detected. -tests/cases/conformance/functions/functionImplementations.ts(154,5): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/functions/functionImplementations.ts (8 errors) ==== - // FunctionExpression with no return type annotation and no return statement returns void - var v: void = function () { } (); - - // FunctionExpression f with no return type annotation and directly references f in its body returns any - var a: any = function f() { - return f; - }; - var a: any = function f() { - return f(); - }; - - // FunctionExpression f with no return type annotation and indirectly references f in its body returns any - var a: any = function f() { - var x = f; - return x; - }; - - // Two mutually recursive function implementations with no return type annotations - function rec1() { - return rec2(); - } - function rec2() { - return rec1(); - } - var a = rec1(); - var a = rec2(); - - // Two mutually recursive function implementations with return type annotation in one - function rec3(): number { - return rec4(); - } - function rec4() { - return rec3(); - } - var n: number; - var n = rec3(); - var n = rec4(); - - // FunctionExpression with no return type annotation and returns a number - var n = function () { - return 3; - } (); - - // FunctionExpression with no return type annotation and returns null - var nu = null; - var nu = function () { - return null; - } (); - - // FunctionExpression with no return type annotation and returns undefined - var un = undefined; - var un = function () { - return undefined; - } (); - - // FunctionExpression with no return type annotation and returns a type parameter type - var n = function (x: T) { - return x; - } (4); - - // FunctionExpression with no return type annotation and returns a constrained type parameter type - var n = function (x: T) { - return x; - } (4); - - // FunctionExpression with no return type annotation with multiple return statements with identical types - var n = function () { - return 3; - return 5; - ~~~~~~ -!!! error TS7027: Unreachable code detected. - }(); - - // Otherwise, the inferred return type is the first of the types of the return statement expressions - // in the function body that is a supertype of each of the others, - // ignoring return statements with no expressions. - // A compile - time error occurs if no return statement expression has a type that is a supertype of each of the others. - // FunctionExpression with no return type annotation with multiple return statements with subtype relation between returns - class Base { private m; } - class Derived extends Base { private q; } - var b: Base; - var b = function () { - return new Base(); return new Derived(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } (); - - // FunctionExpression with no return type annotation with multiple return statements with one a recursive call - var a = function f() { - return new Base(); return new Derived(); return f(); // ? - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } (); - - // FunctionExpression with non -void return type annotation with a single throw statement - undefined === function (): number { - throw undefined; - }; - - // Type of 'this' in function implementation is 'any' - function thisFunc() { - var x = this; - var x: any; - } - - // Function signature with optional parameter, no type annotation and initializer has initializer's type - function opt1(n = 4) { - var m = n; - var m: number; - } - - // Function signature with optional parameter, no type annotation and initializer has initializer's widened type - function opt2(n = { x: null, y: undefined }) { - var m = n; - var m: { x: any; y: any }; - } - - // Function signature with initializer referencing other parameter to the left - function opt3(n: number, m = n) { - var y = m; - var y: number; - } - - // Function signature with optional parameter has correct codegen - // (tested above) - - // FunctionExpression with non -void return type annotation return with no expression - function f6(): number { - return; - } - - class Derived2 extends Base { private r: string; } - class AnotherClass { private x } - // if f is a contextually typed function expression, the inferred return type is the union type - // of the types of the return statement expressions in the function body, - // ignoring return statements with no expressions. - var f7: (x: number) => string | number = x => { // should be (x: number) => number | string - if (x < 0) { return x; } - return x.toString(); - } - var f8: (x: number) => any = x => { // should be (x: number) => Base - return new Base(); - return new Derived2(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } - var f9: (x: number) => any = x => { // should be (x: number) => Base - return new Base(); - return new Derived(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. - return new Derived2(); - } - var f10: (x: number) => any = x => { // should be (x: number) => Derived | Derived1 - return new Derived(); - return new Derived2(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } - var f11: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass - return new Base(); - return new AnotherClass(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } - var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass - return new Base(); - return; // should be ignored - ~~~~~~ -!!! error TS7027: Unreachable code detected. - return new AnotherClass(); - } \ No newline at end of file diff --git a/tests/baselines/reference/functionImplementations.js b/tests/baselines/reference/functionImplementations.js index 3fc040650e48a..512da960b78d6 100644 --- a/tests/baselines/reference/functionImplementations.js +++ b/tests/baselines/reference/functionImplementations.js @@ -1,4 +1,5 @@ //// [functionImplementations.ts] + // FunctionExpression with no return type annotation and no return statement returns void var v: void = function () { } (); diff --git a/tests/baselines/reference/functionImplementations.symbols b/tests/baselines/reference/functionImplementations.symbols new file mode 100644 index 0000000000000..07945b5f765f0 --- /dev/null +++ b/tests/baselines/reference/functionImplementations.symbols @@ -0,0 +1,345 @@ +=== tests/cases/conformance/functions/functionImplementations.ts === + +// FunctionExpression with no return type annotation and no return statement returns void +var v: void = function () { } (); +>v : Symbol(v, Decl(functionImplementations.ts, 2, 3)) + +// FunctionExpression f with no return type annotation and directly references f in its body returns any +var a: any = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 5, 3), Decl(functionImplementations.ts, 8, 3), Decl(functionImplementations.ts, 13, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 26, 3), Decl(functionImplementations.ts, 85, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 5, 12)) + + return f; +>f : Symbol(f, Decl(functionImplementations.ts, 5, 12)) + +}; +var a: any = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 5, 3), Decl(functionImplementations.ts, 8, 3), Decl(functionImplementations.ts, 13, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 26, 3), Decl(functionImplementations.ts, 85, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 8, 12)) + + return f(); +>f : Symbol(f, Decl(functionImplementations.ts, 8, 12)) + +}; + +// FunctionExpression f with no return type annotation and indirectly references f in its body returns any +var a: any = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 5, 3), Decl(functionImplementations.ts, 8, 3), Decl(functionImplementations.ts, 13, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 26, 3), Decl(functionImplementations.ts, 85, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 13, 12)) + + var x = f; +>x : Symbol(x, Decl(functionImplementations.ts, 14, 7)) +>f : Symbol(f, Decl(functionImplementations.ts, 13, 12)) + + return x; +>x : Symbol(x, Decl(functionImplementations.ts, 14, 7)) + +}; + +// Two mutually recursive function implementations with no return type annotations +function rec1() { +>rec1 : Symbol(rec1, Decl(functionImplementations.ts, 16, 2)) + + return rec2(); +>rec2 : Symbol(rec2, Decl(functionImplementations.ts, 21, 1)) +} +function rec2() { +>rec2 : Symbol(rec2, Decl(functionImplementations.ts, 21, 1)) + + return rec1(); +>rec1 : Symbol(rec1, Decl(functionImplementations.ts, 16, 2)) +} +var a = rec1(); +>a : Symbol(a, Decl(functionImplementations.ts, 5, 3), Decl(functionImplementations.ts, 8, 3), Decl(functionImplementations.ts, 13, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 26, 3), Decl(functionImplementations.ts, 85, 3)) +>rec1 : Symbol(rec1, Decl(functionImplementations.ts, 16, 2)) + +var a = rec2(); +>a : Symbol(a, Decl(functionImplementations.ts, 5, 3), Decl(functionImplementations.ts, 8, 3), Decl(functionImplementations.ts, 13, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 26, 3), Decl(functionImplementations.ts, 85, 3)) +>rec2 : Symbol(rec2, Decl(functionImplementations.ts, 21, 1)) + +// Two mutually recursive function implementations with return type annotation in one +function rec3(): number { +>rec3 : Symbol(rec3, Decl(functionImplementations.ts, 26, 15)) + + return rec4(); +>rec4 : Symbol(rec4, Decl(functionImplementations.ts, 31, 1)) +} +function rec4() { +>rec4 : Symbol(rec4, Decl(functionImplementations.ts, 31, 1)) + + return rec3(); +>rec3 : Symbol(rec3, Decl(functionImplementations.ts, 26, 15)) +} +var n: number; +>n : Symbol(n, Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 37, 3), Decl(functionImplementations.ts, 40, 3), Decl(functionImplementations.ts, 57, 3), Decl(functionImplementations.ts, 62, 3), Decl(functionImplementations.ts, 67, 3)) + +var n = rec3(); +>n : Symbol(n, Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 37, 3), Decl(functionImplementations.ts, 40, 3), Decl(functionImplementations.ts, 57, 3), Decl(functionImplementations.ts, 62, 3), Decl(functionImplementations.ts, 67, 3)) +>rec3 : Symbol(rec3, Decl(functionImplementations.ts, 26, 15)) + +var n = rec4(); +>n : Symbol(n, Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 37, 3), Decl(functionImplementations.ts, 40, 3), Decl(functionImplementations.ts, 57, 3), Decl(functionImplementations.ts, 62, 3), Decl(functionImplementations.ts, 67, 3)) +>rec4 : Symbol(rec4, Decl(functionImplementations.ts, 31, 1)) + +// FunctionExpression with no return type annotation and returns a number +var n = function () { +>n : Symbol(n, Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 37, 3), Decl(functionImplementations.ts, 40, 3), Decl(functionImplementations.ts, 57, 3), Decl(functionImplementations.ts, 62, 3), Decl(functionImplementations.ts, 67, 3)) + + return 3; +} (); + +// FunctionExpression with no return type annotation and returns null +var nu = null; +>nu : Symbol(nu, Decl(functionImplementations.ts, 45, 3), Decl(functionImplementations.ts, 46, 3)) + +var nu = function () { +>nu : Symbol(nu, Decl(functionImplementations.ts, 45, 3), Decl(functionImplementations.ts, 46, 3)) + + return null; +} (); + +// FunctionExpression with no return type annotation and returns undefined +var un = undefined; +>un : Symbol(un, Decl(functionImplementations.ts, 51, 3), Decl(functionImplementations.ts, 52, 3)) +>undefined : Symbol(undefined) + +var un = function () { +>un : Symbol(un, Decl(functionImplementations.ts, 51, 3), Decl(functionImplementations.ts, 52, 3)) + + return undefined; +>undefined : Symbol(undefined) + +} (); + +// FunctionExpression with no return type annotation and returns a type parameter type +var n = function (x: T) { +>n : Symbol(n, Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 37, 3), Decl(functionImplementations.ts, 40, 3), Decl(functionImplementations.ts, 57, 3), Decl(functionImplementations.ts, 62, 3), Decl(functionImplementations.ts, 67, 3)) +>T : Symbol(T, Decl(functionImplementations.ts, 57, 18)) +>x : Symbol(x, Decl(functionImplementations.ts, 57, 21)) +>T : Symbol(T, Decl(functionImplementations.ts, 57, 18)) + + return x; +>x : Symbol(x, Decl(functionImplementations.ts, 57, 21)) + +} (4); + +// FunctionExpression with no return type annotation and returns a constrained type parameter type +var n = function (x: T) { +>n : Symbol(n, Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 37, 3), Decl(functionImplementations.ts, 40, 3), Decl(functionImplementations.ts, 57, 3), Decl(functionImplementations.ts, 62, 3), Decl(functionImplementations.ts, 67, 3)) +>T : Symbol(T, Decl(functionImplementations.ts, 62, 18)) +>x : Symbol(x, Decl(functionImplementations.ts, 62, 32)) +>T : Symbol(T, Decl(functionImplementations.ts, 62, 18)) + + return x; +>x : Symbol(x, Decl(functionImplementations.ts, 62, 32)) + +} (4); + +// FunctionExpression with no return type annotation with multiple return statements with identical types +var n = function () { +>n : Symbol(n, Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 37, 3), Decl(functionImplementations.ts, 40, 3), Decl(functionImplementations.ts, 57, 3), Decl(functionImplementations.ts, 62, 3), Decl(functionImplementations.ts, 67, 3)) + + return 3; + return 5; +}(); + +// Otherwise, the inferred return type is the first of the types of the return statement expressions +// in the function body that is a supertype of each of the others, +// ignoring return statements with no expressions. +// A compile - time error occurs if no return statement expression has a type that is a supertype of each of the others. +// FunctionExpression with no return type annotation with multiple return statements with subtype relation between returns +class Base { private m; } +>Base : Symbol(Base, Decl(functionImplementations.ts, 70, 4)) +>m : Symbol(m, Decl(functionImplementations.ts, 77, 12)) + +class Derived extends Base { private q; } +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 77, 25)) +>Base : Symbol(Base, Decl(functionImplementations.ts, 70, 4)) +>q : Symbol(q, Decl(functionImplementations.ts, 78, 28)) + +var b: Base; +>b : Symbol(b, Decl(functionImplementations.ts, 79, 3), Decl(functionImplementations.ts, 80, 3)) +>Base : Symbol(Base, Decl(functionImplementations.ts, 70, 4)) + +var b = function () { +>b : Symbol(b, Decl(functionImplementations.ts, 79, 3), Decl(functionImplementations.ts, 80, 3)) + + return new Base(); return new Derived(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 70, 4)) +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 77, 25)) + +} (); + +// FunctionExpression with no return type annotation with multiple return statements with one a recursive call +var a = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 5, 3), Decl(functionImplementations.ts, 8, 3), Decl(functionImplementations.ts, 13, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 26, 3), Decl(functionImplementations.ts, 85, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 85, 7)) + + return new Base(); return new Derived(); return f(); // ? +>Base : Symbol(Base, Decl(functionImplementations.ts, 70, 4)) +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 77, 25)) +>f : Symbol(f, Decl(functionImplementations.ts, 85, 7)) + +} (); + +// FunctionExpression with non -void return type annotation with a single throw statement +undefined === function (): number { +>undefined : Symbol(undefined) + + throw undefined; +>undefined : Symbol(undefined) + +}; + +// Type of 'this' in function implementation is 'any' +function thisFunc() { +>thisFunc : Symbol(thisFunc, Decl(functionImplementations.ts, 92, 2)) + + var x = this; +>x : Symbol(x, Decl(functionImplementations.ts, 96, 7), Decl(functionImplementations.ts, 97, 7)) + + var x: any; +>x : Symbol(x, Decl(functionImplementations.ts, 96, 7), Decl(functionImplementations.ts, 97, 7)) +} + +// Function signature with optional parameter, no type annotation and initializer has initializer's type +function opt1(n = 4) { +>opt1 : Symbol(opt1, Decl(functionImplementations.ts, 98, 1)) +>n : Symbol(n, Decl(functionImplementations.ts, 101, 14)) + + var m = n; +>m : Symbol(m, Decl(functionImplementations.ts, 102, 7), Decl(functionImplementations.ts, 103, 7)) +>n : Symbol(n, Decl(functionImplementations.ts, 101, 14)) + + var m: number; +>m : Symbol(m, Decl(functionImplementations.ts, 102, 7), Decl(functionImplementations.ts, 103, 7)) +} + +// Function signature with optional parameter, no type annotation and initializer has initializer's widened type +function opt2(n = { x: null, y: undefined }) { +>opt2 : Symbol(opt2, Decl(functionImplementations.ts, 104, 1)) +>n : Symbol(n, Decl(functionImplementations.ts, 107, 14)) +>x : Symbol(x, Decl(functionImplementations.ts, 107, 19)) +>y : Symbol(y, Decl(functionImplementations.ts, 107, 28)) +>undefined : Symbol(undefined) + + var m = n; +>m : Symbol(m, Decl(functionImplementations.ts, 108, 7), Decl(functionImplementations.ts, 109, 7)) +>n : Symbol(n, Decl(functionImplementations.ts, 107, 14)) + + var m: { x: any; y: any }; +>m : Symbol(m, Decl(functionImplementations.ts, 108, 7), Decl(functionImplementations.ts, 109, 7)) +>x : Symbol(x, Decl(functionImplementations.ts, 109, 12)) +>y : Symbol(y, Decl(functionImplementations.ts, 109, 20)) +} + +// Function signature with initializer referencing other parameter to the left +function opt3(n: number, m = n) { +>opt3 : Symbol(opt3, Decl(functionImplementations.ts, 110, 1)) +>n : Symbol(n, Decl(functionImplementations.ts, 113, 14)) +>m : Symbol(m, Decl(functionImplementations.ts, 113, 24)) +>n : Symbol(n, Decl(functionImplementations.ts, 113, 14)) + + var y = m; +>y : Symbol(y, Decl(functionImplementations.ts, 114, 7), Decl(functionImplementations.ts, 115, 7)) +>m : Symbol(m, Decl(functionImplementations.ts, 113, 24)) + + var y: number; +>y : Symbol(y, Decl(functionImplementations.ts, 114, 7), Decl(functionImplementations.ts, 115, 7)) +} + +// Function signature with optional parameter has correct codegen +// (tested above) + +// FunctionExpression with non -void return type annotation return with no expression +function f6(): number { +>f6 : Symbol(f6, Decl(functionImplementations.ts, 116, 1)) + + return; +} + +class Derived2 extends Base { private r: string; } +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 124, 1)) +>Base : Symbol(Base, Decl(functionImplementations.ts, 70, 4)) +>r : Symbol(r, Decl(functionImplementations.ts, 126, 29)) + +class AnotherClass { private x } +>AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 126, 50)) +>x : Symbol(x, Decl(functionImplementations.ts, 127, 20)) + +// if f is a contextually typed function expression, the inferred return type is the union type +// of the types of the return statement expressions in the function body, +// ignoring return statements with no expressions. +var f7: (x: number) => string | number = x => { // should be (x: number) => number | string +>f7 : Symbol(f7, Decl(functionImplementations.ts, 131, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 131, 9)) +>x : Symbol(x, Decl(functionImplementations.ts, 131, 40)) + + if (x < 0) { return x; } +>x : Symbol(x, Decl(functionImplementations.ts, 131, 40)) +>x : Symbol(x, Decl(functionImplementations.ts, 131, 40)) + + return x.toString(); +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(functionImplementations.ts, 131, 40)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +} +var f8: (x: number) => any = x => { // should be (x: number) => Base +>f8 : Symbol(f8, Decl(functionImplementations.ts, 135, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 135, 9)) +>x : Symbol(x, Decl(functionImplementations.ts, 135, 28)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 70, 4)) + + return new Derived2(); +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 124, 1)) +} +var f9: (x: number) => any = x => { // should be (x: number) => Base +>f9 : Symbol(f9, Decl(functionImplementations.ts, 139, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 139, 9)) +>x : Symbol(x, Decl(functionImplementations.ts, 139, 28)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 70, 4)) + + return new Derived(); +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 77, 25)) + + return new Derived2(); +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 124, 1)) +} +var f10: (x: number) => any = x => { // should be (x: number) => Derived | Derived1 +>f10 : Symbol(f10, Decl(functionImplementations.ts, 144, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 144, 10)) +>x : Symbol(x, Decl(functionImplementations.ts, 144, 29)) + + return new Derived(); +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 77, 25)) + + return new Derived2(); +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 124, 1)) +} +var f11: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass +>f11 : Symbol(f11, Decl(functionImplementations.ts, 148, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 148, 10)) +>x : Symbol(x, Decl(functionImplementations.ts, 148, 29)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 70, 4)) + + return new AnotherClass(); +>AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 126, 50)) +} +var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass +>f12 : Symbol(f12, Decl(functionImplementations.ts, 152, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 152, 10)) +>x : Symbol(x, Decl(functionImplementations.ts, 152, 29)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 70, 4)) + + return; // should be ignored + return new AnotherClass(); +>AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 126, 50)) +} diff --git a/tests/baselines/reference/functionImplementations.types b/tests/baselines/reference/functionImplementations.types new file mode 100644 index 0000000000000..6690ca68c98c6 --- /dev/null +++ b/tests/baselines/reference/functionImplementations.types @@ -0,0 +1,417 @@ +=== tests/cases/conformance/functions/functionImplementations.ts === + +// FunctionExpression with no return type annotation and no return statement returns void +var v: void = function () { } (); +>v : void +>function () { } () : void +>function () { } : () => void + +// FunctionExpression f with no return type annotation and directly references f in its body returns any +var a: any = function f() { +>a : any +>function f() { return f;} : () => any +>f : () => any + + return f; +>f : () => any + +}; +var a: any = function f() { +>a : any +>function f() { return f();} : () => any +>f : () => any + + return f(); +>f() : any +>f : () => any + +}; + +// FunctionExpression f with no return type annotation and indirectly references f in its body returns any +var a: any = function f() { +>a : any +>function f() { var x = f; return x;} : () => any +>f : () => any + + var x = f; +>x : () => any +>f : () => any + + return x; +>x : () => any + +}; + +// Two mutually recursive function implementations with no return type annotations +function rec1() { +>rec1 : () => any + + return rec2(); +>rec2() : any +>rec2 : () => any +} +function rec2() { +>rec2 : () => any + + return rec1(); +>rec1() : any +>rec1 : () => any +} +var a = rec1(); +>a : any +>rec1() : any +>rec1 : () => any + +var a = rec2(); +>a : any +>rec2() : any +>rec2 : () => any + +// Two mutually recursive function implementations with return type annotation in one +function rec3(): number { +>rec3 : () => number + + return rec4(); +>rec4() : number +>rec4 : () => number +} +function rec4() { +>rec4 : () => number + + return rec3(); +>rec3() : number +>rec3 : () => number +} +var n: number; +>n : number + +var n = rec3(); +>n : number +>rec3() : number +>rec3 : () => number + +var n = rec4(); +>n : number +>rec4() : number +>rec4 : () => number + +// FunctionExpression with no return type annotation and returns a number +var n = function () { +>n : number +>function () { return 3;} () : number +>function () { return 3;} : () => number + + return 3; +>3 : number + +} (); + +// FunctionExpression with no return type annotation and returns null +var nu = null; +>nu : any +>null : null + +var nu = function () { +>nu : any +>function () { return null;} () : any +>function () { return null;} : () => any + + return null; +>null : null + +} (); + +// FunctionExpression with no return type annotation and returns undefined +var un = undefined; +>un : any +>undefined : undefined + +var un = function () { +>un : any +>function () { return undefined;} () : any +>function () { return undefined;} : () => any + + return undefined; +>undefined : undefined + +} (); + +// FunctionExpression with no return type annotation and returns a type parameter type +var n = function (x: T) { +>n : number +>function (x: T) { return x;} (4) : number +>function (x: T) { return x;} : (x: T) => T +>T : T +>x : T +>T : T + + return x; +>x : T + +} (4); +>4 : number + +// FunctionExpression with no return type annotation and returns a constrained type parameter type +var n = function (x: T) { +>n : number +>function (x: T) { return x;} (4) : number +>function (x: T) { return x;} : (x: T) => T +>T : T +>x : T +>T : T + + return x; +>x : T + +} (4); +>4 : number + +// FunctionExpression with no return type annotation with multiple return statements with identical types +var n = function () { +>n : number +>function () { return 3; return 5;}() : number +>function () { return 3; return 5;} : () => number + + return 3; +>3 : number + + return 5; +>5 : number + +}(); + +// Otherwise, the inferred return type is the first of the types of the return statement expressions +// in the function body that is a supertype of each of the others, +// ignoring return statements with no expressions. +// A compile - time error occurs if no return statement expression has a type that is a supertype of each of the others. +// FunctionExpression with no return type annotation with multiple return statements with subtype relation between returns +class Base { private m; } +>Base : Base +>m : any + +class Derived extends Base { private q; } +>Derived : Derived +>Base : Base +>q : any + +var b: Base; +>b : Base +>Base : Base + +var b = function () { +>b : Base +>function () { return new Base(); return new Derived();} () : Base +>function () { return new Base(); return new Derived();} : () => Base + + return new Base(); return new Derived(); +>new Base() : Base +>Base : typeof Base +>new Derived() : Derived +>Derived : typeof Derived + +} (); + +// FunctionExpression with no return type annotation with multiple return statements with one a recursive call +var a = function f() { +>a : any +>function f() { return new Base(); return new Derived(); return f(); // ?} () : any +>function f() { return new Base(); return new Derived(); return f(); // ?} : () => any +>f : () => any + + return new Base(); return new Derived(); return f(); // ? +>new Base() : Base +>Base : typeof Base +>new Derived() : Derived +>Derived : typeof Derived +>f() : any +>f : () => any + +} (); + +// FunctionExpression with non -void return type annotation with a single throw statement +undefined === function (): number { +>undefined === function (): number { throw undefined;} : boolean +>undefined : undefined +>function (): number { throw undefined;} : () => number + + throw undefined; +>undefined : undefined + +}; + +// Type of 'this' in function implementation is 'any' +function thisFunc() { +>thisFunc : () => void + + var x = this; +>x : any +>this : any + + var x: any; +>x : any +} + +// Function signature with optional parameter, no type annotation and initializer has initializer's type +function opt1(n = 4) { +>opt1 : (n?: number) => void +>n : number +>4 : number + + var m = n; +>m : number +>n : number + + var m: number; +>m : number +} + +// Function signature with optional parameter, no type annotation and initializer has initializer's widened type +function opt2(n = { x: null, y: undefined }) { +>opt2 : (n?: { x: any; y: any; }) => void +>n : { x: any; y: any; } +>{ x: null, y: undefined } : { x: null; y: undefined; } +>x : null +>null : null +>y : undefined +>undefined : undefined + + var m = n; +>m : { x: any; y: any; } +>n : { x: any; y: any; } + + var m: { x: any; y: any }; +>m : { x: any; y: any; } +>x : any +>y : any +} + +// Function signature with initializer referencing other parameter to the left +function opt3(n: number, m = n) { +>opt3 : (n: number, m?: number) => void +>n : number +>m : number +>n : number + + var y = m; +>y : number +>m : number + + var y: number; +>y : number +} + +// Function signature with optional parameter has correct codegen +// (tested above) + +// FunctionExpression with non -void return type annotation return with no expression +function f6(): number { +>f6 : () => number + + return; +} + +class Derived2 extends Base { private r: string; } +>Derived2 : Derived2 +>Base : Base +>r : string + +class AnotherClass { private x } +>AnotherClass : AnotherClass +>x : any + +// if f is a contextually typed function expression, the inferred return type is the union type +// of the types of the return statement expressions in the function body, +// ignoring return statements with no expressions. +var f7: (x: number) => string | number = x => { // should be (x: number) => number | string +>f7 : (x: number) => string | number +>x : number +>x => { // should be (x: number) => number | string if (x < 0) { return x; } return x.toString();} : (x: number) => number | string +>x : number + + if (x < 0) { return x; } +>x < 0 : boolean +>x : number +>0 : number +>x : number + + return x.toString(); +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string +} +var f8: (x: number) => any = x => { // should be (x: number) => Base +>f8 : (x: number) => any +>x : number +>x => { // should be (x: number) => Base return new Base(); return new Derived2();} : (x: number) => Base +>x : number + + return new Base(); +>new Base() : Base +>Base : typeof Base + + return new Derived2(); +>new Derived2() : Derived2 +>Derived2 : typeof Derived2 +} +var f9: (x: number) => any = x => { // should be (x: number) => Base +>f9 : (x: number) => any +>x : number +>x => { // should be (x: number) => Base return new Base(); return new Derived(); return new Derived2();} : (x: number) => Base +>x : number + + return new Base(); +>new Base() : Base +>Base : typeof Base + + return new Derived(); +>new Derived() : Derived +>Derived : typeof Derived + + return new Derived2(); +>new Derived2() : Derived2 +>Derived2 : typeof Derived2 +} +var f10: (x: number) => any = x => { // should be (x: number) => Derived | Derived1 +>f10 : (x: number) => any +>x : number +>x => { // should be (x: number) => Derived | Derived1 return new Derived(); return new Derived2();} : (x: number) => Derived | Derived2 +>x : number + + return new Derived(); +>new Derived() : Derived +>Derived : typeof Derived + + return new Derived2(); +>new Derived2() : Derived2 +>Derived2 : typeof Derived2 +} +var f11: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass +>f11 : (x: number) => any +>x : number +>x => { // should be (x: number) => Base | AnotherClass return new Base(); return new AnotherClass();} : (x: number) => Base | AnotherClass +>x : number + + return new Base(); +>new Base() : Base +>Base : typeof Base + + return new AnotherClass(); +>new AnotherClass() : AnotherClass +>AnotherClass : typeof AnotherClass +} +var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass +>f12 : (x: number) => any +>x : number +>x => { // should be (x: number) => Base | AnotherClass return new Base(); return; // should be ignored return new AnotherClass();} : (x: number) => Base | AnotherClass +>x : number + + return new Base(); +>new Base() : Base +>Base : typeof Base + + return; // should be ignored + return new AnotherClass(); +>new AnotherClass() : AnotherClass +>AnotherClass : typeof AnotherClass +} diff --git a/tests/baselines/reference/functionOverloads12.errors.txt b/tests/baselines/reference/functionOverloads12.errors.txt deleted file mode 100644 index fac5cd71afe72..0000000000000 --- a/tests/baselines/reference/functionOverloads12.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/compiler/functionOverloads12.ts(3,48): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/functionOverloads12.ts (1 errors) ==== - function foo():string; - function foo():number; - function foo():any { if (true) return ""; else return 0;} - ~~~~~~ -!!! error TS7027: Unreachable code detected. - \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads12.js b/tests/baselines/reference/functionOverloads12.js index 4681e43ee5b26..8d834e8180f60 100644 --- a/tests/baselines/reference/functionOverloads12.js +++ b/tests/baselines/reference/functionOverloads12.js @@ -1,4 +1,5 @@ //// [functionOverloads12.ts] + function foo():string; function foo():number; function foo():any { if (true) return ""; else return 0;} diff --git a/tests/baselines/reference/functionOverloads12.symbols b/tests/baselines/reference/functionOverloads12.symbols new file mode 100644 index 0000000000000..4744f98c9f2ac --- /dev/null +++ b/tests/baselines/reference/functionOverloads12.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/functionOverloads12.ts === + +function foo():string; +>foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 1, 22), Decl(functionOverloads12.ts, 2, 22)) + +function foo():number; +>foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 1, 22), Decl(functionOverloads12.ts, 2, 22)) + +function foo():any { if (true) return ""; else return 0;} +>foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 1, 22), Decl(functionOverloads12.ts, 2, 22)) + diff --git a/tests/baselines/reference/functionOverloads12.types b/tests/baselines/reference/functionOverloads12.types new file mode 100644 index 0000000000000..5db8ff68cd4d7 --- /dev/null +++ b/tests/baselines/reference/functionOverloads12.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionOverloads12.ts === + +function foo():string; +>foo : { (): string; (): number; } + +function foo():number; +>foo : { (): string; (): number; } + +function foo():any { if (true) return ""; else return 0;} +>foo : { (): string; (): number; } +>true : boolean +>"" : string +>0 : number + diff --git a/tests/baselines/reference/functionReturn.errors.txt b/tests/baselines/reference/functionReturn.errors.txt deleted file mode 100644 index d5f78b2534d16..0000000000000 --- a/tests/baselines/reference/functionReturn.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/compiler/functionReturn.ts(9,5): error TS7027: Unreachable code detected. -tests/cases/compiler/functionReturn.ts(13,5): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/functionReturn.ts (2 errors) ==== - function f0(): void { } - function f1() { - var n: any = f0(); - } - function f2(): any { } - function f3(): string { return; } - function f4(): string { - return ''; - return; - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } - function f5(): string { - return ''; - return undefined; - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } \ No newline at end of file diff --git a/tests/baselines/reference/functionReturn.js b/tests/baselines/reference/functionReturn.js index c433eec190d72..42d0de5fd7c29 100644 --- a/tests/baselines/reference/functionReturn.js +++ b/tests/baselines/reference/functionReturn.js @@ -1,4 +1,5 @@ //// [functionReturn.ts] + function f0(): void { } function f1() { var n: any = f0(); diff --git a/tests/baselines/reference/functionReturn.symbols b/tests/baselines/reference/functionReturn.symbols new file mode 100644 index 0000000000000..630e435635be1 --- /dev/null +++ b/tests/baselines/reference/functionReturn.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/functionReturn.ts === + +function f0(): void { } +>f0 : Symbol(f0, Decl(functionReturn.ts, 0, 0)) + +function f1() { +>f1 : Symbol(f1, Decl(functionReturn.ts, 1, 23)) + + var n: any = f0(); +>n : Symbol(n, Decl(functionReturn.ts, 3, 7)) +>f0 : Symbol(f0, Decl(functionReturn.ts, 0, 0)) +} +function f2(): any { } +>f2 : Symbol(f2, Decl(functionReturn.ts, 4, 1)) + +function f3(): string { return; } +>f3 : Symbol(f3, Decl(functionReturn.ts, 5, 22)) + +function f4(): string { +>f4 : Symbol(f4, Decl(functionReturn.ts, 6, 33)) + + return ''; + return; +} +function f5(): string { +>f5 : Symbol(f5, Decl(functionReturn.ts, 10, 1)) + + return ''; + return undefined; +>undefined : Symbol(undefined) +} diff --git a/tests/baselines/reference/functionReturn.types b/tests/baselines/reference/functionReturn.types new file mode 100644 index 0000000000000..f9c0b36fbc23a --- /dev/null +++ b/tests/baselines/reference/functionReturn.types @@ -0,0 +1,36 @@ +=== tests/cases/compiler/functionReturn.ts === + +function f0(): void { } +>f0 : () => void + +function f1() { +>f1 : () => void + + var n: any = f0(); +>n : any +>f0() : void +>f0 : () => void +} +function f2(): any { } +>f2 : () => any + +function f3(): string { return; } +>f3 : () => string + +function f4(): string { +>f4 : () => string + + return ''; +>'' : string + + return; +} +function f5(): string { +>f5 : () => string + + return ''; +>'' : string + + return undefined; +>undefined : undefined +} diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt index 4c21fc6814cb3..a981d337093ea 100644 --- a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt @@ -1,20 +1,16 @@ -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(4,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(8,9): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(12,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(15,12): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(22,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(31,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(43,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(45,5): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(48,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(52,9): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(56,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(56,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(56,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(60,9): error TS7027: Unreachable code detected. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(5,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(13,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(23,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(32,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(44,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(49,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(57,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(57,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(57,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts (14 errors) ==== +==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts (9 errors) ==== + // return type of a function with multiple returns is the BCT of each return statement // it is an error if there is no single BCT, these are error cases @@ -25,8 +21,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return 1; } else { return ''; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } } @@ -36,8 +30,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti if (true) { return 1; } else if (false) { - ~~ -!!! error TS7027: Unreachable code detected. return 2; } else { return ''; @@ -74,8 +66,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti !!! error TS2354: No best common type exists among return expressions. return 1; return ''; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } function f6(x: T, y:U) { @@ -85,8 +75,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return x; } else { return y; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } } @@ -101,8 +89,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return x; } else { return y; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.js b/tests/baselines/reference/functionWithMultipleReturnStatements.js index 347a05d0f3355..d44c37ebbf0e7 100644 --- a/tests/baselines/reference/functionWithMultipleReturnStatements.js +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.js @@ -1,4 +1,5 @@ //// [functionWithMultipleReturnStatements.ts] + // return type of a function with multiple returns is the BCT of each return statement // it is an error if there is no single BCT, these are error cases diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt index a965a1a9a99af..0399c7a79a6a6 100644 --- a/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt @@ -1,16 +1,9 @@ -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(8,9): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(15,12): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(36,5): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(43,9): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(58,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(62,9): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(67,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(71,9): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(80,9): error TS7027: Unreachable code detected. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(89,9): error TS7027: Unreachable code detected. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(59,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(68,10): error TS2354: No best common type exists among return expressions. -==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts (10 errors) ==== +==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts (2 errors) ==== + // return type of a function with multiple returns is the BCT of each return statement // no errors expected here @@ -19,8 +12,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return 1; } else { return null; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } } @@ -28,8 +19,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti if (true) { return 1; } else if (false) { - ~~ -!!! error TS7027: Unreachable code detected. return null; } else { return 2; @@ -51,8 +40,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti function f5() { return 1; return new Object(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. } function f6(x: T) { @@ -60,8 +47,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return x; } else { return null; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } } @@ -83,8 +68,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return a; } else { return b; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } } @@ -96,8 +79,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return b; } else { return a; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } } @@ -107,8 +88,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return (x: number) => { } } else { return (x: Object) => { } - ~~~~~~ -!!! error TS7027: Unreachable code detected. } } @@ -118,7 +97,5 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti return (x: Object) => { } } else { return (x: number) => { } - ~~~~~~ -!!! error TS7027: Unreachable code detected. } } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.js b/tests/baselines/reference/functionWithMultipleReturnStatements2.js index 4674c6db953e1..efee5816fb668 100644 --- a/tests/baselines/reference/functionWithMultipleReturnStatements2.js +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.js @@ -1,4 +1,5 @@ //// [functionWithMultipleReturnStatements2.ts] + // return type of a function with multiple returns is the BCT of each return statement // no errors expected here diff --git a/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt b/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt index 4cc440ee3971c..86234b7dd81b2 100644 --- a/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt +++ b/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt @@ -1,15 +1,13 @@ -tests/cases/compiler/functionWithNoBestCommonType1.ts(1,10): error TS2354: No best common type exists among return expressions. -tests/cases/compiler/functionWithNoBestCommonType1.ts(3,5): error TS7027: Unreachable code detected. +tests/cases/compiler/functionWithNoBestCommonType1.ts(2,10): error TS2354: No best common type exists among return expressions. -==== tests/cases/compiler/functionWithNoBestCommonType1.ts (2 errors) ==== +==== tests/cases/compiler/functionWithNoBestCommonType1.ts (1 errors) ==== + function foo() { ~~~ !!! error TS2354: No best common type exists among return expressions. return true; return bar(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. } function bar(): void { diff --git a/tests/baselines/reference/functionWithNoBestCommonType1.js b/tests/baselines/reference/functionWithNoBestCommonType1.js index f7114fb40d891..4d197c24334ba 100644 --- a/tests/baselines/reference/functionWithNoBestCommonType1.js +++ b/tests/baselines/reference/functionWithNoBestCommonType1.js @@ -1,4 +1,5 @@ //// [functionWithNoBestCommonType1.ts] + function foo() { return true; return bar(); diff --git a/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt b/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt index a93161b27b833..6ce898e447cf6 100644 --- a/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt +++ b/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt @@ -1,15 +1,13 @@ -tests/cases/compiler/functionWithNoBestCommonType2.ts(1,9): error TS2354: No best common type exists among return expressions. -tests/cases/compiler/functionWithNoBestCommonType2.ts(3,4): error TS7027: Unreachable code detected. +tests/cases/compiler/functionWithNoBestCommonType2.ts(2,9): error TS2354: No best common type exists among return expressions. -==== tests/cases/compiler/functionWithNoBestCommonType2.ts (2 errors) ==== +==== tests/cases/compiler/functionWithNoBestCommonType2.ts (1 errors) ==== + var v = function () { ~~~~~~~~ !!! error TS2354: No best common type exists among return expressions. return true; return bar(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. }; function bar(): void { diff --git a/tests/baselines/reference/functionWithNoBestCommonType2.js b/tests/baselines/reference/functionWithNoBestCommonType2.js index 8e903518ec0fb..06a133b2db8ec 100644 --- a/tests/baselines/reference/functionWithNoBestCommonType2.js +++ b/tests/baselines/reference/functionWithNoBestCommonType2.js @@ -1,4 +1,5 @@ //// [functionWithNoBestCommonType2.ts] + var v = function () { return true; return bar(); diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt index 3a128de4ceed4..58ffd051d4d6b 100644 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt +++ b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt @@ -1,12 +1,10 @@ -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(2,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(68,5): error TS7027: Unreachable code detected. -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(74,5): error TS7027: Unreachable code detected. -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(94,16): error TS2378: A 'get' accessor must return a value. -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(116,9): error TS7027: Unreachable code detected. -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): error TS1003: Identifier expected. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(3,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(95,16): error TS2378: A 'get' accessor must return a value. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(118,5): error TS1003: Identifier expected. -==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (6 errors) ==== +==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (3 errors) ==== + function f1(): string { ~~~~~~ @@ -77,16 +75,12 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): e // if no return statements are present but we are annotated. throw undefined; throw null; - ~~~~~ -!!! error TS7027: Unreachable code detected. } function f15(): number { // Fine, since we have a return statement somewhere. throw undefined; throw null; - ~~~~~ -!!! error TS7027: Unreachable code detected. return; } @@ -131,8 +125,6 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): e // if no return statements are present but we are a get accessor. throw null; throw undefined. - ~~~~~ -!!! error TS7027: Unreachable code detected. } ~ !!! error TS1003: Identifier expected. diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js index 592a03d71582c..f76e5342aee29 100644 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js +++ b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js @@ -1,5 +1,6 @@ //// [functionsMissingReturnStatementsAndExpressions.ts] + function f1(): string { // errors because there are no return statements } diff --git a/tests/baselines/reference/generatedContextualTyping.errors.txt b/tests/baselines/reference/generatedContextualTyping.errors.txt deleted file mode 100644 index a2f95cdcb2373..0000000000000 --- a/tests/baselines/reference/generatedContextualTyping.errors.txt +++ /dev/null @@ -1,393 +0,0 @@ -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(150,56): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(151,72): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(152,78): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(153,59): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(154,75): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(155,81): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(156,44): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(157,49): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(158,60): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(159,59): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(160,84): error TS7027: Unreachable code detected. -tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts(161,77): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts (12 errors) ==== - class Base { private p; } - class Derived1 extends Base { private m; } - class Derived2 extends Base { private n; } - interface Genric { func(n: T[]); } - var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); - var x1: () => Base[] = () => [d1, d2]; - var x2: () => Base[] = function() { return [d1, d2] }; - var x3: () => Base[] = function named() { return [d1, d2] }; - var x4: { (): Base[]; } = () => [d1, d2]; - var x5: { (): Base[]; } = function() { return [d1, d2] }; - var x6: { (): Base[]; } = function named() { return [d1, d2] }; - var x7: Base[] = [d1, d2]; - var x8: Array = [d1, d2]; - var x9: { [n: number]: Base; } = [d1, d2]; - var x10: {n: Base[]; } = { n: [d1, d2] }; - var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; - var x12: Genric = { func: n => { return [d1, d2]; } }; - class x13 { member: () => Base[] = () => [d1, d2] } - class x14 { member: () => Base[] = function() { return [d1, d2] } } - class x15 { member: () => Base[] = function named() { return [d1, d2] } } - class x16 { member: { (): Base[]; } = () => [d1, d2] } - class x17 { member: { (): Base[]; } = function() { return [d1, d2] } } - class x18 { member: { (): Base[]; } = function named() { return [d1, d2] } } - class x19 { member: Base[] = [d1, d2] } - class x20 { member: Array = [d1, d2] } - class x21 { member: { [n: number]: Base; } = [d1, d2] } - class x22 { member: {n: Base[]; } = { n: [d1, d2] } } - class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } - class x24 { member: Genric = { func: n => { return [d1, d2]; } } } - class x25 { private member: () => Base[] = () => [d1, d2] } - class x26 { private member: () => Base[] = function() { return [d1, d2] } } - class x27 { private member: () => Base[] = function named() { return [d1, d2] } } - class x28 { private member: { (): Base[]; } = () => [d1, d2] } - class x29 { private member: { (): Base[]; } = function() { return [d1, d2] } } - class x30 { private member: { (): Base[]; } = function named() { return [d1, d2] } } - class x31 { private member: Base[] = [d1, d2] } - class x32 { private member: Array = [d1, d2] } - class x33 { private member: { [n: number]: Base; } = [d1, d2] } - class x34 { private member: {n: Base[]; } = { n: [d1, d2] } } - class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return null; } } - class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } - class x37 { public member: () => Base[] = () => [d1, d2] } - class x38 { public member: () => Base[] = function() { return [d1, d2] } } - class x39 { public member: () => Base[] = function named() { return [d1, d2] } } - class x40 { public member: { (): Base[]; } = () => [d1, d2] } - class x41 { public member: { (): Base[]; } = function() { return [d1, d2] } } - class x42 { public member: { (): Base[]; } = function named() { return [d1, d2] } } - class x43 { public member: Base[] = [d1, d2] } - class x44 { public member: Array = [d1, d2] } - class x45 { public member: { [n: number]: Base; } = [d1, d2] } - class x46 { public member: {n: Base[]; } = { n: [d1, d2] } } - class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return null; } } - class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } - class x49 { static member: () => Base[] = () => [d1, d2] } - class x50 { static member: () => Base[] = function() { return [d1, d2] } } - class x51 { static member: () => Base[] = function named() { return [d1, d2] } } - class x52 { static member: { (): Base[]; } = () => [d1, d2] } - class x53 { static member: { (): Base[]; } = function() { return [d1, d2] } } - class x54 { static member: { (): Base[]; } = function named() { return [d1, d2] } } - class x55 { static member: Base[] = [d1, d2] } - class x56 { static member: Array = [d1, d2] } - class x57 { static member: { [n: number]: Base; } = [d1, d2] } - class x58 { static member: {n: Base[]; } = { n: [d1, d2] } } - class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } - class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } - class x61 { private static member: () => Base[] = () => [d1, d2] } - class x62 { private static member: () => Base[] = function() { return [d1, d2] } } - class x63 { private static member: () => Base[] = function named() { return [d1, d2] } } - class x64 { private static member: { (): Base[]; } = () => [d1, d2] } - class x65 { private static member: { (): Base[]; } = function() { return [d1, d2] } } - class x66 { private static member: { (): Base[]; } = function named() { return [d1, d2] } } - class x67 { private static member: Base[] = [d1, d2] } - class x68 { private static member: Array = [d1, d2] } - class x69 { private static member: { [n: number]: Base; } = [d1, d2] } - class x70 { private static member: {n: Base[]; } = { n: [d1, d2] } } - class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } - class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } - class x73 { public static member: () => Base[] = () => [d1, d2] } - class x74 { public static member: () => Base[] = function() { return [d1, d2] } } - class x75 { public static member: () => Base[] = function named() { return [d1, d2] } } - class x76 { public static member: { (): Base[]; } = () => [d1, d2] } - class x77 { public static member: { (): Base[]; } = function() { return [d1, d2] } } - class x78 { public static member: { (): Base[]; } = function named() { return [d1, d2] } } - class x79 { public static member: Base[] = [d1, d2] } - class x80 { public static member: Array = [d1, d2] } - class x81 { public static member: { [n: number]: Base; } = [d1, d2] } - class x82 { public static member: {n: Base[]; } = { n: [d1, d2] } } - class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } - class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } - class x85 { constructor(parm: () => Base[] = () => [d1, d2]) { } } - class x86 { constructor(parm: () => Base[] = function() { return [d1, d2] }) { } } - class x87 { constructor(parm: () => Base[] = function named() { return [d1, d2] }) { } } - class x88 { constructor(parm: { (): Base[]; } = () => [d1, d2]) { } } - class x89 { constructor(parm: { (): Base[]; } = function() { return [d1, d2] }) { } } - class x90 { constructor(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } - class x91 { constructor(parm: Base[] = [d1, d2]) { } } - class x92 { constructor(parm: Array = [d1, d2]) { } } - class x93 { constructor(parm: { [n: number]: Base; } = [d1, d2]) { } } - class x94 { constructor(parm: {n: Base[]; } = { n: [d1, d2] }) { } } - class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } - class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } - class x97 { constructor(public parm: () => Base[] = () => [d1, d2]) { } } - class x98 { constructor(public parm: () => Base[] = function() { return [d1, d2] }) { } } - class x99 { constructor(public parm: () => Base[] = function named() { return [d1, d2] }) { } } - class x100 { constructor(public parm: { (): Base[]; } = () => [d1, d2]) { } } - class x101 { constructor(public parm: { (): Base[]; } = function() { return [d1, d2] }) { } } - class x102 { constructor(public parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } - class x103 { constructor(public parm: Base[] = [d1, d2]) { } } - class x104 { constructor(public parm: Array = [d1, d2]) { } } - class x105 { constructor(public parm: { [n: number]: Base; } = [d1, d2]) { } } - class x106 { constructor(public parm: {n: Base[]; } = { n: [d1, d2] }) { } } - class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } - class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } - class x109 { constructor(private parm: () => Base[] = () => [d1, d2]) { } } - class x110 { constructor(private parm: () => Base[] = function() { return [d1, d2] }) { } } - class x111 { constructor(private parm: () => Base[] = function named() { return [d1, d2] }) { } } - class x112 { constructor(private parm: { (): Base[]; } = () => [d1, d2]) { } } - class x113 { constructor(private parm: { (): Base[]; } = function() { return [d1, d2] }) { } } - class x114 { constructor(private parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } - class x115 { constructor(private parm: Base[] = [d1, d2]) { } } - class x116 { constructor(private parm: Array = [d1, d2]) { } } - class x117 { constructor(private parm: { [n: number]: Base; } = [d1, d2]) { } } - class x118 { constructor(private parm: {n: Base[]; } = { n: [d1, d2] }) { } } - class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } - class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } - function x121(parm: () => Base[] = () => [d1, d2]) { } - function x122(parm: () => Base[] = function() { return [d1, d2] }) { } - function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } - function x124(parm: { (): Base[]; } = () => [d1, d2]) { } - function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } - function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } - function x127(parm: Base[] = [d1, d2]) { } - function x128(parm: Array = [d1, d2]) { } - function x129(parm: { [n: number]: Base; } = [d1, d2]) { } - function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } - function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } - function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } - function x133(): () => Base[] { return () => [d1, d2]; } - function x134(): () => Base[] { return function() { return [d1, d2] }; } - function x135(): () => Base[] { return function named() { return [d1, d2] }; } - function x136(): { (): Base[]; } { return () => [d1, d2]; } - function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } - function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } - function x139(): Base[] { return [d1, d2]; } - function x140(): Array { return [d1, d2]; } - function x141(): { [n: number]: Base; } { return [d1, d2]; } - function x142(): {n: Base[]; } { return { n: [d1, d2] }; } - function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; } - function x144(): Genric { return { func: n => { return [d1, d2]; } }; } - function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x151(): Base[] { return [d1, d2]; return [d1, d2]; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x152(): Array { return [d1, d2]; return [d1, d2]; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] }; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; return n => { var n: Base[]; return null; }; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } - ~~~~~~ -!!! error TS7027: Unreachable code detected. - var x157: () => () => Base[] = () => { return () => [d1, d2]; }; - var x158: () => () => Base[] = () => { return function() { return [d1, d2] }; }; - var x159: () => () => Base[] = () => { return function named() { return [d1, d2] }; }; - var x160: () => { (): Base[]; } = () => { return () => [d1, d2]; }; - var x161: () => { (): Base[]; } = () => { return function() { return [d1, d2] }; }; - var x162: () => { (): Base[]; } = () => { return function named() { return [d1, d2] }; }; - var x163: () => Base[] = () => { return [d1, d2]; }; - var x164: () => Array = () => { return [d1, d2]; }; - var x165: () => { [n: number]: Base; } = () => { return [d1, d2]; }; - var x166: () => {n: Base[]; } = () => { return { n: [d1, d2] }; }; - var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return null; }; }; - var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; - var x169: () => () => Base[] = function() { return () => [d1, d2]; }; - var x170: () => () => Base[] = function() { return function() { return [d1, d2] }; }; - var x171: () => () => Base[] = function() { return function named() { return [d1, d2] }; }; - var x172: () => { (): Base[]; } = function() { return () => [d1, d2]; }; - var x173: () => { (): Base[]; } = function() { return function() { return [d1, d2] }; }; - var x174: () => { (): Base[]; } = function() { return function named() { return [d1, d2] }; }; - var x175: () => Base[] = function() { return [d1, d2]; }; - var x176: () => Array = function() { return [d1, d2]; }; - var x177: () => { [n: number]: Base; } = function() { return [d1, d2]; }; - var x178: () => {n: Base[]; } = function() { return { n: [d1, d2] }; }; - var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; return null; }; }; - var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; - module x181 { var t: () => Base[] = () => [d1, d2]; } - module x182 { var t: () => Base[] = function() { return [d1, d2] }; } - module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } - module x184 { var t: { (): Base[]; } = () => [d1, d2]; } - module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } - module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } - module x187 { var t: Base[] = [d1, d2]; } - module x188 { var t: Array = [d1, d2]; } - module x189 { var t: { [n: number]: Base; } = [d1, d2]; } - module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } - module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } - module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } - module x193 { export var t: () => Base[] = () => [d1, d2]; } - module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } - module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; } - module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } - module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } - module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] }; } - module x199 { export var t: Base[] = [d1, d2]; } - module x200 { export var t: Array = [d1, d2]; } - module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } - module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } - module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } - module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } - var x206 = <() => Base[]>function() { return [d1, d2] }; - var x207 = <() => Base[]>function named() { return [d1, d2] }; - var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; - var x210 = <{ (): Base[]; }>function named() { return [d1, d2] }; - var x211 = [d1, d2]; - var x212 = >[d1, d2]; - var x213 = <{ [n: number]: Base; }>[d1, d2]; - var x214 = <{n: Base[]; } >{ n: [d1, d2] }; - var x216 = >{ func: n => { return [d1, d2]; } }; - var x217 = (<() => Base[]>undefined) || function() { return [d1, d2] }; - var x218 = (<() => Base[]>undefined) || function named() { return [d1, d2] }; - var x219 = (<{ (): Base[]; }>undefined) || function() { return [d1, d2] }; - var x220 = (<{ (): Base[]; }>undefined) || function named() { return [d1, d2] }; - var x221 = (undefined) || [d1, d2]; - var x222 = (>undefined) || [d1, d2]; - var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2]; - var x224 = (<{n: Base[]; } >undefined) || { n: [d1, d2] }; - var x225: () => Base[]; x225 = () => [d1, d2]; - var x226: () => Base[]; x226 = function() { return [d1, d2] }; - var x227: () => Base[]; x227 = function named() { return [d1, d2] }; - var x228: { (): Base[]; }; x228 = () => [d1, d2]; - var x229: { (): Base[]; }; x229 = function() { return [d1, d2] }; - var x230: { (): Base[]; }; x230 = function named() { return [d1, d2] }; - var x231: Base[]; x231 = [d1, d2]; - var x232: Array; x232 = [d1, d2]; - var x233: { [n: number]: Base; }; x233 = [d1, d2]; - var x234: {n: Base[]; } ; x234 = { n: [d1, d2] }; - var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; - var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; - var x237: { n: () => Base[]; } = { n: () => [d1, d2] }; - var x238: { n: () => Base[]; } = { n: function() { return [d1, d2] } }; - var x239: { n: () => Base[]; } = { n: function named() { return [d1, d2] } }; - var x240: { n: { (): Base[]; }; } = { n: () => [d1, d2] }; - var x241: { n: { (): Base[]; }; } = { n: function() { return [d1, d2] } }; - var x242: { n: { (): Base[]; }; } = { n: function named() { return [d1, d2] } }; - var x243: { n: Base[]; } = { n: [d1, d2] }; - var x244: { n: Array; } = { n: [d1, d2] }; - var x245: { n: { [n: number]: Base; }; } = { n: [d1, d2] }; - var x246: { n: {n: Base[]; } ; } = { n: { n: [d1, d2] } }; - var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } }; - var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; - var x252: { (): Base[]; }[] = [() => [d1, d2]]; - var x253: { (): Base[]; }[] = [function() { return [d1, d2] }]; - var x254: { (): Base[]; }[] = [function named() { return [d1, d2] }]; - var x255: Base[][] = [[d1, d2]]; - var x256: Array[] = [[d1, d2]]; - var x257: { [n: number]: Base; }[] = [[d1, d2]]; - var x258: {n: Base[]; } [] = [{ n: [d1, d2] }]; - var x260: Genric[] = [{ func: n => { return [d1, d2]; } }]; - var x261: () => Base[] = function() { return [d1, d2] } || undefined; - var x262: () => Base[] = function named() { return [d1, d2] } || undefined; - var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; - var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; - var x265: Base[] = [d1, d2] || undefined; - var x266: Array = [d1, d2] || undefined; - var x267: { [n: number]: Base; } = [d1, d2] || undefined; - var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; - var x269: () => Base[] = undefined || function() { return [d1, d2] }; - var x270: () => Base[] = undefined || function named() { return [d1, d2] }; - var x271: { (): Base[]; } = undefined || function() { return [d1, d2] }; - var x272: { (): Base[]; } = undefined || function named() { return [d1, d2] }; - var x273: Base[] = undefined || [d1, d2]; - var x274: Array = undefined || [d1, d2]; - var x275: { [n: number]: Base; } = undefined || [d1, d2]; - var x276: {n: Base[]; } = undefined || { n: [d1, d2] }; - var x277: () => Base[] = function() { return [d1, d2] } || function() { return [d1, d2] }; - var x278: () => Base[] = function named() { return [d1, d2] } || function named() { return [d1, d2] }; - var x279: { (): Base[]; } = function() { return [d1, d2] } || function() { return [d1, d2] }; - var x280: { (): Base[]; } = function named() { return [d1, d2] } || function named() { return [d1, d2] }; - var x281: Base[] = [d1, d2] || [d1, d2]; - var x282: Array = [d1, d2] || [d1, d2]; - var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2]; - var x284: {n: Base[]; } = { n: [d1, d2] } || { n: [d1, d2] }; - var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; - var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; - var x287: () => Base[] = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; - var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; - var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; - var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; - var x291: Base[] = true ? [d1, d2] : [d1, d2]; - var x292: Array = true ? [d1, d2] : [d1, d2]; - var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; - var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; - var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; }; - var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; - var x297: () => Base[] = true ? undefined : () => [d1, d2]; - var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; - var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] }; - var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; - var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; - var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2] }; - var x303: Base[] = true ? undefined : [d1, d2]; - var x304: Array = true ? undefined : [d1, d2]; - var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; - var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; - var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return null; }; - var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; - var x309: () => Base[] = true ? () => [d1, d2] : undefined; - var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; - var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined; - var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; - var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; - var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefined; - var x315: Base[] = true ? [d1, d2] : undefined; - var x316: Array = true ? [d1, d2] : undefined; - var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; - var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; - var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : undefined; - var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; - function x321(n: () => Base[]) { }; x321(() => [d1, d2]); - function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); - function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); - function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); - function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); - function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] }); - function x327(n: Base[]) { }; x327([d1, d2]); - function x328(n: Array) { }; x328([d1, d2]); - function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); - function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); - function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null; }); - function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); - var x333 = (n: () => Base[]) => n; x333(() => [d1, d2]); - var x334 = (n: () => Base[]) => n; x334(function() { return [d1, d2] }); - var x335 = (n: () => Base[]) => n; x335(function named() { return [d1, d2] }); - var x336 = (n: { (): Base[]; }) => n; x336(() => [d1, d2]); - var x337 = (n: { (): Base[]; }) => n; x337(function() { return [d1, d2] }); - var x338 = (n: { (): Base[]; }) => n; x338(function named() { return [d1, d2] }); - var x339 = (n: Base[]) => n; x339([d1, d2]); - var x340 = (n: Array) => n; x340([d1, d2]); - var x341 = (n: { [n: number]: Base; }) => n; x341([d1, d2]); - var x342 = (n: {n: Base[]; } ) => n; x342({ n: [d1, d2] }); - var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; }); - var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); - var x345 = function(n: () => Base[]) { }; x345(() => [d1, d2]); - var x346 = function(n: () => Base[]) { }; x346(function() { return [d1, d2] }); - var x347 = function(n: () => Base[]) { }; x347(function named() { return [d1, d2] }); - var x348 = function(n: { (): Base[]; }) { }; x348(() => [d1, d2]); - var x349 = function(n: { (): Base[]; }) { }; x349(function() { return [d1, d2] }); - var x350 = function(n: { (): Base[]; }) { }; x350(function named() { return [d1, d2] }); - var x351 = function(n: Base[]) { }; x351([d1, d2]); - var x352 = function(n: Array) { }; x352([d1, d2]); - var x353 = function(n: { [n: number]: Base; }) { }; x353([d1, d2]); - var x354 = function(n: {n: Base[]; } ) { }; x354({ n: [d1, d2] }); - var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; return null; }); - var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); \ No newline at end of file diff --git a/tests/baselines/reference/generatedContextualTyping.js b/tests/baselines/reference/generatedContextualTyping.js index 1f7d2b8035fb5..a867d4b762933 100644 --- a/tests/baselines/reference/generatedContextualTyping.js +++ b/tests/baselines/reference/generatedContextualTyping.js @@ -1,4 +1,5 @@ //// [generatedContextualTyping.ts] + class Base { private p; } class Derived1 extends Base { private m; } class Derived2 extends Base { private n; } diff --git a/tests/baselines/reference/generatedContextualTyping.symbols b/tests/baselines/reference/generatedContextualTyping.symbols new file mode 100644 index 0000000000000..bc50fcc25c60a --- /dev/null +++ b/tests/baselines/reference/generatedContextualTyping.symbols @@ -0,0 +1,2832 @@ +=== tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts === + +class Base { private p; } +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>p : Symbol(p, Decl(generatedContextualTyping.ts, 1, 12)) + +class Derived1 extends Base { private m; } +>Derived1 : Symbol(Derived1, Decl(generatedContextualTyping.ts, 1, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>m : Symbol(m, Decl(generatedContextualTyping.ts, 2, 29)) + +class Derived2 extends Base { private n; } +>Derived2 : Symbol(Derived2, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 3, 29)) + +interface Genric { func(n: T[]); } +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>T : Symbol(T, Decl(generatedContextualTyping.ts, 4, 17)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 4, 21)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 4, 27)) +>T : Symbol(T, Decl(generatedContextualTyping.ts, 4, 17)) + +var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); +>b : Symbol(b, Decl(generatedContextualTyping.ts, 5, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>Derived1 : Symbol(Derived1, Decl(generatedContextualTyping.ts, 1, 25)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>Derived2 : Symbol(Derived2, Decl(generatedContextualTyping.ts, 2, 42)) + +var x1: () => Base[] = () => [d1, d2]; +>x1 : Symbol(x1, Decl(generatedContextualTyping.ts, 6, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x2: () => Base[] = function() { return [d1, d2] }; +>x2 : Symbol(x2, Decl(generatedContextualTyping.ts, 7, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x3: () => Base[] = function named() { return [d1, d2] }; +>x3 : Symbol(x3, Decl(generatedContextualTyping.ts, 8, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 8, 22)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x4: { (): Base[]; } = () => [d1, d2]; +>x4 : Symbol(x4, Decl(generatedContextualTyping.ts, 9, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x5: { (): Base[]; } = function() { return [d1, d2] }; +>x5 : Symbol(x5, Decl(generatedContextualTyping.ts, 10, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x6: { (): Base[]; } = function named() { return [d1, d2] }; +>x6 : Symbol(x6, Decl(generatedContextualTyping.ts, 11, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 11, 25)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x7: Base[] = [d1, d2]; +>x7 : Symbol(x7, Decl(generatedContextualTyping.ts, 12, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x8: Array = [d1, d2]; +>x8 : Symbol(x8, Decl(generatedContextualTyping.ts, 13, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x9: { [n: number]: Base; } = [d1, d2]; +>x9 : Symbol(x9, Decl(generatedContextualTyping.ts, 14, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 14, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x10: {n: Base[]; } = { n: [d1, d2] }; +>x10 : Symbol(x10, Decl(generatedContextualTyping.ts, 15, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 15, 10)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 15, 27)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; +>x11 : Symbol(x11, Decl(generatedContextualTyping.ts, 16, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 16, 10)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 16, 29), Decl(generatedContextualTyping.ts, 16, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 16, 29), Decl(generatedContextualTyping.ts, 16, 40)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x12: Genric = { func: n => { return [d1, d2]; } }; +>x12 : Symbol(x12, Decl(generatedContextualTyping.ts, 17, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 17, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 17, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x13 { member: () => Base[] = () => [d1, d2] } +>x13 : Symbol(x13, Decl(generatedContextualTyping.ts, 17, 60)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 18, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x14 { member: () => Base[] = function() { return [d1, d2] } } +>x14 : Symbol(x14, Decl(generatedContextualTyping.ts, 18, 51)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 19, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x15 { member: () => Base[] = function named() { return [d1, d2] } } +>x15 : Symbol(x15, Decl(generatedContextualTyping.ts, 19, 67)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 20, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 20, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x16 { member: { (): Base[]; } = () => [d1, d2] } +>x16 : Symbol(x16, Decl(generatedContextualTyping.ts, 20, 73)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 21, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x17 { member: { (): Base[]; } = function() { return [d1, d2] } } +>x17 : Symbol(x17, Decl(generatedContextualTyping.ts, 21, 54)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 22, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x18 { member: { (): Base[]; } = function named() { return [d1, d2] } } +>x18 : Symbol(x18, Decl(generatedContextualTyping.ts, 22, 70)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 23, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 23, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x19 { member: Base[] = [d1, d2] } +>x19 : Symbol(x19, Decl(generatedContextualTyping.ts, 23, 76)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 24, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x20 { member: Array = [d1, d2] } +>x20 : Symbol(x20, Decl(generatedContextualTyping.ts, 24, 39)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 25, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x21 { member: { [n: number]: Base; } = [d1, d2] } +>x21 : Symbol(x21, Decl(generatedContextualTyping.ts, 25, 44)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 26, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 26, 23)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x22 { member: {n: Base[]; } = { n: [d1, d2] } } +>x22 : Symbol(x22, Decl(generatedContextualTyping.ts, 26, 55)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 27, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 27, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 27, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x23 : Symbol(x23, Decl(generatedContextualTyping.ts, 27, 54)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 28, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 28, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 28, 40), Decl(generatedContextualTyping.ts, 28, 51)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 28, 40), Decl(generatedContextualTyping.ts, 28, 51)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x24 { member: Genric = { func: n => { return [d1, d2]; } } } +>x24 : Symbol(x24, Decl(generatedContextualTyping.ts, 28, 79)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 29, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 29, 36)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 29, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x25 { private member: () => Base[] = () => [d1, d2] } +>x25 : Symbol(x25, Decl(generatedContextualTyping.ts, 29, 72)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 30, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x26 { private member: () => Base[] = function() { return [d1, d2] } } +>x26 : Symbol(x26, Decl(generatedContextualTyping.ts, 30, 59)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 31, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x27 { private member: () => Base[] = function named() { return [d1, d2] } } +>x27 : Symbol(x27, Decl(generatedContextualTyping.ts, 31, 75)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 32, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 32, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x28 { private member: { (): Base[]; } = () => [d1, d2] } +>x28 : Symbol(x28, Decl(generatedContextualTyping.ts, 32, 81)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 33, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x29 { private member: { (): Base[]; } = function() { return [d1, d2] } } +>x29 : Symbol(x29, Decl(generatedContextualTyping.ts, 33, 62)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 34, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x30 { private member: { (): Base[]; } = function named() { return [d1, d2] } } +>x30 : Symbol(x30, Decl(generatedContextualTyping.ts, 34, 78)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 35, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 35, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x31 { private member: Base[] = [d1, d2] } +>x31 : Symbol(x31, Decl(generatedContextualTyping.ts, 35, 84)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 36, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x32 { private member: Array = [d1, d2] } +>x32 : Symbol(x32, Decl(generatedContextualTyping.ts, 36, 47)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 37, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x33 { private member: { [n: number]: Base; } = [d1, d2] } +>x33 : Symbol(x33, Decl(generatedContextualTyping.ts, 37, 52)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 38, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 38, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x34 { private member: {n: Base[]; } = { n: [d1, d2] } } +>x34 : Symbol(x34, Decl(generatedContextualTyping.ts, 38, 63)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 39, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 39, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 39, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x35 : Symbol(x35, Decl(generatedContextualTyping.ts, 39, 62)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 40, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 40, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 40, 48), Decl(generatedContextualTyping.ts, 40, 59)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 40, 48), Decl(generatedContextualTyping.ts, 40, 59)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } +>x36 : Symbol(x36, Decl(generatedContextualTyping.ts, 40, 87)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 41, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 41, 44)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 41, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x37 { public member: () => Base[] = () => [d1, d2] } +>x37 : Symbol(x37, Decl(generatedContextualTyping.ts, 41, 80)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 42, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x38 { public member: () => Base[] = function() { return [d1, d2] } } +>x38 : Symbol(x38, Decl(generatedContextualTyping.ts, 42, 58)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 43, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x39 { public member: () => Base[] = function named() { return [d1, d2] } } +>x39 : Symbol(x39, Decl(generatedContextualTyping.ts, 43, 74)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 44, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 44, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x40 { public member: { (): Base[]; } = () => [d1, d2] } +>x40 : Symbol(x40, Decl(generatedContextualTyping.ts, 44, 80)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 45, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x41 { public member: { (): Base[]; } = function() { return [d1, d2] } } +>x41 : Symbol(x41, Decl(generatedContextualTyping.ts, 45, 61)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 46, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x42 { public member: { (): Base[]; } = function named() { return [d1, d2] } } +>x42 : Symbol(x42, Decl(generatedContextualTyping.ts, 46, 77)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 47, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 47, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x43 { public member: Base[] = [d1, d2] } +>x43 : Symbol(x43, Decl(generatedContextualTyping.ts, 47, 83)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 48, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x44 { public member: Array = [d1, d2] } +>x44 : Symbol(x44, Decl(generatedContextualTyping.ts, 48, 46)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 49, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x45 { public member: { [n: number]: Base; } = [d1, d2] } +>x45 : Symbol(x45, Decl(generatedContextualTyping.ts, 49, 51)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 50, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 50, 30)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x46 { public member: {n: Base[]; } = { n: [d1, d2] } } +>x46 : Symbol(x46, Decl(generatedContextualTyping.ts, 50, 62)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 51, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 51, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 51, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x47 : Symbol(x47, Decl(generatedContextualTyping.ts, 51, 61)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 52, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 52, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 52, 47), Decl(generatedContextualTyping.ts, 52, 58)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 52, 47), Decl(generatedContextualTyping.ts, 52, 58)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } +>x48 : Symbol(x48, Decl(generatedContextualTyping.ts, 52, 86)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 53, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 53, 43)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 53, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x49 { static member: () => Base[] = () => [d1, d2] } +>x49 : Symbol(x49, Decl(generatedContextualTyping.ts, 53, 79)) +>member : Symbol(x49.member, Decl(generatedContextualTyping.ts, 54, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x50 { static member: () => Base[] = function() { return [d1, d2] } } +>x50 : Symbol(x50, Decl(generatedContextualTyping.ts, 54, 58)) +>member : Symbol(x50.member, Decl(generatedContextualTyping.ts, 55, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x51 { static member: () => Base[] = function named() { return [d1, d2] } } +>x51 : Symbol(x51, Decl(generatedContextualTyping.ts, 55, 74)) +>member : Symbol(x51.member, Decl(generatedContextualTyping.ts, 56, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 56, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x52 { static member: { (): Base[]; } = () => [d1, d2] } +>x52 : Symbol(x52, Decl(generatedContextualTyping.ts, 56, 80)) +>member : Symbol(x52.member, Decl(generatedContextualTyping.ts, 57, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x53 { static member: { (): Base[]; } = function() { return [d1, d2] } } +>x53 : Symbol(x53, Decl(generatedContextualTyping.ts, 57, 61)) +>member : Symbol(x53.member, Decl(generatedContextualTyping.ts, 58, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x54 { static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x54 : Symbol(x54, Decl(generatedContextualTyping.ts, 58, 77)) +>member : Symbol(x54.member, Decl(generatedContextualTyping.ts, 59, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 59, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x55 { static member: Base[] = [d1, d2] } +>x55 : Symbol(x55, Decl(generatedContextualTyping.ts, 59, 83)) +>member : Symbol(x55.member, Decl(generatedContextualTyping.ts, 60, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x56 { static member: Array = [d1, d2] } +>x56 : Symbol(x56, Decl(generatedContextualTyping.ts, 60, 46)) +>member : Symbol(x56.member, Decl(generatedContextualTyping.ts, 61, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x57 { static member: { [n: number]: Base; } = [d1, d2] } +>x57 : Symbol(x57, Decl(generatedContextualTyping.ts, 61, 51)) +>member : Symbol(x57.member, Decl(generatedContextualTyping.ts, 62, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 62, 30)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x58 { static member: {n: Base[]; } = { n: [d1, d2] } } +>x58 : Symbol(x58, Decl(generatedContextualTyping.ts, 62, 62)) +>member : Symbol(x58.member, Decl(generatedContextualTyping.ts, 63, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 63, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 63, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x59 : Symbol(x59, Decl(generatedContextualTyping.ts, 63, 61)) +>member : Symbol(x59.member, Decl(generatedContextualTyping.ts, 64, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 64, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 64, 47), Decl(generatedContextualTyping.ts, 64, 58)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 64, 47), Decl(generatedContextualTyping.ts, 64, 58)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } +>x60 : Symbol(x60, Decl(generatedContextualTyping.ts, 64, 86)) +>member : Symbol(x60.member, Decl(generatedContextualTyping.ts, 65, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 65, 43)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 65, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x61 { private static member: () => Base[] = () => [d1, d2] } +>x61 : Symbol(x61, Decl(generatedContextualTyping.ts, 65, 79)) +>member : Symbol(x61.member, Decl(generatedContextualTyping.ts, 66, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x62 { private static member: () => Base[] = function() { return [d1, d2] } } +>x62 : Symbol(x62, Decl(generatedContextualTyping.ts, 66, 66)) +>member : Symbol(x62.member, Decl(generatedContextualTyping.ts, 67, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x63 { private static member: () => Base[] = function named() { return [d1, d2] } } +>x63 : Symbol(x63, Decl(generatedContextualTyping.ts, 67, 82)) +>member : Symbol(x63.member, Decl(generatedContextualTyping.ts, 68, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 68, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x64 { private static member: { (): Base[]; } = () => [d1, d2] } +>x64 : Symbol(x64, Decl(generatedContextualTyping.ts, 68, 88)) +>member : Symbol(x64.member, Decl(generatedContextualTyping.ts, 69, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x65 { private static member: { (): Base[]; } = function() { return [d1, d2] } } +>x65 : Symbol(x65, Decl(generatedContextualTyping.ts, 69, 69)) +>member : Symbol(x65.member, Decl(generatedContextualTyping.ts, 70, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x66 { private static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x66 : Symbol(x66, Decl(generatedContextualTyping.ts, 70, 85)) +>member : Symbol(x66.member, Decl(generatedContextualTyping.ts, 71, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 71, 52)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x67 { private static member: Base[] = [d1, d2] } +>x67 : Symbol(x67, Decl(generatedContextualTyping.ts, 71, 91)) +>member : Symbol(x67.member, Decl(generatedContextualTyping.ts, 72, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x68 { private static member: Array = [d1, d2] } +>x68 : Symbol(x68, Decl(generatedContextualTyping.ts, 72, 54)) +>member : Symbol(x68.member, Decl(generatedContextualTyping.ts, 73, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x69 { private static member: { [n: number]: Base; } = [d1, d2] } +>x69 : Symbol(x69, Decl(generatedContextualTyping.ts, 73, 59)) +>member : Symbol(x69.member, Decl(generatedContextualTyping.ts, 74, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 74, 38)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x70 { private static member: {n: Base[]; } = { n: [d1, d2] } } +>x70 : Symbol(x70, Decl(generatedContextualTyping.ts, 74, 70)) +>member : Symbol(x70.member, Decl(generatedContextualTyping.ts, 75, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 75, 36)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 75, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x71 : Symbol(x71, Decl(generatedContextualTyping.ts, 75, 69)) +>member : Symbol(x71.member, Decl(generatedContextualTyping.ts, 76, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 76, 36)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 76, 55), Decl(generatedContextualTyping.ts, 76, 66)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 76, 55), Decl(generatedContextualTyping.ts, 76, 66)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } +>x72 : Symbol(x72, Decl(generatedContextualTyping.ts, 76, 94)) +>member : Symbol(x72.member, Decl(generatedContextualTyping.ts, 77, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 77, 51)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 77, 57)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x73 { public static member: () => Base[] = () => [d1, d2] } +>x73 : Symbol(x73, Decl(generatedContextualTyping.ts, 77, 87)) +>member : Symbol(x73.member, Decl(generatedContextualTyping.ts, 78, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x74 { public static member: () => Base[] = function() { return [d1, d2] } } +>x74 : Symbol(x74, Decl(generatedContextualTyping.ts, 78, 65)) +>member : Symbol(x74.member, Decl(generatedContextualTyping.ts, 79, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x75 { public static member: () => Base[] = function named() { return [d1, d2] } } +>x75 : Symbol(x75, Decl(generatedContextualTyping.ts, 79, 81)) +>member : Symbol(x75.member, Decl(generatedContextualTyping.ts, 80, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 80, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x76 { public static member: { (): Base[]; } = () => [d1, d2] } +>x76 : Symbol(x76, Decl(generatedContextualTyping.ts, 80, 87)) +>member : Symbol(x76.member, Decl(generatedContextualTyping.ts, 81, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x77 { public static member: { (): Base[]; } = function() { return [d1, d2] } } +>x77 : Symbol(x77, Decl(generatedContextualTyping.ts, 81, 68)) +>member : Symbol(x77.member, Decl(generatedContextualTyping.ts, 82, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x78 { public static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x78 : Symbol(x78, Decl(generatedContextualTyping.ts, 82, 84)) +>member : Symbol(x78.member, Decl(generatedContextualTyping.ts, 83, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 83, 51)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x79 { public static member: Base[] = [d1, d2] } +>x79 : Symbol(x79, Decl(generatedContextualTyping.ts, 83, 90)) +>member : Symbol(x79.member, Decl(generatedContextualTyping.ts, 84, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x80 { public static member: Array = [d1, d2] } +>x80 : Symbol(x80, Decl(generatedContextualTyping.ts, 84, 53)) +>member : Symbol(x80.member, Decl(generatedContextualTyping.ts, 85, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x81 { public static member: { [n: number]: Base; } = [d1, d2] } +>x81 : Symbol(x81, Decl(generatedContextualTyping.ts, 85, 58)) +>member : Symbol(x81.member, Decl(generatedContextualTyping.ts, 86, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 86, 37)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x82 { public static member: {n: Base[]; } = { n: [d1, d2] } } +>x82 : Symbol(x82, Decl(generatedContextualTyping.ts, 86, 69)) +>member : Symbol(x82.member, Decl(generatedContextualTyping.ts, 87, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 87, 35)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 87, 52)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x83 : Symbol(x83, Decl(generatedContextualTyping.ts, 87, 68)) +>member : Symbol(x83.member, Decl(generatedContextualTyping.ts, 88, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 88, 35)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 88, 54), Decl(generatedContextualTyping.ts, 88, 65)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 88, 54), Decl(generatedContextualTyping.ts, 88, 65)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } +>x84 : Symbol(x84, Decl(generatedContextualTyping.ts, 88, 93)) +>member : Symbol(x84.member, Decl(generatedContextualTyping.ts, 89, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 89, 50)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 89, 56)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x85 { constructor(parm: () => Base[] = () => [d1, d2]) { } } +>x85 : Symbol(x85, Decl(generatedContextualTyping.ts, 89, 86)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 90, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x86 { constructor(parm: () => Base[] = function() { return [d1, d2] }) { } } +>x86 : Symbol(x86, Decl(generatedContextualTyping.ts, 90, 66)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 91, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x87 { constructor(parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x87 : Symbol(x87, Decl(generatedContextualTyping.ts, 91, 82)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 92, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 92, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x88 { constructor(parm: { (): Base[]; } = () => [d1, d2]) { } } +>x88 : Symbol(x88, Decl(generatedContextualTyping.ts, 92, 88)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 93, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x89 { constructor(parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x89 : Symbol(x89, Decl(generatedContextualTyping.ts, 93, 69)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 94, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x90 { constructor(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x90 : Symbol(x90, Decl(generatedContextualTyping.ts, 94, 85)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 95, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 95, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x91 { constructor(parm: Base[] = [d1, d2]) { } } +>x91 : Symbol(x91, Decl(generatedContextualTyping.ts, 95, 91)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 96, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x92 { constructor(parm: Array = [d1, d2]) { } } +>x92 : Symbol(x92, Decl(generatedContextualTyping.ts, 96, 54)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 97, 24)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x93 { constructor(parm: { [n: number]: Base; } = [d1, d2]) { } } +>x93 : Symbol(x93, Decl(generatedContextualTyping.ts, 97, 59)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 98, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 98, 33)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x94 { constructor(parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x94 : Symbol(x94, Decl(generatedContextualTyping.ts, 98, 70)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 99, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 99, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 99, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x95 : Symbol(x95, Decl(generatedContextualTyping.ts, 99, 69)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 100, 24)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 100, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 100, 50), Decl(generatedContextualTyping.ts, 100, 61)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 100, 50), Decl(generatedContextualTyping.ts, 100, 61)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x96 : Symbol(x96, Decl(generatedContextualTyping.ts, 100, 94)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 101, 24)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 101, 46)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 101, 52)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x97 { constructor(public parm: () => Base[] = () => [d1, d2]) { } } +>x97 : Symbol(x97, Decl(generatedContextualTyping.ts, 101, 87)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 102, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x98 { constructor(public parm: () => Base[] = function() { return [d1, d2] }) { } } +>x98 : Symbol(x98, Decl(generatedContextualTyping.ts, 102, 73)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 103, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x99 { constructor(public parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x99 : Symbol(x99, Decl(generatedContextualTyping.ts, 103, 89)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 104, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 104, 51)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x100 { constructor(public parm: { (): Base[]; } = () => [d1, d2]) { } } +>x100 : Symbol(x100, Decl(generatedContextualTyping.ts, 104, 95)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 105, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x101 { constructor(public parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x101 : Symbol(x101, Decl(generatedContextualTyping.ts, 105, 77)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 106, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x102 { constructor(public parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x102 : Symbol(x102, Decl(generatedContextualTyping.ts, 106, 93)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 107, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 107, 55)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x103 { constructor(public parm: Base[] = [d1, d2]) { } } +>x103 : Symbol(x103, Decl(generatedContextualTyping.ts, 107, 99)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 108, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x104 { constructor(public parm: Array = [d1, d2]) { } } +>x104 : Symbol(x104, Decl(generatedContextualTyping.ts, 108, 62)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 109, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x105 { constructor(public parm: { [n: number]: Base; } = [d1, d2]) { } } +>x105 : Symbol(x105, Decl(generatedContextualTyping.ts, 109, 67)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 110, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 110, 41)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x106 { constructor(public parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x106 : Symbol(x106, Decl(generatedContextualTyping.ts, 110, 78)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 111, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 111, 39)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 111, 56)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x107 : Symbol(x107, Decl(generatedContextualTyping.ts, 111, 77)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 112, 25)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 112, 39)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 112, 58), Decl(generatedContextualTyping.ts, 112, 69)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 112, 58), Decl(generatedContextualTyping.ts, 112, 69)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x108 : Symbol(x108, Decl(generatedContextualTyping.ts, 112, 102)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 113, 25)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 113, 54)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 113, 60)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x109 { constructor(private parm: () => Base[] = () => [d1, d2]) { } } +>x109 : Symbol(x109, Decl(generatedContextualTyping.ts, 113, 95)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 114, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x110 { constructor(private parm: () => Base[] = function() { return [d1, d2] }) { } } +>x110 : Symbol(x110, Decl(generatedContextualTyping.ts, 114, 75)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 115, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x111 { constructor(private parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x111 : Symbol(x111, Decl(generatedContextualTyping.ts, 115, 91)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 116, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 116, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x112 { constructor(private parm: { (): Base[]; } = () => [d1, d2]) { } } +>x112 : Symbol(x112, Decl(generatedContextualTyping.ts, 116, 97)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 117, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x113 { constructor(private parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x113 : Symbol(x113, Decl(generatedContextualTyping.ts, 117, 78)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 118, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x114 { constructor(private parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x114 : Symbol(x114, Decl(generatedContextualTyping.ts, 118, 94)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 119, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 119, 56)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x115 { constructor(private parm: Base[] = [d1, d2]) { } } +>x115 : Symbol(x115, Decl(generatedContextualTyping.ts, 119, 100)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 120, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x116 { constructor(private parm: Array = [d1, d2]) { } } +>x116 : Symbol(x116, Decl(generatedContextualTyping.ts, 120, 63)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 121, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x117 { constructor(private parm: { [n: number]: Base; } = [d1, d2]) { } } +>x117 : Symbol(x117, Decl(generatedContextualTyping.ts, 121, 68)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 122, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 122, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x118 { constructor(private parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x118 : Symbol(x118, Decl(generatedContextualTyping.ts, 122, 79)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 123, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 123, 40)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 123, 57)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x119 : Symbol(x119, Decl(generatedContextualTyping.ts, 123, 78)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 124, 25)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 124, 40)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 124, 59), Decl(generatedContextualTyping.ts, 124, 70)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 124, 59), Decl(generatedContextualTyping.ts, 124, 70)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x120 : Symbol(x120, Decl(generatedContextualTyping.ts, 124, 103)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 125, 25)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 125, 55)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 125, 61)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x121(parm: () => Base[] = () => [d1, d2]) { } +>x121 : Symbol(x121, Decl(generatedContextualTyping.ts, 125, 96)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 126, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x122(parm: () => Base[] = function() { return [d1, d2] }) { } +>x122 : Symbol(x122, Decl(generatedContextualTyping.ts, 126, 54)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 127, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } +>x123 : Symbol(x123, Decl(generatedContextualTyping.ts, 127, 70)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 128, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 128, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x124(parm: { (): Base[]; } = () => [d1, d2]) { } +>x124 : Symbol(x124, Decl(generatedContextualTyping.ts, 128, 76)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 129, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } +>x125 : Symbol(x125, Decl(generatedContextualTyping.ts, 129, 57)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 130, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } +>x126 : Symbol(x126, Decl(generatedContextualTyping.ts, 130, 73)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 131, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 131, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x127(parm: Base[] = [d1, d2]) { } +>x127 : Symbol(x127, Decl(generatedContextualTyping.ts, 131, 79)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 132, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x128(parm: Array = [d1, d2]) { } +>x128 : Symbol(x128, Decl(generatedContextualTyping.ts, 132, 42)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 133, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x129(parm: { [n: number]: Base; } = [d1, d2]) { } +>x129 : Symbol(x129, Decl(generatedContextualTyping.ts, 133, 47)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 134, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 134, 23)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } +>x130 : Symbol(x130, Decl(generatedContextualTyping.ts, 134, 58)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 135, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 135, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 135, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } +>x131 : Symbol(x131, Decl(generatedContextualTyping.ts, 135, 57)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 136, 14)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 136, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 136, 40), Decl(generatedContextualTyping.ts, 136, 51)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 136, 40), Decl(generatedContextualTyping.ts, 136, 51)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } +>x132 : Symbol(x132, Decl(generatedContextualTyping.ts, 136, 82)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 137, 14)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 137, 36)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 137, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x133(): () => Base[] { return () => [d1, d2]; } +>x133 : Symbol(x133, Decl(generatedContextualTyping.ts, 137, 75)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x134(): () => Base[] { return function() { return [d1, d2] }; } +>x134 : Symbol(x134, Decl(generatedContextualTyping.ts, 138, 56)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x135(): () => Base[] { return function named() { return [d1, d2] }; } +>x135 : Symbol(x135, Decl(generatedContextualTyping.ts, 139, 72)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 140, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x136(): { (): Base[]; } { return () => [d1, d2]; } +>x136 : Symbol(x136, Decl(generatedContextualTyping.ts, 140, 78)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } +>x137 : Symbol(x137, Decl(generatedContextualTyping.ts, 141, 59)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } +>x138 : Symbol(x138, Decl(generatedContextualTyping.ts, 142, 75)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 143, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x139(): Base[] { return [d1, d2]; } +>x139 : Symbol(x139, Decl(generatedContextualTyping.ts, 143, 81)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x140(): Array { return [d1, d2]; } +>x140 : Symbol(x140, Decl(generatedContextualTyping.ts, 144, 44)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x141(): { [n: number]: Base; } { return [d1, d2]; } +>x141 : Symbol(x141, Decl(generatedContextualTyping.ts, 145, 49)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 146, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x142(): {n: Base[]; } { return { n: [d1, d2] }; } +>x142 : Symbol(x142, Decl(generatedContextualTyping.ts, 146, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 147, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 147, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; } +>x143 : Symbol(x143, Decl(generatedContextualTyping.ts, 147, 59)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 148, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 148, 44), Decl(generatedContextualTyping.ts, 148, 55)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 148, 44), Decl(generatedContextualTyping.ts, 148, 55)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x144(): Genric { return { func: n => { return [d1, d2]; } }; } +>x144 : Symbol(x144, Decl(generatedContextualTyping.ts, 148, 84)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 149, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 149, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } +>x145 : Symbol(x145, Decl(generatedContextualTyping.ts, 149, 77)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } +>x146 : Symbol(x146, Decl(generatedContextualTyping.ts, 150, 79)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } +>x147 : Symbol(x147, Decl(generatedContextualTyping.ts, 151, 111)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 152, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 152, 83)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } +>x148 : Symbol(x148, Decl(generatedContextualTyping.ts, 152, 123)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } +>x149 : Symbol(x149, Decl(generatedContextualTyping.ts, 153, 82)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } +>x150 : Symbol(x150, Decl(generatedContextualTyping.ts, 154, 114)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 155, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 155, 86)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x151(): Base[] { return [d1, d2]; return [d1, d2]; } +>x151 : Symbol(x151, Decl(generatedContextualTyping.ts, 155, 126)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x152(): Array { return [d1, d2]; return [d1, d2]; } +>x152 : Symbol(x152, Decl(generatedContextualTyping.ts, 156, 61)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } +>x153 : Symbol(x153, Decl(generatedContextualTyping.ts, 157, 66)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 158, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] }; } +>x154 : Symbol(x154, Decl(generatedContextualTyping.ts, 158, 77)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 66)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; return n => { var n: Base[]; return null; }; } +>x155 : Symbol(x155, Decl(generatedContextualTyping.ts, 159, 83)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 160, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 160, 44), Decl(generatedContextualTyping.ts, 160, 55)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 160, 44), Decl(generatedContextualTyping.ts, 160, 55)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 160, 89), Decl(generatedContextualTyping.ts, 160, 100)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 160, 89), Decl(generatedContextualTyping.ts, 160, 100)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } +>x156 : Symbol(x156, Decl(generatedContextualTyping.ts, 160, 129)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 161, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 161, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 161, 84)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 161, 90)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x157: () => () => Base[] = () => { return () => [d1, d2]; }; +>x157 : Symbol(x157, Decl(generatedContextualTyping.ts, 162, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x158: () => () => Base[] = () => { return function() { return [d1, d2] }; }; +>x158 : Symbol(x158, Decl(generatedContextualTyping.ts, 163, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x159: () => () => Base[] = () => { return function named() { return [d1, d2] }; }; +>x159 : Symbol(x159, Decl(generatedContextualTyping.ts, 164, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 164, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x160: () => { (): Base[]; } = () => { return () => [d1, d2]; }; +>x160 : Symbol(x160, Decl(generatedContextualTyping.ts, 165, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x161: () => { (): Base[]; } = () => { return function() { return [d1, d2] }; }; +>x161 : Symbol(x161, Decl(generatedContextualTyping.ts, 166, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x162: () => { (): Base[]; } = () => { return function named() { return [d1, d2] }; }; +>x162 : Symbol(x162, Decl(generatedContextualTyping.ts, 167, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 167, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x163: () => Base[] = () => { return [d1, d2]; }; +>x163 : Symbol(x163, Decl(generatedContextualTyping.ts, 168, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x164: () => Array = () => { return [d1, d2]; }; +>x164 : Symbol(x164, Decl(generatedContextualTyping.ts, 169, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x165: () => { [n: number]: Base; } = () => { return [d1, d2]; }; +>x165 : Symbol(x165, Decl(generatedContextualTyping.ts, 170, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 170, 19)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x166: () => {n: Base[]; } = () => { return { n: [d1, d2] }; }; +>x166 : Symbol(x166, Decl(generatedContextualTyping.ts, 171, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 171, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 171, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return null; }; }; +>x167 : Symbol(x167, Decl(generatedContextualTyping.ts, 172, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 172, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 172, 51), Decl(generatedContextualTyping.ts, 172, 62)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 172, 51), Decl(generatedContextualTyping.ts, 172, 62)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; +>x168 : Symbol(x168, Decl(generatedContextualTyping.ts, 173, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 173, 47)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 173, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x169: () => () => Base[] = function() { return () => [d1, d2]; }; +>x169 : Symbol(x169, Decl(generatedContextualTyping.ts, 174, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x170: () => () => Base[] = function() { return function() { return [d1, d2] }; }; +>x170 : Symbol(x170, Decl(generatedContextualTyping.ts, 175, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x171: () => () => Base[] = function() { return function named() { return [d1, d2] }; }; +>x171 : Symbol(x171, Decl(generatedContextualTyping.ts, 176, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 176, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x172: () => { (): Base[]; } = function() { return () => [d1, d2]; }; +>x172 : Symbol(x172, Decl(generatedContextualTyping.ts, 177, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x173: () => { (): Base[]; } = function() { return function() { return [d1, d2] }; }; +>x173 : Symbol(x173, Decl(generatedContextualTyping.ts, 178, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x174: () => { (): Base[]; } = function() { return function named() { return [d1, d2] }; }; +>x174 : Symbol(x174, Decl(generatedContextualTyping.ts, 179, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 179, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x175: () => Base[] = function() { return [d1, d2]; }; +>x175 : Symbol(x175, Decl(generatedContextualTyping.ts, 180, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x176: () => Array = function() { return [d1, d2]; }; +>x176 : Symbol(x176, Decl(generatedContextualTyping.ts, 181, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x177: () => { [n: number]: Base; } = function() { return [d1, d2]; }; +>x177 : Symbol(x177, Decl(generatedContextualTyping.ts, 182, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 182, 19)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x178: () => {n: Base[]; } = function() { return { n: [d1, d2] }; }; +>x178 : Symbol(x178, Decl(generatedContextualTyping.ts, 183, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 183, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 183, 54)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; return null; }; }; +>x179 : Symbol(x179, Decl(generatedContextualTyping.ts, 184, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 184, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 184, 56), Decl(generatedContextualTyping.ts, 184, 67)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 184, 56), Decl(generatedContextualTyping.ts, 184, 67)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; +>x180 : Symbol(x180, Decl(generatedContextualTyping.ts, 185, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 185, 52)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 185, 58)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x181 { var t: () => Base[] = () => [d1, d2]; } +>x181 : Symbol(x181, Decl(generatedContextualTyping.ts, 185, 90)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 186, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x182 { var t: () => Base[] = function() { return [d1, d2] }; } +>x182 : Symbol(x182, Decl(generatedContextualTyping.ts, 186, 53)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 187, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } +>x183 : Symbol(x183, Decl(generatedContextualTyping.ts, 187, 69)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 188, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 188, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x184 { var t: { (): Base[]; } = () => [d1, d2]; } +>x184 : Symbol(x184, Decl(generatedContextualTyping.ts, 188, 75)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 189, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } +>x185 : Symbol(x185, Decl(generatedContextualTyping.ts, 189, 56)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 190, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } +>x186 : Symbol(x186, Decl(generatedContextualTyping.ts, 190, 72)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 191, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 191, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x187 { var t: Base[] = [d1, d2]; } +>x187 : Symbol(x187, Decl(generatedContextualTyping.ts, 191, 78)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 192, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x188 { var t: Array = [d1, d2]; } +>x188 : Symbol(x188, Decl(generatedContextualTyping.ts, 192, 41)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 193, 17)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x189 { var t: { [n: number]: Base; } = [d1, d2]; } +>x189 : Symbol(x189, Decl(generatedContextualTyping.ts, 193, 46)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 194, 17)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 194, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } +>x190 : Symbol(x190, Decl(generatedContextualTyping.ts, 194, 57)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 195, 17)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 195, 22)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 195, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } +>x191 : Symbol(x191, Decl(generatedContextualTyping.ts, 195, 56)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 196, 17)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 196, 22)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 196, 41), Decl(generatedContextualTyping.ts, 196, 52)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 196, 41), Decl(generatedContextualTyping.ts, 196, 52)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } +>x192 : Symbol(x192, Decl(generatedContextualTyping.ts, 196, 81)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 197, 17)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 197, 37)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 197, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x193 { export var t: () => Base[] = () => [d1, d2]; } +>x193 : Symbol(x193, Decl(generatedContextualTyping.ts, 197, 74)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 198, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } +>x194 : Symbol(x194, Decl(generatedContextualTyping.ts, 198, 60)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 199, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; } +>x195 : Symbol(x195, Decl(generatedContextualTyping.ts, 199, 76)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 200, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 200, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } +>x196 : Symbol(x196, Decl(generatedContextualTyping.ts, 200, 82)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 201, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } +>x197 : Symbol(x197, Decl(generatedContextualTyping.ts, 201, 63)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 202, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] }; } +>x198 : Symbol(x198, Decl(generatedContextualTyping.ts, 202, 79)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 203, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 203, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x199 { export var t: Base[] = [d1, d2]; } +>x199 : Symbol(x199, Decl(generatedContextualTyping.ts, 203, 85)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 204, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x200 { export var t: Array = [d1, d2]; } +>x200 : Symbol(x200, Decl(generatedContextualTyping.ts, 204, 48)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 205, 24)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } +>x201 : Symbol(x201, Decl(generatedContextualTyping.ts, 205, 53)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 206, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 206, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } +>x202 : Symbol(x202, Decl(generatedContextualTyping.ts, 206, 64)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 207, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 207, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 207, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } +>x203 : Symbol(x203, Decl(generatedContextualTyping.ts, 207, 63)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 208, 24)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 208, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 208, 48), Decl(generatedContextualTyping.ts, 208, 59)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 208, 48), Decl(generatedContextualTyping.ts, 208, 59)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } +>x204 : Symbol(x204, Decl(generatedContextualTyping.ts, 208, 88)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 209, 24)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 209, 44)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 209, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x206 = <() => Base[]>function() { return [d1, d2] }; +>x206 : Symbol(x206, Decl(generatedContextualTyping.ts, 210, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x207 = <() => Base[]>function named() { return [d1, d2] }; +>x207 : Symbol(x207, Decl(generatedContextualTyping.ts, 211, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 211, 25)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; +>x209 : Symbol(x209, Decl(generatedContextualTyping.ts, 212, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x210 = <{ (): Base[]; }>function named() { return [d1, d2] }; +>x210 : Symbol(x210, Decl(generatedContextualTyping.ts, 213, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 213, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x211 = [d1, d2]; +>x211 : Symbol(x211, Decl(generatedContextualTyping.ts, 214, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x212 = >[d1, d2]; +>x212 : Symbol(x212, Decl(generatedContextualTyping.ts, 215, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x213 = <{ [n: number]: Base; }>[d1, d2]; +>x213 : Symbol(x213, Decl(generatedContextualTyping.ts, 216, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 216, 15)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x214 = <{n: Base[]; } >{ n: [d1, d2] }; +>x214 : Symbol(x214, Decl(generatedContextualTyping.ts, 217, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 217, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 217, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x216 = >{ func: n => { return [d1, d2]; } }; +>x216 : Symbol(x216, Decl(generatedContextualTyping.ts, 218, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 218, 26)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 218, 32)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x217 = (<() => Base[]>undefined) || function() { return [d1, d2] }; +>x217 : Symbol(x217, Decl(generatedContextualTyping.ts, 219, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x218 = (<() => Base[]>undefined) || function named() { return [d1, d2] }; +>x218 : Symbol(x218, Decl(generatedContextualTyping.ts, 220, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 220, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x219 = (<{ (): Base[]; }>undefined) || function() { return [d1, d2] }; +>x219 : Symbol(x219, Decl(generatedContextualTyping.ts, 221, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x220 = (<{ (): Base[]; }>undefined) || function named() { return [d1, d2] }; +>x220 : Symbol(x220, Decl(generatedContextualTyping.ts, 222, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 222, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x221 = (undefined) || [d1, d2]; +>x221 : Symbol(x221, Decl(generatedContextualTyping.ts, 223, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x222 = (>undefined) || [d1, d2]; +>x222 : Symbol(x222, Decl(generatedContextualTyping.ts, 224, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2]; +>x223 : Symbol(x223, Decl(generatedContextualTyping.ts, 225, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 225, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x224 = (<{n: Base[]; } >undefined) || { n: [d1, d2] }; +>x224 : Symbol(x224, Decl(generatedContextualTyping.ts, 226, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 226, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 226, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x225: () => Base[]; x225 = () => [d1, d2]; +>x225 : Symbol(x225, Decl(generatedContextualTyping.ts, 227, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x225 : Symbol(x225, Decl(generatedContextualTyping.ts, 227, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x226: () => Base[]; x226 = function() { return [d1, d2] }; +>x226 : Symbol(x226, Decl(generatedContextualTyping.ts, 228, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x226 : Symbol(x226, Decl(generatedContextualTyping.ts, 228, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x227: () => Base[]; x227 = function named() { return [d1, d2] }; +>x227 : Symbol(x227, Decl(generatedContextualTyping.ts, 229, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x227 : Symbol(x227, Decl(generatedContextualTyping.ts, 229, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 229, 30)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x228: { (): Base[]; }; x228 = () => [d1, d2]; +>x228 : Symbol(x228, Decl(generatedContextualTyping.ts, 230, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x228 : Symbol(x228, Decl(generatedContextualTyping.ts, 230, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x229: { (): Base[]; }; x229 = function() { return [d1, d2] }; +>x229 : Symbol(x229, Decl(generatedContextualTyping.ts, 231, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x229 : Symbol(x229, Decl(generatedContextualTyping.ts, 231, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x230: { (): Base[]; }; x230 = function named() { return [d1, d2] }; +>x230 : Symbol(x230, Decl(generatedContextualTyping.ts, 232, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x230 : Symbol(x230, Decl(generatedContextualTyping.ts, 232, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 232, 33)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x231: Base[]; x231 = [d1, d2]; +>x231 : Symbol(x231, Decl(generatedContextualTyping.ts, 233, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x231 : Symbol(x231, Decl(generatedContextualTyping.ts, 233, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x232: Array; x232 = [d1, d2]; +>x232 : Symbol(x232, Decl(generatedContextualTyping.ts, 234, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x232 : Symbol(x232, Decl(generatedContextualTyping.ts, 234, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x233: { [n: number]: Base; }; x233 = [d1, d2]; +>x233 : Symbol(x233, Decl(generatedContextualTyping.ts, 235, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 235, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x233 : Symbol(x233, Decl(generatedContextualTyping.ts, 235, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x234: {n: Base[]; } ; x234 = { n: [d1, d2] }; +>x234 : Symbol(x234, Decl(generatedContextualTyping.ts, 236, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 236, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x234 : Symbol(x234, Decl(generatedContextualTyping.ts, 236, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 236, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; +>x235 : Symbol(x235, Decl(generatedContextualTyping.ts, 237, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 237, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x235 : Symbol(x235, Decl(generatedContextualTyping.ts, 237, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 237, 36), Decl(generatedContextualTyping.ts, 237, 47)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 237, 36), Decl(generatedContextualTyping.ts, 237, 47)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; +>x236 : Symbol(x236, Decl(generatedContextualTyping.ts, 238, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x236 : Symbol(x236, Decl(generatedContextualTyping.ts, 238, 3)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 238, 32)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 238, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x237: { n: () => Base[]; } = { n: () => [d1, d2] }; +>x237 : Symbol(x237, Decl(generatedContextualTyping.ts, 239, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 239, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 239, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x238: { n: () => Base[]; } = { n: function() { return [d1, d2] } }; +>x238 : Symbol(x238, Decl(generatedContextualTyping.ts, 240, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 240, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 240, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x239: { n: () => Base[]; } = { n: function named() { return [d1, d2] } }; +>x239 : Symbol(x239, Decl(generatedContextualTyping.ts, 241, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 241, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 241, 34)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 241, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x240: { n: { (): Base[]; }; } = { n: () => [d1, d2] }; +>x240 : Symbol(x240, Decl(generatedContextualTyping.ts, 242, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 242, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 242, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x241: { n: { (): Base[]; }; } = { n: function() { return [d1, d2] } }; +>x241 : Symbol(x241, Decl(generatedContextualTyping.ts, 243, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 243, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 243, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x242: { n: { (): Base[]; }; } = { n: function named() { return [d1, d2] } }; +>x242 : Symbol(x242, Decl(generatedContextualTyping.ts, 244, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 244, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 244, 37)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 244, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x243: { n: Base[]; } = { n: [d1, d2] }; +>x243 : Symbol(x243, Decl(generatedContextualTyping.ts, 245, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 245, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 245, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x244: { n: Array; } = { n: [d1, d2] }; +>x244 : Symbol(x244, Decl(generatedContextualTyping.ts, 246, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 33)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x245: { n: { [n: number]: Base; }; } = { n: [d1, d2] }; +>x245 : Symbol(x245, Decl(generatedContextualTyping.ts, 247, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x246: { n: {n: Base[]; } ; } = { n: { n: [d1, d2] } }; +>x246 : Symbol(x246, Decl(generatedContextualTyping.ts, 248, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 36)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } }; +>x247 : Symbol(x247, Decl(generatedContextualTyping.ts, 249, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 249, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 43), Decl(generatedContextualTyping.ts, 249, 54)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 43), Decl(generatedContextualTyping.ts, 249, 54)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; +>x248 : Symbol(x248, Decl(generatedContextualTyping.ts, 250, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 250, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 250, 34)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 250, 39)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 250, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x252: { (): Base[]; }[] = [() => [d1, d2]]; +>x252 : Symbol(x252, Decl(generatedContextualTyping.ts, 251, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x253: { (): Base[]; }[] = [function() { return [d1, d2] }]; +>x253 : Symbol(x253, Decl(generatedContextualTyping.ts, 252, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x254: { (): Base[]; }[] = [function named() { return [d1, d2] }]; +>x254 : Symbol(x254, Decl(generatedContextualTyping.ts, 253, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 253, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x255: Base[][] = [[d1, d2]]; +>x255 : Symbol(x255, Decl(generatedContextualTyping.ts, 254, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x256: Array[] = [[d1, d2]]; +>x256 : Symbol(x256, Decl(generatedContextualTyping.ts, 255, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x257: { [n: number]: Base; }[] = [[d1, d2]]; +>x257 : Symbol(x257, Decl(generatedContextualTyping.ts, 256, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 256, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x258: {n: Base[]; } [] = [{ n: [d1, d2] }]; +>x258 : Symbol(x258, Decl(generatedContextualTyping.ts, 257, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 257, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 257, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x260: Genric[] = [{ func: n => { return [d1, d2]; } }]; +>x260 : Symbol(x260, Decl(generatedContextualTyping.ts, 258, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 258, 29)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 258, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x261: () => Base[] = function() { return [d1, d2] } || undefined; +>x261 : Symbol(x261, Decl(generatedContextualTyping.ts, 259, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x262: () => Base[] = function named() { return [d1, d2] } || undefined; +>x262 : Symbol(x262, Decl(generatedContextualTyping.ts, 260, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 260, 24)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; +>x263 : Symbol(x263, Decl(generatedContextualTyping.ts, 261, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; +>x264 : Symbol(x264, Decl(generatedContextualTyping.ts, 262, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 262, 27)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x265: Base[] = [d1, d2] || undefined; +>x265 : Symbol(x265, Decl(generatedContextualTyping.ts, 263, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x266: Array = [d1, d2] || undefined; +>x266 : Symbol(x266, Decl(generatedContextualTyping.ts, 264, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x267: { [n: number]: Base; } = [d1, d2] || undefined; +>x267 : Symbol(x267, Decl(generatedContextualTyping.ts, 265, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 265, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; +>x268 : Symbol(x268, Decl(generatedContextualTyping.ts, 266, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 266, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 266, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x269: () => Base[] = undefined || function() { return [d1, d2] }; +>x269 : Symbol(x269, Decl(generatedContextualTyping.ts, 267, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x270: () => Base[] = undefined || function named() { return [d1, d2] }; +>x270 : Symbol(x270, Decl(generatedContextualTyping.ts, 268, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 268, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x271: { (): Base[]; } = undefined || function() { return [d1, d2] }; +>x271 : Symbol(x271, Decl(generatedContextualTyping.ts, 269, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x272: { (): Base[]; } = undefined || function named() { return [d1, d2] }; +>x272 : Symbol(x272, Decl(generatedContextualTyping.ts, 270, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 270, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x273: Base[] = undefined || [d1, d2]; +>x273 : Symbol(x273, Decl(generatedContextualTyping.ts, 271, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x274: Array = undefined || [d1, d2]; +>x274 : Symbol(x274, Decl(generatedContextualTyping.ts, 272, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x275: { [n: number]: Base; } = undefined || [d1, d2]; +>x275 : Symbol(x275, Decl(generatedContextualTyping.ts, 273, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 273, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x276: {n: Base[]; } = undefined || { n: [d1, d2] }; +>x276 : Symbol(x276, Decl(generatedContextualTyping.ts, 274, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 274, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 274, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x277: () => Base[] = function() { return [d1, d2] } || function() { return [d1, d2] }; +>x277 : Symbol(x277, Decl(generatedContextualTyping.ts, 275, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x278: () => Base[] = function named() { return [d1, d2] } || function named() { return [d1, d2] }; +>x278 : Symbol(x278, Decl(generatedContextualTyping.ts, 276, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 276, 24)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 276, 64)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x279: { (): Base[]; } = function() { return [d1, d2] } || function() { return [d1, d2] }; +>x279 : Symbol(x279, Decl(generatedContextualTyping.ts, 277, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x280: { (): Base[]; } = function named() { return [d1, d2] } || function named() { return [d1, d2] }; +>x280 : Symbol(x280, Decl(generatedContextualTyping.ts, 278, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 278, 27)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 278, 67)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x281: Base[] = [d1, d2] || [d1, d2]; +>x281 : Symbol(x281, Decl(generatedContextualTyping.ts, 279, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x282: Array = [d1, d2] || [d1, d2]; +>x282 : Symbol(x282, Decl(generatedContextualTyping.ts, 280, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2]; +>x283 : Symbol(x283, Decl(generatedContextualTyping.ts, 281, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 281, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x284: {n: Base[]; } = { n: [d1, d2] } || { n: [d1, d2] }; +>x284 : Symbol(x284, Decl(generatedContextualTyping.ts, 282, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 282, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 282, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 282, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; +>x285 : Symbol(x285, Decl(generatedContextualTyping.ts, 283, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; +>x286 : Symbol(x286, Decl(generatedContextualTyping.ts, 284, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x287: () => Base[] = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; +>x287 : Symbol(x287, Decl(generatedContextualTyping.ts, 285, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 285, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 285, 70)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; +>x288 : Symbol(x288, Decl(generatedContextualTyping.ts, 286, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; +>x289 : Symbol(x289, Decl(generatedContextualTyping.ts, 287, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; +>x290 : Symbol(x290, Decl(generatedContextualTyping.ts, 288, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 288, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 288, 73)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x291: Base[] = true ? [d1, d2] : [d1, d2]; +>x291 : Symbol(x291, Decl(generatedContextualTyping.ts, 289, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x292: Array = true ? [d1, d2] : [d1, d2]; +>x292 : Symbol(x292, Decl(generatedContextualTyping.ts, 290, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; +>x293 : Symbol(x293, Decl(generatedContextualTyping.ts, 291, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 291, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; +>x294 : Symbol(x294, Decl(generatedContextualTyping.ts, 292, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; }; +>x295 : Symbol(x295, Decl(generatedContextualTyping.ts, 293, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 293, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 293, 37), Decl(generatedContextualTyping.ts, 293, 48)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 293, 37), Decl(generatedContextualTyping.ts, 293, 48)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 293, 76), Decl(generatedContextualTyping.ts, 293, 87)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 293, 76), Decl(generatedContextualTyping.ts, 293, 87)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; +>x296 : Symbol(x296, Decl(generatedContextualTyping.ts, 294, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 294, 33)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 294, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 294, 71)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 294, 77)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x297: () => Base[] = true ? undefined : () => [d1, d2]; +>x297 : Symbol(x297, Decl(generatedContextualTyping.ts, 295, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; +>x298 : Symbol(x298, Decl(generatedContextualTyping.ts, 296, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] }; +>x299 : Symbol(x299, Decl(generatedContextualTyping.ts, 297, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 297, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; +>x300 : Symbol(x300, Decl(generatedContextualTyping.ts, 298, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; +>x301 : Symbol(x301, Decl(generatedContextualTyping.ts, 299, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2] }; +>x302 : Symbol(x302, Decl(generatedContextualTyping.ts, 300, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 300, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x303: Base[] = true ? undefined : [d1, d2]; +>x303 : Symbol(x303, Decl(generatedContextualTyping.ts, 301, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x304: Array = true ? undefined : [d1, d2]; +>x304 : Symbol(x304, Decl(generatedContextualTyping.ts, 302, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; +>x305 : Symbol(x305, Decl(generatedContextualTyping.ts, 303, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 303, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; +>x306 : Symbol(x306, Decl(generatedContextualTyping.ts, 304, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 304, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 304, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return null; }; +>x307 : Symbol(x307, Decl(generatedContextualTyping.ts, 305, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 305, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 305, 49), Decl(generatedContextualTyping.ts, 305, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 305, 49), Decl(generatedContextualTyping.ts, 305, 60)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; +>x308 : Symbol(x308, Decl(generatedContextualTyping.ts, 306, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 306, 45)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 306, 51)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x309: () => Base[] = true ? () => [d1, d2] : undefined; +>x309 : Symbol(x309, Decl(generatedContextualTyping.ts, 307, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; +>x310 : Symbol(x310, Decl(generatedContextualTyping.ts, 308, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined; +>x311 : Symbol(x311, Decl(generatedContextualTyping.ts, 309, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 309, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; +>x312 : Symbol(x312, Decl(generatedContextualTyping.ts, 310, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; +>x313 : Symbol(x313, Decl(generatedContextualTyping.ts, 311, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefined; +>x314 : Symbol(x314, Decl(generatedContextualTyping.ts, 312, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 312, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x315: Base[] = true ? [d1, d2] : undefined; +>x315 : Symbol(x315, Decl(generatedContextualTyping.ts, 313, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x316: Array = true ? [d1, d2] : undefined; +>x316 : Symbol(x316, Decl(generatedContextualTyping.ts, 314, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; +>x317 : Symbol(x317, Decl(generatedContextualTyping.ts, 315, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 315, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; +>x318 : Symbol(x318, Decl(generatedContextualTyping.ts, 316, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 316, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 316, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : undefined; +>x319 : Symbol(x319, Decl(generatedContextualTyping.ts, 317, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 317, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 317, 37), Decl(generatedContextualTyping.ts, 317, 48)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 317, 37), Decl(generatedContextualTyping.ts, 317, 48)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) + +var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; +>x320 : Symbol(x320, Decl(generatedContextualTyping.ts, 318, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 318, 33)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 318, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) +>undefined : Symbol(undefined) + +function x321(n: () => Base[]) { }; x321(() => [d1, d2]); +>x321 : Symbol(x321, Decl(generatedContextualTyping.ts, 318, 80)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 319, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x321 : Symbol(x321, Decl(generatedContextualTyping.ts, 318, 80)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); +>x322 : Symbol(x322, Decl(generatedContextualTyping.ts, 319, 57)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 320, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x322 : Symbol(x322, Decl(generatedContextualTyping.ts, 319, 57)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); +>x323 : Symbol(x323, Decl(generatedContextualTyping.ts, 320, 73)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 321, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x323 : Symbol(x323, Decl(generatedContextualTyping.ts, 320, 73)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 321, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); +>x324 : Symbol(x324, Decl(generatedContextualTyping.ts, 321, 79)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 322, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x324 : Symbol(x324, Decl(generatedContextualTyping.ts, 321, 79)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); +>x325 : Symbol(x325, Decl(generatedContextualTyping.ts, 322, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 323, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x325 : Symbol(x325, Decl(generatedContextualTyping.ts, 322, 60)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] }); +>x326 : Symbol(x326, Decl(generatedContextualTyping.ts, 323, 76)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 324, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x326 : Symbol(x326, Decl(generatedContextualTyping.ts, 323, 76)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 324, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x327(n: Base[]) { }; x327([d1, d2]); +>x327 : Symbol(x327, Decl(generatedContextualTyping.ts, 324, 82)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 325, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x327 : Symbol(x327, Decl(generatedContextualTyping.ts, 324, 82)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x328(n: Array) { }; x328([d1, d2]); +>x328 : Symbol(x328, Decl(generatedContextualTyping.ts, 325, 45)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 326, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x328 : Symbol(x328, Decl(generatedContextualTyping.ts, 325, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); +>x329 : Symbol(x329, Decl(generatedContextualTyping.ts, 326, 50)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x329 : Symbol(x329, Decl(generatedContextualTyping.ts, 326, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); +>x330 : Symbol(x330, Decl(generatedContextualTyping.ts, 327, 61)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x330 : Symbol(x330, Decl(generatedContextualTyping.ts, 327, 61)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null; }); +>x331 : Symbol(x331, Decl(generatedContextualTyping.ts, 328, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 329, 14)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 329, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x331 : Symbol(x331, Decl(generatedContextualTyping.ts, 328, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 329, 47), Decl(generatedContextualTyping.ts, 329, 57)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 329, 47), Decl(generatedContextualTyping.ts, 329, 57)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); +>x332 : Symbol(x332, Decl(generatedContextualTyping.ts, 329, 85)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 330, 14)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x332 : Symbol(x332, Decl(generatedContextualTyping.ts, 329, 85)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 330, 42)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 330, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x333 = (n: () => Base[]) => n; x333(() => [d1, d2]); +>x333 : Symbol(x333, Decl(generatedContextualTyping.ts, 331, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 331, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 331, 12)) +>x333 : Symbol(x333, Decl(generatedContextualTyping.ts, 331, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x334 = (n: () => Base[]) => n; x334(function() { return [d1, d2] }); +>x334 : Symbol(x334, Decl(generatedContextualTyping.ts, 332, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 332, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 332, 12)) +>x334 : Symbol(x334, Decl(generatedContextualTyping.ts, 332, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x335 = (n: () => Base[]) => n; x335(function named() { return [d1, d2] }); +>x335 : Symbol(x335, Decl(generatedContextualTyping.ts, 333, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 333, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 333, 12)) +>x335 : Symbol(x335, Decl(generatedContextualTyping.ts, 333, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 333, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x336 = (n: { (): Base[]; }) => n; x336(() => [d1, d2]); +>x336 : Symbol(x336, Decl(generatedContextualTyping.ts, 334, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 334, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 334, 12)) +>x336 : Symbol(x336, Decl(generatedContextualTyping.ts, 334, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x337 = (n: { (): Base[]; }) => n; x337(function() { return [d1, d2] }); +>x337 : Symbol(x337, Decl(generatedContextualTyping.ts, 335, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 335, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 335, 12)) +>x337 : Symbol(x337, Decl(generatedContextualTyping.ts, 335, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x338 = (n: { (): Base[]; }) => n; x338(function named() { return [d1, d2] }); +>x338 : Symbol(x338, Decl(generatedContextualTyping.ts, 336, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 336, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 336, 12)) +>x338 : Symbol(x338, Decl(generatedContextualTyping.ts, 336, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 336, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x339 = (n: Base[]) => n; x339([d1, d2]); +>x339 : Symbol(x339, Decl(generatedContextualTyping.ts, 337, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 337, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 337, 12)) +>x339 : Symbol(x339, Decl(generatedContextualTyping.ts, 337, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x340 = (n: Array) => n; x340([d1, d2]); +>x340 : Symbol(x340, Decl(generatedContextualTyping.ts, 338, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 12)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 12)) +>x340 : Symbol(x340, Decl(generatedContextualTyping.ts, 338, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x341 = (n: { [n: number]: Base; }) => n; x341([d1, d2]); +>x341 : Symbol(x341, Decl(generatedContextualTyping.ts, 339, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 12)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 12)) +>x341 : Symbol(x341, Decl(generatedContextualTyping.ts, 339, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x342 = (n: {n: Base[]; } ) => n; x342({ n: [d1, d2] }); +>x342 : Symbol(x342, Decl(generatedContextualTyping.ts, 340, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 12)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 12)) +>x342 : Symbol(x342, Decl(generatedContextualTyping.ts, 340, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; }); +>x343 : Symbol(x343, Decl(generatedContextualTyping.ts, 341, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 12)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 341, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 12)) +>x343 : Symbol(x343, Decl(generatedContextualTyping.ts, 341, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 46), Decl(generatedContextualTyping.ts, 341, 56)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 46), Decl(generatedContextualTyping.ts, 341, 56)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); +>x344 : Symbol(x344, Decl(generatedContextualTyping.ts, 342, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 342, 12)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 342, 12)) +>x344 : Symbol(x344, Decl(generatedContextualTyping.ts, 342, 3)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 342, 41)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 342, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x345 = function(n: () => Base[]) { }; x345(() => [d1, d2]); +>x345 : Symbol(x345, Decl(generatedContextualTyping.ts, 343, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 343, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x345 : Symbol(x345, Decl(generatedContextualTyping.ts, 343, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x346 = function(n: () => Base[]) { }; x346(function() { return [d1, d2] }); +>x346 : Symbol(x346, Decl(generatedContextualTyping.ts, 344, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 344, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x346 : Symbol(x346, Decl(generatedContextualTyping.ts, 344, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x347 = function(n: () => Base[]) { }; x347(function named() { return [d1, d2] }); +>x347 : Symbol(x347, Decl(generatedContextualTyping.ts, 345, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 345, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x347 : Symbol(x347, Decl(generatedContextualTyping.ts, 345, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 345, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x348 = function(n: { (): Base[]; }) { }; x348(() => [d1, d2]); +>x348 : Symbol(x348, Decl(generatedContextualTyping.ts, 346, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 346, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x348 : Symbol(x348, Decl(generatedContextualTyping.ts, 346, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x349 = function(n: { (): Base[]; }) { }; x349(function() { return [d1, d2] }); +>x349 : Symbol(x349, Decl(generatedContextualTyping.ts, 347, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 347, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x349 : Symbol(x349, Decl(generatedContextualTyping.ts, 347, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x350 = function(n: { (): Base[]; }) { }; x350(function named() { return [d1, d2] }); +>x350 : Symbol(x350, Decl(generatedContextualTyping.ts, 348, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 348, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x350 : Symbol(x350, Decl(generatedContextualTyping.ts, 348, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 348, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x351 = function(n: Base[]) { }; x351([d1, d2]); +>x351 : Symbol(x351, Decl(generatedContextualTyping.ts, 349, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 349, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x351 : Symbol(x351, Decl(generatedContextualTyping.ts, 349, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x352 = function(n: Array) { }; x352([d1, d2]); +>x352 : Symbol(x352, Decl(generatedContextualTyping.ts, 350, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 350, 20)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x352 : Symbol(x352, Decl(generatedContextualTyping.ts, 350, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x353 = function(n: { [n: number]: Base; }) { }; x353([d1, d2]); +>x353 : Symbol(x353, Decl(generatedContextualTyping.ts, 351, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 20)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 26)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x353 : Symbol(x353, Decl(generatedContextualTyping.ts, 351, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x354 = function(n: {n: Base[]; } ) { }; x354({ n: [d1, d2] }); +>x354 : Symbol(x354, Decl(generatedContextualTyping.ts, 352, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 20)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x354 : Symbol(x354, Decl(generatedContextualTyping.ts, 352, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + +var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; return null; }); +>x355 : Symbol(x355, Decl(generatedContextualTyping.ts, 353, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 353, 20)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 353, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x355 : Symbol(x355, Decl(generatedContextualTyping.ts, 353, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 353, 53), Decl(generatedContextualTyping.ts, 353, 63)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 353, 53), Decl(generatedContextualTyping.ts, 353, 63)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); +>x356 : Symbol(x356, Decl(generatedContextualTyping.ts, 354, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 354, 20)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 3, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x356 : Symbol(x356, Decl(generatedContextualTyping.ts, 354, 3)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 354, 48)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 354, 54)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 5, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 5, 40)) + diff --git a/tests/baselines/reference/generatedContextualTyping.types b/tests/baselines/reference/generatedContextualTyping.types new file mode 100644 index 0000000000000..2e9625cdb8bd1 --- /dev/null +++ b/tests/baselines/reference/generatedContextualTyping.types @@ -0,0 +1,3769 @@ +=== tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts === + +class Base { private p; } +>Base : Base +>p : any + +class Derived1 extends Base { private m; } +>Derived1 : Derived1 +>Base : Base +>m : any + +class Derived2 extends Base { private n; } +>Derived2 : Derived2 +>Base : Base +>n : any + +interface Genric { func(n: T[]); } +>Genric : Genric +>T : T +>func : (n: T[]) => any +>n : T[] +>T : T + +var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); +>b : Base +>new Base() : Base +>Base : typeof Base +>d1 : Derived1 +>new Derived1() : Derived1 +>Derived1 : typeof Derived1 +>d2 : Derived2 +>new Derived2() : Derived2 +>Derived2 : typeof Derived2 + +var x1: () => Base[] = () => [d1, d2]; +>x1 : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x2: () => Base[] = function() { return [d1, d2] }; +>x2 : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x3: () => Base[] = function named() { return [d1, d2] }; +>x3 : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x4: { (): Base[]; } = () => [d1, d2]; +>x4 : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x5: { (): Base[]; } = function() { return [d1, d2] }; +>x5 : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x6: { (): Base[]; } = function named() { return [d1, d2] }; +>x6 : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x7: Base[] = [d1, d2]; +>x7 : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x8: Array = [d1, d2]; +>x8 : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x9: { [n: number]: Base; } = [d1, d2]; +>x9 : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x10: {n: Base[]; } = { n: [d1, d2] }; +>x10 : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; +>x11 : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +var x12: Genric = { func: n => { return [d1, d2]; } }; +>x12 : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x13 { member: () => Base[] = () => [d1, d2] } +>x13 : x13 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x14 { member: () => Base[] = function() { return [d1, d2] } } +>x14 : x14 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x15 { member: () => Base[] = function named() { return [d1, d2] } } +>x15 : x15 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x16 { member: { (): Base[]; } = () => [d1, d2] } +>x16 : x16 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x17 { member: { (): Base[]; } = function() { return [d1, d2] } } +>x17 : x17 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x18 { member: { (): Base[]; } = function named() { return [d1, d2] } } +>x18 : x18 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x19 { member: Base[] = [d1, d2] } +>x19 : x19 +>member : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x20 { member: Array = [d1, d2] } +>x20 : x20 +>member : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x21 { member: { [n: number]: Base; } = [d1, d2] } +>x21 : x21 +>member : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x22 { member: {n: Base[]; } = { n: [d1, d2] } } +>x22 : x22 +>member : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x23 : x23 +>member : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +class x24 { member: Genric = { func: n => { return [d1, d2]; } } } +>x24 : x24 +>member : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x25 { private member: () => Base[] = () => [d1, d2] } +>x25 : x25 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x26 { private member: () => Base[] = function() { return [d1, d2] } } +>x26 : x26 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x27 { private member: () => Base[] = function named() { return [d1, d2] } } +>x27 : x27 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x28 { private member: { (): Base[]; } = () => [d1, d2] } +>x28 : x28 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x29 { private member: { (): Base[]; } = function() { return [d1, d2] } } +>x29 : x29 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x30 { private member: { (): Base[]; } = function named() { return [d1, d2] } } +>x30 : x30 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x31 { private member: Base[] = [d1, d2] } +>x31 : x31 +>member : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x32 { private member: Array = [d1, d2] } +>x32 : x32 +>member : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x33 { private member: { [n: number]: Base; } = [d1, d2] } +>x33 : x33 +>member : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x34 { private member: {n: Base[]; } = { n: [d1, d2] } } +>x34 : x34 +>member : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x35 : x35 +>member : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } +>x36 : x36 +>member : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x37 { public member: () => Base[] = () => [d1, d2] } +>x37 : x37 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x38 { public member: () => Base[] = function() { return [d1, d2] } } +>x38 : x38 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x39 { public member: () => Base[] = function named() { return [d1, d2] } } +>x39 : x39 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x40 { public member: { (): Base[]; } = () => [d1, d2] } +>x40 : x40 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x41 { public member: { (): Base[]; } = function() { return [d1, d2] } } +>x41 : x41 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x42 { public member: { (): Base[]; } = function named() { return [d1, d2] } } +>x42 : x42 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x43 { public member: Base[] = [d1, d2] } +>x43 : x43 +>member : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x44 { public member: Array = [d1, d2] } +>x44 : x44 +>member : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x45 { public member: { [n: number]: Base; } = [d1, d2] } +>x45 : x45 +>member : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x46 { public member: {n: Base[]; } = { n: [d1, d2] } } +>x46 : x46 +>member : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x47 : x47 +>member : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } +>x48 : x48 +>member : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x49 { static member: () => Base[] = () => [d1, d2] } +>x49 : x49 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x50 { static member: () => Base[] = function() { return [d1, d2] } } +>x50 : x50 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x51 { static member: () => Base[] = function named() { return [d1, d2] } } +>x51 : x51 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x52 { static member: { (): Base[]; } = () => [d1, d2] } +>x52 : x52 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x53 { static member: { (): Base[]; } = function() { return [d1, d2] } } +>x53 : x53 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x54 { static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x54 : x54 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x55 { static member: Base[] = [d1, d2] } +>x55 : x55 +>member : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x56 { static member: Array = [d1, d2] } +>x56 : x56 +>member : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x57 { static member: { [n: number]: Base; } = [d1, d2] } +>x57 : x57 +>member : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x58 { static member: {n: Base[]; } = { n: [d1, d2] } } +>x58 : x58 +>member : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x59 : x59 +>member : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } +>x60 : x60 +>member : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x61 { private static member: () => Base[] = () => [d1, d2] } +>x61 : x61 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x62 { private static member: () => Base[] = function() { return [d1, d2] } } +>x62 : x62 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x63 { private static member: () => Base[] = function named() { return [d1, d2] } } +>x63 : x63 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x64 { private static member: { (): Base[]; } = () => [d1, d2] } +>x64 : x64 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x65 { private static member: { (): Base[]; } = function() { return [d1, d2] } } +>x65 : x65 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x66 { private static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x66 : x66 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x67 { private static member: Base[] = [d1, d2] } +>x67 : x67 +>member : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x68 { private static member: Array = [d1, d2] } +>x68 : x68 +>member : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x69 { private static member: { [n: number]: Base; } = [d1, d2] } +>x69 : x69 +>member : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x70 { private static member: {n: Base[]; } = { n: [d1, d2] } } +>x70 : x70 +>member : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x71 : x71 +>member : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } +>x72 : x72 +>member : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x73 { public static member: () => Base[] = () => [d1, d2] } +>x73 : x73 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x74 { public static member: () => Base[] = function() { return [d1, d2] } } +>x74 : x74 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x75 { public static member: () => Base[] = function named() { return [d1, d2] } } +>x75 : x75 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x76 { public static member: { (): Base[]; } = () => [d1, d2] } +>x76 : x76 +>member : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x77 { public static member: { (): Base[]; } = function() { return [d1, d2] } } +>x77 : x77 +>member : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x78 { public static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x78 : x78 +>member : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x79 { public static member: Base[] = [d1, d2] } +>x79 : x79 +>member : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x80 { public static member: Array = [d1, d2] } +>x80 : x80 +>member : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x81 { public static member: { [n: number]: Base; } = [d1, d2] } +>x81 : x81 +>member : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x82 { public static member: {n: Base[]; } = { n: [d1, d2] } } +>x82 : x82 +>member : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x83 : x83 +>member : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } +>x84 : x84 +>member : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x85 { constructor(parm: () => Base[] = () => [d1, d2]) { } } +>x85 : x85 +>parm : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x86 { constructor(parm: () => Base[] = function() { return [d1, d2] }) { } } +>x86 : x86 +>parm : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x87 { constructor(parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x87 : x87 +>parm : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x88 { constructor(parm: { (): Base[]; } = () => [d1, d2]) { } } +>x88 : x88 +>parm : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x89 { constructor(parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x89 : x89 +>parm : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x90 { constructor(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x90 : x90 +>parm : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x91 { constructor(parm: Base[] = [d1, d2]) { } } +>x91 : x91 +>parm : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x92 { constructor(parm: Array = [d1, d2]) { } } +>x92 : x92 +>parm : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x93 { constructor(parm: { [n: number]: Base; } = [d1, d2]) { } } +>x93 : x93 +>parm : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x94 { constructor(parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x94 : x94 +>parm : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x95 : x95 +>parm : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x96 : x96 +>parm : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x97 { constructor(public parm: () => Base[] = () => [d1, d2]) { } } +>x97 : x97 +>parm : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x98 { constructor(public parm: () => Base[] = function() { return [d1, d2] }) { } } +>x98 : x98 +>parm : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x99 { constructor(public parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x99 : x99 +>parm : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x100 { constructor(public parm: { (): Base[]; } = () => [d1, d2]) { } } +>x100 : x100 +>parm : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x101 { constructor(public parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x101 : x101 +>parm : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x102 { constructor(public parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x102 : x102 +>parm : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x103 { constructor(public parm: Base[] = [d1, d2]) { } } +>x103 : x103 +>parm : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x104 { constructor(public parm: Array = [d1, d2]) { } } +>x104 : x104 +>parm : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x105 { constructor(public parm: { [n: number]: Base; } = [d1, d2]) { } } +>x105 : x105 +>parm : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x106 { constructor(public parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x106 : x106 +>parm : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x107 : x107 +>parm : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x108 : x108 +>parm : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x109 { constructor(private parm: () => Base[] = () => [d1, d2]) { } } +>x109 : x109 +>parm : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x110 { constructor(private parm: () => Base[] = function() { return [d1, d2] }) { } } +>x110 : x110 +>parm : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x111 { constructor(private parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x111 : x111 +>parm : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x112 { constructor(private parm: { (): Base[]; } = () => [d1, d2]) { } } +>x112 : x112 +>parm : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x113 { constructor(private parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x113 : x113 +>parm : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x114 { constructor(private parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x114 : x114 +>parm : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x115 { constructor(private parm: Base[] = [d1, d2]) { } } +>x115 : x115 +>parm : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x116 { constructor(private parm: Array = [d1, d2]) { } } +>x116 : x116 +>parm : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x117 { constructor(private parm: { [n: number]: Base; } = [d1, d2]) { } } +>x117 : x117 +>parm : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x118 { constructor(private parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x118 : x118 +>parm : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x119 : x119 +>parm : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x120 : x120 +>parm : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x121(parm: () => Base[] = () => [d1, d2]) { } +>x121 : (parm?: () => Base[]) => void +>parm : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x122(parm: () => Base[] = function() { return [d1, d2] }) { } +>x122 : (parm?: () => Base[]) => void +>parm : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } +>x123 : (parm?: () => Base[]) => void +>parm : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x124(parm: { (): Base[]; } = () => [d1, d2]) { } +>x124 : (parm?: () => Base[]) => void +>parm : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } +>x125 : (parm?: () => Base[]) => void +>parm : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } +>x126 : (parm?: () => Base[]) => void +>parm : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x127(parm: Base[] = [d1, d2]) { } +>x127 : (parm?: Base[]) => void +>parm : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x128(parm: Array = [d1, d2]) { } +>x128 : (parm?: Base[]) => void +>parm : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x129(parm: { [n: number]: Base; } = [d1, d2]) { } +>x129 : (parm?: { [n: number]: Base; }) => void +>parm : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } +>x130 : (parm?: { n: Base[]; }) => void +>parm : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } +>x131 : (parm?: (s: Base[]) => any) => void +>parm : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } +>x132 : (parm?: Genric) => void +>parm : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x133(): () => Base[] { return () => [d1, d2]; } +>x133 : () => () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x134(): () => Base[] { return function() { return [d1, d2] }; } +>x134 : () => () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x135(): () => Base[] { return function named() { return [d1, d2] }; } +>x135 : () => () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x136(): { (): Base[]; } { return () => [d1, d2]; } +>x136 : () => () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } +>x137 : () => () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } +>x138 : () => () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x139(): Base[] { return [d1, d2]; } +>x139 : () => Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x140(): Array { return [d1, d2]; } +>x140 : () => Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x141(): { [n: number]: Base; } { return [d1, d2]; } +>x141 : () => { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x142(): {n: Base[]; } { return { n: [d1, d2] }; } +>x142 : () => { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; } +>x143 : () => (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +function x144(): Genric { return { func: n => { return [d1, d2]; } }; } +>x144 : () => Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } +>x145 : () => () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } +>x146 : () => () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } +>x147 : () => () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } +>x148 : () => () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } +>x149 : () => () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } +>x150 : () => () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x151(): Base[] { return [d1, d2]; return [d1, d2]; } +>x151 : () => Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x152(): Array { return [d1, d2]; return [d1, d2]; } +>x152 : () => Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } +>x153 : () => { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] }; } +>x154 : () => { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; return n => { var n: Base[]; return null; }; } +>x155 : () => (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } +>x156 : () => Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x157: () => () => Base[] = () => { return () => [d1, d2]; }; +>x157 : () => () => Base[] +>Base : Base +>() => { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x158: () => () => Base[] = () => { return function() { return [d1, d2] }; }; +>x158 : () => () => Base[] +>Base : Base +>() => { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x159: () => () => Base[] = () => { return function named() { return [d1, d2] }; }; +>x159 : () => () => Base[] +>Base : Base +>() => { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x160: () => { (): Base[]; } = () => { return () => [d1, d2]; }; +>x160 : () => () => Base[] +>Base : Base +>() => { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x161: () => { (): Base[]; } = () => { return function() { return [d1, d2] }; }; +>x161 : () => () => Base[] +>Base : Base +>() => { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x162: () => { (): Base[]; } = () => { return function named() { return [d1, d2] }; }; +>x162 : () => () => Base[] +>Base : Base +>() => { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x163: () => Base[] = () => { return [d1, d2]; }; +>x163 : () => Base[] +>Base : Base +>() => { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x164: () => Array = () => { return [d1, d2]; }; +>x164 : () => Base[] +>Array : T[] +>Base : Base +>() => { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x165: () => { [n: number]: Base; } = () => { return [d1, d2]; }; +>x165 : () => { [n: number]: Base; } +>n : number +>Base : Base +>() => { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x166: () => {n: Base[]; } = () => { return { n: [d1, d2] }; }; +>x166 : () => { n: Base[]; } +>n : Base[] +>Base : Base +>() => { return { n: [d1, d2] }; } : () => { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return null; }; }; +>x167 : () => (s: Base[]) => any +>s : Base[] +>Base : Base +>() => { return n => { var n: Base[]; return null; }; } : () => (n: Base[]) => any +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; +>x168 : () => Genric +>Genric : Genric +>Base : Base +>() => { return { func: n => { return [d1, d2]; } }; } : () => { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x169: () => () => Base[] = function() { return () => [d1, d2]; }; +>x169 : () => () => Base[] +>Base : Base +>function() { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x170: () => () => Base[] = function() { return function() { return [d1, d2] }; }; +>x170 : () => () => Base[] +>Base : Base +>function() { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x171: () => () => Base[] = function() { return function named() { return [d1, d2] }; }; +>x171 : () => () => Base[] +>Base : Base +>function() { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x172: () => { (): Base[]; } = function() { return () => [d1, d2]; }; +>x172 : () => () => Base[] +>Base : Base +>function() { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x173: () => { (): Base[]; } = function() { return function() { return [d1, d2] }; }; +>x173 : () => () => Base[] +>Base : Base +>function() { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x174: () => { (): Base[]; } = function() { return function named() { return [d1, d2] }; }; +>x174 : () => () => Base[] +>Base : Base +>function() { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x175: () => Base[] = function() { return [d1, d2]; }; +>x175 : () => Base[] +>Base : Base +>function() { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x176: () => Array = function() { return [d1, d2]; }; +>x176 : () => Base[] +>Array : T[] +>Base : Base +>function() { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x177: () => { [n: number]: Base; } = function() { return [d1, d2]; }; +>x177 : () => { [n: number]: Base; } +>n : number +>Base : Base +>function() { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x178: () => {n: Base[]; } = function() { return { n: [d1, d2] }; }; +>x178 : () => { n: Base[]; } +>n : Base[] +>Base : Base +>function() { return { n: [d1, d2] }; } : () => { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; return null; }; }; +>x179 : () => (s: Base[]) => any +>s : Base[] +>Base : Base +>function() { return n => { var n: Base[]; return null; }; } : () => (n: Base[]) => any +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; +>x180 : () => Genric +>Genric : Genric +>Base : Base +>function() { return { func: n => { return [d1, d2]; } }; } : () => { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x181 { var t: () => Base[] = () => [d1, d2]; } +>x181 : typeof x181 +>t : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x182 { var t: () => Base[] = function() { return [d1, d2] }; } +>x182 : typeof x182 +>t : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } +>x183 : typeof x183 +>t : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x184 { var t: { (): Base[]; } = () => [d1, d2]; } +>x184 : typeof x184 +>t : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } +>x185 : typeof x185 +>t : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } +>x186 : typeof x186 +>t : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x187 { var t: Base[] = [d1, d2]; } +>x187 : typeof x187 +>t : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x188 { var t: Array = [d1, d2]; } +>x188 : typeof x188 +>t : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x189 { var t: { [n: number]: Base; } = [d1, d2]; } +>x189 : typeof x189 +>t : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } +>x190 : typeof x190 +>t : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } +>x191 : typeof x191 +>t : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } +>x192 : typeof x192 +>t : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x193 { export var t: () => Base[] = () => [d1, d2]; } +>x193 : typeof x193 +>t : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } +>x194 : typeof x194 +>t : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; } +>x195 : typeof x195 +>t : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } +>x196 : typeof x196 +>t : () => Base[] +>Base : Base +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } +>x197 : typeof x197 +>t : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] }; } +>x198 : typeof x198 +>t : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x199 { export var t: Base[] = [d1, d2]; } +>x199 : typeof x199 +>t : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x200 { export var t: Array = [d1, d2]; } +>x200 : typeof x200 +>t : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } +>x201 : typeof x201 +>t : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } +>x202 : typeof x202 +>t : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } +>x203 : typeof x203 +>t : (s: Base[]) => any +>s : Base[] +>Base : Base +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } +>x204 : typeof x204 +>t : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x206 = <() => Base[]>function() { return [d1, d2] }; +>x206 : () => Base[] +><() => Base[]>function() { return [d1, d2] } : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x207 = <() => Base[]>function named() { return [d1, d2] }; +>x207 : () => Base[] +><() => Base[]>function named() { return [d1, d2] } : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; +>x209 : () => Base[] +><{ (): Base[]; }>function() { return [d1, d2] } : () => Base[] +>Base : Base +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x210 = <{ (): Base[]; }>function named() { return [d1, d2] }; +>x210 : () => Base[] +><{ (): Base[]; }>function named() { return [d1, d2] } : () => Base[] +>Base : Base +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x211 = [d1, d2]; +>x211 : Base[] +>[d1, d2] : Base[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x212 = >[d1, d2]; +>x212 : Base[] +>>[d1, d2] : Base[] +>Array : T[] +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x213 = <{ [n: number]: Base; }>[d1, d2]; +>x213 : { [n: number]: Base; } +><{ [n: number]: Base; }>[d1, d2] : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x214 = <{n: Base[]; } >{ n: [d1, d2] }; +>x214 : { n: Base[]; } +><{n: Base[]; } >{ n: [d1, d2] } : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x216 = >{ func: n => { return [d1, d2]; } }; +>x216 : Genric +>>{ func: n => { return [d1, d2]; } } : Genric +>Genric : Genric +>Base : Base +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x217 = (<() => Base[]>undefined) || function() { return [d1, d2] }; +>x217 : () => Base[] +>(<() => Base[]>undefined) || function() { return [d1, d2] } : () => Base[] +>(<() => Base[]>undefined) : () => Base[] +><() => Base[]>undefined : () => Base[] +>Base : Base +>undefined : undefined +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x218 = (<() => Base[]>undefined) || function named() { return [d1, d2] }; +>x218 : () => Base[] +>(<() => Base[]>undefined) || function named() { return [d1, d2] } : () => Base[] +>(<() => Base[]>undefined) : () => Base[] +><() => Base[]>undefined : () => Base[] +>Base : Base +>undefined : undefined +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x219 = (<{ (): Base[]; }>undefined) || function() { return [d1, d2] }; +>x219 : () => Base[] +>(<{ (): Base[]; }>undefined) || function() { return [d1, d2] } : () => Base[] +>(<{ (): Base[]; }>undefined) : () => Base[] +><{ (): Base[]; }>undefined : () => Base[] +>Base : Base +>undefined : undefined +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x220 = (<{ (): Base[]; }>undefined) || function named() { return [d1, d2] }; +>x220 : () => Base[] +>(<{ (): Base[]; }>undefined) || function named() { return [d1, d2] } : () => Base[] +>(<{ (): Base[]; }>undefined) : () => Base[] +><{ (): Base[]; }>undefined : () => Base[] +>Base : Base +>undefined : undefined +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x221 = (undefined) || [d1, d2]; +>x221 : Base[] +>(undefined) || [d1, d2] : Base[] +>(undefined) : Base[] +>undefined : Base[] +>Base : Base +>undefined : undefined +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x222 = (>undefined) || [d1, d2]; +>x222 : Base[] +>(>undefined) || [d1, d2] : Base[] +>(>undefined) : Base[] +>>undefined : Base[] +>Array : T[] +>Base : Base +>undefined : undefined +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2]; +>x223 : { [n: number]: Base; } +>(<{ [n: number]: Base; }>undefined) || [d1, d2] : { [n: number]: Base; } +>(<{ [n: number]: Base; }>undefined) : { [n: number]: Base; } +><{ [n: number]: Base; }>undefined : { [n: number]: Base; } +>n : number +>Base : Base +>undefined : undefined +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x224 = (<{n: Base[]; } >undefined) || { n: [d1, d2] }; +>x224 : { n: Base[]; } +>(<{n: Base[]; } >undefined) || { n: [d1, d2] } : { n: Base[]; } +>(<{n: Base[]; } >undefined) : { n: Base[]; } +><{n: Base[]; } >undefined : { n: Base[]; } +>n : Base[] +>Base : Base +>undefined : undefined +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x225: () => Base[]; x225 = () => [d1, d2]; +>x225 : () => Base[] +>Base : Base +>x225 = () => [d1, d2] : () => (Derived1 | Derived2)[] +>x225 : () => Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x226: () => Base[]; x226 = function() { return [d1, d2] }; +>x226 : () => Base[] +>Base : Base +>x226 = function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>x226 : () => Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x227: () => Base[]; x227 = function named() { return [d1, d2] }; +>x227 : () => Base[] +>Base : Base +>x227 = function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>x227 : () => Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x228: { (): Base[]; }; x228 = () => [d1, d2]; +>x228 : () => Base[] +>Base : Base +>x228 = () => [d1, d2] : () => (Derived1 | Derived2)[] +>x228 : () => Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x229: { (): Base[]; }; x229 = function() { return [d1, d2] }; +>x229 : () => Base[] +>Base : Base +>x229 = function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>x229 : () => Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x230: { (): Base[]; }; x230 = function named() { return [d1, d2] }; +>x230 : () => Base[] +>Base : Base +>x230 = function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>x230 : () => Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x231: Base[]; x231 = [d1, d2]; +>x231 : Base[] +>Base : Base +>x231 = [d1, d2] : (Derived1 | Derived2)[] +>x231 : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x232: Array; x232 = [d1, d2]; +>x232 : Base[] +>Array : T[] +>Base : Base +>x232 = [d1, d2] : (Derived1 | Derived2)[] +>x232 : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x233: { [n: number]: Base; }; x233 = [d1, d2]; +>x233 : { [n: number]: Base; } +>n : number +>Base : Base +>x233 = [d1, d2] : (Derived1 | Derived2)[] +>x233 : { [n: number]: Base; } +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x234: {n: Base[]; } ; x234 = { n: [d1, d2] }; +>x234 : { n: Base[]; } +>n : Base[] +>Base : Base +>x234 = { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>x234 : { n: Base[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; +>x235 : (s: Base[]) => any +>s : Base[] +>Base : Base +>x235 = n => { var n: Base[]; return null; } : (n: Base[]) => any +>x235 : (s: Base[]) => any +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; +>x236 : Genric +>Genric : Genric +>Base : Base +>x236 = { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>x236 : Genric +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x237: { n: () => Base[]; } = { n: () => [d1, d2] }; +>x237 : { n: () => Base[]; } +>n : () => Base[] +>Base : Base +>{ n: () => [d1, d2] } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x238: { n: () => Base[]; } = { n: function() { return [d1, d2] } }; +>x238 : { n: () => Base[]; } +>n : () => Base[] +>Base : Base +>{ n: function() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x239: { n: () => Base[]; } = { n: function named() { return [d1, d2] } }; +>x239 : { n: () => Base[]; } +>n : () => Base[] +>Base : Base +>{ n: function named() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x240: { n: { (): Base[]; }; } = { n: () => [d1, d2] }; +>x240 : { n: () => Base[]; } +>n : () => Base[] +>Base : Base +>{ n: () => [d1, d2] } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x241: { n: { (): Base[]; }; } = { n: function() { return [d1, d2] } }; +>x241 : { n: () => Base[]; } +>n : () => Base[] +>Base : Base +>{ n: function() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x242: { n: { (): Base[]; }; } = { n: function named() { return [d1, d2] } }; +>x242 : { n: () => Base[]; } +>n : () => Base[] +>Base : Base +>{ n: function named() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x243: { n: Base[]; } = { n: [d1, d2] }; +>x243 : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x244: { n: Array; } = { n: [d1, d2] }; +>x244 : { n: Base[]; } +>n : Base[] +>Array : T[] +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x245: { n: { [n: number]: Base; }; } = { n: [d1, d2] }; +>x245 : { n: { [n: number]: Base; }; } +>n : { [n: number]: Base; } +>n : number +>Base : Base +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x246: { n: {n: Base[]; } ; } = { n: { n: [d1, d2] } }; +>x246 : { n: { n: Base[]; }; } +>n : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: { n: [d1, d2] } } : { n: { n: (Derived1 | Derived2)[]; }; } +>n : { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } }; +>x247 : { n: (s: Base[]) => any; } +>n : (s: Base[]) => any +>s : Base[] +>Base : Base +>{ n: n => { var n: Base[]; return null; } } : { n: (n: Base[]) => any; } +>n : (n: Base[]) => any +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; +>x248 : { n: Genric; } +>n : Genric +>Genric : Genric +>Base : Base +>{ n: { func: n => { return [d1, d2]; } } } : { n: { func: (n: Base[]) => (Derived1 | Derived2)[]; }; } +>n : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x252: { (): Base[]; }[] = [() => [d1, d2]]; +>x252 : (() => Base[])[] +>Base : Base +>[() => [d1, d2]] : (() => (Derived1 | Derived2)[])[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x253: { (): Base[]; }[] = [function() { return [d1, d2] }]; +>x253 : (() => Base[])[] +>Base : Base +>[function() { return [d1, d2] }] : (() => (Derived1 | Derived2)[])[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x254: { (): Base[]; }[] = [function named() { return [d1, d2] }]; +>x254 : (() => Base[])[] +>Base : Base +>[function named() { return [d1, d2] }] : (() => (Derived1 | Derived2)[])[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x255: Base[][] = [[d1, d2]]; +>x255 : Base[][] +>Base : Base +>[[d1, d2]] : (Derived1 | Derived2)[][] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x256: Array[] = [[d1, d2]]; +>x256 : Base[][] +>Array : T[] +>Base : Base +>[[d1, d2]] : (Derived1 | Derived2)[][] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x257: { [n: number]: Base; }[] = [[d1, d2]]; +>x257 : { [n: number]: Base; }[] +>n : number +>Base : Base +>[[d1, d2]] : (Derived1 | Derived2)[][] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x258: {n: Base[]; } [] = [{ n: [d1, d2] }]; +>x258 : { n: Base[]; }[] +>n : Base[] +>Base : Base +>[{ n: [d1, d2] }] : { n: (Derived1 | Derived2)[]; }[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x260: Genric[] = [{ func: n => { return [d1, d2]; } }]; +>x260 : Genric[] +>Genric : Genric +>Base : Base +>[{ func: n => { return [d1, d2]; } }] : { func: (n: Base[]) => (Derived1 | Derived2)[]; }[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x261: () => Base[] = function() { return [d1, d2] } || undefined; +>x261 : () => Base[] +>Base : Base +>function() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x262: () => Base[] = function named() { return [d1, d2] } || undefined; +>x262 : () => Base[] +>Base : Base +>function named() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; +>x263 : () => Base[] +>Base : Base +>function() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; +>x264 : () => Base[] +>Base : Base +>function named() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x265: Base[] = [d1, d2] || undefined; +>x265 : Base[] +>Base : Base +>[d1, d2] || undefined : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x266: Array = [d1, d2] || undefined; +>x266 : Base[] +>Array : T[] +>Base : Base +>[d1, d2] || undefined : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x267: { [n: number]: Base; } = [d1, d2] || undefined; +>x267 : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] || undefined : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; +>x268 : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } || undefined : { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x269: () => Base[] = undefined || function() { return [d1, d2] }; +>x269 : () => Base[] +>Base : Base +>undefined || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>undefined : undefined +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x270: () => Base[] = undefined || function named() { return [d1, d2] }; +>x270 : () => Base[] +>Base : Base +>undefined || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>undefined : undefined +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x271: { (): Base[]; } = undefined || function() { return [d1, d2] }; +>x271 : () => Base[] +>Base : Base +>undefined || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>undefined : undefined +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x272: { (): Base[]; } = undefined || function named() { return [d1, d2] }; +>x272 : () => Base[] +>Base : Base +>undefined || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>undefined : undefined +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x273: Base[] = undefined || [d1, d2]; +>x273 : Base[] +>Base : Base +>undefined || [d1, d2] : (Derived1 | Derived2)[] +>undefined : undefined +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x274: Array = undefined || [d1, d2]; +>x274 : Base[] +>Array : T[] +>Base : Base +>undefined || [d1, d2] : (Derived1 | Derived2)[] +>undefined : undefined +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x275: { [n: number]: Base; } = undefined || [d1, d2]; +>x275 : { [n: number]: Base; } +>n : number +>Base : Base +>undefined || [d1, d2] : (Derived1 | Derived2)[] +>undefined : undefined +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x276: {n: Base[]; } = undefined || { n: [d1, d2] }; +>x276 : { n: Base[]; } +>n : Base[] +>Base : Base +>undefined || { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>undefined : undefined +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x277: () => Base[] = function() { return [d1, d2] } || function() { return [d1, d2] }; +>x277 : () => Base[] +>Base : Base +>function() { return [d1, d2] } || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x278: () => Base[] = function named() { return [d1, d2] } || function named() { return [d1, d2] }; +>x278 : () => Base[] +>Base : Base +>function named() { return [d1, d2] } || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x279: { (): Base[]; } = function() { return [d1, d2] } || function() { return [d1, d2] }; +>x279 : () => Base[] +>Base : Base +>function() { return [d1, d2] } || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x280: { (): Base[]; } = function named() { return [d1, d2] } || function named() { return [d1, d2] }; +>x280 : () => Base[] +>Base : Base +>function named() { return [d1, d2] } || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x281: Base[] = [d1, d2] || [d1, d2]; +>x281 : Base[] +>Base : Base +>[d1, d2] || [d1, d2] : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x282: Array = [d1, d2] || [d1, d2]; +>x282 : Base[] +>Array : T[] +>Base : Base +>[d1, d2] || [d1, d2] : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2]; +>x283 : { [n: number]: Base; } +>n : number +>Base : Base +>[d1, d2] || [d1, d2] : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x284: {n: Base[]; } = { n: [d1, d2] } || { n: [d1, d2] }; +>x284 : { n: Base[]; } +>n : Base[] +>Base : Base +>{ n: [d1, d2] } || { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; +>x285 : () => Base[] +>Base : Base +>true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; +>x286 : () => Base[] +>Base : Base +>true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x287: () => Base[] = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; +>x287 : () => Base[] +>Base : Base +>true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; +>x288 : () => Base[] +>Base : Base +>true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; +>x289 : () => Base[] +>Base : Base +>true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; +>x290 : () => Base[] +>Base : Base +>true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x291: Base[] = true ? [d1, d2] : [d1, d2]; +>x291 : Base[] +>Base : Base +>true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x292: Array = true ? [d1, d2] : [d1, d2]; +>x292 : Base[] +>Array : T[] +>Base : Base +>true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; +>x293 : { [n: number]: Base; } +>n : number +>Base : Base +>true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; +>x294 : { n: Base[]; } +>n : Base[] +>Base : Base +>true ? { n: [d1, d2] } : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>true : boolean +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; }; +>x295 : (s: Base[]) => any +>s : Base[] +>Base : Base +>true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; } : (n: Base[]) => any +>true : boolean +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; +>x296 : Genric +>Genric : Genric +>Base : Base +>true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>true : boolean +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x297: () => Base[] = true ? undefined : () => [d1, d2]; +>x297 : () => Base[] +>Base : Base +>true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean +>undefined : undefined +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; +>x298 : () => Base[] +>Base : Base +>true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean +>undefined : undefined +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] }; +>x299 : () => Base[] +>Base : Base +>true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean +>undefined : undefined +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; +>x300 : () => Base[] +>Base : Base +>true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean +>undefined : undefined +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; +>x301 : () => Base[] +>Base : Base +>true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean +>undefined : undefined +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2] }; +>x302 : () => Base[] +>Base : Base +>true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean +>undefined : undefined +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x303: Base[] = true ? undefined : [d1, d2]; +>x303 : Base[] +>Base : Base +>true ? undefined : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean +>undefined : undefined +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x304: Array = true ? undefined : [d1, d2]; +>x304 : Base[] +>Array : T[] +>Base : Base +>true ? undefined : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean +>undefined : undefined +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; +>x305 : { [n: number]: Base; } +>n : number +>Base : Base +>true ? undefined : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean +>undefined : undefined +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; +>x306 : { n: Base[]; } +>n : Base[] +>Base : Base +>true ? undefined : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>true : boolean +>undefined : undefined +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return null; }; +>x307 : (s: Base[]) => any +>s : Base[] +>Base : Base +>true ? undefined : n => { var n: Base[]; return null; } : (n: Base[]) => any +>true : boolean +>undefined : undefined +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; +>x308 : Genric +>Genric : Genric +>Base : Base +>true ? undefined : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>true : boolean +>undefined : undefined +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x309: () => Base[] = true ? () => [d1, d2] : undefined; +>x309 : () => Base[] +>Base : Base +>true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] +>true : boolean +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; +>x310 : () => Base[] +>Base : Base +>true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined; +>x311 : () => Base[] +>Base : Base +>true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; +>x312 : () => Base[] +>Base : Base +>true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] +>true : boolean +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; +>x313 : () => Base[] +>Base : Base +>true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefined; +>x314 : () => Base[] +>Base : Base +>true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x315: Base[] = true ? [d1, d2] : undefined; +>x315 : Base[] +>Base : Base +>true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>true : boolean +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x316: Array = true ? [d1, d2] : undefined; +>x316 : Base[] +>Array : T[] +>Base : Base +>true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>true : boolean +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; +>x317 : { [n: number]: Base; } +>n : number +>Base : Base +>true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>true : boolean +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; +>x318 : { n: Base[]; } +>n : Base[] +>Base : Base +>true ? { n: [d1, d2] } : undefined : { n: (Derived1 | Derived2)[]; } +>true : boolean +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : undefined; +>x319 : (s: Base[]) => any +>s : Base[] +>Base : Base +>true ? n => { var n: Base[]; return null; } : undefined : (n: Base[]) => any +>true : boolean +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null +>undefined : undefined + +var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; +>x320 : Genric +>Genric : Genric +>Base : Base +>true ? { func: n => { return [d1, d2]; } } : undefined : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>true : boolean +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 +>undefined : undefined + +function x321(n: () => Base[]) { }; x321(() => [d1, d2]); +>x321 : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x321(() => [d1, d2]) : void +>x321 : (n: () => Base[]) => void +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); +>x322 : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x322(function() { return [d1, d2] }) : void +>x322 : (n: () => Base[]) => void +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); +>x323 : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x323(function named() { return [d1, d2] }) : void +>x323 : (n: () => Base[]) => void +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); +>x324 : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x324(() => [d1, d2]) : void +>x324 : (n: () => Base[]) => void +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); +>x325 : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x325(function() { return [d1, d2] }) : void +>x325 : (n: () => Base[]) => void +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] }); +>x326 : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x326(function named() { return [d1, d2] }) : void +>x326 : (n: () => Base[]) => void +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x327(n: Base[]) { }; x327([d1, d2]); +>x327 : (n: Base[]) => void +>n : Base[] +>Base : Base +>x327([d1, d2]) : void +>x327 : (n: Base[]) => void +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x328(n: Array) { }; x328([d1, d2]); +>x328 : (n: Base[]) => void +>n : Base[] +>Array : T[] +>Base : Base +>x328([d1, d2]) : void +>x328 : (n: Base[]) => void +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); +>x329 : (n: { [n: number]: Base; }) => void +>n : { [n: number]: Base; } +>n : number +>Base : Base +>x329([d1, d2]) : void +>x329 : (n: { [n: number]: Base; }) => void +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); +>x330 : (n: { n: Base[]; }) => void +>n : { n: Base[]; } +>n : Base[] +>Base : Base +>x330({ n: [d1, d2] }) : void +>x330 : (n: { n: Base[]; }) => void +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null; }); +>x331 : (n: (s: Base[]) => any) => void +>n : (s: Base[]) => any +>s : Base[] +>Base : Base +>x331(n => { var n: Base[]; return null; }) : void +>x331 : (n: (s: Base[]) => any) => void +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); +>x332 : (n: Genric) => void +>n : Genric +>Genric : Genric +>Base : Base +>x332({ func: n => { return [d1, d2]; } }) : void +>x332 : (n: Genric) => void +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x333 = (n: () => Base[]) => n; x333(() => [d1, d2]); +>x333 : (n: () => Base[]) => () => Base[] +>(n: () => Base[]) => n : (n: () => Base[]) => () => Base[] +>n : () => Base[] +>Base : Base +>n : () => Base[] +>x333(() => [d1, d2]) : () => Base[] +>x333 : (n: () => Base[]) => () => Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x334 = (n: () => Base[]) => n; x334(function() { return [d1, d2] }); +>x334 : (n: () => Base[]) => () => Base[] +>(n: () => Base[]) => n : (n: () => Base[]) => () => Base[] +>n : () => Base[] +>Base : Base +>n : () => Base[] +>x334(function() { return [d1, d2] }) : () => Base[] +>x334 : (n: () => Base[]) => () => Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x335 = (n: () => Base[]) => n; x335(function named() { return [d1, d2] }); +>x335 : (n: () => Base[]) => () => Base[] +>(n: () => Base[]) => n : (n: () => Base[]) => () => Base[] +>n : () => Base[] +>Base : Base +>n : () => Base[] +>x335(function named() { return [d1, d2] }) : () => Base[] +>x335 : (n: () => Base[]) => () => Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x336 = (n: { (): Base[]; }) => n; x336(() => [d1, d2]); +>x336 : (n: () => Base[]) => () => Base[] +>(n: { (): Base[]; }) => n : (n: () => Base[]) => () => Base[] +>n : () => Base[] +>Base : Base +>n : () => Base[] +>x336(() => [d1, d2]) : () => Base[] +>x336 : (n: () => Base[]) => () => Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x337 = (n: { (): Base[]; }) => n; x337(function() { return [d1, d2] }); +>x337 : (n: () => Base[]) => () => Base[] +>(n: { (): Base[]; }) => n : (n: () => Base[]) => () => Base[] +>n : () => Base[] +>Base : Base +>n : () => Base[] +>x337(function() { return [d1, d2] }) : () => Base[] +>x337 : (n: () => Base[]) => () => Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x338 = (n: { (): Base[]; }) => n; x338(function named() { return [d1, d2] }); +>x338 : (n: () => Base[]) => () => Base[] +>(n: { (): Base[]; }) => n : (n: () => Base[]) => () => Base[] +>n : () => Base[] +>Base : Base +>n : () => Base[] +>x338(function named() { return [d1, d2] }) : () => Base[] +>x338 : (n: () => Base[]) => () => Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x339 = (n: Base[]) => n; x339([d1, d2]); +>x339 : (n: Base[]) => Base[] +>(n: Base[]) => n : (n: Base[]) => Base[] +>n : Base[] +>Base : Base +>n : Base[] +>x339([d1, d2]) : Base[] +>x339 : (n: Base[]) => Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x340 = (n: Array) => n; x340([d1, d2]); +>x340 : (n: Base[]) => Base[] +>(n: Array) => n : (n: Base[]) => Base[] +>n : Base[] +>Array : T[] +>Base : Base +>n : Base[] +>x340([d1, d2]) : Base[] +>x340 : (n: Base[]) => Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x341 = (n: { [n: number]: Base; }) => n; x341([d1, d2]); +>x341 : (n: { [n: number]: Base; }) => { [n: number]: Base; } +>(n: { [n: number]: Base; }) => n : (n: { [n: number]: Base; }) => { [n: number]: Base; } +>n : { [n: number]: Base; } +>n : number +>Base : Base +>n : { [n: number]: Base; } +>x341([d1, d2]) : { [n: number]: Base; } +>x341 : (n: { [n: number]: Base; }) => { [n: number]: Base; } +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x342 = (n: {n: Base[]; } ) => n; x342({ n: [d1, d2] }); +>x342 : (n: { n: Base[]; }) => { n: Base[]; } +>(n: {n: Base[]; } ) => n : (n: { n: Base[]; }) => { n: Base[]; } +>n : { n: Base[]; } +>n : Base[] +>Base : Base +>n : { n: Base[]; } +>x342({ n: [d1, d2] }) : { n: Base[]; } +>x342 : (n: { n: Base[]; }) => { n: Base[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; }); +>x343 : (n: (s: Base[]) => any) => (s: Base[]) => any +>(n: (s: Base[]) => any) => n : (n: (s: Base[]) => any) => (s: Base[]) => any +>n : (s: Base[]) => any +>s : Base[] +>Base : Base +>n : (s: Base[]) => any +>x343(n => { var n: Base[]; return null; }) : (s: Base[]) => any +>x343 : (n: (s: Base[]) => any) => (s: Base[]) => any +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); +>x344 : (n: Genric) => Genric +>(n: Genric) => n : (n: Genric) => Genric +>n : Genric +>Genric : Genric +>Base : Base +>n : Genric +>x344({ func: n => { return [d1, d2]; } }) : Genric +>x344 : (n: Genric) => Genric +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x345 = function(n: () => Base[]) { }; x345(() => [d1, d2]); +>x345 : (n: () => Base[]) => void +>function(n: () => Base[]) { } : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x345(() => [d1, d2]) : void +>x345 : (n: () => Base[]) => void +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x346 = function(n: () => Base[]) { }; x346(function() { return [d1, d2] }); +>x346 : (n: () => Base[]) => void +>function(n: () => Base[]) { } : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x346(function() { return [d1, d2] }) : void +>x346 : (n: () => Base[]) => void +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x347 = function(n: () => Base[]) { }; x347(function named() { return [d1, d2] }); +>x347 : (n: () => Base[]) => void +>function(n: () => Base[]) { } : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x347(function named() { return [d1, d2] }) : void +>x347 : (n: () => Base[]) => void +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x348 = function(n: { (): Base[]; }) { }; x348(() => [d1, d2]); +>x348 : (n: () => Base[]) => void +>function(n: { (): Base[]; }) { } : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x348(() => [d1, d2]) : void +>x348 : (n: () => Base[]) => void +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x349 = function(n: { (): Base[]; }) { }; x349(function() { return [d1, d2] }); +>x349 : (n: () => Base[]) => void +>function(n: { (): Base[]; }) { } : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x349(function() { return [d1, d2] }) : void +>x349 : (n: () => Base[]) => void +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x350 = function(n: { (): Base[]; }) { }; x350(function named() { return [d1, d2] }); +>x350 : (n: () => Base[]) => void +>function(n: { (): Base[]; }) { } : (n: () => Base[]) => void +>n : () => Base[] +>Base : Base +>x350(function named() { return [d1, d2] }) : void +>x350 : (n: () => Base[]) => void +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x351 = function(n: Base[]) { }; x351([d1, d2]); +>x351 : (n: Base[]) => void +>function(n: Base[]) { } : (n: Base[]) => void +>n : Base[] +>Base : Base +>x351([d1, d2]) : void +>x351 : (n: Base[]) => void +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x352 = function(n: Array) { }; x352([d1, d2]); +>x352 : (n: Base[]) => void +>function(n: Array) { } : (n: Base[]) => void +>n : Base[] +>Array : T[] +>Base : Base +>x352([d1, d2]) : void +>x352 : (n: Base[]) => void +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x353 = function(n: { [n: number]: Base; }) { }; x353([d1, d2]); +>x353 : (n: { [n: number]: Base; }) => void +>function(n: { [n: number]: Base; }) { } : (n: { [n: number]: Base; }) => void +>n : { [n: number]: Base; } +>n : number +>Base : Base +>x353([d1, d2]) : void +>x353 : (n: { [n: number]: Base; }) => void +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x354 = function(n: {n: Base[]; } ) { }; x354({ n: [d1, d2] }); +>x354 : (n: { n: Base[]; }) => void +>function(n: {n: Base[]; } ) { } : (n: { n: Base[]; }) => void +>n : { n: Base[]; } +>n : Base[] +>Base : Base +>x354({ n: [d1, d2] }) : void +>x354 : (n: { n: Base[]; }) => void +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + +var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; return null; }); +>x355 : (n: (s: Base[]) => any) => void +>function(n: (s: Base[]) => any) { } : (n: (s: Base[]) => any) => void +>n : (s: Base[]) => any +>s : Base[] +>Base : Base +>x355(n => { var n: Base[]; return null; }) : void +>x355 : (n: (s: Base[]) => any) => void +>n => { var n: Base[]; return null; } : (n: Base[]) => any +>n : Base[] +>n : Base[] +>Base : Base +>null : null + +var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); +>x356 : (n: Genric) => void +>function(n: Genric) { } : (n: Genric) => void +>n : Genric +>Genric : Genric +>Base : Base +>x356({ func: n => { return [d1, d2]; } }) : void +>x356 : (n: Genric) => void +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] +>n : Base[] +>[d1, d2] : (Derived1 | Derived2)[] +>d1 : Derived1 +>d2 : Derived2 + diff --git a/tests/baselines/reference/ifDoWhileStatements.errors.txt b/tests/baselines/reference/ifDoWhileStatements.errors.txt deleted file mode 100644 index fb8985e634bfc..0000000000000 --- a/tests/baselines/reference/ifDoWhileStatements.errors.txt +++ /dev/null @@ -1,168 +0,0 @@ -tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts(42,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts (1 errors) ==== - interface I { - id: number; - } - - class C implements I { - id: number; - name: string; - } - - class C2 extends C { - valid: boolean; - } - - class D{ - source: T; - recurse: D; - wrapped: D> - } - - function F(x: string): number { return 42; } - function F2(x: number): boolean { return x < 42; } - - module M { - export class A { - name: string; - } - - export function F2(x: number): string { return x.toString(); } - } - - module N { - export class A { - id: number; - } - - export function F2(x: number): string { return x.toString(); } - } - - // literals - if (true) { } - while (true) { } - do { }while(true) - ~~ -!!! error TS7027: Unreachable code detected. - - if (null) { } - while (null) { } - do { }while(null) - - if (undefined) { } - while (undefined) { } - do { }while(undefined) - - if (0.0) { } - while (0.0) { } - do { }while(0.0) - - if ('a string') { } - while ('a string') { } - do { }while('a string') - - if ('') { } - while ('') { } - do { }while('') - - if (/[a-z]/) { } - while (/[a-z]/) { } - do { }while(/[a-z]/) - - if ([]) { } - while ([]) { } - do { }while([]) - - if ([1, 2]) { } - while ([1, 2]) { } - do { }while([1, 2]) - - if ({}) { } - while ({}) { } - do { }while({}) - - if ({ x: 1, y: 'a' }) { } - while ({ x: 1, y: 'a' }) { } - do { }while({ x: 1, y: 'a' }) - - if (() => 43) { } - while (() => 43) { } - do { }while(() => 43) - - if (new C()) { } - while (new C()) { } - do { }while(new C()) - - if (new D()) { } - while (new D()) { } - do { }while(new D()) - - // references - var a = true; - if (a) { } - while (a) { } - do { }while(a) - - var b = null; - if (b) { } - while (b) { } - do { }while(b) - - var c = undefined; - if (c) { } - while (c) { } - do { }while(c) - - var d = 0.0; - if (d) { } - while (d) { } - do { }while(d) - - var e = 'a string'; - if (e) { } - while (e) { } - do { }while(e) - - var f = ''; - if (f) { } - while (f) { } - do { }while(f) - - var g = /[a-z]/ - if (g) { } - while (g) { } - do { }while(g) - - var h = []; - if (h) { } - while (h) { } - do { }while(h) - - var i = [1, 2]; - if (i) { } - while (i) { } - do { }while(i) - - var j = {}; - if (j) { } - while (j) { } - do { }while(j) - - var k = { x: 1, y: 'a' }; - if (k) { } - while (k) { } - do { }while(k) - - function fn(x?: string): I { return null; } - if (fn()) { } - while (fn()) { } - do { }while(fn()) - - if (fn) { } - while (fn) { } - do { }while(fn) - - - \ No newline at end of file diff --git a/tests/baselines/reference/ifDoWhileStatements.js b/tests/baselines/reference/ifDoWhileStatements.js index 020d3f053d140..a2553c674b090 100644 --- a/tests/baselines/reference/ifDoWhileStatements.js +++ b/tests/baselines/reference/ifDoWhileStatements.js @@ -1,4 +1,5 @@ //// [ifDoWhileStatements.ts] + interface I { id: number; } diff --git a/tests/baselines/reference/ifDoWhileStatements.symbols b/tests/baselines/reference/ifDoWhileStatements.symbols new file mode 100644 index 0000000000000..80c8fc7f1d884 --- /dev/null +++ b/tests/baselines/reference/ifDoWhileStatements.symbols @@ -0,0 +1,337 @@ +=== tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts === + +interface I { +>I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(ifDoWhileStatements.ts, 1, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 3, 1)) +>I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(ifDoWhileStatements.ts, 5, 22)) + + name: string; +>name : Symbol(name, Decl(ifDoWhileStatements.ts, 6, 15)) +} + +class C2 extends C { +>C2 : Symbol(C2, Decl(ifDoWhileStatements.ts, 8, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 3, 1)) + + valid: boolean; +>valid : Symbol(valid, Decl(ifDoWhileStatements.ts, 10, 20)) +} + +class D{ +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 12, 1)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 14, 8)) + + source: T; +>source : Symbol(source, Decl(ifDoWhileStatements.ts, 14, 11)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 14, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(ifDoWhileStatements.ts, 15, 14)) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 12, 1)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 14, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(ifDoWhileStatements.ts, 16, 18)) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 12, 1)) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 12, 1)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 14, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(ifDoWhileStatements.ts, 18, 1)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 20, 11)) + +function F2(x: number): boolean { return x < 42; } +>F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 20, 44)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 21, 12)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 21, 12)) + +module M { +>M : Symbol(M, Decl(ifDoWhileStatements.ts, 21, 50)) + + export class A { +>A : Symbol(A, Decl(ifDoWhileStatements.ts, 23, 10)) + + name: string; +>name : Symbol(name, Decl(ifDoWhileStatements.ts, 24, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 26, 5)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 28, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 28, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +} + +module N { +>N : Symbol(N, Decl(ifDoWhileStatements.ts, 29, 1)) + + export class A { +>A : Symbol(A, Decl(ifDoWhileStatements.ts, 31, 10)) + + id: number; +>id : Symbol(id, Decl(ifDoWhileStatements.ts, 32, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 34, 5)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 36, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 36, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +} + +// literals +if (true) { } +while (true) { } +do { }while(true) + +if (null) { } +while (null) { } +do { }while(null) + +if (undefined) { } +>undefined : Symbol(undefined) + +while (undefined) { } +>undefined : Symbol(undefined) + +do { }while(undefined) +>undefined : Symbol(undefined) + +if (0.0) { } +while (0.0) { } +do { }while(0.0) + +if ('a string') { } +while ('a string') { } +do { }while('a string') + +if ('') { } +while ('') { } +do { }while('') + +if (/[a-z]/) { } +while (/[a-z]/) { } +do { }while(/[a-z]/) + +if ([]) { } +while ([]) { } +do { }while([]) + +if ([1, 2]) { } +while ([1, 2]) { } +do { }while([1, 2]) + +if ({}) { } +while ({}) { } +do { }while({}) + +if ({ x: 1, y: 'a' }) { } +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 80, 5)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 80, 11)) + +while ({ x: 1, y: 'a' }) { } +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 81, 8)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 81, 14)) + +do { }while({ x: 1, y: 'a' }) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 82, 13)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 82, 19)) + +if (() => 43) { } +while (() => 43) { } +do { }while(() => 43) + +if (new C()) { } +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 3, 1)) + +while (new C()) { } +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 3, 1)) + +do { }while(new C()) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 3, 1)) + +if (new D()) { } +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 12, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 3, 1)) + +while (new D()) { } +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 12, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 3, 1)) + +do { }while(new D()) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 12, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 3, 1)) + +// references +var a = true; +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 97, 3)) + +if (a) { } +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 97, 3)) + +while (a) { } +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 97, 3)) + +do { }while(a) +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 97, 3)) + +var b = null; +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 102, 3)) + +if (b) { } +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 102, 3)) + +while (b) { } +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 102, 3)) + +do { }while(b) +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 102, 3)) + +var c = undefined; +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 107, 3)) +>undefined : Symbol(undefined) + +if (c) { } +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 107, 3)) + +while (c) { } +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 107, 3)) + +do { }while(c) +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 107, 3)) + +var d = 0.0; +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 112, 3)) + +if (d) { } +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 112, 3)) + +while (d) { } +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 112, 3)) + +do { }while(d) +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 112, 3)) + +var e = 'a string'; +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 117, 3)) + +if (e) { } +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 117, 3)) + +while (e) { } +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 117, 3)) + +do { }while(e) +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 117, 3)) + +var f = ''; +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 122, 3)) + +if (f) { } +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 122, 3)) + +while (f) { } +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 122, 3)) + +do { }while(f) +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 122, 3)) + +var g = /[a-z]/ +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 127, 3)) + +if (g) { } +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 127, 3)) + +while (g) { } +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 127, 3)) + +do { }while(g) +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 127, 3)) + +var h = []; +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 132, 3)) + +if (h) { } +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 132, 3)) + +while (h) { } +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 132, 3)) + +do { }while(h) +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 132, 3)) + +var i = [1, 2]; +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 137, 3)) + +if (i) { } +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 137, 3)) + +while (i) { } +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 137, 3)) + +do { }while(i) +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 137, 3)) + +var j = {}; +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 142, 3)) + +if (j) { } +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 142, 3)) + +while (j) { } +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 142, 3)) + +do { }while(j) +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 142, 3)) + +var k = { x: 1, y: 'a' }; +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 147, 3)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 147, 9)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 147, 15)) + +if (k) { } +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 147, 3)) + +while (k) { } +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 147, 3)) + +do { }while(k) +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 147, 3)) + +function fn(x?: string): I { return null; } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 150, 14)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 152, 12)) +>I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) + +if (fn()) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 150, 14)) + +while (fn()) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 150, 14)) + +do { }while(fn()) +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 150, 14)) + +if (fn) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 150, 14)) + +while (fn) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 150, 14)) + +do { }while(fn) +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 150, 14)) + + + diff --git a/tests/baselines/reference/ifDoWhileStatements.types b/tests/baselines/reference/ifDoWhileStatements.types new file mode 100644 index 0000000000000..660eaa4fb634b --- /dev/null +++ b/tests/baselines/reference/ifDoWhileStatements.types @@ -0,0 +1,434 @@ +=== tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts === + +interface I { +>I : I + + id: number; +>id : number +} + +class C implements I { +>C : C +>I : I + + id: number; +>id : number + + name: string; +>name : string +} + +class C2 extends C { +>C2 : C2 +>C : C + + valid: boolean; +>valid : boolean +} + +class D{ +>D : D +>T : T + + source: T; +>source : T +>T : T + + recurse: D; +>recurse : D +>D : D +>T : T + + wrapped: D> +>wrapped : D> +>D : D +>D : D +>T : T +} + +function F(x: string): number { return 42; } +>F : (x: string) => number +>x : string +>42 : number + +function F2(x: number): boolean { return x < 42; } +>F2 : (x: number) => boolean +>x : number +>x < 42 : boolean +>x : number +>42 : number + +module M { +>M : typeof M + + export class A { +>A : A + + name: string; +>name : string + } + + export function F2(x: number): string { return x.toString(); } +>F2 : (x: number) => string +>x : number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string +} + +module N { +>N : typeof N + + export class A { +>A : A + + id: number; +>id : number + } + + export function F2(x: number): string { return x.toString(); } +>F2 : (x: number) => string +>x : number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string +} + +// literals +if (true) { } +>true : boolean + +while (true) { } +>true : boolean + +do { }while(true) +>true : boolean + +if (null) { } +>null : null + +while (null) { } +>null : null + +do { }while(null) +>null : null + +if (undefined) { } +>undefined : undefined + +while (undefined) { } +>undefined : undefined + +do { }while(undefined) +>undefined : undefined + +if (0.0) { } +>0.0 : number + +while (0.0) { } +>0.0 : number + +do { }while(0.0) +>0.0 : number + +if ('a string') { } +>'a string' : string + +while ('a string') { } +>'a string' : string + +do { }while('a string') +>'a string' : string + +if ('') { } +>'' : string + +while ('') { } +>'' : string + +do { }while('') +>'' : string + +if (/[a-z]/) { } +>/[a-z]/ : RegExp + +while (/[a-z]/) { } +>/[a-z]/ : RegExp + +do { }while(/[a-z]/) +>/[a-z]/ : RegExp + +if ([]) { } +>[] : undefined[] + +while ([]) { } +>[] : undefined[] + +do { }while([]) +>[] : undefined[] + +if ([1, 2]) { } +>[1, 2] : number[] +>1 : number +>2 : number + +while ([1, 2]) { } +>[1, 2] : number[] +>1 : number +>2 : number + +do { }while([1, 2]) +>[1, 2] : number[] +>1 : number +>2 : number + +if ({}) { } +>{} : {} + +while ({}) { } +>{} : {} + +do { }while({}) +>{} : {} + +if ({ x: 1, y: 'a' }) { } +>{ x: 1, y: 'a' } : { x: number; y: string; } +>x : number +>1 : number +>y : string +>'a' : string + +while ({ x: 1, y: 'a' }) { } +>{ x: 1, y: 'a' } : { x: number; y: string; } +>x : number +>1 : number +>y : string +>'a' : string + +do { }while({ x: 1, y: 'a' }) +>{ x: 1, y: 'a' } : { x: number; y: string; } +>x : number +>1 : number +>y : string +>'a' : string + +if (() => 43) { } +>() => 43 : () => number +>43 : number + +while (() => 43) { } +>() => 43 : () => number +>43 : number + +do { }while(() => 43) +>() => 43 : () => number +>43 : number + +if (new C()) { } +>new C() : C +>C : typeof C + +while (new C()) { } +>new C() : C +>C : typeof C + +do { }while(new C()) +>new C() : C +>C : typeof C + +if (new D()) { } +>new D() : D +>D : typeof D +>C : C + +while (new D()) { } +>new D() : D +>D : typeof D +>C : C + +do { }while(new D()) +>new D() : D +>D : typeof D +>C : C + +// references +var a = true; +>a : boolean +>true : boolean + +if (a) { } +>a : boolean + +while (a) { } +>a : boolean + +do { }while(a) +>a : boolean + +var b = null; +>b : any +>null : null + +if (b) { } +>b : any + +while (b) { } +>b : any + +do { }while(b) +>b : any + +var c = undefined; +>c : any +>undefined : undefined + +if (c) { } +>c : any + +while (c) { } +>c : any + +do { }while(c) +>c : any + +var d = 0.0; +>d : number +>0.0 : number + +if (d) { } +>d : number + +while (d) { } +>d : number + +do { }while(d) +>d : number + +var e = 'a string'; +>e : string +>'a string' : string + +if (e) { } +>e : string + +while (e) { } +>e : string + +do { }while(e) +>e : string + +var f = ''; +>f : string +>'' : string + +if (f) { } +>f : string + +while (f) { } +>f : string + +do { }while(f) +>f : string + +var g = /[a-z]/ +>g : RegExp +>/[a-z]/ : RegExp + +if (g) { } +>g : RegExp + +while (g) { } +>g : RegExp + +do { }while(g) +>g : RegExp + +var h = []; +>h : any[] +>[] : undefined[] + +if (h) { } +>h : any[] + +while (h) { } +>h : any[] + +do { }while(h) +>h : any[] + +var i = [1, 2]; +>i : number[] +>[1, 2] : number[] +>1 : number +>2 : number + +if (i) { } +>i : number[] + +while (i) { } +>i : number[] + +do { }while(i) +>i : number[] + +var j = {}; +>j : {} +>{} : {} + +if (j) { } +>j : {} + +while (j) { } +>j : {} + +do { }while(j) +>j : {} + +var k = { x: 1, y: 'a' }; +>k : { x: number; y: string; } +>{ x: 1, y: 'a' } : { x: number; y: string; } +>x : number +>1 : number +>y : string +>'a' : string + +if (k) { } +>k : { x: number; y: string; } + +while (k) { } +>k : { x: number; y: string; } + +do { }while(k) +>k : { x: number; y: string; } + +function fn(x?: string): I { return null; } +>fn : (x?: string) => I +>x : string +>I : I +>null : null + +if (fn()) { } +>fn() : I +>fn : (x?: string) => I + +while (fn()) { } +>fn() : I +>fn : (x?: string) => I + +do { }while(fn()) +>fn() : I +>fn : (x?: string) => I + +if (fn) { } +>fn : (x?: string) => I + +while (fn) { } +>fn : (x?: string) => I + +do { }while(fn) +>fn : (x?: string) => I + + + diff --git a/tests/baselines/reference/ifElseWithStatements1.errors.txt b/tests/baselines/reference/ifElseWithStatements1.errors.txt index f9fcb33113a96..5dc4d9b0db585 100644 --- a/tests/baselines/reference/ifElseWithStatements1.errors.txt +++ b/tests/baselines/reference/ifElseWithStatements1.errors.txt @@ -1,10 +1,9 @@ -tests/cases/compiler/ifElseWithStatements1.ts(2,5): error TS2304: Cannot find name 'f'. -tests/cases/compiler/ifElseWithStatements1.ts(4,5): error TS2304: Cannot find name 'f'. -tests/cases/compiler/ifElseWithStatements1.ts(4,5): error TS7027: Unreachable code detected. -tests/cases/compiler/ifElseWithStatements1.ts(10,9): error TS7027: Unreachable code detected. +tests/cases/compiler/ifElseWithStatements1.ts(3,5): error TS2304: Cannot find name 'f'. +tests/cases/compiler/ifElseWithStatements1.ts(5,5): error TS2304: Cannot find name 'f'. -==== tests/cases/compiler/ifElseWithStatements1.ts (4 errors) ==== +==== tests/cases/compiler/ifElseWithStatements1.ts (2 errors) ==== + if (true) f(); ~ @@ -13,15 +12,11 @@ tests/cases/compiler/ifElseWithStatements1.ts(10,9): error TS7027: Unreachable c f(); ~ !!! error TS2304: Cannot find name 'f'. - ~ -!!! error TS7027: Unreachable code detected. function foo(): boolean { if (true) return true; else return false; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } \ No newline at end of file diff --git a/tests/baselines/reference/ifElseWithStatements1.js b/tests/baselines/reference/ifElseWithStatements1.js index 506e7e6a33071..47df08d46baa5 100644 --- a/tests/baselines/reference/ifElseWithStatements1.js +++ b/tests/baselines/reference/ifElseWithStatements1.js @@ -1,4 +1,5 @@ //// [ifElseWithStatements1.ts] + if (true) f(); else diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt index b1d4a1ba6ba8c..bab58d0e4cf5f 100644 --- a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt +++ b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(1,10): error TS2354: No best common type exists among return expressions. -tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(6,9): error TS7027: Unreachable code detected. +tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(2,10): error TS2354: No best common type exists among return expressions. -==== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts (2 errors) ==== +==== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts (1 errors) ==== + function foo() { ~~~ !!! error TS2354: No best common type exists among return expressions. @@ -11,8 +11,6 @@ tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(6,9): error TS7027 } else { return "42"; - ~~~~~~ -!!! error TS7027: Unreachable code detected. } }; \ No newline at end of file diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.js b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.js index ba528d4c133eb..2993a331fee3f 100644 --- a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.js +++ b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.js @@ -1,4 +1,5 @@ //// [inferredFunctionReturnTypeIsEmptyType.ts] + function foo() { if (true) { return 42; diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt index 251938cc9c7c7..787b95f22976d 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt @@ -1,16 +1,14 @@ -tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts(3,21): error TS7027: Unreachable code detected. -tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts (3 errors) ==== +==== tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts (2 errors) ==== + class a { static get x(): () => string { ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null;; - ~ -!!! error TS7027: Unreachable code detected. } static set x(aValue: () => string) { ~ diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js index b81b6cd1d789d..fa9c6e2a8b531 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js @@ -1,4 +1,5 @@ //// [inheritanceStaticPropertyOverridingAccessor.ts] + class a { static get x(): () => string { return null;; diff --git a/tests/baselines/reference/interfaceExtendingClass2.errors.txt b/tests/baselines/reference/interfaceExtendingClass2.errors.txt index 68bd5e845acdd..859cb65410eef 100644 --- a/tests/baselines/reference/interfaceExtendingClass2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClass2.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(11,5): error TS2411: Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(13,13): error TS1131: Property or signature expected. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(14,9): error TS1128: Declaration or statement expected. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(14,10): error TS7027: Unreachable code detected. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(15,5): error TS1128: Declaration or statement expected. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(12,5): error TS2411: Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(14,13): error TS1131: Property or signature expected. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(15,9): error TS1128: Declaration or statement expected. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(16,5): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (5 errors) ==== +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (4 errors) ==== + class Foo { x: string; y() { } @@ -27,8 +27,6 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending }; ~ !!! error TS1128: Declaration or statement expected. - ~ -!!! error TS7027: Unreachable code detected. } ~ !!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClass2.js b/tests/baselines/reference/interfaceExtendingClass2.js index 6e6605e245956..c4143659125c7 100644 --- a/tests/baselines/reference/interfaceExtendingClass2.js +++ b/tests/baselines/reference/interfaceExtendingClass2.js @@ -1,4 +1,5 @@ //// [interfaceExtendingClass2.ts] + class Foo { x: string; y() { } diff --git a/tests/baselines/reference/interfaceWithPrivateMember.errors.txt b/tests/baselines/reference/interfaceWithPrivateMember.errors.txt index aa6dfdc103216..dc1cfeabed5e3 100644 --- a/tests/baselines/reference/interfaceWithPrivateMember.errors.txt +++ b/tests/baselines/reference/interfaceWithPrivateMember.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(4,5): error TS1131: Property or signature expected. -tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(8,5): error TS1131: Property or signature expected. -tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(12,5): error TS1131: Property or signature expected. -tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(12,13): error TS7028: Unused label. -tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(12,16): error TS2304: Cannot find name 'string'. -tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(13,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(5,5): error TS1131: Property or signature expected. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(9,5): error TS1131: Property or signature expected. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(13,5): error TS1131: Property or signature expected. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(13,16): error TS2304: Cannot find name 'string'. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(14,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts (6 errors) ==== +==== tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts (5 errors) ==== + // interfaces do not permit private members, these are errors interface I { @@ -25,8 +25,6 @@ tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(13,1): er private y: string; ~~~~~~~ !!! error TS1131: Property or signature expected. - ~ -!!! error TS7028: Unused label. ~~~~~~ !!! error TS2304: Cannot find name 'string'. } diff --git a/tests/baselines/reference/interfaceWithPrivateMember.js b/tests/baselines/reference/interfaceWithPrivateMember.js index 24c2cf9ecf55c..ceb388b1eae26 100644 --- a/tests/baselines/reference/interfaceWithPrivateMember.js +++ b/tests/baselines/reference/interfaceWithPrivateMember.js @@ -1,4 +1,5 @@ //// [interfaceWithPrivateMember.ts] + // interfaces do not permit private members, these are errors interface I { diff --git a/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt b/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt index 2a26190534e81..15983bd1fc40f 100644 --- a/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt +++ b/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt @@ -1,14 +1,13 @@ -tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. -tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(7,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(8,4): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(11,1): error TS7027: Unreachable code detected. -tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(5,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(9,4): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(15,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(22,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(28,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(38,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -==== tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts (8 errors) ==== +==== tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts (6 errors) ==== + // All errors // naked break not allowed @@ -18,16 +17,12 @@ tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements // non-existent label ONE: - ~~~ -!!! error TS7028: Unused label. do break TWO; while (true) ~~~~~~~~~~ !!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. // break from inside function TWO: - ~~~ -!!! error TS7027: Unreachable code detected. do { var x = () => { break TWO; diff --git a/tests/baselines/reference/invalidDoWhileBreakStatements.js b/tests/baselines/reference/invalidDoWhileBreakStatements.js index 807d58a8fea44..4f48a890aa658 100644 --- a/tests/baselines/reference/invalidDoWhileBreakStatements.js +++ b/tests/baselines/reference/invalidDoWhileBreakStatements.js @@ -1,4 +1,5 @@ //// [invalidDoWhileBreakStatements.ts] + // All errors // naked break not allowed diff --git a/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt b/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt index b3938d9ba8b48..3a520209293e5 100644 --- a/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt @@ -1,14 +1,13 @@ -tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(7,1): error TS7028: Unused label. -tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(8,4): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(11,1): error TS7027: Unreachable code detected. -tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(5,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(9,4): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(15,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(22,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(28,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(38,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -==== tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts (8 errors) ==== +==== tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts (6 errors) ==== + // All errors // naked continue not allowed @@ -18,16 +17,12 @@ tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStat // non-existent label ONE: - ~~~ -!!! error TS7028: Unused label. do continue TWO; while (true) ~~~~~~~~~~~~~ !!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: - ~~~ -!!! error TS7027: Unreachable code detected. do { var x = () => { continue TWO; diff --git a/tests/baselines/reference/invalidDoWhileContinueStatements.js b/tests/baselines/reference/invalidDoWhileContinueStatements.js index 21a10a3451bb5..b77259159a9dc 100644 --- a/tests/baselines/reference/invalidDoWhileContinueStatements.js +++ b/tests/baselines/reference/invalidDoWhileContinueStatements.js @@ -1,4 +1,5 @@ //// [invalidDoWhileContinueStatements.ts] + // All errors // naked continue not allowed diff --git a/tests/baselines/reference/invalidForBreakStatements.errors.txt b/tests/baselines/reference/invalidForBreakStatements.errors.txt index f803cad08e157..57ae1d32c8e50 100644 --- a/tests/baselines/reference/invalidForBreakStatements.errors.txt +++ b/tests/baselines/reference/invalidForBreakStatements.errors.txt @@ -1,14 +1,13 @@ -tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. -tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(7,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(8,9): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(11,1): error TS7027: Unreachable code detected. -tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(36,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(5,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(9,9): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(15,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(22,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(28,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -==== tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts (8 errors) ==== +==== tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts (6 errors) ==== + // All errors // naked break not allowed @@ -18,16 +17,12 @@ tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts( // non-existent label ONE: - ~~~ -!!! error TS7028: Unused label. for(;;) break TWO; ~~~~~~~~~~ !!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. // break from inside function TWO: - ~~~ -!!! error TS7027: Unreachable code detected. for(;;) { var x = () => { break TWO; diff --git a/tests/baselines/reference/invalidForBreakStatements.js b/tests/baselines/reference/invalidForBreakStatements.js index 5e3430ecb417d..50096e1672029 100644 --- a/tests/baselines/reference/invalidForBreakStatements.js +++ b/tests/baselines/reference/invalidForBreakStatements.js @@ -1,4 +1,5 @@ //// [invalidForBreakStatements.ts] + // All errors // naked break not allowed diff --git a/tests/baselines/reference/invalidForContinueStatements.errors.txt b/tests/baselines/reference/invalidForContinueStatements.errors.txt index 9a252a2c5726c..9ebfae57e9f70 100644 --- a/tests/baselines/reference/invalidForContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidForContinueStatements.errors.txt @@ -1,14 +1,13 @@ -tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(7,1): error TS7028: Unused label. -tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(8,9): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(11,1): error TS7027: Unreachable code detected. -tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(36,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(5,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(9,9): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(15,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(22,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(28,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -==== tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts (8 errors) ==== +==== tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts (6 errors) ==== + // All errors // naked continue not allowed @@ -18,16 +17,12 @@ tests/cases/conformance/statements/continueStatements/invalidForContinueStatemen // non-existent label ONE: - ~~~ -!!! error TS7028: Unused label. for(;;) continue TWO; ~~~~~~~~~~~~~ !!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: - ~~~ -!!! error TS7027: Unreachable code detected. for(;;) { var x = () => { continue TWO; diff --git a/tests/baselines/reference/invalidForContinueStatements.js b/tests/baselines/reference/invalidForContinueStatements.js index 2db1ce69ede00..7a3513bb2a394 100644 --- a/tests/baselines/reference/invalidForContinueStatements.js +++ b/tests/baselines/reference/invalidForContinueStatements.js @@ -1,4 +1,5 @@ //// [invalidForContinueStatements.ts] + // All errors // naked continue not allowed diff --git a/tests/baselines/reference/invalidForInBreakStatements.errors.txt b/tests/baselines/reference/invalidForInBreakStatements.errors.txt index a575970ff889d..b1f5d64f973e9 100644 --- a/tests/baselines/reference/invalidForInBreakStatements.errors.txt +++ b/tests/baselines/reference/invalidForInBreakStatements.errors.txt @@ -1,17 +1,13 @@ -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(7,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(8,19): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(11,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(18,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(28,5): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(33,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(5,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(9,19): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(15,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(22,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(28,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(38,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. -==== tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts (11 errors) ==== +==== tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts (6 errors) ==== + // All errors // naked break not allowed @@ -21,16 +17,12 @@ tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.t // non-existent label ONE: - ~~~ -!!! error TS7028: Unused label. for (var x in {}) break TWO; ~~~~~~~~~~ !!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. // break from inside function TWO: - ~~~ -!!! error TS7028: Unused label. for (var x in {}) { var fn = () => { break TWO; @@ -40,8 +32,6 @@ tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.t } THREE: - ~~~~~ -!!! error TS7028: Unused label. for (var x in {}) { var fn = function () { break THREE; @@ -56,15 +46,11 @@ tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.t ~~~~~~~~~~~ !!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. FIVE: - ~~~~ -!!! error TS7028: Unused label. for (var x in {}) { } } // label on non-loop statement NINE: - ~~~~ -!!! error TS7028: Unused label. var y = 12; for (var x in {}) { diff --git a/tests/baselines/reference/invalidForInBreakStatements.js b/tests/baselines/reference/invalidForInBreakStatements.js index 1784b9a57a61d..11517f2a02027 100644 --- a/tests/baselines/reference/invalidForInBreakStatements.js +++ b/tests/baselines/reference/invalidForInBreakStatements.js @@ -1,4 +1,5 @@ //// [invalidForInBreakStatements.ts] + // All errors // naked break not allowed diff --git a/tests/baselines/reference/invalidForInContinueStatements.errors.txt b/tests/baselines/reference/invalidForInContinueStatements.errors.txt index 15b515742a91d..f20d9c6e81c6b 100644 --- a/tests/baselines/reference/invalidForInContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidForInContinueStatements.errors.txt @@ -1,17 +1,13 @@ -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(7,1): error TS7028: Unused label. -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(8,19): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(11,1): error TS7028: Unused label. -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(18,1): error TS7028: Unused label. -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(28,5): error TS7028: Unused label. -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(33,1): error TS7028: Unused label. -tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(5,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(9,19): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(15,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(22,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(28,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(38,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -==== tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts (11 errors) ==== +==== tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts (6 errors) ==== + // All errors // naked continue not allowed @@ -21,16 +17,12 @@ tests/cases/conformance/statements/continueStatements/invalidForInContinueStatem // non-existent label ONE: - ~~~ -!!! error TS7028: Unused label. for (var x in {}) continue TWO; ~~~~~~~~~~~~~ !!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: - ~~~ -!!! error TS7028: Unused label. for (var x in {}) { var fn = () => { continue TWO; @@ -40,8 +32,6 @@ tests/cases/conformance/statements/continueStatements/invalidForInContinueStatem } THREE: - ~~~~~ -!!! error TS7028: Unused label. for (var x in {}) { var fn = function () { continue THREE; @@ -56,15 +46,11 @@ tests/cases/conformance/statements/continueStatements/invalidForInContinueStatem ~~~~~~~~~~~~~~ !!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. FIVE: - ~~~~ -!!! error TS7028: Unused label. for (var x in {}) { } } // label on non-loop statement NINE: - ~~~~ -!!! error TS7028: Unused label. var y = 12; for (var x in {}) { diff --git a/tests/baselines/reference/invalidForInContinueStatements.js b/tests/baselines/reference/invalidForInContinueStatements.js index 94020d00f2b50..5eb0e10bf5361 100644 --- a/tests/baselines/reference/invalidForInContinueStatements.js +++ b/tests/baselines/reference/invalidForInContinueStatements.js @@ -1,4 +1,5 @@ //// [invalidForInContinueStatements.ts] + // All errors // naked continue not allowed diff --git a/tests/baselines/reference/invalidThrowStatement.errors.txt b/tests/baselines/reference/invalidThrowStatement.errors.txt index d72fd7e2acd6b..3002bce2f1f34 100644 --- a/tests/baselines/reference/invalidThrowStatement.errors.txt +++ b/tests/baselines/reference/invalidThrowStatement.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts(1,6): error TS1109: Expression expected. -tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts(3,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts(3,8): error TS7027: Unreachable code detected. +tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts(2,6): error TS1109: Expression expected. +tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts(4,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts (3 errors) ==== +==== tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts (2 errors) ==== + throw; ~ !!! error TS1109: Expression expected. @@ -11,6 +11,4 @@ tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts(3,8) export throw null; ~~~~~~ !!! error TS1128: Declaration or statement expected. - ~~~~~ -!!! error TS7027: Unreachable code detected. \ No newline at end of file diff --git a/tests/baselines/reference/invalidThrowStatement.js b/tests/baselines/reference/invalidThrowStatement.js index 4b794ab3d517a..674dacf5c17fc 100644 --- a/tests/baselines/reference/invalidThrowStatement.js +++ b/tests/baselines/reference/invalidThrowStatement.js @@ -1,4 +1,5 @@ //// [invalidThrowStatement.ts] + throw; export throw null; diff --git a/tests/baselines/reference/invalidWhileContinueStatements.errors.txt b/tests/baselines/reference/invalidWhileContinueStatements.errors.txt index fdc84d84f2e97..e7a9ed13c4033 100644 --- a/tests/baselines/reference/invalidWhileContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidWhileContinueStatements.errors.txt @@ -1,14 +1,13 @@ -tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(7,1): error TS7028: Unused label. -tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(8,14): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(11,1): error TS7027: Unreachable code detected. -tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. -tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(5,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(9,14): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(15,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(22,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(28,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts(38,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. -==== tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts (8 errors) ==== +==== tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts (6 errors) ==== + // All errors // naked continue not allowed @@ -18,16 +17,12 @@ tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatem // non-existent label ONE: - ~~~ -!!! error TS7028: Unused label. while (true) continue TWO; ~~~~~~~~~~~~~ !!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: - ~~~ -!!! error TS7027: Unreachable code detected. while (true){ var x = () => { continue TWO; diff --git a/tests/baselines/reference/invalidWhileContinueStatements.js b/tests/baselines/reference/invalidWhileContinueStatements.js index b8234bf96045c..16350e9b561f0 100644 --- a/tests/baselines/reference/invalidWhileContinueStatements.js +++ b/tests/baselines/reference/invalidWhileContinueStatements.js @@ -1,4 +1,5 @@ //// [invalidWhileContinueStatements.ts] + // All errors // naked continue not allowed diff --git a/tests/baselines/reference/letAndVarRedeclaration.errors.txt b/tests/baselines/reference/letAndVarRedeclaration.errors.txt index 3c523154c3f6e..50a916e8d9003 100644 --- a/tests/baselines/reference/letAndVarRedeclaration.errors.txt +++ b/tests/baselines/reference/letAndVarRedeclaration.errors.txt @@ -1,28 +1,28 @@ -tests/cases/compiler/letAndVarRedeclaration.ts(2,5): error TS2451: Cannot redeclare block-scoped variable 'e0'. tests/cases/compiler/letAndVarRedeclaration.ts(3,5): error TS2451: Cannot redeclare block-scoped variable 'e0'. -tests/cases/compiler/letAndVarRedeclaration.ts(4,10): error TS2451: Cannot redeclare block-scoped variable 'e0'. -tests/cases/compiler/letAndVarRedeclaration.ts(7,9): error TS2451: Cannot redeclare block-scoped variable 'x1'. +tests/cases/compiler/letAndVarRedeclaration.ts(4,5): error TS2451: Cannot redeclare block-scoped variable 'e0'. +tests/cases/compiler/letAndVarRedeclaration.ts(5,10): error TS2451: Cannot redeclare block-scoped variable 'e0'. tests/cases/compiler/letAndVarRedeclaration.ts(8,9): error TS2451: Cannot redeclare block-scoped variable 'x1'. -tests/cases/compiler/letAndVarRedeclaration.ts(9,14): error TS2451: Cannot redeclare block-scoped variable 'x1'. -tests/cases/compiler/letAndVarRedeclaration.ts(13,9): error TS2451: Cannot redeclare block-scoped variable 'x'. -tests/cases/compiler/letAndVarRedeclaration.ts(15,13): error TS2451: Cannot redeclare block-scoped variable 'x'. -tests/cases/compiler/letAndVarRedeclaration.ts(18,18): error TS2451: Cannot redeclare block-scoped variable 'x'. -tests/cases/compiler/letAndVarRedeclaration.ts(23,9): error TS2451: Cannot redeclare block-scoped variable 'x2'. +tests/cases/compiler/letAndVarRedeclaration.ts(9,9): error TS2451: Cannot redeclare block-scoped variable 'x1'. +tests/cases/compiler/letAndVarRedeclaration.ts(10,14): error TS2451: Cannot redeclare block-scoped variable 'x1'. +tests/cases/compiler/letAndVarRedeclaration.ts(14,9): error TS2451: Cannot redeclare block-scoped variable 'x'. +tests/cases/compiler/letAndVarRedeclaration.ts(16,13): error TS2451: Cannot redeclare block-scoped variable 'x'. +tests/cases/compiler/letAndVarRedeclaration.ts(19,18): error TS2451: Cannot redeclare block-scoped variable 'x'. tests/cases/compiler/letAndVarRedeclaration.ts(24,9): error TS2451: Cannot redeclare block-scoped variable 'x2'. -tests/cases/compiler/letAndVarRedeclaration.ts(25,14): error TS2451: Cannot redeclare block-scoped variable 'x2'. -tests/cases/compiler/letAndVarRedeclaration.ts(29,9): error TS2451: Cannot redeclare block-scoped variable 'x2'. -tests/cases/compiler/letAndVarRedeclaration.ts(31,13): error TS2451: Cannot redeclare block-scoped variable 'x2'. -tests/cases/compiler/letAndVarRedeclaration.ts(34,18): error TS2451: Cannot redeclare block-scoped variable 'x2'. -tests/cases/compiler/letAndVarRedeclaration.ts(38,5): error TS2451: Cannot redeclare block-scoped variable 'x11'. -tests/cases/compiler/letAndVarRedeclaration.ts(39,10): error TS2451: Cannot redeclare block-scoped variable 'x11'. -tests/cases/compiler/letAndVarRedeclaration.ts(43,9): error TS2451: Cannot redeclare block-scoped variable 'x11'. -tests/cases/compiler/letAndVarRedeclaration.ts(44,14): error TS2451: Cannot redeclare block-scoped variable 'x11'. -tests/cases/compiler/letAndVarRedeclaration.ts(48,1): error TS7027: Unreachable code detected. -tests/cases/compiler/letAndVarRedeclaration.ts(49,9): error TS2451: Cannot redeclare block-scoped variable 'x11'. -tests/cases/compiler/letAndVarRedeclaration.ts(50,14): error TS2451: Cannot redeclare block-scoped variable 'x11'. +tests/cases/compiler/letAndVarRedeclaration.ts(25,9): error TS2451: Cannot redeclare block-scoped variable 'x2'. +tests/cases/compiler/letAndVarRedeclaration.ts(26,14): error TS2451: Cannot redeclare block-scoped variable 'x2'. +tests/cases/compiler/letAndVarRedeclaration.ts(30,9): error TS2451: Cannot redeclare block-scoped variable 'x2'. +tests/cases/compiler/letAndVarRedeclaration.ts(32,13): error TS2451: Cannot redeclare block-scoped variable 'x2'. +tests/cases/compiler/letAndVarRedeclaration.ts(35,18): error TS2451: Cannot redeclare block-scoped variable 'x2'. +tests/cases/compiler/letAndVarRedeclaration.ts(39,5): error TS2451: Cannot redeclare block-scoped variable 'x11'. +tests/cases/compiler/letAndVarRedeclaration.ts(40,10): error TS2451: Cannot redeclare block-scoped variable 'x11'. +tests/cases/compiler/letAndVarRedeclaration.ts(44,9): error TS2451: Cannot redeclare block-scoped variable 'x11'. +tests/cases/compiler/letAndVarRedeclaration.ts(45,14): error TS2451: Cannot redeclare block-scoped variable 'x11'. +tests/cases/compiler/letAndVarRedeclaration.ts(50,9): error TS2451: Cannot redeclare block-scoped variable 'x11'. +tests/cases/compiler/letAndVarRedeclaration.ts(51,14): error TS2451: Cannot redeclare block-scoped variable 'x11'. -==== tests/cases/compiler/letAndVarRedeclaration.ts (22 errors) ==== +==== tests/cases/compiler/letAndVarRedeclaration.ts (21 errors) ==== + let e0 ~~ @@ -109,8 +109,6 @@ tests/cases/compiler/letAndVarRedeclaration.ts(50,14): error TS2451: Cannot rede } module M2 { - ~~~~~~ -!!! error TS7027: Unreachable code detected. let x11; ~~~ !!! error TS2451: Cannot redeclare block-scoped variable 'x11'. diff --git a/tests/baselines/reference/letAndVarRedeclaration.js b/tests/baselines/reference/letAndVarRedeclaration.js index fd4bfe67cacd6..eb4dfc9c0e831 100644 --- a/tests/baselines/reference/letAndVarRedeclaration.js +++ b/tests/baselines/reference/letAndVarRedeclaration.js @@ -1,5 +1,6 @@ //// [letAndVarRedeclaration.ts] + let e0 var e0; function e0() { } diff --git a/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt index f3144b525006d..e46554ec0e636 100644 --- a/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/letDeclarations-invalidContexts.errors.txt @@ -1,17 +1,16 @@ -tests/cases/compiler/letDeclarations-invalidContexts.ts(4,5): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(6,5): error TS7027: Unreachable code detected. -tests/cases/compiler/letDeclarations-invalidContexts.ts(6,5): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(9,5): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(11,1): error TS7027: Unreachable code detected. -tests/cases/compiler/letDeclarations-invalidContexts.ts(12,5): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -tests/cases/compiler/letDeclarations-invalidContexts.ts(20,5): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(23,5): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(26,12): error TS1157: 'let' declarations can only be declared inside a block. -tests/cases/compiler/letDeclarations-invalidContexts.ts(29,29): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(5,5): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(7,5): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(10,5): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(13,5): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(17,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/compiler/letDeclarations-invalidContexts.ts(21,5): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(24,5): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(27,12): error TS1157: 'let' declarations can only be declared inside a block. +tests/cases/compiler/letDeclarations-invalidContexts.ts(30,29): error TS1157: 'let' declarations can only be declared inside a block. -==== tests/cases/compiler/letDeclarations-invalidContexts.ts (11 errors) ==== +==== tests/cases/compiler/letDeclarations-invalidContexts.ts (9 errors) ==== + // Errors, let must be defined inside a block if (true) @@ -20,8 +19,6 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(29,29): error TS1157: 'l !!! error TS1157: 'let' declarations can only be declared inside a block. else let l2 = 0; - ~~~ -!!! error TS7027: Unreachable code detected. ~~~~~~~~~~~ !!! error TS1157: 'let' declarations can only be declared inside a block. @@ -31,8 +28,6 @@ tests/cases/compiler/letDeclarations-invalidContexts.ts(29,29): error TS1157: 'l !!! error TS1157: 'let' declarations can only be declared inside a block. do - ~~ -!!! error TS7027: Unreachable code detected. let l4 = 0; ~~~~~~~~~~~ !!! error TS1157: 'let' declarations can only be declared inside a block. diff --git a/tests/baselines/reference/letDeclarations-invalidContexts.js b/tests/baselines/reference/letDeclarations-invalidContexts.js index f8c3bb04bdb20..4c3be1faed80c 100644 --- a/tests/baselines/reference/letDeclarations-invalidContexts.js +++ b/tests/baselines/reference/letDeclarations-invalidContexts.js @@ -1,5 +1,6 @@ //// [letDeclarations-invalidContexts.ts] + // Errors, let must be defined inside a block if (true) let l1 = 0; diff --git a/tests/baselines/reference/letDeclarations-scopes.errors.txt b/tests/baselines/reference/letDeclarations-scopes.errors.txt index 49072f30e9835..1b10903af7c6f 100644 --- a/tests/baselines/reference/letDeclarations-scopes.errors.txt +++ b/tests/baselines/reference/letDeclarations-scopes.errors.txt @@ -1,10 +1,8 @@ -tests/cases/compiler/letDeclarations-scopes.ts(13,5): error TS7027: Unreachable code detected. -tests/cases/compiler/letDeclarations-scopes.ts(22,1): error TS7027: Unreachable code detected. -tests/cases/compiler/letDeclarations-scopes.ts(28,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -tests/cases/compiler/letDeclarations-scopes.ts(120,5): error TS7028: Unused label. +tests/cases/compiler/letDeclarations-scopes.ts(29,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -==== tests/cases/compiler/letDeclarations-scopes.ts (4 errors) ==== +==== tests/cases/compiler/letDeclarations-scopes.ts (1 errors) ==== + // global let l = "string"; @@ -18,8 +16,6 @@ tests/cases/compiler/letDeclarations-scopes.ts(120,5): error TS7028: Unused labe } else { let l = 0; - ~~~ -!!! error TS7027: Unreachable code detected. n = l; } @@ -29,8 +25,6 @@ tests/cases/compiler/letDeclarations-scopes.ts(120,5): error TS7028: Unused labe } do { - ~~ -!!! error TS7027: Unreachable code detected. let l = 0; n = l; } while (true); @@ -131,8 +125,6 @@ tests/cases/compiler/letDeclarations-scopes.ts(120,5): error TS7028: Unused labe } lable: let l2 = 0; - ~~~~~ -!!! error TS7028: Unused label. } // methods diff --git a/tests/baselines/reference/letDeclarations-scopes.js b/tests/baselines/reference/letDeclarations-scopes.js index d0489820d0b90..3fc5976b4b700 100644 --- a/tests/baselines/reference/letDeclarations-scopes.js +++ b/tests/baselines/reference/letDeclarations-scopes.js @@ -1,5 +1,6 @@ //// [letDeclarations-scopes.ts] + // global let l = "string"; diff --git a/tests/baselines/reference/letDeclarations-validContexts.errors.txt b/tests/baselines/reference/letDeclarations-validContexts.errors.txt index f5e8022191b0e..acec026daf06f 100644 --- a/tests/baselines/reference/letDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/letDeclarations-validContexts.errors.txt @@ -1,13 +1,8 @@ -tests/cases/compiler/letDeclarations-validContexts.ts(8,5): error TS7027: Unreachable code detected. -tests/cases/compiler/letDeclarations-validContexts.ts(15,1): error TS7027: Unreachable code detected. -tests/cases/compiler/letDeclarations-validContexts.ts(20,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -tests/cases/compiler/letDeclarations-validContexts.ts(132,5): error TS7028: Unused label. -tests/cases/compiler/letDeclarations-validContexts.ts(134,9): error TS7028: Unused label. -tests/cases/compiler/letDeclarations-validContexts.ts(139,5): error TS7028: Unused label. -tests/cases/compiler/letDeclarations-validContexts.ts(141,9): error TS7028: Unused label. +tests/cases/compiler/letDeclarations-validContexts.ts(21,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. -==== tests/cases/compiler/letDeclarations-validContexts.ts (7 errors) ==== +==== tests/cases/compiler/letDeclarations-validContexts.ts (1 errors) ==== + // Control flow statements with blocks @@ -16,8 +11,6 @@ tests/cases/compiler/letDeclarations-validContexts.ts(141,9): error TS7028: Unus } else { let l2 = 0; - ~~~ -!!! error TS7027: Unreachable code detected. } while (true) { @@ -25,8 +18,6 @@ tests/cases/compiler/letDeclarations-validContexts.ts(141,9): error TS7028: Unus } do { - ~~ -!!! error TS7027: Unreachable code detected. let l4 = 0; } while (true); @@ -146,22 +137,14 @@ tests/cases/compiler/letDeclarations-validContexts.ts(141,9): error TS7028: Unus function f3() { label: let l32 = 0; - ~~~~~ -!!! error TS7028: Unused label. { label2: let l33 = 0; - ~~~~~~ -!!! error TS7028: Unused label. } } module m3 { label: let l34 = 0; - ~~~~~ -!!! error TS7028: Unused label. { label2: let l35 = 0; - ~~~~~~ -!!! error TS7028: Unused label. } } \ No newline at end of file diff --git a/tests/baselines/reference/letDeclarations-validContexts.js b/tests/baselines/reference/letDeclarations-validContexts.js index b11a19223836d..1859a0215bb21 100644 --- a/tests/baselines/reference/letDeclarations-validContexts.js +++ b/tests/baselines/reference/letDeclarations-validContexts.js @@ -1,6 +1,7 @@ //// [letDeclarations-validContexts.ts] + // Control flow statements with blocks if (true) { let l1 = 0; diff --git a/tests/baselines/reference/localTypes4.errors.txt b/tests/baselines/reference/localTypes4.errors.txt index d6a3f0ce69998..4d08644ea89c8 100644 --- a/tests/baselines/reference/localTypes4.errors.txt +++ b/tests/baselines/reference/localTypes4.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/types/localTypes/localTypes4.ts(10,19): error TS2304: Cannot find name 'T'. -tests/cases/conformance/types/localTypes/localTypes4.ts(10,23): error TS2304: Cannot find name 'T'. -tests/cases/conformance/types/localTypes/localTypes4.ts(18,16): error TS2300: Duplicate identifier 'T'. -tests/cases/conformance/types/localTypes/localTypes4.ts(19,19): error TS2300: Duplicate identifier 'T'. -tests/cases/conformance/types/localTypes/localTypes4.ts(35,9): error TS7027: Unreachable code detected. +tests/cases/conformance/types/localTypes/localTypes4.ts(11,19): error TS2304: Cannot find name 'T'. +tests/cases/conformance/types/localTypes/localTypes4.ts(11,23): error TS2304: Cannot find name 'T'. +tests/cases/conformance/types/localTypes/localTypes4.ts(19,16): error TS2300: Duplicate identifier 'T'. +tests/cases/conformance/types/localTypes/localTypes4.ts(20,19): error TS2300: Duplicate identifier 'T'. -==== tests/cases/conformance/types/localTypes/localTypes4.ts (5 errors) ==== +==== tests/cases/conformance/types/localTypes/localTypes4.ts (4 errors) ==== + function f1() { // Type parameters are in scope in parameters and return types function f(x: T): T { @@ -49,8 +49,6 @@ tests/cases/conformance/types/localTypes/localTypes4.ts(35,9): error TS7027: Unr } else { v.x = 20; - ~ -!!! error TS7027: Unreachable code detected. } } \ No newline at end of file diff --git a/tests/baselines/reference/localTypes4.js b/tests/baselines/reference/localTypes4.js index 8f51761a65af6..3b81175d2b620 100644 --- a/tests/baselines/reference/localTypes4.js +++ b/tests/baselines/reference/localTypes4.js @@ -1,4 +1,5 @@ //// [localTypes4.ts] + function f1() { // Type parameters are in scope in parameters and return types function f(x: T): T { diff --git a/tests/baselines/reference/null.errors.txt b/tests/baselines/reference/null.errors.txt deleted file mode 100644 index b516720b2412f..0000000000000 --- a/tests/baselines/reference/null.errors.txt +++ /dev/null @@ -1,30 +0,0 @@ -tests/cases/compiler/null.ts(8,5): error TS7027: Unreachable code detected. -tests/cases/compiler/null.ts(12,5): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/null.ts (2 errors) ==== - var x=null; - var y=3+x; - var z=3+null; - class C { - } - function f() { - return null; - return new C(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } - function g() { - return null; - return 3; - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } - interface I { - x:any; - y:number; - } - var w:I={x:null,y:3}; - - - \ No newline at end of file diff --git a/tests/baselines/reference/null.js b/tests/baselines/reference/null.js index 499d6901847b4..ee897643fb172 100644 --- a/tests/baselines/reference/null.js +++ b/tests/baselines/reference/null.js @@ -1,4 +1,5 @@ //// [null.ts] + var x=null; var y=3+x; var z=3+null; diff --git a/tests/baselines/reference/null.symbols b/tests/baselines/reference/null.symbols new file mode 100644 index 0000000000000..bd3d835995b57 --- /dev/null +++ b/tests/baselines/reference/null.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/null.ts === + +var x=null; +>x : Symbol(x, Decl(null.ts, 1, 3)) + +var y=3+x; +>y : Symbol(y, Decl(null.ts, 2, 3)) +>x : Symbol(x, Decl(null.ts, 1, 3)) + +var z=3+null; +>z : Symbol(z, Decl(null.ts, 3, 3)) + +class C { +>C : Symbol(C, Decl(null.ts, 3, 13)) +} +function f() { +>f : Symbol(f, Decl(null.ts, 5, 1)) + + return null; + return new C(); +>C : Symbol(C, Decl(null.ts, 3, 13)) +} +function g() { +>g : Symbol(g, Decl(null.ts, 9, 1)) + + return null; + return 3; +} +interface I { +>I : Symbol(I, Decl(null.ts, 13, 1)) + + x:any; +>x : Symbol(x, Decl(null.ts, 14, 13)) + + y:number; +>y : Symbol(y, Decl(null.ts, 15, 10)) +} +var w:I={x:null,y:3}; +>w : Symbol(w, Decl(null.ts, 18, 3)) +>I : Symbol(I, Decl(null.ts, 13, 1)) +>x : Symbol(x, Decl(null.ts, 18, 9)) +>y : Symbol(y, Decl(null.ts, 18, 16)) + + + diff --git a/tests/baselines/reference/null.types b/tests/baselines/reference/null.types new file mode 100644 index 0000000000000..6fd8b423f1381 --- /dev/null +++ b/tests/baselines/reference/null.types @@ -0,0 +1,60 @@ +=== tests/cases/compiler/null.ts === + +var x=null; +>x : any +>null : null + +var y=3+x; +>y : any +>3+x : any +>3 : number +>x : any + +var z=3+null; +>z : number +>3+null : number +>3 : number +>null : null + +class C { +>C : C +} +function f() { +>f : () => C + + return null; +>null : null + + return new C(); +>new C() : C +>C : typeof C +} +function g() { +>g : () => number + + return null; +>null : null + + return 3; +>3 : number +} +interface I { +>I : I + + x:any; +>x : any + + y:number; +>y : number +} +var w:I={x:null,y:3}; +>w : I +>I : I +>{x:null,y:3} : { x: null; y: number; } +>x : null +>null : null +>y : number +>3 : number + + + diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt index 48f1ce1bd1367..a78e0c8abcfaf 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt @@ -1,13 +1,11 @@ -tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,8): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. -tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,37): error TS1005: ';' expected. -tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,53): error TS7027: Unreachable code detected. +tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(2,8): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(2,37): error TS1005: ';' expected. -==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (3 errors) ==== +==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (2 errors) ==== + var f: (x: 'hi') => number = ('hi') => { return 1; }; ~~~~~~~~~~~~~~~~~~~ !!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. ~~ -!!! error TS1005: ';' expected. - ~ -!!! error TS7027: Unreachable code detected. \ No newline at end of file +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.js b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.js index 48e52ba096764..aa5c8701f2881 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.js +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.js @@ -1,4 +1,5 @@ //// [overloadOnConstAsTypeAnnotation.ts] + var f: (x: 'hi') => number = ('hi') => { return 1; }; //// [overloadOnConstAsTypeAnnotation.js] diff --git a/tests/baselines/reference/parser10.1.1-8gs.errors.txt b/tests/baselines/reference/parser10.1.1-8gs.errors.txt index c321ca1fff894..3426ccab8da0c 100644 --- a/tests/baselines/reference/parser10.1.1-8gs.errors.txt +++ b/tests/baselines/reference/parser10.1.1-8gs.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(16,7): error TS2304: Cannot find name 'NotEarlyError'. -tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,1): error TS7027: Unreachable code detected. -tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,5): error TS1212: Identifier expected. 'public' is a reserved word in strict mode +tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,7): error TS2304: Cannot find name 'NotEarlyError'. +tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(18,5): error TS1212: Identifier expected. 'public' is a reserved word in strict mode -==== tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts (2 errors) ==== + /// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the @@ -23,8 +23,6 @@ tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,5): error TS12 ~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'NotEarlyError'. var public = 1; - ~~~ -!!! error TS7027: Unreachable code detected. ~~~~~~ !!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode \ No newline at end of file diff --git a/tests/baselines/reference/parser10.1.1-8gs.js b/tests/baselines/reference/parser10.1.1-8gs.js index e7d342cf1f105..fb3b96f6baffb 100644 --- a/tests/baselines/reference/parser10.1.1-8gs.js +++ b/tests/baselines/reference/parser10.1.1-8gs.js @@ -1,4 +1,5 @@ //// [parser10.1.1-8gs.ts] + /// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the diff --git a/tests/baselines/reference/parser768531.errors.txt b/tests/baselines/reference/parser768531.errors.txt deleted file mode 100644 index 8298431e0e031..0000000000000 --- a/tests/baselines/reference/parser768531.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts(1,2): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts (1 errors) ==== - {a: 3} - ~ -!!! error TS7028: Unused label. - /x/ \ No newline at end of file diff --git a/tests/baselines/reference/parser768531.js b/tests/baselines/reference/parser768531.js index 26e22117717b1..462db3742b30a 100644 --- a/tests/baselines/reference/parser768531.js +++ b/tests/baselines/reference/parser768531.js @@ -1,4 +1,5 @@ //// [parser768531.ts] + {a: 3} /x/ diff --git a/tests/baselines/reference/parser768531.symbols b/tests/baselines/reference/parser768531.symbols new file mode 100644 index 0000000000000..f180922c7e081 --- /dev/null +++ b/tests/baselines/reference/parser768531.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts === + +No type information for this code.{a: 3} +No type information for this code./x/ +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser768531.types b/tests/baselines/reference/parser768531.types new file mode 100644 index 0000000000000..434535b5cc9e2 --- /dev/null +++ b/tests/baselines/reference/parser768531.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts === + +{a: 3} +>a : any +>3 : number + +/x/ +>/x/ : RegExp + diff --git a/tests/baselines/reference/whileBreakStatements.errors.txt b/tests/baselines/reference/whileBreakStatements.errors.txt deleted file mode 100644 index 7c63dc59d3cb2..0000000000000 --- a/tests/baselines/reference/whileBreakStatements.errors.txt +++ /dev/null @@ -1,54 +0,0 @@ -tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts(11,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts(19,5): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts(31,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts (3 errors) ==== - while(true) { - break; - } - - ONE: - - while (true) { - break ONE; - } - - TWO: - ~~~ -!!! error TS7028: Unused label. - THREE: - while (true) { - break THREE; - } - - FOUR: - while (true) { - FIVE: - ~~~~ -!!! error TS7028: Unused label. - while (true) { - break FOUR; - } - } - - while (true) { - SIX: - while (true) - break SIX; - } - - SEVEN: - ~~~~~ -!!! error TS7027: Unreachable code detected. - while (true) - while (true) - while (true) - break SEVEN; - - EIGHT: - while (true) { - var fn = function () { } - break EIGHT; - } - \ No newline at end of file diff --git a/tests/baselines/reference/whileBreakStatements.js b/tests/baselines/reference/whileBreakStatements.js index 818be39a242cb..15dffe3e582b9 100644 --- a/tests/baselines/reference/whileBreakStatements.js +++ b/tests/baselines/reference/whileBreakStatements.js @@ -1,4 +1,5 @@ //// [whileBreakStatements.ts] + while(true) { break; } diff --git a/tests/baselines/reference/whileBreakStatements.symbols b/tests/baselines/reference/whileBreakStatements.symbols new file mode 100644 index 0000000000000..022fe9a12a83f --- /dev/null +++ b/tests/baselines/reference/whileBreakStatements.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts === + +while(true) { + break; +} + +ONE: + +while (true) { + break ONE; +} + +TWO: +THREE: +while (true) { + break THREE; +} + +FOUR: +while (true) { + FIVE: + while (true) { + break FOUR; + } +} + +while (true) { + SIX: + while (true) + break SIX; +} + +SEVEN: +while (true) + while (true) + while (true) + break SEVEN; + +EIGHT: +while (true) { + var fn = function () { } +>fn : Symbol(fn, Decl(whileBreakStatements.ts, 39, 7)) + + break EIGHT; +} + diff --git a/tests/baselines/reference/whileBreakStatements.types b/tests/baselines/reference/whileBreakStatements.types new file mode 100644 index 0000000000000..a31d1e9b40e38 --- /dev/null +++ b/tests/baselines/reference/whileBreakStatements.types @@ -0,0 +1,90 @@ +=== tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts === + +while(true) { +>true : boolean + + break; +} + +ONE: +>ONE : any + +while (true) { +>true : boolean + + break ONE; +>ONE : any +} + +TWO: +>TWO : any + +THREE: +>THREE : any + +while (true) { +>true : boolean + + break THREE; +>THREE : any +} + +FOUR: +>FOUR : any + +while (true) { +>true : boolean + + FIVE: +>FIVE : any + + while (true) { +>true : boolean + + break FOUR; +>FOUR : any + } +} + +while (true) { +>true : boolean + + SIX: +>SIX : any + + while (true) +>true : boolean + + break SIX; +>SIX : any +} + +SEVEN: +>SEVEN : any + +while (true) +>true : boolean + + while (true) +>true : boolean + + while (true) +>true : boolean + + break SEVEN; +>SEVEN : any + +EIGHT: +>EIGHT : any + +while (true) { +>true : boolean + + var fn = function () { } +>fn : () => void +>function () { } : () => void + + break EIGHT; +>EIGHT : any +} + diff --git a/tests/cases/compiler/bestCommonTypeReturnStatement.ts b/tests/cases/compiler/bestCommonTypeReturnStatement.ts index aff173664f60d..cb481147f9b8b 100644 --- a/tests/cases/compiler/bestCommonTypeReturnStatement.ts +++ b/tests/cases/compiler/bestCommonTypeReturnStatement.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + interface IPromise { then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; } diff --git a/tests/cases/compiler/breakTarget3.ts b/tests/cases/compiler/breakTarget3.ts index 9cef599692c30..64a9357706fb0 100644 --- a/tests/cases/compiler/breakTarget3.ts +++ b/tests/cases/compiler/breakTarget3.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/compiler/breakTarget4.ts b/tests/cases/compiler/breakTarget4.ts index 2c3eadca7dbcd..3e00bca659b90 100644 --- a/tests/cases/compiler/breakTarget4.ts +++ b/tests/cases/compiler/breakTarget4.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/compiler/breakTarget5.ts b/tests/cases/compiler/breakTarget5.ts index a05ee1cf8793a..f0bceb5015f2f 100644 --- a/tests/cases/compiler/breakTarget5.ts +++ b/tests/cases/compiler/breakTarget5.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target: while (true) { function f() { diff --git a/tests/cases/compiler/commentEmitAtEndOfFile1.ts b/tests/cases/compiler/commentEmitAtEndOfFile1.ts index b1b863890d5f4..5713ef006e5fc 100644 --- a/tests/cases/compiler/commentEmitAtEndOfFile1.ts +++ b/tests/cases/compiler/commentEmitAtEndOfFile1.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + // test var f = '' // test #2 diff --git a/tests/cases/compiler/conditionalExpressions2.ts b/tests/cases/compiler/conditionalExpressions2.ts index 6f2f097f6dedc..ece002d7778fc 100644 --- a/tests/cases/compiler/conditionalExpressions2.ts +++ b/tests/cases/compiler/conditionalExpressions2.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + var a = false ? 1 : null; var b = false ? undefined : 0; var c = false ? 1 : 0; diff --git a/tests/cases/compiler/constDeclarations-invalidContexts.ts b/tests/cases/compiler/constDeclarations-invalidContexts.ts index b509318099012..6d21ee31ec243 100644 --- a/tests/cases/compiler/constDeclarations-invalidContexts.ts +++ b/tests/cases/compiler/constDeclarations-invalidContexts.ts @@ -1,3 +1,4 @@ +// @allowUnreachableCode: true // @target: ES6 // Errors, const must be defined inside a block diff --git a/tests/cases/compiler/constDeclarations-validContexts.ts b/tests/cases/compiler/constDeclarations-validContexts.ts index ffde8e45d6fa1..63af6d169597d 100644 --- a/tests/cases/compiler/constDeclarations-validContexts.ts +++ b/tests/cases/compiler/constDeclarations-validContexts.ts @@ -1,3 +1,4 @@ +// @allowUnreachableCode: true // @target: ES6 diff --git a/tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts b/tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts index a93628e5494c8..63e0fc30141f9 100644 --- a/tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts +++ b/tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + declare module "fs" { export class File { constructor(filename: string); diff --git a/tests/cases/compiler/continueNotInIterationStatement4.ts b/tests/cases/compiler/continueNotInIterationStatement4.ts index 5996eb4323af8..218cb151df3d1 100644 --- a/tests/cases/compiler/continueNotInIterationStatement4.ts +++ b/tests/cases/compiler/continueNotInIterationStatement4.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + TWO: while (true){ var x = () => { diff --git a/tests/cases/compiler/continueTarget3.ts b/tests/cases/compiler/continueTarget3.ts index 26bea241a7a36..a7b47ff071bd6 100644 --- a/tests/cases/compiler/continueTarget3.ts +++ b/tests/cases/compiler/continueTarget3.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/compiler/continueTarget4.ts b/tests/cases/compiler/continueTarget4.ts index e00c222aa9ca7..5ba2bd69b1173 100644 --- a/tests/cases/compiler/continueTarget4.ts +++ b/tests/cases/compiler/continueTarget4.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/compiler/continueTarget5.ts b/tests/cases/compiler/continueTarget5.ts index dd3a806ab2dba..5f3d068282b6b 100644 --- a/tests/cases/compiler/continueTarget5.ts +++ b/tests/cases/compiler/continueTarget5.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target: while (true) { function f() { diff --git a/tests/cases/compiler/downlevelLetConst16.ts b/tests/cases/compiler/downlevelLetConst16.ts index 30a27ba61f48a..b30f26b4b82f9 100644 --- a/tests/cases/compiler/downlevelLetConst16.ts +++ b/tests/cases/compiler/downlevelLetConst16.ts @@ -1,4 +1,6 @@ // @target:es5 +// @allowUnreachableCode: true + 'use strict' declare function use(a: any); diff --git a/tests/cases/compiler/downlevelLetConst17.ts b/tests/cases/compiler/downlevelLetConst17.ts index b581281f67975..7cea2031ac5b6 100644 --- a/tests/cases/compiler/downlevelLetConst17.ts +++ b/tests/cases/compiler/downlevelLetConst17.ts @@ -1,4 +1,5 @@ // @target:es5 +// @allowUnreachableCode: true 'use strict' declare function use(a: any); diff --git a/tests/cases/compiler/downlevelLetConst18.ts b/tests/cases/compiler/downlevelLetConst18.ts index 59f2ee7a46ee3..d40f23e3a37f3 100644 --- a/tests/cases/compiler/downlevelLetConst18.ts +++ b/tests/cases/compiler/downlevelLetConst18.ts @@ -1,4 +1,6 @@ // @target:es5 +// @allowUnreachableCode: true + 'use strict' for (let x; ;) { diff --git a/tests/cases/compiler/duplicateLabel1.ts b/tests/cases/compiler/duplicateLabel1.ts index c588e7b81837d..ff248c6454858 100644 --- a/tests/cases/compiler/duplicateLabel1.ts +++ b/tests/cases/compiler/duplicateLabel1.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target: target: while (true) { diff --git a/tests/cases/compiler/duplicateLabel2.ts b/tests/cases/compiler/duplicateLabel2.ts index bdb0396a246a2..5ebf273c1187f 100644 --- a/tests/cases/compiler/duplicateLabel2.ts +++ b/tests/cases/compiler/duplicateLabel2.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target: while (true) { target: diff --git a/tests/cases/compiler/duplicateLabel3.ts b/tests/cases/compiler/duplicateLabel3.ts index d4db9399ed232..d6add9804471f 100644 --- a/tests/cases/compiler/duplicateLabel3.ts +++ b/tests/cases/compiler/duplicateLabel3.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target: while (true) { function f() { diff --git a/tests/cases/compiler/duplicateLabel4.ts b/tests/cases/compiler/duplicateLabel4.ts index 2c62180a2ab69..bf7ea5c22c6a4 100644 --- a/tests/cases/compiler/duplicateLabel4.ts +++ b/tests/cases/compiler/duplicateLabel4.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + target: while (true) { } diff --git a/tests/cases/compiler/duplicateLocalVariable1.ts b/tests/cases/compiler/duplicateLocalVariable1.ts index fc20a19c2d99b..f6288cfc6ae4e 100644 --- a/tests/cases/compiler/duplicateLocalVariable1.ts +++ b/tests/cases/compiler/duplicateLocalVariable1.ts @@ -1,4 +1,6 @@ -//@module: commonjs + +// @allowUnreachableCode: true +/ /@module: commonjs //import FileManager = require('filemanager'); //import App = require('app'); diff --git a/tests/cases/compiler/duplicateVariablesByScope.ts b/tests/cases/compiler/duplicateVariablesByScope.ts index 481c1bb950ebb..dc811130d4fb7 100644 --- a/tests/cases/compiler/duplicateVariablesByScope.ts +++ b/tests/cases/compiler/duplicateVariablesByScope.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // duplicate local variables are only reported at global scope module M { diff --git a/tests/cases/compiler/es6ClassSuperCodegenBug.ts b/tests/cases/compiler/es6ClassSuperCodegenBug.ts index 7ab8344c81509..2e3f306d5d68b 100644 --- a/tests/cases/compiler/es6ClassSuperCodegenBug.ts +++ b/tests/cases/compiler/es6ClassSuperCodegenBug.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + class A { constructor(str1:string, str2:string) {} } diff --git a/tests/cases/compiler/escapedIdentifiers.ts b/tests/cases/compiler/escapedIdentifiers.ts index 795aeca2481ac..c58c59d9b4241 100644 --- a/tests/cases/compiler/escapedIdentifiers.ts +++ b/tests/cases/compiler/escapedIdentifiers.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + /* 0 .. \u0030 9 .. \u0039 diff --git a/tests/cases/compiler/for.ts b/tests/cases/compiler/for.ts index e27dab7dbd222..636c7e4a5fc33 100644 --- a/tests/cases/compiler/for.ts +++ b/tests/cases/compiler/for.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + for (var i = 0; i < 10; i++) { // ok var x1 = i; } diff --git a/tests/cases/compiler/functionOverloads12.ts b/tests/cases/compiler/functionOverloads12.ts index 3e8a9882d0876..48a8af06cc5de 100644 --- a/tests/cases/compiler/functionOverloads12.ts +++ b/tests/cases/compiler/functionOverloads12.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + function foo():string; function foo():number; function foo():any { if (true) return ""; else return 0;} diff --git a/tests/cases/compiler/functionReturn.ts b/tests/cases/compiler/functionReturn.ts index 8ea0cb8f5a1b9..897480c64d61e 100644 --- a/tests/cases/compiler/functionReturn.ts +++ b/tests/cases/compiler/functionReturn.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + function f0(): void { } function f1() { var n: any = f0(); diff --git a/tests/cases/compiler/functionWithNoBestCommonType1.ts b/tests/cases/compiler/functionWithNoBestCommonType1.ts index 1162881292531..2d7a1191770b1 100644 --- a/tests/cases/compiler/functionWithNoBestCommonType1.ts +++ b/tests/cases/compiler/functionWithNoBestCommonType1.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + function foo() { return true; return bar(); diff --git a/tests/cases/compiler/functionWithNoBestCommonType2.ts b/tests/cases/compiler/functionWithNoBestCommonType2.ts index 974ccdfe035d4..6bc3878d834ff 100644 --- a/tests/cases/compiler/functionWithNoBestCommonType2.ts +++ b/tests/cases/compiler/functionWithNoBestCommonType2.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + var v = function () { return true; return bar(); diff --git a/tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts b/tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts index 81259fd7c0c7f..fde615af41db5 100644 --- a/tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts +++ b/tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // @target: es5 function f1(): string { diff --git a/tests/cases/compiler/ifElseWithStatements1.ts b/tests/cases/compiler/ifElseWithStatements1.ts index a7f337068cb10..5ed7f7dd7a31b 100644 --- a/tests/cases/compiler/ifElseWithStatements1.ts +++ b/tests/cases/compiler/ifElseWithStatements1.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + if (true) f(); else diff --git a/tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts b/tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts index d150fb1930a98..6465e7f12000e 100644 --- a/tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts +++ b/tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + function foo() { if (true) { return 42; diff --git a/tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts b/tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts index 2620e7d88d4c5..e325ae4582aad 100644 --- a/tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts +++ b/tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + class a { static get x(): () => string { return null;; diff --git a/tests/cases/compiler/letAndVarRedeclaration.ts b/tests/cases/compiler/letAndVarRedeclaration.ts index 1f901ded5207e..aaf2ce1a68cde 100644 --- a/tests/cases/compiler/letAndVarRedeclaration.ts +++ b/tests/cases/compiler/letAndVarRedeclaration.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // @target: es6 let e0 diff --git a/tests/cases/compiler/letDeclarations-invalidContexts.ts b/tests/cases/compiler/letDeclarations-invalidContexts.ts index 4d165ba2cda0e..cde6c2006bbe9 100644 --- a/tests/cases/compiler/letDeclarations-invalidContexts.ts +++ b/tests/cases/compiler/letDeclarations-invalidContexts.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // @target: ES6 // Errors, let must be defined inside a block diff --git a/tests/cases/compiler/letDeclarations-scopes.ts b/tests/cases/compiler/letDeclarations-scopes.ts index 93f4ce5b4ed0f..b050a5e9bd0ff 100644 --- a/tests/cases/compiler/letDeclarations-scopes.ts +++ b/tests/cases/compiler/letDeclarations-scopes.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + // @target: ES6 // global diff --git a/tests/cases/compiler/letDeclarations-validContexts.ts b/tests/cases/compiler/letDeclarations-validContexts.ts index baedfa2644cb0..2a4022901c151 100644 --- a/tests/cases/compiler/letDeclarations-validContexts.ts +++ b/tests/cases/compiler/letDeclarations-validContexts.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + // @target: ES6 diff --git a/tests/cases/compiler/null.ts b/tests/cases/compiler/null.ts index eb88d387bccb1..e8fa9a5d68724 100644 --- a/tests/cases/compiler/null.ts +++ b/tests/cases/compiler/null.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + var x=null; var y=3+x; var z=3+null; diff --git a/tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts b/tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts index 21884031aec0c..12b99fb29ceae 100644 --- a/tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts +++ b/tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts @@ -1 +1,3 @@ +// @allowUnreachableCode: true + var f: (x: 'hi') => number = ('hi') => { return 1; }; \ No newline at end of file diff --git a/tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts b/tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts index b36f423be21fd..62311ee75c9e3 100644 --- a/tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts +++ b/tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + // expected error for all the LHS of compound assignments (arithmetic and addition) var value; diff --git a/tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts b/tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts index cd0fb64e0d2d2..d6bfd84fd9a8c 100644 --- a/tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts +++ b/tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + class Base { private p; } class Derived1 extends Base { private m; } class Derived2 extends Base { private n; } diff --git a/tests/cases/conformance/functions/functionImplementationErrors.ts b/tests/cases/conformance/functions/functionImplementationErrors.ts index ddd3ba0a2c1b8..0a7c7812932f8 100644 --- a/tests/cases/conformance/functions/functionImplementationErrors.ts +++ b/tests/cases/conformance/functions/functionImplementationErrors.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // FunctionExpression with no return type annotation with multiple return statements with unrelated types var f1 = function () { return ''; diff --git a/tests/cases/conformance/functions/functionImplementations.ts b/tests/cases/conformance/functions/functionImplementations.ts index df36a0b445799..3c5adefd2e40a 100644 --- a/tests/cases/conformance/functions/functionImplementations.ts +++ b/tests/cases/conformance/functions/functionImplementations.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // FunctionExpression with no return type annotation and no return statement returns void var v: void = function () { } (); diff --git a/tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts b/tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts index 31407b88590cd..d35002e2f65fc 100644 --- a/tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts +++ b/tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + class Foo { x: string; y() { } diff --git a/tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts b/tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts index cad137cc88dff..62c0153f2248c 100644 --- a/tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts +++ b/tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts @@ -1,2 +1,4 @@ +// @allowUnusedLabels: true + {a: 3} /x/ \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts b/tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts index 88476ac4a7820..b35204beb4851 100644 --- a/tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts +++ b/tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + /// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the diff --git a/tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts b/tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts index 49bfaaca13fa9..cca94947a5da5 100644 --- a/tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts +++ b/tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + do { break; } while(true) diff --git a/tests/cases/conformance/statements/breakStatements/forBreakStatements.ts b/tests/cases/conformance/statements/breakStatements/forBreakStatements.ts index 20a93db441857..9cf07e1eef7d4 100644 --- a/tests/cases/conformance/statements/breakStatements/forBreakStatements.ts +++ b/tests/cases/conformance/statements/breakStatements/forBreakStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + for (; ;) { break; } diff --git a/tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts b/tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts index 5810d5221829c..ffc99ee904bf3 100644 --- a/tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts +++ b/tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + for(var x in {}) { break; } diff --git a/tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts b/tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts index 7c93553a726b8..d164691db68c3 100644 --- a/tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts +++ b/tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + // All errors // naked break not allowed diff --git a/tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts b/tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts index cc21818b80f14..142a8f8b3b5e8 100644 --- a/tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts +++ b/tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + // All errors // naked break not allowed diff --git a/tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts b/tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts index 9cda003e6f557..db49a13c8f743 100644 --- a/tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts +++ b/tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + // All errors // naked break not allowed diff --git a/tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts b/tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts index c471e6552b92f..e2a836b62a348 100644 --- a/tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts +++ b/tests/cases/conformance/statements/breakStatements/whileBreakStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + while(true) { break; } diff --git a/tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts b/tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts index d3d999ccb4955..4685cc9f046c7 100644 --- a/tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts +++ b/tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + do { continue; } while(true) diff --git a/tests/cases/conformance/statements/continueStatements/forContinueStatements.ts b/tests/cases/conformance/statements/continueStatements/forContinueStatements.ts index 1f8a3fc7b68d6..9b852df80c7a9 100644 --- a/tests/cases/conformance/statements/continueStatements/forContinueStatements.ts +++ b/tests/cases/conformance/statements/continueStatements/forContinueStatements.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + for (; ;) { continue; } diff --git a/tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts b/tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts index 863caec2ccf1e..b5ccd8189ca1b 100644 --- a/tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts +++ b/tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + for(var x in {}) { continue; } diff --git a/tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts b/tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts index 54192212ef79a..dcf543ed7e31f 100644 --- a/tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts +++ b/tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + // All errors // naked continue not allowed diff --git a/tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts b/tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts index 751cd9477ad35..ba367ef87b75d 100644 --- a/tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts +++ b/tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + // All errors // naked continue not allowed diff --git a/tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts b/tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts index be274005961d4..861d7e9062939 100644 --- a/tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts +++ b/tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + // All errors // naked continue not allowed diff --git a/tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts b/tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts index cf913671315f3..ef94466ffba33 100644 --- a/tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts +++ b/tests/cases/conformance/statements/continueStatements/invalidWhileContinueStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + // All errors // naked continue not allowed diff --git a/tests/cases/conformance/statements/forStatements/forStatements.ts b/tests/cases/conformance/statements/forStatements/forStatements.ts index 567c49c1098a9..1e65bdc293216 100644 --- a/tests/cases/conformance/statements/forStatements/forStatements.ts +++ b/tests/cases/conformance/statements/forStatements/forStatements.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + interface I { id: number; } diff --git a/tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts b/tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts index 0c2bb3d40dced..64317b233369d 100644 --- a/tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts +++ b/tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + interface I { id: number; } diff --git a/tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts b/tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts index 9f5557e7756f6..af19fd404dfe3 100644 --- a/tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts +++ b/tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // all expected to be valid for (var x: number; ;) { } diff --git a/tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts b/tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts index f2cd9aa43eec2..03f042401d822 100644 --- a/tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts +++ b/tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + interface I { id: number; } diff --git a/tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts b/tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts index aa382d4ec3485..8cc294d01f7b0 100644 --- a/tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts +++ b/tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + throw; export throw null; diff --git a/tests/cases/conformance/types/localTypes/localTypes4.ts b/tests/cases/conformance/types/localTypes/localTypes4.ts index bd31e76a80f86..388d5efb637d4 100644 --- a/tests/cases/conformance/types/localTypes/localTypes4.ts +++ b/tests/cases/conformance/types/localTypes/localTypes4.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + function f1() { // Type parameters are in scope in parameters and return types function f(x: T): T { diff --git a/tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts b/tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts index c249d2e5671c5..5cb52588644c2 100644 --- a/tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts +++ b/tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + // interfaces do not permit private members, these are errors interface I { diff --git a/tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts b/tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts index 7ea4f414e151b..1cc499c7d6e03 100644 --- a/tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts +++ b/tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // Call signatures without a return type should infer one from the function body (if present) // Simple types diff --git a/tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts b/tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts index 9b12363ff08a9..9864ddab4887a 100644 --- a/tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts +++ b/tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // return type of a function with multiple returns is the BCT of each return statement // it is an error if there is no single BCT, these are error cases diff --git a/tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts b/tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts index 41d4fddfbebe5..03021bfdd106b 100644 --- a/tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts +++ b/tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // return type of a function with multiple returns is the BCT of each return statement // no errors expected here From 238e1c6f4bedfcd2dc0d64acdac58b33f665fef6 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 13 Oct 2015 11:17:10 -0700 Subject: [PATCH 08/11] partially suppress reachability errors in tests --- .../reference/commentsAtEndOfFile1.errors.txt | 10 - .../reference/commentsAtEndOfFile1.js | 1 + .../reference/commentsAtEndOfFile1.symbols | 7 + .../reference/commentsAtEndOfFile1.types | 8 + .../reference/parser_breakTarget3.errors.txt | 11 - .../reference/parser_breakTarget3.js | 1 + .../reference/parser_breakTarget3.symbols | 8 + .../reference/parser_breakTarget3.types | 14 + .../reference/parser_breakTarget4.errors.txt | 11 - .../reference/parser_breakTarget4.js | 1 + .../reference/parser_breakTarget4.symbols | 8 + .../reference/parser_breakTarget4.types | 14 + .../parser_continueTarget3.errors.txt | 11 - .../reference/parser_continueTarget3.js | 1 + .../reference/parser_continueTarget3.symbols | 8 + .../reference/parser_continueTarget3.types | 14 + .../parser_continueTarget4.errors.txt | 11 - .../reference/parser_continueTarget4.js | 1 + .../reference/parser_continueTarget4.symbols | 8 + .../reference/parser_continueTarget4.types | 14 + .../parser_duplicateLabel3.errors.txt | 17 -- .../reference/parser_duplicateLabel3.js | 1 + .../reference/parser_duplicateLabel3.symbols | 12 + .../reference/parser_duplicateLabel3.types | 19 ++ .../parser_duplicateLabel4.errors.txt | 16 -- .../reference/parser_duplicateLabel4.js | 1 + .../reference/parser_duplicateLabel4.symbols | 10 + .../reference/parser_duplicateLabel4.types | 15 + .../reference/recursiveMods.errors.txt | 29 -- tests/baselines/reference/recursiveMods.js | 1 + .../baselines/reference/recursiveMods.symbols | 48 ++++ tests/baselines/reference/recursiveMods.types | 54 ++++ .../reference/returnStatement1.errors.txt | 12 - tests/baselines/reference/returnStatement1.js | 1 + .../reference/returnStatement1.symbols | 15 + .../reference/returnStatement1.types | 18 ++ .../sourceMapValidationLabeled.errors.txt | 8 - .../reference/sourceMapValidationLabeled.js | 1 + .../sourceMapValidationLabeled.js.map | 2 +- .../sourceMapValidationLabeled.sourcemap.txt | 19 +- .../sourceMapValidationLabeled.symbols | 6 + .../sourceMapValidationLabeled.types | 9 + .../switchBreakStatements.errors.txt | 67 ----- .../reference/switchBreakStatements.js | 1 + .../reference/switchBreakStatements.symbols | 59 ++++ .../reference/switchBreakStatements.types | 127 +++++++++ .../reference/systemModule8.errors.txt | 36 --- .../baselines/reference/systemModule8.symbols | 92 ++++++ tests/baselines/reference/systemModule8.types | 143 ++++++++++ .../throwInEnclosingStatements.errors.txt | 52 ---- .../reference/throwInEnclosingStatements.js | 1 + .../throwInEnclosingStatements.symbols | 94 ++++++ .../throwInEnclosingStatements.types | 110 ++++++++ .../reference/throwStatements.errors.txt | 91 ------ tests/baselines/reference/throwStatements.js | 1 + .../reference/throwStatements.symbols | 216 ++++++++++++++ .../baselines/reference/throwStatements.types | 267 ++++++++++++++++++ .../typeofOperatorWithBooleanType.errors.txt | 59 ---- .../typeofOperatorWithBooleanType.js | 1 + .../typeofOperatorWithBooleanType.symbols | 131 +++++++++ .../typeofOperatorWithBooleanType.types | 177 ++++++++++++ .../typeofOperatorWithEnumType.errors.txt | 33 --- .../reference/typeofOperatorWithEnumType.js | 1 + .../typeofOperatorWithEnumType.symbols | 70 +++++ .../typeofOperatorWithEnumType.types | 99 +++++++ tests/cases/compiler/commentsAtEndOfFile1.ts | 2 + tests/cases/compiler/recursiveMods.ts | 4 +- tests/cases/compiler/returnStatement1.ts | 2 + .../compiler/sourceMapValidationLabeled.ts | 2 + tests/cases/compiler/systemModule8.ts | 1 + .../typeofOperatorWithBooleanType.ts | 2 + .../typeofOperatorWithEnumType.ts | 2 + .../BreakStatements/parser_breakTarget3.ts | 2 + .../BreakStatements/parser_breakTarget4.ts | 2 + .../parser_continueTarget3.ts | 2 + .../parser_continueTarget4.ts | 2 + .../parser_duplicateLabel3.ts | 2 + .../parser_duplicateLabel4.ts | 3 + .../breakStatements/switchBreakStatements.ts | 3 + .../throwInEnclosingStatements.ts | 2 + .../throwStatements/throwStatements.ts | 2 + 81 files changed, 1954 insertions(+), 485 deletions(-) delete mode 100644 tests/baselines/reference/commentsAtEndOfFile1.errors.txt create mode 100644 tests/baselines/reference/commentsAtEndOfFile1.symbols create mode 100644 tests/baselines/reference/commentsAtEndOfFile1.types delete mode 100644 tests/baselines/reference/parser_breakTarget3.errors.txt create mode 100644 tests/baselines/reference/parser_breakTarget3.symbols create mode 100644 tests/baselines/reference/parser_breakTarget3.types delete mode 100644 tests/baselines/reference/parser_breakTarget4.errors.txt create mode 100644 tests/baselines/reference/parser_breakTarget4.symbols create mode 100644 tests/baselines/reference/parser_breakTarget4.types delete mode 100644 tests/baselines/reference/parser_continueTarget3.errors.txt create mode 100644 tests/baselines/reference/parser_continueTarget3.symbols create mode 100644 tests/baselines/reference/parser_continueTarget3.types delete mode 100644 tests/baselines/reference/parser_continueTarget4.errors.txt create mode 100644 tests/baselines/reference/parser_continueTarget4.symbols create mode 100644 tests/baselines/reference/parser_continueTarget4.types delete mode 100644 tests/baselines/reference/parser_duplicateLabel3.errors.txt create mode 100644 tests/baselines/reference/parser_duplicateLabel3.symbols create mode 100644 tests/baselines/reference/parser_duplicateLabel3.types delete mode 100644 tests/baselines/reference/parser_duplicateLabel4.errors.txt create mode 100644 tests/baselines/reference/parser_duplicateLabel4.symbols create mode 100644 tests/baselines/reference/parser_duplicateLabel4.types delete mode 100644 tests/baselines/reference/recursiveMods.errors.txt create mode 100644 tests/baselines/reference/recursiveMods.symbols create mode 100644 tests/baselines/reference/recursiveMods.types delete mode 100644 tests/baselines/reference/returnStatement1.errors.txt create mode 100644 tests/baselines/reference/returnStatement1.symbols create mode 100644 tests/baselines/reference/returnStatement1.types delete mode 100644 tests/baselines/reference/sourceMapValidationLabeled.errors.txt create mode 100644 tests/baselines/reference/sourceMapValidationLabeled.symbols create mode 100644 tests/baselines/reference/sourceMapValidationLabeled.types delete mode 100644 tests/baselines/reference/switchBreakStatements.errors.txt create mode 100644 tests/baselines/reference/switchBreakStatements.symbols create mode 100644 tests/baselines/reference/switchBreakStatements.types delete mode 100644 tests/baselines/reference/systemModule8.errors.txt create mode 100644 tests/baselines/reference/systemModule8.symbols create mode 100644 tests/baselines/reference/systemModule8.types delete mode 100644 tests/baselines/reference/throwInEnclosingStatements.errors.txt create mode 100644 tests/baselines/reference/throwInEnclosingStatements.symbols create mode 100644 tests/baselines/reference/throwInEnclosingStatements.types delete mode 100644 tests/baselines/reference/throwStatements.errors.txt create mode 100644 tests/baselines/reference/throwStatements.symbols create mode 100644 tests/baselines/reference/throwStatements.types delete mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.symbols create mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.types delete mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.symbols create mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.types diff --git a/tests/baselines/reference/commentsAtEndOfFile1.errors.txt b/tests/baselines/reference/commentsAtEndOfFile1.errors.txt deleted file mode 100644 index dd689841659f4..0000000000000 --- a/tests/baselines/reference/commentsAtEndOfFile1.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/compiler/commentsAtEndOfFile1.ts(1,1): error TS7028: Unused label. - - -==== tests/cases/compiler/commentsAtEndOfFile1.ts (1 errors) ==== - Input: - ~~~~~ -!!! error TS7028: Unused label. - ; - //Testing two - \ No newline at end of file diff --git a/tests/baselines/reference/commentsAtEndOfFile1.js b/tests/baselines/reference/commentsAtEndOfFile1.js index 2d4dae39e6ba3..d93dded59b062 100644 --- a/tests/baselines/reference/commentsAtEndOfFile1.js +++ b/tests/baselines/reference/commentsAtEndOfFile1.js @@ -1,4 +1,5 @@ //// [commentsAtEndOfFile1.ts] + Input: ; //Testing two diff --git a/tests/baselines/reference/commentsAtEndOfFile1.symbols b/tests/baselines/reference/commentsAtEndOfFile1.symbols new file mode 100644 index 0000000000000..d35b4f251f6ab --- /dev/null +++ b/tests/baselines/reference/commentsAtEndOfFile1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/commentsAtEndOfFile1.ts === + +No type information for this code.Input: +No type information for this code.; +No type information for this code.//Testing two +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/commentsAtEndOfFile1.types b/tests/baselines/reference/commentsAtEndOfFile1.types new file mode 100644 index 0000000000000..71eb367738b1a --- /dev/null +++ b/tests/baselines/reference/commentsAtEndOfFile1.types @@ -0,0 +1,8 @@ +=== tests/cases/compiler/commentsAtEndOfFile1.ts === + +Input: +>Input : any + +; +//Testing two + diff --git a/tests/baselines/reference/parser_breakTarget3.errors.txt b/tests/baselines/reference/parser_breakTarget3.errors.txt deleted file mode 100644 index ad3123eda79aa..0000000000000 --- a/tests/baselines/reference/parser_breakTarget3.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts(2,1): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts (1 errors) ==== - target1: - target2: - ~~~~~~~ -!!! error TS7028: Unused label. - while (true) { - break target1; - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget3.js b/tests/baselines/reference/parser_breakTarget3.js index 0eceba87bf8d2..91ba9fb599369 100644 --- a/tests/baselines/reference/parser_breakTarget3.js +++ b/tests/baselines/reference/parser_breakTarget3.js @@ -1,4 +1,5 @@ //// [parser_breakTarget3.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/parser_breakTarget3.symbols b/tests/baselines/reference/parser_breakTarget3.symbols new file mode 100644 index 0000000000000..35184471d4d31 --- /dev/null +++ b/tests/baselines/reference/parser_breakTarget3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget3.types b/tests/baselines/reference/parser_breakTarget3.types new file mode 100644 index 0000000000000..b1ce9f8d94dda --- /dev/null +++ b/tests/baselines/reference/parser_breakTarget3.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + break target1; +>target1 : any +} diff --git a/tests/baselines/reference/parser_breakTarget4.errors.txt b/tests/baselines/reference/parser_breakTarget4.errors.txt deleted file mode 100644 index 8c61b20b0ed73..0000000000000 --- a/tests/baselines/reference/parser_breakTarget4.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts(1,1): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts (1 errors) ==== - target1: - ~~~~~~~ -!!! error TS7028: Unused label. - target2: - while (true) { - break target2; - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget4.js b/tests/baselines/reference/parser_breakTarget4.js index c6cadb5efa1af..4516cf3e8f9b1 100644 --- a/tests/baselines/reference/parser_breakTarget4.js +++ b/tests/baselines/reference/parser_breakTarget4.js @@ -1,4 +1,5 @@ //// [parser_breakTarget4.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/parser_breakTarget4.symbols b/tests/baselines/reference/parser_breakTarget4.symbols new file mode 100644 index 0000000000000..f4d4b2e4bffd1 --- /dev/null +++ b/tests/baselines/reference/parser_breakTarget4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_breakTarget4.types b/tests/baselines/reference/parser_breakTarget4.types new file mode 100644 index 0000000000000..04bb129c9190c --- /dev/null +++ b/tests/baselines/reference/parser_breakTarget4.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + break target2; +>target2 : any +} diff --git a/tests/baselines/reference/parser_continueTarget3.errors.txt b/tests/baselines/reference/parser_continueTarget3.errors.txt deleted file mode 100644 index 4871cb275e770..0000000000000 --- a/tests/baselines/reference/parser_continueTarget3.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts(2,1): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts (1 errors) ==== - target1: - target2: - ~~~~~~~ -!!! error TS7028: Unused label. - while (true) { - continue target1; - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget3.js b/tests/baselines/reference/parser_continueTarget3.js index 76a98a0e20428..ea1559346dee2 100644 --- a/tests/baselines/reference/parser_continueTarget3.js +++ b/tests/baselines/reference/parser_continueTarget3.js @@ -1,4 +1,5 @@ //// [parser_continueTarget3.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/parser_continueTarget3.symbols b/tests/baselines/reference/parser_continueTarget3.symbols new file mode 100644 index 0000000000000..c522444ca1aef --- /dev/null +++ b/tests/baselines/reference/parser_continueTarget3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget3.types b/tests/baselines/reference/parser_continueTarget3.types new file mode 100644 index 0000000000000..fd8aedc357f74 --- /dev/null +++ b/tests/baselines/reference/parser_continueTarget3.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + continue target1; +>target1 : any +} diff --git a/tests/baselines/reference/parser_continueTarget4.errors.txt b/tests/baselines/reference/parser_continueTarget4.errors.txt deleted file mode 100644 index 6089ea60cf7f3..0000000000000 --- a/tests/baselines/reference/parser_continueTarget4.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts(1,1): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts (1 errors) ==== - target1: - ~~~~~~~ -!!! error TS7028: Unused label. - target2: - while (true) { - continue target2; - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget4.js b/tests/baselines/reference/parser_continueTarget4.js index 795cab2e2adaa..9ccaaac27e749 100644 --- a/tests/baselines/reference/parser_continueTarget4.js +++ b/tests/baselines/reference/parser_continueTarget4.js @@ -1,4 +1,5 @@ //// [parser_continueTarget4.ts] + target1: target2: while (true) { diff --git a/tests/baselines/reference/parser_continueTarget4.symbols b/tests/baselines/reference/parser_continueTarget4.symbols new file mode 100644 index 0000000000000..b7e770f9bf9c7 --- /dev/null +++ b/tests/baselines/reference/parser_continueTarget4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts === + +No type information for this code.target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_continueTarget4.types b/tests/baselines/reference/parser_continueTarget4.types new file mode 100644 index 0000000000000..be1e5458f4bca --- /dev/null +++ b/tests/baselines/reference/parser_continueTarget4.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts === + +target1: +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + continue target2; +>target2 : any +} diff --git a/tests/baselines/reference/parser_duplicateLabel3.errors.txt b/tests/baselines/reference/parser_duplicateLabel3.errors.txt deleted file mode 100644 index a933588f538bc..0000000000000 --- a/tests/baselines/reference/parser_duplicateLabel3.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts(1,1): error TS7028: Unused label. -tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts(4,5): error TS7028: Unused label. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts (2 errors) ==== - target: - ~~~~~~ -!!! error TS7028: Unused label. - while (true) { - function f() { - target: - ~~~~~~ -!!! error TS7028: Unused label. - while (true) { - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_duplicateLabel3.js b/tests/baselines/reference/parser_duplicateLabel3.js index 9bd6c56356af9..c2ea2769f18fc 100644 --- a/tests/baselines/reference/parser_duplicateLabel3.js +++ b/tests/baselines/reference/parser_duplicateLabel3.js @@ -1,4 +1,5 @@ //// [parser_duplicateLabel3.ts] + target: while (true) { function f() { diff --git a/tests/baselines/reference/parser_duplicateLabel3.symbols b/tests/baselines/reference/parser_duplicateLabel3.symbols new file mode 100644 index 0000000000000..7e238eb2916f9 --- /dev/null +++ b/tests/baselines/reference/parser_duplicateLabel3.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts === + +target: +while (true) { + function f() { +>f : Symbol(f, Decl(parser_duplicateLabel3.ts, 2, 14)) + + target: + while (true) { + } + } +} diff --git a/tests/baselines/reference/parser_duplicateLabel3.types b/tests/baselines/reference/parser_duplicateLabel3.types new file mode 100644 index 0000000000000..88ea435bf3e21 --- /dev/null +++ b/tests/baselines/reference/parser_duplicateLabel3.types @@ -0,0 +1,19 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts === + +target: +>target : any + +while (true) { +>true : boolean + + function f() { +>f : () => void + + target: +>target : any + + while (true) { +>true : boolean + } + } +} diff --git a/tests/baselines/reference/parser_duplicateLabel4.errors.txt b/tests/baselines/reference/parser_duplicateLabel4.errors.txt deleted file mode 100644 index 4a0108ebe069b..0000000000000 --- a/tests/baselines/reference/parser_duplicateLabel4.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts(1,1): error TS7028: Unused label. -tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts(5,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts (2 errors) ==== - target: - ~~~~~~ -!!! error TS7028: Unused label. - while (true) { - } - - target: - ~~~~~~ -!!! error TS7027: Unreachable code detected. - while (true) { - } \ No newline at end of file diff --git a/tests/baselines/reference/parser_duplicateLabel4.js b/tests/baselines/reference/parser_duplicateLabel4.js index 569a9bcd1023b..a949131442630 100644 --- a/tests/baselines/reference/parser_duplicateLabel4.js +++ b/tests/baselines/reference/parser_duplicateLabel4.js @@ -1,4 +1,5 @@ //// [parser_duplicateLabel4.ts] + target: while (true) { } diff --git a/tests/baselines/reference/parser_duplicateLabel4.symbols b/tests/baselines/reference/parser_duplicateLabel4.symbols new file mode 100644 index 0000000000000..e7123de16008e --- /dev/null +++ b/tests/baselines/reference/parser_duplicateLabel4.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts === + +No type information for this code.target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. +No type information for this code.target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser_duplicateLabel4.types b/tests/baselines/reference/parser_duplicateLabel4.types new file mode 100644 index 0000000000000..b70dd12c695bf --- /dev/null +++ b/tests/baselines/reference/parser_duplicateLabel4.types @@ -0,0 +1,15 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts === + +target: +>target : any + +while (true) { +>true : boolean +} + +target: +>target : any + +while (true) { +>true : boolean +} diff --git a/tests/baselines/reference/recursiveMods.errors.txt b/tests/baselines/reference/recursiveMods.errors.txt deleted file mode 100644 index 6adba78d0049b..0000000000000 --- a/tests/baselines/reference/recursiveMods.errors.txt +++ /dev/null @@ -1,29 +0,0 @@ -tests/cases/compiler/recursiveMods.ts(9,3): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/recursiveMods.ts (1 errors) ==== - export module Foo { - export class C {} - } - - export module Foo { - - function Bar() : C { - if (true) { return Bar();} - return new C(); - ~~~~~~ -!!! error TS7027: Unreachable code detected. - } - - function Baz() : C { - var c = Baz(); - return Bar(); - } - - function Gar() { - var c : C = Baz(); - return; - } - - } - \ No newline at end of file diff --git a/tests/baselines/reference/recursiveMods.js b/tests/baselines/reference/recursiveMods.js index 36d2712e04005..f913ddec012be 100644 --- a/tests/baselines/reference/recursiveMods.js +++ b/tests/baselines/reference/recursiveMods.js @@ -1,4 +1,5 @@ //// [recursiveMods.ts] + export module Foo { export class C {} } diff --git a/tests/baselines/reference/recursiveMods.symbols b/tests/baselines/reference/recursiveMods.symbols new file mode 100644 index 0000000000000..5f6d6f87721eb --- /dev/null +++ b/tests/baselines/reference/recursiveMods.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/recursiveMods.ts === + +export module Foo { +>Foo : Symbol(Foo, Decl(recursiveMods.ts, 0, 0), Decl(recursiveMods.ts, 3, 1)) + + export class C {} +>C : Symbol(C, Decl(recursiveMods.ts, 1, 19)) +} + +export module Foo { +>Foo : Symbol(Foo, Decl(recursiveMods.ts, 0, 0), Decl(recursiveMods.ts, 3, 1)) + + function Bar() : C { +>Bar : Symbol(Bar, Decl(recursiveMods.ts, 5, 19)) +>C : Symbol(C, Decl(recursiveMods.ts, 1, 19)) + + if (true) { return Bar();} +>Bar : Symbol(Bar, Decl(recursiveMods.ts, 5, 19)) + + return new C(); +>C : Symbol(C, Decl(recursiveMods.ts, 1, 19)) + } + + function Baz() : C { +>Baz : Symbol(Baz, Decl(recursiveMods.ts, 10, 2)) +>C : Symbol(C, Decl(recursiveMods.ts, 1, 19)) + + var c = Baz(); +>c : Symbol(c, Decl(recursiveMods.ts, 13, 5)) +>Baz : Symbol(Baz, Decl(recursiveMods.ts, 10, 2)) + + return Bar(); +>Bar : Symbol(Bar, Decl(recursiveMods.ts, 5, 19)) + } + + function Gar() { +>Gar : Symbol(Gar, Decl(recursiveMods.ts, 15, 2)) + + var c : C = Baz(); +>c : Symbol(c, Decl(recursiveMods.ts, 18, 5)) +>C : Symbol(C, Decl(recursiveMods.ts, 1, 19)) +>Baz : Symbol(Baz, Decl(recursiveMods.ts, 10, 2)) + + return; + } + +} + diff --git a/tests/baselines/reference/recursiveMods.types b/tests/baselines/reference/recursiveMods.types new file mode 100644 index 0000000000000..d4db816daf7c3 --- /dev/null +++ b/tests/baselines/reference/recursiveMods.types @@ -0,0 +1,54 @@ +=== tests/cases/compiler/recursiveMods.ts === + +export module Foo { +>Foo : typeof Foo + + export class C {} +>C : C +} + +export module Foo { +>Foo : typeof Foo + + function Bar() : C { +>Bar : () => C +>C : C + + if (true) { return Bar();} +>true : boolean +>Bar() : C +>Bar : () => C + + return new C(); +>new C() : C +>C : typeof C + } + + function Baz() : C { +>Baz : () => C +>C : C + + var c = Baz(); +>c : C +>Baz() : C +>Baz : () => C + + return Bar(); +>Bar() : C +>Bar : () => C + } + + function Gar() { +>Gar : () => void + + var c : C = Baz(); +>c : C +>C : C +>Baz() : C +>Baz : () => C + + return; + } + +} + diff --git a/tests/baselines/reference/returnStatement1.errors.txt b/tests/baselines/reference/returnStatement1.errors.txt deleted file mode 100644 index af17564a8744e..0000000000000 --- a/tests/baselines/reference/returnStatement1.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/compiler/returnStatement1.ts(5,5): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/returnStatement1.ts (1 errors) ==== - function f() { - return function (s) { - var x = s; - }; - ("harmless extra line"); - ~ -!!! error TS7027: Unreachable code detected. - } \ No newline at end of file diff --git a/tests/baselines/reference/returnStatement1.js b/tests/baselines/reference/returnStatement1.js index c4ccc3caddec2..3f5c5561b2a01 100644 --- a/tests/baselines/reference/returnStatement1.js +++ b/tests/baselines/reference/returnStatement1.js @@ -1,4 +1,5 @@ //// [returnStatement1.ts] + function f() { return function (s) { var x = s; diff --git a/tests/baselines/reference/returnStatement1.symbols b/tests/baselines/reference/returnStatement1.symbols new file mode 100644 index 0000000000000..6727cba0df5b0 --- /dev/null +++ b/tests/baselines/reference/returnStatement1.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/returnStatement1.ts === + +function f() { +>f : Symbol(f, Decl(returnStatement1.ts, 0, 0)) + + return function (s) { +>s : Symbol(s, Decl(returnStatement1.ts, 2, 21)) + + var x = s; +>x : Symbol(x, Decl(returnStatement1.ts, 3, 11)) +>s : Symbol(s, Decl(returnStatement1.ts, 2, 21)) + + }; + ("harmless extra line"); +} diff --git a/tests/baselines/reference/returnStatement1.types b/tests/baselines/reference/returnStatement1.types new file mode 100644 index 0000000000000..b7e166ffa75a9 --- /dev/null +++ b/tests/baselines/reference/returnStatement1.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/returnStatement1.ts === + +function f() { +>f : () => (s: any) => void + + return function (s) { +>function (s) { var x = s; } : (s: any) => void +>s : any + + var x = s; +>x : any +>s : any + + }; + ("harmless extra line"); +>("harmless extra line") : string +>"harmless extra line" : string +} diff --git a/tests/baselines/reference/sourceMapValidationLabeled.errors.txt b/tests/baselines/reference/sourceMapValidationLabeled.errors.txt deleted file mode 100644 index e9cf1fb3db8bc..0000000000000 --- a/tests/baselines/reference/sourceMapValidationLabeled.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/compiler/sourceMapValidationLabeled.ts(1,1): error TS7028: Unused label. - - -==== tests/cases/compiler/sourceMapValidationLabeled.ts (1 errors) ==== - x: - ~ -!!! error TS7028: Unused label. - var b = 10; \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLabeled.js b/tests/baselines/reference/sourceMapValidationLabeled.js index 7aabc47ea4ea0..50669b870abb8 100644 --- a/tests/baselines/reference/sourceMapValidationLabeled.js +++ b/tests/baselines/reference/sourceMapValidationLabeled.js @@ -1,4 +1,5 @@ //// [sourceMapValidationLabeled.ts] + x: var b = 10; diff --git a/tests/baselines/reference/sourceMapValidationLabeled.js.map b/tests/baselines/reference/sourceMapValidationLabeled.js.map index d1219f9896ffb..206ac95b9512f 100644 --- a/tests/baselines/reference/sourceMapValidationLabeled.js.map +++ b/tests/baselines/reference/sourceMapValidationLabeled.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationLabeled.js.map] -{"version":3,"file":"sourceMapValidationLabeled.js","sourceRoot":"","sources":["sourceMapValidationLabeled.ts"],"names":[],"mappings":"AAAA,CAAC,EACD,IAAI,CAAC,GAAG,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationLabeled.js","sourceRoot":"","sources":["sourceMapValidationLabeled.ts"],"names":[],"mappings":"AACA,CAAC,EACD,IAAI,CAAC,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt b/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt index 007208c78f95c..7cf1bf896ca00 100644 --- a/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt @@ -18,7 +18,8 @@ sourceFile:sourceMapValidationLabeled.ts 7 > ^^ 8 > ^ 9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > +1 > + > 2 >x 3 > : > @@ -27,13 +28,13 @@ sourceFile:sourceMapValidationLabeled.ts 6 > = 7 > 10 8 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 2) Source(1, 2) + SourceIndex(0) -3 >Emitted(1, 4) Source(2, 1) + SourceIndex(0) -4 >Emitted(1, 8) Source(2, 5) + SourceIndex(0) -5 >Emitted(1, 9) Source(2, 6) + SourceIndex(0) -6 >Emitted(1, 12) Source(2, 9) + SourceIndex(0) -7 >Emitted(1, 14) Source(2, 11) + SourceIndex(0) -8 >Emitted(1, 15) Source(2, 12) + SourceIndex(0) +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 2) Source(2, 2) + SourceIndex(0) +3 >Emitted(1, 4) Source(3, 1) + SourceIndex(0) +4 >Emitted(1, 8) Source(3, 5) + SourceIndex(0) +5 >Emitted(1, 9) Source(3, 6) + SourceIndex(0) +6 >Emitted(1, 12) Source(3, 9) + SourceIndex(0) +7 >Emitted(1, 14) Source(3, 11) + SourceIndex(0) +8 >Emitted(1, 15) Source(3, 12) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationLabeled.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLabeled.symbols b/tests/baselines/reference/sourceMapValidationLabeled.symbols new file mode 100644 index 0000000000000..bf9abc593b34c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLabeled.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/sourceMapValidationLabeled.ts === + +x: +var b = 10; +>b : Symbol(b, Decl(sourceMapValidationLabeled.ts, 2, 3)) + diff --git a/tests/baselines/reference/sourceMapValidationLabeled.types b/tests/baselines/reference/sourceMapValidationLabeled.types new file mode 100644 index 0000000000000..7af624ac93b00 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLabeled.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/sourceMapValidationLabeled.ts === + +x: +>x : any + +var b = 10; +>b : number +>10 : number + diff --git a/tests/baselines/reference/switchBreakStatements.errors.txt b/tests/baselines/reference/switchBreakStatements.errors.txt deleted file mode 100644 index 77577e485da33..0000000000000 --- a/tests/baselines/reference/switchBreakStatements.errors.txt +++ /dev/null @@ -1,67 +0,0 @@ -tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(12,1): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(22,9): error TS7028: Unused label. -tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(46,25): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts (3 errors) ==== - switch ('') { - case 'a': - break; - } - - ONE: - switch ('') { - case 'a': - break ONE; - } - - TWO: - ~~~ -!!! error TS7028: Unused label. - THREE: - switch ('') { - case 'a': - break THREE; - } - - FOUR: - switch ('') { - case 'a': - FIVE: - ~~~~ -!!! error TS7028: Unused label. - switch ('') { - case 'a': - break FOUR; - } - } - - switch ('') { - case 'a': - SIX: - switch ('') { - case 'a': - break SIX; - } - } - - SEVEN: - switch ('') { - case 'a': - switch ('') { - case 'a': - switch ('') { - case 'a': - break SEVEN; - EIGHT: - ~~~~~ -!!! error TS7027: Unreachable code detected. - switch ('') { - case 'a': - var fn = function () { } - break EIGHT; - } - } - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/switchBreakStatements.js b/tests/baselines/reference/switchBreakStatements.js index 534f025e2f5b8..d7fa279248c6d 100644 --- a/tests/baselines/reference/switchBreakStatements.js +++ b/tests/baselines/reference/switchBreakStatements.js @@ -1,4 +1,5 @@ //// [switchBreakStatements.ts] + switch ('') { case 'a': break; diff --git a/tests/baselines/reference/switchBreakStatements.symbols b/tests/baselines/reference/switchBreakStatements.symbols new file mode 100644 index 0000000000000..dde7ca028ccd3 --- /dev/null +++ b/tests/baselines/reference/switchBreakStatements.symbols @@ -0,0 +1,59 @@ +=== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts === + +switch ('') { + case 'a': + break; +} + +ONE: +switch ('') { + case 'a': + break ONE; +} + +TWO: +THREE: +switch ('') { + case 'a': + break THREE; +} + +FOUR: +switch ('') { + case 'a': + FIVE: + switch ('') { + case 'a': + break FOUR; + } +} + +switch ('') { + case 'a': + SIX: + switch ('') { + case 'a': + break SIX; + } +} + +SEVEN: +switch ('') { + case 'a': + switch ('') { + case 'a': + switch ('') { + case 'a': + break SEVEN; + EIGHT: + switch ('') { + case 'a': + var fn = function () { } +>fn : Symbol(fn, Decl(switchBreakStatements.ts, 49, 35)) + + break EIGHT; + } + } + } +} + diff --git a/tests/baselines/reference/switchBreakStatements.types b/tests/baselines/reference/switchBreakStatements.types new file mode 100644 index 0000000000000..0364d878d5ab4 --- /dev/null +++ b/tests/baselines/reference/switchBreakStatements.types @@ -0,0 +1,127 @@ +=== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts === + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + break; +} + +ONE: +>ONE : any + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + break ONE; +>ONE : any +} + +TWO: +>TWO : any + +THREE: +>THREE : any + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + break THREE; +>THREE : any +} + +FOUR: +>FOUR : any + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + FIVE: +>FIVE : any + + switch ('') { +>'' : string + + case 'a': +>'a' : string + + break FOUR; +>FOUR : any + } +} + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + SIX: +>SIX : any + + switch ('') { +>'' : string + + case 'a': +>'a' : string + + break SIX; +>SIX : any + } +} + +SEVEN: +>SEVEN : any + +switch ('') { +>'' : string + + case 'a': +>'a' : string + + switch ('') { +>'' : string + + case 'a': +>'a' : string + + switch ('') { +>'' : string + + case 'a': +>'a' : string + + break SEVEN; +>SEVEN : any + + EIGHT: +>EIGHT : any + + switch ('') { +>'' : string + + case 'a': +>'a' : string + + var fn = function () { } +>fn : () => void +>function () { } : () => void + + break EIGHT; +>EIGHT : any + } + } + } +} + diff --git a/tests/baselines/reference/systemModule8.errors.txt b/tests/baselines/reference/systemModule8.errors.txt deleted file mode 100644 index 17a37e57d2400..0000000000000 --- a/tests/baselines/reference/systemModule8.errors.txt +++ /dev/null @@ -1,36 +0,0 @@ -tests/cases/compiler/systemModule8.ts(19,1): error TS7027: Unreachable code detected. - - -==== tests/cases/compiler/systemModule8.ts (1 errors) ==== - - export var x; - x = 1; - x++; - x--; - ++x; - --x; - x += 1; - x -= 1; - x *= 1; - x /= 1; - x |= 1; - x &= 1; - x + 1; - x - 1; - x & 1; - x | 1; - for (x = 5;;x++) {} - for (x = 8;;x--) {} - ~~~ -!!! error TS7027: Unreachable code detected. - for (x = 15;;++x) {} - for (x = 18;;--x) {} - - for (let x = 50;;) {} - function foo() { - x = 100; - } - - export let [y] = [1]; - export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; - for ([x] of [[1]]) {} \ No newline at end of file diff --git a/tests/baselines/reference/systemModule8.symbols b/tests/baselines/reference/systemModule8.symbols new file mode 100644 index 0000000000000..719d48e4592db --- /dev/null +++ b/tests/baselines/reference/systemModule8.symbols @@ -0,0 +1,92 @@ +=== tests/cases/compiler/systemModule8.ts === + +export var x; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x = 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x++; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x--; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +++x; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +--x; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x += 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x -= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x *= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x /= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x |= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x &= 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x + 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x - 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x & 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +x | 1; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 5;;x++) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 8;;x--) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 15;;++x) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (x = 18;;--x) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + +for (let x = 50;;) {} +>x : Symbol(x, Decl(systemModule8.ts, 22, 8)) + +function foo() { +>foo : Symbol(foo, Decl(systemModule8.ts, 22, 21)) + + x = 100; +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) +} + +export let [y] = [1]; +>y : Symbol(y, Decl(systemModule8.ts, 27, 12)) + +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +>a : Symbol(a, Decl(systemModule8.ts, 28, 36)) +>z0 : Symbol(z0, Decl(systemModule8.ts, 28, 14)) +>b : Symbol(b, Decl(systemModule8.ts, 28, 44)) +>c : Symbol(c, Decl(systemModule8.ts, 28, 49)) +>z1 : Symbol(z1, Decl(systemModule8.ts, 28, 25)) +>a : Symbol(a, Decl(systemModule8.ts, 28, 36)) +>b : Symbol(b, Decl(systemModule8.ts, 28, 44)) +>c : Symbol(c, Decl(systemModule8.ts, 28, 49)) + +for ([x] of [[1]]) {} +>x : Symbol(x, Decl(systemModule8.ts, 1, 10)) + diff --git a/tests/baselines/reference/systemModule8.types b/tests/baselines/reference/systemModule8.types new file mode 100644 index 0000000000000..2c3dd1e48bb04 --- /dev/null +++ b/tests/baselines/reference/systemModule8.types @@ -0,0 +1,143 @@ +=== tests/cases/compiler/systemModule8.ts === + +export var x; +>x : any + +x = 1; +>x = 1 : number +>x : any +>1 : number + +x++; +>x++ : number +>x : any + +x--; +>x-- : number +>x : any + +++x; +>++x : number +>x : any + +--x; +>--x : number +>x : any + +x += 1; +>x += 1 : any +>x : any +>1 : number + +x -= 1; +>x -= 1 : number +>x : any +>1 : number + +x *= 1; +>x *= 1 : number +>x : any +>1 : number + +x /= 1; +>x /= 1 : number +>x : any +>1 : number + +x |= 1; +>x |= 1 : number +>x : any +>1 : number + +x &= 1; +>x &= 1 : number +>x : any +>1 : number + +x + 1; +>x + 1 : any +>x : any +>1 : number + +x - 1; +>x - 1 : number +>x : any +>1 : number + +x & 1; +>x & 1 : number +>x : any +>1 : number + +x | 1; +>x | 1 : number +>x : any +>1 : number + +for (x = 5;;x++) {} +>x = 5 : number +>x : any +>5 : number +>x++ : number +>x : any + +for (x = 8;;x--) {} +>x = 8 : number +>x : any +>8 : number +>x-- : number +>x : any + +for (x = 15;;++x) {} +>x = 15 : number +>x : any +>15 : number +>++x : number +>x : any + +for (x = 18;;--x) {} +>x = 18 : number +>x : any +>18 : number +>--x : number +>x : any + +for (let x = 50;;) {} +>x : number +>50 : number + +function foo() { +>foo : () => void + + x = 100; +>x = 100 : number +>x : any +>100 : number +} + +export let [y] = [1]; +>y : number +>[1] : [number] +>1 : number + +export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; +>a : any +>z0 : boolean +>b : any +>c : any +>z1 : string +>{a: true, b: {c: "123"}} : { a: boolean; b: { c: string; }; } +>a : boolean +>true : boolean +>b : { c: string; } +>{c: "123"} : { c: string; } +>c : string +>"123" : string + +for ([x] of [[1]]) {} +>[x] : any[] +>x : any +>[[1]] : number[][] +>[1] : number[] +>1 : number + diff --git a/tests/baselines/reference/throwInEnclosingStatements.errors.txt b/tests/baselines/reference/throwInEnclosingStatements.errors.txt deleted file mode 100644 index 1d225a45fe835..0000000000000 --- a/tests/baselines/reference/throwInEnclosingStatements.errors.txt +++ /dev/null @@ -1,52 +0,0 @@ -tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts(15,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts (1 errors) ==== - function fn(x) { - throw x; - } - - (x: T) => { throw x; } - - var y: string; - switch (y) { - case 'a': - throw y; - default: - throw y; - } - - var z = 0; - ~~~ -!!! error TS7027: Unreachable code detected. - while (z < 10) { - throw z; - } - - for (var i = 0; ;) { throw i; } - - for (var idx in {}) { throw idx; } - - do { throw null; }while(true) - - var j = 0; - while (j < 0) { throw j; } - - class C { - private value: T; - biz() { - throw this.value; - } - - constructor() { - throw this; - } - } - - var aa = { - id:12, - biz() { - throw this; - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/throwInEnclosingStatements.js b/tests/baselines/reference/throwInEnclosingStatements.js index 0b072434f3365..4d9200776e7de 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.js +++ b/tests/baselines/reference/throwInEnclosingStatements.js @@ -1,4 +1,5 @@ //// [throwInEnclosingStatements.ts] + function fn(x) { throw x; } diff --git a/tests/baselines/reference/throwInEnclosingStatements.symbols b/tests/baselines/reference/throwInEnclosingStatements.symbols new file mode 100644 index 0000000000000..42053c60efa06 --- /dev/null +++ b/tests/baselines/reference/throwInEnclosingStatements.symbols @@ -0,0 +1,94 @@ +=== tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts === + +function fn(x) { +>fn : Symbol(fn, Decl(throwInEnclosingStatements.ts, 0, 0)) +>x : Symbol(x, Decl(throwInEnclosingStatements.ts, 1, 12)) + + throw x; +>x : Symbol(x, Decl(throwInEnclosingStatements.ts, 1, 12)) +} + +(x: T) => { throw x; } +>T : Symbol(T, Decl(throwInEnclosingStatements.ts, 5, 1)) +>x : Symbol(x, Decl(throwInEnclosingStatements.ts, 5, 4)) +>T : Symbol(T, Decl(throwInEnclosingStatements.ts, 5, 1)) +>x : Symbol(x, Decl(throwInEnclosingStatements.ts, 5, 4)) + +var y: string; +>y : Symbol(y, Decl(throwInEnclosingStatements.ts, 7, 3)) + +switch (y) { +>y : Symbol(y, Decl(throwInEnclosingStatements.ts, 7, 3)) + + case 'a': + throw y; +>y : Symbol(y, Decl(throwInEnclosingStatements.ts, 7, 3)) + + default: + throw y; +>y : Symbol(y, Decl(throwInEnclosingStatements.ts, 7, 3)) +} + +var z = 0; +>z : Symbol(z, Decl(throwInEnclosingStatements.ts, 15, 3)) + +while (z < 10) { +>z : Symbol(z, Decl(throwInEnclosingStatements.ts, 15, 3)) + + throw z; +>z : Symbol(z, Decl(throwInEnclosingStatements.ts, 15, 3)) +} + +for (var i = 0; ;) { throw i; } +>i : Symbol(i, Decl(throwInEnclosingStatements.ts, 20, 8)) +>i : Symbol(i, Decl(throwInEnclosingStatements.ts, 20, 8)) + +for (var idx in {}) { throw idx; } +>idx : Symbol(idx, Decl(throwInEnclosingStatements.ts, 22, 8)) +>idx : Symbol(idx, Decl(throwInEnclosingStatements.ts, 22, 8)) + +do { throw null; }while(true) + +var j = 0; +>j : Symbol(j, Decl(throwInEnclosingStatements.ts, 26, 3)) + +while (j < 0) { throw j; } +>j : Symbol(j, Decl(throwInEnclosingStatements.ts, 26, 3)) +>j : Symbol(j, Decl(throwInEnclosingStatements.ts, 26, 3)) + +class C { +>C : Symbol(C, Decl(throwInEnclosingStatements.ts, 27, 26)) +>T : Symbol(T, Decl(throwInEnclosingStatements.ts, 29, 8)) + + private value: T; +>value : Symbol(value, Decl(throwInEnclosingStatements.ts, 29, 12)) +>T : Symbol(T, Decl(throwInEnclosingStatements.ts, 29, 8)) + + biz() { +>biz : Symbol(biz, Decl(throwInEnclosingStatements.ts, 30, 21)) + + throw this.value; +>this.value : Symbol(value, Decl(throwInEnclosingStatements.ts, 29, 12)) +>this : Symbol(C, Decl(throwInEnclosingStatements.ts, 27, 26)) +>value : Symbol(value, Decl(throwInEnclosingStatements.ts, 29, 12)) + } + + constructor() { + throw this; +>this : Symbol(C, Decl(throwInEnclosingStatements.ts, 27, 26)) + } +} + +var aa = { +>aa : Symbol(aa, Decl(throwInEnclosingStatements.ts, 40, 3)) + + id:12, +>id : Symbol(id, Decl(throwInEnclosingStatements.ts, 40, 10)) + + biz() { +>biz : Symbol(biz, Decl(throwInEnclosingStatements.ts, 41, 10)) + + throw this; + } +} + diff --git a/tests/baselines/reference/throwInEnclosingStatements.types b/tests/baselines/reference/throwInEnclosingStatements.types new file mode 100644 index 0000000000000..568fd800e353f --- /dev/null +++ b/tests/baselines/reference/throwInEnclosingStatements.types @@ -0,0 +1,110 @@ +=== tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts === + +function fn(x) { +>fn : (x: any) => void +>x : any + + throw x; +>x : any +} + +(x: T) => { throw x; } +>(x: T) => { throw x; } : (x: T) => void +>T : T +>x : T +>T : T +>x : T + +var y: string; +>y : string + +switch (y) { +>y : string + + case 'a': +>'a' : string + + throw y; +>y : string + + default: + throw y; +>y : string +} + +var z = 0; +>z : number +>0 : number + +while (z < 10) { +>z < 10 : boolean +>z : number +>10 : number + + throw z; +>z : number +} + +for (var i = 0; ;) { throw i; } +>i : number +>0 : number +>i : number + +for (var idx in {}) { throw idx; } +>idx : any +>{} : {} +>idx : any + +do { throw null; }while(true) +>null : null +>true : boolean + +var j = 0; +>j : number +>0 : number + +while (j < 0) { throw j; } +>j < 0 : boolean +>j : number +>0 : number +>j : number + +class C { +>C : C +>T : T + + private value: T; +>value : T +>T : T + + biz() { +>biz : () => void + + throw this.value; +>this.value : T +>this : this +>value : T + } + + constructor() { + throw this; +>this : this + } +} + +var aa = { +>aa : { id: number; biz(): void; } +>{ id:12, biz() { throw this; }} : { id: number; biz(): void; } + + id:12, +>id : number +>12 : number + + biz() { +>biz : () => void + + throw this; +>this : any + } +} + diff --git a/tests/baselines/reference/throwStatements.errors.txt b/tests/baselines/reference/throwStatements.errors.txt deleted file mode 100644 index e2e15bd503a27..0000000000000 --- a/tests/baselines/reference/throwStatements.errors.txt +++ /dev/null @@ -1,91 +0,0 @@ -tests/cases/conformance/statements/throwStatements/throwStatements.ts(29,1): error TS7027: Unreachable code detected. - - -==== tests/cases/conformance/statements/throwStatements/throwStatements.ts (1 errors) ==== - // all legal - - interface I { - id: number; - } - - class C implements I { - id: number; - } - - class D{ - source: T; - recurse: D; - wrapped: D> - } - - function F(x: string): number { return 42; } - - module M { - export class A { - name: string; - } - - export function F2(x: number): string { return x.toString(); } - } - - var aNumber = 9.9; - throw aNumber; - var aString = 'this is a string'; - ~~~ -!!! error TS7027: Unreachable code detected. - throw aString; - var aDate = new Date(12); - throw aDate; - var anObject = new Object(); - throw anObject; - - var anAny = null; - throw anAny; - var anOtherAny = new C(); - throw anOtherAny; - var anUndefined = undefined; - throw anUndefined; - - var aClass = new C(); - throw aClass; - var aGenericClass = new D(); - throw aGenericClass; - var anObjectLiteral = { id: 12 }; - throw anObjectLiteral; - - var aFunction = F; - throw aFunction; - throw aFunction(''); - var aLambda = (x) => 2; - throw aLambda; - throw aLambda(1); - - var aModule = M; - throw aModule; - throw typeof M; - var aClassInModule = new M.A(); - throw aClassInModule; - var aFunctionInModule = M.F2; - throw aFunctionInModule; - - // no initializer or annotation, so this is an 'any' - var x; - throw x; - - // literals - throw 0.0; - throw false; - throw null; - throw undefined; - throw 'a string'; - throw function () { return 'a string' }; - throw (x:T) => 42; - throw { x: 12, y: 13 }; - throw []; - throw ['a', ['b']]; - throw /[a-z]/; - throw new Date(); - throw new C(); - throw new Object(); - throw new D(); - \ No newline at end of file diff --git a/tests/baselines/reference/throwStatements.js b/tests/baselines/reference/throwStatements.js index 83663d08cc481..556ebc55e37b4 100644 --- a/tests/baselines/reference/throwStatements.js +++ b/tests/baselines/reference/throwStatements.js @@ -1,4 +1,5 @@ //// [throwStatements.ts] + // all legal interface I { diff --git a/tests/baselines/reference/throwStatements.symbols b/tests/baselines/reference/throwStatements.symbols new file mode 100644 index 0000000000000..adf9cb461cf8c --- /dev/null +++ b/tests/baselines/reference/throwStatements.symbols @@ -0,0 +1,216 @@ +=== tests/cases/conformance/statements/throwStatements/throwStatements.ts === + +// all legal + +interface I { +>I : Symbol(I, Decl(throwStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(throwStatements.ts, 3, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(throwStatements.ts, 5, 1)) +>I : Symbol(I, Decl(throwStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(throwStatements.ts, 7, 22)) +} + +class D{ +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) +>T : Symbol(T, Decl(throwStatements.ts, 11, 8)) + + source: T; +>source : Symbol(source, Decl(throwStatements.ts, 11, 11)) +>T : Symbol(T, Decl(throwStatements.ts, 11, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(throwStatements.ts, 12, 14)) +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) +>T : Symbol(T, Decl(throwStatements.ts, 11, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(throwStatements.ts, 13, 18)) +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) +>T : Symbol(T, Decl(throwStatements.ts, 11, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(throwStatements.ts, 15, 1)) +>x : Symbol(x, Decl(throwStatements.ts, 17, 11)) + +module M { +>M : Symbol(M, Decl(throwStatements.ts, 17, 44)) + + export class A { +>A : Symbol(A, Decl(throwStatements.ts, 19, 10)) + + name: string; +>name : Symbol(name, Decl(throwStatements.ts, 20, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(throwStatements.ts, 22, 5)) +>x : Symbol(x, Decl(throwStatements.ts, 24, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(throwStatements.ts, 24, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +} + +var aNumber = 9.9; +>aNumber : Symbol(aNumber, Decl(throwStatements.ts, 27, 3)) + +throw aNumber; +>aNumber : Symbol(aNumber, Decl(throwStatements.ts, 27, 3)) + +var aString = 'this is a string'; +>aString : Symbol(aString, Decl(throwStatements.ts, 29, 3)) + +throw aString; +>aString : Symbol(aString, Decl(throwStatements.ts, 29, 3)) + +var aDate = new Date(12); +>aDate : Symbol(aDate, Decl(throwStatements.ts, 31, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +throw aDate; +>aDate : Symbol(aDate, Decl(throwStatements.ts, 31, 3)) + +var anObject = new Object(); +>anObject : Symbol(anObject, Decl(throwStatements.ts, 33, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +throw anObject; +>anObject : Symbol(anObject, Decl(throwStatements.ts, 33, 3)) + +var anAny = null; +>anAny : Symbol(anAny, Decl(throwStatements.ts, 36, 3)) + +throw anAny; +>anAny : Symbol(anAny, Decl(throwStatements.ts, 36, 3)) + +var anOtherAny = new C(); +>anOtherAny : Symbol(anOtherAny, Decl(throwStatements.ts, 38, 3)) +>C : Symbol(C, Decl(throwStatements.ts, 5, 1)) + +throw anOtherAny; +>anOtherAny : Symbol(anOtherAny, Decl(throwStatements.ts, 38, 3)) + +var anUndefined = undefined; +>anUndefined : Symbol(anUndefined, Decl(throwStatements.ts, 40, 3)) +>undefined : Symbol(undefined) + +throw anUndefined; +>anUndefined : Symbol(anUndefined, Decl(throwStatements.ts, 40, 3)) + +var aClass = new C(); +>aClass : Symbol(aClass, Decl(throwStatements.ts, 43, 3)) +>C : Symbol(C, Decl(throwStatements.ts, 5, 1)) + +throw aClass; +>aClass : Symbol(aClass, Decl(throwStatements.ts, 43, 3)) + +var aGenericClass = new D(); +>aGenericClass : Symbol(aGenericClass, Decl(throwStatements.ts, 45, 3)) +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) + +throw aGenericClass; +>aGenericClass : Symbol(aGenericClass, Decl(throwStatements.ts, 45, 3)) + +var anObjectLiteral = { id: 12 }; +>anObjectLiteral : Symbol(anObjectLiteral, Decl(throwStatements.ts, 47, 3)) +>id : Symbol(id, Decl(throwStatements.ts, 47, 23)) + +throw anObjectLiteral; +>anObjectLiteral : Symbol(anObjectLiteral, Decl(throwStatements.ts, 47, 3)) + +var aFunction = F; +>aFunction : Symbol(aFunction, Decl(throwStatements.ts, 50, 3)) +>F : Symbol(F, Decl(throwStatements.ts, 15, 1)) + +throw aFunction; +>aFunction : Symbol(aFunction, Decl(throwStatements.ts, 50, 3)) + +throw aFunction(''); +>aFunction : Symbol(aFunction, Decl(throwStatements.ts, 50, 3)) + +var aLambda = (x) => 2; +>aLambda : Symbol(aLambda, Decl(throwStatements.ts, 53, 3)) +>x : Symbol(x, Decl(throwStatements.ts, 53, 15)) + +throw aLambda; +>aLambda : Symbol(aLambda, Decl(throwStatements.ts, 53, 3)) + +throw aLambda(1); +>aLambda : Symbol(aLambda, Decl(throwStatements.ts, 53, 3)) + +var aModule = M; +>aModule : Symbol(aModule, Decl(throwStatements.ts, 57, 3)) +>M : Symbol(M, Decl(throwStatements.ts, 17, 44)) + +throw aModule; +>aModule : Symbol(aModule, Decl(throwStatements.ts, 57, 3)) + +throw typeof M; +>M : Symbol(M, Decl(throwStatements.ts, 17, 44)) + +var aClassInModule = new M.A(); +>aClassInModule : Symbol(aClassInModule, Decl(throwStatements.ts, 60, 3)) +>M.A : Symbol(M.A, Decl(throwStatements.ts, 19, 10)) +>M : Symbol(M, Decl(throwStatements.ts, 17, 44)) +>A : Symbol(M.A, Decl(throwStatements.ts, 19, 10)) + +throw aClassInModule; +>aClassInModule : Symbol(aClassInModule, Decl(throwStatements.ts, 60, 3)) + +var aFunctionInModule = M.F2; +>aFunctionInModule : Symbol(aFunctionInModule, Decl(throwStatements.ts, 62, 3)) +>M.F2 : Symbol(M.F2, Decl(throwStatements.ts, 22, 5)) +>M : Symbol(M, Decl(throwStatements.ts, 17, 44)) +>F2 : Symbol(M.F2, Decl(throwStatements.ts, 22, 5)) + +throw aFunctionInModule; +>aFunctionInModule : Symbol(aFunctionInModule, Decl(throwStatements.ts, 62, 3)) + +// no initializer or annotation, so this is an 'any' +var x; +>x : Symbol(x, Decl(throwStatements.ts, 66, 3)) + +throw x; +>x : Symbol(x, Decl(throwStatements.ts, 66, 3)) + +// literals +throw 0.0; +throw false; +throw null; +throw undefined; +>undefined : Symbol(undefined) + +throw 'a string'; +throw function () { return 'a string' }; +throw (x:T) => 42; +>T : Symbol(T, Decl(throwStatements.ts, 76, 7)) +>x : Symbol(x, Decl(throwStatements.ts, 76, 10)) +>T : Symbol(T, Decl(throwStatements.ts, 76, 7)) + +throw { x: 12, y: 13 }; +>x : Symbol(x, Decl(throwStatements.ts, 77, 7)) +>y : Symbol(y, Decl(throwStatements.ts, 77, 14)) + +throw []; +throw ['a', ['b']]; +throw /[a-z]/; +throw new Date(); +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +throw new C(); +>C : Symbol(C, Decl(throwStatements.ts, 5, 1)) + +throw new Object(); +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +throw new D(); +>D : Symbol(D, Decl(throwStatements.ts, 9, 1)) + diff --git a/tests/baselines/reference/throwStatements.types b/tests/baselines/reference/throwStatements.types new file mode 100644 index 0000000000000..5023513ee5372 --- /dev/null +++ b/tests/baselines/reference/throwStatements.types @@ -0,0 +1,267 @@ +=== tests/cases/conformance/statements/throwStatements/throwStatements.ts === + +// all legal + +interface I { +>I : I + + id: number; +>id : number +} + +class C implements I { +>C : C +>I : I + + id: number; +>id : number +} + +class D{ +>D : D +>T : T + + source: T; +>source : T +>T : T + + recurse: D; +>recurse : D +>D : D +>T : T + + wrapped: D> +>wrapped : D> +>D : D +>D : D +>T : T +} + +function F(x: string): number { return 42; } +>F : (x: string) => number +>x : string +>42 : number + +module M { +>M : typeof M + + export class A { +>A : A + + name: string; +>name : string + } + + export function F2(x: number): string { return x.toString(); } +>F2 : (x: number) => string +>x : number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string +} + +var aNumber = 9.9; +>aNumber : number +>9.9 : number + +throw aNumber; +>aNumber : number + +var aString = 'this is a string'; +>aString : string +>'this is a string' : string + +throw aString; +>aString : string + +var aDate = new Date(12); +>aDate : Date +>new Date(12) : Date +>Date : DateConstructor +>12 : number + +throw aDate; +>aDate : Date + +var anObject = new Object(); +>anObject : Object +>new Object() : Object +>Object : ObjectConstructor + +throw anObject; +>anObject : Object + +var anAny = null; +>anAny : any +>null : null + +throw anAny; +>anAny : any + +var anOtherAny = new C(); +>anOtherAny : any +> new C() : any +>new C() : C +>C : typeof C + +throw anOtherAny; +>anOtherAny : any + +var anUndefined = undefined; +>anUndefined : any +>undefined : undefined + +throw anUndefined; +>anUndefined : any + +var aClass = new C(); +>aClass : C +>new C() : C +>C : typeof C + +throw aClass; +>aClass : C + +var aGenericClass = new D(); +>aGenericClass : D +>new D() : D +>D : typeof D + +throw aGenericClass; +>aGenericClass : D + +var anObjectLiteral = { id: 12 }; +>anObjectLiteral : { id: number; } +>{ id: 12 } : { id: number; } +>id : number +>12 : number + +throw anObjectLiteral; +>anObjectLiteral : { id: number; } + +var aFunction = F; +>aFunction : (x: string) => number +>F : (x: string) => number + +throw aFunction; +>aFunction : (x: string) => number + +throw aFunction(''); +>aFunction('') : number +>aFunction : (x: string) => number +>'' : string + +var aLambda = (x) => 2; +>aLambda : (x: any) => number +>(x) => 2 : (x: any) => number +>x : any +>2 : number + +throw aLambda; +>aLambda : (x: any) => number + +throw aLambda(1); +>aLambda(1) : number +>aLambda : (x: any) => number +>1 : number + +var aModule = M; +>aModule : typeof M +>M : typeof M + +throw aModule; +>aModule : typeof M + +throw typeof M; +>typeof M : string +>M : typeof M + +var aClassInModule = new M.A(); +>aClassInModule : M.A +>new M.A() : M.A +>M.A : typeof M.A +>M : typeof M +>A : typeof M.A + +throw aClassInModule; +>aClassInModule : M.A + +var aFunctionInModule = M.F2; +>aFunctionInModule : (x: number) => string +>M.F2 : (x: number) => string +>M : typeof M +>F2 : (x: number) => string + +throw aFunctionInModule; +>aFunctionInModule : (x: number) => string + +// no initializer or annotation, so this is an 'any' +var x; +>x : any + +throw x; +>x : any + +// literals +throw 0.0; +>0.0 : number + +throw false; +>false : boolean + +throw null; +>null : null + +throw undefined; +>undefined : undefined + +throw 'a string'; +>'a string' : string + +throw function () { return 'a string' }; +>function () { return 'a string' } : () => string +>'a string' : string + +throw (x:T) => 42; +>(x:T) => 42 : (x: T) => number +>T : T +>x : T +>T : T +>42 : number + +throw { x: 12, y: 13 }; +>{ x: 12, y: 13 } : { x: number; y: number; } +>x : number +>12 : number +>y : number +>13 : number + +throw []; +>[] : undefined[] + +throw ['a', ['b']]; +>['a', ['b']] : (string | string[])[] +>'a' : string +>['b'] : string[] +>'b' : string + +throw /[a-z]/; +>/[a-z]/ : RegExp + +throw new Date(); +>new Date() : Date +>Date : DateConstructor + +throw new C(); +>new C() : C +>C : typeof C + +throw new Object(); +>new Object() : Object +>Object : ObjectConstructor + +throw new D(); +>new D() : D +>D : typeof D + diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt deleted file mode 100644 index 9c4e249566056..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt +++ /dev/null @@ -1,59 +0,0 @@ -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(44,1): error TS7028: Unused label. -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(45,1): error TS7028: Unused label. - - -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts (2 errors) ==== - // typeof operator on boolean type - var BOOLEAN: boolean; - - function foo(): boolean { return true; } - - class A { - public a: boolean; - static foo() { return false; } - } - module M { - export var n: boolean; - } - - var objA = new A(); - - // boolean type var - var ResultIsString1 = typeof BOOLEAN; - - // boolean type literal - var ResultIsString2 = typeof true; - var ResultIsString3 = typeof { x: true, y: false }; - - // boolean type expressions - var ResultIsString4 = typeof objA.a; - var ResultIsString5 = typeof M.n; - var ResultIsString6 = typeof foo(); - var ResultIsString7 = typeof A.foo(); - - // multiple typeof operator - var ResultIsString8 = typeof typeof BOOLEAN; - - // miss assignment operators - typeof true; - typeof BOOLEAN; - typeof foo(); - typeof true, false; - typeof objA.a; - typeof M.n; - - // use typeof in type query - var z: boolean; - var x: boolean[]; - var r: () => boolean; - z: typeof BOOLEAN; - ~ -!!! error TS7028: Unused label. - r: typeof foo; - ~ -!!! error TS7028: Unused label. - var y = { a: true, b: false}; - z: typeof y.a; - z: typeof objA.a; - z: typeof A.foo; - z: typeof M.n; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.js b/tests/baselines/reference/typeofOperatorWithBooleanType.js index c0538b78b1448..b9db33b11a4bb 100644 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.js +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.js @@ -1,4 +1,5 @@ //// [typeofOperatorWithBooleanType.ts] + // typeof operator on boolean type var BOOLEAN: boolean; diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.symbols b/tests/baselines/reference/typeofOperatorWithBooleanType.symbols new file mode 100644 index 0000000000000..0167a14ae03ff --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.symbols @@ -0,0 +1,131 @@ +=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts === + +// typeof operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 2, 3)) + +function foo(): boolean { return true; } +>foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 2, 21)) + +class A { +>A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 4, 40)) + + public a: boolean; +>a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) + + static foo() { return false; } +>foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 7, 22)) +} +module M { +>M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 9, 1)) + + export var n: boolean; +>n : Symbol(n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 14, 3)) +>A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 4, 40)) + +// boolean type var +var ResultIsString1 = typeof BOOLEAN; +>ResultIsString1 : Symbol(ResultIsString1, Decl(typeofOperatorWithBooleanType.ts, 17, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 2, 3)) + +// boolean type literal +var ResultIsString2 = typeof true; +>ResultIsString2 : Symbol(ResultIsString2, Decl(typeofOperatorWithBooleanType.ts, 20, 3)) + +var ResultIsString3 = typeof { x: true, y: false }; +>ResultIsString3 : Symbol(ResultIsString3, Decl(typeofOperatorWithBooleanType.ts, 21, 3)) +>x : Symbol(x, Decl(typeofOperatorWithBooleanType.ts, 21, 30)) +>y : Symbol(y, Decl(typeofOperatorWithBooleanType.ts, 21, 39)) + +// boolean type expressions +var ResultIsString4 = typeof objA.a; +>ResultIsString4 : Symbol(ResultIsString4, Decl(typeofOperatorWithBooleanType.ts, 24, 3)) +>objA.a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) +>objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 14, 3)) +>a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) + +var ResultIsString5 = typeof M.n; +>ResultIsString5 : Symbol(ResultIsString5, Decl(typeofOperatorWithBooleanType.ts, 25, 3)) +>M.n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) +>M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 9, 1)) +>n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) + +var ResultIsString6 = typeof foo(); +>ResultIsString6 : Symbol(ResultIsString6, Decl(typeofOperatorWithBooleanType.ts, 26, 3)) +>foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 2, 21)) + +var ResultIsString7 = typeof A.foo(); +>ResultIsString7 : Symbol(ResultIsString7, Decl(typeofOperatorWithBooleanType.ts, 27, 3)) +>A.foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 7, 22)) +>A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 7, 22)) + +// multiple typeof operator +var ResultIsString8 = typeof typeof BOOLEAN; +>ResultIsString8 : Symbol(ResultIsString8, Decl(typeofOperatorWithBooleanType.ts, 30, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 2, 3)) + +// miss assignment operators +typeof true; +typeof BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 2, 3)) + +typeof foo(); +>foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 2, 21)) + +typeof true, false; +typeof objA.a; +>objA.a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) +>objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 14, 3)) +>a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) + +typeof M.n; +>M.n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) +>M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 9, 1)) +>n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) + +// use typeof in type query +var z: boolean; +>z : Symbol(z, Decl(typeofOperatorWithBooleanType.ts, 41, 3)) + +var x: boolean[]; +>x : Symbol(x, Decl(typeofOperatorWithBooleanType.ts, 42, 3)) + +var r: () => boolean; +>r : Symbol(r, Decl(typeofOperatorWithBooleanType.ts, 43, 3)) + +z: typeof BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(typeofOperatorWithBooleanType.ts, 2, 3)) + +r: typeof foo; +>foo : Symbol(foo, Decl(typeofOperatorWithBooleanType.ts, 2, 21)) + +var y = { a: true, b: false}; +>y : Symbol(y, Decl(typeofOperatorWithBooleanType.ts, 46, 3)) +>a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 46, 9)) +>b : Symbol(b, Decl(typeofOperatorWithBooleanType.ts, 46, 18)) + +z: typeof y.a; +>y.a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 46, 9)) +>y : Symbol(y, Decl(typeofOperatorWithBooleanType.ts, 46, 3)) +>a : Symbol(a, Decl(typeofOperatorWithBooleanType.ts, 46, 9)) + +z: typeof objA.a; +>objA.a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) +>objA : Symbol(objA, Decl(typeofOperatorWithBooleanType.ts, 14, 3)) +>a : Symbol(A.a, Decl(typeofOperatorWithBooleanType.ts, 6, 9)) + +z: typeof A.foo; +>A.foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 7, 22)) +>A : Symbol(A, Decl(typeofOperatorWithBooleanType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(typeofOperatorWithBooleanType.ts, 7, 22)) + +z: typeof M.n; +>M.n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) +>M : Symbol(M, Decl(typeofOperatorWithBooleanType.ts, 9, 1)) +>n : Symbol(M.n, Decl(typeofOperatorWithBooleanType.ts, 11, 14)) + diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.types b/tests/baselines/reference/typeofOperatorWithBooleanType.types new file mode 100644 index 0000000000000..043307cfb0051 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.types @@ -0,0 +1,177 @@ +=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts === + +// typeof operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : boolean + +function foo(): boolean { return true; } +>foo : () => boolean +>true : boolean + +class A { +>A : A + + public a: boolean; +>a : boolean + + static foo() { return false; } +>foo : () => boolean +>false : boolean +} +module M { +>M : typeof M + + export var n: boolean; +>n : boolean +} + +var objA = new A(); +>objA : A +>new A() : A +>A : typeof A + +// boolean type var +var ResultIsString1 = typeof BOOLEAN; +>ResultIsString1 : string +>typeof BOOLEAN : string +>BOOLEAN : boolean + +// boolean type literal +var ResultIsString2 = typeof true; +>ResultIsString2 : string +>typeof true : string +>true : boolean + +var ResultIsString3 = typeof { x: true, y: false }; +>ResultIsString3 : string +>typeof { x: true, y: false } : string +>{ x: true, y: false } : { x: boolean; y: boolean; } +>x : boolean +>true : boolean +>y : boolean +>false : boolean + +// boolean type expressions +var ResultIsString4 = typeof objA.a; +>ResultIsString4 : string +>typeof objA.a : string +>objA.a : boolean +>objA : A +>a : boolean + +var ResultIsString5 = typeof M.n; +>ResultIsString5 : string +>typeof M.n : string +>M.n : boolean +>M : typeof M +>n : boolean + +var ResultIsString6 = typeof foo(); +>ResultIsString6 : string +>typeof foo() : string +>foo() : boolean +>foo : () => boolean + +var ResultIsString7 = typeof A.foo(); +>ResultIsString7 : string +>typeof A.foo() : string +>A.foo() : boolean +>A.foo : () => boolean +>A : typeof A +>foo : () => boolean + +// multiple typeof operator +var ResultIsString8 = typeof typeof BOOLEAN; +>ResultIsString8 : string +>typeof typeof BOOLEAN : string +>typeof BOOLEAN : string +>BOOLEAN : boolean + +// miss assignment operators +typeof true; +>typeof true : string +>true : boolean + +typeof BOOLEAN; +>typeof BOOLEAN : string +>BOOLEAN : boolean + +typeof foo(); +>typeof foo() : string +>foo() : boolean +>foo : () => boolean + +typeof true, false; +>typeof true, false : boolean +>typeof true : string +>true : boolean +>false : boolean + +typeof objA.a; +>typeof objA.a : string +>objA.a : boolean +>objA : A +>a : boolean + +typeof M.n; +>typeof M.n : string +>M.n : boolean +>M : typeof M +>n : boolean + +// use typeof in type query +var z: boolean; +>z : boolean + +var x: boolean[]; +>x : boolean[] + +var r: () => boolean; +>r : () => boolean + +z: typeof BOOLEAN; +>z : any +>typeof BOOLEAN : string +>BOOLEAN : boolean + +r: typeof foo; +>r : any +>typeof foo : string +>foo : () => boolean + +var y = { a: true, b: false}; +>y : { a: boolean; b: boolean; } +>{ a: true, b: false} : { a: boolean; b: boolean; } +>a : boolean +>true : boolean +>b : boolean +>false : boolean + +z: typeof y.a; +>z : any +>typeof y.a : string +>y.a : boolean +>y : { a: boolean; b: boolean; } +>a : boolean + +z: typeof objA.a; +>z : any +>typeof objA.a : string +>objA.a : boolean +>objA : A +>a : boolean + +z: typeof A.foo; +>z : any +>typeof A.foo : string +>A.foo : () => boolean +>A : typeof A +>foo : () => boolean + +z: typeof M.n; +>z : any +>typeof M.n : string +>M.n : boolean +>M : typeof M +>n : boolean + diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt deleted file mode 100644 index 6e473b7487d68..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt +++ /dev/null @@ -1,33 +0,0 @@ -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts(26,1): error TS7028: Unused label. - - -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts (1 errors) ==== - // typeof operator on enum type - - enum ENUM { }; - enum ENUM1 { A, B, "" }; - - // enum type var - var ResultIsString1 = typeof ENUM; - var ResultIsString2 = typeof ENUM1; - - // enum type expressions - var ResultIsString3 = typeof ENUM1["A"]; - var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); - - // multiple typeof operators - var ResultIsString5 = typeof typeof ENUM; - var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); - - // miss assignment operators - typeof ENUM; - typeof ENUM1; - typeof ENUM1["B"]; - typeof ENUM, ENUM1; - - // use typeof in type query - enum z { }; - z: typeof ENUM; - ~ -!!! error TS7028: Unused label. - z: typeof ENUM1; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.js b/tests/baselines/reference/typeofOperatorWithEnumType.js index 2e2963b0955aa..2ce326681862b 100644 --- a/tests/baselines/reference/typeofOperatorWithEnumType.js +++ b/tests/baselines/reference/typeofOperatorWithEnumType.js @@ -1,4 +1,5 @@ //// [typeofOperatorWithEnumType.ts] + // typeof operator on enum type enum ENUM { }; diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.symbols b/tests/baselines/reference/typeofOperatorWithEnumType.symbols new file mode 100644 index 0000000000000..a8e3d6d351f00 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithEnumType.symbols @@ -0,0 +1,70 @@ +=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts === + +// typeof operator on enum type + +enum ENUM { }; +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) + +enum ENUM1 { A, B, "" }; +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) +>A : Symbol(ENUM1.A, Decl(typeofOperatorWithEnumType.ts, 4, 12)) +>B : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 4, 15)) + +// enum type var +var ResultIsString1 = typeof ENUM; +>ResultIsString1 : Symbol(ResultIsString1, Decl(typeofOperatorWithEnumType.ts, 7, 3)) +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) + +var ResultIsString2 = typeof ENUM1; +>ResultIsString2 : Symbol(ResultIsString2, Decl(typeofOperatorWithEnumType.ts, 8, 3)) +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) + +// enum type expressions +var ResultIsString3 = typeof ENUM1["A"]; +>ResultIsString3 : Symbol(ResultIsString3, Decl(typeofOperatorWithEnumType.ts, 11, 3)) +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) +>"A" : Symbol(ENUM1.A, Decl(typeofOperatorWithEnumType.ts, 4, 12)) + +var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); +>ResultIsString4 : Symbol(ResultIsString4, Decl(typeofOperatorWithEnumType.ts, 12, 3)) +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) +>"B" : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 4, 15)) + +// multiple typeof operators +var ResultIsString5 = typeof typeof ENUM; +>ResultIsString5 : Symbol(ResultIsString5, Decl(typeofOperatorWithEnumType.ts, 15, 3)) +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) + +var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); +>ResultIsString6 : Symbol(ResultIsString6, Decl(typeofOperatorWithEnumType.ts, 16, 3)) +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) +>ENUM1.B : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 4, 15)) +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) +>B : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 4, 15)) + +// miss assignment operators +typeof ENUM; +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) + +typeof ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) + +typeof ENUM1["B"]; +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) +>"B" : Symbol(ENUM1.B, Decl(typeofOperatorWithEnumType.ts, 4, 15)) + +typeof ENUM, ENUM1; +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) + +// use typeof in type query +enum z { }; +>z : Symbol(z, Decl(typeofOperatorWithEnumType.ts, 22, 19)) + +z: typeof ENUM; +>ENUM : Symbol(ENUM, Decl(typeofOperatorWithEnumType.ts, 0, 0)) + +z: typeof ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(typeofOperatorWithEnumType.ts, 3, 14)) + diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.types b/tests/baselines/reference/typeofOperatorWithEnumType.types new file mode 100644 index 0000000000000..f9224811393c5 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithEnumType.types @@ -0,0 +1,99 @@ +=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts === + +// typeof operator on enum type + +enum ENUM { }; +>ENUM : ENUM + +enum ENUM1 { A, B, "" }; +>ENUM1 : ENUM1 +>A : ENUM1 +>B : ENUM1 + +// enum type var +var ResultIsString1 = typeof ENUM; +>ResultIsString1 : string +>typeof ENUM : string +>ENUM : typeof ENUM + +var ResultIsString2 = typeof ENUM1; +>ResultIsString2 : string +>typeof ENUM1 : string +>ENUM1 : typeof ENUM1 + +// enum type expressions +var ResultIsString3 = typeof ENUM1["A"]; +>ResultIsString3 : string +>typeof ENUM1["A"] : string +>ENUM1["A"] : ENUM1 +>ENUM1 : typeof ENUM1 +>"A" : string + +var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); +>ResultIsString4 : string +>typeof (ENUM[0] + ENUM1["B"]) : string +>(ENUM[0] + ENUM1["B"]) : string +>ENUM[0] + ENUM1["B"] : string +>ENUM[0] : string +>ENUM : typeof ENUM +>0 : number +>ENUM1["B"] : ENUM1 +>ENUM1 : typeof ENUM1 +>"B" : string + +// multiple typeof operators +var ResultIsString5 = typeof typeof ENUM; +>ResultIsString5 : string +>typeof typeof ENUM : string +>typeof ENUM : string +>ENUM : typeof ENUM + +var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); +>ResultIsString6 : string +>typeof typeof typeof (ENUM[0] + ENUM1.B) : string +>typeof typeof (ENUM[0] + ENUM1.B) : string +>typeof (ENUM[0] + ENUM1.B) : string +>(ENUM[0] + ENUM1.B) : string +>ENUM[0] + ENUM1.B : string +>ENUM[0] : string +>ENUM : typeof ENUM +>0 : number +>ENUM1.B : ENUM1 +>ENUM1 : typeof ENUM1 +>B : ENUM1 + +// miss assignment operators +typeof ENUM; +>typeof ENUM : string +>ENUM : typeof ENUM + +typeof ENUM1; +>typeof ENUM1 : string +>ENUM1 : typeof ENUM1 + +typeof ENUM1["B"]; +>typeof ENUM1["B"] : string +>ENUM1["B"] : ENUM1 +>ENUM1 : typeof ENUM1 +>"B" : string + +typeof ENUM, ENUM1; +>typeof ENUM, ENUM1 : typeof ENUM1 +>typeof ENUM : string +>ENUM : typeof ENUM +>ENUM1 : typeof ENUM1 + +// use typeof in type query +enum z { }; +>z : z + +z: typeof ENUM; +>z : any +>typeof ENUM : string +>ENUM : typeof ENUM + +z: typeof ENUM1; +>z : any +>typeof ENUM1 : string +>ENUM1 : typeof ENUM1 + diff --git a/tests/cases/compiler/commentsAtEndOfFile1.ts b/tests/cases/compiler/commentsAtEndOfFile1.ts index 8e37b2361a545..04c90b3433a6c 100644 --- a/tests/cases/compiler/commentsAtEndOfFile1.ts +++ b/tests/cases/compiler/commentsAtEndOfFile1.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + Input: ; //Testing two diff --git a/tests/cases/compiler/recursiveMods.ts b/tests/cases/compiler/recursiveMods.ts index fa07646ba72b6..84dbafff55829 100644 --- a/tests/cases/compiler/recursiveMods.ts +++ b/tests/cases/compiler/recursiveMods.ts @@ -1,4 +1,6 @@ -//@module: commonjs +// @allowUnreachableCode: true +// @module: commonjs + export module Foo { export class C {} } diff --git a/tests/cases/compiler/returnStatement1.ts b/tests/cases/compiler/returnStatement1.ts index e87635b37d7c1..06d1bdb956970 100644 --- a/tests/cases/compiler/returnStatement1.ts +++ b/tests/cases/compiler/returnStatement1.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + function f() { return function (s) { var x = s; diff --git a/tests/cases/compiler/sourceMapValidationLabeled.ts b/tests/cases/compiler/sourceMapValidationLabeled.ts index 5993e82aacc09..e36bdd9a0b340 100644 --- a/tests/cases/compiler/sourceMapValidationLabeled.ts +++ b/tests/cases/compiler/sourceMapValidationLabeled.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true // @sourcemap: true + x: var b = 10; \ No newline at end of file diff --git a/tests/cases/compiler/systemModule8.ts b/tests/cases/compiler/systemModule8.ts index c3e0c7c74373e..4490b2a85294f 100644 --- a/tests/cases/compiler/systemModule8.ts +++ b/tests/cases/compiler/systemModule8.ts @@ -1,3 +1,4 @@ +// @allowUnreachableCode: true // @module: system export var x; diff --git a/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts b/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts index 00460181c2b61..c22ed94087b6b 100644 --- a/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + // typeof operator on boolean type var BOOLEAN: boolean; diff --git a/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts b/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts index 9abb602db06bd..57b22e3646c1c 100644 --- a/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + // typeof operator on enum type enum ENUM { }; diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts b/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts index 9cef599692c30..64a9357706fb0 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts b/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts index 2c3eadca7dbcd..3e00bca659b90 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget4.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts b/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts index 26bea241a7a36..a7b47ff071bd6 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts b/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts index e00c222aa9ca7..5ba2bd69b1173 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget4.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target1: target2: while (true) { diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts b/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts index d4db9399ed232..d6add9804471f 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel3.ts @@ -1,3 +1,5 @@ +// @allowUnusedLabels: true + target: while (true) { function f() { diff --git a/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts b/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts index 2c62180a2ab69..bf7ea5c22c6a4 100644 --- a/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts +++ b/tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel4.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + target: while (true) { } diff --git a/tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts b/tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts index f5ce6ffa52fbd..3080a6b38a82a 100644 --- a/tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts +++ b/tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts @@ -1,3 +1,6 @@ +// @allowUnusedLabels: true +// @allowUnreachableCode: true + switch ('') { case 'a': break; diff --git a/tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts b/tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts index 4b9675f9d63b8..c5875327b50af 100644 --- a/tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts +++ b/tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + function fn(x) { throw x; } diff --git a/tests/cases/conformance/statements/throwStatements/throwStatements.ts b/tests/cases/conformance/statements/throwStatements/throwStatements.ts index 8d155cbc8cf16..07c09da93fc68 100644 --- a/tests/cases/conformance/statements/throwStatements/throwStatements.ts +++ b/tests/cases/conformance/statements/throwStatements/throwStatements.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // all legal interface I { From 55327781c2920d474f36fd9a3edaf9301e252283 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 13 Oct 2015 13:06:43 -0700 Subject: [PATCH 09/11] suppress reachability errors in remaining tests --- .../typeofOperatorWithNumberType.errors.txt | 69 ------ .../typeofOperatorWithNumberType.symbols | 168 +++++++++++++ .../typeofOperatorWithNumberType.types | 233 ++++++++++++++++++ .../typeofOperatorWithNumberType.ts | 1 + 4 files changed, 402 insertions(+), 69 deletions(-) delete mode 100644 tests/baselines/reference/typeofOperatorWithNumberType.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithNumberType.symbols create mode 100644 tests/baselines/reference/typeofOperatorWithNumberType.types diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt deleted file mode 100644 index b84d3798ab07c..0000000000000 --- a/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt +++ /dev/null @@ -1,69 +0,0 @@ -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(50,1): error TS7028: Unused label. -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(51,1): error TS7028: Unused label. -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(52,1): error TS7028: Unused label. - - -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts (3 errors) ==== - // typeof operator on number type - var NUMBER: number; - var NUMBER1: number[] = [1, 2]; - - function foo(): number { return 1; } - - class A { - public a: number; - static foo() { return 1; } - } - module M { - export var n: number; - } - - var objA = new A(); - - // number type var - var ResultIsString1 = typeof NUMBER; - var ResultIsString2 = typeof NUMBER1; - - // number type literal - var ResultIsString3 = typeof 1; - var ResultIsString4 = typeof { x: 1, y: 2}; - var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } }; - - // number type expressions - var ResultIsString6 = typeof objA.a; - var ResultIsString7 = typeof M.n; - var ResultIsString8 = typeof NUMBER1[0]; - var ResultIsString9 = typeof foo(); - var ResultIsString10 = typeof A.foo(); - var ResultIsString11 = typeof (NUMBER + NUMBER); - - // multiple typeof operators - var ResultIsString12 = typeof typeof NUMBER; - var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER); - - // miss assignment operators - typeof 1; - typeof NUMBER; - typeof NUMBER1; - typeof foo(); - typeof objA.a; - typeof M.n; - typeof objA.a, M.n; - - // use typeof in type query - var z: number; - var x: number[]; - z: typeof NUMBER; - ~ -!!! error TS7028: Unused label. - x: typeof NUMBER1; - ~ -!!! error TS7028: Unused label. - r: typeof foo; - ~ -!!! error TS7028: Unused label. - var y = { a: 1, b: 2 }; - z: typeof y.a; - z: typeof objA.a; - z: typeof A.foo; - z: typeof M.n; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.symbols b/tests/baselines/reference/typeofOperatorWithNumberType.symbols new file mode 100644 index 0000000000000..df49b7dccb6f0 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithNumberType.symbols @@ -0,0 +1,168 @@ +=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts === +// typeof operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(typeofOperatorWithNumberType.ts, 2, 3)) + +function foo(): number { return 1; } +>foo : Symbol(foo, Decl(typeofOperatorWithNumberType.ts, 2, 31)) + +class A { +>A : Symbol(A, Decl(typeofOperatorWithNumberType.ts, 4, 36)) + + public a: number; +>a : Symbol(a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) + + static foo() { return 1; } +>foo : Symbol(A.foo, Decl(typeofOperatorWithNumberType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(typeofOperatorWithNumberType.ts, 9, 1)) + + export var n: number; +>n : Symbol(n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(typeofOperatorWithNumberType.ts, 14, 3)) +>A : Symbol(A, Decl(typeofOperatorWithNumberType.ts, 4, 36)) + +// number type var +var ResultIsString1 = typeof NUMBER; +>ResultIsString1 : Symbol(ResultIsString1, Decl(typeofOperatorWithNumberType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) + +var ResultIsString2 = typeof NUMBER1; +>ResultIsString2 : Symbol(ResultIsString2, Decl(typeofOperatorWithNumberType.ts, 18, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(typeofOperatorWithNumberType.ts, 2, 3)) + +// number type literal +var ResultIsString3 = typeof 1; +>ResultIsString3 : Symbol(ResultIsString3, Decl(typeofOperatorWithNumberType.ts, 21, 3)) + +var ResultIsString4 = typeof { x: 1, y: 2}; +>ResultIsString4 : Symbol(ResultIsString4, Decl(typeofOperatorWithNumberType.ts, 22, 3)) +>x : Symbol(x, Decl(typeofOperatorWithNumberType.ts, 22, 30)) +>y : Symbol(y, Decl(typeofOperatorWithNumberType.ts, 22, 36)) + +var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } }; +>ResultIsString5 : Symbol(ResultIsString5, Decl(typeofOperatorWithNumberType.ts, 23, 3)) +>x : Symbol(x, Decl(typeofOperatorWithNumberType.ts, 23, 30)) +>y : Symbol(y, Decl(typeofOperatorWithNumberType.ts, 23, 36)) +>n : Symbol(n, Decl(typeofOperatorWithNumberType.ts, 23, 41)) +>n : Symbol(n, Decl(typeofOperatorWithNumberType.ts, 23, 41)) + +// number type expressions +var ResultIsString6 = typeof objA.a; +>ResultIsString6 : Symbol(ResultIsString6, Decl(typeofOperatorWithNumberType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(typeofOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) + +var ResultIsString7 = typeof M.n; +>ResultIsString7 : Symbol(ResultIsString7, Decl(typeofOperatorWithNumberType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(typeofOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) + +var ResultIsString8 = typeof NUMBER1[0]; +>ResultIsString8 : Symbol(ResultIsString8, Decl(typeofOperatorWithNumberType.ts, 28, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(typeofOperatorWithNumberType.ts, 2, 3)) + +var ResultIsString9 = typeof foo(); +>ResultIsString9 : Symbol(ResultIsString9, Decl(typeofOperatorWithNumberType.ts, 29, 3)) +>foo : Symbol(foo, Decl(typeofOperatorWithNumberType.ts, 2, 31)) + +var ResultIsString10 = typeof A.foo(); +>ResultIsString10 : Symbol(ResultIsString10, Decl(typeofOperatorWithNumberType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(typeofOperatorWithNumberType.ts, 7, 21)) +>A : Symbol(A, Decl(typeofOperatorWithNumberType.ts, 4, 36)) +>foo : Symbol(A.foo, Decl(typeofOperatorWithNumberType.ts, 7, 21)) + +var ResultIsString11 = typeof (NUMBER + NUMBER); +>ResultIsString11 : Symbol(ResultIsString11, Decl(typeofOperatorWithNumberType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) + +// multiple typeof operators +var ResultIsString12 = typeof typeof NUMBER; +>ResultIsString12 : Symbol(ResultIsString12, Decl(typeofOperatorWithNumberType.ts, 34, 3)) +>NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) + +var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER); +>ResultIsString13 : Symbol(ResultIsString13, Decl(typeofOperatorWithNumberType.ts, 35, 3)) +>NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) + +// miss assignment operators +typeof 1; +typeof NUMBER; +>NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) + +typeof NUMBER1; +>NUMBER1 : Symbol(NUMBER1, Decl(typeofOperatorWithNumberType.ts, 2, 3)) + +typeof foo(); +>foo : Symbol(foo, Decl(typeofOperatorWithNumberType.ts, 2, 31)) + +typeof objA.a; +>objA.a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(typeofOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) + +typeof M.n; +>M.n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(typeofOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) + +typeof objA.a, M.n; +>objA.a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(typeofOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(typeofOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) + +// use typeof in type query +var z: number; +>z : Symbol(z, Decl(typeofOperatorWithNumberType.ts, 47, 3)) + +var x: number[]; +>x : Symbol(x, Decl(typeofOperatorWithNumberType.ts, 48, 3)) + +z: typeof NUMBER; +>NUMBER : Symbol(NUMBER, Decl(typeofOperatorWithNumberType.ts, 1, 3)) + +x: typeof NUMBER1; +>NUMBER1 : Symbol(NUMBER1, Decl(typeofOperatorWithNumberType.ts, 2, 3)) + +r: typeof foo; +>foo : Symbol(foo, Decl(typeofOperatorWithNumberType.ts, 2, 31)) + +var y = { a: 1, b: 2 }; +>y : Symbol(y, Decl(typeofOperatorWithNumberType.ts, 52, 3)) +>a : Symbol(a, Decl(typeofOperatorWithNumberType.ts, 52, 9)) +>b : Symbol(b, Decl(typeofOperatorWithNumberType.ts, 52, 15)) + +z: typeof y.a; +>y.a : Symbol(a, Decl(typeofOperatorWithNumberType.ts, 52, 9)) +>y : Symbol(y, Decl(typeofOperatorWithNumberType.ts, 52, 3)) +>a : Symbol(a, Decl(typeofOperatorWithNumberType.ts, 52, 9)) + +z: typeof objA.a; +>objA.a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(typeofOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(typeofOperatorWithNumberType.ts, 6, 9)) + +z: typeof A.foo; +>A.foo : Symbol(A.foo, Decl(typeofOperatorWithNumberType.ts, 7, 21)) +>A : Symbol(A, Decl(typeofOperatorWithNumberType.ts, 4, 36)) +>foo : Symbol(A.foo, Decl(typeofOperatorWithNumberType.ts, 7, 21)) + +z: typeof M.n; +>M.n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(typeofOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(typeofOperatorWithNumberType.ts, 11, 14)) + diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.types b/tests/baselines/reference/typeofOperatorWithNumberType.types new file mode 100644 index 0000000000000..b80e6b1d4a8f4 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithNumberType.types @@ -0,0 +1,233 @@ +=== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts === +// typeof operator on number type +var NUMBER: number; +>NUMBER : number + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : number[] +>[1, 2] : number[] +>1 : number +>2 : number + +function foo(): number { return 1; } +>foo : () => number +>1 : number + +class A { +>A : A + + public a: number; +>a : number + + static foo() { return 1; } +>foo : () => number +>1 : number +} +module M { +>M : typeof M + + export var n: number; +>n : number +} + +var objA = new A(); +>objA : A +>new A() : A +>A : typeof A + +// number type var +var ResultIsString1 = typeof NUMBER; +>ResultIsString1 : string +>typeof NUMBER : string +>NUMBER : number + +var ResultIsString2 = typeof NUMBER1; +>ResultIsString2 : string +>typeof NUMBER1 : string +>NUMBER1 : number[] + +// number type literal +var ResultIsString3 = typeof 1; +>ResultIsString3 : string +>typeof 1 : string +>1 : number + +var ResultIsString4 = typeof { x: 1, y: 2}; +>ResultIsString4 : string +>typeof { x: 1, y: 2} : string +>{ x: 1, y: 2} : { x: number; y: number; } +>x : number +>1 : number +>y : number +>2 : number + +var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } }; +>ResultIsString5 : string +>typeof { x: 1, y: (n: number) => { return n; } } : string +>{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } +>x : number +>1 : number +>y : (n: number) => number +>(n: number) => { return n; } : (n: number) => number +>n : number +>n : number + +// number type expressions +var ResultIsString6 = typeof objA.a; +>ResultIsString6 : string +>typeof objA.a : string +>objA.a : number +>objA : A +>a : number + +var ResultIsString7 = typeof M.n; +>ResultIsString7 : string +>typeof M.n : string +>M.n : number +>M : typeof M +>n : number + +var ResultIsString8 = typeof NUMBER1[0]; +>ResultIsString8 : string +>typeof NUMBER1[0] : string +>NUMBER1[0] : number +>NUMBER1 : number[] +>0 : number + +var ResultIsString9 = typeof foo(); +>ResultIsString9 : string +>typeof foo() : string +>foo() : number +>foo : () => number + +var ResultIsString10 = typeof A.foo(); +>ResultIsString10 : string +>typeof A.foo() : string +>A.foo() : number +>A.foo : () => number +>A : typeof A +>foo : () => number + +var ResultIsString11 = typeof (NUMBER + NUMBER); +>ResultIsString11 : string +>typeof (NUMBER + NUMBER) : string +>(NUMBER + NUMBER) : number +>NUMBER + NUMBER : number +>NUMBER : number +>NUMBER : number + +// multiple typeof operators +var ResultIsString12 = typeof typeof NUMBER; +>ResultIsString12 : string +>typeof typeof NUMBER : string +>typeof NUMBER : string +>NUMBER : number + +var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER); +>ResultIsString13 : string +>typeof typeof typeof (NUMBER + NUMBER) : string +>typeof typeof (NUMBER + NUMBER) : string +>typeof (NUMBER + NUMBER) : string +>(NUMBER + NUMBER) : number +>NUMBER + NUMBER : number +>NUMBER : number +>NUMBER : number + +// miss assignment operators +typeof 1; +>typeof 1 : string +>1 : number + +typeof NUMBER; +>typeof NUMBER : string +>NUMBER : number + +typeof NUMBER1; +>typeof NUMBER1 : string +>NUMBER1 : number[] + +typeof foo(); +>typeof foo() : string +>foo() : number +>foo : () => number + +typeof objA.a; +>typeof objA.a : string +>objA.a : number +>objA : A +>a : number + +typeof M.n; +>typeof M.n : string +>M.n : number +>M : typeof M +>n : number + +typeof objA.a, M.n; +>typeof objA.a, M.n : number +>typeof objA.a : string +>objA.a : number +>objA : A +>a : number +>M.n : number +>M : typeof M +>n : number + +// use typeof in type query +var z: number; +>z : number + +var x: number[]; +>x : number[] + +z: typeof NUMBER; +>z : any +>typeof NUMBER : string +>NUMBER : number + +x: typeof NUMBER1; +>x : any +>typeof NUMBER1 : string +>NUMBER1 : number[] + +r: typeof foo; +>r : any +>typeof foo : string +>foo : () => number + +var y = { a: 1, b: 2 }; +>y : { a: number; b: number; } +>{ a: 1, b: 2 } : { a: number; b: number; } +>a : number +>1 : number +>b : number +>2 : number + +z: typeof y.a; +>z : any +>typeof y.a : string +>y.a : number +>y : { a: number; b: number; } +>a : number + +z: typeof objA.a; +>z : any +>typeof objA.a : string +>objA.a : number +>objA : A +>a : number + +z: typeof A.foo; +>z : any +>typeof A.foo : string +>A.foo : () => number +>A : typeof A +>foo : () => number + +z: typeof M.n; +>z : any +>typeof M.n : string +>M.n : number +>M : typeof M +>n : number + diff --git a/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts b/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts index 06ac3e297841e..81687e4f86098 100644 --- a/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts @@ -1,3 +1,4 @@ +// @allowUnusedLabels: true // typeof operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; From 2779352868f8c2806e056a582388cf1e2636aab9 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 22 Oct 2015 08:58:20 -0700 Subject: [PATCH 10/11] make binder singleton, inline bindWithReachabilityChecks --- src/compiler/binder.ts | 84 +++++++++++++++++++++++++-------------- src/compiler/utilities.ts | 37 ++++++++--------- 2 files changed, 73 insertions(+), 48 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 8e764947ee8bc..9126bc465bd73 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -92,13 +92,17 @@ namespace ts { IsContainerWithLocals = IsContainer | HasLocals } + const binder = createBinder(); + export function bindSourceFile(file: SourceFile, options: CompilerOptions) { let start = new Date().getTime(); - bindSourceFileWorker(file, options); + binder(file, options); bindTime += new Date().getTime() - start; } - function bindSourceFileWorker(file: SourceFile, options: CompilerOptions) { + function createBinder(): (file: SourceFile, options: CompilerOptions) => void { + let file: SourceFile; + let options: CompilerOptions; let parent: Node; let container: Node; let blockScopeContainer: Node; @@ -115,19 +119,37 @@ namespace ts { // If this file is an external module, then it is automatically in strict-mode according to // ES6. If it is not an external module, then we'll determine if it is in strict mode or // not depending on if we see "use strict" in certain places (or if we hit a class/namespace). - let inStrictMode = !!file.externalModuleIndicator; + let inStrictMode: boolean; let symbolCount = 0; - let Symbol = objectAllocator.getSymbolConstructor(); - let classifiableNames: Map = {}; + let Symbol: { new (flags: SymbolFlags, name: string): Symbol }; + let classifiableNames: Map; + + function bindSourceFile(f: SourceFile, opts: CompilerOptions) { + file = f; + options = opts; + inStrictMode = !!file.externalModuleIndicator; + classifiableNames = {}; + Symbol = objectAllocator.getSymbolConstructor(); + + if (!file.locals) { + bind(file); + file.symbolCount = symbolCount; + file.classifiableNames = classifiableNames; + } - if (!file.locals) { - bind(file); - file.symbolCount = symbolCount; - file.classifiableNames = classifiableNames; + parent = undefined; + container = undefined; + blockScopeContainer = undefined; + lastContainer = undefined; + seenThisKeyword = false; + hasExplicitReturn = false; + labelStack = undefined; + labelIndexMap = undefined; + implicitLabels = undefined; } - return; + return bindSourceFile; function createSymbol(flags: SymbolFlags, name: string): Symbol { symbolCount++; @@ -360,31 +382,23 @@ namespace ts { blockScopeContainer.locals = undefined; } - if (node.kind === SyntaxKind.InterfaceDeclaration) { - seenThisKeyword = false; - bindWithReachabilityChecks(node); - node.flags = seenThisKeyword ? node.flags | NodeFlags.ContainsThis : node.flags & ~NodeFlags.ContainsThis; - } - else { - bindWithReachabilityChecks(node); - } - - container = saveContainer; - parent = saveParent; - blockScopeContainer = savedBlockScopeContainer; - } - - function bindWithReachabilityChecks(node: Node): void { let savedReachabilityState: Reachability; let savedLabelStack: Reachability[]; let savedLabels: Map; let savedImplicitLabels: number[]; let savedHasExplicitReturn: boolean; + const kind = node.kind; + let flags = node.flags; + // reset all reachability check related flags on node (for incremental scenarios) - node.flags &= ~NodeFlags.ReachabilityCheckFlags; + flags &= ~NodeFlags.ReachabilityCheckFlags; + + if (kind === SyntaxKind.InterfaceDeclaration) { + seenThisKeyword = false; + } - let saveState = node.kind === SyntaxKind.SourceFile || node.kind === SyntaxKind.ModuleBlock || isFunctionLike(node); + let saveState = kind === SyntaxKind.SourceFile || kind === SyntaxKind.ModuleBlock || isFunctionLikeKind(kind); if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; @@ -399,13 +413,19 @@ namespace ts { bindReachableStatement(node); - if (currentReachabilityState === Reachability.Reachable && isFunctionLike(node) && nodeIsPresent((node).body)) { - node.flags |= NodeFlags.HasImplicitReturn; + if (currentReachabilityState === Reachability.Reachable && isFunctionLikeKind(kind) && nodeIsPresent((node).body)) { + flags |= NodeFlags.HasImplicitReturn; if (hasExplicitReturn) { - node.flags |= NodeFlags.HasExplicitReturn; + flags |= NodeFlags.HasExplicitReturn; } } + if (kind === SyntaxKind.InterfaceDeclaration) { + flags = seenThisKeyword ? flags | NodeFlags.ContainsThis : flags & ~NodeFlags.ContainsThis; + } + + node.flags = flags; + if (saveState) { hasExplicitReturn = savedHasExplicitReturn; currentReachabilityState = savedReachabilityState; @@ -413,6 +433,10 @@ namespace ts { labelIndexMap = savedLabels; implicitLabels = savedImplicitLabels; } + + container = saveContainer; + parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; } /** diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 5cab42629e443..f506384c2988e 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -622,25 +622,26 @@ namespace ts { } export function isFunctionLike(node: Node): node is FunctionLikeDeclaration { - if (node) { - switch (node.kind) { - case SyntaxKind.Constructor: - case SyntaxKind.FunctionExpression: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ArrowFunction: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - case SyntaxKind.IndexSignature: - case SyntaxKind.FunctionType: - case SyntaxKind.ConstructorType: - return true; - } + return node && isFunctionLikeKind(node.kind); + } + + export function isFunctionLikeKind(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.Constructor: + case SyntaxKind.FunctionExpression: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ArrowFunction: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.IndexSignature: + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: + return true; } - return false; } export function introducesArgumentsExoticObject(node: Node) { From 7d09f268c40fb63b39d186718ddf2f5c804b9723 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 22 Oct 2015 09:50:38 -0700 Subject: [PATCH 11/11] defer allocation of error message text in binder --- src/compiler/binder.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 9126bc465bd73..3d7d980706b21 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1410,9 +1410,16 @@ namespace ts { } function popImplicitLabel(implicitLabelIndex: number, outerState: Reachability): void { - Debug.assert(labelStack.length === implicitLabelIndex + 1, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`); + if (labelStack.length !== implicitLabelIndex + 1) { + Debug.assert(false, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`); + } + let i = implicitLabels.pop(); - Debug.assert(implicitLabelIndex === i, `i: ${i}, index: ${implicitLabelIndex}`); + + if (implicitLabelIndex !== i) { + Debug.assert(false, `i: ${i}, index: ${implicitLabelIndex}`); + } + setCurrentStateAtLabel(labelStack.pop(), outerState, /*name*/ undefined); }