Add regression tests
This commit is contained in:
parent
e0599fd19c
commit
044d70fc24
1 changed files with 34 additions and 0 deletions
|
@ -140,3 +140,37 @@ declare function passContentsToFunc<T>(outerBox: T, consumer: BoxConsumerFromOut
|
|||
declare const outerBoxOfString: OuterBox<string>;
|
||||
|
||||
passContentsToFunc(outerBoxOfString, box => box.value);
|
||||
|
||||
// Repro from #32349
|
||||
|
||||
type DooDad = 'SOMETHING' | 'ELSE' ;
|
||||
|
||||
class Interesting {
|
||||
public compiles = () : Promise<DooDad> => {
|
||||
return Promise.resolve().then(() => {
|
||||
if (1 < 2) {
|
||||
return 'SOMETHING';
|
||||
}
|
||||
return 'ELSE';
|
||||
});
|
||||
};
|
||||
public doesnt = () : Promise<DooDad> => {
|
||||
return Promise.resolve().then(() => {
|
||||
return 'ELSE';
|
||||
});
|
||||
};
|
||||
public slightlyDifferentErrorMessage = () : Promise<DooDad> => {
|
||||
return Promise.resolve().then(() => {
|
||||
if (1 < 2) {
|
||||
return 'SOMETHING';
|
||||
}
|
||||
return 'SOMETHING';
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// Repro from #32349
|
||||
|
||||
declare function invoke<T>(f: () => T): T;
|
||||
|
||||
let xx: 0 | 1 | 2 = invoke(() => 1);
|
||||
|
|
Loading…
Reference in a new issue