[GHC] #14568: Uncurried Parameter to n-ary Function in Type Signature Causes Crash

#14568: Uncurried Parameter to n-ary Function in Type Signature Causes Crash -------------------------------------+------------------------------------- Reporter: nixy | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 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: -------------------------------------+------------------------------------- If you uncomment the arrow, everything's fine; GHC crashes as-is. {{{#!hs f :: (a -> b) {- -> -} a -> c f = undefined }}} Apparently GHC incorrectly parses any n-ary function parameter followed by another uncurried parameter in type signatures. System Info: GHC v8.2.1 GCC v5.4.0 Linux Mint (Linux 4.8.0-53-generic #56~16.04.1-Ubuntu SMP x86_64) ghc -v -dcore-lint: {{{ Glasgow Haskell Compiler, Version 8.2.1, stage 2 booted by GHC version 8.0.2 Using binary package database: /usr/local/haskell/ghc-8.2.1-x86_64/lib/ghc-8.2.1/package.conf.d/package.cache Using binary package database: /home/nic/.ghc/x86_64-linux-8.2.1/package.conf.d/package.cache package flags [] loading package database /usr/local/haskell/ghc-8.2.1-x86_64/lib/ghc-8.2.1/package.conf.d loading package database /home/nic/.ghc/x86_64-linux-8.2.1/package.conf.d wired-in package ghc-prim mapped to ghc-prim-0.5.1.0 wired-in package integer-gmp mapped to integer-gmp-1.0.1.0 wired-in package base mapped to base-4.10.0.0 wired-in package rts mapped to rts wired-in package template-haskell mapped to template-haskell-2.12.0.0 wired-in package ghc mapped to ghc-8.2.1 wired-in package dph-seq not found. wired-in package dph-par not found. package flags [] loading package database /usr/local/haskell/ghc-8.2.1-x86_64/lib/ghc-8.2.1/package.conf.d loading package database /home/nic/.ghc/x86_64-linux-8.2.1/package.conf.d wired-in package ghc-prim mapped to ghc-prim-0.5.1.0 wired-in package integer-gmp mapped to integer-gmp-1.0.1.0 wired-in package base mapped to base-4.10.0.0 wired-in package rts mapped to rts-1.0 wired-in package template-haskell mapped to template-haskell-2.12.0.0 wired-in package ghc mapped to ghc-8.2.1 wired-in package dph-seq not found. wired-in package dph-par not found. *** Chasing dependencies: Chasing modules from: *bug.hs !!! Chasing dependencies: finished in 1.14 milliseconds, allocated 0.207 megabytes Stable obj: [] Stable BCO: [] Ready for upsweep [NONREC ModSummary { ms_hs_date = 2017-12-08 23:11:58.321654412 UTC ms_mod = Main, ms_textual_imps = [(Nothing, Prelude)] ms_srcimps = [] }] *** Deleting temp files: Deleting: compile: input file bug.hs *** Checking old interface for Main (use -ddump-hi-diffs for more details): [1 of 1] Compiling Main ( bug.hs, bug.o ) *** Parser [Main]: !!! Parser [Main]: finished in 0.13 milliseconds, allocated 0.090 megabytes *** Renamer/typechecker [Main]: *** Deleting temp files: Deleting: *** Deleting temp dirs: Deleting: ghc: panic! (the 'impossible' happened) (GHC version 8.2.1 for x86_64-unknown-linux): repSplitAppTys a_anL[sk:1] b_anM[sk:1] [] Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14568 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14568: Uncurried Parameter to n-ary Function in Type Signature Causes Crash -------------------------------------+------------------------------------- Reporter: nixy | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: fixed | 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 simonpj): * status: new => closed * resolution: => fixed Comment: Thanks for reporting this. A quick search for `repSplitAppTys` sugggests that this is a dup of #13819 and a number of other similar ones. Happily it's fixed in 8.2.2 and HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14568#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC