Add additional repro
This commit is contained in:
parent
48cad7788d
commit
500c4729e9
1 changed files with 28 additions and 0 deletions
|
@ -122,6 +122,34 @@ u.a && u.b && f(u.a, u.b);
|
|||
|
||||
u.b && u.a && f(u.a, u.b);
|
||||
|
||||
// Repro from #29012
|
||||
|
||||
type Additive = '+' | '-';
|
||||
type Multiplicative = '*' | '/';
|
||||
|
||||
interface AdditiveObj {
|
||||
key: Additive
|
||||
}
|
||||
|
||||
interface MultiplicativeObj {
|
||||
key: Multiplicative
|
||||
}
|
||||
|
||||
type Obj = AdditiveObj | MultiplicativeObj
|
||||
|
||||
export function foo(obj: Obj) {
|
||||
switch (obj.key) {
|
||||
case '+': {
|
||||
onlyPlus(obj.key);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onlyPlus(arg: '+') {
|
||||
return arg;
|
||||
}
|
||||
|
||||
// Repro from #29496
|
||||
|
||||
declare function never(value: never): never;
|
||||
|
|
Loading…
Reference in a new issue