summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/should_compile/T22122.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/rename/should_compile/T22122.hs')
-rw-r--r--testsuite/tests/rename/should_compile/T22122.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_compile/T22122.hs b/testsuite/tests/rename/should_compile/T22122.hs
new file mode 100644
index 0000000000..25f8377e96
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T22122.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+{-# LANGUAGE NoFieldSelectors #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TemplateHaskell #-}
+
+module T22122 where
+
+import T22122_aux ( data_decls, record_upds )
+
+-- This test checks that we can handle record declarations and updates
+-- when the field 'Name's share the same underlying string.
+
+-- data D1 = MkD1 { fld1 :: Char, fld2 :: String }
+-- data D2 = MkD2A { fld1 :: Char } | MkD2B { fld2 :: String }
+$(return data_decls)
+
+-- rec_upd r = r { fld1 = 'c', fld2 = "foo" }
+$(return record_upds)