Skip to content
GitLab
Menu
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
745c4c0e
Commit
745c4c0e
authored
Nov 08, 2014
by
Gergő Érdi
Browse files
Binding things matched by an unboxed pattern synonym should require a bang
parent
9b30d9de
Changes
5
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/patsyn/should_compile/all.T
View file @
745c4c0e
...
...
@@ -10,3 +10,4 @@ test('incomplete', normal, compile, [''])
test
('
export
',
normal
,
compile
,
[''])
test
('
T8966
',
normal
,
compile
,
[''])
test
('
T9023
',
normal
,
compile
,
[''])
test
('
unboxed-bind-bang
',
normal
,
compile
,
[''])
testsuite/tests/patsyn/should_compile/unboxed-bind-bang.hs
0 → 100644
View file @
745c4c0e
{-# LANGUAGE PatternSynonyms, MagicHash, BangPatterns #-}
module
ShouldCompile
where
import
GHC.Base
data
Foo
=
MkFoo
Int
#
Int
#
pattern
P
x
=
MkFoo
0
#
x
f
x
=
let
!
(
P
arg
)
=
x
in
arg
testsuite/tests/patsyn/should_fail/all.T
View file @
745c4c0e
test
('
mono
',
normal
,
compile_fail
,
[''])
test
('
unidir
',
normal
,
compile_fail
,
[''])
test
('
local
',
normal
,
compile_fail
,
[''])
...
...
@@ -8,3 +7,4 @@ test('T9161-1', normal, compile_fail, [''])
test
('
T9161-2
',
normal
,
compile_fail
,
[''])
test
('
T9705-1
',
normal
,
compile_fail
,
[''])
test
('
T9705-2
',
normal
,
compile_fail
,
[''])
test
('
unboxed-bind
',
normal
,
compile_fail
,
[''])
testsuite/tests/patsyn/should_fail/unboxed-bind.hs
0 → 100644
View file @
745c4c0e
{-# LANGUAGE PatternSynonyms, MagicHash #-}
module
ShouldFail
where
import
GHC.Base
data
Foo
=
MkFoo
Int
#
Int
#
pattern
P
x
=
MkFoo
0
#
x
f
x
=
let
P
arg
=
x
in
arg
testsuite/tests/patsyn/should_fail/unboxed-bind.stderr
0 → 100644
View file @
745c4c0e
unboxed-bind.hs:10:11:
Pattern bindings containing unlifted types should use an outermost bang pattern:
P arg = x
In the expression: let P arg = x in arg
In an equation for ‘f’: f x = let P arg = x in arg
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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