Opened 9 years ago

Closed 9 years ago

Last modified 44 years ago

#392 closed bug (Fixed)

forall in pattern type sig has changed from 6.2.2

Reported by: mtullsen Owned by: nobody
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 6.4
Keywords: Cc:
Operating System: Architecture:
Type of failure: Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

------ The program (straight from documentation :-) ------
$ cat Test.hs

test = \(f :: forall a. a -> a) -> (f True,f 'a')

------ Works fine under 6.2.2 ------
tests $ ghci-6.2.2 -fglasgow-exts Test.hs
...
Compiling Test             ( Test.hs, interpreted )
Ok, modules loaded: Test.

------ Doesn't typecheck under 6.4 ------
$ ghci-6.4 -fglasgow-exts Test.hs
...
Compiling Test             ( Test.hs, interpreted )

Test.hs:3:9:
    Inferred type is less polymorphic than expected
      Quantified type variable `a' is mentioned in the environment:
        test :: (a -> a) -> t (bound at Test.hs:3:0)
      Expected type: forall a1. a1 -> a1
      Inferred type: a -> a
    In a lambda abstraction: \ (f :: forall a. a -> a) -> (f True, f 'a')
    In the definition of `test': test = \ (f :: forall a. a -> a) -> (f True, f 
'a')
...

Change History (1)

comment:1 Changed 9 years ago by simonpj

  • Status changed from assigned to closed
Logged In: YES 
user_id=50165

Ah yes.  Thank you.  In a cleanup of TcBInds I failed to take 
account of this case; the old code did it fine.

Fixed now. tc194 is the test case
Note: See TracTickets for help on using tickets.