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

Compiler panic: genApp: invalid size when using UnliftedNewtypes #836

Open
amesgen opened this issue Jul 23, 2022 · 0 comments
Open

Compiler panic: genApp: invalid size when using UnliftedNewtypes #836

amesgen opened this issue Jul 23, 2022 · 0 comments

Comments

@amesgen
Copy link

amesgen commented Jul 23, 2022

The minimal example

{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE UnliftedNewtypes #-}

newtype Foo = Foo (# #)

fails to compile:

panic! (the 'impossible' happened)
  (GHCJS version 8.10.7, GHC version 8.10.7):
        genApp: invalid size

Please report this as a GHCJS bug:  https://github.com/ghcjs/ghcjs/issues

Context

I encountered this in GHC.Parser.Lexer in GHC 9.4, where ParseResult is an unlifted newtype: https://gitlab.haskell.org/ghc/ghc/-/blob/ghc-9.4.1-rc1/compiler/GHC/Parser/Lexer.x#L2328

Note that type synonyms for unlifted types work just fine:

type Foo = (# #)

Minimal reproducible example

https://github.com/amesgen/stuff/tree/ghcjs-unlifted

nix build github:amesgen/stuff/ghcjs-unlifted
@amesgen amesgen changed the title Compiler panic: genApp: invalid size when using UnlifedNewtypes Compiler panic: genApp: invalid size when using UnliftedNewtypes Jul 23, 2022
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

1 participant