[5.02] Bug with existentially-quantified constructors

Simon Peyton-Jones simonpj at microsoft.com
Mon Oct 22 07:46:01 EDT 2001


Thank you for reporting this.  It's my fault... 
when checking that the existential type variable doesn't
escape from the RHS of

	call (C f) a = f a

I just checked the *result type* of (f a), which is IO ().
Of course, I should check the *function* type (a -> IO ()),
from whence the tyvar does escape.

Incidentally, using -dcore-lint will often nail the bug well
before a seg fault.

Fix will be in 5.02.1

Simon

| -----Original Message-----
| From: Volker Stolz [mailto:vs at foldr.org] 
| Sent: 18 October 2001 16:45
| To: glasgow-haskell-bugs at haskell.org
| Cc: fhu at informatik.uni-kiel.de; Michael Weber
| Subject: [5.02] Bug with existentially-quantified constructors
| 
| 
| The following program can be compiled using
| ghc-5.02 --make test.lhs -fglasgow-exts
| but segfaults.
| 
| > ./a.out
| "foo"
| Segmentation fault
| 
| \begin{code}
| module Main where
| 
| import IO
| 
| data DS = forall a. C (a -> IO ())
| 
| main = do
|   let (li:st:[]) = [C (print :: String -> IO ()), C (print :: 
| Int -> IO ())]
|   call li "foo"
|   call st 3
| 
| call (C f) arg = do
|   f arg
| \end{code}
| -- 
| Volker Stolz * vs at foldr.org * PGP + S/MIME
| 
| _______________________________________________
| Glasgow-haskell-bugs mailing list 
| Glasgow-haskell-bugs at haskell.org 
| http://www.haskell.org/mailman/listinfo/glasgow-| haskell-bugs
| 




More information about the Glasgow-haskell-bugs mailing list