Commit 47d5bce2 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

More changes for scoped type variables

parent ac2d9213
......@@ -133,7 +133,10 @@ test('tc130', normal, compile, [''])
test('tc131', normal, compile, [''])
test('tc132', normal, compile, [''])
test('tc133', normal, compile, [''])
test('tc134', only_compiler_types(['ghc']), compile_fail, [''])
# tc134 tested result type signatures, which aren't supported any more
# test('tc134', only_compiler_types(['ghc']), compile_fail, [''])
test('tc135', only_compiler_types(['ghc']), compile, [''])
test('tc136', normal, compile, [''])
test('tc137', normal, compile, [''])
......
{-# OPTIONS -fglasgow-exts #-}
-- !!! Scoped type variables in result signatures
module ShouldCompile where
import Control.Monad.ST
import Data.STRef
-- The pattern type sig for f makes it monomorphic,
-- but the 's' scopes over the separate type signature
-- so that is monomorphic too.
f:: ST s Int
f:: ST s Int = do
v <- newSTRef 5
-- (Modified now that we don't have result type signatures)
f:: forall s. ST s Int
f = do v <- newSTRef 5
let g :: ST s Int
-- ^ should be in scope
g = readSTRef v
......
......@@ -2,3 +2,5 @@
tc141.hs:11:14: Not in scope: type variable `a'
tc141.hs:11:19: Not in scope: type variable `a'
tc141.hs:13:15: Not in scope: type variable `a'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment