Add regression test

This commit is contained in:
Anders Hejlsberg
2017-10-10 17:34:32 -07:00
parent 5a1d846e76
commit 83020dbbd6

View 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
})