[GHC] #15380: Infinite typechecker loop in GHC 8.6

#15380: Infinite typechecker loop in GHC 8.6 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 (Type checker) | Keywords: TypeInType, | Operating System: Unknown/Multiple TypeFamilies | Architecture: | Type of failure: Compile-time Unknown/Multiple | performance bug Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The following program loops infinitely during typechecking with GHC 8.6.1 and HEAD: {{{#!hs {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeInType #-} {-# LANGUAGE TypeOperators #-} module Bug where import Data.Kind class Generic a where type Rep a :: Type class PGeneric a where type To a (x :: Rep a) :: a type family MDefault (x :: a) :: a where MDefault x = To (M x) class C a where type M (x :: a) :: a type M (x :: a) = MDefault x }}} In GHC 8.4.3, however this fails with a proper error: {{{ $ /opt/ghc/8.4.3/bin/ghc Bug.hs [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) Bug.hs:15:16: error: • Occurs check: cannot construct the infinite kind: a ~ Rep (M x) -> M x • In the type ‘To (M x)’ In the type family declaration for ‘MDefault’ • Type variable kinds: x :: a | 15 | MDefault x = To (M x) | ^^^^^^^^ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15380 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15380: Infinite typechecker loop in GHC 8.6 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.5 checker) | Keywords: TypeInType, Resolution: | TypeFamilies Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: goldfire (added) * version: 8.4.3 => 8.5 Comment: This regression was introduced in commit faec8d358985e5d0bf363bd96f23fe76c9e281f7 (`Track type variable scope more carefully.`). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15380#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15380: Infinite typechecker loop in GHC 8.6 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: high | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.5 checker) | Keywords: TypeInType, Resolution: | TypeFamilies Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4974 Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => patch * differential: => Phab:D4974 Comment: I really nailed this one. See the patch. :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15380#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15380: Infinite typechecker loop in GHC 8.6 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: high | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.5 checker) | Keywords: TypeInType, Resolution: | TypeFamilies Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4974 Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): The patch now validates, but waiting for Simon's review before committing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15380#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15380: Infinite typechecker loop in GHC 8.6 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: high | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.5 checker) | Keywords: TypeInType, Resolution: | TypeFamilies Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4974 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Richard and I discussed yesterday; he has a bit more to do and then will commmit. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15380#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15380: Infinite typechecker loop in GHC 8.6
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: patch
Priority: high | Milestone: 8.6.1
Component: Compiler (Type | Version: 8.5
checker) | Keywords: TypeInType,
Resolution: | TypeFamilies
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4974
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#15380: Infinite typechecker loop in GHC 8.6 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.5 checker) | Keywords: TypeInType, Resolution: | TypeFamilies Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: performance bug | dependent/should_fail/T15380 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4974 Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: patch => merge * testcase: => dependent/should_fail/T15380 Comment: Fixed now. Though this touches quite a few files, I don't think it should cause merging trouble. But it's not really critical. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15380#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15380: Infinite typechecker loop in GHC 8.6 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.5 checker) | Keywords: TypeInType, Resolution: | TypeFamilies Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: performance bug | dependent/should_fail/T15380 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4974 Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): Posted #15464 as the follow-up TH bug. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15380#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15380: Infinite typechecker loop in GHC 8.6 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.5 checker) | Keywords: TypeInType, Resolution: fixed | TypeFamilies Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: performance bug | dependent/should_fail/T15380 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4974 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.6` with 59f38587d44efd00b10a6d98f6a7a1b22e87f13a. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15380#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC