Refactor (again) the handling of default methods
authorsimonpj@microsoft.com <unknown>
Tue, 25 May 2010 11:39:10 +0000 (11:39 +0000)
committersimonpj@microsoft.com <unknown>
Tue, 25 May 2010 11:39:10 +0000 (11:39 +0000)
commit786932468faac49aafe20b65eabc8bdf465fbc9d
treea97f7a54f1160f33fb7fc3fbce596b7bdaef7ce0
parentf03b9562a92c6ef94c603a334d5d5e1cd2165c92
Refactor (again) the handling of default methods

This patch fixes Trac #4056, by

 a) tidying up the treatment of default method names
 b) removing the 'module' argument to newTopSrcBinder

The details aren't that interesting, but the result
is much tidier. The original bug was a 'nameModule' panic,
caused by trying to find the module of a top-level name.
But TH quotes generate Internal top-level names that don't
have a module, and that is generally a good thing.

Fixing that in turn led to the default-method refactoring,
which also makes the Name for a default method be handled
in the same way as other derived names, generated in BuildTyCl
via a call newImplicitBinder.  Hurrah.
14 files changed:
compiler/basicTypes/BasicTypes.lhs
compiler/basicTypes/RdrName.lhs
compiler/iface/BinIface.hs
compiler/iface/BuildTyCl.lhs
compiler/iface/IfaceSyn.lhs
compiler/iface/MkIface.lhs
compiler/rename/RnBinds.lhs
compiler/rename/RnEnv.lhs
compiler/rename/RnNames.lhs
compiler/rename/RnPat.lhs
compiler/typecheck/TcClassDcl.lhs
compiler/typecheck/TcInstDcls.lhs
compiler/typecheck/TcSplice.lhs
compiler/types/Class.lhs