Code
declarefunctionlog(msg: string): void;typeEQString<T>=Textendsstring ? T : never;functionc<T>(x: T|string){consty=xasEQString<T>;// assert stringinessreturnlog(y);}Expected behavior:
No error.
Actual behavior:
[ts]
Argument of type 'EQString<T>' is not assignable to parameter of type 'string'.
Type 'T' is not assignable to type 'string'
on y.
Code
Expected behavior:
No error.
Actual behavior:
on
y.