---
title: "analyse/dead-code/impossible-type-check"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="analyse/dead-code/impossible-type-check" />

In the [`analyse-recommended`](/docs/rules/presets/analyse-recommended) preset and every stricter one. Report only.

## Configuration

```toml title="pun.toml"
[analyse.rules]
"dead-code/impossible-type-check" = "on"
```

To skip it in some files or lines, add an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`ImpossibleCheckTypeFunctionCallRule`](https://phpstan.org/error-identifiers/function.alreadyNarrowedType) (phpstan-classes)
- [`ImpossibleCondition`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`ImpossibleNullTypeComparison`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`ImpossibleTypeComparison`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`RedundantCondition`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`RedundantNonnullTypeComparison`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`RedundantTypeComparison`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`function.alreadyNarrowedType`](https://phpstan.org/error-identifiers/function.alreadyNarrowedType) (phpstan)
- [`function.impossibleType`](https://phpstan.org/error-identifiers/function.impossibleType) (phpstan)

[More analyse/dead-code rules](/docs/rules/analyse/dead-code) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
