You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| None -> MethInfo.CreateILMeth(amap, m, origTy, mdef)
2871
-
| Some ilActualTypeRef ->
2872
-
letactualTyconRef= Import.ImportILTypeRef amap m ilActualTypeRef
2873
-
MethInfo.CreateILExtensionMeth(amap, m, origTy, actualTyconRef, None, mdef)
2874
-
Choice1Of5 (ilMethInfo, minst)
2875
-
| FSMethSln(ty, vref, minst)->
2876
-
Choice1Of5 (FSMeth(g, ty, vref, None), minst)
2877
-
| FSRecdFieldSln(tinst, rfref, isSetProp)->
2878
-
Choice2Of5 (tinst, rfref, isSetProp)
2879
-
| FSAnonRecdFieldSln(anonInfo, tinst, i)->
2880
-
Choice3Of5 (anonInfo, tinst, i)
2881
-
| BuiltInSln ->
2882
-
Choice5Of5 ()
2883
-
| ClosedExprSln expr ->
2884
-
Choice4Of5 expr
2885
-
return!
2886
-
match sln with
2887
-
| Choice1Of5(minfo, methArgTys)->
2888
-
letargExprs=
2889
-
// FIX for #421894 - typechecker assumes that coercion can be applied for the trait calls arguments but codegen doesn't emit coercion operations
2890
-
// result - generation of non-verifiable code
2891
-
// fix - apply coercion for the arguments (excluding 'receiver' argument in instance calls)
2892
-
2893
-
// flatten list of argument types (looks like trait calls with curried arguments are not supported so we can just convert argument list in straightforward way)
2894
-
letargTypes=
2895
-
minfo.GetParamTypes(amap, m, methArgTys)
2896
-
|> List.concat
2897
-
// do not apply coercion to the 'receiver' argument
2898
-
letreceiverArgOpt,argExprs =
2899
-
if minfo.IsInstance then
2900
-
match argExprs with
2901
-
| h :: t -> Some h, t
2902
-
| argExprs -> None, argExprs
2903
-
else None, argExprs
2904
-
letconvertedArgs=(argExprs, argTypes)||> List.map2 (fun expr expectedTy -> mkCoerceIfNeeded g expectedTy (tyOfExpr g expr) expr)
2905
-
match receiverArgOpt with
2906
-
| Some r -> r :: convertedArgs
2907
-
| None -> convertedArgs
2908
-
2909
-
// Fix bug 1281: If we resolve to an instance method on a struct and we haven't yet taken
2910
-
// the address of the object then go do that
2911
-
if minfo.IsStruct && minfo.IsInstance &&(match argExprs with[]->false| h ::_->not(isByrefTy g (tyOfExpr g h)))then
2912
-
leth,t = List.headAndTail argExprs
2913
-
letwrap,h',_readonly,_writeonly = mkExprAddrOfExpr g truefalse PossiblyMutates h None m
0 commit comments