TypeScript/tests/cases/conformance/controlFlow/switchWithConstrainedTypeVariable.ts

15 lines
230 B
TypeScript
Raw Normal View History

2017-12-24 04:28:13 +01:00
// @strict: true
// Repro from #20840
function function1<T extends 'a' | 'b'>(key: T) {
switch (key) {
case 'a':
key.toLowerCase();
break;
default:
key.toLowerCase();
break;
}
}