[GHC] #7854: Constrained method type accepted in Haskell 98 mode
GHC
ghc-devs at haskell.org
Wed Mar 4 10:08:38 UTC 2015
#7854: Constrained method type accepted in Haskell 98 mode
-------------------------------------+-------------------------------------
Reporter: refold | Owner: thomie
Type: bug | Status: patch
Priority: normal | Milestone: 7.12.1
Component: Compiler (Type | Version: 7.6.3
checker) | Keywords: newcomer
Resolution: | Architecture:
Operating System: Unknown/Multiple | Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | typechecker/should_fail/T7854
Related Tickets: #10118, #10119 | Blocking:
| Differential Revisions: Phab:D688
-------------------------------------+-------------------------------------
Comment (by simonpj):
Thomie, thanks for working on this. Inspired by your patches I can see a
simpler way to achieve the same goal, so I'll do that.
Specifically I plan to do this:
* Fix the original bug simply by always doing a `checkValidType` on the
entire selector-id type. That includes an ambiguity check which is
precisely what we need.
* Implement the check when `ConstrainedClassMethods` is ''off'' as a
special check that does nothing else.
* As comment:4 acknowledges, GHC has not been making the claimed check
for ages. Rather than making `ConstrainedClassMethods` on by default (as
you propose), I plan to make it implied by `MultiParamTypeClasses`, which
means that we are out of Haskell-98 land anyway. This means that some
programs may break, but (a) the error message suggests adding
`ConstrainedClassMethods` (b) the fix is easy. If necessary (e.g. on a
Stackage run) we can make it on-by-default in 7.10 to ease transition.
Commit coming. Thanks for unblocking this.
Simon
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7854#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list