Commit 9dfd8cd7 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #6078

parent bb5447cb
{-# LANGUAGE BangPatterns #-}
module T6078 where
import GHC.Ptr
import Foreign
byteStringSlice len = \fpbuf ip0 ipe s0 ->
let ip1p@(Ptr ip1) = Ptr ip0 `plusPtr` len
-- Note that the panic goes away if we use a bang-pattern as follows
-- let !ip1p@(Ptr ip1) = Ptr ip0 `plusPtr` len
in ip1p
T6078.hs:8:10:
You can't mix polymorphic and unlifted bindings
ip1p@(Ptr ip1) = Ptr ip0 `plusPtr` len
Probable fix: use a bang pattern
In the expression:
let ip1p@(Ptr ip1) = Ptr ip0 `plusPtr` len in ip1p
In the expression:
\ fpbuf ip0 ipe s0 -> let ip1p@(Ptr ip1) = ... in ip1p
In an equation for `byteStringSlice':
byteStringSlice len = \ fpbuf ip0 ipe s0 -> let ... in ip1p
......@@ -276,3 +276,4 @@ test('T5957', normal, compile_fail, [''])
test('T6001', normal, compile_fail, [''])
test('T6022', expect_broken(6022), compile_fail, [''])
test('T5853', normal, compile_fail, [''])
test('T6078', 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