---
title: "ScalarCastSource: type in Types, TypeShade API reference"
description: "ScalarCastSource, a type in Types. The scalar keys a cast reads: every native scalar, plus the emulated double."
url: https://typeshade.dev/api/scalarcastsource/
language: en
---

# `ScalarCastSource`

Type in Types

The scalar keys a cast reads: every native scalar, plus the emulated double.

`import type { ScalarCastSource } from 'typeshade'`
`import type { ScalarCastSource } from 'typeshade/core/ir'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
type ScalarCastSource = 'f32' | 'i32' | 'u32' | 'f64' | 'bool';
```

## Description

WGSL converts between all of them — `f32(true)` is `1.0` — and none of them is a vector, which is the point: `f32(someVec3)` used to type-check on both authoring surfaces and emit `f32(v)`, which no target compiles.

## Source

[`src/core/ir/node.ts`, line 730](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L730), at commit af54ddad5
