Commit ae66f356 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Allow typed holes to be levity-polymorphic

This one-line change fixes Trac #12531.  Hooray.

Simple, non-invasive; can merge to 8.0.2
parent 1083f453
......@@ -1658,16 +1658,16 @@ tc_infer_id lbl id_name
tcUnboundId :: UnboundVar -> ExpRhoType -> TcM (HsExpr TcId)
-- Typechedk an occurrence of an unbound Id
-- Typecheck an occurrence of an unbound Id
--
-- Some of these started life as a true hole "_". Others might simply
-- be variables that accidentally have no binding site
-- Some of these started life as a true expression hole "_".
-- Others might simply be variables that accidentally have no binding site
--
-- We turn all of them into HsVar, since HsUnboundVar can't contain an
-- Id; and indeed the evidence for the CHoleCan does bind it, so it's
-- not unbound any more!
tcUnboundId unbound res_ty
= do { ty <- newFlexiTyVarTy liftedTypeKind
= do { ty <- newOpenFlexiTyVarTy -- Allow Int# etc (Trac #12531)
; let occ = unboundVarOcc unbound
; name <- newSysName occ
; let ev = mkLocalId name ty
......
{-# LANGUAGE MagicHash #-}
module T12531 where
import GHC.Exts
f x = I# (_ +# x)
......@@ -65,3 +65,4 @@ test('T12033', normal, compile, [''])
test('T11339a', normal, compile, [''])
test('T11670', normal, compile, [''])
test('T12156', normal, compile_fail, ['-fdefer-typed-holes'])
test('T12531', normal, compile, ['-fdefer-typed-holes'])
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