mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Modify tests so that they verify the inference of filtered catch handlers
This commit is contained in:
@@ -352,7 +352,7 @@ class CustomError extends Error {
|
||||
customField: number;
|
||||
}
|
||||
// $ExpectType Bluebird<void | Foo>
|
||||
fooProm.catch(CustomError, (reason: CustomError) => {
|
||||
fooProm.catch(CustomError, reason => {
|
||||
let a: number = reason.customField;
|
||||
});
|
||||
|
||||
@@ -366,7 +366,7 @@ class CustomErrorWithConstructor extends Error {
|
||||
}
|
||||
}
|
||||
// $ExpectType Bluebird<void | Foo>
|
||||
fooProm.catch(CustomErrorWithConstructor, (reason: CustomErrorWithConstructor) => {
|
||||
fooProm.catch(CustomErrorWithConstructor, reason => {
|
||||
let a: boolean = reason.arg1;
|
||||
let b: number = reason.arg2;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user