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

internal error: extractDecl (ClsInstD) #775

Closed
tmcdonell opened this issue Mar 13, 2018 · 7 comments
Closed

internal error: extractDecl (ClsInstD) #775

tmcdonell opened this issue Mar 13, 2018 · 7 comments

Comments

@tmcdonell
Copy link

I encountered this error running haddock on accelerate-llvm-native (example travis log):

haddock: internal error: internal: extractDecl (ClsInstD)
CallStack (from HasCallStack):
  error, called at utils/haddock/haddock-api/src/Haddock/Interface/Create.hs:1067:16 in main:Haddock.Interface.Create
  • ghc-8.4.1
  • haddock-2.19.0 and 2.19.0.1
  • ubuntu 14.04 and macOS 10.13

If you have some suggestions for how to trim this down to a smaller example I can try that. Otherwise this should reproduce it:

$ git clone https://github.com/AccelerateHS/accelerate-llvm.git
$ cd accelerate-llvm
$ stack haddock accelerate-llvm-native
@alexbiehl
Copy link
Member

Trevor, thank you for your report. 'extractDecl' is called for exports that only export a small part of the whole declaration. In this case we are talking about a class instance which probably exports an associated data type or similar and we are only interested in that data type. Maybe that helps pinning down the offender.

I will investigate by myself later today.

tmcdonell added a commit to tmcdonell/accelerate-llvm that referenced this issue Mar 13, 2018
@alexbiehl
Copy link
Member

alexbiehl commented Mar 13, 2018

Trevor, I couldn't find anything suspicious from your source (I just had a look, couldn't build it for some reason). But I found missing cases in extractDecl (see 7b3f6f3).

These were strictly not possible with older versions of haddock. Could you give it a try?

@tmcdonell
Copy link
Author

Hi @alexbiehl, thanks for the quick fix! haskell/haddock@ 7b3f6f3 seems to have done it! (:

@alexbiehl
Copy link
Member

Good to know. Interestingly, AFAIK, this situation can only arise with the use of pattern exports like this:

module (pattern A) where

class T a where 
  data X a

instance T Bla where
  data X Blah = A | B

I couldn't find such a thing in your source code. Have you seen something like this?

@tmcdonell
Copy link
Author

Interesting. I don't have any pattern synonyms at all. There are some associated data types (1, 2, 3, 4) which are all standard records, and a few non-associated data families (1, 2, 3), but I think that is it.

@alexbiehl
Copy link
Member

Ok, could you upload the documentation somewhere?

@tmcdonell
Copy link
Author

tmcdonell added a commit to tmcdonell-bot/accelerate-travis-buildbot that referenced this issue Mar 28, 2018
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