Skip to content
  • Matthew Pickering's avatar
    74c767df
    ApplicativeDo: Set pattern location before running exhaustiveness checker · 74c767df
    Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
    This improves the error messages of the exhaustiveness checker when
    checking statements which have been moved around with ApplicativeDo.
    
    Before:
    
    Test.hs:2:3: warning: [GHC-62161] [-Wincomplete-uni-patterns]
        Pattern match(es) are non-exhaustive
        In a pattern binding:
            Patterns of type ‘Maybe ()’ not matched: Nothing
      |
    2 |   let x = ()
      |   ^^^^^^^^^^
    
    After:
    
    Test.hs:4:3: warning: [GHC-62161] [-Wincomplete-uni-patterns]
        Pattern match(es) are non-exhaustive
        In a pattern binding:
            Patterns of type ‘Maybe ()’ not matched: Nothing
      |
    4 |   ~(Just res1) <- seq x (pure $ Nothing @())
      |
    
    Fixes #22483
    74c767df
    ApplicativeDo: Set pattern location before running exhaustiveness checker
    Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
    This improves the error messages of the exhaustiveness checker when
    checking statements which have been moved around with ApplicativeDo.
    
    Before:
    
    Test.hs:2:3: warning: [GHC-62161] [-Wincomplete-uni-patterns]
        Pattern match(es) are non-exhaustive
        In a pattern binding:
            Patterns of type ‘Maybe ()’ not matched: Nothing
      |
    2 |   let x = ()
      |   ^^^^^^^^^^
    
    After:
    
    Test.hs:4:3: warning: [GHC-62161] [-Wincomplete-uni-patterns]
        Pattern match(es) are non-exhaustive
        In a pattern binding:
            Patterns of type ‘Maybe ()’ not matched: Nothing
      |
    4 |   ~(Just res1) <- seq x (pure $ Nothing @())
      |
    
    Fixes #22483
Loading