Commit 6f362e31 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #5573

parent 1d81b324
{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-}
module T5573a where
import GHC.Exts
-- This is ok
foo1 x = (# x,x #)
bar y = let (# x, _ #) = foo1 y in x
-- Nested unboxed tuple not ok
foo2 x = (# x, (# True, False #) #)
-- Unboxed tuple argument not ok
foo3 (# x,y #) = x
T5573a.hs:11:16:
Kind incompatibility when matching types:
t0 :: ??
(# Bool, Bool #) :: (#)
In the expression: (# True, False #)
In the expression: (# x, (# True, False #) #)
In an equation for `foo2': foo2 x = (# x, (# True, False #) #)
T5573a.hs:14:6:
Kind incompatibility when matching types:
t0 :: ??
(# t1, t2 #) :: (#)
In the pattern: (# x, y #)
In an equation for `foo3': foo3 (# x, y #) = x
{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-}
module T5573b where
import GHC.Exts
foo :: Double# -> (# (# Double#, Double# #), Double# #)
foo x = (# (# x, x #), x #)
T5573b.hs:6:22:
Kind mis-match
The first argument of an unboxed tuple should have kind `??',
but `(# Double#, Double# #)' has kind `(#)'
In the type signature for `foo':
foo :: Double# -> (# (# Double#, Double# #), Double# #)
......@@ -264,3 +264,5 @@ test('AssocTyDef08', normal, compile_fail, [''])
test('AssocTyDef09', normal, compile_fail, [''])
test('T3592', normal, compile_fail, [''])
test('T5570', normal, compile_fail, [''])
test('T5573a', normal, compile_fail, [''])
test('T5573b', normal, compile_fail, [''])
Markdown is supported
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