You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should compile. Overloading function definitions should allow props of either A or B.
Actual behavior:
The compiler respects only the first overload signature. Visual studio code correctly doesn't warn inline.
src/test.tsx(17,1): error TS2324: Property 'requiredA' is missing in type 'IntrinsicAttributes & A'.
src/test.tsx(17,8): error TS2339: Property 'requiredB' does not exist on type 'IntrinsicAttributes & A'.
src/test.tsx(25,1): error TS2324: Property 'requiredB' is missing in type 'IntrinsicAttributes & B'.
src/test.tsx(25,8): error TS2339: Property 'requiredA' does not exist on type 'IntrinsicAttributes & B'.
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.2.1
Code
Expected behavior:
This should compile. Overloading function definitions should allow props of either A or B.
Actual behavior:
The compiler respects only the first overload signature. Visual studio code correctly doesn't warn inline.
The text was updated successfully, but these errors were encountered: