> For AI agents: the complete documentation index is available at /byethrow/ja/llms.txt, the full documentation bundle is available at /byethrow/ja/llms-full.txt.

# Type Alias: InferFailure\<T>

> **InferFailure**\<`T`> = \[`T`] _extends_ \[(...`args`) => [`ResultMaybeAsync`](/byethrow/ja/api/types/Result.ResultMaybeAsync.md)\<`any`, infer U>] ? `U` : \[`T`] _extends_ \[[`ResultMaybeAsync`](/byethrow/ja/api/types/Result.ResultMaybeAsync.md)\<`any`, infer U>] ? `U` : `never`

Infers the [Failure](/byethrow/ja/api/types/Result.Failure.md) value type `E` from a Result or a function returning a Result.

## Type Parameters

### T

`T`

A [ResultMaybeAsync](/byethrow/ja/api/types/Result.ResultMaybeAsync.md) type or a function returning it.

## Examples

**From a result object**

```ts
import { Result } from '@praha/byethrow';

type R = Result.Result<number, string>;
type ErrorValue = Result.InferFailure<R>; // string
```

**From a function**

```ts
import { Result } from '@praha/byethrow';

const fn = () => Promise.resolve({ type: 'Failure', error: new Error() } as const);
type ErrorValue = Result.InferFailure<typeof fn>; // Error
```
