Ticket #40 (closed defect: invalid)

Opened 7 years ago

Last modified 7 years ago

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.

Change History

Changed 7 years ago by duncan.coutts@…

The March 2005 version does not have this bug.

Changed 7 years ago by ross

  • status changed from new to closed
  • resolution set to invalid

hugs +k reports:

ERROR "Api.hs":156 - Kind error in constructor application
*** expression     : Document -> API
*** constructor    : Document
*** kind           : * -> *
*** does not match : *

The Document type changed kind in Sep 2005 ( rev. 1.6 of Text.XML.HaXml.Types)

Changed 7 years ago by duncan.coutts@…

Oh yes. Sorry, my confusion not hugs'.

Note: See TracTickets for help on using tickets.