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
Type '{ kind: "a"; } | { kind: "b"; }' is not assignable to type 'T'.
'{ kind: "a"; } | { kind: "b"; }' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Component'.
Type '{ kind: "a"; }' is not assignable to type 'T'.
'{ kind: "a"; }' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Component'.(2322)
π Expected behavior
No error, since c is T, { ... c } should also be T.
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
spread assignment generic constraint
π Version & Regression Information
version 4.3.0-dev.20210418
version 4.3.0-beta
β― Playground Link
Errors with ts 4.3.0-beta:
https://www.typescriptlang.org/play?ts=4.3.0-beta#code/FAFwngDgpgBAgjAvDA3jA1gSwHYBMBcMARAIZEwC+A3KJLAEJKoY4HEBG51t0MAwgHsAthAHYo2EEwQAfGPRrAAZgFdsAYxCYxMAE5R2KzABtcAHgAqMKAA8QE3AGd+w0eMkA+ABTrCFgJR+qMAwoTDqYo5S4gDufEHIKCFhKQB06erJodwp+iAqutgwsXw0FMBAA
Works fine with ts 4.2.3:
https://www.typescriptlang.org/play?ts=4.2.3#code/FAFwngDgpgBAgjAvDA3jA1gSwHYBMBcMARAIZEwC+A3KJLAEJKoY4HEBG51t0MAwgHsAthAHYo2EEwQAfGPRrAAZgFdsAYxCYxMAE5R2KzABtcAHgAqMKAA8QE3AGd+w0eMkA+ABTrCFgJR+qMAwoTDqYo5S4gDufEHIKCFhKQB06erJodwp+iAqutgwsXw0FMBAA
π» Code
π Actual behavior
π Expected behavior
No error, since
c
isT
,{ ... c }
should also beT
.The text was updated successfully, but these errors were encountered: