summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc130.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/tc130.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/tc130.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/tc130.hs b/testsuite/tests/typecheck/should_compile/tc130.hs
new file mode 100644
index 0000000000..da91273ff0
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/tc130.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE ImplicitParams #-}
+
+-- !!! Desugaring of record updates
+-- Showed up a bug in the newtype-squashing machinery
+
+
+module ShouldCompile where
+
+data R = R {field :: Int}
+
+test:: (?param :: R) => a -> Int
+test x = field (?param {field = 42})
+ -- The type of the record to be updated is
+ -- {?param :: R} as well as plain R
+ -- which confused the compiler
+