Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Expanding Template Haskell in Yesod Hello World causes error #92

Closed
greenrd opened this issue Dec 2, 2012 · 6 comments
Closed

Expanding Template Haskell in Yesod Hello World causes error #92

greenrd opened this issue Dec 2, 2012 · 6 comments

Comments

@greenrd
Copy link

greenrd commented Dec 2, 2012

If I type in the Yesod Hello world example into helloworld.hs:

{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell, OverloadedStrings #-}
import Yesod

data HelloWorld = HelloWorld

mkYesod "HelloWorld" [parseRoutes|
/ HomeR GET
|]

instance Yesod HelloWorld

getHomeR :: Handler RepHtml
getHomeR = defaultLayout [whamlet|Hello World!|]

main :: IO ()
main = warpDebug 3000 HelloWorld

and put point immediately after a |], and type C-c C-e, I get:

ghc-mod:0:0:Probably mutual module import occurred

ghc-mod:0:0:Probably mutual module import occurred

ghc-mod:0:0:Probably mutual module import occurred

in the GHC Info buffer.

emacs 24.2, ghc-mod 1.11.2, ghc 7.6.1

@kazu-yamamoto
Copy link
Collaborator

I confirmed that this bug exists in GHC 7.6.1, but not in GHC 7.4.1. Let's see if this bug exits in coming GHC 7.6.2.

@mikavilpas
Copy link

Does not occur for me either with GHC 7.4.1, ghc-mod 1.11.3, GNU Emacs 24.1.50.1.

@kazu-yamamoto
Copy link
Collaborator

I tested this on GHC 7.6.2. But the same problem happens. #109 says the same thing and suggests that there is a way to fix it. I will try to find.

@kazu-yamamoto
Copy link
Collaborator

I understand this problem. GHC 7.4 or earlier dumps splices directly to stderr while GHC 7.6 passes splices to ghc-mod's logger. Because its SrcLoc uses an unexpected constructor, an exception is thrown.

I will fix this. Since I need to take core of the case of mutually imported modules, it would take a time.

@kazu-yamamoto
Copy link
Collaborator

Fixed in 4a5f544.

@kazu-yamamoto
Copy link
Collaborator

I have released ghc-mod v 1.12.3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants