[GHC] #13755: GHC-8.0.2+ spits out $dm names in error messages
GHC
ghc-devs at haskell.org
Fri May 26 09:35:00 UTC 2017
#13755: GHC-8.0.2+ spits out $dm names in error messages
-------------------------------------+-------------------------------------
Reporter: zilinc | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.0.2
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Poor/confusing | Unknown/Multiple
error message | Test Case:
Blocked By: | Blocking:
Related Tickets: #10087 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
Fixing this infelicity isn't fundamentally hard, but it's a bit fiddly. I
can advise if anyone (Ryan?) wants to take it up.
The challenge is this:
* In an instance declaration, the default method
{{{
reflextive = $dgmreflective @ty
}}}
is generated as `HsSyn Name`; and then fed to the type checker. There
are excellent reasons for doing this, rather than (say) generating
something in already-typechecked form.
* (Something similar happens for ordinary default methods, but it'd be
`$dmreflective`.
* When typechecking this binding the typechecker doesn't a-prori know that
it's special, with a funny name in it.
* So the typechecker needs to "know" somehow that this `Id` is special.
One way to do that would be to add a form of `IdDetails` to say "I'm a
default method Id". Then the "arising from ..." stuff could print a
better message.
* That would not be hard; these Ids are built in one place, by
`mkDefaultMethodIds`.
I have not worked out all the details, but am happy to advise.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13755#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list