TypeScript `const` Type Parameters: Immutable Inference and When It Beats `as const` TypeScript's `const` type parameters allow generic functions to infer the narrowest possible literal types from arguments without requiring callers to use `as const` assertions. This feature preserves exact string literals, readonly tuples, and deeply readonly object properties directly in the function signature, solving type widening problems at library boundaries. The approach shifts immutability enforcement from the caller to the function definition, improving type safety and consistency across codebases. const Type Parameters: Immutable Inference and When It Beats as const This article was written with the assistance of AI, under human supervision and review. Most TypeScript type widening problems in generic functions stem from a single overlooked feature: const type parameters. Teams write elaborate type helpers and sprinkle as const assertions everywhere when the compiler already offers a direct solution. The gap between what developers think they need and what the language provides is a ten-line diff. The problem manifests when you pass a literal object to a generic function. TypeScript widens { method: "GET" } to { method: string } , losing the exact literal type that downstream code depends on. The workaround—forcing callers to add as const at every call site—shifts the burden to the wrong place and creates inconsistent adoption across a codebase. Type widening problem in generic functions The const type parameter modifier solves this at the function signature level. When you write function route