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
ghost
changed the title
Type error for this context although types are assignable (broke in 3.1)
Type inference for union of arrays broken
Sep 25, 2018
Okay, If I understood it correctly, the 3.2 feature #27028 was on the 3.1 (@next) channel for short amount of time and introduced this issue => this issue won't arrive in the 3.1 release and therefore is tagged with the 3.2 milestone.
@ulrichb The upcoming 3.1 release is in the release-3.1 branch, so master is technically the 3.2 release now (and has been for several days). We just hadn't bumped the version tag (but that's done now).
TypeScript Version: Version 3.1.0-dev.20180925
Search Terms: array this context type compatibility assignability
Code
Works in TS 3.0.
Note that the error disappears when changing
equalsShallow()
toequalsShallow<T>(this: Array<T>, other: Array<T>): boolean
.Further note that the error disappears when extracting a type for
a
andb
(instead of using the literal type inference).Expected behavior: No compile error
Actual behavior: Compile error, see snippet
Playground Link: Link (no error because it's TS 3.0)
The text was updated successfully, but these errors were encountered: