Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitafe5027

Browse files
dsymelatkin
authored andcommitted
Allow static arguments to Type Provider methods
http://fslang.uservoice.com/forums/245727-f-language/suggestions/6097685-allow-static-arguments-to-type-provider-methods-ecommit 44277d4ebd7fb4afa3a995450d355d1b0b3f901bAuthor: latkin <latkin@microsoft.com>Date: Tue Nov 11 12:35:25 2014 -0800 Updating surface area tests with ITypeProvider2 interfacecommit 4b70dd0366d3994d9c2d2224944abf9644edbdd4Merge: de9bb86 c57072aAuthor: latkin <latkin@microsoft.com>Date: Tue Nov 11 06:10:44 2014 -0800 Merge branch 'staticparams3' ofhttps://git01.codeplex.com/forks/dsyme/cleanup into static Conflicts: src/fsharp/FSComp.txtcommit c57072aa46ddb644ad894b4c301dbac8e6ec3ba1Author: Don Syme <dsyme@microsoft.com>Date: Tue Nov 11 13:23:55 2014 +0000 remove unnecessary error messagecommit adb3e2353a0de40ea47218b87e8f8e78b8d1773eMerge: 36fff74c76f1ecAuthor: Don Syme <dsyme@microsoft.com>Date: Tue Nov 11 13:08:29 2014 +0000 Merge branch 'fsharp4' ofhttps://git01.codeplex.com/visualfsharp into staticparams3, Conflicts: src/fsharp/FSComp.txt, src/fsharp/tc.fscommit de9bb86efb9f6a3453f063068ebb218aa971a8b4Author: latkin <latkin@microsoft.com>Date: Mon Nov 10 16:57:28 2014 -0800 Adding missing #if EXTENSIONTYPINGcommit 87db4d3e4f2139a6efdad261069c327e498e8bcbAuthor: latkin <latkin@microsoft.com>Date: Sun Nov 9 19:24:15 2014 -0800 Reverting change to test labelscommit 1ad19a9a3df49602ac43b312635298b23acc2a1fMerge:c76f1ec 36fff74Author: latkin <latkin@microsoft.com>Date: Sun Nov 9 19:04:15 2014 -0800 Merge branch 'staticparams3' ofhttps://git01.codeplex.com/forks/dsyme/cleanup into static Conflicts: src/fsharp/FSComp.txt src/fsharp/tc.fscommit 36fff74c8b7ff06993f5fe20f112e5f4f1697d54Author: Don Syme <dsyme@microsoft.com>Date: Wed Oct 29 19:45:12 2014 +0000 reapply error mesage for nested typescommit 465846189661a4f1cfc416d2661678b0d9fb5b6bAuthor: Don Syme <dsyme@microsoft.com>Date: Wed Oct 29 19:43:49 2014 +0000 reapply error mesage for nested typescommit a0cdb8b66bbed75b3befd77b5a5f1f0d8eb95025Author: Don Syme <dsyme@microsoft.com>Date: Wed Oct 29 16:20:00 2014 +0000 update test.lstcommit d80c744e7577aeceae911b7601b8cf827490bdccAuthor: Don Syme <dsyme@microsoft.com>Date: Wed Oct 29 15:00:12 2014 +0000 Add extensive testing for methods taking static argscommit fa81aecdc850265f4029a0b8b5a4bf869b7b587bAuthor: Don Syme <dsyme@microsoft.com>Date: Tue Jul 29 19:18:36 2014 +0200 updates to let proto compiler buildcommit 8c873c2bfb3d208e1498dd2360ebc148884ec5a4Author: Don Syme <dsyme@microsoft.com>Date: Tue Jul 29 18:38:45 2014 +0200 Initial cut at static parameters for provided methods
1 parentc76f1ec commitafe5027

File tree

14 files changed

+483
-59
lines changed

14 files changed

+483
-59
lines changed

‎src/fsharp/FSComp.txt‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,14 +1201,15 @@ fscTooManyErrors,"Exiting - too many errors"
12011201
3044,etNestedProvidedTypesDoNotTakeStaticArgumentsOrGenericParameters,"Nested provided types do not take static arguments or generic parameters"
12021202
3045,etInvalidStaticArgument,"Invalid static argument to provided type. Expected an argument of kind '%s'."
12031203
3046,etErrorApplyingStaticArgumentsToType,"An error occured applying the static arguments to a provided type"
1204-
3047,etUnknownStaticArgumentKind,"Unknown static argument kind '%s' when resolving a reference to a provided type '%s'"
1204+
3047,etUnknownStaticArgumentKind,"Unknown static argument kind '%s' when resolving a reference to a provided typeor method'%s'"
12051205
invalidNamespaceForProvidedType,"invalid namespace for provided type"
12061206
invalidFullNameForProvidedType,"invalid full name for provided type"
12071207
#3050,etGenerateAttributeRequiresInternal,"The 'Generate' attribute must be used with a type definition with 'internal' visibility"
12081208
3051,etProviderReturnedNull,"The type provider returned 'null', which is not a valid return value from '%s'"
12091209
3053,etTypeProviderConstructorException,"The type provider constructor has thrown an exception: %s"
12101210
3056,etNullProvidedExpression,"Type provider '%s' returned null from GetInvokerExpression."
12111211
3057,etProvidedAppliedTypeHadWrongName,"The type provider '%s' returned an invalid type from 'ApplyStaticArguments'. A type with name '%s' was expected, but a type with name '%s' was returned."
1212+
3058,etProvidedAppliedMethodHadWrongName,"The type provider '%s' returned an invalid method from 'ApplyStaticArgumentsForMethod'. A method with name '%s' was expected, but a method with name '%s' was returned."
12121213
3060,tcTypeTestLossy,"This type test or downcast will erase the provided type '%s' to the type '%s'"
12131214
3061,tcTypeCastErased,"This downcast will erase the provided type '%s' to the type '%s'."
12141215
3062,tcTypeTestErased,"This type test with a provided type '%s' is not allowed because this provided type will be erased to '%s' at runtime."
@@ -1225,7 +1226,7 @@ invalidFullNameForProvidedType,"invalid full name for provided type"
12251226
3077,tcJoinMustUseSimplePattern,"In queries, '%s' must use a simple pattern"
12261227
3078,tcMissingCustomOperation,"A custom query operation for '%s' is required but not specified"
12271228
3080,etBadUnnamedStaticArgs,"Named static arguments must come after all unnamed static arguments"
1228-
3081,etStaticParameterRequiresAValue,"The static parameter '%s' of the provided type '%s' requires a value. Static parameters to type providers may be optionally specified using named arguments, e.g. '%s<%s=...>'."
1229+
3081,etStaticParameterRequiresAValue,"The static parameter '%s' of the provided typeor method'%s' requires a value. Static parameters to type providers may be optionally specified using named arguments, e.g. '%s<%s=...>'."
12291230
3082,etNoStaticParameterWithName,"No static parameter exists with name '%s'"
12301231
3083,etStaticParameterAlreadyHasValue,"The static parameter '%s' has already been given a value"
12311232
3084,etMultipleStaticParameterWithName,"Multiple static parameters exist with name '%s'"
@@ -1332,3 +1333,5 @@ descriptionUnavailable,"(description unavailable...)"
13321333
3178,tcIllegalStructTypeForConstantExpression,"This is not valid literal expression. The [<Literal>] attribute will be ignored."
13331334
3179,fscSystemRuntimeInteropServicesIsRequired,"System.Runtime.InteropServices assembly is required to use UnknownWrapper\DispatchWrapper classes."
13341335
3180,abImplicitHeapAllocation,"The mutable local '%s' is implicitly allocated as a reference cell because it has been captured by a closure. This warning is for informational purposes only to indicate where implicit allocations are performed."
1336+
estApplyStaticArgumentsForMethodNotImplemented,"A type provider implemented GetStaticParametersForMethod, but ApplyStaticArgumentsForMethod was not implemented or invalid"
1337+
3181,etErrorApplyingStaticArgumentsToMethod,"An error occured applying the static arguments to a provided method"

‎src/fsharp/FSharp.Core.Unittests/SurfaceArea.4.0.fs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,8 @@ Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.String Namespa
919919
Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.String get_NamespaceName()
920920
Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.Type ResolveTypeName(System.String)
921921
Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.Type[] GetTypes()
922+
Microsoft.FSharp.Core.CompilerServices.ITypeProvider2: System.Reflection.MethodBase ApplyStaticArgumentsForMethod(System.Reflection.MethodBase, System.String, System.Object[])
923+
Microsoft.FSharp.Core.CompilerServices.ITypeProvider2: System.Reflection.ParameterInfo[] GetStaticParametersForMethod(System.Reflection.MethodBase)
922924
Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Byte[] GetGeneratedAssemblyContents(System.Reflection.Assembly)
923925
Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace[] GetNamespaces()
924926
Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Microsoft.FSharp.Quotations.FSharpExpr GetInvokerExpression(System.Reflection.MethodBase, Microsoft.FSharp.Quotations.FSharpExpr[])

‎src/fsharp/FSharp.Core.Unittests/SurfaceArea.Portable.fs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,8 @@ Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.String Namespa
912912
Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.String get_NamespaceName()
913913
Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.Type ResolveTypeName(System.String)
914914
Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.Type[] GetTypes()
915+
Microsoft.FSharp.Core.CompilerServices.ITypeProvider2: System.Reflection.MethodBase ApplyStaticArgumentsForMethod(System.Reflection.MethodBase, System.String, System.Object[])
916+
Microsoft.FSharp.Core.CompilerServices.ITypeProvider2: System.Reflection.ParameterInfo[] GetStaticParametersForMethod(System.Reflection.MethodBase)
915917
Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Byte[] GetGeneratedAssemblyContents(System.Reflection.Assembly)
916918
Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace[] GetNamespaces()
917919
Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Microsoft.FSharp.Quotations.FSharpExpr GetInvokerExpression(System.Reflection.MethodBase, Microsoft.FSharp.Quotations.FSharpExpr[])

‎src/fsharp/FSharp.Core/fslib-extra-pervasives.fs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ namespace Microsoft.FSharp.Core.CompilerServices
298298
abstractGetTypes :unit->Type[]
299299
abstractResolveTypeName : typeName:string->Type
300300

301+
301302
typeITypeProvider=
302303
inherit System.IDisposable
303304
abstractGetNamespaces :unit->IProvidedNamespace[]
@@ -314,4 +315,8 @@ namespace Microsoft.FSharp.Core.CompilerServices
314315
abstractGetParameterCustomAttributesData : assembly:System.Reflection.ParameterInfo->System.Collections.Generic.IList<IProvidedCustomAttributeData>
315316
#endif
316317

318+
typeITypeProvider2=
319+
abstractGetStaticParametersForMethod : methodWithoutArguments:MethodBase->ParameterInfo[]
320+
abstractApplyStaticArgumentsForMethod : methodWithoutArguments:MethodBase* methodNameWithArguments:string* staticArguments:obj[]->MethodBase
321+
317322
#endif

‎src/fsharp/FSharp.Core/fslib-extra-pervasives.fsi‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ namespace Microsoft.FSharp.Core.CompilerServices
261261
#endif
262262

263263

264+
///<summary>
265+
///Represents a namespace provided by a type provider component.
266+
///</summary>
264267
type IProvidedNamespace=
265268
///Namespace name the provider injects types into.
266269
abstract NamespaceName:string
@@ -282,6 +285,9 @@ namespace Microsoft.FSharp.Core.CompilerServices
282285
///<returns></returns>
283286
abstract ResolveTypeName:typeName:string->Type
284287

288+
///<summary>
289+
///Represents an instantiation of a type provider component.
290+
///</summary>
285291
type ITypeProvider=
286292
inherit System.IDisposable
287293

@@ -331,4 +337,25 @@ namespace Microsoft.FSharp.Core.CompilerServices
331337
abstract GetParameterCustomAttributesData:assembly:System.Reflection.ParameterInfo->System.Collections.Generic.IList<IProvidedCustomAttributeData>
332338
#endif
333339

340+
///Represents additional,optional information for a type provider component
341+
type ITypeProvider2=
342+
343+
///<summary>
344+
///Get the static parameters for a provided method.
345+
///</summary>
346+
///<param name="methodWithoutArguments">A method returned by GetMethod on a provided type</param>
347+
///<returns>The static parameters of the provided method,if any</returns>
348+
349+
abstract GetStaticParametersForMethod:methodWithoutArguments:MethodBase->ParameterInfo[]
350+
351+
///<summary>
352+
///Apply static arguments to a provided method that accepts static arguments.
353+
///</summary>
354+
///<remarks>The provider must return a provided method with the given mangled name.</remarks>
355+
///<param name="methodWithoutArguments">the provided method definition which has static parameters</param>
356+
///<param name="methodNameWithArguments">the full name of the method that must be returned,including encoded representations of static parameters</param>
357+
///<param name="staticArguments">the values of the static parameters,indexed by name</param>
358+
///<returns>The provided method definition corresponding to the given static parameter values</returns>
359+
abstract ApplyStaticArgumentsForMethod:methodWithoutArguments:MethodBase*methodNameWithArguments:string*staticArguments:obj[]->MethodBase
360+
334361
#endif

‎src/fsharp/est.fs‎

Lines changed: 84 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,45 @@ module internal ExtensionTyping =
728728
static memberTaintedEquals(pt1:Tainted<ProvidedMethodBase>,pt2:Tainted<ProvidedMethodBase>)=
729729
Tainted.EqTainted(pt1.PApplyNoFailure(fun st-> st.Handle))(pt2.PApplyNoFailure(fun st-> st.Handle))
730730

731+
member__.GetStaticParametersForMethod(provider:ITypeProvider)=
732+
letbindingFlags= BindingFlags.Instance||| BindingFlags.NonPublic||| BindingFlags.Public
733+
734+
letstaticParams=
735+
match providerwith
736+
|:? ITypeProvider2as itp2->
737+
itp2.GetStaticParametersForMethod(x)
738+
|_->
739+
// To allow a type provider to depend only on FSharp.Core 4.3.0.0, it can alternatively implement an appropriate method called GetStaticParametersForMethod
740+
letmeth= provider.GetType().GetMethod("GetStaticParametersForMethod", bindingFlags,null,[| typeof<MethodBase>|],null)
741+
if isNull meththen[||]else
742+
letparamsAsObj= meth.Invoke(provider, bindingFlags||| BindingFlags.InvokeMethod,null,[| box x|],null)
743+
paramsAsObj:?> ParameterInfo[]
744+
745+
staticParams|> ProvidedParameterInfo.CreateArray ctxt
746+
747+
member__.ApplyStaticArgumentsForMethod(provider:ITypeProvider,fullNameAfterArguments:string,staticArgs:obj[])=
748+
letbindingFlags= BindingFlags.Instance||| BindingFlags.Public||| BindingFlags.InvokeMethod
749+
750+
letmb=
751+
match providerwith
752+
|:? ITypeProvider2as itp2->
753+
itp2.ApplyStaticArgumentsForMethod(x, fullNameAfterArguments, staticArgs)
754+
|_->
755+
// To allow a type provider to depend only on FSharp.Core 4.3.0.0, it can alternatively implement a method called GetStaticParametersForMethod
756+
letmeth= provider.GetType().GetMethod("ApplyStaticArgumentsForMethod", bindingFlags,null,[| typeof<MethodBase>; typeof<string>; typeof<obj[]>|],null)
757+
match methwith
758+
|null-> failwith(FSComp.SR.estApplyStaticArgumentsForMethodNotImplemented())
759+
|_->
760+
letmbAsObj= meth.Invoke(provider, bindingFlags||| BindingFlags.InvokeMethod,null,[| box x; box fullNameAfterArguments; box staticArgs|],null)
761+
match mbAsObjwith
762+
|:? MethodBaseas mb-> mb
763+
|_-> failwith(FSComp.SR.estApplyStaticArgumentsForMethodNotImplemented())
764+
match mbwith
765+
|:? MethodInfoas mi->(mi|> ProvidedMethodInfo.Create ctxt: ProvidedMethodInfo):> ProvidedMethodBase
766+
|:? ConstructorInfoas ci->(ci|> ProvidedConstructorInfo.Create ctxt: ProvidedConstructorInfo):> ProvidedMethodBase
767+
|_-> failwith(FSComp.SR.estApplyStaticArgumentsForMethodNotImplemented())
768+
769+
731770
and [<AllowNullLiteral; Sealed>]
732771
ProvidedFieldInfo(x:System.Reflection.FieldInfo,ctxt)=
733772
inherit ProvidedMemberInfo(x,ctxt)
@@ -749,12 +788,16 @@ module internal ExtensionTyping =
749788
override__.Equals y=assertfalse;match ywith:? ProvidedFieldInfoas y-> x.Equals y.Handle|_->false
750789
override__.GetHashCode()=assertfalse; x.GetHashCode()
751790

791+
792+
752793
and [<AllowNullLiteral; Sealed>]
753794
ProvidedMethodInfo(x:System.Reflection.MethodInfo,ctxt)=
754795
inherit ProvidedMethodBase(x,ctxt)
755-
/// MethodInfo.ReturnType cannot be null
796+
756797
member__.ReturnType= x.ReturnType|> ProvidedType.CreateWithNullCheck ctxt"ReturnType"
798+
757799
static memberCreate ctxt x=match xwithnull->null| t-> ProvidedMethodInfo(t,ctxt)
800+
758801
static memberCreateArray ctxt xs=match xswithnull->null|_-> xs|> Array.map(ProvidedMethodInfo.Create ctxt)
759802
member__.Handle= x
760803
member__.MetadataToken= x.MetadataToken
@@ -1120,7 +1163,7 @@ module internal ExtensionTyping =
11201163
| None->
11211164
errorR(Error(FSComp.SR.etUnsupportedMemberKind(memberName,fullName),m))
11221165

1123-
letValidateProvidedTypeDefinition(m,st:Tainted<ProvidedType>,expectedPath:string[],expectedName:string)=
1166+
letValidateProvidedTypeDefinition(m,st:Tainted<ProvidedType>,expectedPath:string[],expectedName:string)=
11241167

11251168
// Validate the Name, Namespace and FullName properties
11261169
letname= CheckAndComputeProvidedNameProperty(m, st,(fun st-> st.Name),"Name")
@@ -1208,8 +1251,44 @@ module internal ExtensionTyping =
12081251

12091252
encContrib st, nameContrib st
12101253

1254+
letComputeMangledNameForApplyStaticParameters(nm,staticArgs,staticParams:Tainted<ProvidedParameterInfo[]>,m)=
1255+
letdefaultArgValues=
1256+
staticParams.PApply((fun ps-> ps|> Array.map(fun sp-> sp.Name,(if sp.IsOptionalthen Some(string sp.RawDefaultValue)else None))),range=m)
1257+
1258+
letdefaultArgValues= defaultArgValues.PUntaint(id,m)
1259+
1260+
letnonDefaultArgs=
1261+
(staticArgs,defaultArgValues)
1262+
||> Array.zip
1263+
|> Array.choose(fun(staticArg,(defaultArgName,defaultArgValue))->
1264+
letactualArgValue= string staticArg
1265+
match defaultArgValuewith
1266+
| Some vwhen v= actualArgValue-> None
1267+
|_-> Some(defaultArgName, actualArgValue))
1268+
PrettyNaming.mangleProvidedTypeName(nm, nonDefaultArgs)
1269+
1270+
/// Apply the given provided method to the given static arguments (the arguments are assumed to have been sorted into application order)
1271+
letTryApplyProvidedMethod(methBeforeArgs:Tainted<ProvidedMethodBase>,staticArgs:obj[],m:range)=
1272+
if staticArgs.Length=0then
1273+
Some methBeforeArgs
1274+
else
1275+
letmangledName=
1276+
letnm= methBeforeArgs.PUntaint((fun x-> x.Name),m)
1277+
letstaticParams= methBeforeArgs.PApplyWithProvider((fun(mb,resolver)-> mb.GetStaticParametersForMethod(resolver)),range=m)
1278+
letmangledName= ComputeMangledNameForApplyStaticParameters(nm, staticArgs, staticParams, m)
1279+
mangledName
1280+
1281+
match methBeforeArgs.PApplyWithProvider((fun(mb,provider)-> mb.ApplyStaticArgumentsForMethod(provider, mangledName, staticArgs)),range=m)with
1282+
| Tainted.Null-> None
1283+
| methWithArguments->
1284+
letactualName= methWithArguments.PUntaint((fun x-> x.Name),m)
1285+
if actualName<> mangledNamethen
1286+
error(Error(FSComp.SR.etProvidedAppliedMethodHadWrongName(methWithArguments.TypeProviderDesignation, mangledName, actualName),m))
1287+
Some methWithArguments
1288+
1289+
12111290
/// Apply the given provided type to the given static arguments (the arguments are assumed to have been sorted into application order
1212-
letTryApplyProvidedType(typeBeforeArguments:Tainted<ProvidedType>,(optGeneratedTypePath:string list option),staticArgs:obj[],m:range)=
1291+
letTryApplyProvidedType(typeBeforeArguments:Tainted<ProvidedType>,optGeneratedTypePath:string list option,staticArgs:obj[],m:range)=
12131292
if staticArgs.Length=0then
12141293
Some(typeBeforeArguments,(fun()->()))
12151294
else
@@ -1222,21 +1301,8 @@ module internal ExtensionTyping =
12221301
// Otherwise, use the full path of the erased type, including mangled arguments
12231302
letnm= typeBeforeArguments.PUntaint((fun x-> x.Name),m)
12241303
letenc,_= ILPathToProvidedType(typeBeforeArguments,m)
1225-
letdefaultArgValues=
1226-
typeBeforeArguments.PApplyWithProvider((fun(typeBeforeArguments,resolver)->
1227-
typeBeforeArguments.GetStaticParameters(resolver)
1228-
|> Array.map(fun sp-> sp.Name,(if sp.IsOptionalthen Some(string sp.RawDefaultValue)else None))),range=m)
1229-
letdefaultArgValues= defaultArgValues.PUntaint(id,m)
1230-
1231-
letnonDefaultArgs=
1232-
(staticArgs,defaultArgValues)
1233-
||> Array.zip
1234-
|> Array.choose(fun(staticArg,(defaultArgName,defaultArgValue))->
1235-
letactualArgValue= string staticArg
1236-
match defaultArgValuewith
1237-
| Some vwhen v= actualArgValue-> None
1238-
|_-> Some(defaultArgName, actualArgValue))
1239-
letmangledName= PrettyNaming.mangleProvidedTypeName(nm, nonDefaultArgs)
1304+
letstaticParams= typeBeforeArguments.PApplyWithProvider((fun(mb,resolver)-> mb.GetStaticParameters(resolver)),range=m)
1305+
letmangledName= ComputeMangledNameForApplyStaticParameters(nm, staticArgs, staticParams, m)
12401306
enc@[ mangledName]
12411307

12421308
match typeBeforeArguments.PApplyWithProvider((fun(typeBeforeArguments,provider)-> typeBeforeArguments.ApplyStaticArguments(provider, Array.ofList fullTypePathAfterArguments, staticArgs)),range=m)with

‎src/fsharp/est.fsi‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ module internal ExtensionTyping =
209209
memberIsConstructor:bool
210210
memberGetParameters:unit->ProvidedParameterInfo[]
211211
memberGetGenericArguments:unit->ProvidedType[]
212+
memberGetStaticParametersForMethod:ITypeProvider->ProvidedParameterInfo[]
212213
static memberTaintedGetHashCode:Tainted<ProvidedMethodBase>->int
213214
static memberTaintedEquals:Tainted<ProvidedMethodBase>* Tainted<ProvidedMethodBase>-> bool
214215

@@ -359,6 +360,9 @@ module internal ExtensionTyping =
359360
/// after other checks are made).
360361
val TryApplyProvidedType: typeBeforeArguments:Tainted<ProvidedType>* optGeneratedTypePath: string list option* staticArgs:obj[]* range->(Tainted<ProvidedType>*(unit-> unit)) option
361362

363+
/// Try to apply a provided method to the given static arguments.
364+
val TryApplyProvidedMethod: methBeforeArguments:Tainted<ProvidedMethodBase>* staticArgs:obj[]* range-> Tainted<ProvidedMethodBase> option
365+
362366
/// Try to resolve a type in the given extension type resolver
363367
val TryResolveProvidedType: ResolutionEnvironment* Tainted<ITypeProvider>* range* string[]* typeName: string-> Tainted<ProvidedType> option
364368

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp