[Git][ghc/ghc][master] Add tests for #22106

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Jun 30 16:39:45 UTC 2023



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


Commits:
cec90389 by sheaf at 2023-06-30T12:39:27-04:00
Add tests for #22106

Fixes #22106

- - - - -


7 changed files:

- + testsuite/tests/overloadedrecflds/should_compile/T22106_A.hs
- + testsuite/tests/overloadedrecflds/should_compile/T22106_B.hs
- + testsuite/tests/overloadedrecflds/should_compile/T22106_C.hs
- + testsuite/tests/overloadedrecflds/should_compile/T22106_C.stderr
- + testsuite/tests/overloadedrecflds/should_compile/T22106_D.hs
- + testsuite/tests/overloadedrecflds/should_compile/T22106_aux.hs
- testsuite/tests/overloadedrecflds/should_compile/all.T


Changes:

=====================================
testsuite/tests/overloadedrecflds/should_compile/T22106_A.hs
=====================================
@@ -0,0 +1,5 @@
+module T22106_A where
+
+import T22106_aux ( foo )
+
+xyzzy = foo


=====================================
testsuite/tests/overloadedrecflds/should_compile/T22106_B.hs
=====================================
@@ -0,0 +1,5 @@
+module T22106_B where
+
+import T22106_aux ( T(foo) )
+
+xyzzy r = r { foo = 3 }


=====================================
testsuite/tests/overloadedrecflds/should_compile/T22106_C.hs
=====================================
@@ -0,0 +1,5 @@
+module T22106_C where
+
+import T22106_aux ( bar )
+
+xyzzy = bar


=====================================
testsuite/tests/overloadedrecflds/should_compile/T22106_C.stderr
=====================================
@@ -0,0 +1,6 @@
+
+T22106_C.hs:5:9: error: [GHC-88464]
+    Variable not in scope: bar
+    Suggested fix:
+      Notice that ‘bar’ is a field selector belonging to the type ‘T22106_aux.T’
+      that has been suppressed by NoFieldSelectors.


=====================================
testsuite/tests/overloadedrecflds/should_compile/T22106_D.hs
=====================================
@@ -0,0 +1,5 @@
+module T22106_D where
+
+import T22106_aux ( T(bar) )
+
+xyzzy r = r { bar = 7 }


=====================================
testsuite/tests/overloadedrecflds/should_compile/T22106_aux.hs
=====================================
@@ -0,0 +1,6 @@
+{-# LANGUAGE NoFieldSelectors #-}
+
+module T22106_aux where
+
+data T = MkT { foo :: Int, bar :: Int }
+foo = ()


=====================================
testsuite/tests/overloadedrecflds/should_compile/all.T
=====================================
@@ -50,3 +50,8 @@ test('BootFldReexport'
 test('T23220'
     , [req_th, extra_files(['T23220_aux.hs'])]
     , multimod_compile, ['T23220_aux.hs T23220.hs', '-v0'])
+
+test('T22106_A', [extra_files(['T22106_aux.hs'])], multimod_compile, ['T22106_A', '-v0'])
+test('T22106_B', [extra_files(['T22106_aux.hs'])], multimod_compile, ['T22106_B', '-v0'])
+test('T22106_C', [extra_files(['T22106_aux.hs'])], multimod_compile_fail, ['T22106_C', '-v0'])
+test('T22106_D', [extra_files(['T22106_aux.hs'])], multimod_compile, ['T22106_D', '-v0'])



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cec903899234bf9e25ea404477ba846ac1e963bb
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/20230630/25a843f6/attachment-0001.html>


More information about the ghc-commits mailing list