Commit 745c4c0e authored by Gergő Érdi's avatar Gergő Érdi
Browse files

Binding things matched by an unboxed pattern synonym should require a bang

parent 9b30d9de
......@@ -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, [''])
{-# 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
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, [''])
{-# 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
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
Supports Markdown
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