is this change in TH error message intentional?
Richard Eisenberg
eir at cis.upenn.edu
Tue Oct 20 15:44:07 UTC 2015
I didn't make the change, but I like it (with the exception of loss of context in the first error). I think you should post a bug report about that loss of context.
But I, personally, always have found the second one redundant.
Richard
On Oct 19, 2015, at 4:38 PM, Ömer Sinan Ağacan <omeragacan at gmail.com> wrote:
> Hi all,
>
> I realized this change in TH error messages:
>
> GHC 7.10.2:
>
> ➜ th-test ghc --make Main.hs
> [1 of 1] Compiling Main ( Main.hs, Main.o )
>
> Main.hs:13:15:
> Not in scope: ‘locaton’
> Perhaps you meant ‘location’ (imported from Language.Haskell.TH.Syntax)
> In the splice: $locaton
>
> Main.hs:13:15:
> GHC stage restriction:
> ‘locaton’ is used in a top-level splice or annotation,
> and must be imported, not defined locally
> In the expression: locaton
> In the splice: $locaton
>
> I think both error messages are quite useful in this context. I don't see
> second one as redundant.
>
> However, with HEAD:
>
> ➜ th-test ghc-stage2 --make Main.hs
> [1 of 1] Compiling Main ( Main.hs, Main.o )
>
> Main.hs:13:15: error:
> Variable not in scope: locaton :: ExpQ
> Perhaps you meant ‘location’ (imported from Language.Haskell.TH.Syntax)
>
> I think this new message is quite worse than previous one. First, "In the
> splice ..." part is missing. Second, "It must be imported, not defined locally"
> message is not given at all.
>
> Was this change intentional? May I ask why it's changed?
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
More information about the ghc-devs
mailing list