diff --git a/tests/baselines/reference/nestedBlockScopedBindings13.errors.txt b/tests/baselines/reference/nestedBlockScopedBindings13.errors.txt new file mode 100644 index 00000000000..0421583cff9 --- /dev/null +++ b/tests/baselines/reference/nestedBlockScopedBindings13.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/nestedBlockScopedBindings13.ts(2,5): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings13.ts(7,5): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/nestedBlockScopedBindings13.ts (2 errors) ==== + for (; false;) { + let x; + ~~~ +!!! error TS7027: Unreachable code detected. + () => x; + } + + for (; false;) { + let y; + ~~~ +!!! error TS7027: Unreachable code detected. + y = 1; + } \ No newline at end of file diff --git a/tests/baselines/reference/nestedBlockScopedBindings13.symbols b/tests/baselines/reference/nestedBlockScopedBindings13.symbols deleted file mode 100644 index a5bc7ed7866..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings13.symbols +++ /dev/null @@ -1,16 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings13.ts === -for (; false;) { - let x; ->x : Symbol(x, Decl(nestedBlockScopedBindings13.ts, 1, 7)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings13.ts, 1, 7)) -} - -for (; false;) { - let y; ->y : Symbol(y, Decl(nestedBlockScopedBindings13.ts, 6, 7)) - - y = 1; ->y : Symbol(y, Decl(nestedBlockScopedBindings13.ts, 6, 7)) -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings13.types b/tests/baselines/reference/nestedBlockScopedBindings13.types deleted file mode 100644 index 2e7bc7de77e..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings13.types +++ /dev/null @@ -1,23 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings13.ts === -for (; false;) { ->false : boolean - - let x; ->x : any - - () => x; ->() => x : () => any ->x : any -} - -for (; false;) { ->false : boolean - - let y; ->y : any - - y = 1; ->y = 1 : number ->y : any ->1 : number -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings14.errors.txt b/tests/baselines/reference/nestedBlockScopedBindings14.errors.txt new file mode 100644 index 00000000000..1b5babb4c25 --- /dev/null +++ b/tests/baselines/reference/nestedBlockScopedBindings14.errors.txt @@ -0,0 +1,20 @@ +tests/cases/compiler/nestedBlockScopedBindings14.ts(3,5): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings14.ts(9,5): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/nestedBlockScopedBindings14.ts (2 errors) ==== + var x; + for (; false;) { + let x; + ~~~ +!!! error TS7027: Unreachable code detected. + () => x; + } + + var y; + for (; false;) { + let y; + ~~~ +!!! error TS7027: Unreachable code detected. + y = 1; + } \ No newline at end of file diff --git a/tests/baselines/reference/nestedBlockScopedBindings14.symbols b/tests/baselines/reference/nestedBlockScopedBindings14.symbols deleted file mode 100644 index 4a13b296e88..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings14.symbols +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings14.ts === -var x; ->x : Symbol(x, Decl(nestedBlockScopedBindings14.ts, 0, 3)) - -for (; false;) { - let x; ->x : Symbol(x, Decl(nestedBlockScopedBindings14.ts, 2, 7)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings14.ts, 2, 7)) -} - -var y; ->y : Symbol(y, Decl(nestedBlockScopedBindings14.ts, 6, 3)) - -for (; false;) { - let y; ->y : Symbol(y, Decl(nestedBlockScopedBindings14.ts, 8, 7)) - - y = 1; ->y : Symbol(y, Decl(nestedBlockScopedBindings14.ts, 8, 7)) -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings14.types b/tests/baselines/reference/nestedBlockScopedBindings14.types deleted file mode 100644 index 966eaaaac7a..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings14.types +++ /dev/null @@ -1,29 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings14.ts === -var x; ->x : any - -for (; false;) { ->false : boolean - - let x; ->x : any - - () => x; ->() => x : () => any ->x : any -} - -var y; ->y : any - -for (; false;) { ->false : boolean - - let y; ->y : any - - y = 1; ->y = 1 : number ->y : any ->1 : number -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings15.errors.txt b/tests/baselines/reference/nestedBlockScopedBindings15.errors.txt new file mode 100644 index 00000000000..b60a502b528 --- /dev/null +++ b/tests/baselines/reference/nestedBlockScopedBindings15.errors.txt @@ -0,0 +1,46 @@ +tests/cases/compiler/nestedBlockScopedBindings15.ts(3,9): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings15.ts(10,9): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings15.ts(16,5): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings15.ts(25,5): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/nestedBlockScopedBindings15.ts (4 errors) ==== + for (; false;) { + { + let x; + ~~~ +!!! error TS7027: Unreachable code detected. + () => x; + } + } + + for (; false;) { + { + let y; + ~~~ +!!! error TS7027: Unreachable code detected. + y = 1; + } + } + + for (; false;) { + switch (1){ + ~~~~~~ +!!! error TS7027: Unreachable code detected. + case 1: + let z0; + () => z0; + break; + } + } + + for (; false;) { + switch (1){ + ~~~~~~ +!!! error TS7027: Unreachable code detected. + case 1: + let z; + z = 1; + break; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nestedBlockScopedBindings15.symbols b/tests/baselines/reference/nestedBlockScopedBindings15.symbols deleted file mode 100644 index 26ef28f6050..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings15.symbols +++ /dev/null @@ -1,46 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings15.ts === -for (; false;) { - { - let x; ->x : Symbol(x, Decl(nestedBlockScopedBindings15.ts, 2, 11)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings15.ts, 2, 11)) - } -} - -for (; false;) { - { - let y; ->y : Symbol(y, Decl(nestedBlockScopedBindings15.ts, 9, 11)) - - y = 1; ->y : Symbol(y, Decl(nestedBlockScopedBindings15.ts, 9, 11)) - } -} - -for (; false;) { - switch (1){ - case 1: - let z0; ->z0 : Symbol(z0, Decl(nestedBlockScopedBindings15.ts, 17, 15)) - - () => z0; ->z0 : Symbol(z0, Decl(nestedBlockScopedBindings15.ts, 17, 15)) - - break; - } -} - -for (; false;) { - switch (1){ - case 1: - let z; ->z : Symbol(z, Decl(nestedBlockScopedBindings15.ts, 26, 15)) - - z = 1; ->z : Symbol(z, Decl(nestedBlockScopedBindings15.ts, 26, 15)) - - break; - } -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings15.types b/tests/baselines/reference/nestedBlockScopedBindings15.types deleted file mode 100644 index 5173c0c5600..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings15.types +++ /dev/null @@ -1,66 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings15.ts === -for (; false;) { ->false : boolean - { - let x; ->x : any - - () => x; ->() => x : () => any ->x : any - } -} - -for (; false;) { ->false : boolean - { - let y; ->y : any - - y = 1; ->y = 1 : number ->y : any ->1 : number - } -} - -for (; false;) { ->false : boolean - - switch (1){ ->1 : number - - case 1: ->1 : number - - let z0; ->z0 : any - - () => z0; ->() => z0 : () => any ->z0 : any - - break; - } -} - -for (; false;) { ->false : boolean - - switch (1){ ->1 : number - - case 1: ->1 : number - - let z; ->z : any - - z = 1; ->z = 1 : number ->z : any ->1 : number - - break; - } -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings16.errors.txt b/tests/baselines/reference/nestedBlockScopedBindings16.errors.txt new file mode 100644 index 00000000000..806f58231a0 --- /dev/null +++ b/tests/baselines/reference/nestedBlockScopedBindings16.errors.txt @@ -0,0 +1,50 @@ +tests/cases/compiler/nestedBlockScopedBindings16.ts(4,9): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings16.ts(12,9): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings16.ts(19,5): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings16.ts(29,5): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/nestedBlockScopedBindings16.ts (4 errors) ==== + var x; + for (; false;) { + { + let x; + ~~~ +!!! error TS7027: Unreachable code detected. + () => x; + } + } + + var y; + for (; false;) { + { + let y; + ~~~ +!!! error TS7027: Unreachable code detected. + y = 1; + } + } + + var z0; + for (; false;) { + switch (1){ + ~~~~~~ +!!! error TS7027: Unreachable code detected. + case 1: + let z0; + () => z0; + break; + } + } + + var z; + for (; false;) { + switch (1){ + ~~~~~~ +!!! error TS7027: Unreachable code detected. + case 1: + let z; + z = 1; + break; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nestedBlockScopedBindings16.symbols b/tests/baselines/reference/nestedBlockScopedBindings16.symbols deleted file mode 100644 index cbe8114cf14..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings16.symbols +++ /dev/null @@ -1,58 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings16.ts === -var x; ->x : Symbol(x, Decl(nestedBlockScopedBindings16.ts, 0, 3)) - -for (; false;) { - { - let x; ->x : Symbol(x, Decl(nestedBlockScopedBindings16.ts, 3, 11)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings16.ts, 3, 11)) - } -} - -var y; ->y : Symbol(y, Decl(nestedBlockScopedBindings16.ts, 8, 3)) - -for (; false;) { - { - let y; ->y : Symbol(y, Decl(nestedBlockScopedBindings16.ts, 11, 11)) - - y = 1; ->y : Symbol(y, Decl(nestedBlockScopedBindings16.ts, 11, 11)) - } -} - -var z0; ->z0 : Symbol(z0, Decl(nestedBlockScopedBindings16.ts, 16, 3)) - -for (; false;) { - switch (1){ - case 1: - let z0; ->z0 : Symbol(z0, Decl(nestedBlockScopedBindings16.ts, 20, 15)) - - () => z0; ->z0 : Symbol(z0, Decl(nestedBlockScopedBindings16.ts, 20, 15)) - - break; - } -} - -var z; ->z : Symbol(z, Decl(nestedBlockScopedBindings16.ts, 26, 3)) - -for (; false;) { - switch (1){ - case 1: - let z; ->z : Symbol(z, Decl(nestedBlockScopedBindings16.ts, 30, 15)) - - z = 1; ->z : Symbol(z, Decl(nestedBlockScopedBindings16.ts, 30, 15)) - - break; - } -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings16.types b/tests/baselines/reference/nestedBlockScopedBindings16.types deleted file mode 100644 index 22698402a62..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings16.types +++ /dev/null @@ -1,78 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings16.ts === -var x; ->x : any - -for (; false;) { ->false : boolean - { - let x; ->x : any - - () => x; ->() => x : () => any ->x : any - } -} - -var y; ->y : any - -for (; false;) { ->false : boolean - { - let y; ->y : any - - y = 1; ->y = 1 : number ->y : any ->1 : number - } -} - -var z0; ->z0 : any - -for (; false;) { ->false : boolean - - switch (1){ ->1 : number - - case 1: ->1 : number - - let z0; ->z0 : any - - () => z0; ->() => z0 : () => any ->z0 : any - - break; - } -} - -var z; ->z : any - -for (; false;) { ->false : boolean - - switch (1){ ->1 : number - - case 1: ->1 : number - - let z; ->z : any - - z = 1; ->z = 1 : number ->z : any ->1 : number - - break; - } -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings5.errors.txt b/tests/baselines/reference/nestedBlockScopedBindings5.errors.txt new file mode 100644 index 00000000000..a40f6a29aea --- /dev/null +++ b/tests/baselines/reference/nestedBlockScopedBindings5.errors.txt @@ -0,0 +1,92 @@ +tests/cases/compiler/nestedBlockScopedBindings5.ts(37,9): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings5.ts(54,9): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings5.ts(71,9): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/nestedBlockScopedBindings5.ts (3 errors) ==== + function a0() { + for (let x in []) { + x = x + 1; + } + for (let x;;) { + x = x + 2; + } + } + + function a1() { + for (let x in []) { + x = x + 1; + () => x; + } + for (let x;;) { + x = x + 2; + } + } + + function a2() { + for (let x in []) { + x = x + 1; + } + for (let x;;) { + x = x + 2; + () => x; + } + } + + + function a3() { + for (let x in []) { + x = x + 1; + () => x; + } + for (let x;false;) { + x = x + 2; + ~ +!!! error TS7027: Unreachable code detected. + () => x; + } + switch (1) { + case 1: + let x; + () => x; + break; + } + + } + + function a4() { + for (let x in []) { + x = x + 1; + } + for (let x;false;) { + x = x + 2; + ~ +!!! error TS7027: Unreachable code detected. + } + switch (1) { + case 1: + let x; + () => x; + break; + } + + } + + function a5() { + let y; + for (let x in []) { + x = x + 1; + } + for (let x;false;) { + x = x + 2; + ~ +!!! error TS7027: Unreachable code detected. + () => x; + } + switch (1) { + case 1: + let x; + break; + } + + } \ No newline at end of file diff --git a/tests/baselines/reference/nestedBlockScopedBindings5.symbols b/tests/baselines/reference/nestedBlockScopedBindings5.symbols deleted file mode 100644 index 202a1d2e83f..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings5.symbols +++ /dev/null @@ -1,163 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings5.ts === -function a0() { ->a0 : Symbol(a0, Decl(nestedBlockScopedBindings5.ts, 0, 0)) - - for (let x in []) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 1, 12)) - - x = x + 1; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 1, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 1, 12)) - } - for (let x;;) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 4, 12)) - - x = x + 2; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 4, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 4, 12)) - } -} - -function a1() { ->a1 : Symbol(a1, Decl(nestedBlockScopedBindings5.ts, 7, 1)) - - for (let x in []) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 10, 12)) - - x = x + 1; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 10, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 10, 12)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 10, 12)) - } - for (let x;;) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 14, 12)) - - x = x + 2; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 14, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 14, 12)) - } -} - -function a2() { ->a2 : Symbol(a2, Decl(nestedBlockScopedBindings5.ts, 17, 1)) - - for (let x in []) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 20, 12)) - - x = x + 1; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 20, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 20, 12)) - } - for (let x;;) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 23, 12)) - - x = x + 2; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 23, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 23, 12)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 23, 12)) - } -} - - -function a3() { ->a3 : Symbol(a3, Decl(nestedBlockScopedBindings5.ts, 27, 1)) - - for (let x in []) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 31, 12)) - - x = x + 1; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 31, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 31, 12)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 31, 12)) - } - for (let x;false;) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 35, 12)) - - x = x + 2; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 35, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 35, 12)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 35, 12)) - } - switch (1) { - case 1: - let x; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 41, 15)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 41, 15)) - - break; - } - -} - -function a4() { ->a4 : Symbol(a4, Decl(nestedBlockScopedBindings5.ts, 46, 1)) - - for (let x in []) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 49, 12)) - - x = x + 1; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 49, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 49, 12)) - } - for (let x;false;) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 52, 12)) - - x = x + 2; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 52, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 52, 12)) - } - switch (1) { - case 1: - let x; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 57, 15)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 57, 15)) - - break; - } - -} - -function a5() { ->a5 : Symbol(a5, Decl(nestedBlockScopedBindings5.ts, 62, 1)) - - let y; ->y : Symbol(y, Decl(nestedBlockScopedBindings5.ts, 65, 7)) - - for (let x in []) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 66, 12)) - - x = x + 1; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 66, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 66, 12)) - } - for (let x;false;) { ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 69, 12)) - - x = x + 2; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 69, 12)) ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 69, 12)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 69, 12)) - } - switch (1) { - case 1: - let x; ->x : Symbol(x, Decl(nestedBlockScopedBindings5.ts, 75, 15)) - - break; - } - -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings5.types b/tests/baselines/reference/nestedBlockScopedBindings5.types deleted file mode 100644 index 10ea0e5f902..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings5.types +++ /dev/null @@ -1,227 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings5.ts === -function a0() { ->a0 : () => void - - for (let x in []) { ->x : string ->[] : undefined[] - - x = x + 1; ->x = x + 1 : string ->x : string ->x + 1 : string ->x : string ->1 : number - } - for (let x;;) { ->x : any - - x = x + 2; ->x = x + 2 : any ->x : any ->x + 2 : any ->x : any ->2 : number - } -} - -function a1() { ->a1 : () => void - - for (let x in []) { ->x : string ->[] : undefined[] - - x = x + 1; ->x = x + 1 : string ->x : string ->x + 1 : string ->x : string ->1 : number - - () => x; ->() => x : () => string ->x : string - } - for (let x;;) { ->x : any - - x = x + 2; ->x = x + 2 : any ->x : any ->x + 2 : any ->x : any ->2 : number - } -} - -function a2() { ->a2 : () => void - - for (let x in []) { ->x : string ->[] : undefined[] - - x = x + 1; ->x = x + 1 : string ->x : string ->x + 1 : string ->x : string ->1 : number - } - for (let x;;) { ->x : any - - x = x + 2; ->x = x + 2 : any ->x : any ->x + 2 : any ->x : any ->2 : number - - () => x; ->() => x : () => any ->x : any - } -} - - -function a3() { ->a3 : () => void - - for (let x in []) { ->x : string ->[] : undefined[] - - x = x + 1; ->x = x + 1 : string ->x : string ->x + 1 : string ->x : string ->1 : number - - () => x; ->() => x : () => string ->x : string - } - for (let x;false;) { ->x : any ->false : boolean - - x = x + 2; ->x = x + 2 : any ->x : any ->x + 2 : any ->x : any ->2 : number - - () => x; ->() => x : () => any ->x : any - } - switch (1) { ->1 : number - - case 1: ->1 : number - - let x; ->x : any - - () => x; ->() => x : () => any ->x : any - - break; - } - -} - -function a4() { ->a4 : () => void - - for (let x in []) { ->x : string ->[] : undefined[] - - x = x + 1; ->x = x + 1 : string ->x : string ->x + 1 : string ->x : string ->1 : number - } - for (let x;false;) { ->x : any ->false : boolean - - x = x + 2; ->x = x + 2 : any ->x : any ->x + 2 : any ->x : any ->2 : number - } - switch (1) { ->1 : number - - case 1: ->1 : number - - let x; ->x : any - - () => x; ->() => x : () => any ->x : any - - break; - } - -} - -function a5() { ->a5 : () => void - - let y; ->y : any - - for (let x in []) { ->x : string ->[] : undefined[] - - x = x + 1; ->x = x + 1 : string ->x : string ->x + 1 : string ->x : string ->1 : number - } - for (let x;false;) { ->x : any ->false : boolean - - x = x + 2; ->x = x + 2 : any ->x : any ->x + 2 : any ->x : any ->2 : number - - () => x; ->() => x : () => any ->x : any - } - switch (1) { ->1 : number - - case 1: ->1 : number - - let x; ->x : any - - break; - } - -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings7.errors.txt b/tests/baselines/reference/nestedBlockScopedBindings7.errors.txt new file mode 100644 index 00000000000..274ef8bf6c3 --- /dev/null +++ b/tests/baselines/reference/nestedBlockScopedBindings7.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/nestedBlockScopedBindings7.ts(2,5): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings7.ts(6,5): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/nestedBlockScopedBindings7.ts (2 errors) ==== + for (let x; false;) { + () => x; + ~ +!!! error TS7027: Unreachable code detected. + } + + for (let y; false;) { + y = 1; + ~ +!!! error TS7027: Unreachable code detected. + } \ No newline at end of file diff --git a/tests/baselines/reference/nestedBlockScopedBindings7.symbols b/tests/baselines/reference/nestedBlockScopedBindings7.symbols deleted file mode 100644 index 2d65af06a96..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings7.symbols +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings7.ts === -for (let x; false;) { ->x : Symbol(x, Decl(nestedBlockScopedBindings7.ts, 0, 8)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings7.ts, 0, 8)) -} - -for (let y; false;) { ->y : Symbol(y, Decl(nestedBlockScopedBindings7.ts, 4, 8)) - - y = 1; ->y : Symbol(y, Decl(nestedBlockScopedBindings7.ts, 4, 8)) -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings7.types b/tests/baselines/reference/nestedBlockScopedBindings7.types deleted file mode 100644 index 2fdb2d90e76..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings7.types +++ /dev/null @@ -1,19 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings7.ts === -for (let x; false;) { ->x : any ->false : boolean - - () => x; ->() => x : () => any ->x : any -} - -for (let y; false;) { ->y : any ->false : boolean - - y = 1; ->y = 1 : number ->y : any ->1 : number -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings8.errors.txt b/tests/baselines/reference/nestedBlockScopedBindings8.errors.txt new file mode 100644 index 00000000000..73f580ae3cb --- /dev/null +++ b/tests/baselines/reference/nestedBlockScopedBindings8.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/nestedBlockScopedBindings8.ts(3,5): error TS7027: Unreachable code detected. +tests/cases/compiler/nestedBlockScopedBindings8.ts(8,5): error TS7027: Unreachable code detected. + + +==== tests/cases/compiler/nestedBlockScopedBindings8.ts (2 errors) ==== + var x; + for (let x; false; ) { + () => x; + ~ +!!! error TS7027: Unreachable code detected. + } + + var y; + for (let y; false; ) { + y = 1; + ~ +!!! error TS7027: Unreachable code detected. + } \ No newline at end of file diff --git a/tests/baselines/reference/nestedBlockScopedBindings8.symbols b/tests/baselines/reference/nestedBlockScopedBindings8.symbols deleted file mode 100644 index a61df0502ec..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings8.symbols +++ /dev/null @@ -1,20 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings8.ts === -var x; ->x : Symbol(x, Decl(nestedBlockScopedBindings8.ts, 0, 3)) - -for (let x; false; ) { ->x : Symbol(x, Decl(nestedBlockScopedBindings8.ts, 1, 8)) - - () => x; ->x : Symbol(x, Decl(nestedBlockScopedBindings8.ts, 1, 8)) -} - -var y; ->y : Symbol(y, Decl(nestedBlockScopedBindings8.ts, 5, 3)) - -for (let y; false; ) { ->y : Symbol(y, Decl(nestedBlockScopedBindings8.ts, 6, 8)) - - y = 1; ->y : Symbol(y, Decl(nestedBlockScopedBindings8.ts, 6, 8)) -} diff --git a/tests/baselines/reference/nestedBlockScopedBindings8.types b/tests/baselines/reference/nestedBlockScopedBindings8.types deleted file mode 100644 index 9e4b98ffbf2..00000000000 --- a/tests/baselines/reference/nestedBlockScopedBindings8.types +++ /dev/null @@ -1,25 +0,0 @@ -=== tests/cases/compiler/nestedBlockScopedBindings8.ts === -var x; ->x : any - -for (let x; false; ) { ->x : any ->false : boolean - - () => x; ->() => x : () => any ->x : any -} - -var y; ->y : any - -for (let y; false; ) { ->y : any ->false : boolean - - y = 1; ->y = 1 : number ->y : any ->1 : number -} diff --git a/tests/baselines/reference/parser_duplicateLabel1.errors.txt b/tests/baselines/reference/parser_duplicateLabel1.errors.txt index a4319aaa7b9..c98ede21ecf 100644 --- a/tests/baselines/reference/parser_duplicateLabel1.errors.txt +++ b/tests/baselines/reference/parser_duplicateLabel1.errors.txt @@ -1,13 +1,16 @@ tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel1.ts(1,1): error TS7028: Unused label. tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel1.ts(2,1): error TS1114: Duplicate label 'target' +tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel1.ts(2,1): error TS7028: Unused label. -==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel1.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel1.ts (3 errors) ==== target: ~~~~~~ !!! error TS7028: Unused label. target: ~~~~~~ !!! error TS1114: Duplicate label 'target' + ~~~~~~ +!!! error TS7028: Unused label. while (true) { } \ No newline at end of file diff --git a/tests/baselines/reference/parser_duplicateLabel2.errors.txt b/tests/baselines/reference/parser_duplicateLabel2.errors.txt index 123949fa5aa..cbad8b73a21 100644 --- a/tests/baselines/reference/parser_duplicateLabel2.errors.txt +++ b/tests/baselines/reference/parser_duplicateLabel2.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel2.ts(1,1): error TS7028: Unused label. tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel2.ts(3,3): error TS1114: Duplicate label 'target' +tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel2.ts(3,3): error TS7028: Unused label. -==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel2.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_duplicateLabel2.ts (3 errors) ==== target: ~~~~~~ !!! error TS7028: Unused label. @@ -10,6 +11,8 @@ tests/cases/conformance/parser/ecmascript5/Statements/LabeledStatements/parser_d target: ~~~~~~ !!! error TS1114: Duplicate label 'target' + ~~~~~~ +!!! error TS7028: Unused label. while (true) { } } \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecks5.errors.txt b/tests/baselines/reference/reachabilityChecks5.errors.txt index 147dbe264a3..4a894261a3d 100644 --- a/tests/baselines/reference/reachabilityChecks5.errors.txt +++ b/tests/baselines/reference/reachabilityChecks5.errors.txt @@ -6,11 +6,12 @@ tests/cases/compiler/reachabilityChecks5.ts(52,17): error TS7030: Not all code p tests/cases/compiler/reachabilityChecks5.ts(80,17): error TS7030: Not all code paths return a value. tests/cases/compiler/reachabilityChecks5.ts(86,13): error TS7027: Unreachable code detected. tests/cases/compiler/reachabilityChecks5.ts(94,17): error TS7030: Not all code paths return a value. +tests/cases/compiler/reachabilityChecks5.ts(97,13): error TS7027: Unreachable code detected. tests/cases/compiler/reachabilityChecks5.ts(116,18): error TS7030: Not all code paths return a value. tests/cases/compiler/reachabilityChecks5.ts(123,13): error TS7027: Unreachable code detected. -==== tests/cases/compiler/reachabilityChecks5.ts (10 errors) ==== +==== tests/cases/compiler/reachabilityChecks5.ts (11 errors) ==== function f0(x): number { while (true); @@ -124,6 +125,8 @@ tests/cases/compiler/reachabilityChecks5.ts(123,13): error TS7027: Unreachable c try { while (false) { return 1; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } catch (e) { diff --git a/tests/baselines/reference/reachabilityChecks6.errors.txt b/tests/baselines/reference/reachabilityChecks6.errors.txt index 38e72def8c6..24832d9ab38 100644 --- a/tests/baselines/reference/reachabilityChecks6.errors.txt +++ b/tests/baselines/reference/reachabilityChecks6.errors.txt @@ -5,11 +5,12 @@ tests/cases/compiler/reachabilityChecks6.ts(52,10): error TS7030: Not all code p tests/cases/compiler/reachabilityChecks6.ts(80,10): error TS7030: Not all code paths return a value. tests/cases/compiler/reachabilityChecks6.ts(86,13): error TS7027: Unreachable code detected. tests/cases/compiler/reachabilityChecks6.ts(94,10): error TS7030: Not all code paths return a value. +tests/cases/compiler/reachabilityChecks6.ts(97,13): error TS7027: Unreachable code detected. tests/cases/compiler/reachabilityChecks6.ts(116,10): error TS7030: Not all code paths return a value. tests/cases/compiler/reachabilityChecks6.ts(123,13): error TS7027: Unreachable code detected. -==== tests/cases/compiler/reachabilityChecks6.ts (9 errors) ==== +==== tests/cases/compiler/reachabilityChecks6.ts (10 errors) ==== function f0(x) { while (true); @@ -121,6 +122,8 @@ tests/cases/compiler/reachabilityChecks6.ts(123,13): error TS7027: Unreachable c try { while (false) { return 1; + ~~~~~~ +!!! error TS7027: Unreachable code detected. } } catch (e) { diff --git a/tests/baselines/reference/typeGuardEnums.types b/tests/baselines/reference/typeGuardEnums.types index 1d39a81d78a..2bef6915046 100644 --- a/tests/baselines/reference/typeGuardEnums.types +++ b/tests/baselines/reference/typeGuardEnums.types @@ -27,7 +27,7 @@ else { if (typeof x !== "number") { >typeof x !== "number" : boolean >typeof x : string ->x : number | string | E | V +>x : number | string >"number" : string x; // string @@ -35,6 +35,6 @@ if (typeof x !== "number") { } else { x; // number|E|V ->x : number | E | V +>x : number } diff --git a/tests/baselines/reference/typeGuardNesting.types b/tests/baselines/reference/typeGuardNesting.types index 255e96da89e..2b18e232412 100644 --- a/tests/baselines/reference/typeGuardNesting.types +++ b/tests/baselines/reference/typeGuardNesting.types @@ -34,7 +34,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >(typeof strOrBool === 'boolean') : boolean >typeof strOrBool === 'boolean' : boolean >typeof strOrBool : string ->strOrBool : boolean | string +>strOrBool : string | boolean >'boolean' : string >strOrBool : boolean >false : boolean @@ -56,7 +56,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >(typeof strOrBool !== 'string') : boolean >typeof strOrBool !== 'string' : boolean >typeof strOrBool : string ->strOrBool : boolean | string +>strOrBool : string | boolean >'string' : string >strOrBool : boolean >false : boolean @@ -68,7 +68,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >typeof strOrBool !== 'string' && !strOrBool : boolean >typeof strOrBool !== 'string' : boolean >typeof strOrBool : string ->strOrBool : string | boolean +>strOrBool : boolean | string >'string' : string >!strOrBool : boolean >strOrBool : boolean @@ -94,7 +94,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >(typeof strOrBool === 'boolean') : boolean >typeof strOrBool === 'boolean' : boolean >typeof strOrBool : string ->strOrBool : boolean | string +>strOrBool : string | boolean >'boolean' : string >strOrBool : boolean >false : boolean @@ -116,7 +116,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >(typeof strOrBool !== 'string') : boolean >typeof strOrBool !== 'string' : boolean >typeof strOrBool : string ->strOrBool : boolean | string +>strOrBool : string | boolean >'string' : string >strOrBool : boolean >false : boolean diff --git a/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types b/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types index 10f50bed52e..a10d398988f 100644 --- a/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types +++ b/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types @@ -95,11 +95,11 @@ if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "numbe >typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" : boolean >typeof strOrNumOrBoolOrC !== "string" : boolean >typeof strOrNumOrBoolOrC : string ->strOrNumOrBoolOrC : string | number | boolean | C +>strOrNumOrBoolOrC : C | string | number | boolean >"string" : string >typeof strOrNumOrBoolOrC !== "number" : boolean >typeof strOrNumOrBoolOrC : string ->strOrNumOrBoolOrC : number | boolean | C +>strOrNumOrBoolOrC : C | number | boolean >"number" : string >typeof strOrNumOrBool === "boolean" : boolean >typeof strOrNumOrBool : string @@ -107,9 +107,9 @@ if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "numbe >"boolean" : string cOrBool = strOrNumOrBoolOrC; // C | boolean ->cOrBool = strOrNumOrBoolOrC : boolean | C +>cOrBool = strOrNumOrBoolOrC : C | boolean >cOrBool : C | boolean ->strOrNumOrBoolOrC : boolean | C +>strOrNumOrBoolOrC : C | boolean bool = strOrNumOrBool; // boolean >bool = strOrNumOrBool : boolean @@ -120,7 +120,7 @@ else { var r1: string | number | boolean | C = strOrNumOrBoolOrC; // string | number | boolean | C >r1 : string | number | boolean | C >C : C ->strOrNumOrBoolOrC : string | number | boolean | C +>strOrNumOrBoolOrC : string | number | C | boolean var r2: string | number | boolean = strOrNumOrBool; >r2 : string | number | boolean diff --git a/tests/baselines/reference/typeGuardOfFormNotExpr.types b/tests/baselines/reference/typeGuardOfFormNotExpr.types index a99db08efab..e7cfd6a0dce 100644 --- a/tests/baselines/reference/typeGuardOfFormNotExpr.types +++ b/tests/baselines/reference/typeGuardOfFormNotExpr.types @@ -73,13 +73,13 @@ if (!(typeof strOrNumOrBool !== "string") || !(typeof strOrNumOrBool !== "number >(typeof strOrNumOrBool !== "string") : boolean >typeof strOrNumOrBool !== "string" : boolean >typeof strOrNumOrBool : string ->strOrNumOrBool : string | number | boolean +>strOrNumOrBool : boolean | string | number >"string" : string >!(typeof strOrNumOrBool !== "number") : boolean >(typeof strOrNumOrBool !== "number") : boolean >typeof strOrNumOrBool !== "number" : boolean >typeof strOrNumOrBool : string ->strOrNumOrBool : number | boolean +>strOrNumOrBool : boolean | number >"number" : string strOrNum = strOrNumOrBool; // string | number @@ -152,19 +152,19 @@ if (!(typeof strOrNumOrBool === "string") && numOrBool !== strOrNumOrBool) { >(typeof strOrNumOrBool === "string") : boolean >typeof strOrNumOrBool === "string" : boolean >typeof strOrNumOrBool : string ->strOrNumOrBool : string | number | boolean +>strOrNumOrBool : boolean | string | number >"string" : string >numOrBool !== strOrNumOrBool : boolean >numOrBool : number | boolean ->strOrNumOrBool : number | boolean +>strOrNumOrBool : boolean | number numOrBool = strOrNumOrBool; // number | boolean ->numOrBool = strOrNumOrBool : number | boolean +>numOrBool = strOrNumOrBool : boolean | number >numOrBool : number | boolean ->strOrNumOrBool : number | boolean +>strOrNumOrBool : boolean | number } else { var r1: string | number | boolean = strOrNumOrBool; // string | number | boolean >r1 : string | number | boolean ->strOrNumOrBool : string | number | boolean +>strOrNumOrBool : string | boolean | number } diff --git a/tests/baselines/reference/typeGuardRedundancy.types b/tests/baselines/reference/typeGuardRedundancy.types index 1507ceb850e..754019de7ed 100644 --- a/tests/baselines/reference/typeGuardRedundancy.types +++ b/tests/baselines/reference/typeGuardRedundancy.types @@ -48,7 +48,7 @@ var r3 = typeof x === "string" || typeof x === "string" ? x.substr : x.toFixed; >typeof x === "string" || typeof x === "string" : boolean >typeof x === "string" : boolean >typeof x : string ->x : string | number +>x : number | string >"string" : string >typeof x === "string" : boolean >typeof x : string diff --git a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt index 0139c96b3f9..f9394c622c0 100644 --- a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt @@ -4,9 +4,13 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(68,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(69,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(70,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(71,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(72,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(73,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(74,1): error TS7028: Unused label. -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (6 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (10 errors) ==== // typeof operator on any type var ANY: any; @@ -90,6 +94,14 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator ~ !!! error TS7028: Unused label. z: typeof objA.a; + ~ +!!! error TS7028: Unused label. z: typeof A.foo; + ~ +!!! error TS7028: Unused label. z: typeof M.n; - z: typeof obj1.x; \ No newline at end of file + ~ +!!! error TS7028: Unused label. + z: typeof obj1.x; + ~ +!!! error TS7028: Unused label. \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt index 37b2cafab37..bd891c949a3 100644 --- a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt @@ -1,9 +1,13 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(50,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(51,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(52,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(54,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(55,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(56,1): error TS7028: Unused label. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(57,1): error TS7028: Unused label. -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (3 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (7 errors) ==== // typeof operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; @@ -64,6 +68,14 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator !!! error TS7028: Unused label. var y = { a: "", b: "" }; z: typeof y.a; + ~ +!!! error TS7028: Unused label. z: typeof objA.a; + ~ +!!! error TS7028: Unused label. z: typeof A.foo; - z: typeof M.n; \ No newline at end of file + ~ +!!! error TS7028: Unused label. + z: typeof M.n; + ~ +!!! error TS7028: Unused label. \ No newline at end of file