Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC

Commits:

5 changed files:

Changes:

  • compiler/GHC/Tc/Types/Origin.hs
    ... ... @@ -86,6 +86,7 @@ import Language.Haskell.Syntax.Basic (FieldLabelString(..))
    86 86
     
    
    87 87
     import qualified Data.Kind as Hs
    
    88 88
     import Data.List.NonEmpty (NonEmpty (..))
    
    89
    +import qualified Data.List.NonEmpty as NE
    
    89 90
     
    
    90 91
     {- *********************************************************************
    
    91 92
     *                                                                      *
    
    ... ... @@ -737,7 +738,7 @@ exprCtOrigin (HsAppType _ e1 _) = lexprCtOrigin e1
    737 738
     exprCtOrigin (OpApp _ _ op _)     = lexprCtOrigin op
    
    738 739
     exprCtOrigin (NegApp _ e _)       = lexprCtOrigin e
    
    739 740
     exprCtOrigin (HsPar _ e)          = lexprCtOrigin e
    
    740
    -exprCtOrigin (HsProjection _ _)   = SectionOrigin
    
    741
    +exprCtOrigin (HsProjection _ p)   = GetFieldOrigin ((field_label . unLoc . dfoLabel . NE.head . NE.reverse) p)
    
    741 742
     exprCtOrigin (SectionL _ _ _)     = SectionOrigin
    
    742 743
     exprCtOrigin (SectionR _ _ _)     = SectionOrigin
    
    743 744
     exprCtOrigin (ExplicitTuple {})   = Shouldn'tHappenOrigin "explicit tuple"
    

  • testsuite/tests/deSugar/should_compile/T10662.stderr
    1
    -T10662.hs:2:8: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)]
    
    1
    +
    
    2
    +T10662.hs:3:3: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)]
    
    2 3
         A do-notation statement discarded a result of type ‘String’
    
    3 4
         Suggested fix:
    
    4 5
           Suppress this warning by saying
    
    5 6
             ‘_ <- return $ let a = "hello" in a’
    6
    -

  • testsuite/tests/deSugar/should_compile/T3263-1.stderr
    1
    -T3263-1.hs:24:6: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)]
    
    1
    +
    
    2
    +T3263-1.hs:25:3: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)]
    
    2 3
         A do-notation statement discarded a result of type ‘Int’
    
    3 4
         Suggested fix: Suppress this warning by saying ‘_ <- nonNullM’
    
    4 5
     
    
    5
    -T3263-1.hs:34:6: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)]
    
    6
    +T3263-1.hs:35:3: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)]
    
    6 7
         A do-notation statement discarded a result of type ‘Int’
    
    7 8
         Suggested fix: Suppress this warning by saying ‘_ <- nonNullM’
    8
    -

  • testsuite/tests/deSugar/should_compile/T3263-2.stderr
    1
    -T3263-2.hs:24:6: warning: [GHC-08838] [-Wwrong-do-bind (in -Wdefault)]
    
    1
    +
    
    2
    +T3263-2.hs:25:3: warning: [GHC-08838] [-Wwrong-do-bind (in -Wdefault)]
    
    2 3
         A do-notation statement discarded a result of type ‘m Int’
    
    3 4
         Suggested fix:
    
    4 5
           Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’
    
    5 6
     
    
    6
    -T3263-2.hs:36:6: warning: [GHC-08838] [-Wwrong-do-bind (in -Wdefault)]
    
    7
    +T3263-2.hs:37:3: warning: [GHC-08838] [-Wwrong-do-bind (in -Wdefault)]
    
    7 8
         A do-notation statement discarded a result of type ‘m Int’
    
    8 9
         Suggested fix:
    
    9 10
           Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’
    10
    -

  • testsuite/tests/ghci.debugger/scripts/break029.script
    1 1
     :load break029.hs
    
    2 2
     :step f 3
    
    3 3
     :step
    
    4
    +:step
    
    4 5
     y