View patterns with locally defined functions in restructuring don't compile
{-# LANGUAGE ViewPatterns #-}
foo x = x
Just (id -> res) = pure 'a' -- WORKS
Just (foo -> res') = pure 'a' -- FAILS
bar (foo -> res) = res -- WORKS
{-
[1 of 1] Compiling Main ( T14293.hs, interpreted )
T14293.hs:6:7-9: error: Variable not in scope: foo :: Char -> t
|
6 | Just (foo -> res') = pure 'a'
| ^^^
Failed, 0 modules loaded.
-}
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.2.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |