From 1e373c7b6e868da05b39fcf6f1266a4d1a1b10b5 Mon Sep 17 00:00:00 2001 From: ncave <777696+ncave@users.noreply.github.com> Date: Fri, 2 Feb 2018 05:12:22 -0800 Subject: [PATCH] more targeted replacements --- src/fsharp/symbols/Exprs.fs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index 9106cc3d792..5a39e3c8491 100644 --- a/src/fsharp/symbols/Exprs.fs +++ b/src/fsharp/symbols/Exprs.fs @@ -617,12 +617,14 @@ module FSharpExprConvert = ConvExprPrim cenv env op | TOp.ILAsm ([ I_call (Normalcall, mspec, None) ], _), _, [arg] - when mspec.Name = "GetHashCode" -> + when mspec.MethodRef.EnclosingTypeRef.Name = "System.String" && mspec.Name = "GetHashCode" -> let ty = tyOfExpr cenv.g arg let op = mkCallHash cenv.g m ty arg ConvExprPrim cenv env op - | TOp.ILAsm([ I_ldtoken (ILToken.ILType _ilty) ], _), [ty], _ -> + | TOp.ILCall(_, _, _, _, _, _, _, mref, _, _, _), [], + [Expr.Op(TOp.ILAsm([ I_ldtoken (ILToken.ILType _) ], _), [ty], _, _)] + when mref.EnclosingTypeRef.Name = "System.Type" && mref.Name = "GetTypeFromHandle" -> let op = mkCallTypeOf cenv.g m ty ConvExprPrim cenv env op @@ -754,10 +756,6 @@ module FSharpExprConvert = else lim1 E.FastIntegerForLoop(ConvExpr cenv env lim0, ConvExpr cenv env lim1, ConvExpr cenv env body, dir <> FSharpForLoopDown) - | TOp.ILCall(_, _, _, _isNewObj, _valUseFlags, _isProp, _, ilMethRef, _enclTypeArgs, _methTypeArgs, _tys), [], [arg] - when ilMethRef.EnclosingTypeRef.Name = "System.Type" && ilMethRef.Name = "GetTypeFromHandle" -> - ConvExprPrim cenv env arg - | TOp.ILCall(_, _, _, isNewObj, valUseFlags, _isProp, _, ilMethRef, enclTypeArgs, methTypeArgs, _tys), [], callArgs -> ConvILCall cenv env (isNewObj, valUseFlags, ilMethRef, enclTypeArgs, methTypeArgs, callArgs, m)