summaryrefslogtreecommitdiff
path: root/testsuite/tests/showIface/Orphans.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/showIface/Orphans.hs')
-rw-r--r--testsuite/tests/showIface/Orphans.hs26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/showIface/Orphans.hs b/testsuite/tests/showIface/Orphans.hs
new file mode 100644
index 0000000000..f3b7b6adec
--- /dev/null
+++ b/testsuite/tests/showIface/Orphans.hs
@@ -0,0 +1,26 @@
+{-# LANGUAGE TypeFamilies #-}
+{-# OPTIONS_GHC -O -Wno-inline-rule-shadowing #-}
+-- Rules are ignored without -O
+
+module Orphans where
+
+import GHC.Exts (IsList(..))
+
+-- Some orphan things
+instance IsList Bool where
+ type Item Bool = Double
+ fromList = undefined
+ toList = undefined
+
+{-# RULES "myrule1" id id = id #-}
+
+-- And some non-orphan things
+data X = X [Int]
+instance IsList X where
+ type Item X = Int
+ fromList = undefined
+ toList = undefined
+
+f :: X -> X
+f x = x
+{-# RULES "myrule2" id f = f #-}