[GHC] #11663: GHC 8.0 behavior WRT scoped type variables changed
GHC
ghc-devs at haskell.org
Wed Mar 2 03:58:07 UTC 2016
#11663: GHC 8.0 behavior WRT scoped type variables changed
-------------------------------------+-------------------------------------
Reporter: bitemyapp | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 8.0.1
Component: Compiler | Version: 8.0.1-rc2
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
Not sure if this was intentional or not.
This compiles under GHC 8.0.0.20160221
{{{
module Main where
import Control.Exception
import System.IO
main =
writeFile "zzz" "hi"
`catch` (\(e :: SomeException) -> return ())
}}}
Run with an unwritable file named "zzz" in the directory, it ends without
complaint.
Run under GHC 7.10.3, it throws an error at compilation time:
{{{
code/printPls.hs:8:19:
Illegal type signature: ‘SomeException’
Perhaps you intended to use ScopedTypeVariables
In a pattern type-signature
}}}
Did something intentionally change to make this compile out of the box?
When I add:
{{{
{-# LANGUAGE ScopedTypeVariables #-}
}}}
Both versions compile. This distinction holds in GHCi as well.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11663>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list