Commit e7c3878d authored by Simon Peyton Jones's avatar Simon Peyton Jones

Move zonkWC to the right place in simplfyInfer

runTcSWithEvBinds does some unification, so the zonkWC
must be after, not before!  Yikes.  An outright bug.

This fixes Trac #14715.
parent 47031db4
......@@ -649,9 +649,7 @@ simplifyInfer rhs_tclvl infer_mode sigs name_taus wanteds
psig_givens = mkGivens loc psig_theta_vars
; _ <- solveSimpleGivens psig_givens
-- See Note [Add signature contexts as givens]
; wanteds' <- solveWanteds wanteds
; TcS.zonkWC wanteds' }
; solveWanteds wanteds }
-- Find quant_pred_candidates, the predicates that
-- we'll consider quantifying over
......@@ -659,6 +657,7 @@ simplifyInfer rhs_tclvl infer_mode sigs name_taus wanteds
-- the psig_theta; it's just the extra bit
-- NB2: We do not do any defaulting when inferring a type, this can lead
-- to less polymorphic types, see Note [Default while Inferring]
; wanted_transformed_incl_derivs <- TcM.zonkWC wanted_transformed_incl_derivs
; let definite_error = insolubleWC wanted_transformed_incl_derivs
-- See Note [Quantification with errors]
-- NB: must include derived errors in this test,
......
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
module T14715 (bench_mulPublic) where
data Cyc r
data CT zp r'q
class Reduce a b
type family LiftOf b
bench_mulPublic :: forall z zp zq . (z ~ LiftOf zq, _) => Cyc zp -> Cyc z -> IO (zp,zq)
bench_mulPublic pt sk = do
ct :: CT zp (Cyc zq) <- encrypt sk pt
undefined ct
encrypt :: forall z zp zq. Reduce z zq => Cyc z -> Cyc zp -> IO (CT zp (Cyc zq))
encrypt = undefined
......@@ -73,4 +73,5 @@ test('T13482', normal, compile, [''])
test('T14217', normal, compile_fail, [''])
test('T14643', normal, compile, [''])
test('T14643a', normal, compile, [''])
test('T14715', 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