Skip to content

Instance declarations in hs-boot files result in GHC errors #723

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

Closed
simmsb opened this issue Dec 28, 2020 · 0 comments · Fixed by #781
Closed

Instance declarations in hs-boot files result in GHC errors #723

simmsb opened this issue Dec 28, 2020 · 0 comments · Fixed by #781
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@simmsb
Copy link
Contributor

simmsb commented Dec 28, 2020

Hi, I've come across this issue where any hs-boot file containing instance
declarations results in the following error on the module:

File:     /home/ben/dev/ghcide_boot_file/src/X.hs-boot
Hidden:   no
Range:    1:1-2:1
Source:   compile
Severity: DsError
Message: 
  Compilation Issue
  lookup_final_id

  $fxShowY
  Call stack:
  CallStack (from HasCallStack):
  callStackDoc, called at compiler/utils/Outputable.hs:1159:37 in ghc:Outputable
  pprPanic, called at compiler/main/TidyPgm.hs:201:12 in ghc:TidyPgm
  Please report this bug to the compiler authors.

This causes any modules dependent on the hs-boot module to also fail.

For reference:

  • X.hs-boot
module X (Y) where

data Y

instance Show Y
instance Eq Y
  • X.hs
module X (Y) where

data Y = Y
  deriving (Show, Eq)
@pepeiborra pepeiborra transferred this issue from haskell/ghcide Dec 30, 2020
@jneira jneira added component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Dec 30, 2020
simmsb added a commit to simmsb/haskell-language-server that referenced this issue Jan 1, 2021
simmsb added a commit to simmsb/haskell-language-server that referenced this issue Jan 1, 2021
@mergify mergify bot closed this as completed in #781 Jan 5, 2021
mergify bot added a commit that referenced this issue Jan 5, 2021
#781)

* Fix #723

* Update boot test to have instance declarations

* Correct expected location of 'f' in boot-def-test

* Missed TemplateHaskell pragma from boot test

* Fix comment placement

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
pepeiborra added a commit to pepeiborra/ide that referenced this issue Jan 9, 2021
… errors) (haskell#781)

* Fix haskell#723

* Update boot test to have instance declarations

* Correct expected location of 'f' in boot-def-test

* Missed TemplateHaskell pragma from boot test

* Fix comment placement

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
2 participants