---
title: "SD0116: a scalar cast applied to a non-scalar value"
description: "SD0116, an error code of the TypeShade compiler. a scalar cast applied to a non-scalar value"
url: https://typeshade.dev/reference/errors/sd0116/
language: en
---

# `SD0116`

Core code

a scalar cast applied to a non-scalar value

No `"use typeshade"` program on this site raises this code, so the page has no example. The [`fn()`](https://typeshade.dev/api/fn/) builder builds the IR directly and reaches the check at the lines under Source.

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

## When it fires

A scalar cast applied to a vector used to type-check on both authoring surfaces and emit `f32(v)`, which no target compiles. The cast methods and the node forms of `f32`/`i32`/`u32`/`f64` are bounded to a scalar receiver at tsc; this covers a widened or untyped caller.

## How to fix it

The registry's hint: `f32`/`i32`/`u32`/`f64` and the .f32()/.i32()/.u32()/.f64() methods convert one scalar — convert per component, or rebuild the vector with `vec3`(a.f32(), b.f32(), c.f32())

## See also

- [Types](https://typeshade.dev/guide/language/types/)
- [`TypeShadeError`](https://typeshade.dev/api/typeshadeerror/)
- [`f32`](https://typeshade.dev/reference/types/f32/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

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

- [`src/core/ir/node.ts:739`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L739)
