[Git][ghc/ghc][wip/spj-apporv-Oct24] 2 commits: fix exprCtOrigin for HsProjection case. It was assigned to be SectionOrigin,...

Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC Commits: e12c1e9d by Apoorv Ingle at 2025-06-29T20:27:28-05:00 fix exprCtOrigin for HsProjection case. It was assigned to be SectionOrigin, but it should be GetFieldOrigin - - - - - d37adc69 by Apoorv Ingle at 2025-06-29T21:37:38-05:00 undo test changes - - - - - 5 changed files: - compiler/GHC/Tc/Types/Origin.hs - testsuite/tests/deSugar/should_compile/T10662.stderr - testsuite/tests/deSugar/should_compile/T3263-1.stderr - testsuite/tests/deSugar/should_compile/T3263-2.stderr - testsuite/tests/ghci.debugger/scripts/break029.script Changes: ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -86,6 +86,7 @@ import Language.Haskell.Syntax.Basic (FieldLabelString(..)) import qualified Data.Kind as Hs import Data.List.NonEmpty (NonEmpty (..)) +import qualified Data.List.NonEmpty as NE {- ********************************************************************* * * @@ -737,7 +738,7 @@ exprCtOrigin (HsAppType _ e1 _) = lexprCtOrigin e1 exprCtOrigin (OpApp _ _ op _) = lexprCtOrigin op exprCtOrigin (NegApp _ e _) = lexprCtOrigin e exprCtOrigin (HsPar _ e) = lexprCtOrigin e -exprCtOrigin (HsProjection _ _) = SectionOrigin +exprCtOrigin (HsProjection _ p) = GetFieldOrigin ((field_label . unLoc . dfoLabel . NE.head . NE.reverse) p) exprCtOrigin (SectionL _ _ _) = SectionOrigin exprCtOrigin (SectionR _ _ _) = SectionOrigin exprCtOrigin (ExplicitTuple {}) = Shouldn'tHappenOrigin "explicit tuple" ===================================== testsuite/tests/deSugar/should_compile/T10662.stderr ===================================== @@ -1,6 +1,6 @@ -T10662.hs:2:8: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)] + +T10662.hs:3:3: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)] A do-notation statement discarded a result of type ‘String’ Suggested fix: Suppress this warning by saying ‘_ <- return $ let a = "hello" in a’ - ===================================== testsuite/tests/deSugar/should_compile/T3263-1.stderr ===================================== @@ -1,8 +1,8 @@ -T3263-1.hs:24:6: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)] + +T3263-1.hs:25:3: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)] A do-notation statement discarded a result of type ‘Int’ Suggested fix: Suppress this warning by saying ‘_ <- nonNullM’ -T3263-1.hs:34:6: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)] +T3263-1.hs:35:3: warning: [GHC-81995] [-Wunused-do-bind (in -Wall)] A do-notation statement discarded a result of type ‘Int’ Suggested fix: Suppress this warning by saying ‘_ <- nonNullM’ - ===================================== testsuite/tests/deSugar/should_compile/T3263-2.stderr ===================================== @@ -1,10 +1,10 @@ -T3263-2.hs:24:6: warning: [GHC-08838] [-Wwrong-do-bind (in -Wdefault)] + +T3263-2.hs:25:3: warning: [GHC-08838] [-Wwrong-do-bind (in -Wdefault)] A do-notation statement discarded a result of type ‘m Int’ Suggested fix: Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’ -T3263-2.hs:36:6: warning: [GHC-08838] [-Wwrong-do-bind (in -Wdefault)] +T3263-2.hs:37:3: warning: [GHC-08838] [-Wwrong-do-bind (in -Wdefault)] A do-notation statement discarded a result of type ‘m Int’ Suggested fix: Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’ - ===================================== testsuite/tests/ghci.debugger/scripts/break029.script ===================================== @@ -1,4 +1,5 @@ :load break029.hs :step f 3 :step +:step y View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/984d1631398c15beb7a63544b6d6511... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/984d1631398c15beb7a63544b6d6511... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Apoorv Ingle (@ani)