mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Additional test case for contextual type check
This commit is contained in:
@@ -267,6 +267,12 @@ namespace N { // Force this test to be TS-only
|
||||
testExtractConstant("extractConstant_ContextualType", `
|
||||
interface I { a: 1 | 2 | 3 }
|
||||
let i: I = [#|{ a: 1 }|];
|
||||
`);
|
||||
|
||||
testExtractConstant("extractConstant_ContextualType_Lambda", `
|
||||
const myObj: { member(x: number, y: string): void } = {
|
||||
member: [#|(x, y) => x + y|],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user