From 80e363e77af6001acda87813c128362e746b8a4b Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 2 Sep 2002 16:31:34 +0000 Subject: [PATCH] [project @ 2002-09-02 16:31:34 by simonpj] Do not specialise functions that take implicit parameters. The specialisation mechanism doesn't work for them, because their implicit args are not driven by their type args (unlike the implicit dictionary parameters) MERGE TO STABLE --- ghc/compiler/specialise/Specialise.lhs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/specialise/Specialise.lhs b/ghc/compiler/specialise/Specialise.lhs index c9ffa0b..56aa638 100644 --- a/ghc/compiler/specialise/Specialise.lhs +++ b/ghc/compiler/specialise/Specialise.lhs @@ -11,7 +11,7 @@ module Specialise ( specProgram ) where import CmdLineOpts ( DynFlags, DynFlag(..) ) import Id ( Id, idName, idType, mkUserLocal, idSpecialisation, isDataConWrapId ) import TcType ( Type, mkTyVarTy, tcSplitSigmaTy, - tyVarsOfTypes, tyVarsOfTheta, + tyVarsOfTypes, tyVarsOfTheta, isClassPred, mkForAllTys, tcCmpType ) import Subst ( Subst, mkSubst, substTy, mkSubst, extendSubstList, mkInScopeSet, @@ -1003,6 +1003,10 @@ callDetailsToList calls = [ (id,tys,dicts) mkCallUDs subst f args | null theta + || not (all isClassPred theta) + -- Only specialise if all overloading is on class params. + -- In ptic, with implicit params, the type args + -- *don't* say what the value of the implicit param is! || not (spec_tys `lengthIs` n_tyvars) || not ( dicts `lengthIs` n_dicts) || maybeToBool (lookupRule (\act -> True) (substInScope subst) f args) -- 1.7.10.4