#3857: gchi compiles but gch fails
--------------------------------------+-------------------------------------
Reporter: dstr | Owner:
Type: bug | Status: closed
Priority: normal | Component: Compiler
Version: 6.12.1 | Resolution: invalid
Keywords: | Os: MacOS X
Testcase: | Architecture: x86
Failure: GHC rejects valid program |
--------------------------------------+-------------------------------------
Changes (by maeder):
* status: new => closed
* resolution: => invalid
Comment:
To place a further declaration after the instance, the instance must be
terminated by a semicolon, that does not indicate a further instance
equation.
This works:
{{{
data Ftype = Numa Integer | Str [Char] ;
instance Show Ftype where
show (Str s) = s; show (Numa n) = show n
;
bla = undefined
}}}
This does not:
{{{
data Ftype = Numa Integer | Str [Char] ;
instance Show Ftype where
show (Str s) = s; show (Numa n) = show n ;
bla = undefined
}}}
And this works:
{{{
data Ftype = Numa Integer | Str [Char] ;
instance Show Ftype where
{ show (Str s) = s;
show (Numa n) = show n } ;
bla = undefined
}}}
but not without ";" after "}".
So this is no bug, but just a complicated misunderstanding.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3857#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs