Files
tsgo/testdata/baselines/reference/compiler/reachabilityChecks9.errors.txt

37 lines
950 B
Plaintext

reachabilityChecks9.ts(7,7): error TS7027: Unreachable code detected.
reachabilityChecks9.ts(20,7): error TS7027: Unreachable code detected.
==== reachabilityChecks9.ts (2 errors) ====
// https://github.com/microsoft/TypeScript/issues/55562
function g(str: string) {
switch (str) {
case "a":
return;
console.log("1");
~~~~~~~~~~~~~~~~~
console.log("2");
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS7027: Unreachable code detected.
case "b":
console.log("3");
}
}
function h(str: string) {
switch (str) {
case "a":
console.log("1");
default:
return;
console.log("2");
~~~~~~~~~~~~~~~~~
console.log("3");
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS7027: Unreachable code detected.
case "b":
console.log("4");
}
}