Opened 5 years ago

Closed 5 years ago

Last modified 13 months ago

#4284 closed bug (fixed)

Adding parentheses introduces type error

Reported by: jpbernardy Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 6.12.3
Keywords: higher-rank polymorphism Cc: nad, asr
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Test Case: typecheck/should_compile/T4284
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


{-# LANGUAGE RankNTypes #-}

module Test where

foo :: () -> forall b. b
foo = undefined

works = id foo

fails = (id) foo

-- works type checks, but fails fails with the following error
-- message:
--   Cannot match a monotype with `() -> forall b. b'
--   Probable cause: `foo' is applied to too few arguments
--   In the first argument of `(id)', namely `foo'
--   In the expression: (id) foo

Change History (3)

comment:1 Changed 5 years ago by andresSR

  • Cc andres.sicard.ramirez@… added

comment:2 Changed 5 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to typecheck/should_compile/T4284

Good point, thank you. Works in the new typechecker, which is about to become HEAD, so I'll close this. Added a regression test though.


comment:3 Changed 13 months ago by asr

  • Cc asr added; andres.sicard.ramirez@… removed
  • difficulty set to Unknown
Note: See TracTickets for help on using tickets.