# Bug Report <!-- First, thank you for reporting a bug. That takes time and we appreciate that! --> | Subject | Details | | :------------- | :--------------------| | Rector version | last dev-main | | Installed as | composer dependency | ## Minimal PHP Code Causing Issue See https://getrector.com/demo/c655ef2d-fc8b-413b-b22d-eb903cd113a7 ```php <?php trait SomeTrait { public function run(bool $param): bool { return (bool) ($this->config['allow_404'] ?? false); } } ``` On trait, the valid cast is removed on union falsy mixed. ### Responsible rules * `RecastingRemovalRector` ## Expected Behavior should be skipped. <!-- How should Rector change the code? Or should Rector skip it? -->
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/c655ef2d-fc8b-413b-b22d-eb903cd113a7
On trait, the valid cast is removed on union falsy mixed.
Responsible rules
RecastingRemovalRectorExpected Behavior
should be skipped.