mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
37 lines
950 B
Plaintext
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");
|
|
}
|
|
}
|
|
|