[Git][ghc/ghc][wip/spj-apporv-Oct24] revert back rep-poly err messages
Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC Commits: 50f0aaae by Apoorv Ingle at 2026-03-30T14:14:47-05:00 revert back rep-poly err messages - - - - - 5 changed files: - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Types/Origin.hs - testsuite/tests/rep-poly/RepPolyDoBind.stderr - testsuite/tests/rep-poly/RepPolyDoBody1.stderr - testsuite/tests/rep-poly/RepPolyDoBody2.stderr Changes: ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -916,7 +916,7 @@ tcInstFun do_ql inst_final (fun_orig, rn_fun, fun_lspan) tc_fun fun_sigma rn_arg mk_herald :: HsExpr GhcTc -> HsExpr GhcRn -> ExpectedFunTyCtxt mk_herald tc_fun arg = case fun_orig of - DoStmtOrigin -> ExpectedTySyntax DoStmtOrigin arg + DoStmtOrigin -> ExpectedFunTySyntaxOp DoStmtOrigin tc_fun _ -> ExpectedFunTyArg (HsExprTcThing tc_fun) arg -- Is the argument supposed to instantiate a forall? ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -1536,13 +1536,6 @@ data ExpectedFunTyCtxt => ExpectedFunTySyntaxOp !CtOrigin !(HsExpr (GhcPass p)) -- ^ rebindable syntax operator - -- | A rebindable syntax operator is expected to have a function type. - -- - -- Test cases for representation-polymorphism checks: - -- RepPolyDoBind, RepPolyDoBody{1,2}, - -- This constructor will merge with ExpectedFunTySyntaxOp when tcSyntaxOp is retired. - | ExpectedTySyntax !CtOrigin !(HsExpr GhcRn) - -- | A view pattern must have a function type. -- -- Test cases for representation-polymorphism checks: @@ -1598,9 +1591,6 @@ pprExpectedFunTyCtxt funTy_origin i = , text "the rebindable syntax operator" , quotes (ppr op) ] , nest 2 (ppr orig) ] - ExpectedTySyntax orig arg -> - vcat [ text "The expression" <+> quotes (ppr arg) - , nest 2 (ppr orig) ] ExpectedFunTyViewPat expr -> vcat [ the_arg_of <+> text "the view pattern" , nest 2 (ppr expr) ] @@ -1629,8 +1619,6 @@ pprExpectedFunTyCtxt funTy_origin i = pprExpectedFunTyHerald :: ExpectedFunTyCtxt -> SDoc pprExpectedFunTyHerald (ExpectedFunTySyntaxOp {}) = text "This rebindable syntax expects a function with" -pprExpectedFunTyHerald (ExpectedTySyntax orig _) - = pprCtOriginBriefly orig pprExpectedFunTyHerald (ExpectedFunTyViewPat {}) = text "A view pattern expression expects" pprExpectedFunTyHerald (ExpectedFunTyArg fun _) ===================================== testsuite/tests/rep-poly/RepPolyDoBind.stderr ===================================== @@ -1,5 +1,5 @@ RepPolyDoBind.hs:26:3: error: [GHC-55287] - • The expression ‘undefined’ + • The first argument of the rebindable syntax operator ‘(>>=)’ arising from a do statement does not have a fixed runtime representation. Its type is: ===================================== testsuite/tests/rep-poly/RepPolyDoBody1.stderr ===================================== @@ -1,5 +1,5 @@ RepPolyDoBody1.hs:24:3: error: [GHC-55287] - • The expression ‘undefined :: ma’ + • The first argument of the rebindable syntax operator ‘(>>)’ arising from a do statement does not have a fixed runtime representation. Its type is: ===================================== testsuite/tests/rep-poly/RepPolyDoBody2.stderr ===================================== @@ -1,5 +1,5 @@ RepPolyDoBody2.hs:23:3: error: [GHC-55287] - • The expression ‘return ()’ + • The first argument of the rebindable syntax operator ‘(>>)’ arising from a do statement does not have a fixed runtime representation. Its type is: View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/50f0aaae7c21d7108cff352ec7e64b97... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/50f0aaae7c21d7108cff352ec7e64b97... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Apoorv Ingle (@ani)