---
title: "SD0040: an error code of the TypeShade compiler"
description: "SD0040, an error code of the TypeShade compiler. f64 type leaked past fp64Lower into a backend emitter"
url: https://typeshade.dev/reference/errors/sd0040/
language: en
---

# `SD0040`

Core code

`f64` type leaked past fp64Lower into a backend emitter

The registry calls this an internal invariant: it means the compiler itself went wrong, and no program is meant to raise it.

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

## How to fix it

The registry's hint: internal invariant — the fp64 lowering pass must rewrite every `f64` before emit; report a typeshade bug

## See also

- [Emulated double](https://typeshade.dev/guide/language/from-typescript/double/)
- [`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:34`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/backends/glsl/spelling.ts#L34) (3 sites)
- [`src/core/backends/wgsl/spelling.ts:19`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/backends/wgsl/spelling.ts#L19) (3 sites)
