[Git][ghc/ghc][master] Fixes #24046

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Oct 5 09:39:28 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
7d390bce by Rewbert at 2023-10-05T05:38:08-04:00
Fixes #24046

- - - - -


2 changed files:

- + testsuite/tests/th/T24046.hs
- testsuite/tests/th/all.T


Changes:

=====================================
testsuite/tests/th/T24046.hs
=====================================
@@ -0,0 +1,19 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module T24046 where
+
+import Language.Haskell.TH.Syntax
+
+-- Test added in relation to this issue: https://gitlab.haskell.org/ghc/ghc/-/issues/24046
+
+{-# NOINLINE foo #-}
+foo = undefined
+
+$( let simplerule = [PragmaD $ RuleP "rejected-rule" Nothing foralld lhs rhs AllPhases]
+
+       foralld = [RuleVar $ mkName "x", RuleVar $ mkName "y"]
+
+       lhs = AppE (AppE (VarE $ mkName "foo") (VarE $ mkName "x")) (VarE $ mkName "y")
+
+       rhs = AppE (AppE (VarE $ mkName "foo") (VarE $ mkName "y")) (VarE $ mkName "x")
+   in return simplerule)


=====================================
testsuite/tests/th/all.T
=====================================
@@ -146,6 +146,7 @@ test('T2817', normal, compile, ['-v0'])
 test('T2713', normal, compile_fail, ['-v0'])
 test('T2674', normal, compile_fail, ['-v0'])
 test('TH_emptycase', normal, compile, ['-v0'])
+test('T24046', normal, compile, ['-v0'])
 
 test('T2386', [only_ways(['normal'])], makefile_test, ['T2386'])
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7d390bce49398409878a8580a78bbe7a3bd08914

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7d390bce49398409878a8580a78bbe7a3bd08914
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231005/85852b40/attachment-0001.html>


More information about the ghc-commits mailing list