patch applied (ghc): Emit a decent error message when there is a decl-splice inside a decl-bracket

Simon Peyton Jones simonpj at microsoft.com
Fri Mar 23 07:25:50 EDT 2007


Fri Mar 23 04:19:12 PDT 2007  simonpj at microsoft.com
  * Emit a decent error message when there is a decl-splice inside a decl-bracket
  
  This fixes Trac #1065.  The fix is just to emit a decent error message
  rather than crash.  The situation is this:
  
    f x = ... [d| $(..stuff..); 
                  f x = v :: T |] ...
  
  TH wants to rename and typecheck the bracket; but it can't run the 
  nested splice yet.  That seems hard, because we know nothing about v, T,
  which are, presumably bound by the splice.
  
  The original TH paper says this isn't allowed, and now it's checked for
  properly (in the parser, in fact) rather than causing a crash.  In the
  fullness of time we might want to do something more flexible, but not now.
  
  

    M ./compiler/parser/Parser.y.pp -2 +3
    M ./compiler/parser/RdrHsSyn.lhs -11 +10



More information about the Cvs-ghc mailing list