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
typeTypes<T>=(Textends{} ? 'object' : never)|'primitive'functionaccept<T>(a: Types<T>){}functionb<Textends{}>(a: T){accept<T>('primitive');// Okayaccept<T>('object');// Error: TS2345accept<T&object>('object');// Okay, but T already extends from {}, such workaround shall not be required}
π Actual behavior
tsc accepts the above code
π Expected behavior
the above code is rejected
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
Constraint generics param does not satisfy type infer expression.
π Version & Regression Information
4.7.4 and 4.8.2, earlier versions may behave the same.
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
tsc accepts the above code
π Expected behavior
the above code is rejected
The text was updated successfully, but these errors were encountered: