Opened 14 years ago

Closed 14 years ago

Last modified 47 years ago

#195 closed bug (Wont Fix)

Missing # from #-} elicits utterly opaque error

Reported by: nobody Owned by: nobody
Priority: normal Milestone:
Component: None Version: None
Keywords: Cc:
Operating System: Architecture:
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Consider this in Foo.hs

	module Foo where
	{-# LINE 1 "Baz.hs" -}

Notice the missing #

GHC 6.3 (HEAD, 30 Oct 2003) gives the message:

       Baz.hs:0: lexical error

This is extremely opaque; after all, the error is in Foo.  
And it would help to know the offending token.

Simon PJ 

Change History (1)

comment:1 Changed 14 years ago by simonmar

Status: assignedclosed
Logged In: YES 

The error message might be opaque, but there's a good reason
for it:  when GHC sees

   {-# LINE 1 "foo.hs"

it sets the current file to "foo.hs" and the line number to
0 (one less than 1, because the *next* line in the file is
line 1).  I suppose we should really wait for the closing
'#-}' before changing the file & line number, but that's
hard (there might be intervening comments).
Note: See TracTickets for help on using tickets.