[GHC] #13244: Error Dealing with Unboxed Types and Type Families

#13244: Error Dealing with Unboxed Types and Type Families ----------------------------------------+--------------------------------- Reporter: sgschlesinger | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: pprIfaceCo | Operating System: Linux Architecture: Unknown/Multiple | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ----------------------------------------+--------------------------------- Hello, I was playing with unboxed types and this happened: [2 of 2] Compiling Data.Unbox ( Data/Unbox.hs, .stack- work/dist/x86_64-linux/Cabal-1.24.0.0/build/Data/Unbox.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): pprIfaceCo I will attach the relevant file. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13244 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13244: Error Dealing with Unboxed Types and Type Families ----------------------------------+---------------------------------------- Reporter: sgschlesinger | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: pprIfaceCo Operating System: Linux | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+---------------------------------------- Changes (by sgschlesinger): * Attachment "Unbox.hs" added. The relevant code -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13244 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13244: Error Dealing with Unboxed Types and Type Families ----------------------------------+---------------------------------------- Reporter: sgschlesinger | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: pprIfaceCo Operating System: Linux | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+---------------------------------------- Comment (by simonpj): Can you explain how to provoke the error? I tried {{{ ghc -c T13244.hs }}} and all was well. (But I may not have used exactly the version that you did..) Probably a dup of #12242 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13244#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13244: Error Dealing with Unboxed Types and Type Families ----------------------------------+---------------------------------------- Reporter: sgschlesinger | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: pprIfaceCo Operating System: Linux | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+---------------------------------------- Changes (by sgschlesinger): * Attachment "lint-errors.txt" added. lint errors from "stack build --ghc-options -dcore-lint -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13244 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13244: Error Dealing with Unboxed Types and Type Families ----------------------------------+---------------------------------------- Reporter: sgschlesinger | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: pprIfaceCo Operating System: Linux | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+---------------------------------------- Comment (by sgschlesinger): I'm using stack with resolver lts-7.19 which uses ghc 8.0.1. I ran stack build --ghc-options -dcore-lint and got quite the atrocious output which I will attach to the issue. The error I got originally was from a dup of #12242 almost certainly, but could the -dcore-lint errors have been caused by that? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13244#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13244: Error Dealing with Unboxed Types and Type Families ----------------------------------+---------------------------------------- Reporter: sgschlesinger | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: pprIfaceCo Operating System: Linux | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+---------------------------------------- Comment (by simonpj): Could you provoke it with an invocation of GHC, not via stack? One less indirection. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13244#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13244: Error Dealing with Unboxed Types and Type Families ----------------------------------+---------------------------------------- Reporter: sgschlesinger | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: pprIfaceCo Operating System: Linux | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+---------------------------------------- Comment (by sgschlesinger): Yes, here is the relevant session: {{{ samuel@computer:~/Documents/lower/Data$ ghc Unbox.hs -XMagicHash -XDataKinds -XTypeInType -XTypeFamilies [1 of 1] Compiling Data.Unbox ( Unbox.hs, Unbox.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-unknown-linux): kindPrimRep.go Rep Int Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13244#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13244: Error Dealing with Unboxed Types and Type Families ----------------------------------+---------------------------------------- Reporter: sgschlesinger | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: pprIfaceCo Operating System: Linux | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+---------------------------------------- Comment (by sgschlesinger): Behaviors to note: if I set "box = undefined", the code will compile but still have type errors when run with -dcore-lint, whereas if I set "unbox = undefined" the message is still the same. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13244#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13244: Error Dealing with Unboxed Types and Type Families -------------------------------------+------------------------------------- Reporter: sgschlesinger | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | LevityPolymorphism Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * keywords: pprIfaceCo => LevityPolymorphism Comment: OK I can reproduce this. It fails with a Lint error in the GHC 8.0 branch: {{{ *** Core Lint errors : in result of Tidy Core *** <no location info>: warning: In the type ‘Unboxed x_aws[sk] -> x_aws[sk]’ Ill-kinded argument in type or kind ‘Unboxed x_aws[sk] -> x_aws[sk]’ type or kind ‘Unboxed x_aws[sk] -> x_aws[sk]’ kind: TYPE (Rep x_aws[sk]) <no location info>: warning: In the type ‘Unboxed x_aws[sk] -> x_aws[sk]’ Ill-kinded argument in type or kind ‘Unboxed x_aws[sk] -> x_aws[sk]’ type or kind ‘Unboxed x_aws[sk] -> x_aws[sk]’ kind: TYPE (Rep x_aws[sk]) <no location info>: warning: In the type ‘Unboxed x_aws[sk] -> x_aws[sk]’ Ill-kinded argument in type or kind ‘Unboxed x_aws[sk] -> x_aws[sk]’ type or kind ‘Unboxed x_aws[sk] -> x_aws[sk]’ kind: TYPE (Rep x_aws[sk]) <no location info>: warning: In the type ‘forall x_aws[sk]. Unbox x_aws[sk] => Unboxed x_aws[sk] -> x_aws[sk]’ Ill-kinded argument in type or kind ‘Unboxed x_aws[sk] -> x_aws[sk]’ type or kind ‘Unboxed x_aws[sk] -> x_aws[sk]’ kind: TYPE (Rep x_aws[sk]) *** Offending Program *** }}} But the recent round of improvements to levity polymorphism make this OK in HEAD (and hence in 8.2). I'll add a regression test. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13244#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13244: Error Dealing with Unboxed Types and Type Families
-------------------------------------+-------------------------------------
Reporter: sgschlesinger | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
| LevityPolymorphism
Operating System: Linux | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#13244: Error Dealing with Unboxed Types and Type Families -------------------------------------+------------------------------------- Reporter: sgschlesinger | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | LevityPolymorphism Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_compile/T13244 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => indexed-types/should_compile/T13244 * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13244#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC