[GHC] #15368: Type families, holes and -fdefer-type-errors may cause 'opt_univ fell into a hole' panic

#15368: Type families, holes and -fdefer-type-errors may cause 'opt_univ fell into a hole' panic -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This program, when compiled like `ghc -fdefer-type-errors -c panic.hs`: {{{#!hs {-# LANGUAGE TypeFamilies #-} module MorePanic where transitive :: (a, b) -> (b, c) -> (a, c) transitive = undefined trigger :: a -> b -> (F a b, F b a) trigger _ _ = _ `transitive` trigger _ _ type family F (n :: *) (m :: *) :: * }}} Gives this panic after several error messages: {{{ ghc.EXE: panic! (the 'impossible' happened) (GHC version 8.4.3 for x86_64-unknown-mingw32): opt_univ fell into a hole {co_a7Sj} Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler\utils\Outputable.hs:1150:37 in ghc:Outputable pprPanic, called at compiler\\types\\OptCoercion.hs:242:5 in ghc:OptCoercion Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} This bug also affects GHCi. Attached is full output -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15368 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15368: Type families, holes and -fdefer-type-errors may cause 'opt_univ fell into a hole' panic -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dramforever): * Attachment "fell-into-a-hole.txt" added. Full output when using GHC 8.4.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15368 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15368: Type families, holes and -fdefer-type-errors may cause 'opt_univ fell into a hole' panic -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Seems ok in HEAD, I'm happy to say. I'm not sure about the 8.6 branch. Regardless, could someone add a regression test? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15368#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15368: Type families, holes and -fdefer-type-errors may cause 'opt_univ fell into a hole' panic -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Added test in Phab:D4958. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15368#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15368: Type families, holes and -fdefer-type-errors may cause 'opt_univ fell into a hole' panic -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | typecheck/should_compile/T15368 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * testcase: => typecheck/should_compile/T15368 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15368#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15368: Type families, holes and -fdefer-type-errors may cause 'opt_univ fell into a hole' panic -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | typecheck/should_compile/T15368 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): I believe this is fixed in 8.6 beta already so we should merge Phab:D4958 and close this: {{{ haskell $ ghc MorePanic.hs -fdefer-type-errors [1 of 1] Compiling MorePanic ( MorePanic.hs, MorePanic.o ) MorePanic.hs:9:15: warning: [-Wtyped-holes] • Found hole: _ :: (F a b, F a0 b0) Where: ‘a0’ is an ambiguous type variable ‘b0’ is an ambiguous type variable ‘a’, ‘b’ are rigid type variables bound by the type signature for: trigger :: forall a b. a -> b -> (F a b, F b a) at MorePanic.hs:8:1-35 • In the first argument of ‘transitive’, namely ‘_’ In the expression: _ `transitive` trigger _ _ In an equation for ‘trigger’: trigger _ _ = _ `transitive` trigger _ _ • Relevant bindings include trigger :: a -> b -> (F a b, F b a) (bound at MorePanic.hs:9:1) | 9 | trigger _ _ = _ `transitive` trigger _ _ | ^ MorePanic.hs:9:15: warning: [-Wdeferred-type-errors] • Couldn't match type ‘F b a’ with ‘F b0 a0’ Expected type: (F a b, F b a) Actual type: (F a b, F b0 a0) NB: ‘F’ is a non-injective type family The type variables ‘b0’, ‘a0’ are ambiguous • In the expression: _ `transitive` trigger _ _ In an equation for ‘trigger’: trigger _ _ = _ `transitive` trigger _ _ • Relevant bindings include trigger :: a -> b -> (F a b, F b a) (bound at MorePanic.hs:9:1) | 9 | trigger _ _ = _ `transitive` trigger _ _ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ MorePanic.hs:9:38: warning: [-Wtyped-holes] • Found hole: _ :: a0 Where: ‘a0’ is an ambiguous type variable • In the first argument of ‘trigger’, namely ‘_’ In the second argument of ‘transitive’, namely ‘trigger _ _’ In the expression: _ `transitive` trigger _ _ • Relevant bindings include trigger :: a -> b -> (F a b, F b a) (bound at MorePanic.hs:9:1) | 9 | trigger _ _ = _ `transitive` trigger _ _ | ^ MorePanic.hs:9:40: warning: [-Wtyped-holes] • Found hole: _ :: b0 Where: ‘b0’ is an ambiguous type variable • In the second argument of ‘trigger’, namely ‘_’ In the second argument of ‘transitive’, namely ‘trigger _ _’ In the expression: _ `transitive` trigger _ _ • Relevant bindings include trigger :: a -> b -> (F a b, F b a) (bound at MorePanic.hs:9:1) | 9 | trigger _ _ = _ `transitive` trigger _ _ | ^ haskell $ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.6.0.20180810 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15368#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15368: Type families, holes and -fdefer-type-errors may cause 'opt_univ fell into
a hole' panic
-------------------------------------+-------------------------------------
Reporter: dramforever | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.8.1
Component: Compiler | Version: 8.4.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Compile-time | Test Case:
crash or panic | typecheck/should_compile/T15368
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Krzysztof Gogolewski

#15368: Type families, holes and -fdefer-type-errors may cause 'opt_univ fell into a hole' panic -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | typecheck/should_compile/T15368 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15368#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC