Ticket #4284 (closed bug: fixed)

Opened 18 months ago

Last modified 17 months ago

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, andres.sicard.ramirez@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Difficulty:
Test Case: typecheck/should_compile/T4284 Blocked By:
Blocking: Related Tickets:

Description

{-# 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

Changed 18 months ago by andresSR

  • cc andres.sicard.ramirez@… added

Changed 17 months ago by simonpj

  • status changed from new to closed
  • testcase set to typecheck/should_compile/T4284
  • resolution set to fixed

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.

Simon

Note: See TracTickets for help on using tickets.