summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/should_compile/T12533.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-08-26 17:32:42 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-08-26 17:35:38 +0100
commit0050aff22ba04baca732bf5124002417ab667f8a (patch)
tree7ba4cacd42cff192820898957e821cd1be070238 /testsuite/tests/rename/should_compile/T12533.hs
parenta60ea709c2b58b77a920823f2d095b1e3c02e2b5 (diff)
downloadhaskell-0050aff22ba04baca732bf5124002417ab667f8a.tar.gz
Fix scoping of type variables in instances
This fixes Trac #12531: class Foo x where foo :: forall a . x a -> x a default foo :: forall b . x b -> x b foo x = go where go :: x b go = undefined We want 'b' to scope over the code for 'foo', but we were using 'a' instead.
Diffstat (limited to 'testsuite/tests/rename/should_compile/T12533.hs')
-rw-r--r--testsuite/tests/rename/should_compile/T12533.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_compile/T12533.hs b/testsuite/tests/rename/should_compile/T12533.hs
new file mode 100644
index 0000000000..a120babf3f
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T12533.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE ScopedTypeVariables, DefaultSignatures #-}
+
+module T12533 where
+
+class Foo x where
+ foo :: forall a . x a -> x a
+ default foo :: forall a . x a -> x a
+ foo x = go
+ where go :: x a
+ go = undefined