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 is the behavior in every version I tried (from 3.3.3 to 5.5.0-beta), and I reviewed the FAQ for entries about intersections and conditional types.
It's looking increasingly likely the only good fix here is going to be introducing an unreliable (name???) companion to the in and out variance markers and let users specify that
π Search Terms
intersection, empty, generic
π Version & Regression Information
This is the behavior in every version I tried (from 3.3.3 to 5.5.0-beta), and I reviewed the FAQ for entries about intersections and conditional types.
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.5.0-beta#code/C4TwDgpgBAggznCAnY84EsDmA7AhgIwBsIAeAVQBooAVKCAD2AmwBM4oyA+KAXhoFgAUENCRYJWnwCu2ANbYA9gHds3PgG8wSBWABcUAAx1GzNjSgB+KMCRTo+gGa5CiAL4BuEeGgwATL1gEZFQELDwiUhgqGBIDTk53KAB6JKgAMVx0FyEvMQAhCQCZeWVVAM1tPUNjJlZ2WisbOyhHZzcoADIodQ9c6Dz-PjRgtDCCYhI8qgK4hOTUgGUpAGNliAg2HMFRaABhQuk5RRU1aoZaswbrW3soJxcIT23vKF3BwMQUUZxx0l2qfazRIpKBLVbrNhAA
π» Code
π Actual behavior
Type
A2
fails with:π Expected behavior
A<0>
should be assignable toA
. I.e.A2
should not fail.Additional information about the issue
B2
does not fail, i.e. adding& {}
seems to strangely work around this problem.C2
does not fail, i.e. this problem seems to only occur inside object properties.The text was updated successfully, but these errors were encountered: