
#13594: Typechecker behavior w.r.t. BangPatterns and nested foralls has changed in 8.2 -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: bgamari Type: bug | Status: merge Priority: high | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.2.1-rc2 checker) | Keywords: BangPatterns, Resolution: | RankNTypes Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3525 Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Erm, the commit in 372995364c52eef15066132d7d1ea8b6760034e6 doesn't actually fix either of the programs I reported, does it? I get the same errors on a recent GHC HEAD build: {{{ $ inplace/bin/ghc-stage2 --interactive GHCi, version 8.3.20170511: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci λ> :set -XBangPatterns -XRankNTypes -XTypeFamilies λ> let x :: forall a . a ~ Integer => forall b. b ~ Integer => (a, b); !x = (1, 2) <interactive>:2:74: error: • Couldn't match expected type ‘forall b. b ~ Integer => (a, b)’ with actual type ‘(Integer, Integer)’ • In the expression: (1, 2) In a pattern binding: !x = (1, 2) • Relevant bindings include x :: forall b. b ~ Integer => (a, b) (bound at <interactive>:2:70) }}} {{{ $ inplace/bin/ghc-stage2 ../Bug.hs [1 of 1] Compiling Bug ( ../Bug.hs, ../Bug.o ) ../Bug.hs:6:1: error: Overloaded signature conflicts with monomorphism restriction x :: forall a. a ~ Integer => forall b. b ~ Integer => (a, b) | 6 | x :: forall a . a ~ Integer => forall b. b ~ Integer => (a, b) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13594#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler