Ticket #40 (closed defect: invalid)
type/constructor namespace bug
| Reported by: | duncan.coutts@… | Owned by: | nobody |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | hugs | Version: | 200609 |
| Keywords: | Cc: |
Description
I tried to compile the Gtk2Hs code generator with hugs (September 2006) and it complained about this bit of code:
extractAPI :: Xml.Document -> API extractAPI (Xml.Document _ _ (Xml.Elem "api" [] namespaces) _) =
The message is:
ERROR "./Api.hs":156 - Illegal type "Document -> API" in constructor application
Commenting out the type signature suppressed the error.
The problem seems to be a mixup in what namespace Xml.Document is being looked up in. There is both a type Xml.Document and a constructor Xml.Document. The type name seems to be masking the constructor name. It may also be because it's a qualified import. I don't know, I've looked into that any further.
The Gtk2Hs code generator is here: http://darcs.haskell.org/gtk2hs/tools/apiGen/
You only need the Api.hs module to reproduce the error, though you would need all the .hs files in that dir to get the whole thing to run of course.
