#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
    Reporter:  parcs             |       Owner:                    
        Type:  bug               |      Status:  merge             
    Priority:  normal            |   Milestone:                    
   Component:  Compiler          |     Version:  7.6.1             
    Keywords:                    |          Os:  Unknown/Multiple  
Architecture:  Unknown/Multiple  |     Failure:  Compile-time crash
  Difficulty:  Unknown           |    Testcase:  th/T7276          
   Blockedby:                    |    Blocking:                    
     Related:                    |  

Comment(by parcs):

 It looks like you can still trigger a segfault if you bind the quotation
 to an identifier while coercing its type and then splicing the quotation,

 :set -fdefer-type-errors
 :set -XTemplateHaskell

 import Language.Haskell.TH

 let x = [d|a = ()|] :: Q Exp
 :t $x

 The patch also makes GHC too aggressive than it should be with respect to
 type errors within declaration quotations. For example the type error in
 `$([d|a = () ()|])` could be deferred but after this patch it becomes an
 eager type error. Likewise, you can no longer do e.g. `:t $([|() ()|])`
 within GHCi to view the type of a malformed expression quotation.

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

Glasgow-haskell-bugs mailing list

Reply via email to