[GHC] #15172: Undecidable instances slip through

#15172: Undecidable instances slip through -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Consider {{{ {-# LANGUAGE FlexibleInstances, TypeFamilies, ConstraintKinds #-} type family F a :: Constraint class C a where instance (F a) => C [[a]] where }}} This should be rejected because the `F a` constraint could expand to be arbitrarily large, depending on `F`. There's simply a missing check in `checkInstTermination`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15172 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15172: Undecidable instances slip through -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by simonpj: Old description:
Consider {{{ {-# LANGUAGE FlexibleInstances, TypeFamilies, ConstraintKinds #-}
type family F a :: Constraint
class C a where instance (F a) => C [[a]] where }}} This should be rejected because the `F a` constraint could expand to be arbitrarily large, depending on `F`. There's simply a missing check in `checkInstTermination`.
New description: Consider {{{ {-# LANGUAGE FlexibleInstances, TypeFamilies, ConstraintKinds #-} type family F a :: Constraint class C a where instance (F a) => C [[a]] where }}} This should be rejected because the `F a` constraint could expand to be arbitrarily large, depending on `F`. But it's accepted by HEAD. There's simply a missing check in `checkInstTermination`. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15172#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15172: Undecidable instances slip through
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.2.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | 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

#15172: Undecidable instances slip through -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: indexed- | types/should_fail/T15172 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => indexed-types/should_fail/T15172 * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15172#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC