Opened 7 years ago

Closed 7 years ago

Last modified 3 years 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 7 years ago by andresSR

Cc: andres.sicard.ramirez@… added

comment:2 Changed 7 years ago by simonpj

Resolution: fixed
Status: newclosed
Test Case: 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 3 years ago by asr

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