P.when behaves incorrectly in corner cases when types have intersection

Author: mordvCreated Sep 25, 2025Updated Sep 25, 2025

Describe the bug The bug is strange and I think self explanatory, see playground, comments starting with !!!

TypeScript playground with a minimal reproduction case

Example: Playground

Versions

  • TypeScript version: 5.8.* 5.9.*
  • ts-pattern version: 5.8.0
  • environment: TS playground