From 39a26b708661d2fd31beae417b2b88ce4798a750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulie=20Pe=C3=B1a?= <203125+paulie4@users.noreply.github.com> Date: Mon, 3 Aug 2026 15:03:01 -0400 Subject: [PATCH] `Utility Types.md`: clarify `NoInfer` usage add a description of what the example is showing --- packages/documentation/copy/en/reference/Utility Types.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/documentation/copy/en/reference/Utility Types.md b/packages/documentation/copy/en/reference/Utility Types.md index cdd36db38c70..dcc9fd782c51 100644 --- a/packages/documentation/copy/en/reference/Utility Types.md +++ b/packages/documentation/copy/en/reference/Utility Types.md @@ -464,6 +464,8 @@ Released: Blocks inferences to the contained type. Other than blocking inferences, `NoInfer` is identical to `Type`. +For example, the `createStreetLight()` function below is called with a `colors` value of `["red", "yellow", "green"]`, making the `C` type parameter be a union of `"red" | "yellow" | "green"` (so `"blue"` would not be a valid default), but if `NoInfer` was not used, the `defaultColor`'s type of `"blue"` would get added to the type parameter union, so the compiler would consider `"blue"` as a valid default even though it's not in the list of `colors`. + ##### Example ```ts