mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into iFeelPrettyErr
This commit is contained in:
+454
-30
@@ -10,6 +10,21 @@ namespace ts {
|
||||
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
|
||||
// 1. interface declarations, type alias declarations
|
||||
@@ -77,35 +92,64 @@ namespace ts {
|
||||
IsContainerWithLocals = IsContainer | HasLocals
|
||||
}
|
||||
|
||||
export function bindSourceFile(file: SourceFile) {
|
||||
const binder = createBinder();
|
||||
|
||||
export function bindSourceFile(file: SourceFile, options: CompilerOptions) {
|
||||
let start = new Date().getTime();
|
||||
bindSourceFileWorker(file);
|
||||
binder(file, options);
|
||||
bindTime += new Date().getTime() - start;
|
||||
}
|
||||
|
||||
function bindSourceFileWorker(file: SourceFile) {
|
||||
function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
|
||||
let file: SourceFile;
|
||||
let options: CompilerOptions;
|
||||
let parent: Node;
|
||||
let container: Node;
|
||||
let blockScopeContainer: Node;
|
||||
let lastContainer: Node;
|
||||
let seenThisKeyword: boolean;
|
||||
|
||||
// state used by reachability checks
|
||||
let hasExplicitReturn: boolean;
|
||||
let currentReachabilityState: Reachability;
|
||||
let labelStack: Reachability[];
|
||||
let labelIndexMap: Map<number>;
|
||||
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).
|
||||
let inStrictMode = !!file.externalModuleIndicator;
|
||||
let inStrictMode: boolean;
|
||||
|
||||
let symbolCount = 0;
|
||||
let Symbol = objectAllocator.getSymbolConstructor();
|
||||
let classifiableNames: Map<string> = {};
|
||||
let Symbol: { new (flags: SymbolFlags, name: string): Symbol };
|
||||
let classifiableNames: Map<string>;
|
||||
|
||||
if (!file.locals) {
|
||||
bind(file);
|
||||
file.symbolCount = symbolCount;
|
||||
file.classifiableNames = classifiableNames;
|
||||
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;
|
||||
}
|
||||
|
||||
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++;
|
||||
@@ -338,13 +382,56 @@ namespace ts {
|
||||
blockScopeContainer.locals = undefined;
|
||||
}
|
||||
|
||||
if (node.kind === SyntaxKind.InterfaceDeclaration) {
|
||||
let savedReachabilityState: Reachability;
|
||||
let savedLabelStack: Reachability[];
|
||||
let savedLabels: Map<number>;
|
||||
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)
|
||||
flags &= ~NodeFlags.ReachabilityCheckFlags;
|
||||
|
||||
if (kind === SyntaxKind.InterfaceDeclaration) {
|
||||
seenThisKeyword = false;
|
||||
forEachChild(node, bind);
|
||||
node.flags = seenThisKeyword ? node.flags | NodeFlags.ContainsThis : node.flags & ~NodeFlags.ContainsThis;
|
||||
}
|
||||
else {
|
||||
forEachChild(node, bind);
|
||||
|
||||
let saveState = kind === SyntaxKind.SourceFile || kind === SyntaxKind.ModuleBlock || isFunctionLikeKind(kind);
|
||||
if (saveState) {
|
||||
savedReachabilityState = currentReachabilityState;
|
||||
savedLabelStack = labelStack;
|
||||
savedLabels = labelIndexMap;
|
||||
savedImplicitLabels = implicitLabels;
|
||||
savedHasExplicitReturn = hasExplicitReturn;
|
||||
|
||||
currentReachabilityState = Reachability.Reachable;
|
||||
hasExplicitReturn = false;
|
||||
labelStack = labelIndexMap = implicitLabels = undefined;
|
||||
}
|
||||
|
||||
bindReachableStatement(node);
|
||||
|
||||
if (currentReachabilityState === Reachability.Reachable && isFunctionLikeKind(kind) && nodeIsPresent((<FunctionLikeDeclaration>node).body)) {
|
||||
flags |= NodeFlags.HasImplicitReturn;
|
||||
if (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;
|
||||
labelStack = savedLabelStack;
|
||||
labelIndexMap = savedLabels;
|
||||
implicitLabels = savedImplicitLabels;
|
||||
}
|
||||
|
||||
container = saveContainer;
|
||||
@@ -352,6 +439,220 @@ namespace ts {
|
||||
blockScopeContainer = savedBlockScopeContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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): void {
|
||||
if (checkUnreachable(node)) {
|
||||
forEachChild(node, bind);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.WhileStatement:
|
||||
bindWhileStatement(<WhileStatement>node);
|
||||
break;
|
||||
case SyntaxKind.DoStatement:
|
||||
bindDoStatement(<DoStatement>node);
|
||||
break;
|
||||
case SyntaxKind.ForStatement:
|
||||
bindForStatement(<ForStatement>node);
|
||||
break;
|
||||
case SyntaxKind.ForInStatement:
|
||||
case SyntaxKind.ForOfStatement:
|
||||
bindForInOrForOfStatement(<ForInStatement | ForOfStatement>node);
|
||||
break;
|
||||
case SyntaxKind.IfStatement:
|
||||
bindIfStatement(<IfStatement>node);
|
||||
break;
|
||||
case SyntaxKind.ReturnStatement:
|
||||
case SyntaxKind.ThrowStatement:
|
||||
bindReturnOrThrow(<ReturnStatement | ThrowStatement>node);
|
||||
break;
|
||||
case SyntaxKind.BreakStatement:
|
||||
case SyntaxKind.ContinueStatement:
|
||||
bindBreakOrContinueStatement(<BreakOrContinueStatement>node);
|
||||
break;
|
||||
case SyntaxKind.TryStatement:
|
||||
bindTryStatement(<TryStatement>node);
|
||||
break;
|
||||
case SyntaxKind.SwitchStatement:
|
||||
bindSwitchStatement(<SwitchStatement>node);
|
||||
break;
|
||||
case SyntaxKind.CaseBlock:
|
||||
bindCaseBlock(<CaseBlock>node);
|
||||
break;
|
||||
case SyntaxKind.LabeledStatement:
|
||||
bindLabeledStatement(<LabeledStatement>node);
|
||||
break;
|
||||
default:
|
||||
forEachChild(node, bind);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function bindWhileStatement(n: WhileStatement): void {
|
||||
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);
|
||||
}
|
||||
|
||||
function bindDoStatement(n: DoStatement): void {
|
||||
const preDoState = currentReachabilityState;
|
||||
|
||||
const postDoLabel = pushImplicitLabel();
|
||||
bind(n.statement);
|
||||
const postDoState = n.expression.kind === SyntaxKind.TrueKeyword ? Reachability.Unreachable : preDoState;
|
||||
popImplicitLabel(postDoLabel, postDoState);
|
||||
|
||||
// bind expressions (don't affect reachability)
|
||||
bind(n.expression);
|
||||
}
|
||||
|
||||
function bindForStatement(n: ForStatement): void {
|
||||
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);
|
||||
}
|
||||
|
||||
function bindForInOrForOfStatement(n: ForInStatement | ForOfStatement): void {
|
||||
const preStatementState = currentReachabilityState;
|
||||
const postStatementLabel = pushImplicitLabel();
|
||||
|
||||
// bind expressions (don't affect reachability)
|
||||
bind(n.initializer);
|
||||
bind(n.expression);
|
||||
|
||||
bind(n.statement);
|
||||
popImplicitLabel(postStatementLabel, preStatementState);
|
||||
}
|
||||
|
||||
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;
|
||||
// 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;
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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
|
||||
const isValidJump = jumpToLabel(n.label, n.kind === SyntaxKind.BreakStatement ? currentReachabilityState : Reachability.Unreachable);
|
||||
if (isValidJump) {
|
||||
currentReachabilityState = Reachability.Unreachable;
|
||||
}
|
||||
}
|
||||
|
||||
function bindTryStatement(n: TryStatement): void {
|
||||
// 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);
|
||||
}
|
||||
|
||||
function bindSwitchStatement(n: SwitchStatement): void {
|
||||
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
|
||||
const postSwitchState = hasDefault && currentReachabilityState !== Reachability.Reachable ? Reachability.Unreachable : preSwitchState;
|
||||
|
||||
popImplicitLabel(postSwitchLabel, postSwitchState);
|
||||
}
|
||||
|
||||
function bindCaseBlock(n: CaseBlock): void {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bindLabeledStatement(n: LabeledStatement): void {
|
||||
// call bind on label (don't affect reachability)
|
||||
bind(n.label);
|
||||
|
||||
const ok = pushNamedLabel(n.label);
|
||||
bind(n.statement);
|
||||
if (ok) {
|
||||
popNamedLabel(n.label, currentReachabilityState);
|
||||
}
|
||||
}
|
||||
|
||||
function getContainerFlags(node: Node): ContainerFlags {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.ClassExpression:
|
||||
@@ -488,17 +789,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 : (<ModuleDeclaration>node).body;
|
||||
if (body.kind === SyntaxKind.SourceFile || body.kind === SyntaxKind.ModuleBlock) {
|
||||
@@ -514,7 +804,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 {
|
||||
@@ -766,11 +1056,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));
|
||||
}
|
||||
@@ -780,6 +1070,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
function bind(node: Node) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
node.parent = parent;
|
||||
|
||||
let savedInStrictMode = inStrictMode;
|
||||
@@ -1084,5 +1378,135 @@ namespace ts {
|
||||
? bindAnonymousDeclaration(node, symbolFlags, "__computed")
|
||||
: declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes);
|
||||
}
|
||||
|
||||
// reachability checks
|
||||
|
||||
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 {
|
||||
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 {
|
||||
if (labelStack.length !== implicitLabelIndex + 1) {
|
||||
Debug.assert(false, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`);
|
||||
}
|
||||
|
||||
let i = implicitLabels.pop();
|
||||
|
||||
if (implicitLabelIndex !== i) {
|
||||
Debug.assert(false, `i: ${i}, index: ${implicitLabelIndex}`);
|
||||
}
|
||||
|
||||
setCurrentStateAtLabel(labelStack.pop(), outerState, /*name*/ undefined);
|
||||
}
|
||||
|
||||
function setCurrentStateAtLabel(innerMergedState: Reachability, outerState: Reachability, label: Identifier): void {
|
||||
if (innerMergedState === Reachability.Unintialized) {
|
||||
if (label && !options.allowUnusedLabels) {
|
||||
file.bindDiagnostics.push(createDiagnosticForNode(label, Diagnostics.Unused_label));
|
||||
}
|
||||
currentReachabilityState = outerState;
|
||||
}
|
||||
else {
|
||||
currentReachabilityState = or(innerMergedState, outerState);
|
||||
}
|
||||
}
|
||||
|
||||
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 false;
|
||||
}
|
||||
const stateAtLabel = labelStack[index];
|
||||
labelStack[index] = stateAtLabel === Reachability.Unintialized ? outerState : or(stateAtLabel, outerState);
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkUnreachable(node: Node): boolean {
|
||||
switch (currentReachabilityState) {
|
||||
case Reachability.Unreachable:
|
||||
const reportError =
|
||||
// report error on all statements
|
||||
isStatement(node) ||
|
||||
// report error on class declarations
|
||||
node.kind === SyntaxKind.ClassDeclaration ||
|
||||
// report error on instantiated modules or const-enums only modules if preserveConstEnums is set
|
||||
(node.kind === SyntaxKind.ModuleDeclaration && shouldReportErrorOnModuleDeclaration(<ModuleDeclaration>node)) ||
|
||||
// report error on regular enums and const enums if preserveConstEnums is set
|
||||
(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 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
|
||||
// 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.allowUnreachableCode &&
|
||||
!isInAmbientContext(node) &&
|
||||
(
|
||||
node.kind !== SyntaxKind.VariableStatement ||
|
||||
getCombinedNodeFlags((<VariableStatement>node).declarationList) & NodeFlags.BlockScoped ||
|
||||
forEach((<VariableStatement>node).declarationList.declarations, d => d.initializer)
|
||||
);
|
||||
|
||||
if (reportUnreachableCode) {
|
||||
errorOnFirstToken(node, Diagnostics.Unreachable_code_detected);
|
||||
}
|
||||
}
|
||||
case Reachability.ReportedUnreachable:
|
||||
return true;
|
||||
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 (labelIndexMap) {
|
||||
return;
|
||||
}
|
||||
currentReachabilityState = Reachability.Reachable;
|
||||
labelIndexMap = {};
|
||||
labelStack = [];
|
||||
implicitLabels = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+24
-32
@@ -160,6 +160,8 @@ namespace ts {
|
||||
let getGlobalPromiseConstructorLikeType: () => ObjectType;
|
||||
let getGlobalThenableType: () => ObjectType;
|
||||
|
||||
let jsxElementClassType: Type;
|
||||
|
||||
let tupleTypes: Map<TupleType> = {};
|
||||
let unionTypes: Map<UnionType> = {};
|
||||
let intersectionTypes: Map<IntersectionType> = {};
|
||||
@@ -7874,7 +7876,6 @@ namespace ts {
|
||||
return prop || unknownSymbol;
|
||||
}
|
||||
|
||||
let jsxElementClassType: Type = undefined;
|
||||
function getJsxGlobalElementClassType(): Type {
|
||||
if (!jsxElementClassType) {
|
||||
jsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass);
|
||||
@@ -9620,21 +9621,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;
|
||||
}
|
||||
@@ -9645,26 +9636,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 = <Block>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 {
|
||||
@@ -9744,7 +9729,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (returnType && !node.asteriskToken) {
|
||||
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, isAsync ? promisedType : returnType);
|
||||
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType);
|
||||
}
|
||||
|
||||
if (node.body) {
|
||||
@@ -10945,8 +10930,15 @@ namespace ts {
|
||||
checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name);
|
||||
|
||||
if (node.kind === SyntaxKind.GetAccessor) {
|
||||
if (!isInAmbientContext(node) && nodeIsPresent(node.body) && !(bodyContainsAReturnStatement(<Block>node.body) || bodyContainsSingleThrowStatement(<Block>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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11877,7 +11869,7 @@ namespace ts {
|
||||
promisedType = checkAsyncFunctionReturnType(node);
|
||||
}
|
||||
|
||||
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, isAsync ? promisedType : returnType);
|
||||
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, isAsync ? promisedType : returnType);
|
||||
}
|
||||
|
||||
if (produceDiagnostics && !node.type) {
|
||||
@@ -14915,7 +14907,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
|
||||
|
||||
@@ -255,11 +255,31 @@ namespace ts {
|
||||
description: Diagnostics.Specifies_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,
|
||||
error: Diagnostics.Argument_for_moduleResolution_option_must_be_node_or_classic,
|
||||
},
|
||||
{
|
||||
name: "allowUnusedLabels",
|
||||
type: "boolean",
|
||||
description: Diagnostics.Do_not_report_errors_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: "allowUnreachableCode",
|
||||
type: "boolean",
|
||||
description: Diagnostics.Do_not_report_errors_on_unreachable_code
|
||||
},
|
||||
{
|
||||
name: "forceConsistentCasingInFileNames",
|
||||
type: "boolean",
|
||||
description: Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file
|
||||
},
|
||||
}
|
||||
];
|
||||
|
||||
/* @internal */
|
||||
|
||||
@@ -1012,7 +1012,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
|
||||
},
|
||||
@@ -1096,7 +1096,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
|
||||
},
|
||||
@@ -2290,10 +2290,26 @@
|
||||
"category": "Message",
|
||||
"code": 6073
|
||||
},
|
||||
"Disallow inconsistently-cased references to the same file.": {
|
||||
"Do not report errors on unused labels.": {
|
||||
"category": "Message",
|
||||
"code": 6074
|
||||
},
|
||||
"Report error when not all code paths in function return a value.": {
|
||||
"category": "Message",
|
||||
"code": 6075
|
||||
},
|
||||
"Report errors for fallthrough cases in switch statement.": {
|
||||
"category": "Message",
|
||||
"code": 6076
|
||||
},
|
||||
"Do not report errors on unreachable code.": {
|
||||
"category": "Message",
|
||||
"code": 6077
|
||||
},
|
||||
"Disallow inconsistently-cased references to the same file.": {
|
||||
"category": "Message",
|
||||
"code": 6078
|
||||
},
|
||||
|
||||
"Specify JSX code generation: 'preserve' or 'react'": {
|
||||
"category": "Message",
|
||||
@@ -2372,8 +2388,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
|
||||
|
||||
@@ -9,6 +9,12 @@ namespace ts {
|
||||
|
||||
type DependencyGroup = Array<ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration>;
|
||||
|
||||
const enum Jump {
|
||||
Break = 1 << 1,
|
||||
Continue = 1 << 2,
|
||||
Return = 1 << 3
|
||||
}
|
||||
|
||||
let entities: Map<number> = {
|
||||
"quot": 0x0022,
|
||||
"amp": 0x0026,
|
||||
@@ -371,12 +377,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
return true;
|
||||
}
|
||||
|
||||
const enum Jump {
|
||||
Break = 1 << 1,
|
||||
Continue = 1 << 2,
|
||||
Return = 1 << 3
|
||||
}
|
||||
|
||||
interface ConvertedLoopState {
|
||||
/*
|
||||
* set of labels that occured inside the converted loop
|
||||
|
||||
+27
-20
@@ -367,28 +367,31 @@ namespace ts {
|
||||
|
||||
export const enum NodeFlags {
|
||||
None = 0,
|
||||
Export = 0x00000001, // Declarations
|
||||
Ambient = 0x00000002, // Declarations
|
||||
Public = 0x00000010, // Property/Method
|
||||
Private = 0x00000020, // Property/Method
|
||||
Protected = 0x00000040, // Property/Method
|
||||
Static = 0x00000080, // Property/Method
|
||||
Abstract = 0x00000100, // Class/Method/ConstructSignature
|
||||
Async = 0x00000200, // Property/Method/Function
|
||||
Default = 0x00000400, // Function/Class (export default declaration)
|
||||
MultiLine = 0x00000800, // Multi-line array or object literal
|
||||
Synthetic = 0x00001000, // Synthetic node (for full fidelity)
|
||||
DeclarationFile = 0x00002000, // Node is a .d.ts file
|
||||
Let = 0x00004000, // Variable declaration
|
||||
Const = 0x00008000, // Variable declaration
|
||||
OctalLiteral = 0x00010000, // Octal numeric literal
|
||||
Namespace = 0x00020000, // Namespace declaration
|
||||
ExportContext = 0x00040000, // Export context (initialized by binding)
|
||||
ContainsThis = 0x00080000, // Interface contains references to "this"
|
||||
|
||||
Export = 1 << 1, // Declarations
|
||||
Ambient = 1 << 2, // Declarations
|
||||
Public = 1 << 3, // Property/Method
|
||||
Private = 1 << 4, // Property/Method
|
||||
Protected = 1 << 5, // Property/Method
|
||||
Static = 1 << 6, // Property/Method
|
||||
Abstract = 1 << 7, // Class/Method/ConstructSignature
|
||||
Async = 1 << 8, // Property/Method/Function
|
||||
Default = 1 << 9, // Function/Class (export default declaration)
|
||||
MultiLine = 1 << 10, // Multi-line array or object literal
|
||||
Synthetic = 1 << 11, // Synthetic node (for full fidelity)
|
||||
DeclarationFile = 1 << 12, // Node is a .d.ts file
|
||||
Let = 1 << 13, // Variable declaration
|
||||
Const = 1 << 14, // Variable declaration
|
||||
OctalLiteral = 1 << 15, // Octal numeric literal
|
||||
Namespace = 1 << 16, // Namespace declaration
|
||||
ExportContext = 1 << 17, // Export context (initialized by binding)
|
||||
ContainsThis = 1 << 18, // Interface contains references to "this"
|
||||
HasImplicitReturn = 1 << 19, // If function implicitly returns on one of codepaths (initialized by binding)
|
||||
HasExplicitReturn = 1 << 20, // 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,
|
||||
BlockScoped = Let | Const
|
||||
BlockScoped = Let | Const,
|
||||
|
||||
ReachabilityCheckFlags = HasImplicitReturn | HasExplicitReturn
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
@@ -2099,6 +2102,10 @@ namespace ts {
|
||||
experimentalDecorators?: boolean;
|
||||
emitDecoratorMetadata?: boolean;
|
||||
moduleResolution?: ModuleResolutionKind;
|
||||
allowUnusedLabels?: boolean;
|
||||
allowUnreachableCode?: boolean;
|
||||
noImplicitReturns?: boolean;
|
||||
noFallthroughCasesInSwitch?: boolean;
|
||||
forceConsistentCasingInFileNames?: boolean;
|
||||
/* @internal */ stripInternal?: boolean;
|
||||
|
||||
|
||||
+20
-19
@@ -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) {
|
||||
@@ -1236,7 +1237,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:
|
||||
|
||||
@@ -446,7 +446,7 @@ namespace ts.BreakpointResolver {
|
||||
// fall through.
|
||||
|
||||
case SyntaxKind.CatchClause:
|
||||
return spanInNode(lastOrUndefined((<Block>node.parent).statements));;
|
||||
return spanInNode(lastOrUndefined((<Block>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 {
|
||||
|
||||
@@ -360,7 +360,6 @@ namespace ts.formatting {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -4937,7 +4937,7 @@ namespace ts {
|
||||
else if (!isFunctionLike(node)) {
|
||||
forEachChild(node, aggregate);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4984,7 +4984,7 @@ namespace ts {
|
||||
else if (!isFunctionLike(node)) {
|
||||
forEachChild(node, aggregate);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function ownsBreakOrContinueStatement(owner: Node, statement: BreakOrContinueStatement): boolean {
|
||||
@@ -6293,8 +6293,6 @@ namespace ts {
|
||||
}
|
||||
|
||||
return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace;
|
||||
|
||||
Debug.fail("Unknown declaration type");
|
||||
}
|
||||
|
||||
function isTypeReference(node: Node): boolean {
|
||||
|
||||
@@ -323,7 +323,6 @@ namespace ts {
|
||||
// TODO: should this be '==='?
|
||||
if (settingsJson == null || settingsJson == "") {
|
||||
throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");
|
||||
return null;
|
||||
}
|
||||
return <CompilerOptions>JSON.parse(settingsJson);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
~
|
||||
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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;
|
||||
~~~~~
|
||||
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [bestCommonTypeReturnStatement.ts]
|
||||
|
||||
interface IPromise<T> {
|
||||
then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise<any>;
|
||||
}
|
||||
|
||||
@@ -1,34 +1,35 @@
|
||||
=== tests/cases/compiler/bestCommonTypeReturnStatement.ts ===
|
||||
|
||||
interface IPromise<T> {
|
||||
>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 0, 19))
|
||||
>T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 1, 19))
|
||||
|
||||
then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise<any>;
|
||||
>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))
|
||||
>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, 2, 1))
|
||||
>f : Symbol(f, Decl(bestCommonTypeReturnStatement.ts, 3, 1))
|
||||
|
||||
if (true) return b();
|
||||
>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 7, 1))
|
||||
>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 8, 1))
|
||||
|
||||
return d();
|
||||
>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 10, 45))
|
||||
>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 11, 45))
|
||||
}
|
||||
|
||||
|
||||
function b(): IPromise<void> { return null; }
|
||||
>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 7, 1))
|
||||
>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 8, 1))
|
||||
>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0))
|
||||
|
||||
function d(): IPromise<any> { return null; }
|
||||
>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 10, 45))
|
||||
>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 11, 45))
|
||||
>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/bestCommonTypeReturnStatement.ts ===
|
||||
|
||||
interface IPromise<T> {
|
||||
>IPromise : IPromise<T>
|
||||
>T : T
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [breakTarget3.ts]
|
||||
|
||||
target1:
|
||||
target2:
|
||||
while (true) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
=== tests/cases/compiler/breakTarget3.ts ===
|
||||
target1:
|
||||
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/breakTarget3.ts ===
|
||||
|
||||
target1:
|
||||
>target1 : any
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [breakTarget4.ts]
|
||||
|
||||
target1:
|
||||
target2:
|
||||
while (true) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
=== tests/cases/compiler/breakTarget4.ts ===
|
||||
target1:
|
||||
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/breakTarget4.ts ===
|
||||
|
||||
target1:
|
||||
>target1 : any
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
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 (1 errors) ====
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [breakTarget5.ts]
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [callSignatureWithoutReturnTypeAnnotationInference.ts]
|
||||
|
||||
// Call signatures without a return type should infer one from the function body (if present)
|
||||
|
||||
// Simple types
|
||||
|
||||
+99
-98
@@ -1,55 +1,56 @@
|
||||
=== 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))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 4, 13))
|
||||
|
||||
return 1;
|
||||
}
|
||||
var r = foo(1);
|
||||
>r : Symbol(r, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 3))
|
||||
>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, 6, 15))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 8, 14))
|
||||
>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, 8, 14))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 9, 14))
|
||||
}
|
||||
var r2 = foo2(1);
|
||||
>r2 : Symbol(r2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 3))
|
||||
>foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 15))
|
||||
>r2 : Symbol(r2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 3))
|
||||
>foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 7, 15))
|
||||
|
||||
function foo3() {
|
||||
>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17))
|
||||
>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 17))
|
||||
|
||||
return foo3();
|
||||
>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17))
|
||||
>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 17))
|
||||
}
|
||||
var r3 = foo3();
|
||||
>r3 : Symbol(r3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 3))
|
||||
>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17))
|
||||
>r3 : Symbol(r3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 17, 3))
|
||||
>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 17))
|
||||
|
||||
function foo4<T>(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))
|
||||
>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, 18, 17))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 19, 17))
|
||||
}
|
||||
var r4 = foo4(1);
|
||||
>r4 : Symbol(r4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 3))
|
||||
>foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 16))
|
||||
>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, 21, 17))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 23, 14))
|
||||
>foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 22, 17))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 24, 14))
|
||||
|
||||
if (true) {
|
||||
return 1;
|
||||
@@ -58,17 +59,17 @@ function foo5(x) {
|
||||
}
|
||||
}
|
||||
var r5 = foo5(1);
|
||||
>r5 : Symbol(r5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 3))
|
||||
>foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 17))
|
||||
>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, 30, 17))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 32, 14))
|
||||
>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, 35, 11))
|
||||
>e : Symbol(e, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 36, 11))
|
||||
|
||||
return [];
|
||||
}
|
||||
@@ -77,179 +78,179 @@ function foo6(x) {
|
||||
}
|
||||
}
|
||||
var r6 = foo6(1);
|
||||
>r6 : Symbol(r6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 3))
|
||||
>foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 17))
|
||||
>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, 42, 17))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 44, 14))
|
||||
>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, 44, 14))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 45, 14))
|
||||
}
|
||||
var r7 = foo7(1);
|
||||
>r7 : Symbol(r7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 3))
|
||||
>foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 17))
|
||||
>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, 47, 17))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 50, 14))
|
||||
>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, 51, 12))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 50, 14))
|
||||
>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, 53, 3))
|
||||
>foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 17))
|
||||
>r8 : Symbol(r8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 54, 3))
|
||||
>foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 48, 17))
|
||||
|
||||
interface I {
|
||||
>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 17))
|
||||
>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 54, 17))
|
||||
|
||||
foo: string;
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 55, 13))
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 56, 13))
|
||||
}
|
||||
function foo9(x: number) {
|
||||
>foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 57, 1))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 58, 14))
|
||||
>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, 59, 7))
|
||||
>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 17))
|
||||
>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 60, 7))
|
||||
>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 54, 17))
|
||||
|
||||
return i;
|
||||
>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 59, 7))
|
||||
>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 60, 7))
|
||||
}
|
||||
var r9 = foo9(1);
|
||||
>r9 : Symbol(r9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 3))
|
||||
>foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 57, 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, 62, 17))
|
||||
>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 63, 17))
|
||||
|
||||
foo: string;
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 64, 9))
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 65, 9))
|
||||
}
|
||||
function foo10(x: number) {
|
||||
>foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 66, 1))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 67, 15))
|
||||
>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, 68, 7))
|
||||
>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 17))
|
||||
>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 69, 7))
|
||||
>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 63, 17))
|
||||
|
||||
return c;
|
||||
>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 68, 7))
|
||||
>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 69, 7))
|
||||
}
|
||||
var r10 = foo10(1);
|
||||
>r10 : Symbol(r10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 3))
|
||||
>foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 66, 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, 71, 19))
|
||||
>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 72, 19))
|
||||
|
||||
export var x = 1;
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 74, 14))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 75, 14))
|
||||
|
||||
export class C { foo: string }
|
||||
>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 74, 21))
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 75, 20))
|
||||
>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 75, 21))
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 20))
|
||||
}
|
||||
function foo11() {
|
||||
>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 1))
|
||||
>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 77, 1))
|
||||
|
||||
return M;
|
||||
>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 19))
|
||||
>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 72, 19))
|
||||
}
|
||||
var r11 = foo11();
|
||||
>r11 : Symbol(r11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 3))
|
||||
>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 1))
|
||||
>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, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1))
|
||||
>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 81, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 1))
|
||||
|
||||
x: number;
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 83, 14))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 84, 14))
|
||||
}
|
||||
interface I2 {
|
||||
>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1))
|
||||
>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 81, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 1))
|
||||
|
||||
y: number;
|
||||
>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 14))
|
||||
>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 87, 14))
|
||||
}
|
||||
function foo12() {
|
||||
>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 88, 1))
|
||||
>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 89, 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))
|
||||
>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, 90, 7))
|
||||
>i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 91, 7))
|
||||
}
|
||||
var r12 = foo12();
|
||||
>r12 : Symbol(r12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 3))
|
||||
>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 88, 1))
|
||||
>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, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27))
|
||||
>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, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27))
|
||||
>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 22))
|
||||
>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, 96, 31))
|
||||
>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 97, 31))
|
||||
|
||||
return m1;
|
||||
>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27))
|
||||
>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 94, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 27))
|
||||
}
|
||||
var r13 = foo13();
|
||||
>r13 : Symbol(r13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 3))
|
||||
>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 31))
|
||||
>r13 : Symbol(r13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 3))
|
||||
>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 97, 31))
|
||||
|
||||
class c1 {
|
||||
>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1))
|
||||
>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 106, 1))
|
||||
|
||||
foo: string;
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 102, 10))
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 103, 10))
|
||||
|
||||
constructor(x) { }
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 104, 16))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 16))
|
||||
}
|
||||
module c1 {
|
||||
>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1))
|
||||
>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 106, 1))
|
||||
|
||||
export var x = 1;
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 107, 14))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 14))
|
||||
}
|
||||
function foo14() {
|
||||
>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 1))
|
||||
>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 109, 1))
|
||||
|
||||
return c1;
|
||||
>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1))
|
||||
>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 106, 1))
|
||||
}
|
||||
var r14 = foo14();
|
||||
>r14 : Symbol(r14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 3))
|
||||
>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 1))
|
||||
>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, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13))
|
||||
>A : Symbol(e1.A, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 9))
|
||||
>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, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13))
|
||||
>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 22))
|
||||
>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, 115, 31))
|
||||
>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 116, 31))
|
||||
|
||||
return e1;
|
||||
>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13))
|
||||
>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 113, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 13))
|
||||
}
|
||||
var r15 = foo15();
|
||||
>r15 : Symbol(r15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 119, 3))
|
||||
>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 31))
|
||||
>r15 : Symbol(r15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 120, 3))
|
||||
>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 116, 31))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== 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
|
||||
|
||||
@@ -75,9 +75,8 @@ function foo() {
|
||||
break l0;
|
||||
}
|
||||
|
||||
return 100;
|
||||
|
||||
() => b
|
||||
return 100;
|
||||
}
|
||||
|
||||
|
||||
@@ -207,8 +206,8 @@ function foo() {
|
||||
if (b === 2) {
|
||||
return "break-l0";
|
||||
}
|
||||
return { value: 100 };
|
||||
(function () { return b; });
|
||||
return { value: 100 };
|
||||
};
|
||||
for (var _d = 0, _e = []; _d < _e.length; _d++) {
|
||||
var b = _e[_d];
|
||||
|
||||
@@ -142,10 +142,10 @@ function foo() {
|
||||
break l0;
|
||||
}
|
||||
|
||||
return 100;
|
||||
|
||||
() => b
|
||||
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 66, 16))
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
|
||||
@@ -171,25 +171,25 @@ function foo() {
|
||||
}
|
||||
|
||||
function foo2() {
|
||||
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9.ts, 89, 1))
|
||||
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9.ts, 88, 1))
|
||||
|
||||
for (let x of []) {
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 91, 12))
|
||||
|
||||
if (x === 1) {
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 91, 12))
|
||||
|
||||
break;
|
||||
}
|
||||
else if (x === 2) {
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 91, 12))
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
while (1 === 1) {
|
||||
if (x) {
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 91, 12))
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -199,17 +199,17 @@ function foo2() {
|
||||
}
|
||||
|
||||
switch(x) {
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 91, 12))
|
||||
|
||||
case 1: break;
|
||||
case 2: continue;
|
||||
}
|
||||
|
||||
for (let y of []) {
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 114, 16))
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 113, 16))
|
||||
|
||||
switch(y) {
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 114, 16))
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 113, 16))
|
||||
|
||||
case 1: break;
|
||||
case 2: continue;
|
||||
@@ -219,50 +219,50 @@ function foo2() {
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(capturedLetConstInLoop9.ts, 121, 1))
|
||||
>C : Symbol(C, Decl(capturedLetConstInLoop9.ts, 120, 1))
|
||||
|
||||
constructor(private N: number) { }
|
||||
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
|
||||
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 123, 16))
|
||||
|
||||
foo() {
|
||||
>foo : Symbol(foo, Decl(capturedLetConstInLoop9.ts, 124, 38))
|
||||
>foo : Symbol(foo, Decl(capturedLetConstInLoop9.ts, 123, 38))
|
||||
|
||||
for (let i = 0; i < 100; i++) {
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 125, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 125, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 125, 16))
|
||||
|
||||
let f = () => this.N * i;
|
||||
>f : Symbol(f, Decl(capturedLetConstInLoop9.ts, 127, 15))
|
||||
>this.N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
|
||||
>this : Symbol(C, Decl(capturedLetConstInLoop9.ts, 121, 1))
|
||||
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
|
||||
>f : Symbol(f, Decl(capturedLetConstInLoop9.ts, 126, 15))
|
||||
>this.N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 123, 16))
|
||||
>this : Symbol(C, Decl(capturedLetConstInLoop9.ts, 120, 1))
|
||||
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 123, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 125, 16))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function foo3 () {
|
||||
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9.ts, 130, 1))
|
||||
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9.ts, 129, 1))
|
||||
|
||||
let x = arguments.length;
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 133, 7))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 132, 7))
|
||||
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
>arguments : Symbol(arguments)
|
||||
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
|
||||
for (let y of []) {
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 134, 12))
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 133, 12))
|
||||
|
||||
let z = arguments.length;
|
||||
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 135, 11))
|
||||
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 134, 11))
|
||||
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
>arguments : Symbol(arguments)
|
||||
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
|
||||
(function() { return y + z + arguments.length; });
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 134, 12))
|
||||
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 135, 11))
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 133, 12))
|
||||
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 134, 11))
|
||||
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
>arguments : Symbol(arguments)
|
||||
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
|
||||
@@ -197,12 +197,12 @@ function foo() {
|
||||
>l0 : any
|
||||
}
|
||||
|
||||
return 100;
|
||||
>100 : number
|
||||
|
||||
() => b
|
||||
>() => b : () => any
|
||||
>b : any
|
||||
|
||||
return 100;
|
||||
>100 : number
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -75,10 +75,8 @@ function foo() {
|
||||
if (b === 2) {
|
||||
break l0;
|
||||
}
|
||||
|
||||
return 100;
|
||||
|
||||
() => b
|
||||
return 100;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,8 +196,8 @@ function foo() {
|
||||
if (b === 2) {
|
||||
break l0;
|
||||
}
|
||||
return 100;
|
||||
(() => b);
|
||||
return 100;
|
||||
}
|
||||
(() => a);
|
||||
}
|
||||
|
||||
@@ -142,11 +142,10 @@ function foo() {
|
||||
|
||||
break l0;
|
||||
}
|
||||
|
||||
return 100;
|
||||
|
||||
() => b
|
||||
>b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 67, 16))
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,25 +171,25 @@ function foo() {
|
||||
}
|
||||
|
||||
function foo2() {
|
||||
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9_ES6.ts, 90, 1))
|
||||
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9_ES6.ts, 88, 1))
|
||||
|
||||
for (let x of []) {
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 91, 12))
|
||||
|
||||
if (x === 1) {
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 91, 12))
|
||||
|
||||
break;
|
||||
}
|
||||
else if (x === 2) {
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 91, 12))
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
while (1 === 1) {
|
||||
if (x) {
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 91, 12))
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -200,17 +199,17 @@ function foo2() {
|
||||
}
|
||||
|
||||
switch(x) {
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 91, 12))
|
||||
|
||||
case 1: break;
|
||||
case 2: continue;
|
||||
}
|
||||
|
||||
for (let y of []) {
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 115, 16))
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 113, 16))
|
||||
|
||||
switch(y) {
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 115, 16))
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 113, 16))
|
||||
|
||||
case 1: break;
|
||||
case 2: continue;
|
||||
@@ -220,50 +219,50 @@ function foo2() {
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(capturedLetConstInLoop9_ES6.ts, 122, 1))
|
||||
>C : Symbol(C, Decl(capturedLetConstInLoop9_ES6.ts, 120, 1))
|
||||
|
||||
constructor(private N: number) { }
|
||||
>N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
|
||||
>N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 123, 16))
|
||||
|
||||
foo() {
|
||||
>foo : Symbol(foo, Decl(capturedLetConstInLoop9_ES6.ts, 125, 38))
|
||||
>foo : Symbol(foo, Decl(capturedLetConstInLoop9_ES6.ts, 123, 38))
|
||||
|
||||
for (let i = 0; i < 100; i++) {
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
|
||||
|
||||
let f = () => this.N * i;
|
||||
>f : Symbol(f, Decl(capturedLetConstInLoop9_ES6.ts, 128, 15))
|
||||
>this.N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
|
||||
>this : Symbol(C, Decl(capturedLetConstInLoop9_ES6.ts, 122, 1))
|
||||
>N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
|
||||
>f : Symbol(f, Decl(capturedLetConstInLoop9_ES6.ts, 126, 15))
|
||||
>this.N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 123, 16))
|
||||
>this : Symbol(C, Decl(capturedLetConstInLoop9_ES6.ts, 120, 1))
|
||||
>N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 123, 16))
|
||||
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function foo3 () {
|
||||
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9_ES6.ts, 131, 1))
|
||||
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9_ES6.ts, 129, 1))
|
||||
|
||||
let x = arguments.length;
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 134, 7))
|
||||
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 132, 7))
|
||||
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
>arguments : Symbol(arguments)
|
||||
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
|
||||
for (let y of []) {
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 135, 12))
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 133, 12))
|
||||
|
||||
let z = arguments.length;
|
||||
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 136, 11))
|
||||
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 134, 11))
|
||||
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
>arguments : Symbol(arguments)
|
||||
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
|
||||
(function() { return y + z + arguments.length; });
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 135, 12))
|
||||
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 136, 11))
|
||||
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 133, 12))
|
||||
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 134, 11))
|
||||
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
>arguments : Symbol(arguments)
|
||||
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
|
||||
|
||||
@@ -197,13 +197,12 @@ function foo() {
|
||||
break l0;
|
||||
>l0 : any
|
||||
}
|
||||
|
||||
return 100;
|
||||
>100 : number
|
||||
|
||||
() => b
|
||||
>() => b : () => any
|
||||
>b : any
|
||||
|
||||
return 100;
|
||||
>100 : number
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 (x<y) {
|
||||
break L2;
|
||||
x=13;
|
||||
~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
}
|
||||
else {
|
||||
break L3;
|
||||
x=14;
|
||||
~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
x++;
|
||||
}
|
||||
finally {
|
||||
x+=3;
|
||||
}
|
||||
y++;
|
||||
for (var k=0;k<10;k++) {
|
||||
z;
|
||||
break;
|
||||
}
|
||||
for (k=0;k<10;k++) {
|
||||
if (k==6) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
=== tests/cases/compiler/cf.ts ===
|
||||
function f() {
|
||||
>f : 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 (x<y) {
|
||||
>x : 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 (x<y) {
|
||||
>L3 : any
|
||||
>x<y : boolean
|
||||
>x : 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commentEmitAtEndOfFile1.ts]
|
||||
|
||||
// test
|
||||
var f = ''
|
||||
// test #2
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/commentEmitAtEndOfFile1.ts ===
|
||||
|
||||
// test
|
||||
var f = ''
|
||||
>f : string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commentsAtEndOfFile1.ts]
|
||||
|
||||
Input:
|
||||
;
|
||||
//Testing two
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
=== tests/cases/compiler/commentsAtEndOfFile1.ts ===
|
||||
Input:
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/commentsAtEndOfFile1.ts ===
|
||||
|
||||
Input:
|
||||
>Input : any
|
||||
|
||||
|
||||
@@ -1,80 +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,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 (74 errors) ====
|
||||
|
||||
// expected error for all the LHS of compound assignments (arithmetic and addition)
|
||||
var value;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [compoundAssignmentLHSIsValue.ts]
|
||||
|
||||
// expected error for all the LHS of compound assignments (arithmetic and addition)
|
||||
var value;
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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) { }
|
||||
}
|
||||
@@ -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) { }
|
||||
}
|
||||
@@ -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 [<String>""]() { }
|
||||
~~~~~~~~~~~~
|
||||
!!! 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) { }
|
||||
|
||||
@@ -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 [<String>""]() { }
|
||||
~~~~~~~~~~~~
|
||||
!!! 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) { }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [conditionalExpressions2.ts]
|
||||
|
||||
var a = false ? 1 : null;
|
||||
var b = false ? undefined : 0;
|
||||
var c = false ? 1 : 0;
|
||||
|
||||
@@ -1,33 +1,34 @@
|
||||
=== tests/cases/compiler/conditionalExpressions2.ts ===
|
||||
|
||||
var a = false ? 1 : null;
|
||||
>a : Symbol(a, Decl(conditionalExpressions2.ts, 0, 3))
|
||||
>a : Symbol(a, Decl(conditionalExpressions2.ts, 1, 3))
|
||||
|
||||
var b = false ? undefined : 0;
|
||||
>b : Symbol(b, Decl(conditionalExpressions2.ts, 1, 3))
|
||||
>b : Symbol(b, Decl(conditionalExpressions2.ts, 2, 3))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
var c = false ? 1 : 0;
|
||||
>c : Symbol(c, Decl(conditionalExpressions2.ts, 2, 3))
|
||||
>c : Symbol(c, Decl(conditionalExpressions2.ts, 3, 3))
|
||||
|
||||
var d = false ? false : true;
|
||||
>d : Symbol(d, Decl(conditionalExpressions2.ts, 3, 3))
|
||||
>d : Symbol(d, Decl(conditionalExpressions2.ts, 4, 3))
|
||||
|
||||
var e = false ? "foo" : "bar";
|
||||
>e : Symbol(e, Decl(conditionalExpressions2.ts, 4, 3))
|
||||
>e : Symbol(e, Decl(conditionalExpressions2.ts, 5, 3))
|
||||
|
||||
var f = false ? null : undefined;
|
||||
>f : Symbol(f, Decl(conditionalExpressions2.ts, 5, 3))
|
||||
>f : Symbol(f, Decl(conditionalExpressions2.ts, 6, 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))
|
||||
>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, 7, 3))
|
||||
>h : Symbol(h, Decl(conditionalExpressions2.ts, 7, 10))
|
||||
>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, 7, 22))
|
||||
>x : Symbol(x, Decl(conditionalExpressions2.ts, 8, 35))
|
||||
>i : Symbol(i, Decl(conditionalExpressions2.ts, 8, 22))
|
||||
>x : Symbol(x, Decl(conditionalExpressions2.ts, 9, 35))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/conditionalExpressions2.ts ===
|
||||
|
||||
var a = false ? 1 : null;
|
||||
>a : number
|
||||
>false ? 1 : null : number
|
||||
|
||||
@@ -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.
|
||||
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
|
||||
@@ -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);
|
||||
|
||||
@@ -1,89 +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(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,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 (83 errors) ====
|
||||
|
||||
declare module "fs" {
|
||||
export class File {
|
||||
constructor(filename: string);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [constructorWithIncompleteTypeAnnotation.ts]
|
||||
|
||||
declare module "fs" {
|
||||
export class File {
|
||||
constructor(filename: string);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
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 (1 errors) ====
|
||||
|
||||
TWO:
|
||||
while (true){
|
||||
var x = () => {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [continueNotInIterationStatement4.ts]
|
||||
|
||||
TWO:
|
||||
while (true){
|
||||
var x = () => {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [continueTarget3.ts]
|
||||
|
||||
target1:
|
||||
target2:
|
||||
while (true) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
=== tests/cases/compiler/continueTarget3.ts ===
|
||||
target1:
|
||||
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/continueTarget3.ts ===
|
||||
|
||||
target1:
|
||||
>target1 : any
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [continueTarget4.ts]
|
||||
|
||||
target1:
|
||||
target2:
|
||||
while (true) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
=== tests/cases/compiler/continueTarget4.ts ===
|
||||
target1:
|
||||
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/continueTarget4.ts ===
|
||||
|
||||
target1:
|
||||
>target1 : any
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
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 (1 errors) ====
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [continueTarget5.ts]
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [doWhileBreakStatements.ts]
|
||||
|
||||
do {
|
||||
break;
|
||||
} while(true)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts ===
|
||||
|
||||
do {
|
||||
break;
|
||||
} while(true)
|
||||
@@ -34,7 +35,7 @@ do do do break SEVEN; while (true) while (true) while (true)
|
||||
EIGHT:
|
||||
do{
|
||||
var fn = function () { }
|
||||
>fn : Symbol(fn, Decl(doWhileBreakStatements.ts, 34, 7))
|
||||
>fn : Symbol(fn, Decl(doWhileBreakStatements.ts, 35, 7))
|
||||
|
||||
break EIGHT;
|
||||
}while(true)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts ===
|
||||
|
||||
do {
|
||||
break;
|
||||
} while(true)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [doWhileContinueStatements.ts]
|
||||
|
||||
do {
|
||||
continue;
|
||||
} while(true)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts ===
|
||||
|
||||
do {
|
||||
continue;
|
||||
} while(true)
|
||||
@@ -34,7 +35,7 @@ do do do continue SEVEN; while (true) while (true) while (true)
|
||||
EIGHT:
|
||||
do{
|
||||
var fn = function () { }
|
||||
>fn : Symbol(fn, Decl(doWhileContinueStatements.ts, 34, 7))
|
||||
>fn : Symbol(fn, Decl(doWhileContinueStatements.ts, 35, 7))
|
||||
|
||||
continue EIGHT;
|
||||
}while(true)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts ===
|
||||
|
||||
do {
|
||||
continue;
|
||||
} while(true)
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
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,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 (6 errors) ====
|
||||
|
||||
'use strict'
|
||||
|
||||
declare function use(a: any);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [downlevelLetConst16.ts]
|
||||
|
||||
'use strict'
|
||||
|
||||
declare function use(a: any);
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
tests/cases/compiler/downlevelLetConst18.ts(4,14): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(8,14): error TS2393: Duplicate function implementation.
|
||||
|
||||
|
||||
==== tests/cases/compiler/downlevelLetConst18.ts (2 errors) ====
|
||||
'use strict'
|
||||
|
||||
for (let x; ;) {
|
||||
function foo() { x };
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
function foo() { x };
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
(() => { x })();
|
||||
}
|
||||
|
||||
for (const x = 1; ;) {
|
||||
(() => { x })();
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
({ foo() { x }})
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
({ get foo() { return x } })
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
({ set foo(v) { x } })
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [downlevelLetConst18.ts]
|
||||
|
||||
'use strict'
|
||||
|
||||
for (let x; ;) {
|
||||
@@ -6,7 +7,7 @@ for (let x; ;) {
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
function foo() { x };
|
||||
function foo1() { x };
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
@@ -40,7 +41,7 @@ for (var x = void 0;;) {
|
||||
_loop_1(x);
|
||||
}
|
||||
var _loop_2 = function(x) {
|
||||
function foo() { x; }
|
||||
function foo1() { x; }
|
||||
;
|
||||
};
|
||||
for (var x = void 0;;) {
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
=== tests/cases/compiler/downlevelLetConst18.ts ===
|
||||
|
||||
'use strict'
|
||||
|
||||
for (let x; ;) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 3, 8))
|
||||
|
||||
function foo() { x };
|
||||
>foo : Symbol(foo, Decl(downlevelLetConst18.ts, 3, 16))
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 3, 8))
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 7, 8))
|
||||
|
||||
function foo1() { x };
|
||||
>foo1 : Symbol(foo1, Decl(downlevelLetConst18.ts, 7, 16))
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 7, 8))
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 11, 8))
|
||||
|
||||
(() => { x })();
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 11, 8))
|
||||
}
|
||||
|
||||
for (const x = 1; ;) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 15, 10))
|
||||
|
||||
(() => { x })();
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 15, 10))
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 19, 8))
|
||||
|
||||
({ foo() { x }})
|
||||
>foo : Symbol(foo, Decl(downlevelLetConst18.ts, 20, 6))
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 19, 8))
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 23, 8))
|
||||
|
||||
({ get foo() { return x } })
|
||||
>foo : Symbol(foo, Decl(downlevelLetConst18.ts, 24, 6))
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 23, 8))
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 27, 8))
|
||||
|
||||
({ set foo(v) { x } })
|
||||
>foo : Symbol(foo, Decl(downlevelLetConst18.ts, 28, 6))
|
||||
>v : Symbol(v, Decl(downlevelLetConst18.ts, 28, 15))
|
||||
>x : Symbol(x, Decl(downlevelLetConst18.ts, 27, 8))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
=== tests/cases/compiler/downlevelLetConst18.ts ===
|
||||
|
||||
'use strict'
|
||||
>'use strict' : string
|
||||
|
||||
for (let x; ;) {
|
||||
>x : any
|
||||
|
||||
function foo() { x };
|
||||
>foo : () => void
|
||||
>x : any
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : any
|
||||
|
||||
function foo1() { x };
|
||||
>foo1 : () => void
|
||||
>x : any
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : any
|
||||
|
||||
(() => { x })();
|
||||
>(() => { x })() : void
|
||||
>(() => { x }) : () => void
|
||||
>() => { x } : () => void
|
||||
>x : any
|
||||
}
|
||||
|
||||
for (const x = 1; ;) {
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
(() => { x })();
|
||||
>(() => { x })() : void
|
||||
>(() => { x }) : () => void
|
||||
>() => { x } : () => void
|
||||
>x : number
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : any
|
||||
|
||||
({ foo() { x }})
|
||||
>({ foo() { x }}) : { foo(): void; }
|
||||
>{ foo() { x }} : { foo(): void; }
|
||||
>foo : () => void
|
||||
>x : any
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : any
|
||||
|
||||
({ get foo() { return x } })
|
||||
>({ get foo() { return x } }) : { foo: any; }
|
||||
>{ get foo() { return x } } : { foo: any; }
|
||||
>foo : any
|
||||
>x : any
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : any
|
||||
|
||||
({ set foo(v) { x } })
|
||||
>({ set foo(v) { x } }) : { foo: any; }
|
||||
>{ set foo(v) { x } } : { foo: any; }
|
||||
>foo : any
|
||||
>v : any
|
||||
>x : any
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
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 (1 errors) ====
|
||||
|
||||
target:
|
||||
target:
|
||||
~~~~~~
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [duplicateLabel1.ts]
|
||||
|
||||
target:
|
||||
target:
|
||||
while (true) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
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 (1 errors) ====
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
target:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [duplicateLabel2.ts]
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
target:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [duplicateLabel3.ts]
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
=== tests/cases/compiler/duplicateLabel3.ts ===
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
>f : Symbol(f, Decl(duplicateLabel3.ts, 1, 14))
|
||||
>f : Symbol(f, Decl(duplicateLabel3.ts, 2, 14))
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/duplicateLabel3.ts ===
|
||||
|
||||
target:
|
||||
>target : any
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [duplicateLabel4.ts]
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
=== tests/cases/compiler/duplicateLabel4.ts ===
|
||||
target:
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/duplicateLabel4.ts ===
|
||||
|
||||
target:
|
||||
>target : any
|
||||
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
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 (1 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');
|
||||
@@ -12,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) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [duplicateVariablesByScope.ts]
|
||||
|
||||
// duplicate local variables are only reported at global scope
|
||||
|
||||
module M {
|
||||
|
||||
@@ -1,56 +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, 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))
|
||||
>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, 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))
|
||||
>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, 8, 1))
|
||||
>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 9, 1))
|
||||
|
||||
var x = 2;
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 11, 7), Decl(duplicateVariablesByScope.ts, 12, 7))
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 12, 7), Decl(duplicateVariablesByScope.ts, 13, 7))
|
||||
|
||||
var x = 1;
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 11, 7), Decl(duplicateVariablesByScope.ts, 12, 7))
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 12, 7), Decl(duplicateVariablesByScope.ts, 13, 7))
|
||||
|
||||
if (true) {
|
||||
var result = 1;
|
||||
>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 14, 11), Decl(duplicateVariablesByScope.ts, 17, 11))
|
||||
>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 15, 11), Decl(duplicateVariablesByScope.ts, 18, 11))
|
||||
}
|
||||
else {
|
||||
var result = 2;
|
||||
>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 14, 11), Decl(duplicateVariablesByScope.ts, 17, 11))
|
||||
>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 15, 11), Decl(duplicateVariablesByScope.ts, 18, 11))
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(duplicateVariablesByScope.ts, 19, 1))
|
||||
>C : Symbol(C, Decl(duplicateVariablesByScope.ts, 20, 1))
|
||||
|
||||
foo() {
|
||||
>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 21, 9))
|
||||
>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 22, 9))
|
||||
|
||||
try {
|
||||
var x = 1;
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 24, 15), Decl(duplicateVariablesByScope.ts, 27, 15))
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 25, 15), Decl(duplicateVariablesByScope.ts, 28, 15))
|
||||
}
|
||||
catch (e) {
|
||||
>e : Symbol(e, Decl(duplicateVariablesByScope.ts, 26, 15))
|
||||
>e : Symbol(e, Decl(duplicateVariablesByScope.ts, 27, 15))
|
||||
|
||||
var x = 2;
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 24, 15), Decl(duplicateVariablesByScope.ts, 27, 15))
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 25, 15), Decl(duplicateVariablesByScope.ts, 28, 15))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/duplicateVariablesByScope.ts ===
|
||||
|
||||
// duplicate local variables are only reported at global scope
|
||||
|
||||
module M {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [es6ClassSuperCodegenBug.ts]
|
||||
|
||||
class A {
|
||||
constructor(str1:string, str2:string) {}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user