Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
47d5bce2
Commit
47d5bce2
authored
Sep 07, 2006
by
simonpj
Browse files
More changes for scoped type variables
parent
ac2d9213
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/typecheck/should_compile/all.T
View file @
47d5bce2
...
...
@@ -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
,
[''])
...
...
testsuite/tests/ghc-regress/typecheck/should_compile/tc105.hs
View file @
47d5bce2
{-# 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
let
g
::
ST
s
Int
-- (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
g
g
=
readSTRef
v
g
testsuite/tests/ghc-regress/typecheck/should_compile/tc141.stderr
View file @
47d5bce2
...
...
@@ -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'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment