Back to Flow

Natural Inference for Primitives in Flow

website/blog/2025-05-29-Natural-Inference-for-Primitives-in-Flow.md

0.318.0555 B
Original Source

:::info[Historical] This post announced natural inference for primitives when it was introduced. For current behavior, see the literal types and const expressions and const type parameters documentation. :::

Flow now decides the type of string, number, and boolean literal values at their definition site: either the broad type (e.g. string) or the literal type (e.g. 'foo'). You can control the behavior with type annotations, as const, or const type parameters.

<!--truncate-->