We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
TypeScript Version: 2.5.3+ TSC works as expected in 2.5.2, unexpected behavior seen in 2.5.3 and @next (typescript@2.6.0-dev.20171007)
typescript@2.6.0-dev.20171007
Code
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 })
Expected behavior: Both literal and combined should produce the same behavior, and properties a and b should be accessible on the argument for both.
literal
combined
a
b
Actual behavior: comb.a is unaccessible: test.ts(21,8): error TS2339: Property 'a' does not exist on type 'Combined'.
comb.a
test.ts(21,8): error TS2339: Property 'a' does not exist on type 'Combined'.
TypeScript Version: 2.5.3+
TSC works as expected in 2.5.2, unexpected behavior seen in 2.5.3 and @next (
typescript@2.6.0-dev.20171007)Code
Expected behavior:
Both
literalandcombinedshould produce the same behavior, and propertiesaandbshould be accessible on the argument for both.Actual behavior:
comb.ais unaccessible:test.ts(21,8): error TS2339: Property 'a' does not exist on type 'Combined'.