Skip to content

Commit

Permalink
added type provider designation to provided context
Browse files Browse the repository at this point in the history
  • Loading branch information
DedSec256 committed May 3, 2020
1 parent 9fd0fa2 commit 11c8086
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/fsharp/ExtensionTyping.fs
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ module ExtensionTyping =
compilerToolPaths,
m)

Tainted<_>.CreateAll (providers |> List.map (fun p -> p, ilScopeRefOfRuntimeAssembly))
Tainted<_>.CreateAll (providers |> List.map (fun p -> p, ilScopeRefOfRuntimeAssembly, ExtensionTypingProvider.DisplayNameOfTypeProvider(p)))

/// Get the provided invoker expression for a particular use of a method.
let GetInvokerExpression (provider: ITypeProvider, methodBase: ProvidedMethodBase, paramExprs: ProvidedVar[]) =
Expand Down
10 changes: 5 additions & 5 deletions src/fsharp/tainted.fs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type TypeProviderError
for msg in errors do
f (new TypeProviderError(errNum, tpDesignation, m, [msg], typeNameContext, methodNameContext))

type TaintedContext = { TypeProvider : ITypeProvider; TypeProviderAssemblyRef : ILScopeRef }
type TaintedContext = { TypeProvider : ITypeProvider; TypeProviderAssemblyRef : ILScopeRef; TypeProviderDesignation: string }

[<NoEquality>][<NoComparison>]
type Tainted<'T> (context : TaintedContext, value : 'T) =
Expand All @@ -81,7 +81,7 @@ type Tainted<'T> (context : TaintedContext, value : 'T) =
| _ -> ()

member this.TypeProviderDesignation =
context.TypeProvider.GetType().FullName
context.TypeProviderDesignation

member this.TypeProviderAssemblyRef =
context.TypeProviderAssemblyRef
Expand Down Expand Up @@ -141,9 +141,9 @@ type Tainted<'T> (context : TaintedContext, value : 'T) =
/// Access the target object directly. Use with extreme caution.
member this.AccessObjectDirectly = value

static member CreateAll(providerSpecs : (ITypeProvider * ILScopeRef) list) =
[for (tp,nm) in providerSpecs do
yield Tainted<_>({ TypeProvider=tp; TypeProviderAssemblyRef=nm },tp) ]
static member CreateAll(providerSpecs : (ITypeProvider * ILScopeRef * string) list) =
[for (tp,nm, tpd) in providerSpecs do
yield Tainted<_>({ TypeProvider = tp; TypeProviderAssemblyRef = nm; TypeProviderDesignation = tpd },tp) ]

member this.OfType<'U> () =
match box value with
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/tainted.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type TypeProviderError =
type Tainted<'T> =

/// Create an initial tainted value
static member CreateAll : (ITypeProvider * ILScopeRef) list -> Tainted<ITypeProvider> list
static member CreateAll : (ITypeProvider * ILScopeRef * string) list -> Tainted<ITypeProvider> list

/// A type provider that produced the value
member TypeProvider : Tainted<ITypeProvider>
Expand Down

0 comments on commit 11c8086

Please sign in to comment.