summaryrefslogtreecommitdiff
path: root/testsuite/tests/rebindable/T19167.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/rebindable/T19167.hs')
-rw-r--r--testsuite/tests/rebindable/T19167.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/rebindable/T19167.hs b/testsuite/tests/rebindable/T19167.hs
new file mode 100644
index 0000000000..6f7ebff33d
--- /dev/null
+++ b/testsuite/tests/rebindable/T19167.hs
@@ -0,0 +1,29 @@
+{-# LANGUAGE RebindableSyntax, RankNTypes, TypeApplications, OverloadedStrings,
+ OverloadedLists, TypeFamilies #-}
+
+module Bug where
+
+import qualified Prelude as P
+import qualified GHC.Exts as P
+import Data.List.NonEmpty ( NonEmpty )
+
+fromInteger :: P.Integer -> forall a. P.Num a => a
+fromInteger n = P.fromInteger n
+
+shouldBeAnInt = 3 @P.Int
+
+newtype RevString = RevString P.String
+ deriving P.Show
+
+instance P.IsString RevString where
+ fromString str = RevString (P.reverse str)
+
+fromString :: P.String -> forall a. P.IsString a => a
+fromString str = P.fromString str
+
+shouldBeARevString = "hello" @RevString
+
+fromListN :: P.Int -> [elt] -> forall list. (P.IsList list, elt ~ P.Item list) => list
+fromListN n l = P.fromListN n l
+
+shouldBeANonEmpty = ['x', 'y', 'z'] @(NonEmpty P.Char)