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
Previously, spreading an optional any gave a bogus error when the name
conflicted with earlier properties in the object literal. Now the code
checks any types for optionality before issuing the error.
Fixes#37740
Previously, spreading an optional any gave a bogus error when the name
conflicted with earlier properties in the object literal. Now the code
checks any types for optionality before issuing the error.
Fixes#37740
TypeScript Version: 3.9.0-dev.20200328
Search Terms:
property-will-be-overwritten-by-spread
Code
Using string instead of any as the type of
a
property in A works as expected.Expected behavior:
No error
Actual behavior:
Playground Link:
Using any errors - bug
https://www.typescriptlang.org/play/?ts=3.9.0-dev.20200328&ssl=6&ssc=32&pln=1&pc=1#code/C4TwDgpgBAglC8UDeAoK6oEMD8AuLAdiCgL4ooDGA9gQM7Bb5yJIkDclN9UARgsukz4A5AC9xwgDRQAdHMzT2QA
Using string no error - works as expected
https://www.typescriptlang.org/play/?ts=3.9.0-dev.20200328#code/C4TwDgpgBAglC8UDeAoK6oEMD8AuKAzsAE4CWAdgOYoC+KKAxgPblFb5yJI0DcjLbAEYJk6TPgDkALxkSANFAB0yzAt5A
Related Issues: #36779
The text was updated successfully, but these errors were encountered: