Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
obsidiansystems
GHC
Commits
05e35414
Commit
05e35414
authored
Dec 26, 2015
by
eir@cis.upenn.edu
Browse files
Test #10619 in typecheck/should_fail/T10619
parent
b218241d
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/typecheck/should_fail/T10619.hs
0 → 100644
View file @
05e35414
{-# LANGUAGE RankNTypes #-}
module
T10619
where
-- tests that type checking doesn't care about order. all of these
-- should fail and be reported.
foo
_
=
if
True
then
((
\
x
->
x
)
::
(
forall
a
.
a
->
a
)
->
forall
b
.
b
->
b
)
else
\
y
->
y
bar
_
=
if
True
then
\
y
->
y
else
((
\
x
->
x
)
::
(
forall
a
.
a
->
a
)
->
forall
b
.
b
->
b
)
baz
True
=
(
\
x
->
x
)
::
(
forall
a
.
a
->
a
)
->
forall
b
.
b
->
b
baz
False
=
\
y
->
y
quux
False
=
\
y
->
y
quux
True
=
(
\
x
->
x
)
::
(
forall
a
.
a
->
a
)
->
forall
b
.
b
->
b
testsuite/tests/typecheck/should_fail/T10619.stderr
0 → 100644
View file @
05e35414
T10619.hs:9:15: error:
• Couldn't match type ‘forall a. a -> a’ with ‘b -> b’
Expected type: (b -> b) -> b -> b
Actual type: (forall a. a -> a) -> b -> b
• In the expression:
((\ x -> x) :: (forall a. a -> a) -> forall b. b -> b)
In the expression:
if True then
((\ x -> x) :: (forall a. a -> a) -> forall b. b -> b)
else
\ y -> y
In an equation for ‘foo’:
foo _
= if True then
((\ x -> x) :: (forall a. a -> a) -> forall b. b -> b)
else
\ y -> y
• Relevant bindings include
foo :: r -> (b -> b) -> b -> b (bound at T10619.hs:8:1)
T10619.hs:14:15: error:
• Couldn't match type ‘b’ with ‘a’
because type variable ‘a’ would escape its scope
This (rigid, skolem) type variable is bound by
a type expected by the context:
a -> a
at T10619.hs:14:15-65
Expected type: (b -> b) -> b -> b
Actual type: (forall a. a -> a) -> forall b. b -> b
• In the expression:
((\ x -> x) :: (forall a. a -> a) -> forall b. b -> b)
In the expression:
if True then
\ y -> y
else
((\ x -> x) :: (forall a. a -> a) -> forall b. b -> b)
In an equation for ‘bar’:
bar _
= if True then
\ y -> y
else
((\ x -> x) :: (forall a. a -> a) -> forall b. b -> b)
• Relevant bindings include
bar :: r -> (b -> b) -> b -> b (bound at T10619.hs:12:1)
T10619.hs:16:13: error:
• Couldn't match type ‘forall a. a -> a’ with ‘b -> b’
Expected type: (b -> b) -> b -> b
Actual type: (forall a. a -> a) -> b -> b
• In the expression:
(\ x -> x) :: (forall a. a -> a) -> forall b. b -> b
In an equation for ‘baz’:
baz True = (\ x -> x) :: (forall a. a -> a) -> forall b. b -> b
• Relevant bindings include
baz :: Bool -> (b -> b) -> b -> b (bound at T10619.hs:16:1)
T10619.hs:20:14: error:
• Couldn't match type ‘b’ with ‘a’
because type variable ‘a’ would escape its scope
This (rigid, skolem) type variable is bound by
a type expected by the context:
a -> a
at T10619.hs:20:14-64
Expected type: (b -> b) -> b -> b
Actual type: (forall a. a -> a) -> forall b. b -> b
• In the expression:
(\ x -> x) :: (forall a. a -> a) -> forall b. b -> b
In an equation for ‘quux’:
quux True = (\ x -> x) :: (forall a. a -> a) -> forall b. b -> b
• Relevant bindings include
quux :: Bool -> (b -> b) -> b -> b (bound at T10619.hs:19:1)
testsuite/tests/typecheck/should_fail/all.T
View file @
05e35414
...
...
@@ -397,3 +397,4 @@ test('CustomTypeErrors03', normal, compile_fail, [''])
test
('
T11112
',
normal
,
compile_fail
,
[''])
test
('
ClassOperator
',
normal
,
compile_fail
,
[''])
test
('
T11274
',
normal
,
compile_fail
,
[''])
test
('
T10619
',
normal
,
compile_fail
,
[''])
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