We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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'.
The text was updated successfully, but these errors were encountered:
This is caused by an optimization in #18231 that is a little too optimistic. I will take a look.
Sorry, something went wrong.
ahejlsberg
No branches or pull requests
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
literal
andcombined
should produce the same behavior, and propertiesa
andb
should be accessible on the argument for both.Actual behavior:
comb.a
is unaccessible:test.ts(21,8): error TS2339: Property 'a' does not exist on type 'Combined'.
The text was updated successfully, but these errors were encountered: