- Error
- Reported by the type checker
TS1360
Type '{0}' does not satisfy the expected type '{1}'.
An expression doesn't match the type given with `satisfies`. Change the value, or the type it must satisfy.
What it means
expr satisfies T checks that the expression is assignable to T without changing the expression's own type. When it isn't, this error is reported at the expression.
Example
type Color = "red" | "green";
export const theme = { primary: "blue" } satisfies Record<string, Color>;
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(3,22): error TS1360: Type '{ primary: "blue"; }' does not satisfy the expected type 'Record<string, Color>'.
Property 'primary' is incompatible with index signature.
Type '"blue"' is not assignable to type 'Color'.
Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.
How to fix
- Fix the value so it fits the type.
- If the type is too narrow, widen it.