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)