#961: Associated type synonyms not working right
---------------------------------------------------+------------------------
Reporter: Samuel Bronson <[EMAIL PROTECTED]> | Owner: chak
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 6.5
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: Unknown | Os: Unknown
---------------------------------------------------+------------------------
When I try to compile:
{{{
class Foo a where
type Bar a :: *
aBar :: Bar a
}}}
I get this "type error":
{{{
Test.hs:1:0:
Type synonym `Bar' should have 1 argument, but has been given 1
When checking the class method: aBar :: Bar a
In the class declaration for `Foo'
}}}
I've tracked it down to this case in `typecheck/TcMType.lhs`:
{{{
check_tau_type rank ubx_tup ty@(TyConApp tc tys)
| isSynTyCon tc
}}}
which calls `tcView`, which in turn calls `tcExpandTyCon_maybe`, which
doesn't handle open type synonyms. (And so `Nothing` is returned down the
line, and you get this nasty error.)
It should be pretty easy to fix if you actually have a clue what you are
doing ;-). So, please fix it. Then I can get back to trying to reimplement
the MTL with ATs ;-).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/961>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs