Closed
Description
TypeScript Version: 3.9.1-rc/4.0.0-dev.20200428
3.9.0-beta seems to be fine.
Search Terms: intersection,private,generic,constraint,union
Code
type Type = {foo: string} | {bar: number};
class SyncableObject {
private foo: unknown;
}
interface SyncableRef<T extends ISyncableObject> {
}
interface ISyncableObject<T = object> extends SyncableObject {
}
type __ValueDescriptorType<
T extends Type | undefined
> = T extends ISyncableObject
? SyncableRef<T>
: T;
Expected behavior: No error
Actual behavior:
Type 'ISyncableObject<object> & T' does not satisfy the constraint 'ISyncableObject<object>'.
Property 'foo' is missing in type 'ISyncableObject<object> & T' but required in type 'ISyncableObject<object>'.(2344)
Playground Link: Playground
Related Issues: