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
5e8ff849
Commit
5e8ff849
authored
Jul 17, 2009
by
batterseapower
Browse files
Tests for basic TupleSections
parent
059783d1
Changes
11
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/rename/should_fail/all.T
View file @
5e8ff849
...
...
@@ -65,6 +65,7 @@ test('rnfail055',
'
RnFail055_aux.hi
',
'
RnFail055_aux.o
']),
multimod_compile_fail
,
['
RnFail055
','
-v0
'])
test
('
rnfail056
',
if_compiler_lt
('
ghc
',
'
6.11
',
expect_fail
),
compile_fail
,
[''])
test
('
rn_dup
',
normal
,
compile_fail
,
[''])
test
('
T2310
',
normal
,
compile_fail
,
[''])
...
...
testsuite/tests/ghc-regress/rename/should_fail/rnfail056.hs
0 → 100644
View file @
5e8ff849
-- TupleSections not enabled
module
Foo
where
foo
=
(
1
,)
testsuite/tests/ghc-regress/rename/should_fail/rnfail056.stderr
0 → 100644
View file @
5e8ff849
rnfail056.hs:5:6: Illegal tuple section: use -XTupleSections
testsuite/tests/ghc-regress/typecheck/should_fail/all.T
View file @
5e8ff849
...
...
@@ -200,6 +200,7 @@ test('tcfail201', normal, compile_fail, [''])
test
('
tcfail202
',
normal
,
compile_fail
,
[''])
test
('
tcfail203
',
expect_broken
(
2806
),
compile_fail
,
[''])
test
('
tcfail204
',
normal
,
compile_fail
,
[''])
test
('
tcfail206
',
if_compiler_lt
('
ghc
',
'
6.11
',
expect_fail
),
compile_fail
,
[''])
test
('
T1899
',
normal
,
compile_fail
,
[''])
test
('
T2126
',
normal
,
compile_fail
,
[''])
...
...
testsuite/tests/ghc-regress/typecheck/should_fail/tcfail206.hs
0 → 100644
View file @
5e8ff849
{-# LANGUAGE TupleSections #-}
module
Main
where
a
::
Bool
->
(
Int
,
Bool
)
a
=
(
,
True
)
b
::
Int
->
Bool
->
(
Int
,
Bool
)
b
=
(
1
,
)
c
::
a
->
(
a
,
Bool
)
c
=
(
True
||
False
,
)
main
=
return
()
\ No newline at end of file
testsuite/tests/ghc-regress/typecheck/should_fail/tcfail206.stderr
0 → 100644
View file @
5e8ff849
tcfail206.hs:5:4:
Couldn't match expected type `Int' against inferred type `Bool'
Expected type: Bool -> (Int, Bool)
Inferred type: Bool -> (Bool, Bool)
In the expression: (, True)
In the definition of `a': a = (, True)
tcfail206.hs:8:4:
Couldn't match expected type `Bool -> (Int, Bool)'
against inferred type `(t, Int)'
Expected type: Int -> Bool -> (Int, Bool)
Inferred type: Int -> (t, Int)
In the expression: (1,)
In the definition of `b': b = (1,)
tcfail206.hs:11:4:
Couldn't match expected type `a' against inferred type `Bool'
`a' is a rigid type variable bound by
the type signature for `c' at tcfail206.hs:10:5
Expected type: a -> (a, Bool)
Inferred type: a -> (Bool, a)
In the expression: (True || False,)
In the definition of `c': c = (True || False,)
testsuite/tests/ghc-regress/typecheck/should_run/all.T
View file @
5e8ff849
...
...
@@ -64,6 +64,8 @@ test('tcrun038',
test
('
tcrun039
',
only_compiler_types
(['
ghc
']),
compile_and_run
,
[''])
test
('
tcrun040
',
normal
,
compile_and_run
,
[''])
test
('
tcrun041
',
if_compiler_lt
('
ghc
',
'
6.11
',
expect_fail
),
compile_and_run
,
[''])
test
('
tcrun042
',
if_compiler_lt
('
ghc
',
'
6.11
',
expect_fail
),
compile_and_run
,
[''])
test
('
church
',
normal
,
compile_and_run
,
[''])
test
('
testeq2
',
normal
,
compile_and_run
,
[''])
...
...
testsuite/tests/ghc-regress/typecheck/should_run/tcrun041.hs
0 → 100644
View file @
5e8ff849
{-# LANGUAGE TupleSections #-}
module
Main
where
a
::
Int
->
(
Int
,
Bool
)
a
=
(
,
True
)
b
::
Bool
->
(
Int
,
Bool
)
b
=
(
1
,
)
c
::
a
->
(
a
,
Bool
)
c
=
(,
True
||
False
)
d
=
(,
1
,)
main
=
print
(
a
1
,
b
False
,
c
"Hello"
,
c
1337
,
d
"Yeah"
"Baby"
)
\ No newline at end of file
testsuite/tests/ghc-regress/typecheck/should_run/tcrun041.stdout
0 → 100644
View file @
5e8ff849
((1,True),(1,False),("Hello",True),(1337,True),("Yeah",1,"Baby"))
testsuite/tests/ghc-regress/typecheck/should_run/tcrun042.hs
0 → 100644
View file @
5e8ff849
{-# LANGUAGE TupleSections, RankNTypes, ImpredicativeTypes #-}
module
Main
where
e
::
a
->
(
forall
b
.
b
->
b
->
b
)
->
(
a
,
String
,
forall
c
.
c
->
c
->
c
)
e
=
(,
"Hello"
++
"World"
,)
dropFunction
::
(
a
,
String
,
forall
c
.
c
->
c
->
c
)
->
(
a
,
String
,
Int
)
dropFunction
(
x
,
y
,
z
)
=
(
x
,
y
,
z
10
20
)
main
=
print
(
dropFunction
$
e
"Meh"
(
flip
const
),
dropFunction
$
e
10
const
)
\ No newline at end of file
testsuite/tests/ghc-regress/typecheck/should_run/tcrun042.stdout
0 → 100644
View file @
5e8ff849
(("Meh","HelloWorld",20),(10,"HelloWorld",10))
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