mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Add regression test
This commit is contained in:
23
tests/cases/compiler/typeInferenceCacheInvalidation.ts
Normal file
23
tests/cases/compiler/typeInferenceCacheInvalidation.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// @strict: true
|
||||
|
||||
// Repro from #32230
|
||||
|
||||
type Callback<TFoo, TBar> = (foo: TFoo, bar: TBar) => any
|
||||
|
||||
declare function example<TFoo, TBar, TCallback extends Callback<TFoo, TBar>>(
|
||||
foo: TFoo,
|
||||
callback: TCallback,
|
||||
bar: TBar,
|
||||
): TCallback
|
||||
|
||||
example(42, (foo, bar) => ({
|
||||
t: () => {
|
||||
let s: string = bar;
|
||||
}
|
||||
}), '42');
|
||||
|
||||
example(42, (foo, bar) => ({
|
||||
t() {
|
||||
let s: string = bar;
|
||||
}
|
||||
}), '42');
|
||||
Reference in New Issue
Block a user