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, ['']) ...@@ -133,7 +133,10 @@ test('tc130', normal, compile, [''])
test('tc131', normal, compile, ['']) test('tc131', normal, compile, [''])
test('tc132', normal, compile, ['']) test('tc132', normal, compile, [''])
test('tc133', 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('tc135', only_compiler_types(['ghc']), compile, [''])
test('tc136', normal, compile, ['']) test('tc136', normal, compile, [''])
test('tc137', normal, compile, ['']) test('tc137', normal, compile, [''])
......
{-# OPTIONS -fglasgow-exts #-} {-# OPTIONS -fglasgow-exts #-}
-- !!! Scoped type variables in result signatures
module ShouldCompile where module ShouldCompile where
import Control.Monad.ST import Control.Monad.ST
import Data.STRef import Data.STRef
-- The pattern type sig for f makes it monomorphic, -- (Modified now that we don't have result type signatures)
-- but the 's' scopes over the separate type signature
-- so that is monomorphic too. f:: forall s. ST s Int
f:: ST s Int f = do v <- newSTRef 5
f:: ST s Int = do let g :: ST s Int
v <- newSTRef 5
let g :: ST s Int
-- ^ should be in scope -- ^ should be in scope
g = readSTRef v g = readSTRef v
g g
...@@ -2,3 +2,5 @@ ...@@ -2,3 +2,5 @@
tc141.hs:11:14: Not in scope: type variable `a' tc141.hs:11:14: Not in scope: type variable `a'
tc141.hs:11:19: 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