Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helpful "not in scope before the splice" went missing in 9.0 #547

Open
tomjaguarpaw opened this issue Sep 10, 2023 · 6 comments
Open

Helpful "not in scope before the splice" went missing in 9.0 #547

tomjaguarpaw opened this issue Sep 10, 2023 · 6 comments

Comments

@tomjaguarpaw
Copy link
Member

In the program below, c is not in scope where a is defined because of the intervening TH splice. The error message in 8.10 was helpful

test18.hs:6:5: error:
    • Variable not in scope: c :: Int
    • ‘c’ (line 11) is not in scope before the splice on line 8

In 9.0 the error message became unhelpful

test18.hs:6:5: error: Variable not in scope: c :: Int

{-# LANGUAGE TemplateHaskell #-}

import Language.Haskell.TH.Syntax

a :: Int
a = c

$(pure [])

c :: Int
c = 0
@tomjaguarpaw
Copy link
Member Author

@monoidal
Copy link
Member

@tomjaguarpaw
Copy link
Member Author

Thanks @monoidal!

(I realised I've posted this on the wrong issue tracker. I'll try to find the correct one...)

@tomjaguarpaw
Copy link
Member Author

Actually perhaps it is the correct one, per https://github.com/haskell/error-messages#the-haskell-message-index. I got confused between this one and https://github.com/haskellfoundation/error-message-index, but I think this is the correct one for general issues around error messages.

@monoidal
Copy link
Member

Yes - error-message-index is used to describe existing errors, while this one is for improving them.

@tomjaguarpaw
Copy link
Member Author

Apparently it took "hundreds of lines of code" to support this error message!

https://gitlab.haskell.org/ghc/ghc/-/issues/17816#note_256193

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

No branches or pull requests

2 participants