mboes / haskell-src-exts-qq

A quasiquoter for haskell-src-exts.
Other
9 stars 7 forks source link

type/data/newtype decls with tuples fail #5

Closed unthought closed 12 years ago

unthought commented 12 years ago
ghci> :set -XTemplateHaskell
ghci> :set -XQuasiQuotes
ghci> :set -ddump-if-trace
ghci> import Language.Haskell.Exts.Syntax.QQ
ghci> [dec| type Pair = (Int, String) |]

Considering whether to load ghc-prim:GHC.CString
Considering whether to load template-haskell:Language.Haskell.TH.Quote
Considering whether to load haskell-src-exts-qq-0.6.0:Language.Haskell.Exts.QQ
tcImportDecl Language.Haskell.Exts.Syntax.Boxed
Need decl for Language.Haskell.Exts.Syntax.Boxed
Considering whether to load haskell-src-exts-1.13.3:Language.Haskell.Exts.Syntax {- SYSTEM -}

<interactive>:8:6:
    Can't find interface-file declaration for variable Language.Haskell.Exts.Syntax.Boxed
      Probable cause: bug in .hi-boot file, or inconsistent .hi file
      Use -ddump-if-trace to get an idea of which file caused the error
    In the first argument of `Language.Haskell.Exts.Syntax.TyTuple', namely
      `Language.Haskell.Exts.Syntax.Boxed'
    In the fourth argument of `Language.Haskell.Exts.Syntax.TypeDecl', namely
      `Language.Haskell.Exts.Syntax.TyTuple
         Language.Haskell.Exts.Syntax.Boxed
         ((:)
            (Language.Haskell.Exts.Syntax.TyCon
               (Language.Haskell.Exts.Syntax.UnQual
                  (Language.Haskell.Exts.Syntax.Ident
                     ((:) 'I' ((:) 'n' ((:) 't' []))))))
            ((:)
               (Language.Haskell.Exts.Syntax.TyCon
                  (Language.Haskell.Exts.Syntax.UnQual
                     (Language.Haskell.Exts.Syntax.Ident
                        ((:) 'S' ((:) 't' ((:) 'r' ((:) 'i' ((:) 'n' ((:) 'g' [])))))))))
               []))'
    In the expression:
      Language.Haskell.Exts.Syntax.TypeDecl
        (Language.Haskell.Exts.SrcLoc.SrcLoc
           ((:)
              '<'
              ((:)
                 'u'
                 ((:)
                    'n'
                    ((:)
                       'k'
                       ((:)
                          'n'
                          ((:)
                             'o'
                             ((:)
                                'w' ((:) 'n' ((:) '>' ((:) '.' ((:) 'h' ((:) 's' []))))))))))))
           1
           2)
        (Language.Haskell.Exts.Syntax.Ident
           ((:) 'P' ((:) 'a' ((:) 'i' ((:) 'r' [])))))
        []
        (Language.Haskell.Exts.Syntax.TyTuple
           Language.Haskell.Exts.Syntax.Boxed
           ((:)
              (Language.Haskell.Exts.Syntax.TyCon
                 (Language.Haskell.Exts.Syntax.UnQual
                    (Language.Haskell.Exts.Syntax.Ident
                       ((:) 'I' ((:) 'n' ((:) 't' []))))))
              ((:)
                 (Language.Haskell.Exts.Syntax.TyCon
                    (Language.Haskell.Exts.Syntax.UnQual
                       (Language.Haskell.Exts.Syntax.Ident
                          ((:) 'S' ((:) 't' ((:) 'r' ((:) 'i' ((:) 'n' ((:) 'g' [])))))))))
                 [])))
unthought commented 12 years ago

And the system config:

ghci> :show packages
active package flags:
  -package-id template-haskell-2.7.0.0-c77fdef202828dcc7ffefd2eb5f20430
  -package-id syb-0.3.6.1-25afc4081bcba194a5b590534d6cacab
  -package-id haskell-src-meta-0.5.1.2-b7dc69301647596c9e27c27f7603450c
  -package-id haskell-src-exts-1.13.3-0c42cf4a57732bef6711685aa3042aaa
  -package-id base-4.5.0.0-7aff24101508c8e98d083dc12ec4756b

$> cabal-dev ghc-pkg list
/Library/Frameworks/GHC.framework/Versions/7.4.1-x86_64/usr/lib/ghc-7.4.1/package.conf.d
   Cabal-1.14.0
   GLUT-2.1.2.1
   HTTP-4000.2.3
   HUnit-1.2.4.2
   OpenGL-2.2.3.1
   QuickCheck-2.4.2
   array-0.4.0.0
   base-4.5.0.0
   bin-package-db-0.0.0.0
   binary-0.5.1.0
   bytestring-0.9.2.1
   cgi-3001.1.7.4
   containers-0.4.2.1
   deepseq-1.3.0.0
   directory-1.1.0.2
   extensible-exceptions-0.1.1.4
   fgl-5.4.2.4
   filepath-1.3.0.0
   ghc-7.4.1
   ghc-prim-0.2.0.0
   haskell-platform-2012.2.0.0
   haskell-src-1.0.1.5
   haskell2010-1.1.0.1
   haskell98-2.0.0.1
   hoopl-3.8.7.3
   hpc-0.5.1.1
   html-1.0.1.2
   integer-gmp-0.4.0.0
   mtl-2.1.1
   network-2.3.0.13
   old-locale-1.0.0.4
   old-time-1.1.0.0
   parallel-3.2.0.2
   parsec-3.1.2
   pretty-1.1.1.0
   process-1.1.0.1
   random-1.0.1.1
   regex-base-0.93.2
   regex-compat-0.95.1
   regex-posix-0.95.1
   rts-1.0
   stm-2.3
   syb-0.3.6.1
   template-haskell-2.7.0.0
   text-0.11.2.0
   time-1.4
   transformers-0.3.0.0
   unix-2.5.1.0
   xhtml-3000.2.1
   zlib-0.5.3.3
/Users/me/Source/External/git/haskell-src-exts-qq/cabal-dev/packages-7.4.1.conf
   cpphs-1.14
   haskell-src-exts-1.13.3
   haskell-src-exts-qq-0.6.0
   haskell-src-meta-0.5.1.2
   th-lift-0.5.5
mboes commented 12 years ago

Hi Dan,

thanks for looking into this. This is fixed in commit 9741b26bdf20f18a90a1119207a0d34f3438affe. I added a special case for the Boxed constructor, which we now don't qualify. There arleady was such a special case for SrcLoc, but I really don't remember why these are needed.

-- Mathieu