Skip to content

Pattern synonyms bind variables out of scope

Wasn't sure what to call this ticket:

{-# Language PatternSynonyms #-}

pattern XInstrProxy :: (Bool -> Bool) -> a
pattern XInstrProxy not <- _

This works fine, is it intended? It came as some surprise to me when I was renaming type variables only to find it still working even though I hadn't changed the variable in the ViewPattern

import Data.Tagged

pattern XInstrProxy proxy <- ((\(Proxy::Proxy descr) -> Proxy::Proxy (XInstr descr)) -> ty) 
Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC mpickering
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information