---
title: "SD0017: literal cannot be spelled by the target in TypeShade"
description: "SD0017, an error code of the TypeShade compiler. literal cannot be spelled by the target"
url: https://typeshade.dev/reference/errors/sd0017/
language: en
---

# `SD0017`

Core code

literal cannot be spelled by the target

The registry text and every compiler message on these pages are the compiler's own English.

## In the front end

A `"use typeshade"` file never reaches this check with the same mistake: the front end refuses it first, under its own code. This program, compiled at build time, gets:

example.shade.ts

```ts
"use typeshade"

@fragment
export function main(uv: location<0, vec2>): vec4 {
  const k: i32 = 3000000000
  return vec4(uv, f32(k), 1.)
}
```

**[TS8003](https://typeshade.dev/reference/errors/ts8003/)** error, line 5: The value has to fit: 3000000000 is outside `i32`, which holds -2147483648 to 2147483647 (§13).

## How to fix it

The registry's hint: an `i32`/`u32` literal must be an integer inside its 32-bit range and a float literal must be finite — neither WGSL nor GLSL has a NaN/Infinity spelling, and an out-of-range integer literal is a driver compile error; clamp or wrap the host-side value before it becomes a literal

## See also

**[`TS8003`](https://typeshade.dev/reference/errors/ts8003/) `TYPE_MISMATCH`**

Two types that do not fit where they meet (an operator, a condition, a declaration, a return or an argument), a read of an optional value (`T | undefined`, `T | null` or `T | null | undefined`) that no test narrowed ([Rule 7.10](https://typeshade.dev/reference/rules/7-10/)), or a constant the compiler folds that WGSL refuses: a shift amount past 31, a divisor of 0, clamp bounds that cross, an `f32` past its range or a builtin call outside its domain, such as `Math.pow(-2., 2.)`.

- [WGSL and GLSL](https://typeshade.dev/guide/concepts/wgsl-and-glsl/)
- [`TypeShadeError`](https://typeshade.dev/api/typeshadeerror/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

Where the compiler raises this code at commit af54ddad5, one line per file:

- [`src/core/backends/glsl/spelling.ts:110`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/backends/glsl/spelling.ts#L110) (2 sites)
- [`src/core/backends/wgsl/spelling.ts:88`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/backends/wgsl/spelling.ts#L88) (4 sites)
