# Avoid Widening Returned/Yielded Types in Const Contexts #56858 * Idea is to do a specific check when widening. * Feels like an ad-hoc fix is not the right one? * Why doesn't the `const` context give you the non-widening literal type in the first place? * This is about const type paramerters - it's really more tied to ordering of when we decide to widen a function type. * https://github.com/microsoft/TypeScript/issues/241 * Could take a few views: * This can be viewed as a suitable carve-out. * This can be duped to #241, in which case * search for a non-breaky more-ideal solution. * say "won't fix" * We mostly feel like this is desirable - not like you need a ton of explanation of what's happening. * Conclusion: we're mostly inclined to take the PR, barring any implementation problems. * Want tests for * Overloads * Async functions * Async yields
Avoid Widening Returned/Yielded Types in Const Contexts
#56858
constcontext give you the non-widening literal type in the first place?