TS8053
On this page

TS8053

Front-end code INT_LITERAL_DEPRECATION

A deprecation warning, not an error: an undecided integer-written declaration still defaults to f32 and will default to i32 (§13).

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

When it fires

A deprecation warning, not an error: an undecided integer-written declaration still defaults to f32 and will default to i32 (§13). A declared use that already establishes an integer type carries no warning. Reported only when the caller asks for it with deprecations: true; the compiler's warning does not change the chosen type.

Example

example.shade.ts
"use typeshade"
@fragment
export function main(@location(0) uv: vec2): vec4 {
const k = 2
return vec4(uv * k, 0., 1.)
}

Compiled with { deprecations: true }, the option that turns this warning on.

Compiled at build time against the pinned compiler, this program gets:

TS8053 warning, line 5: "k" is written as an integer and types as f32 today; it will type as i32 (§13, #148). Write "k = 2." to keep f32, or leave it and take i32.

How to fix it

The same program, corrected. It compiles with no diagnostic.

example.shade.ts
"use typeshade"
@fragment
export function main(@location(0) uv: vec2): vec4 {
const k = 2.
return vec4(uv * k, 0., 1.)
}

See also

Source

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

Edit this page Report a problem