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

No parse when importing a module (with an import hook), which is using class hooks #155

Closed
noughtmare opened this Issue Jan 12, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@noughtmare

I have one file Types.chs with the code:

module Types where

data ExampleStruct
{#pointer *example_struct as exampleStructPtr -> exampleStruct#}
{#class exampleStructClass exampleStructPtr#}

data ChildStruct
{#pointer *child_struct as childStructPtr -> childStruct#}
{#class exampleStructClass => childStructClass childStructPtr#}

If I then import that file with {#import Types#} in a second file, c2hs gives me the error: "Prelude.read no parse".

@noughtmare noughtmare changed the title from no parse when importing a module (with an import hook) that is using class hooks to no parse when importing a module (with an import hook) which is using class hooks Jan 12, 2016

@noughtmare noughtmare changed the title from no parse when importing a module (with an import hook) which is using class hooks to No parse when importing a module (with an import hook), which is using class hooks Jan 12, 2016

@ian-ross

This comment has been minimized.

Show comment
Hide comment
@ian-ross

ian-ross Jan 12, 2016

Member

@noughtmare Is this a real issue or not? I got an email comment from you saying that it wasn't, but that comment doesn't show up here, so I don't know if you deleted it... (If it is a real issue, I'll have a look at it on the weekend: I've blocked out some C2HS time for Sunday.)

Member

ian-ross commented Jan 12, 2016

@noughtmare Is this a real issue or not? I got an email comment from you saying that it wasn't, but that comment doesn't show up here, so I don't know if you deleted it... (If it is a real issue, I'll have a look at it on the weekend: I've blocked out some C2HS time for Sunday.)

@noughtmare

This comment has been minimized.

Show comment
Hide comment
@noughtmare

noughtmare Jan 12, 2016

Ah, yes I thought I had found the solution, but when I recompiled from scratch it didn't work anymore. So it is not fixed yet.

Ah, yes I thought I had found the solution, but when I recompiled from scratch it didn't work anymore. So it is not fixed yet.

@ian-ross

This comment has been minimized.

Show comment
Hide comment
@ian-ross

ian-ross Jan 12, 2016

Member

@noughtmare Thanks for confirming. I'll take a look on Sunday.

Member

ian-ross commented Jan 12, 2016

@noughtmare Thanks for confirming. I'll take a look on Sunday.

@ian-ross ian-ross closed this in 73a985f Jan 17, 2016

@ian-ross

This comment has been minimized.

Show comment
Hide comment
@ian-ross

ian-ross Jan 17, 2016

Member

@noughtmare So, there was a bug in the handling of class definitions in CHS files imported into other files. However, you should probably also know that the example code you provided needs some changes to work, to do with language extensions needed for some of the instance definitions, and for lack of capitalisation on Haskell type names. You can see one working version in tests/bugs/issue-155/Types.chs.

Member

ian-ross commented Jan 17, 2016

@noughtmare So, there was a bug in the handling of class definitions in CHS files imported into other files. However, you should probably also know that the example code you provided needs some changes to work, to do with language extensions needed for some of the instance definitions, and for lack of capitalisation on Haskell type names. You can see one working version in tests/bugs/issue-155/Types.chs.

@noughtmare

This comment has been minimized.

Show comment
Hide comment

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment