This PR fixes “declaration has free variables” errors when generating a splitter for a match statement with named patterns. Fixes #8274.