[GHC] #2713: Fixities interact badly with TH under GHC 6.10.1 20081007

GHC trac at galois.com
Wed Oct 22 11:18:50 EDT 2008


#2713: Fixities interact badly with TH under GHC 6.10.1 20081007
------------------------------+---------------------------------------------
 Reporter:  BenMoseley        |          Owner:                  
     Type:  bug               |         Status:  new             
 Priority:  normal            |      Milestone:                  
Component:  Template Haskell  |        Version:  6.10.1          
 Severity:  normal            |     Resolution:                  
 Keywords:                    |     Difficulty:  Unknown         
 Testcase:                    |   Architecture:  Unknown/Multiple
       Os:  Unknown/Multiple  |  
------------------------------+---------------------------------------------
Changes (by simonpj):

  * difficulty:  => Unknown

Comment:

 Hmm.  I'm not sure what 'worked fine' means.  I think that with the
 declaration splice un-commented, GHC should probably report an error
 "Fixity declaration without accompanying definition" or something.

 Remember that GHC renames and typechecks all the code up to and including
 the first declaration splice; then runs the splice, and then renames and
 typechecks the result of the splice, plus all the code that follows up to
 and including the next splice.   (Reason: the first splice might bring new
 stuff into scope that is needed to make sense of the stuff that follows
 the splice.)

 To be concrete, what would you expect to happen here?
 {{{
 module Fixity where

 class MyClass a where
    (.*.) :: a -> a -> a

 main = putStrLn "hi"

 $(f (1 .*. 2 * 3) )

 infixr 3 .*.
 }}}
 That is, what fixity does `(.*.)` have in the code for the decl splice?
 Remember, at this point GHC hasn't "seen" the declarations below.

 I don't like the idea that an operator might have different fixities in
 different parts of the code.

 So I assert that the bug is that you don't get an error message, not that
 the fixity is omitted from the interface file.  I'll add that error check
 -- but first I want to check that this makes sense to you.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2713#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list