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
interfaceWrapped<T>{wrapped: T;}functionwrap<T>(value: T): Wrapped<T>{return{wrapped: value};}constone='test';// one is 'test'constoneWrapped=wrap(one);// oneWrapped is Wrapped<string>constanother: 'test'='test';// another is 'test'constanotherWrapped=wrap(another);// anotherWrapped is Wrapped<'test'> <--- WHY?
yes. the inferred literal type is not widened in two cases, 1. it is present unwrapped in the output, e.g. identity function, 2. if the type parameter is constraint to its base type, e.g. string. explicit literal types are never widened.
nightly build jan 26
is that how #10676 supposed to work?
The text was updated successfully, but these errors were encountered: