[GHC] #13271: GHC Panic With Injective Type Families
#13271: GHC Panic With Injective Type Families ----------------------------------------+--------------------------------- Reporter: wayofthepie | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Linux Architecture: Unknown/Multiple | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ----------------------------------------+--------------------------------- The following causes GHC to panic: {{{ {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilyDependencies #-} module T where import GHC.TypeLits data T1 = T1 type T2 = TypeError (Text "You can't do that!") type family X i = r | r -> i where X 1 = T1 X 2 = T2 }}} {{{ $ ghc T.hs [1 of 1] Compiling T ( T.hs, T.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): isInjectiveTyCon sees a TcTyCon T2 }}} This may be related to https://ghc.haskell.org/trac/ghc/ticket/11560. Without injectivity it gives the expected type error with the message "You can't do that!" {{{ {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilies #-} module T where import GHC.TypeLits data T1 = T1 type T2 = TypeError (Text "You can't do that!") type family X i where X 1 = T1 X 2 = T2 }}} {{{ $ ghc T.hs [1 of 1] Compiling T ( T.hs, T.o ) T.hs:9:1: error: • You can't do that • In the type synonym declaration for ‘T2’ }}} This isn't something anyone would intentionally write, as it could never type check with the type synonym T2 being a TypeError, but a panic is a panic so I said I'd raise it anyway. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13271> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13271: GHC Panic With Injective Type Families ---------------------------------+---------------------------------------- Reporter: wayofthepie | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: 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 <simonpj@…>): In [changeset:"0c9d9dec0a924a4f34f4cff26d004143c028861a/ghc" 0c9d9de/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="0c9d9dec0a924a4f34f4cff26d004143c028861a" Remove panics for TcTyCon Previously TcTyCons were used only for knot-tying, but now they are also used after an error, to add a benign TyCon to the envt so we can carry on; see TyCon.makeRecoveryTyCon. But since it is used in this way, subsequent declarations may see a TcTyCon (e.g. during injectivity checks) and should not have a heart attack as a result. See Note [TcTyCon] in TyCon. This fixes Trac #13271 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13271#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13271: GHC Panic With Injective Type Families ---------------------------------+---------------------------------------- Reporter: wayofthepie | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: 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 <simonpj@…>): In [changeset:"b125392983401cc9fe13502e52880387bc71a092/ghc" b1253929/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="b125392983401cc9fe13502e52880387bc71a092" Test Trac #13271 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13271#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13271: GHC Panic With Injective Type Families -------------------------------------+------------------------------------- Reporter: wayofthepie | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_fail/T13271 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => indexed-types/should_fail/T13271 * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13271#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13271: GHC Panic With Injective Type Families -------------------------------------+------------------------------------- Reporter: wayofthepie | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_fail/T13271 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ryan Scott <ryan.gl.scott@…>): In [changeset:"01af8aee30c743ab505e164ac9aa02149fbe4b9e/ghc" 01af8ae/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="01af8aee30c743ab505e164ac9aa02149fbe4b9e" Add regression tests for #12083 Summary: Commit 0c9d9dec0a924a4f34f4cff26d004143c028861a (the fix for #13271) fixed the programs in #12083. This adds regression tests for them. Test Plan: make test TEST="T12083a T12083b" Reviewers: austin, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #12083 Differential Revision: https://phabricator.haskell.org/D3573 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13271#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC