aboutsummaryrefslogtreecommitdiff
path: root/html-test/src/Bug613.hs
diff options
context:
space:
mode:
authorMoritz Drexl <mdrexl@fastmail.fm>2017-08-05 16:44:40 +0200
committerAlexander Biehl <alexbiehl@gmail.com>2017-08-05 16:44:40 +0200
commit4d765e3cd0a735f9a7e8d13fb6633f9ee534fbfb (patch)
tree9daee9af367a7c7d54eeef63083a2adbf97ffcfb /html-test/src/Bug613.hs
parent74d1173fa022cc8f520ff33c2620507522423e42 (diff)
Fix renaming after instance signature specializing (#660)
* rework rename * Add regression test for Bug 613 * update tests * update changelog
Diffstat (limited to 'html-test/src/Bug613.hs')
-rw-r--r--html-test/src/Bug613.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/html-test/src/Bug613.hs b/html-test/src/Bug613.hs
new file mode 100644
index 00000000..effef695
--- /dev/null
+++ b/html-test/src/Bug613.hs
@@ -0,0 +1,16 @@
+module Bug613 where
+
+import Prelude (Either(Left, Right))
+
+class Functor f where
+ fmap :: (a -> b) -> f a -> f b
+
+instance Functor (Either a) where
+ fmap _ (Left x) = Left x
+ fmap f (Right y) = Right (f y)
+
+-- | Phantom type a0 is added to block the first renaming from a to a0. This ensures that the renamer doesn't create a new conflict
+data ThreeVars a0 a b = ThreeVars a b
+
+instance Functor (ThreeVars a0 a) where
+ fmap f (ThreeVars a b) = ThreeVars a (f b)