mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-12 11:50:54 -06:00
Add regression tests
This commit is contained in:
parent
08cd0b3700
commit
22475e8958
19
tests/cases/compiler/contravariantTypeAliasInference.ts
Normal file
19
tests/cases/compiler/contravariantTypeAliasInference.ts
Normal file
@ -0,0 +1,19 @@
|
||||
// @strict: true
|
||||
|
||||
type Func1<T> = (x: T) => void;
|
||||
type Func2<T> = ((x: T) => void) | undefined;
|
||||
|
||||
declare let f1: Func1<string>;
|
||||
declare let f2: Func1<"a">;
|
||||
|
||||
declare function foo<T>(f1: Func1<T>, f2: Func1<T>): void;
|
||||
|
||||
foo(f1, f2);
|
||||
|
||||
declare let g1: Func2<string>;
|
||||
declare let g2: Func2<"a">;
|
||||
|
||||
declare function bar<T>(g1: Func2<T>, g2: Func2<T>): void;
|
||||
|
||||
bar(f1, f2);
|
||||
bar(g1, g2);
|
||||
Loading…
x
Reference in New Issue
Block a user