Apoorv Ingle pushed to branch wip/ani/T27156 at Glasgow Haskell Compiler / GHC Commits: e65ad951 by Apoorv Ingle at 2026-08-16T12:21:54-05:00 revert th test - - - - - 4 changed files: - compiler/GHC/Rename/Expr.hs - testsuite/tests/parser/should_fail/RecordDotSyntaxFail8.stderr - testsuite/tests/th/T18102b.hs - testsuite/tests/th/T18102b_aux.hs Changes: ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -46,7 +46,6 @@ import GHC.Driver.DynFlags import GHC.Builtin.KnownKeys import GHC.Builtin.KnownOccs import GHC.Builtin.WiredIn.Types ( nilDataConName, oneDataConName ) -import GHC.Builtin.WiredIn.Ids( rightSectionName, leftSectionName ) import GHC.Unit.Module ( isInteractiveModule ) @@ -74,7 +73,7 @@ import qualified GHC.LanguageExtensions as LangExt import Control.Monad import qualified Data.Foldable as Partial (maximum) import Data.List (unzip4) -import Data.List.NonEmpty ( NonEmpty(..), head, init, last, nonEmpty, scanl, tail ) +import Data.List.NonEmpty ( NonEmpty(..), head, nonEmpty, scanl, tail ) import Data.Ord import Data.Array import GHC.Driver.Env (HscEnv) ===================================== testsuite/tests/parser/should_fail/RecordDotSyntaxFail8.stderr ===================================== @@ -1,41 +1,42 @@ RecordDotSyntaxFail8.hs:47:17: error: [GHC-39999] • No instance for ‘HasField "quux1" Quux Quux’ - arising from selecting the field ‘quux1’ - NB: ‘HasField’ is not the built-in ‘GHC.Internal.Records.HasField’ class. + arising from selecting the field ‘quux1’ + NB: ‘HasField’ is not the built-in ‘HasField’ class. • In the second argument of ‘($)’, namely ‘a.foo.bar.baz.quux1’ In a stmt of a 'do' block: print @Quux $ a.foo.bar.baz.quux1 In the expression: - do let a = Foo {foo = ...} - print @Quux $ ....bar.baz.quux1 - let b = myQuux - print @Quux $ b.quux2 - let c = Foo {foo = ...} - ... + do let a = Foo {foo = ...} + print @Quux $ ....bar.baz.quux1 + let b = myQuux + print @Quux $ b.quux2 + let c = Foo {foo = ...} + ... RecordDotSyntaxFail8.hs:50:17: error: [GHC-39999] • No instance for ‘HasField "quux2" Quux Quux’ - arising from selecting the field ‘quux2’ + arising from selecting the field ‘quux2’ NB: ‘HasField’ is not the built-in ‘HasField’ class. • In the second argument of ‘($)’, namely ‘b.quux2’ In a stmt of a 'do' block: print @Quux $ b.quux2 In the expression: - do let a = Foo {foo = ...} - print @Quux $ ....bar.baz.quux1 - let b = myQuux - print @Quux $ b.quux2 - let c = Foo {foo = ...} - ... + do let a = Foo {foo = ...} + print @Quux $ ....bar.baz.quux1 + let b = myQuux + print @Quux $ b.quux2 + let c = Foo {foo = ...} + ... RecordDotSyntaxFail8.hs:53:17: error: [GHC-39999] • No instance for ‘HasField "quux3" Quux r0’ - arising from selecting the field ‘quux3’ - NB: ‘HasField’ is not the built-in ‘GHC.Internal.Records.HasField’ class. + arising from selecting the field ‘quux3’ + NB: ‘HasField’ is not the built-in ‘HasField’ class. • In the second argument of ‘($)’, namely ‘a.foo.bar.baz.quux3.wob’ In a stmt of a 'do' block: print @Bool $ a.foo.bar.baz.quux3.wob In the expression: - do let a = Foo {foo = ...} - print @Quux $ ....bar.baz.quux1 - let b = myQuux - print @Quux $ b.quux2 - let c = Foo {foo = ...} - ... + do let a = Foo {foo = ...} + print @Quux $ ....bar.baz.quux1 + let b = myQuux + print @Quux $ b.quux2 + let c = Foo {foo = ...} + ... + ===================================== testsuite/tests/th/T18102b.hs ===================================== @@ -1,47 +1,9 @@ -{-# LANGUAGE TemplateHaskell, RebindableSyntax #-} +{-# LANGUAGE TemplateHaskell #-} -import Prelude import T18102b_aux -x1 :: Int -x1 = $$(intQuote_TTH) - -z1 :: Int -z1 = $(intQuote_TH) - -x2 :: Char -x2 = $$(charQuote_TTH) - -z2 :: Char -z2 = $(charQuote_TH) - -x3 :: [Int] -x3 = $$(seqQuote_TTH) - -z3 :: [Int] -z3 = $(seqQuote_TH) - -x4 :: [Int] -x4 = $$(listQuote_TTH) - -z4 :: [Int] -z4 = $(listQuote_TH) - +x :: Int +x = $$(intQuote) main :: IO () -main = do - print t1 - print x1 - print z1 - - print t2 - print x2 - print z2 - - print t3 - print x3 - print z3 - - print t4 - print x4 - print z4 +main = print x ===================================== testsuite/tests/th/T18102b_aux.hs ===================================== @@ -1,60 +1,11 @@ -{-# LANGUAGE RebindableSyntax, TemplateHaskell, OverloadedLists #-} +{-# LANGUAGE RebindableSyntax, TemplateHaskell #-} module T18102b_aux where -import Prelude hiding ((>>=), return ) +import Prelude import Language.Haskell.TH.Syntax - - ifThenElse :: Bool -> Int -> Int -> Int ifThenElse _ a b = a+b -intQuote_TTH :: Code Q Int -intQuote_TTH = [|| if True then 10 else 15 ||] - -intQuote_TH :: Quote m => m Exp -intQuote_TH = [| if True then 10 else 15 |] - -t1 :: Int -t1 = if True then 10 else 15 - - -(>>=) :: a -> ((forall b . b) -> c) -> c -a >>= f = f undefined -return _ = 'b' -fail s = undefined - -t2 :: Char -t2 = do { return 'k' } - -charQuote_TTH :: Code Q Char -charQuote_TTH = [|| do { return 'k' } ||] - -charQuote_TH :: Quote m => m Exp -charQuote_TH = [| do { return 'k' } |] - -fromListN :: Int -> [Int] -> [Int] -fromListN _ l = replicate (length l) (length l) - -fromList :: [Int] -> [Int] -fromList x = replicate (length x) (length x) - - -t3 :: [Int] -t3 = [2..7] - -seqQuote_TTH :: Code Q [Int] -seqQuote_TTH = [|| [2..7] ||] - -seqQuote_TH :: Quote m => m Exp -seqQuote_TH = [| [2..7] |] - - -t4 :: [Int] -t4 = [1,2,3] - -listQuote_TTH :: Code Q [Int] -listQuote_TTH = [|| [1,2,3] ||] - -listQuote_TH :: Quote m => m Exp -listQuote_TH = [| [1,2,3] |] +intQuote :: Code Q Int +intQuote = [|| if True then 10 else 15 ||] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e65ad951348d5e11786b3d6de329396c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e65ad951348d5e11786b3d6de329396c... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help