summaryrefslogtreecommitdiff
path: root/testsuite/tests/rep-poly/RepPolyRecordUpdate.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/rep-poly/RepPolyRecordUpdate.hs')
-rw-r--r--testsuite/tests/rep-poly/RepPolyRecordUpdate.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/rep-poly/RepPolyRecordUpdate.hs b/testsuite/tests/rep-poly/RepPolyRecordUpdate.hs
new file mode 100644
index 0000000000..9ef3a0f897
--- /dev/null
+++ b/testsuite/tests/rep-poly/RepPolyRecordUpdate.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE UnliftedNewtypes #-}
+
+module RepPolyRecordUpdate where
+
+import GHC.Exts
+
+newtype X (a :: TYPE rep) = MkX { fld :: a }
+
+class C rep (a :: TYPE rep) where
+ meth :: () -> a
+
+upd :: C rep a => X b -> X a
+upd x = x { fld = meth () }