Commit 8c9b8a31 authored by Matthew Pickering's avatar Matthew Pickering
Browse files

Allow unlifted types in pattern synonym result type

Fixes #12094

Test Plan: ./validate

Reviewers: austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2255

GHC Trac Issues: #12094
parent 2230c882
......@@ -113,7 +113,9 @@ tcPatSynSig name sig_ty
do { req <- tcHsContext hs_req
; prov <- tcHsContext hs_prov
; arg_tys <- mapM tcHsOpenType (hs_arg_tys :: [LHsType Name])
; body_ty <- tcHsLiftedType hs_body_ty
-- A (literal) pattern can be unlifted;
-- -- e.g. pattern Zero <- 0# (Trac #12094)
; body_ty <- tcHsOpenType hs_body_ty
; let bound_tvs
= unionVarSets [ allBoundVariabless req
, allBoundVariabless prov
......
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE PatternSynonyms #-}
module T12094 where
import GHC.Exts (Int#)
pattern Zero :: Int# -- commenting out this line works
pattern Zero <- 0#
......@@ -52,4 +52,5 @@ test('T11336', normal, compile, [''])
test('T11367', normal, compile, [''])
test('T11351', normal, compile, [''])
test('T11633', normal, compile, [''])
test('T11959', expect_broken(11959), multimod_compile, ['T11959', '-v0'])
\ No newline at end of file
test('T11959', expect_broken(11959), multimod_compile, ['T11959', '-v0'])
test('T12094', normal, compile, [''])
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