mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Add regression test
This commit is contained in:
24
tests/cases/compiler/indirectTypeParameterReferences.ts
Normal file
24
tests/cases/compiler/indirectTypeParameterReferences.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
// Repro from #19043
|
||||
|
||||
type B = {b: string}
|
||||
|
||||
const flowtypes = <A>(b: B) => {
|
||||
type Combined = A & B
|
||||
|
||||
const combined = (fn: (combined: Combined) => void) => null
|
||||
const literal = (fn: (aPlusB: A & B) => void) => null
|
||||
|
||||
return {combined, literal}
|
||||
}
|
||||
|
||||
const {combined, literal} = flowtypes<{a: string}>({b: 'b-value'})
|
||||
|
||||
literal(aPlusB => {
|
||||
aPlusB.b
|
||||
aPlusB.a
|
||||
})
|
||||
|
||||
combined(comb => {
|
||||
comb.b
|
||||
comb.a
|
||||
})
|
||||
Reference in New Issue
Block a user