mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
addressed PR feedback, updated tests to suppress reachability errors where they are not needed
This commit is contained in:
+43
-60
@@ -374,10 +374,6 @@ namespace ts {
|
||||
blockScopeContainer = savedBlockScopeContainer;
|
||||
}
|
||||
|
||||
function shouldSaveReachabilityState(n: Node): boolean {
|
||||
return n.kind === SyntaxKind.SourceFile || n.kind === SyntaxKind.ModuleBlock || isFunctionLike(n);
|
||||
}
|
||||
|
||||
function bindWithReachabilityChecks(node: Node): void {
|
||||
let savedReachabilityState: Reachability;
|
||||
let savedLabelStack: Reachability[];
|
||||
@@ -385,7 +381,10 @@ namespace ts {
|
||||
let savedImplicitLabels: number[];
|
||||
let savedHasExplicitReturn: boolean;
|
||||
|
||||
let saveState = shouldSaveReachabilityState(node);
|
||||
// reset all reachability check related flags on node (for incremental scenarios)
|
||||
node.flags &= ~NodeFlags.ReachabilityCheckFlags;
|
||||
|
||||
let saveState = node.kind === SyntaxKind.SourceFile || node.kind === SyntaxKind.ModuleBlock || isFunctionLike(node);
|
||||
if (saveState) {
|
||||
savedReachabilityState = currentReachabilityState;
|
||||
savedLabelStack = labelStack;
|
||||
@@ -398,9 +397,7 @@ namespace ts {
|
||||
labelStack = labelIndexMap = implicitLabels = undefined;
|
||||
}
|
||||
|
||||
if (!bindReachableStatement(node)) {
|
||||
forEachChild(node, bind);
|
||||
}
|
||||
bindReachableStatement(node);
|
||||
|
||||
if (currentReachabilityState === Reachability.Reachable && isFunctionLike(node) && nodeIsPresent((<FunctionLikeDeclaration>node).body)) {
|
||||
node.flags |= NodeFlags.HasImplicitReturn;
|
||||
@@ -422,43 +419,56 @@ namespace ts {
|
||||
* Returns true if node and its subnodes were successfully traversed.
|
||||
* Returning false means that node was not examined and caller needs to dive into the node himself.
|
||||
*/
|
||||
function bindReachableStatement(node: Node): boolean {
|
||||
function bindReachableStatement(node: Node): void {
|
||||
if (checkUnreachable(node)) {
|
||||
return false;
|
||||
forEachChild(node, bind);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.WhileStatement:
|
||||
return bindWhileStatement(<WhileStatement>node);
|
||||
bindWhileStatement(<WhileStatement>node);
|
||||
break;
|
||||
case SyntaxKind.DoStatement:
|
||||
return bindDoStatement(<DoStatement>node);
|
||||
bindDoStatement(<DoStatement>node);
|
||||
break;
|
||||
case SyntaxKind.ForStatement:
|
||||
return bindForStatement(<ForStatement>node);
|
||||
bindForStatement(<ForStatement>node);
|
||||
break;
|
||||
case SyntaxKind.ForInStatement:
|
||||
case SyntaxKind.ForOfStatement:
|
||||
return bindForInOrForOfStatement(<ForInStatement | ForOfStatement>node);
|
||||
bindForInOrForOfStatement(<ForInStatement | ForOfStatement>node);
|
||||
break;
|
||||
case SyntaxKind.IfStatement:
|
||||
return bindIfStatement(<IfStatement>node);
|
||||
bindIfStatement(<IfStatement>node);
|
||||
break;
|
||||
case SyntaxKind.ReturnStatement:
|
||||
case SyntaxKind.ThrowStatement:
|
||||
return bindReturnOrThrow(<ReturnStatement | ThrowStatement>node);
|
||||
bindReturnOrThrow(<ReturnStatement | ThrowStatement>node);
|
||||
break;
|
||||
case SyntaxKind.BreakStatement:
|
||||
case SyntaxKind.ContinueStatement:
|
||||
return bindBreakOrContinueStatement(<BreakOrContinueStatement>node);
|
||||
bindBreakOrContinueStatement(<BreakOrContinueStatement>node);
|
||||
break;
|
||||
case SyntaxKind.TryStatement:
|
||||
return bindTryStatement(<TryStatement>node);
|
||||
bindTryStatement(<TryStatement>node);
|
||||
break;
|
||||
case SyntaxKind.SwitchStatement:
|
||||
return bindSwitchStatement(<SwitchStatement>node);
|
||||
bindSwitchStatement(<SwitchStatement>node);
|
||||
break;
|
||||
case SyntaxKind.CaseBlock:
|
||||
return bindCaseBlock(<CaseBlock>node);
|
||||
bindCaseBlock(<CaseBlock>node);
|
||||
break;
|
||||
case SyntaxKind.LabeledStatement:
|
||||
return bindLabeledStatement(<LabeledStatement>node);
|
||||
bindLabeledStatement(<LabeledStatement>node);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
forEachChild(node, bind);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function bindWhileStatement(n: WhileStatement): boolean {
|
||||
function bindWhileStatement(n: WhileStatement): void {
|
||||
const preWhileState =
|
||||
n.expression.kind === SyntaxKind.FalseKeyword ? Reachability.Unreachable : currentReachabilityState;
|
||||
const postWhileState =
|
||||
@@ -471,11 +481,9 @@ namespace ts {
|
||||
const postWhileLabel = pushImplicitLabel();
|
||||
bind(n.statement);
|
||||
popImplicitLabel(postWhileLabel, postWhileState);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindDoStatement(n: DoStatement): boolean {
|
||||
function bindDoStatement(n: DoStatement): void {
|
||||
const preDoState = currentReachabilityState;
|
||||
|
||||
const postDoLabel = pushImplicitLabel();
|
||||
@@ -485,11 +493,9 @@ namespace ts {
|
||||
|
||||
// bind expressions (don't affect reachability)
|
||||
bind(n.expression);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindForStatement(n: ForStatement): boolean {
|
||||
function bindForStatement(n: ForStatement): void {
|
||||
const preForState = currentReachabilityState;
|
||||
const postForLabel = pushImplicitLabel();
|
||||
|
||||
@@ -506,11 +512,9 @@ namespace ts {
|
||||
const isInfiniteLoop = (!n.condition || n.condition.kind === SyntaxKind.TrueKeyword);
|
||||
const postForState = isInfiniteLoop ? Reachability.Unreachable : preForState;
|
||||
popImplicitLabel(postForLabel, postForState);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindForInOrForOfStatement(n: ForInStatement | ForOfStatement): boolean {
|
||||
function bindForInOrForOfStatement(n: ForInStatement | ForOfStatement): void {
|
||||
const preStatementState = currentReachabilityState;
|
||||
const postStatementLabel = pushImplicitLabel();
|
||||
|
||||
@@ -520,11 +524,9 @@ namespace ts {
|
||||
|
||||
bind(n.statement);
|
||||
popImplicitLabel(postStatementLabel, preStatementState);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindIfStatement(n: IfStatement): boolean {
|
||||
function bindIfStatement(n: IfStatement): void {
|
||||
// denotes reachability state when entering 'thenStatement' part of the if statement:
|
||||
// i.e. if condition is false then thenStatement is unreachable
|
||||
const ifTrueState = n.expression.kind === SyntaxKind.FalseKeyword ? Reachability.Unreachable : currentReachabilityState;
|
||||
@@ -547,22 +549,18 @@ namespace ts {
|
||||
else {
|
||||
currentReachabilityState = or(currentReachabilityState, ifFalseState);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindReturnOrThrow(n: ReturnStatement | ThrowStatement): boolean {
|
||||
function bindReturnOrThrow(n: ReturnStatement | ThrowStatement): void {
|
||||
// bind expression (don't affect reachability)
|
||||
bind(n.expression);
|
||||
if (n.kind === SyntaxKind.ReturnStatement) {
|
||||
hasExplicitReturn = true;
|
||||
}
|
||||
currentReachabilityState = Reachability.Unreachable;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindBreakOrContinueStatement(n: BreakOrContinueStatement): boolean {
|
||||
function bindBreakOrContinueStatement(n: BreakOrContinueStatement): void {
|
||||
// call bind on label (don't affect reachability)
|
||||
bind(n.label);
|
||||
// for continue case touch label so it will be marked a used
|
||||
@@ -570,10 +568,9 @@ namespace ts {
|
||||
if (isValidJump) {
|
||||
currentReachabilityState = Reachability.Unreachable;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindTryStatement(n: TryStatement): boolean {
|
||||
function bindTryStatement(n: TryStatement): void {
|
||||
// catch\finally blocks has the same reachability as try block
|
||||
const preTryState = currentReachabilityState;
|
||||
bind(n.tryBlock);
|
||||
@@ -590,11 +587,9 @@ namespace ts {
|
||||
// - post try state is reachable - control flow can fall out of try block
|
||||
// - post catch state is reachable - control flow can fall out of catch block
|
||||
currentReachabilityState = or(postTryState, postCatchState);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindSwitchStatement(n: SwitchStatement): boolean {
|
||||
function bindSwitchStatement(n: SwitchStatement): void {
|
||||
const preSwitchState = currentReachabilityState;
|
||||
const postSwitchLabel = pushImplicitLabel();
|
||||
|
||||
@@ -609,11 +604,9 @@ namespace ts {
|
||||
const postSwitchState = hasDefault && currentReachabilityState !== Reachability.Reachable ? Reachability.Unreachable : preSwitchState;
|
||||
|
||||
popImplicitLabel(postSwitchLabel, postSwitchState);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindCaseBlock(n: CaseBlock): boolean {
|
||||
function bindCaseBlock(n: CaseBlock): void {
|
||||
const startState = currentReachabilityState;
|
||||
|
||||
for (let clause of n.clauses) {
|
||||
@@ -623,11 +616,9 @@ namespace ts {
|
||||
errorOnFirstToken(clause, Diagnostics.Fallthrough_case_in_switch);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindLabeledStatement(n: LabeledStatement): boolean {
|
||||
function bindLabeledStatement(n: LabeledStatement): void {
|
||||
// call bind on label (don't affect reachability)
|
||||
bind(n.label);
|
||||
|
||||
@@ -636,8 +627,6 @@ namespace ts {
|
||||
if (ok) {
|
||||
popNamedLabel(n.label, currentReachabilityState);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function getContainerFlags(node: Node): ContainerFlags {
|
||||
@@ -1387,8 +1376,6 @@ namespace ts {
|
||||
}
|
||||
|
||||
function popNamedLabel(label: Identifier, outerState: Reachability): void {
|
||||
initializeReachabilityStateIfNecessary();
|
||||
|
||||
let index = labelIndexMap[label.text];
|
||||
Debug.assert(index !== undefined);
|
||||
Debug.assert(labelStack.length == index + 1);
|
||||
@@ -1399,8 +1386,6 @@ namespace ts {
|
||||
}
|
||||
|
||||
function popImplicitLabel(implicitLabelIndex: number, outerState: Reachability): void {
|
||||
initializeReachabilityStateIfNecessary();
|
||||
|
||||
Debug.assert(labelStack.length === implicitLabelIndex + 1, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`);
|
||||
let i = implicitLabels.pop();
|
||||
Debug.assert(implicitLabelIndex === i, `i: ${i}, index: ${implicitLabelIndex}`);
|
||||
@@ -1408,8 +1393,6 @@ namespace ts {
|
||||
}
|
||||
|
||||
function setCurrentStateAtLabel(innerMergedState: Reachability, outerState: Reachability, label: Identifier): void {
|
||||
initializeReachabilityStateIfNecessary();
|
||||
|
||||
if (innerMergedState === Reachability.Unintialized) {
|
||||
if (label && !options.allowUnusedLabels) {
|
||||
file.bindDiagnostics.push(createDiagnosticForNode(label, Diagnostics.Unused_label));
|
||||
|
||||
@@ -384,7 +384,9 @@ namespace ts {
|
||||
|
||||
Modifier = Export | Ambient | Public | Private | Protected | Static | Abstract | Default | Async,
|
||||
AccessibilityModifier = Public | Private | Protected,
|
||||
BlockScoped = Let | Const
|
||||
BlockScoped = Let | Const,
|
||||
|
||||
ReachabilityCheckFlags = HasImplicitReturn | HasExplicitReturn
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
tests/cases/compiler/bestCommonTypeReturnStatement.ts(7,5): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/bestCommonTypeReturnStatement.ts (1 errors) ====
|
||||
interface IPromise<T> {
|
||||
then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise<any>;
|
||||
}
|
||||
|
||||
function f() {
|
||||
if (true) return b();
|
||||
return d();
|
||||
~~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
}
|
||||
|
||||
|
||||
function b(): IPromise<void> { return null; }
|
||||
function d(): IPromise<any> { return null; }
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [bestCommonTypeReturnStatement.ts]
|
||||
|
||||
interface IPromise<T> {
|
||||
then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise<any>;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
=== tests/cases/compiler/bestCommonTypeReturnStatement.ts ===
|
||||
|
||||
interface IPromise<T> {
|
||||
>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 1, 19))
|
||||
|
||||
then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise<any>;
|
||||
>then : Symbol(then, Decl(bestCommonTypeReturnStatement.ts, 1, 23))
|
||||
>successCallback : Symbol(successCallback, Decl(bestCommonTypeReturnStatement.ts, 2, 9))
|
||||
>promiseValue : Symbol(promiseValue, Decl(bestCommonTypeReturnStatement.ts, 2, 27))
|
||||
>T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 1, 19))
|
||||
>errorCallback : Symbol(errorCallback, Decl(bestCommonTypeReturnStatement.ts, 2, 51))
|
||||
>reason : Symbol(reason, Decl(bestCommonTypeReturnStatement.ts, 2, 69))
|
||||
>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0))
|
||||
}
|
||||
|
||||
function f() {
|
||||
>f : Symbol(f, Decl(bestCommonTypeReturnStatement.ts, 3, 1))
|
||||
|
||||
if (true) return b();
|
||||
>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 8, 1))
|
||||
|
||||
return d();
|
||||
>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 11, 45))
|
||||
}
|
||||
|
||||
|
||||
function b(): IPromise<void> { return null; }
|
||||
>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, 11, 45))
|
||||
>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
=== tests/cases/compiler/bestCommonTypeReturnStatement.ts ===
|
||||
|
||||
interface IPromise<T> {
|
||||
>IPromise : IPromise<T>
|
||||
>T : T
|
||||
|
||||
then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise<any>;
|
||||
>then : (successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any) => IPromise<any>
|
||||
>successCallback : (promiseValue: T) => any
|
||||
>promiseValue : T
|
||||
>T : T
|
||||
>errorCallback : (reason: any) => any
|
||||
>reason : any
|
||||
>IPromise : IPromise<T>
|
||||
}
|
||||
|
||||
function f() {
|
||||
>f : () => IPromise<void>
|
||||
|
||||
if (true) return b();
|
||||
>true : boolean
|
||||
>b() : IPromise<void>
|
||||
>b : () => IPromise<void>
|
||||
|
||||
return d();
|
||||
>d() : IPromise<any>
|
||||
>d : () => IPromise<any>
|
||||
}
|
||||
|
||||
|
||||
function b(): IPromise<void> { return null; }
|
||||
>b : () => IPromise<void>
|
||||
>IPromise : IPromise<T>
|
||||
>null : null
|
||||
|
||||
function d(): IPromise<any> { return null; }
|
||||
>d : () => IPromise<any>
|
||||
>IPromise : IPromise<T>
|
||||
>null : null
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
tests/cases/compiler/breakTarget3.ts(2,1): error TS7028: Unused label.
|
||||
|
||||
|
||||
==== tests/cases/compiler/breakTarget3.ts (1 errors) ====
|
||||
target1:
|
||||
target2:
|
||||
~~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (true) {
|
||||
break target1;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [breakTarget3.ts]
|
||||
|
||||
target1:
|
||||
target2:
|
||||
while (true) {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/compiler/breakTarget3.ts ===
|
||||
|
||||
No type information for this code.target1:
|
||||
No type information for this code.target2:
|
||||
No type information for this code.while (true) {
|
||||
No type information for this code. break target1;
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/breakTarget3.ts ===
|
||||
|
||||
target1:
|
||||
>target1 : any
|
||||
|
||||
target2:
|
||||
>target2 : any
|
||||
|
||||
while (true) {
|
||||
>true : boolean
|
||||
|
||||
break target1;
|
||||
>target1 : any
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
tests/cases/compiler/breakTarget4.ts(1,1): error TS7028: Unused label.
|
||||
|
||||
|
||||
==== tests/cases/compiler/breakTarget4.ts (1 errors) ====
|
||||
target1:
|
||||
~~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
target2:
|
||||
while (true) {
|
||||
break target2;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [breakTarget4.ts]
|
||||
|
||||
target1:
|
||||
target2:
|
||||
while (true) {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/compiler/breakTarget4.ts ===
|
||||
|
||||
No type information for this code.target1:
|
||||
No type information for this code.target2:
|
||||
No type information for this code.while (true) {
|
||||
No type information for this code. break target2;
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/breakTarget4.ts ===
|
||||
|
||||
target1:
|
||||
>target1 : any
|
||||
|
||||
target2:
|
||||
>target2 : any
|
||||
|
||||
while (true) {
|
||||
>true : boolean
|
||||
|
||||
break target2;
|
||||
>target2 : any
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
tests/cases/compiler/breakTarget5.ts(1,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/breakTarget5.ts(5,7): error TS1107: Jump target cannot cross function boundary.
|
||||
tests/cases/compiler/breakTarget5.ts(6,7): error TS1107: Jump target cannot cross function boundary.
|
||||
|
||||
|
||||
==== tests/cases/compiler/breakTarget5.ts (2 errors) ====
|
||||
==== tests/cases/compiler/breakTarget5.ts (1 errors) ====
|
||||
|
||||
target:
|
||||
~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (true) {
|
||||
function f() {
|
||||
while (true) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [breakTarget5.ts]
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
|
||||
-126
@@ -1,126 +0,0 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts(28,9): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts (1 errors) ====
|
||||
// Call signatures without a return type should infer one from the function body (if present)
|
||||
|
||||
// Simple types
|
||||
function foo(x) {
|
||||
return 1;
|
||||
}
|
||||
var r = foo(1);
|
||||
|
||||
function foo2(x) {
|
||||
return foo(x);
|
||||
}
|
||||
var r2 = foo2(1);
|
||||
|
||||
function foo3() {
|
||||
return foo3();
|
||||
}
|
||||
var r3 = foo3();
|
||||
|
||||
function foo4<T>(x: T) {
|
||||
return x;
|
||||
}
|
||||
var r4 = foo4(1);
|
||||
|
||||
function foo5(x) {
|
||||
if (true) {
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
~~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
}
|
||||
}
|
||||
var r5 = foo5(1);
|
||||
|
||||
function foo6(x) {
|
||||
try {
|
||||
}
|
||||
catch (e) {
|
||||
return [];
|
||||
}
|
||||
finally {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
var r6 = foo6(1);
|
||||
|
||||
function foo7(x) {
|
||||
return typeof x;
|
||||
}
|
||||
var r7 = foo7(1);
|
||||
|
||||
// object types
|
||||
function foo8(x: number) {
|
||||
return { x: x };
|
||||
}
|
||||
var r8 = foo8(1);
|
||||
|
||||
interface I {
|
||||
foo: string;
|
||||
}
|
||||
function foo9(x: number) {
|
||||
var i: I;
|
||||
return i;
|
||||
}
|
||||
var r9 = foo9(1);
|
||||
|
||||
class C {
|
||||
foo: string;
|
||||
}
|
||||
function foo10(x: number) {
|
||||
var c: C;
|
||||
return c;
|
||||
}
|
||||
var r10 = foo10(1);
|
||||
|
||||
module M {
|
||||
export var x = 1;
|
||||
export class C { foo: string }
|
||||
}
|
||||
function foo11() {
|
||||
return M;
|
||||
}
|
||||
var r11 = foo11();
|
||||
|
||||
// merged declarations
|
||||
interface I2 {
|
||||
x: number;
|
||||
}
|
||||
interface I2 {
|
||||
y: number;
|
||||
}
|
||||
function foo12() {
|
||||
var i2: I2;
|
||||
return i2;
|
||||
}
|
||||
var r12 = foo12();
|
||||
|
||||
function m1() { return 1; }
|
||||
module m1 { export var y = 2; }
|
||||
function foo13() {
|
||||
return m1;
|
||||
}
|
||||
var r13 = foo13();
|
||||
|
||||
class c1 {
|
||||
foo: string;
|
||||
constructor(x) { }
|
||||
}
|
||||
module c1 {
|
||||
export var x = 1;
|
||||
}
|
||||
function foo14() {
|
||||
return c1;
|
||||
}
|
||||
var r14 = foo14();
|
||||
|
||||
enum e1 { A }
|
||||
module e1 { export var y = 1; }
|
||||
function foo15() {
|
||||
return e1;
|
||||
}
|
||||
var r15 = foo15();
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [callSignatureWithoutReturnTypeAnnotationInference.ts]
|
||||
|
||||
// Call signatures without a return type should infer one from the function body (if present)
|
||||
|
||||
// Simple types
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts ===
|
||||
|
||||
// Call signatures without a return type should infer one from the function body (if present)
|
||||
|
||||
// Simple types
|
||||
function foo(x) {
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 4, 13))
|
||||
|
||||
return 1;
|
||||
}
|
||||
var r = foo(1);
|
||||
>r : Symbol(r, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 7, 3))
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0))
|
||||
|
||||
function foo2(x) {
|
||||
>foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 7, 15))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 9, 14))
|
||||
|
||||
return foo(x);
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 9, 14))
|
||||
}
|
||||
var r2 = foo2(1);
|
||||
>r2 : Symbol(r2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 3))
|
||||
>foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 7, 15))
|
||||
|
||||
function foo3() {
|
||||
>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 17))
|
||||
|
||||
return foo3();
|
||||
>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 17))
|
||||
}
|
||||
var r3 = foo3();
|
||||
>r3 : Symbol(r3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 17, 3))
|
||||
>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 12, 17))
|
||||
|
||||
function foo4<T>(x: T) {
|
||||
>foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 17, 16))
|
||||
>T : Symbol(T, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 19, 14))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 19, 17))
|
||||
>T : Symbol(T, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 19, 14))
|
||||
|
||||
return x;
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 19, 17))
|
||||
}
|
||||
var r4 = foo4(1);
|
||||
>r4 : Symbol(r4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 22, 3))
|
||||
>foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 17, 16))
|
||||
|
||||
function foo5(x) {
|
||||
>foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 22, 17))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 24, 14))
|
||||
|
||||
if (true) {
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
var r5 = foo5(1);
|
||||
>r5 : Symbol(r5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 31, 3))
|
||||
>foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 22, 17))
|
||||
|
||||
function foo6(x) {
|
||||
>foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 31, 17))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 33, 14))
|
||||
|
||||
try {
|
||||
}
|
||||
catch (e) {
|
||||
>e : Symbol(e, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 36, 11))
|
||||
|
||||
return [];
|
||||
}
|
||||
finally {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
var r6 = foo6(1);
|
||||
>r6 : Symbol(r6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 43, 3))
|
||||
>foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 31, 17))
|
||||
|
||||
function foo7(x) {
|
||||
>foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 43, 17))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 45, 14))
|
||||
|
||||
return typeof x;
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 45, 14))
|
||||
}
|
||||
var r7 = foo7(1);
|
||||
>r7 : Symbol(r7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 48, 3))
|
||||
>foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 43, 17))
|
||||
|
||||
// object types
|
||||
function foo8(x: number) {
|
||||
>foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 48, 17))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 51, 14))
|
||||
|
||||
return { x: x };
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 52, 12))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 51, 14))
|
||||
}
|
||||
var r8 = foo8(1);
|
||||
>r8 : Symbol(r8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 54, 3))
|
||||
>foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 48, 17))
|
||||
|
||||
interface I {
|
||||
>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 54, 17))
|
||||
|
||||
foo: string;
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 56, 13))
|
||||
}
|
||||
function foo9(x: number) {
|
||||
>foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 58, 1))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 59, 14))
|
||||
|
||||
var i: I;
|
||||
>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 60, 7))
|
||||
>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 54, 17))
|
||||
|
||||
return i;
|
||||
>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 60, 7))
|
||||
}
|
||||
var r9 = foo9(1);
|
||||
>r9 : Symbol(r9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 63, 3))
|
||||
>foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 58, 1))
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 63, 17))
|
||||
|
||||
foo: string;
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 65, 9))
|
||||
}
|
||||
function foo10(x: number) {
|
||||
>foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 67, 1))
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 68, 15))
|
||||
|
||||
var c: C;
|
||||
>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 69, 7))
|
||||
>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 63, 17))
|
||||
|
||||
return c;
|
||||
>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 69, 7))
|
||||
}
|
||||
var r10 = foo10(1);
|
||||
>r10 : Symbol(r10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 72, 3))
|
||||
>foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 67, 1))
|
||||
|
||||
module M {
|
||||
>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 72, 19))
|
||||
|
||||
export var x = 1;
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 75, 14))
|
||||
|
||||
export class C { foo: string }
|
||||
>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 75, 21))
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 20))
|
||||
}
|
||||
function foo11() {
|
||||
>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 77, 1))
|
||||
|
||||
return M;
|
||||
>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 72, 19))
|
||||
}
|
||||
var r11 = foo11();
|
||||
>r11 : Symbol(r11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 81, 3))
|
||||
>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 77, 1))
|
||||
|
||||
// merged declarations
|
||||
interface I2 {
|
||||
>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 81, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 1))
|
||||
|
||||
x: number;
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 84, 14))
|
||||
}
|
||||
interface I2 {
|
||||
>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 81, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 1))
|
||||
|
||||
y: number;
|
||||
>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 87, 14))
|
||||
}
|
||||
function foo12() {
|
||||
>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 89, 1))
|
||||
|
||||
var i2: I2;
|
||||
>i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 91, 7))
|
||||
>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 81, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 1))
|
||||
|
||||
return i2;
|
||||
>i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 91, 7))
|
||||
}
|
||||
var r12 = foo12();
|
||||
>r12 : Symbol(r12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 94, 3))
|
||||
>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 89, 1))
|
||||
|
||||
function m1() { return 1; }
|
||||
>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 94, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 27))
|
||||
|
||||
module m1 { export var y = 2; }
|
||||
>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 94, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 27))
|
||||
>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 97, 22))
|
||||
|
||||
function foo13() {
|
||||
>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 97, 31))
|
||||
|
||||
return m1;
|
||||
>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 94, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 27))
|
||||
}
|
||||
var r13 = foo13();
|
||||
>r13 : Symbol(r13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 3))
|
||||
>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 97, 31))
|
||||
|
||||
class c1 {
|
||||
>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 106, 1))
|
||||
|
||||
foo: string;
|
||||
>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 103, 10))
|
||||
|
||||
constructor(x) { }
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 16))
|
||||
}
|
||||
module c1 {
|
||||
>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 106, 1))
|
||||
|
||||
export var x = 1;
|
||||
>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 14))
|
||||
}
|
||||
function foo14() {
|
||||
>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 109, 1))
|
||||
|
||||
return c1;
|
||||
>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 101, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 106, 1))
|
||||
}
|
||||
var r14 = foo14();
|
||||
>r14 : Symbol(r14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 113, 3))
|
||||
>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 109, 1))
|
||||
|
||||
enum e1 { A }
|
||||
>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 113, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 13))
|
||||
>A : Symbol(e1.A, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 9))
|
||||
|
||||
module e1 { export var y = 1; }
|
||||
>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 113, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 13))
|
||||
>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 116, 22))
|
||||
|
||||
function foo15() {
|
||||
>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 116, 31))
|
||||
|
||||
return e1;
|
||||
>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 113, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 13))
|
||||
}
|
||||
var r15 = foo15();
|
||||
>r15 : Symbol(r15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 120, 3))
|
||||
>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 116, 31))
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts ===
|
||||
|
||||
// Call signatures without a return type should infer one from the function body (if present)
|
||||
|
||||
// Simple types
|
||||
function foo(x) {
|
||||
>foo : (x: any) => number
|
||||
>x : any
|
||||
|
||||
return 1;
|
||||
>1 : number
|
||||
}
|
||||
var r = foo(1);
|
||||
>r : number
|
||||
>foo(1) : number
|
||||
>foo : (x: any) => number
|
||||
>1 : number
|
||||
|
||||
function foo2(x) {
|
||||
>foo2 : (x: any) => number
|
||||
>x : any
|
||||
|
||||
return foo(x);
|
||||
>foo(x) : number
|
||||
>foo : (x: any) => number
|
||||
>x : any
|
||||
}
|
||||
var r2 = foo2(1);
|
||||
>r2 : number
|
||||
>foo2(1) : number
|
||||
>foo2 : (x: any) => number
|
||||
>1 : number
|
||||
|
||||
function foo3() {
|
||||
>foo3 : () => any
|
||||
|
||||
return foo3();
|
||||
>foo3() : any
|
||||
>foo3 : () => any
|
||||
}
|
||||
var r3 = foo3();
|
||||
>r3 : any
|
||||
>foo3() : any
|
||||
>foo3 : () => any
|
||||
|
||||
function foo4<T>(x: T) {
|
||||
>foo4 : <T>(x: T) => T
|
||||
>T : T
|
||||
>x : T
|
||||
>T : T
|
||||
|
||||
return x;
|
||||
>x : T
|
||||
}
|
||||
var r4 = foo4(1);
|
||||
>r4 : number
|
||||
>foo4(1) : number
|
||||
>foo4 : <T>(x: T) => T
|
||||
>1 : number
|
||||
|
||||
function foo5(x) {
|
||||
>foo5 : (x: any) => number
|
||||
>x : any
|
||||
|
||||
if (true) {
|
||||
>true : boolean
|
||||
|
||||
return 1;
|
||||
>1 : number
|
||||
|
||||
} else {
|
||||
return 2;
|
||||
>2 : number
|
||||
}
|
||||
}
|
||||
var r5 = foo5(1);
|
||||
>r5 : number
|
||||
>foo5(1) : number
|
||||
>foo5 : (x: any) => number
|
||||
>1 : number
|
||||
|
||||
function foo6(x) {
|
||||
>foo6 : (x: any) => any[]
|
||||
>x : any
|
||||
|
||||
try {
|
||||
}
|
||||
catch (e) {
|
||||
>e : any
|
||||
|
||||
return [];
|
||||
>[] : undefined[]
|
||||
}
|
||||
finally {
|
||||
return [];
|
||||
>[] : undefined[]
|
||||
}
|
||||
}
|
||||
var r6 = foo6(1);
|
||||
>r6 : any[]
|
||||
>foo6(1) : any[]
|
||||
>foo6 : (x: any) => any[]
|
||||
>1 : number
|
||||
|
||||
function foo7(x) {
|
||||
>foo7 : (x: any) => string
|
||||
>x : any
|
||||
|
||||
return typeof x;
|
||||
>typeof x : string
|
||||
>x : any
|
||||
}
|
||||
var r7 = foo7(1);
|
||||
>r7 : string
|
||||
>foo7(1) : string
|
||||
>foo7 : (x: any) => string
|
||||
>1 : number
|
||||
|
||||
// object types
|
||||
function foo8(x: number) {
|
||||
>foo8 : (x: number) => { x: number; }
|
||||
>x : number
|
||||
|
||||
return { x: x };
|
||||
>{ x: x } : { x: number; }
|
||||
>x : number
|
||||
>x : number
|
||||
}
|
||||
var r8 = foo8(1);
|
||||
>r8 : { x: number; }
|
||||
>foo8(1) : { x: number; }
|
||||
>foo8 : (x: number) => { x: number; }
|
||||
>1 : number
|
||||
|
||||
interface I {
|
||||
>I : I
|
||||
|
||||
foo: string;
|
||||
>foo : string
|
||||
}
|
||||
function foo9(x: number) {
|
||||
>foo9 : (x: number) => I
|
||||
>x : number
|
||||
|
||||
var i: I;
|
||||
>i : I
|
||||
>I : I
|
||||
|
||||
return i;
|
||||
>i : I
|
||||
}
|
||||
var r9 = foo9(1);
|
||||
>r9 : I
|
||||
>foo9(1) : I
|
||||
>foo9 : (x: number) => I
|
||||
>1 : number
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
foo: string;
|
||||
>foo : string
|
||||
}
|
||||
function foo10(x: number) {
|
||||
>foo10 : (x: number) => C
|
||||
>x : number
|
||||
|
||||
var c: C;
|
||||
>c : C
|
||||
>C : C
|
||||
|
||||
return c;
|
||||
>c : C
|
||||
}
|
||||
var r10 = foo10(1);
|
||||
>r10 : C
|
||||
>foo10(1) : C
|
||||
>foo10 : (x: number) => C
|
||||
>1 : number
|
||||
|
||||
module M {
|
||||
>M : typeof M
|
||||
|
||||
export var x = 1;
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
export class C { foo: string }
|
||||
>C : C
|
||||
>foo : string
|
||||
}
|
||||
function foo11() {
|
||||
>foo11 : () => typeof M
|
||||
|
||||
return M;
|
||||
>M : typeof M
|
||||
}
|
||||
var r11 = foo11();
|
||||
>r11 : typeof M
|
||||
>foo11() : typeof M
|
||||
>foo11 : () => typeof M
|
||||
|
||||
// merged declarations
|
||||
interface I2 {
|
||||
>I2 : I2
|
||||
|
||||
x: number;
|
||||
>x : number
|
||||
}
|
||||
interface I2 {
|
||||
>I2 : I2
|
||||
|
||||
y: number;
|
||||
>y : number
|
||||
}
|
||||
function foo12() {
|
||||
>foo12 : () => I2
|
||||
|
||||
var i2: I2;
|
||||
>i2 : I2
|
||||
>I2 : I2
|
||||
|
||||
return i2;
|
||||
>i2 : I2
|
||||
}
|
||||
var r12 = foo12();
|
||||
>r12 : I2
|
||||
>foo12() : I2
|
||||
>foo12 : () => I2
|
||||
|
||||
function m1() { return 1; }
|
||||
>m1 : typeof m1
|
||||
>1 : number
|
||||
|
||||
module m1 { export var y = 2; }
|
||||
>m1 : typeof m1
|
||||
>y : number
|
||||
>2 : number
|
||||
|
||||
function foo13() {
|
||||
>foo13 : () => typeof m1
|
||||
|
||||
return m1;
|
||||
>m1 : typeof m1
|
||||
}
|
||||
var r13 = foo13();
|
||||
>r13 : typeof m1
|
||||
>foo13() : typeof m1
|
||||
>foo13 : () => typeof m1
|
||||
|
||||
class c1 {
|
||||
>c1 : c1
|
||||
|
||||
foo: string;
|
||||
>foo : string
|
||||
|
||||
constructor(x) { }
|
||||
>x : any
|
||||
}
|
||||
module c1 {
|
||||
>c1 : typeof c1
|
||||
|
||||
export var x = 1;
|
||||
>x : number
|
||||
>1 : number
|
||||
}
|
||||
function foo14() {
|
||||
>foo14 : () => typeof c1
|
||||
|
||||
return c1;
|
||||
>c1 : typeof c1
|
||||
}
|
||||
var r14 = foo14();
|
||||
>r14 : typeof c1
|
||||
>foo14() : typeof c1
|
||||
>foo14 : () => typeof c1
|
||||
|
||||
enum e1 { A }
|
||||
>e1 : e1
|
||||
>A : e1
|
||||
|
||||
module e1 { export var y = 1; }
|
||||
>e1 : typeof e1
|
||||
>y : number
|
||||
>1 : number
|
||||
|
||||
function foo15() {
|
||||
>foo15 : () => typeof e1
|
||||
|
||||
return e1;
|
||||
>e1 : typeof e1
|
||||
}
|
||||
var r15 = foo15();
|
||||
>r15 : typeof e1
|
||||
>foo15() : typeof e1
|
||||
>foo15 : () => typeof e1
|
||||
|
||||
@@ -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,81 +1,81 @@
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(7,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(8,9): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(11,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(12,9): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(15,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(16,9): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(21,5): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(8,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(9,9): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(12,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(13,9): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(16,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(17,9): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(22,5): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(25,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(23,5): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(26,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(30,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(31,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(33,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(34,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(37,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(38,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(40,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(41,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(44,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(27,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(31,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(32,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(34,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(35,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(38,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(39,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(41,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(42,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(45,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(46,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(47,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(48,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(49,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(46,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(47,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(48,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(49,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(50,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(51,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(52,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(53,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(54,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(55,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(58,3): error TS7028: Unused label.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(58,9): error TS1128: Declaration or statement expected.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(52,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(53,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(54,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(55,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(56,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(59,9): error TS1128: Declaration or statement expected.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(62,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(63,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(69,15): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(60,9): error TS1128: Declaration or statement expected.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(63,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(64,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(70,15): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(74,15): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(71,15): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(75,15): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(79,15): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(76,15): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(80,15): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(85,21): error TS1128: Declaration or statement expected.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(81,15): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(86,21): error TS1128: Declaration or statement expected.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(87,11): error TS1005: ';' expected.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(87,21): error TS1128: Declaration or statement expected.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(88,11): error TS1005: ';' expected.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(91,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(92,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(95,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(89,11): error TS1005: ';' expected.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(92,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(93,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(96,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(97,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(98,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(99,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(100,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(101,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(102,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(103,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(104,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(97,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(98,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(99,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(100,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(101,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(102,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(103,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(104,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(105,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(106,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(107,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(108,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(107,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(108,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(109,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(110,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(111,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(112,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(113,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(114,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(115,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(116,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(117,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(118,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(119,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(120,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(121,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(122,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(111,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(112,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(113,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(114,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(115,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(116,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(117,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(118,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(119,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(120,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(121,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(122,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(123,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts (75 errors) ====
|
||||
==== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts (74 errors) ====
|
||||
|
||||
// expected error for all the LHS of compound assignments (arithmetic and addition)
|
||||
var value;
|
||||
|
||||
@@ -194,8 +194,6 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa
|
||||
|
||||
// object literals
|
||||
{ a: 0} *= value;
|
||||
~
|
||||
!!! error TS7028: Unused label.
|
||||
~~
|
||||
!!! error TS1128: Declaration or statement expected.
|
||||
{ a: 0} += value;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [compoundAssignmentLHSIsValue.ts]
|
||||
|
||||
// expected error for all the LHS of compound assignments (arithmetic and addition)
|
||||
var value;
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
tests/cases/compiler/conditionalExpressions2.ts(9,54): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/conditionalExpressions2.ts (1 errors) ====
|
||||
var a = false ? 1 : null;
|
||||
var b = false ? undefined : 0;
|
||||
var c = false ? 1 : 0;
|
||||
var d = false ? false : true;
|
||||
var e = false ? "foo" : "bar";
|
||||
var f = false ? null : undefined;
|
||||
var g = true ? {g:5} : null;
|
||||
var h = [{h:5}, null];
|
||||
function i() { if (true) { return { x: 5 }; } else { return null; } }
|
||||
~~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [conditionalExpressions2.ts]
|
||||
|
||||
var a = false ? 1 : null;
|
||||
var b = false ? undefined : 0;
|
||||
var c = false ? 1 : 0;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
=== tests/cases/compiler/conditionalExpressions2.ts ===
|
||||
|
||||
var a = false ? 1 : null;
|
||||
>a : Symbol(a, Decl(conditionalExpressions2.ts, 1, 3))
|
||||
|
||||
var b = false ? undefined : 0;
|
||||
>b : Symbol(b, Decl(conditionalExpressions2.ts, 2, 3))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
var c = false ? 1 : 0;
|
||||
>c : Symbol(c, Decl(conditionalExpressions2.ts, 3, 3))
|
||||
|
||||
var d = false ? false : true;
|
||||
>d : Symbol(d, Decl(conditionalExpressions2.ts, 4, 3))
|
||||
|
||||
var e = false ? "foo" : "bar";
|
||||
>e : Symbol(e, Decl(conditionalExpressions2.ts, 5, 3))
|
||||
|
||||
var f = false ? null : undefined;
|
||||
>f : Symbol(f, Decl(conditionalExpressions2.ts, 6, 3))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
var g = true ? {g:5} : null;
|
||||
>g : Symbol(g, Decl(conditionalExpressions2.ts, 7, 3))
|
||||
>g : Symbol(g, Decl(conditionalExpressions2.ts, 7, 16))
|
||||
|
||||
var h = [{h:5}, null];
|
||||
>h : Symbol(h, Decl(conditionalExpressions2.ts, 8, 3))
|
||||
>h : Symbol(h, Decl(conditionalExpressions2.ts, 8, 10))
|
||||
|
||||
function i() { if (true) { return { x: 5 }; } else { return null; } }
|
||||
>i : Symbol(i, Decl(conditionalExpressions2.ts, 8, 22))
|
||||
>x : Symbol(x, Decl(conditionalExpressions2.ts, 9, 35))
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
=== tests/cases/compiler/conditionalExpressions2.ts ===
|
||||
|
||||
var a = false ? 1 : null;
|
||||
>a : number
|
||||
>false ? 1 : null : number
|
||||
>false : boolean
|
||||
>1 : number
|
||||
>null : null
|
||||
|
||||
var b = false ? undefined : 0;
|
||||
>b : number
|
||||
>false ? undefined : 0 : number
|
||||
>false : boolean
|
||||
>undefined : undefined
|
||||
>0 : number
|
||||
|
||||
var c = false ? 1 : 0;
|
||||
>c : number
|
||||
>false ? 1 : 0 : number
|
||||
>false : boolean
|
||||
>1 : number
|
||||
>0 : number
|
||||
|
||||
var d = false ? false : true;
|
||||
>d : boolean
|
||||
>false ? false : true : boolean
|
||||
>false : boolean
|
||||
>false : boolean
|
||||
>true : boolean
|
||||
|
||||
var e = false ? "foo" : "bar";
|
||||
>e : string
|
||||
>false ? "foo" : "bar" : string
|
||||
>false : boolean
|
||||
>"foo" : string
|
||||
>"bar" : string
|
||||
|
||||
var f = false ? null : undefined;
|
||||
>f : any
|
||||
>false ? null : undefined : null
|
||||
>false : boolean
|
||||
>null : null
|
||||
>undefined : undefined
|
||||
|
||||
var g = true ? {g:5} : null;
|
||||
>g : { g: number; }
|
||||
>true ? {g:5} : null : { g: number; }
|
||||
>true : boolean
|
||||
>{g:5} : { g: number; }
|
||||
>g : number
|
||||
>5 : number
|
||||
>null : null
|
||||
|
||||
var h = [{h:5}, null];
|
||||
>h : { h: number; }[]
|
||||
>[{h:5}, null] : { h: number; }[]
|
||||
>{h:5} : { h: number; }
|
||||
>h : number
|
||||
>5 : number
|
||||
>null : null
|
||||
|
||||
function i() { if (true) { return { x: 5 }; } else { return null; } }
|
||||
>i : () => { x: number; }
|
||||
>true : boolean
|
||||
>{ x: 5 } : { x: number; }
|
||||
>x : number
|
||||
>5 : number
|
||||
>null : null
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
tests/cases/compiler/constDeclarations-invalidContexts.ts(4,5): error TS1156: 'const' declarations can only be declared inside a block.
|
||||
tests/cases/compiler/constDeclarations-invalidContexts.ts(6,5): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/constDeclarations-invalidContexts.ts(6,5): error TS1156: 'const' declarations can only be declared inside a block.
|
||||
tests/cases/compiler/constDeclarations-invalidContexts.ts(9,5): error TS1156: 'const' declarations can only be declared inside a block.
|
||||
tests/cases/compiler/constDeclarations-invalidContexts.ts(11,1): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/constDeclarations-invalidContexts.ts(12,5): error TS1156: 'const' declarations can only be declared inside a block.
|
||||
tests/cases/compiler/constDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'.
|
||||
tests/cases/compiler/constDeclarations-invalidContexts.ts(20,5): error TS1156: 'const' declarations can only be declared inside a block.
|
||||
@@ -11,7 +9,7 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(26,12): error TS1156:
|
||||
tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: 'const' declarations can only be declared inside a block.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constDeclarations-invalidContexts.ts (11 errors) ====
|
||||
==== tests/cases/compiler/constDeclarations-invalidContexts.ts (9 errors) ====
|
||||
|
||||
// Errors, const must be defined inside a block
|
||||
if (true)
|
||||
@@ -20,8 +18,6 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156:
|
||||
!!! error TS1156: 'const' declarations can only be declared inside a block.
|
||||
else
|
||||
const c2 = 0;
|
||||
~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS1156: 'const' declarations can only be declared inside a block.
|
||||
|
||||
@@ -31,8 +27,6 @@ tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156:
|
||||
!!! error TS1156: 'const' declarations can only be declared inside a block.
|
||||
|
||||
do
|
||||
~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
const c4 = 0;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS1156: 'const' declarations can only be declared inside a block.
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
tests/cases/compiler/constDeclarations-validContexts.ts(8,5): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/constDeclarations-validContexts.ts(15,1): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constDeclarations-validContexts.ts (3 errors) ====
|
||||
==== tests/cases/compiler/constDeclarations-validContexts.ts (1 errors) ====
|
||||
|
||||
|
||||
// Control flow statements with blocks
|
||||
@@ -12,8 +10,6 @@ tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All
|
||||
}
|
||||
else {
|
||||
const c2 = 0;
|
||||
~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
}
|
||||
|
||||
while (true) {
|
||||
@@ -21,8 +17,6 @@ tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All
|
||||
}
|
||||
|
||||
do {
|
||||
~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
const c4 = 0;
|
||||
} while (true);
|
||||
|
||||
|
||||
@@ -1,91 +1,90 @@
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2304: Cannot find name 'module'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,28): error TS1005: ':' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,29): error TS1005: ',' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,18): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,26): error TS2304: Cannot find name 'bfs'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: '=' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,26): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,28): error TS2304: Cannot find name 'bfs'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(38,17): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,28): error TS2304: Cannot find name 'bfs'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,41): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,45): error TS1002: Unterminated string literal.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS2304: Cannot find name 'console'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(49,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2304: Cannot find name 'console'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(81,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(90,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(105,29): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(106,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(138,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(141,32): error TS1005: '{' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(143,13): error TS1005: 'try' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,24): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '(' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(166,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(205,28): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(213,16): error TS2304: Cannot find name 'bool'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(223,23): error TS2304: Cannot find name 'bool'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(227,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(234,14): error TS1005: '{' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,9): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,16): error TS2304: Cannot find name 'method1'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,24): error TS2304: Cannot find name 'val'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,28): error TS2304: Cannot find name 'number'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS2304: Cannot find name 'method2'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,26): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(241,5): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(246,25): error TS2339: Property 'method1' does not exist on type 'B'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,9): error TS2390: Constructor implementation is missing.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,21): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,44): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,69): error TS1110: Type expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,9): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,16): error TS2304: Cannot find name 'Overloads'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,26): error TS2304: Cannot find name 'value'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,31): error TS1005: ',' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(12,13): error TS2304: Cannot find name 'module'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(12,13): error TS2503: Cannot find namespace 'module'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(12,19): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(23,35): error TS1005: ')' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(23,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(25,28): error TS1005: ':' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(25,29): error TS1005: ',' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,18): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,26): error TS2304: Cannot find name 'bfs'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(29,30): error TS1005: '=' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(32,18): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,26): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,28): error TS2304: Cannot find name 'bfs'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(36,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(39,17): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,28): error TS2304: Cannot find name 'bfs'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,41): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,45): error TS1002: Unterminated string literal.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(42,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(48,17): error TS2304: Cannot find name 'console'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(50,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(54,13): error TS2304: Cannot find name 'console'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(59,5): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(70,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(73,37): error TS1127: Invalid character.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(82,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(90,23): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(91,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(106,29): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(107,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(109,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(139,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(142,32): error TS1005: '{' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(144,13): error TS1005: 'try' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,24): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,30): error TS1005: '(' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,31): error TS2304: Cannot find name 'Property'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(167,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(181,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(206,28): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(214,16): error TS2304: Cannot find name 'bool'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(219,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(224,23): error TS2304: Cannot find name 'bool'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(228,13): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,14): error TS1005: '{' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,9): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,16): error TS2304: Cannot find name 'method1'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,24): error TS2304: Cannot find name 'val'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,27): error TS1005: ',' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,28): error TS2304: Cannot find name 'number'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,36): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(239,9): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(239,16): error TS2304: Cannot find name 'method2'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(239,26): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(242,5): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(247,25): error TS2339: Property 'method1' does not exist on type 'B'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(255,9): error TS2390: Constructor implementation is missing.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(255,21): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(255,44): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(255,69): error TS1110: Type expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,9): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,16): error TS2304: Cannot find name 'Overloads'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error TS1135: Argument expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS2304: Cannot find name 'public'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS2304: Cannot find name 'DefaultValue'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error TS2304: Cannot find name 'value'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,26): error TS2304: Cannot find name 'value'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,31): error TS1005: ',' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,9): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,16): error TS2304: Cannot find name 'Overloads'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,27): error TS1135: Argument expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,33): error TS1005: '(' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,35): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,43): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,52): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,60): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(258,65): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,9): error TS2304: Cannot find name 'public'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,16): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,16): error TS2304: Cannot find name 'DefaultValue'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,29): error TS2304: Cannot find name 'value'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,35): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,37): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,55): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS1128: Declaration or statement expected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (85 errors) ====
|
||||
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (83 errors) ====
|
||||
|
||||
declare module "fs" {
|
||||
export class File {
|
||||
constructor(filename: string);
|
||||
@@ -142,8 +141,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS
|
||||
^
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
retValue = bfs.TYPES();
|
||||
@@ -437,8 +434,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS
|
||||
!!! error TS1128: Declaration or statement expected.
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'method2'.
|
||||
~~~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
return 2 * this.method1(2);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [constructorWithIncompleteTypeAnnotation.ts]
|
||||
|
||||
declare module "fs" {
|
||||
export class File {
|
||||
constructor(filename: string);
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
tests/cases/compiler/continueNotInIterationStatement4.ts(1,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/continueNotInIterationStatement4.ts(4,5): error TS1107: Jump target cannot cross function boundary.
|
||||
tests/cases/compiler/continueNotInIterationStatement4.ts(5,5): error TS1107: Jump target cannot cross function boundary.
|
||||
|
||||
|
||||
==== tests/cases/compiler/continueNotInIterationStatement4.ts (2 errors) ====
|
||||
==== tests/cases/compiler/continueNotInIterationStatement4.ts (1 errors) ====
|
||||
|
||||
TWO:
|
||||
~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (true){
|
||||
var x = () => {
|
||||
continue TWO;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [continueNotInIterationStatement4.ts]
|
||||
|
||||
TWO:
|
||||
while (true){
|
||||
var x = () => {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
tests/cases/compiler/continueTarget3.ts(2,1): error TS7028: Unused label.
|
||||
|
||||
|
||||
==== tests/cases/compiler/continueTarget3.ts (1 errors) ====
|
||||
target1:
|
||||
target2:
|
||||
~~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (true) {
|
||||
continue target1;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [continueTarget3.ts]
|
||||
|
||||
target1:
|
||||
target2:
|
||||
while (true) {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/compiler/continueTarget3.ts ===
|
||||
|
||||
No type information for this code.target1:
|
||||
No type information for this code.target2:
|
||||
No type information for this code.while (true) {
|
||||
No type information for this code. continue target1;
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/continueTarget3.ts ===
|
||||
|
||||
target1:
|
||||
>target1 : any
|
||||
|
||||
target2:
|
||||
>target2 : any
|
||||
|
||||
while (true) {
|
||||
>true : boolean
|
||||
|
||||
continue target1;
|
||||
>target1 : any
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
tests/cases/compiler/continueTarget4.ts(1,1): error TS7028: Unused label.
|
||||
|
||||
|
||||
==== tests/cases/compiler/continueTarget4.ts (1 errors) ====
|
||||
target1:
|
||||
~~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
target2:
|
||||
while (true) {
|
||||
continue target2;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [continueTarget4.ts]
|
||||
|
||||
target1:
|
||||
target2:
|
||||
while (true) {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/compiler/continueTarget4.ts ===
|
||||
|
||||
No type information for this code.target1:
|
||||
No type information for this code.target2:
|
||||
No type information for this code.while (true) {
|
||||
No type information for this code. continue target2;
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/continueTarget4.ts ===
|
||||
|
||||
target1:
|
||||
>target1 : any
|
||||
|
||||
target2:
|
||||
>target2 : any
|
||||
|
||||
while (true) {
|
||||
>true : boolean
|
||||
|
||||
continue target2;
|
||||
>target2 : any
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
tests/cases/compiler/continueTarget5.ts(1,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/continueTarget5.ts(5,7): error TS1107: Jump target cannot cross function boundary.
|
||||
tests/cases/compiler/continueTarget5.ts(6,7): error TS1107: Jump target cannot cross function boundary.
|
||||
|
||||
|
||||
==== tests/cases/compiler/continueTarget5.ts (2 errors) ====
|
||||
==== tests/cases/compiler/continueTarget5.ts (1 errors) ====
|
||||
|
||||
target:
|
||||
~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (true) {
|
||||
function f() {
|
||||
while (true) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [continueTarget5.ts]
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts(11,1): error TS7028: Unused label.
|
||||
tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts(19,5): error TS7028: Unused label.
|
||||
tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts(30,1): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts (3 errors) ====
|
||||
do {
|
||||
break;
|
||||
} while(true)
|
||||
|
||||
ONE:
|
||||
do {
|
||||
break ONE;
|
||||
}
|
||||
while (true)
|
||||
|
||||
TWO:
|
||||
~~~
|
||||
!!! error TS7028: Unused label.
|
||||
THREE:
|
||||
do {
|
||||
break THREE;
|
||||
}while (true)
|
||||
|
||||
FOUR:
|
||||
do {
|
||||
FIVE:
|
||||
~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
do {
|
||||
break FOUR;
|
||||
}while (true)
|
||||
}while (true)
|
||||
|
||||
do {
|
||||
SIX:
|
||||
do break SIX; while(true)
|
||||
}while (true)
|
||||
|
||||
SEVEN:
|
||||
~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
do do do break SEVEN; while (true) while (true) while (true)
|
||||
|
||||
EIGHT:
|
||||
do{
|
||||
var fn = function () { }
|
||||
break EIGHT;
|
||||
}while(true)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [doWhileBreakStatements.ts]
|
||||
|
||||
do {
|
||||
break;
|
||||
} while(true)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
=== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts ===
|
||||
|
||||
do {
|
||||
break;
|
||||
} while(true)
|
||||
|
||||
ONE:
|
||||
do {
|
||||
break ONE;
|
||||
}
|
||||
while (true)
|
||||
|
||||
TWO:
|
||||
THREE:
|
||||
do {
|
||||
break THREE;
|
||||
}while (true)
|
||||
|
||||
FOUR:
|
||||
do {
|
||||
FIVE:
|
||||
do {
|
||||
break FOUR;
|
||||
}while (true)
|
||||
}while (true)
|
||||
|
||||
do {
|
||||
SIX:
|
||||
do break SIX; while(true)
|
||||
}while (true)
|
||||
|
||||
SEVEN:
|
||||
do do do break SEVEN; while (true) while (true) while (true)
|
||||
|
||||
EIGHT:
|
||||
do{
|
||||
var fn = function () { }
|
||||
>fn : Symbol(fn, Decl(doWhileBreakStatements.ts, 35, 7))
|
||||
|
||||
break EIGHT;
|
||||
}while(true)
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
=== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts ===
|
||||
|
||||
do {
|
||||
break;
|
||||
} while(true)
|
||||
>true : boolean
|
||||
|
||||
ONE:
|
||||
>ONE : any
|
||||
|
||||
do {
|
||||
break ONE;
|
||||
>ONE : any
|
||||
}
|
||||
while (true)
|
||||
>true : boolean
|
||||
|
||||
TWO:
|
||||
>TWO : any
|
||||
|
||||
THREE:
|
||||
>THREE : any
|
||||
|
||||
do {
|
||||
break THREE;
|
||||
>THREE : any
|
||||
|
||||
}while (true)
|
||||
>true : boolean
|
||||
|
||||
FOUR:
|
||||
>FOUR : any
|
||||
|
||||
do {
|
||||
FIVE:
|
||||
>FIVE : any
|
||||
|
||||
do {
|
||||
break FOUR;
|
||||
>FOUR : any
|
||||
|
||||
}while (true)
|
||||
>true : boolean
|
||||
|
||||
}while (true)
|
||||
>true : boolean
|
||||
|
||||
do {
|
||||
SIX:
|
||||
>SIX : any
|
||||
|
||||
do break SIX; while(true)
|
||||
>SIX : any
|
||||
>true : boolean
|
||||
|
||||
}while (true)
|
||||
>true : boolean
|
||||
|
||||
SEVEN:
|
||||
>SEVEN : any
|
||||
|
||||
do do do break SEVEN; while (true) while (true) while (true)
|
||||
>SEVEN : any
|
||||
>true : boolean
|
||||
>true : boolean
|
||||
>true : boolean
|
||||
|
||||
EIGHT:
|
||||
>EIGHT : any
|
||||
|
||||
do{
|
||||
var fn = function () { }
|
||||
>fn : () => void
|
||||
>function () { } : () => void
|
||||
|
||||
break EIGHT;
|
||||
>EIGHT : any
|
||||
|
||||
}while(true)
|
||||
>true : boolean
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts(5,1): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts (1 errors) ====
|
||||
do {
|
||||
continue;
|
||||
} while(true)
|
||||
|
||||
ONE:
|
||||
~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
do {
|
||||
continue ONE;
|
||||
}
|
||||
while (true)
|
||||
|
||||
TWO:
|
||||
THREE:
|
||||
do {
|
||||
continue THREE;
|
||||
}while (true)
|
||||
|
||||
FOUR:
|
||||
do {
|
||||
FIVE:
|
||||
do {
|
||||
continue FOUR;
|
||||
}while (true)
|
||||
}while (true)
|
||||
|
||||
do {
|
||||
SIX:
|
||||
do continue SIX; while(true)
|
||||
}while (true)
|
||||
|
||||
SEVEN:
|
||||
do do do continue SEVEN; while (true) while (true) while (true)
|
||||
|
||||
EIGHT:
|
||||
do{
|
||||
var fn = function () { }
|
||||
continue EIGHT;
|
||||
}while(true)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [doWhileContinueStatements.ts]
|
||||
|
||||
do {
|
||||
continue;
|
||||
} while(true)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
=== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts ===
|
||||
|
||||
do {
|
||||
continue;
|
||||
} while(true)
|
||||
|
||||
ONE:
|
||||
do {
|
||||
continue ONE;
|
||||
}
|
||||
while (true)
|
||||
|
||||
TWO:
|
||||
THREE:
|
||||
do {
|
||||
continue THREE;
|
||||
}while (true)
|
||||
|
||||
FOUR:
|
||||
do {
|
||||
FIVE:
|
||||
do {
|
||||
continue FOUR;
|
||||
}while (true)
|
||||
}while (true)
|
||||
|
||||
do {
|
||||
SIX:
|
||||
do continue SIX; while(true)
|
||||
}while (true)
|
||||
|
||||
SEVEN:
|
||||
do do do continue SEVEN; while (true) while (true) while (true)
|
||||
|
||||
EIGHT:
|
||||
do{
|
||||
var fn = function () { }
|
||||
>fn : Symbol(fn, Decl(doWhileContinueStatements.ts, 35, 7))
|
||||
|
||||
continue EIGHT;
|
||||
}while(true)
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
=== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts ===
|
||||
|
||||
do {
|
||||
continue;
|
||||
} while(true)
|
||||
>true : boolean
|
||||
|
||||
ONE:
|
||||
>ONE : any
|
||||
|
||||
do {
|
||||
continue ONE;
|
||||
>ONE : any
|
||||
}
|
||||
while (true)
|
||||
>true : boolean
|
||||
|
||||
TWO:
|
||||
>TWO : any
|
||||
|
||||
THREE:
|
||||
>THREE : any
|
||||
|
||||
do {
|
||||
continue THREE;
|
||||
>THREE : any
|
||||
|
||||
}while (true)
|
||||
>true : boolean
|
||||
|
||||
FOUR:
|
||||
>FOUR : any
|
||||
|
||||
do {
|
||||
FIVE:
|
||||
>FIVE : any
|
||||
|
||||
do {
|
||||
continue FOUR;
|
||||
>FOUR : any
|
||||
|
||||
}while (true)
|
||||
>true : boolean
|
||||
|
||||
}while (true)
|
||||
>true : boolean
|
||||
|
||||
do {
|
||||
SIX:
|
||||
>SIX : any
|
||||
|
||||
do continue SIX; while(true)
|
||||
>SIX : any
|
||||
>true : boolean
|
||||
|
||||
}while (true)
|
||||
>true : boolean
|
||||
|
||||
SEVEN:
|
||||
>SEVEN : any
|
||||
|
||||
do do do continue SEVEN; while (true) while (true) while (true)
|
||||
>SEVEN : any
|
||||
>true : boolean
|
||||
>true : boolean
|
||||
>true : boolean
|
||||
|
||||
EIGHT:
|
||||
>EIGHT : any
|
||||
|
||||
do{
|
||||
var fn = function () { }
|
||||
>fn : () => void
|
||||
>function () { } : () => void
|
||||
|
||||
continue EIGHT;
|
||||
>EIGHT : any
|
||||
|
||||
}while(true)
|
||||
>true : boolean
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
tests/cases/compiler/downlevelLetConst16.ts(151,5): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(151,15): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(164,5): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(164,17): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(195,14): error TS2461: Type 'undefined' is not an array type.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(202,15): error TS2459: Type 'undefined' has no property 'a' and no string index signature.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(216,16): error TS2461: Type 'undefined' is not an array type.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2459: Type 'undefined' has no property 'a' and no string index signature.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(152,15): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(165,17): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(196,14): error TS2461: Type 'undefined' is not an array type.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(203,15): error TS2459: Type 'undefined' has no property 'a' and no string index signature.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(217,16): error TS2461: Type 'undefined' is not an array type.
|
||||
tests/cases/compiler/downlevelLetConst16.ts(224,17): error TS2459: Type 'undefined' has no property 'a' and no string index signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/downlevelLetConst16.ts (8 errors) ====
|
||||
==== tests/cases/compiler/downlevelLetConst16.ts (6 errors) ====
|
||||
|
||||
'use strict'
|
||||
|
||||
declare function use(a: any);
|
||||
@@ -160,8 +159,6 @@ tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2459: Type 'undefin
|
||||
use(x);
|
||||
}
|
||||
for (let [y] = []; ;) {
|
||||
~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
~
|
||||
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
|
||||
use(y);
|
||||
@@ -177,8 +174,6 @@ tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2459: Type 'undefin
|
||||
use(x);
|
||||
}
|
||||
for (const [y] = []; ;) {
|
||||
~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
~
|
||||
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
|
||||
use(y);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [downlevelLetConst16.ts]
|
||||
|
||||
'use strict'
|
||||
|
||||
declare function use(a: any);
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
tests/cases/compiler/downlevelLetConst17.ts(9,1): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/downlevelLetConst17.ts (1 errors) ====
|
||||
'use strict'
|
||||
|
||||
declare function use(a: any);
|
||||
|
||||
var x;
|
||||
for (let x = 10; ;) {
|
||||
use(x);
|
||||
}
|
||||
use(x);
|
||||
~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
|
||||
for (const x = 10; ;) {
|
||||
use(x);
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
let x = 10;
|
||||
use(x);
|
||||
x = 1;
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
const x = 10;
|
||||
use(x);
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
use(x);
|
||||
x = 1;
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
let x;
|
||||
use(x);
|
||||
x = 1;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
let x;
|
||||
use(x);
|
||||
}
|
||||
|
||||
while (true) {
|
||||
const x = true;
|
||||
use(x);
|
||||
}
|
||||
|
||||
do {
|
||||
let x;
|
||||
use(x);
|
||||
} while (true);
|
||||
|
||||
do {
|
||||
let x;
|
||||
use(x);
|
||||
} while (true);
|
||||
|
||||
for (let x in []) {
|
||||
use(x);
|
||||
}
|
||||
|
||||
for (const x in []) {
|
||||
use(x);
|
||||
}
|
||||
|
||||
for (const x of []) {
|
||||
use(x);
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
=== tests/cases/compiler/downlevelLetConst17.ts ===
|
||||
'use strict'
|
||||
|
||||
declare function use(a: any);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>a : Symbol(a, Decl(downlevelLetConst17.ts, 2, 21))
|
||||
|
||||
var x;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 4, 3))
|
||||
|
||||
for (let x = 10; ;) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 5, 8))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 5, 8))
|
||||
}
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 4, 3))
|
||||
|
||||
for (const x = 10; ;) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 10, 10))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 10, 10))
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
let x = 10;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7))
|
||||
|
||||
x = 1;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7))
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
const x = 10;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 21, 9))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 21, 9))
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8))
|
||||
|
||||
x = 1;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8))
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
let x;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7))
|
||||
|
||||
x = 1;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7))
|
||||
}
|
||||
|
||||
while (true) {
|
||||
let x;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 37, 7))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 37, 7))
|
||||
}
|
||||
|
||||
while (true) {
|
||||
const x = true;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 42, 9))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 42, 9))
|
||||
}
|
||||
|
||||
do {
|
||||
let x;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 47, 7))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 47, 7))
|
||||
|
||||
} while (true);
|
||||
|
||||
do {
|
||||
let x;
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 52, 7))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 52, 7))
|
||||
|
||||
} while (true);
|
||||
|
||||
for (let x in []) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 56, 8))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 56, 8))
|
||||
}
|
||||
|
||||
for (const x in []) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 60, 10))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 60, 10))
|
||||
}
|
||||
|
||||
for (const x of []) {
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 64, 10))
|
||||
|
||||
use(x);
|
||||
>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12))
|
||||
>x : Symbol(x, Decl(downlevelLetConst17.ts, 64, 10))
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
=== tests/cases/compiler/downlevelLetConst17.ts ===
|
||||
'use strict'
|
||||
>'use strict' : string
|
||||
|
||||
declare function use(a: any);
|
||||
>use : (a: any) => any
|
||||
>a : any
|
||||
|
||||
var x;
|
||||
>x : any
|
||||
|
||||
for (let x = 10; ;) {
|
||||
>x : number
|
||||
>10 : number
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : number
|
||||
}
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : any
|
||||
|
||||
for (const x = 10; ;) {
|
||||
>x : number
|
||||
>10 : number
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : number
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
let x = 10;
|
||||
>x : number
|
||||
>10 : number
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : number
|
||||
|
||||
x = 1;
|
||||
>x = 1 : number
|
||||
>x : number
|
||||
>1 : number
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
const x = 10;
|
||||
>x : number
|
||||
>10 : number
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : number
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
>x : any
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : any
|
||||
|
||||
x = 1;
|
||||
>x = 1 : number
|
||||
>x : any
|
||||
>1 : number
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
let x;
|
||||
>x : any
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : any
|
||||
|
||||
x = 1;
|
||||
>x = 1 : number
|
||||
>x : any
|
||||
>1 : number
|
||||
}
|
||||
|
||||
while (true) {
|
||||
>true : boolean
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : any
|
||||
}
|
||||
|
||||
while (true) {
|
||||
>true : boolean
|
||||
|
||||
const x = true;
|
||||
>x : boolean
|
||||
>true : boolean
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : boolean
|
||||
}
|
||||
|
||||
do {
|
||||
let x;
|
||||
>x : any
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : any
|
||||
|
||||
} while (true);
|
||||
>true : boolean
|
||||
|
||||
do {
|
||||
let x;
|
||||
>x : any
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : any
|
||||
|
||||
} while (true);
|
||||
>true : boolean
|
||||
|
||||
for (let x in []) {
|
||||
>x : any
|
||||
>[] : undefined[]
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : any
|
||||
}
|
||||
|
||||
for (const x in []) {
|
||||
>x : any
|
||||
>[] : undefined[]
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : any
|
||||
}
|
||||
|
||||
for (const x of []) {
|
||||
>x : any
|
||||
>[] : undefined[]
|
||||
|
||||
use(x);
|
||||
>use(x) : any
|
||||
>use : (a: any) => any
|
||||
>x : any
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
tests/cases/compiler/downlevelLetConst18.ts(3,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(4,14): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(7,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(7,1): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(8,14): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(11,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(15,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(19,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(23,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(27,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(4,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(5,14): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(8,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(9,14): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(12,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(16,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(20,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(24,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
tests/cases/compiler/downlevelLetConst18.ts(28,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/compiler/downlevelLetConst18.ts (10 errors) ====
|
||||
==== tests/cases/compiler/downlevelLetConst18.ts (9 errors) ====
|
||||
|
||||
'use strict'
|
||||
|
||||
for (let x; ;) {
|
||||
@@ -24,8 +24,6 @@ tests/cases/compiler/downlevelLetConst18.ts(27,1): error TS4091: Loop contains b
|
||||
for (let x; ;) {
|
||||
~~~
|
||||
!!! error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
|
||||
~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
function foo() { x };
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [downlevelLetConst18.ts]
|
||||
|
||||
'use strict'
|
||||
|
||||
for (let x; ;) {
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
tests/cases/compiler/duplicateLabel1.ts(1,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/duplicateLabel1.ts(2,1): error TS1114: Duplicate label 'target'
|
||||
tests/cases/compiler/duplicateLabel1.ts(3,1): error TS1114: Duplicate label 'target'
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateLabel1.ts (2 errors) ====
|
||||
==== tests/cases/compiler/duplicateLabel1.ts (1 errors) ====
|
||||
|
||||
target:
|
||||
~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
target:
|
||||
~~~~~~
|
||||
!!! error TS1114: Duplicate label 'target'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [duplicateLabel1.ts]
|
||||
|
||||
target:
|
||||
target:
|
||||
while (true) {
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
tests/cases/compiler/duplicateLabel2.ts(1,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/duplicateLabel2.ts(3,3): error TS1114: Duplicate label 'target'
|
||||
tests/cases/compiler/duplicateLabel2.ts(4,3): error TS1114: Duplicate label 'target'
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateLabel2.ts (2 errors) ====
|
||||
==== tests/cases/compiler/duplicateLabel2.ts (1 errors) ====
|
||||
|
||||
target:
|
||||
~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (true) {
|
||||
target:
|
||||
~~~~~~
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [duplicateLabel2.ts]
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
target:
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
tests/cases/compiler/duplicateLabel3.ts(1,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/duplicateLabel3.ts(4,5): error TS7028: Unused label.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateLabel3.ts (2 errors) ====
|
||||
target:
|
||||
~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (true) {
|
||||
function f() {
|
||||
target:
|
||||
~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (true) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [duplicateLabel3.ts]
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/duplicateLabel3.ts ===
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
function f() {
|
||||
>f : Symbol(f, Decl(duplicateLabel3.ts, 2, 14))
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/compiler/duplicateLabel3.ts ===
|
||||
|
||||
target:
|
||||
>target : any
|
||||
|
||||
while (true) {
|
||||
>true : boolean
|
||||
|
||||
function f() {
|
||||
>f : () => void
|
||||
|
||||
target:
|
||||
>target : any
|
||||
|
||||
while (true) {
|
||||
>true : boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
tests/cases/compiler/duplicateLabel4.ts(1,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/duplicateLabel4.ts(5,1): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateLabel4.ts (2 errors) ====
|
||||
target:
|
||||
~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (true) {
|
||||
}
|
||||
|
||||
target:
|
||||
~~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
while (true) {
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [duplicateLabel4.ts]
|
||||
|
||||
target:
|
||||
while (true) {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/compiler/duplicateLabel4.ts ===
|
||||
|
||||
No type information for this code.target:
|
||||
No type information for this code.while (true) {
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
No type information for this code.target:
|
||||
No type information for this code.while (true) {
|
||||
No type information for this code.}
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/duplicateLabel4.ts ===
|
||||
|
||||
target:
|
||||
>target : any
|
||||
|
||||
while (true) {
|
||||
>true : boolean
|
||||
}
|
||||
|
||||
target:
|
||||
>target : any
|
||||
|
||||
while (true) {
|
||||
>true : boolean
|
||||
}
|
||||
@@ -1,9 +1,19 @@
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(64,92): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(65,122): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(185,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(2,4): error TS1005: ';' expected.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(2,11): error TS1146: Declaration expected.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(2,13): error TS2304: Cannot find name 'commonjs'.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(12,14): error TS1148: Cannot compile modules unless the '--module' flag is provided.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(187,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateLocalVariable1.ts (3 errors) ====
|
||||
==== tests/cases/compiler/duplicateLocalVariable1.ts (5 errors) ====
|
||||
|
||||
/ /@module: commonjs
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
|
||||
!!! error TS1146: Declaration expected.
|
||||
~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'commonjs'.
|
||||
|
||||
//import FileManager = require('filemanager');
|
||||
//import App = require('app');
|
||||
@@ -14,6 +24,8 @@ tests/cases/compiler/duplicateLocalVariable1.ts(185,22): error TS2403: Subsequen
|
||||
var TestFileDir = ".\\TempTestFiles";
|
||||
|
||||
export class TestCase {
|
||||
~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided.
|
||||
constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) {
|
||||
}
|
||||
}
|
||||
@@ -68,11 +80,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(185,22): error TS2403: Subsequen
|
||||
// First 3 are for simple harness validation
|
||||
testRunner.addTest(new TestCase("Basic test", function () { return true; }));
|
||||
testRunner.addTest(new TestCase("Test for any error", function () { throw new Error(); return false; }, ""));
|
||||
~~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
testRunner.addTest(new TestCase("Test RegEx error message match", function () { throw new Error("Should also pass"); return false; }, "Should [also]+ pass"));
|
||||
~~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
testRunner.addTest(new TestCase("Test array compare true", function () { return TestRunner.arrayCompare([1, 2, 3], [1, 2, 3]); }));
|
||||
testRunner.addTest(new TestCase("Test array compare false", function () { return !TestRunner.arrayCompare([3, 2, 3], [1, 2, 3]); }));
|
||||
|
||||
|
||||
@@ -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,37 +0,0 @@
|
||||
tests/cases/compiler/duplicateVariablesByScope.ts(18,9): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateVariablesByScope.ts (1 errors) ====
|
||||
// duplicate local variables are only reported at global scope
|
||||
|
||||
module M {
|
||||
for (var j = 0; j < 10; j++) {
|
||||
}
|
||||
|
||||
for (var j = 0; j < 10; j++) {
|
||||
}
|
||||
}
|
||||
|
||||
function foo() {
|
||||
var x = 2;
|
||||
var x = 1;
|
||||
if (true) {
|
||||
var result = 1;
|
||||
}
|
||||
else {
|
||||
var result = 2;
|
||||
~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
foo() {
|
||||
try {
|
||||
var x = 1;
|
||||
}
|
||||
catch (e) {
|
||||
var x = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [duplicateVariablesByScope.ts]
|
||||
|
||||
// duplicate local variables are only reported at global scope
|
||||
|
||||
module M {
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
=== tests/cases/compiler/duplicateVariablesByScope.ts ===
|
||||
|
||||
// duplicate local variables are only reported at global scope
|
||||
|
||||
module M {
|
||||
>M : Symbol(M, Decl(duplicateVariablesByScope.ts, 0, 0))
|
||||
|
||||
for (var j = 0; j < 10; j++) {
|
||||
>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12))
|
||||
>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12))
|
||||
>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12))
|
||||
}
|
||||
|
||||
for (var j = 0; j < 10; j++) {
|
||||
>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12))
|
||||
>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12))
|
||||
>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 4, 12), Decl(duplicateVariablesByScope.ts, 7, 12))
|
||||
}
|
||||
}
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 9, 1))
|
||||
|
||||
var x = 2;
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 12, 7), Decl(duplicateVariablesByScope.ts, 13, 7))
|
||||
|
||||
var x = 1;
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 12, 7), Decl(duplicateVariablesByScope.ts, 13, 7))
|
||||
|
||||
if (true) {
|
||||
var result = 1;
|
||||
>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 15, 11), Decl(duplicateVariablesByScope.ts, 18, 11))
|
||||
}
|
||||
else {
|
||||
var result = 2;
|
||||
>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 15, 11), Decl(duplicateVariablesByScope.ts, 18, 11))
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(duplicateVariablesByScope.ts, 20, 1))
|
||||
|
||||
foo() {
|
||||
>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 22, 9))
|
||||
|
||||
try {
|
||||
var x = 1;
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 25, 15), Decl(duplicateVariablesByScope.ts, 28, 15))
|
||||
}
|
||||
catch (e) {
|
||||
>e : Symbol(e, Decl(duplicateVariablesByScope.ts, 27, 15))
|
||||
|
||||
var x = 2;
|
||||
>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 25, 15), Decl(duplicateVariablesByScope.ts, 28, 15))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
=== tests/cases/compiler/duplicateVariablesByScope.ts ===
|
||||
|
||||
// duplicate local variables are only reported at global scope
|
||||
|
||||
module M {
|
||||
>M : typeof M
|
||||
|
||||
for (var j = 0; j < 10; j++) {
|
||||
>j : number
|
||||
>0 : number
|
||||
>j < 10 : boolean
|
||||
>j : number
|
||||
>10 : number
|
||||
>j++ : number
|
||||
>j : number
|
||||
}
|
||||
|
||||
for (var j = 0; j < 10; j++) {
|
||||
>j : number
|
||||
>0 : number
|
||||
>j < 10 : boolean
|
||||
>j : number
|
||||
>10 : number
|
||||
>j++ : number
|
||||
>j : number
|
||||
}
|
||||
}
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
var x = 2;
|
||||
>x : number
|
||||
>2 : number
|
||||
|
||||
var x = 1;
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
if (true) {
|
||||
>true : boolean
|
||||
|
||||
var result = 1;
|
||||
>result : number
|
||||
>1 : number
|
||||
}
|
||||
else {
|
||||
var result = 2;
|
||||
>result : number
|
||||
>2 : number
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
foo() {
|
||||
>foo : () => void
|
||||
|
||||
try {
|
||||
var x = 1;
|
||||
>x : number
|
||||
>1 : number
|
||||
}
|
||||
catch (e) {
|
||||
>e : any
|
||||
|
||||
var x = 2;
|
||||
>x : number
|
||||
>2 : number
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
tests/cases/compiler/es6ClassSuperCodegenBug.ts(9,10): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ClassSuperCodegenBug.ts (1 errors) ====
|
||||
class A {
|
||||
constructor(str1:string, str2:string) {}
|
||||
}
|
||||
class B extends A {
|
||||
constructor() {
|
||||
if (true) {
|
||||
super('a1', 'b1');
|
||||
} else {
|
||||
super('a2', 'b2');
|
||||
~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [es6ClassSuperCodegenBug.ts]
|
||||
|
||||
class A {
|
||||
constructor(str1:string, str2:string) {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
=== tests/cases/compiler/es6ClassSuperCodegenBug.ts ===
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0))
|
||||
|
||||
constructor(str1:string, str2:string) {}
|
||||
>str1 : Symbol(str1, Decl(es6ClassSuperCodegenBug.ts, 2, 13))
|
||||
>str2 : Symbol(str2, Decl(es6ClassSuperCodegenBug.ts, 2, 25))
|
||||
}
|
||||
class B extends A {
|
||||
>B : Symbol(B, Decl(es6ClassSuperCodegenBug.ts, 3, 1))
|
||||
>A : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0))
|
||||
|
||||
constructor() {
|
||||
if (true) {
|
||||
super('a1', 'b1');
|
||||
>super : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0))
|
||||
|
||||
} else {
|
||||
super('a2', 'b2');
|
||||
>super : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
=== tests/cases/compiler/es6ClassSuperCodegenBug.ts ===
|
||||
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
constructor(str1:string, str2:string) {}
|
||||
>str1 : string
|
||||
>str2 : string
|
||||
}
|
||||
class B extends A {
|
||||
>B : B
|
||||
>A : A
|
||||
|
||||
constructor() {
|
||||
if (true) {
|
||||
>true : boolean
|
||||
|
||||
super('a1', 'b1');
|
||||
>super('a1', 'b1') : void
|
||||
>super : typeof A
|
||||
>'a1' : string
|
||||
>'b1' : string
|
||||
|
||||
} else {
|
||||
super('a2', 'b2');
|
||||
>super('a2', 'b2') : void
|
||||
>super : typeof A
|
||||
>'a2' : string
|
||||
>'b2' : string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
tests/cases/compiler/escapedIdentifiers.ts(93,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/escapedIdentifiers.ts(96,8): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/escapedIdentifiers.ts(100,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/escapedIdentifiers.ts(103,8): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/escapedIdentifiers.ts(107,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/escapedIdentifiers.ts(110,8): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/escapedIdentifiers.ts(114,1): error TS7028: Unused label.
|
||||
tests/cases/compiler/escapedIdentifiers.ts(117,8): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/escapedIdentifiers.ts (8 errors) ====
|
||||
/*
|
||||
0 .. \u0030
|
||||
9 .. \u0039
|
||||
|
||||
A .. \u0041
|
||||
Z .. \u005a
|
||||
|
||||
a .. \u0061
|
||||
z .. \u00za
|
||||
*/
|
||||
|
||||
// var decl
|
||||
var \u0061 = 1;
|
||||
a ++;
|
||||
\u0061 ++;
|
||||
|
||||
var b = 1;
|
||||
b ++;
|
||||
\u0062 ++;
|
||||
|
||||
// modules
|
||||
module moduleType1 {
|
||||
export var baz1: number;
|
||||
}
|
||||
module moduleType\u0032 {
|
||||
export var baz2: number;
|
||||
}
|
||||
|
||||
moduleType1.baz1 = 3;
|
||||
moduleType\u0031.baz1 = 3;
|
||||
moduleType2.baz2 = 3;
|
||||
moduleType\u0032.baz2 = 3;
|
||||
|
||||
// classes
|
||||
|
||||
class classType1 {
|
||||
public foo1: number;
|
||||
}
|
||||
class classType\u0032 {
|
||||
public foo2: number;
|
||||
}
|
||||
|
||||
var classType1Object1 = new classType1();
|
||||
classType1Object1.foo1 = 2;
|
||||
var classType1Object2 = new classType\u0031();
|
||||
classType1Object2.foo1 = 2;
|
||||
var classType2Object1 = new classType2();
|
||||
classType2Object1.foo2 = 2;
|
||||
var classType2Object2 = new classType\u0032();
|
||||
classType2Object2.foo2 = 2;
|
||||
|
||||
// interfaces
|
||||
interface interfaceType1 {
|
||||
bar1: number;
|
||||
}
|
||||
interface interfaceType\u0032 {
|
||||
bar2: number;
|
||||
}
|
||||
|
||||
var interfaceType1Object1 = <interfaceType1>{ bar1: 0 };
|
||||
interfaceType1Object1.bar1 = 2;
|
||||
var interfaceType1Object2 = <interfaceType\u0031>{ bar1: 0 };
|
||||
interfaceType1Object2.bar1 = 2;
|
||||
var interfaceType2Object1 = <interfaceType2>{ bar2: 0 };
|
||||
interfaceType2Object1.bar2 = 2;
|
||||
var interfaceType2Object2 = <interfaceType\u0032>{ bar2: 0 };
|
||||
interfaceType2Object2.bar2 = 2;
|
||||
|
||||
|
||||
// arguments
|
||||
class testClass {
|
||||
public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) {
|
||||
arg\u0031 = 1;
|
||||
arg2 = 'string';
|
||||
arg\u0033 = true;
|
||||
arg4 = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// constructors
|
||||
class constructorTestClass {
|
||||
constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) {
|
||||
}
|
||||
}
|
||||
var constructorTestObject = new constructorTestClass(1, 'string', true, 2);
|
||||
constructorTestObject.arg\u0031 = 1;
|
||||
constructorTestObject.arg2 = 'string';
|
||||
constructorTestObject.arg\u0033 = true;
|
||||
constructorTestObject.arg4 = 2;
|
||||
|
||||
// Lables
|
||||
|
||||
l\u0061bel1:
|
||||
~~~~~~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (false)
|
||||
{
|
||||
while(false)
|
||||
~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
continue label1; // it will go to next iteration of outer loop
|
||||
}
|
||||
|
||||
label2:
|
||||
~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (false)
|
||||
{
|
||||
while(false)
|
||||
~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
continue l\u0061bel2; // it will go to next iteration of outer loop
|
||||
}
|
||||
|
||||
label3:
|
||||
~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (false)
|
||||
{
|
||||
while(false)
|
||||
~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
continue label3; // it will go to next iteration of outer loop
|
||||
}
|
||||
|
||||
l\u0061bel4:
|
||||
~~~~~~~~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
while (false)
|
||||
{
|
||||
while(false)
|
||||
~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
continue l\u0061bel4; // it will go to next iteration of outer loop
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [escapedIdentifiers.ts]
|
||||
|
||||
/*
|
||||
0 .. \u0030
|
||||
9 .. \u0039
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
=== tests/cases/compiler/escapedIdentifiers.ts ===
|
||||
|
||||
/*
|
||||
0 .. \u0030
|
||||
9 .. \u0039
|
||||
|
||||
A .. \u0041
|
||||
Z .. \u005a
|
||||
|
||||
a .. \u0061
|
||||
z .. \u00za
|
||||
*/
|
||||
|
||||
// var decl
|
||||
var \u0061 = 1;
|
||||
>\u0061 : Symbol(\u0061, Decl(escapedIdentifiers.ts, 13, 3))
|
||||
|
||||
a ++;
|
||||
>a : Symbol(\u0061, Decl(escapedIdentifiers.ts, 13, 3))
|
||||
|
||||
\u0061 ++;
|
||||
>\u0061 : Symbol(\u0061, Decl(escapedIdentifiers.ts, 13, 3))
|
||||
|
||||
var b = 1;
|
||||
>b : Symbol(b, Decl(escapedIdentifiers.ts, 17, 3))
|
||||
|
||||
b ++;
|
||||
>b : Symbol(b, Decl(escapedIdentifiers.ts, 17, 3))
|
||||
|
||||
\u0062 ++;
|
||||
>\u0062 : Symbol(b, Decl(escapedIdentifiers.ts, 17, 3))
|
||||
|
||||
// modules
|
||||
module moduleType1 {
|
||||
>moduleType1 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 19, 10))
|
||||
|
||||
export var baz1: number;
|
||||
>baz1 : Symbol(baz1, Decl(escapedIdentifiers.ts, 23, 14))
|
||||
}
|
||||
module moduleType\u0032 {
|
||||
>moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 24, 1))
|
||||
|
||||
export var baz2: number;
|
||||
>baz2 : Symbol(baz2, Decl(escapedIdentifiers.ts, 26, 14))
|
||||
}
|
||||
|
||||
moduleType1.baz1 = 3;
|
||||
>moduleType1.baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 23, 14))
|
||||
>moduleType1 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 19, 10))
|
||||
>baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 23, 14))
|
||||
|
||||
moduleType\u0031.baz1 = 3;
|
||||
>moduleType\u0031.baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 23, 14))
|
||||
>moduleType\u0031 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 19, 10))
|
||||
>baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 23, 14))
|
||||
|
||||
moduleType2.baz2 = 3;
|
||||
>moduleType2.baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 26, 14))
|
||||
>moduleType2 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 24, 1))
|
||||
>baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 26, 14))
|
||||
|
||||
moduleType\u0032.baz2 = 3;
|
||||
>moduleType\u0032.baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 26, 14))
|
||||
>moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 24, 1))
|
||||
>baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 26, 14))
|
||||
|
||||
// classes
|
||||
|
||||
class classType1 {
|
||||
>classType1 : Symbol(classType1, Decl(escapedIdentifiers.ts, 32, 26))
|
||||
|
||||
public foo1: number;
|
||||
>foo1 : Symbol(foo1, Decl(escapedIdentifiers.ts, 36, 18))
|
||||
}
|
||||
class classType\u0032 {
|
||||
>classType\u0032 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 38, 1))
|
||||
|
||||
public foo2: number;
|
||||
>foo2 : Symbol(foo2, Decl(escapedIdentifiers.ts, 39, 23))
|
||||
}
|
||||
|
||||
var classType1Object1 = new classType1();
|
||||
>classType1Object1 : Symbol(classType1Object1, Decl(escapedIdentifiers.ts, 43, 3))
|
||||
>classType1 : Symbol(classType1, Decl(escapedIdentifiers.ts, 32, 26))
|
||||
|
||||
classType1Object1.foo1 = 2;
|
||||
>classType1Object1.foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 36, 18))
|
||||
>classType1Object1 : Symbol(classType1Object1, Decl(escapedIdentifiers.ts, 43, 3))
|
||||
>foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 36, 18))
|
||||
|
||||
var classType1Object2 = new classType\u0031();
|
||||
>classType1Object2 : Symbol(classType1Object2, Decl(escapedIdentifiers.ts, 45, 3))
|
||||
>classType\u0031 : Symbol(classType1, Decl(escapedIdentifiers.ts, 32, 26))
|
||||
|
||||
classType1Object2.foo1 = 2;
|
||||
>classType1Object2.foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 36, 18))
|
||||
>classType1Object2 : Symbol(classType1Object2, Decl(escapedIdentifiers.ts, 45, 3))
|
||||
>foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 36, 18))
|
||||
|
||||
var classType2Object1 = new classType2();
|
||||
>classType2Object1 : Symbol(classType2Object1, Decl(escapedIdentifiers.ts, 47, 3))
|
||||
>classType2 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 38, 1))
|
||||
|
||||
classType2Object1.foo2 = 2;
|
||||
>classType2Object1.foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 39, 23))
|
||||
>classType2Object1 : Symbol(classType2Object1, Decl(escapedIdentifiers.ts, 47, 3))
|
||||
>foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 39, 23))
|
||||
|
||||
var classType2Object2 = new classType\u0032();
|
||||
>classType2Object2 : Symbol(classType2Object2, Decl(escapedIdentifiers.ts, 49, 3))
|
||||
>classType\u0032 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 38, 1))
|
||||
|
||||
classType2Object2.foo2 = 2;
|
||||
>classType2Object2.foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 39, 23))
|
||||
>classType2Object2 : Symbol(classType2Object2, Decl(escapedIdentifiers.ts, 49, 3))
|
||||
>foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 39, 23))
|
||||
|
||||
// interfaces
|
||||
interface interfaceType1 {
|
||||
>interfaceType1 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 50, 27))
|
||||
|
||||
bar1: number;
|
||||
>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 53, 26))
|
||||
}
|
||||
interface interfaceType\u0032 {
|
||||
>interfaceType\u0032 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 55, 1))
|
||||
|
||||
bar2: number;
|
||||
>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 56, 31))
|
||||
}
|
||||
|
||||
var interfaceType1Object1 = <interfaceType1>{ bar1: 0 };
|
||||
>interfaceType1Object1 : Symbol(interfaceType1Object1, Decl(escapedIdentifiers.ts, 60, 3))
|
||||
>interfaceType1 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 50, 27))
|
||||
>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 60, 45))
|
||||
|
||||
interfaceType1Object1.bar1 = 2;
|
||||
>interfaceType1Object1.bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 53, 26))
|
||||
>interfaceType1Object1 : Symbol(interfaceType1Object1, Decl(escapedIdentifiers.ts, 60, 3))
|
||||
>bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 53, 26))
|
||||
|
||||
var interfaceType1Object2 = <interfaceType\u0031>{ bar1: 0 };
|
||||
>interfaceType1Object2 : Symbol(interfaceType1Object2, Decl(escapedIdentifiers.ts, 62, 3))
|
||||
>interfaceType\u0031 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 50, 27))
|
||||
>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 62, 50))
|
||||
|
||||
interfaceType1Object2.bar1 = 2;
|
||||
>interfaceType1Object2.bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 53, 26))
|
||||
>interfaceType1Object2 : Symbol(interfaceType1Object2, Decl(escapedIdentifiers.ts, 62, 3))
|
||||
>bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 53, 26))
|
||||
|
||||
var interfaceType2Object1 = <interfaceType2>{ bar2: 0 };
|
||||
>interfaceType2Object1 : Symbol(interfaceType2Object1, Decl(escapedIdentifiers.ts, 64, 3))
|
||||
>interfaceType2 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 55, 1))
|
||||
>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 64, 45))
|
||||
|
||||
interfaceType2Object1.bar2 = 2;
|
||||
>interfaceType2Object1.bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 56, 31))
|
||||
>interfaceType2Object1 : Symbol(interfaceType2Object1, Decl(escapedIdentifiers.ts, 64, 3))
|
||||
>bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 56, 31))
|
||||
|
||||
var interfaceType2Object2 = <interfaceType\u0032>{ bar2: 0 };
|
||||
>interfaceType2Object2 : Symbol(interfaceType2Object2, Decl(escapedIdentifiers.ts, 66, 3))
|
||||
>interfaceType\u0032 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 55, 1))
|
||||
>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 66, 50))
|
||||
|
||||
interfaceType2Object2.bar2 = 2;
|
||||
>interfaceType2Object2.bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 56, 31))
|
||||
>interfaceType2Object2 : Symbol(interfaceType2Object2, Decl(escapedIdentifiers.ts, 66, 3))
|
||||
>bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 56, 31))
|
||||
|
||||
|
||||
// arguments
|
||||
class testClass {
|
||||
>testClass : Symbol(testClass, Decl(escapedIdentifiers.ts, 67, 31))
|
||||
|
||||
public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) {
|
||||
>func : Symbol(func, Decl(escapedIdentifiers.ts, 71, 17))
|
||||
>arg1 : Symbol(arg1, Decl(escapedIdentifiers.ts, 72, 16))
|
||||
>arg\u0032 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 72, 29))
|
||||
>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 72, 48))
|
||||
>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 72, 68))
|
||||
|
||||
arg\u0031 = 1;
|
||||
>arg\u0031 : Symbol(arg1, Decl(escapedIdentifiers.ts, 72, 16))
|
||||
|
||||
arg2 = 'string';
|
||||
>arg2 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 72, 29))
|
||||
|
||||
arg\u0033 = true;
|
||||
>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 72, 48))
|
||||
|
||||
arg4 = 2;
|
||||
>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 72, 68))
|
||||
}
|
||||
}
|
||||
|
||||
// constructors
|
||||
class constructorTestClass {
|
||||
>constructorTestClass : Symbol(constructorTestClass, Decl(escapedIdentifiers.ts, 78, 1))
|
||||
|
||||
constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) {
|
||||
>arg1 : Symbol(arg1, Decl(escapedIdentifiers.ts, 82, 17))
|
||||
>arg\u0032 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 82, 37))
|
||||
>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 82, 62))
|
||||
>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 82, 88))
|
||||
}
|
||||
}
|
||||
var constructorTestObject = new constructorTestClass(1, 'string', true, 2);
|
||||
>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 85, 3))
|
||||
>constructorTestClass : Symbol(constructorTestClass, Decl(escapedIdentifiers.ts, 78, 1))
|
||||
|
||||
constructorTestObject.arg\u0031 = 1;
|
||||
>constructorTestObject.arg\u0031 : Symbol(constructorTestClass.arg1, Decl(escapedIdentifiers.ts, 82, 17))
|
||||
>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 85, 3))
|
||||
>arg\u0031 : Symbol(constructorTestClass.arg1, Decl(escapedIdentifiers.ts, 82, 17))
|
||||
|
||||
constructorTestObject.arg2 = 'string';
|
||||
>constructorTestObject.arg2 : Symbol(constructorTestClass.arg\u0032, Decl(escapedIdentifiers.ts, 82, 37))
|
||||
>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 85, 3))
|
||||
>arg2 : Symbol(constructorTestClass.arg\u0032, Decl(escapedIdentifiers.ts, 82, 37))
|
||||
|
||||
constructorTestObject.arg\u0033 = true;
|
||||
>constructorTestObject.arg\u0033 : Symbol(constructorTestClass.arg\u0033, Decl(escapedIdentifiers.ts, 82, 62))
|
||||
>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 85, 3))
|
||||
>arg\u0033 : Symbol(constructorTestClass.arg\u0033, Decl(escapedIdentifiers.ts, 82, 62))
|
||||
|
||||
constructorTestObject.arg4 = 2;
|
||||
>constructorTestObject.arg4 : Symbol(constructorTestClass.arg4, Decl(escapedIdentifiers.ts, 82, 88))
|
||||
>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 85, 3))
|
||||
>arg4 : Symbol(constructorTestClass.arg4, Decl(escapedIdentifiers.ts, 82, 88))
|
||||
|
||||
// Lables
|
||||
|
||||
l\u0061bel1:
|
||||
while (false)
|
||||
{
|
||||
while(false)
|
||||
continue label1; // it will go to next iteration of outer loop
|
||||
}
|
||||
|
||||
label2:
|
||||
while (false)
|
||||
{
|
||||
while(false)
|
||||
continue l\u0061bel2; // it will go to next iteration of outer loop
|
||||
}
|
||||
|
||||
label3:
|
||||
while (false)
|
||||
{
|
||||
while(false)
|
||||
continue label3; // it will go to next iteration of outer loop
|
||||
}
|
||||
|
||||
l\u0061bel4:
|
||||
while (false)
|
||||
{
|
||||
while(false)
|
||||
continue l\u0061bel4; // it will go to next iteration of outer loop
|
||||
}
|
||||
@@ -0,0 +1,352 @@
|
||||
=== tests/cases/compiler/escapedIdentifiers.ts ===
|
||||
|
||||
/*
|
||||
0 .. \u0030
|
||||
9 .. \u0039
|
||||
|
||||
A .. \u0041
|
||||
Z .. \u005a
|
||||
|
||||
a .. \u0061
|
||||
z .. \u00za
|
||||
*/
|
||||
|
||||
// var decl
|
||||
var \u0061 = 1;
|
||||
>\u0061 : number
|
||||
>1 : number
|
||||
|
||||
a ++;
|
||||
>a ++ : number
|
||||
>a : number
|
||||
|
||||
\u0061 ++;
|
||||
>\u0061 ++ : number
|
||||
>\u0061 : number
|
||||
|
||||
var b = 1;
|
||||
>b : number
|
||||
>1 : number
|
||||
|
||||
b ++;
|
||||
>b ++ : number
|
||||
>b : number
|
||||
|
||||
\u0062 ++;
|
||||
>\u0062 ++ : number
|
||||
>\u0062 : number
|
||||
|
||||
// modules
|
||||
module moduleType1 {
|
||||
>moduleType1 : typeof moduleType1
|
||||
|
||||
export var baz1: number;
|
||||
>baz1 : number
|
||||
}
|
||||
module moduleType\u0032 {
|
||||
>moduleType\u0032 : typeof moduleType\u0032
|
||||
|
||||
export var baz2: number;
|
||||
>baz2 : number
|
||||
}
|
||||
|
||||
moduleType1.baz1 = 3;
|
||||
>moduleType1.baz1 = 3 : number
|
||||
>moduleType1.baz1 : number
|
||||
>moduleType1 : typeof moduleType1
|
||||
>baz1 : number
|
||||
>3 : number
|
||||
|
||||
moduleType\u0031.baz1 = 3;
|
||||
>moduleType\u0031.baz1 = 3 : number
|
||||
>moduleType\u0031.baz1 : number
|
||||
>moduleType\u0031 : typeof moduleType1
|
||||
>baz1 : number
|
||||
>3 : number
|
||||
|
||||
moduleType2.baz2 = 3;
|
||||
>moduleType2.baz2 = 3 : number
|
||||
>moduleType2.baz2 : number
|
||||
>moduleType2 : typeof moduleType\u0032
|
||||
>baz2 : number
|
||||
>3 : number
|
||||
|
||||
moduleType\u0032.baz2 = 3;
|
||||
>moduleType\u0032.baz2 = 3 : number
|
||||
>moduleType\u0032.baz2 : number
|
||||
>moduleType\u0032 : typeof moduleType\u0032
|
||||
>baz2 : number
|
||||
>3 : number
|
||||
|
||||
// classes
|
||||
|
||||
class classType1 {
|
||||
>classType1 : classType1
|
||||
|
||||
public foo1: number;
|
||||
>foo1 : number
|
||||
}
|
||||
class classType\u0032 {
|
||||
>classType\u0032 : classType\u0032
|
||||
|
||||
public foo2: number;
|
||||
>foo2 : number
|
||||
}
|
||||
|
||||
var classType1Object1 = new classType1();
|
||||
>classType1Object1 : classType1
|
||||
>new classType1() : classType1
|
||||
>classType1 : typeof classType1
|
||||
|
||||
classType1Object1.foo1 = 2;
|
||||
>classType1Object1.foo1 = 2 : number
|
||||
>classType1Object1.foo1 : number
|
||||
>classType1Object1 : classType1
|
||||
>foo1 : number
|
||||
>2 : number
|
||||
|
||||
var classType1Object2 = new classType\u0031();
|
||||
>classType1Object2 : classType1
|
||||
>new classType\u0031() : classType1
|
||||
>classType\u0031 : typeof classType1
|
||||
|
||||
classType1Object2.foo1 = 2;
|
||||
>classType1Object2.foo1 = 2 : number
|
||||
>classType1Object2.foo1 : number
|
||||
>classType1Object2 : classType1
|
||||
>foo1 : number
|
||||
>2 : number
|
||||
|
||||
var classType2Object1 = new classType2();
|
||||
>classType2Object1 : classType\u0032
|
||||
>new classType2() : classType\u0032
|
||||
>classType2 : typeof classType\u0032
|
||||
|
||||
classType2Object1.foo2 = 2;
|
||||
>classType2Object1.foo2 = 2 : number
|
||||
>classType2Object1.foo2 : number
|
||||
>classType2Object1 : classType\u0032
|
||||
>foo2 : number
|
||||
>2 : number
|
||||
|
||||
var classType2Object2 = new classType\u0032();
|
||||
>classType2Object2 : classType\u0032
|
||||
>new classType\u0032() : classType\u0032
|
||||
>classType\u0032 : typeof classType\u0032
|
||||
|
||||
classType2Object2.foo2 = 2;
|
||||
>classType2Object2.foo2 = 2 : number
|
||||
>classType2Object2.foo2 : number
|
||||
>classType2Object2 : classType\u0032
|
||||
>foo2 : number
|
||||
>2 : number
|
||||
|
||||
// interfaces
|
||||
interface interfaceType1 {
|
||||
>interfaceType1 : interfaceType1
|
||||
|
||||
bar1: number;
|
||||
>bar1 : number
|
||||
}
|
||||
interface interfaceType\u0032 {
|
||||
>interfaceType\u0032 : interfaceType\u0032
|
||||
|
||||
bar2: number;
|
||||
>bar2 : number
|
||||
}
|
||||
|
||||
var interfaceType1Object1 = <interfaceType1>{ bar1: 0 };
|
||||
>interfaceType1Object1 : interfaceType1
|
||||
><interfaceType1>{ bar1: 0 } : interfaceType1
|
||||
>interfaceType1 : interfaceType1
|
||||
>{ bar1: 0 } : { bar1: number; }
|
||||
>bar1 : number
|
||||
>0 : number
|
||||
|
||||
interfaceType1Object1.bar1 = 2;
|
||||
>interfaceType1Object1.bar1 = 2 : number
|
||||
>interfaceType1Object1.bar1 : number
|
||||
>interfaceType1Object1 : interfaceType1
|
||||
>bar1 : number
|
||||
>2 : number
|
||||
|
||||
var interfaceType1Object2 = <interfaceType\u0031>{ bar1: 0 };
|
||||
>interfaceType1Object2 : interfaceType1
|
||||
><interfaceType\u0031>{ bar1: 0 } : interfaceType1
|
||||
>interfaceType\u0031 : interfaceType1
|
||||
>{ bar1: 0 } : { bar1: number; }
|
||||
>bar1 : number
|
||||
>0 : number
|
||||
|
||||
interfaceType1Object2.bar1 = 2;
|
||||
>interfaceType1Object2.bar1 = 2 : number
|
||||
>interfaceType1Object2.bar1 : number
|
||||
>interfaceType1Object2 : interfaceType1
|
||||
>bar1 : number
|
||||
>2 : number
|
||||
|
||||
var interfaceType2Object1 = <interfaceType2>{ bar2: 0 };
|
||||
>interfaceType2Object1 : interfaceType\u0032
|
||||
><interfaceType2>{ bar2: 0 } : interfaceType\u0032
|
||||
>interfaceType2 : interfaceType\u0032
|
||||
>{ bar2: 0 } : { bar2: number; }
|
||||
>bar2 : number
|
||||
>0 : number
|
||||
|
||||
interfaceType2Object1.bar2 = 2;
|
||||
>interfaceType2Object1.bar2 = 2 : number
|
||||
>interfaceType2Object1.bar2 : number
|
||||
>interfaceType2Object1 : interfaceType\u0032
|
||||
>bar2 : number
|
||||
>2 : number
|
||||
|
||||
var interfaceType2Object2 = <interfaceType\u0032>{ bar2: 0 };
|
||||
>interfaceType2Object2 : interfaceType\u0032
|
||||
><interfaceType\u0032>{ bar2: 0 } : interfaceType\u0032
|
||||
>interfaceType\u0032 : interfaceType\u0032
|
||||
>{ bar2: 0 } : { bar2: number; }
|
||||
>bar2 : number
|
||||
>0 : number
|
||||
|
||||
interfaceType2Object2.bar2 = 2;
|
||||
>interfaceType2Object2.bar2 = 2 : number
|
||||
>interfaceType2Object2.bar2 : number
|
||||
>interfaceType2Object2 : interfaceType\u0032
|
||||
>bar2 : number
|
||||
>2 : number
|
||||
|
||||
|
||||
// arguments
|
||||
class testClass {
|
||||
>testClass : testClass
|
||||
|
||||
public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) {
|
||||
>func : (arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) => void
|
||||
>arg1 : number
|
||||
>arg\u0032 : string
|
||||
>arg\u0033 : boolean
|
||||
>arg4 : number
|
||||
|
||||
arg\u0031 = 1;
|
||||
>arg\u0031 = 1 : number
|
||||
>arg\u0031 : number
|
||||
>1 : number
|
||||
|
||||
arg2 = 'string';
|
||||
>arg2 = 'string' : string
|
||||
>arg2 : string
|
||||
>'string' : string
|
||||
|
||||
arg\u0033 = true;
|
||||
>arg\u0033 = true : boolean
|
||||
>arg\u0033 : boolean
|
||||
>true : boolean
|
||||
|
||||
arg4 = 2;
|
||||
>arg4 = 2 : number
|
||||
>arg4 : number
|
||||
>2 : number
|
||||
}
|
||||
}
|
||||
|
||||
// constructors
|
||||
class constructorTestClass {
|
||||
>constructorTestClass : constructorTestClass
|
||||
|
||||
constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) {
|
||||
>arg1 : number
|
||||
>arg\u0032 : string
|
||||
>arg\u0033 : boolean
|
||||
>arg4 : number
|
||||
}
|
||||
}
|
||||
var constructorTestObject = new constructorTestClass(1, 'string', true, 2);
|
||||
>constructorTestObject : constructorTestClass
|
||||
>new constructorTestClass(1, 'string', true, 2) : constructorTestClass
|
||||
>constructorTestClass : typeof constructorTestClass
|
||||
>1 : number
|
||||
>'string' : string
|
||||
>true : boolean
|
||||
>2 : number
|
||||
|
||||
constructorTestObject.arg\u0031 = 1;
|
||||
>constructorTestObject.arg\u0031 = 1 : number
|
||||
>constructorTestObject.arg\u0031 : number
|
||||
>constructorTestObject : constructorTestClass
|
||||
>arg\u0031 : number
|
||||
>1 : number
|
||||
|
||||
constructorTestObject.arg2 = 'string';
|
||||
>constructorTestObject.arg2 = 'string' : string
|
||||
>constructorTestObject.arg2 : string
|
||||
>constructorTestObject : constructorTestClass
|
||||
>arg2 : string
|
||||
>'string' : string
|
||||
|
||||
constructorTestObject.arg\u0033 = true;
|
||||
>constructorTestObject.arg\u0033 = true : boolean
|
||||
>constructorTestObject.arg\u0033 : boolean
|
||||
>constructorTestObject : constructorTestClass
|
||||
>arg\u0033 : boolean
|
||||
>true : boolean
|
||||
|
||||
constructorTestObject.arg4 = 2;
|
||||
>constructorTestObject.arg4 = 2 : number
|
||||
>constructorTestObject.arg4 : number
|
||||
>constructorTestObject : constructorTestClass
|
||||
>arg4 : number
|
||||
>2 : number
|
||||
|
||||
// Lables
|
||||
|
||||
l\u0061bel1:
|
||||
>l\u0061bel1 : any
|
||||
|
||||
while (false)
|
||||
>false : boolean
|
||||
{
|
||||
while(false)
|
||||
>false : boolean
|
||||
|
||||
continue label1; // it will go to next iteration of outer loop
|
||||
>label1 : any
|
||||
}
|
||||
|
||||
label2:
|
||||
>label2 : any
|
||||
|
||||
while (false)
|
||||
>false : boolean
|
||||
{
|
||||
while(false)
|
||||
>false : boolean
|
||||
|
||||
continue l\u0061bel2; // it will go to next iteration of outer loop
|
||||
>l\u0061bel2 : any
|
||||
}
|
||||
|
||||
label3:
|
||||
>label3 : any
|
||||
|
||||
while (false)
|
||||
>false : boolean
|
||||
{
|
||||
while(false)
|
||||
>false : boolean
|
||||
|
||||
continue label3; // it will go to next iteration of outer loop
|
||||
>label3 : any
|
||||
}
|
||||
|
||||
l\u0061bel4:
|
||||
>l\u0061bel4 : any
|
||||
|
||||
while (false)
|
||||
>false : boolean
|
||||
{
|
||||
while(false)
|
||||
>false : boolean
|
||||
|
||||
continue l\u0061bel4; // it will go to next iteration of outer loop
|
||||
>l\u0061bel4 : any
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/compiler/for.ts(29,1): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/for.ts(29,6): error TS1109: Expression expected.
|
||||
tests/cases/compiler/for.ts(30,6): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/for.ts (2 errors) ====
|
||||
==== tests/cases/compiler/for.ts (1 errors) ====
|
||||
|
||||
for (var i = 0; i < 10; i++) { // ok
|
||||
var x1 = i;
|
||||
}
|
||||
@@ -32,8 +32,6 @@ tests/cases/compiler/for.ts(29,6): error TS1109: Expression expected.
|
||||
}
|
||||
|
||||
for () { // error
|
||||
~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [for.ts]
|
||||
|
||||
for (var i = 0; i < 10; i++) { // ok
|
||||
var x1 = i;
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
tests/cases/conformance/statements/breakStatements/forBreakStatements.ts(10,1): error TS7028: Unused label.
|
||||
tests/cases/conformance/statements/breakStatements/forBreakStatements.ts(18,5): error TS7028: Unused label.
|
||||
tests/cases/conformance/statements/breakStatements/forBreakStatements.ts(29,1): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts (3 errors) ====
|
||||
for (; ;) {
|
||||
break;
|
||||
}
|
||||
|
||||
ONE:
|
||||
for (; ;) {
|
||||
break ONE;
|
||||
}
|
||||
|
||||
TWO:
|
||||
~~~
|
||||
!!! error TS7028: Unused label.
|
||||
THREE:
|
||||
for (; ;) {
|
||||
break THREE;
|
||||
}
|
||||
|
||||
FOUR:
|
||||
for (; ;) {
|
||||
FIVE:
|
||||
~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
for (; ;) {
|
||||
break FOUR;
|
||||
}
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
SIX:
|
||||
for (; ;) break SIX;
|
||||
}
|
||||
|
||||
SEVEN:
|
||||
~~~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
for (; ;) for (; ;) for (; ;) break SEVEN;
|
||||
|
||||
EIGHT:
|
||||
for (; ;) {
|
||||
var fn = function () { }
|
||||
break EIGHT;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [forBreakStatements.ts]
|
||||
|
||||
for (; ;) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
=== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts ===
|
||||
|
||||
for (; ;) {
|
||||
break;
|
||||
}
|
||||
|
||||
ONE:
|
||||
for (; ;) {
|
||||
break ONE;
|
||||
}
|
||||
|
||||
TWO:
|
||||
THREE:
|
||||
for (; ;) {
|
||||
break THREE;
|
||||
}
|
||||
|
||||
FOUR:
|
||||
for (; ;) {
|
||||
FIVE:
|
||||
for (; ;) {
|
||||
break FOUR;
|
||||
}
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
SIX:
|
||||
for (; ;) break SIX;
|
||||
}
|
||||
|
||||
SEVEN:
|
||||
for (; ;) for (; ;) for (; ;) break SEVEN;
|
||||
|
||||
EIGHT:
|
||||
for (; ;) {
|
||||
var fn = function () { }
|
||||
>fn : Symbol(fn, Decl(forBreakStatements.ts, 34, 7))
|
||||
|
||||
break EIGHT;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
=== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts ===
|
||||
|
||||
for (; ;) {
|
||||
break;
|
||||
}
|
||||
|
||||
ONE:
|
||||
>ONE : any
|
||||
|
||||
for (; ;) {
|
||||
break ONE;
|
||||
>ONE : any
|
||||
}
|
||||
|
||||
TWO:
|
||||
>TWO : any
|
||||
|
||||
THREE:
|
||||
>THREE : any
|
||||
|
||||
for (; ;) {
|
||||
break THREE;
|
||||
>THREE : any
|
||||
}
|
||||
|
||||
FOUR:
|
||||
>FOUR : any
|
||||
|
||||
for (; ;) {
|
||||
FIVE:
|
||||
>FIVE : any
|
||||
|
||||
for (; ;) {
|
||||
break FOUR;
|
||||
>FOUR : any
|
||||
}
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
SIX:
|
||||
>SIX : any
|
||||
|
||||
for (; ;) break SIX;
|
||||
>SIX : any
|
||||
}
|
||||
|
||||
SEVEN:
|
||||
>SEVEN : any
|
||||
|
||||
for (; ;) for (; ;) for (; ;) break SEVEN;
|
||||
>SEVEN : any
|
||||
|
||||
EIGHT:
|
||||
>EIGHT : any
|
||||
|
||||
for (; ;) {
|
||||
var fn = function () { }
|
||||
>fn : () => void
|
||||
>function () { } : () => void
|
||||
|
||||
break EIGHT;
|
||||
>EIGHT : any
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
tests/cases/conformance/statements/continueStatements/forContinueStatements.ts(5,1): error TS7027: Unreachable code detected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts (1 errors) ====
|
||||
for (; ;) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ONE:
|
||||
~~~
|
||||
!!! error TS7027: Unreachable code detected.
|
||||
for (; ;) {
|
||||
continue ONE;
|
||||
}
|
||||
|
||||
TWO:
|
||||
THREE:
|
||||
for (; ;) {
|
||||
continue THREE;
|
||||
}
|
||||
|
||||
FOUR:
|
||||
for (; ;) {
|
||||
FIVE:
|
||||
for (; ;) {
|
||||
continue FOUR;
|
||||
}
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
SIX:
|
||||
for (; ;) continue SIX;
|
||||
}
|
||||
|
||||
SEVEN:
|
||||
for (; ;) for (; ;) for (; ;) continue SEVEN;
|
||||
|
||||
EIGHT:
|
||||
for (; ;) {
|
||||
var fn = function () { }
|
||||
continue EIGHT;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [forContinueStatements.ts]
|
||||
|
||||
for (; ;) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
=== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts ===
|
||||
|
||||
for (; ;) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ONE:
|
||||
for (; ;) {
|
||||
continue ONE;
|
||||
}
|
||||
|
||||
TWO:
|
||||
THREE:
|
||||
for (; ;) {
|
||||
continue THREE;
|
||||
}
|
||||
|
||||
FOUR:
|
||||
for (; ;) {
|
||||
FIVE:
|
||||
for (; ;) {
|
||||
continue FOUR;
|
||||
}
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
SIX:
|
||||
for (; ;) continue SIX;
|
||||
}
|
||||
|
||||
SEVEN:
|
||||
for (; ;) for (; ;) for (; ;) continue SEVEN;
|
||||
|
||||
EIGHT:
|
||||
for (; ;) {
|
||||
var fn = function () { }
|
||||
>fn : Symbol(fn, Decl(forContinueStatements.ts, 34, 7))
|
||||
|
||||
continue EIGHT;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
=== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts ===
|
||||
|
||||
for (; ;) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ONE:
|
||||
>ONE : any
|
||||
|
||||
for (; ;) {
|
||||
continue ONE;
|
||||
>ONE : any
|
||||
}
|
||||
|
||||
TWO:
|
||||
>TWO : any
|
||||
|
||||
THREE:
|
||||
>THREE : any
|
||||
|
||||
for (; ;) {
|
||||
continue THREE;
|
||||
>THREE : any
|
||||
}
|
||||
|
||||
FOUR:
|
||||
>FOUR : any
|
||||
|
||||
for (; ;) {
|
||||
FIVE:
|
||||
>FIVE : any
|
||||
|
||||
for (; ;) {
|
||||
continue FOUR;
|
||||
>FOUR : any
|
||||
}
|
||||
}
|
||||
|
||||
for (; ;) {
|
||||
SIX:
|
||||
>SIX : any
|
||||
|
||||
for (; ;) continue SIX;
|
||||
>SIX : any
|
||||
}
|
||||
|
||||
SEVEN:
|
||||
>SEVEN : any
|
||||
|
||||
for (; ;) for (; ;) for (; ;) continue SEVEN;
|
||||
>SEVEN : any
|
||||
|
||||
EIGHT:
|
||||
>EIGHT : any
|
||||
|
||||
for (; ;) {
|
||||
var fn = function () { }
|
||||
>fn : () => void
|
||||
>function () { } : () => void
|
||||
|
||||
continue EIGHT;
|
||||
>EIGHT : any
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts(10,1): error TS7028: Unused label.
|
||||
tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts(18,5): error TS7028: Unused label.
|
||||
|
||||
|
||||
==== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts (2 errors) ====
|
||||
for(var x in {}) {
|
||||
break;
|
||||
}
|
||||
|
||||
ONE:
|
||||
for(var x in {}) {
|
||||
break ONE;
|
||||
}
|
||||
|
||||
TWO:
|
||||
~~~
|
||||
!!! error TS7028: Unused label.
|
||||
THREE:
|
||||
for(var x in {}) {
|
||||
break THREE;
|
||||
}
|
||||
|
||||
FOUR:
|
||||
for(var x in {}) {
|
||||
FIVE:
|
||||
~~~~
|
||||
!!! error TS7028: Unused label.
|
||||
for(var x in {}) {
|
||||
break FOUR;
|
||||
}
|
||||
}
|
||||
|
||||
for(var x in {}) {
|
||||
SIX:
|
||||
for(var x in {}) break SIX;
|
||||
}
|
||||
|
||||
SEVEN:
|
||||
for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN;
|
||||
|
||||
EIGHT:
|
||||
for (var x in {}){
|
||||
var fn = function () { }
|
||||
break EIGHT;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [forInBreakStatements.ts]
|
||||
|
||||
for(var x in {}) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
=== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts ===
|
||||
|
||||
for(var x in {}) {
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
ONE:
|
||||
for(var x in {}) {
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
|
||||
break ONE;
|
||||
}
|
||||
|
||||
TWO:
|
||||
THREE:
|
||||
for(var x in {}) {
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
|
||||
break THREE;
|
||||
}
|
||||
|
||||
FOUR:
|
||||
for(var x in {}) {
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
|
||||
FIVE:
|
||||
for(var x in {}) {
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
|
||||
break FOUR;
|
||||
}
|
||||
}
|
||||
|
||||
for(var x in {}) {
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
|
||||
SIX:
|
||||
for(var x in {}) break SIX;
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
}
|
||||
|
||||
SEVEN:
|
||||
for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN;
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
|
||||
EIGHT:
|
||||
for (var x in {}){
|
||||
>x : Symbol(x, Decl(forInBreakStatements.ts, 1, 7), Decl(forInBreakStatements.ts, 6, 7), Decl(forInBreakStatements.ts, 12, 7), Decl(forInBreakStatements.ts, 17, 7), Decl(forInBreakStatements.ts, 19, 11), Decl(forInBreakStatements.ts, 24, 7), Decl(forInBreakStatements.ts, 26, 11), Decl(forInBreakStatements.ts, 30, 8), Decl(forInBreakStatements.ts, 30, 26), Decl(forInBreakStatements.ts, 30, 44), Decl(forInBreakStatements.ts, 33, 8))
|
||||
|
||||
var fn = function () { }
|
||||
>fn : Symbol(fn, Decl(forInBreakStatements.ts, 34, 7))
|
||||
|
||||
break EIGHT;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
=== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts ===
|
||||
|
||||
for(var x in {}) {
|
||||
>x : any
|
||||
>{} : {}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
ONE:
|
||||
>ONE : any
|
||||
|
||||
for(var x in {}) {
|
||||
>x : any
|
||||
>{} : {}
|
||||
|
||||
break ONE;
|
||||
>ONE : any
|
||||
}
|
||||
|
||||
TWO:
|
||||
>TWO : any
|
||||
|
||||
THREE:
|
||||
>THREE : any
|
||||
|
||||
for(var x in {}) {
|
||||
>x : any
|
||||
>{} : {}
|
||||
|
||||
break THREE;
|
||||
>THREE : any
|
||||
}
|
||||
|
||||
FOUR:
|
||||
>FOUR : any
|
||||
|
||||
for(var x in {}) {
|
||||
>x : any
|
||||
>{} : {}
|
||||
|
||||
FIVE:
|
||||
>FIVE : any
|
||||
|
||||
for(var x in {}) {
|
||||
>x : any
|
||||
>{} : {}
|
||||
|
||||
break FOUR;
|
||||
>FOUR : any
|
||||
}
|
||||
}
|
||||
|
||||
for(var x in {}) {
|
||||
>x : any
|
||||
>{} : {}
|
||||
|
||||
SIX:
|
||||
>SIX : any
|
||||
|
||||
for(var x in {}) break SIX;
|
||||
>x : any
|
||||
>{} : {}
|
||||
>SIX : any
|
||||
}
|
||||
|
||||
SEVEN:
|
||||
>SEVEN : any
|
||||
|
||||
for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN;
|
||||
>x : any
|
||||
>{} : {}
|
||||
>x : any
|
||||
>{} : {}
|
||||
>x : any
|
||||
>{} : {}
|
||||
>SEVEN : any
|
||||
|
||||
EIGHT:
|
||||
>EIGHT : any
|
||||
|
||||
for (var x in {}){
|
||||
>x : any
|
||||
>{} : {}
|
||||
|
||||
var fn = function () { }
|
||||
>fn : () => void
|
||||
>function () { } : () => void
|
||||
|
||||
break EIGHT;
|
||||
>EIGHT : any
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user