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.
Showing
- compiler/hsSyn/HsUtils.hs 28 additions, 1 deletioncompiler/hsSyn/HsUtils.hs
- compiler/rename/RnBinds.hs 14 additions, 17 deletionscompiler/rename/RnBinds.hs
- compiler/typecheck/TcClassDcl.hs 22 additions, 14 deletionscompiler/typecheck/TcClassDcl.hs
- compiler/typecheck/TcInstDcls.hs 3 additions, 3 deletionscompiler/typecheck/TcInstDcls.hs
- testsuite/tests/rename/should_compile/T12533.hs 10 additions, 0 deletionstestsuite/tests/rename/should_compile/T12533.hs
- testsuite/tests/rename/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/rename/should_compile/all.T
Loading
Please register or sign in to comment