---
title: "SD0115: an error code of the TypeShade compiler"
description: "SD0115, an error code of the TypeShade compiler. a branch body returned a value, which a branch cannot carry out"
url: https://typeshade.dev/reference/errors/sd0115/
language: en
---

# `SD0115`

Core code

a branch body returned a value, which a branch cannot carry out

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.

## How to fix it

The registry's hint: an If/elif/else body is a statement block: write Return(value) for an early return, when(cond, () => a, () => b) for a value, or assign to a Var

## See also

- [The `fn()` builder](https://typeshade.dev/api/fn/)
- [`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/ir/builder.ts:437`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/builder.ts#L437)
