[GHC] #10438: GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local bindings

#10438: GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local bindings -------------------------------------+------------------------------------- Reporter: rpglover64 | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.10.1 Keywords: | Operating System: Linux Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- {{{#!hs {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE TypeFamilies #-} module Bad where foo f = g where g r = x where x :: _ x = r }}} When compiled, it produces the following output: {{{ [1 of 1] Compiling Bad ( src/Bad.hs, src/Bad.o ) src/Bad.hs:8:22: Warning: Found hole ‘_’ with type: w_1 Where: ‘w_1’ is a rigid type variable bound by the inferred type of g :: w_1 -> w_1 at src/Bad.hs:7:9 Relevant bindings include r :: w_1 (bound at src/Bad.hs:7:11) g :: w_1 -> w_1 (bound at src/Bad.hs:7:9) f :: t (bound at src/Bad.hs:6:5) foo :: t -> w_ -> w_ (bound at src/Bad.hs:6:1) In the type signature for ‘x’: _ In an equation for ‘g’: g r = x where x :: _ x = r In an equation for ‘foo’: foo f = g where g r = x where x :: _ x = r ghc: panic! (the 'impossible' happened) (GHC version 7.10.1 for x86_64-unknown-linux): StgCmmEnv: variable not found x_alC local binds for: f_sv5 r_sv6 Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10438 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10438: GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local bindings -------------------------------------+------------------------------------- Reporter: rpglover64 | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by archblob): This does no longer reproduce on current HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10438#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10438: GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local
bindings
-------------------------------------+-------------------------------------
Reporter: rpglover64 | Owner:
Type: bug | Status: new
Priority: high | Milestone:
Component: Compiler | Version: 7.10.1
Resolution: | Keywords:
Operating System: Linux | Architecture: x86_64
Type of failure: Compile-time | (amd64)
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#10438: GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local bindings -------------------------------------+------------------------------------- Reporter: rpglover64 | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: partial- Blocked By: | sigs/should_compile/T10438 Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => partial-sigs/should_compile/T10438 * milestone: => 7.10.2 Comment: Thanks. I've added a test to make sure it stays good. I'll re-milestone the ticket for the 7.10 branch, but I don't have time to fix this on the 7.10 branch. I'll leave the ticket open in case anyone else does. (Finding which patch on HEAD fixed it would be a good start.) Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10438#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10438: GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local bindings -------------------------------------+------------------------------------- Reporter: rpglover64 | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 | (amd64) Type of failure: Compile-time | Test Case: partial- crash | sigs/should_compile/T10438 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rpglover64): For reference, this is still an issue in ghc-7.10.1.20150630 (i.e. 7.10.2-rc2). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10438#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10438: GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local bindings -------------------------------------+------------------------------------- Reporter: rpglover64 | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 | (amd64) Type of failure: Compile-time | Test Case: partial- crash | sigs/should_compile/T10438 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rpglover64): If my `git bisect` was correct, the patch that fixes the problem is https://git.haskell.org/ghc.git/commitdiff/28299d6 "Always generalise a partial type signature". -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10438#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10438: GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local bindings -------------------------------------+------------------------------------- Reporter: rpglover64 | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 | (amd64) Type of failure: Compile-time | Test Case: partial- crash | sigs/should_compile/T10438 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rpglover64): It seems like cherry picking said patch onto the ghc-7.10 branch fixes the bug (running tests locally now to make sure it doesn't break anything else), but I don't know what the correct workflow is in this case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10438#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10438: GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local bindings -------------------------------------+------------------------------------- Reporter: rpglover64 | Owner: Type: bug | Status: merge Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 | (amd64) Type of failure: Compile-time | Test Case: partial- crash | sigs/should_compile/T10438 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge Comment: I'll change status to merge, so that if we do 7.10.3 it'll get in. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10438#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10438: GHC 7.10.1 panic due to PartialTypeSignatures, TypeFamilies, and local bindings -------------------------------------+------------------------------------- Reporter: rpglover64 | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 | (amd64) Type of failure: Compile-time | Test Case: partial- crash | sigs/should_compile/T10438 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-7.10` as 0e1c983 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10438#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC