Closed 7sharp9 closed 6 years ago
Anyone have any comments on this or the #222 issue?
This file should really be source included into the test projects, not the type provider project. The problem is that GetInvokeCode()
is internal
But agree this will do for now
@dsyme The problem is circular dependencies, you can only really add providedtypes.fs to one project.
if you need something from providedtypes.fs
from an assembly that differs from where you are generating provided types and methods then you get into a situation where you would have to source include in two projects, you now have a new issue that the types are not interchangeable: type ProvidedType is not assignable to ProvidedType etc because there are the same types in difference assemblies.
Im using provided types to generate provided types in one assembly, and to test provided types from a test assembly.
Im also using provided types with an alternative backend to produce source code rather than injected IL. But the first scenario still required access to an internal.
Either use InternalsVisibleTo, or do your testing via the System.Type API?
Which internals do you need access to? I removed the use of internals by ProvidedTypesTesting.fs
Only ProvidedTypesTesting.Testing.MakeSimulatedTypeProviderConfig
which was internal.
Im instantiating the type provider via an instance of that configuration, then iterating over the provided types (I have created a ProvidedRecord) and methods, extracting the quotations and reassembling them into an untyped ast before reconstituting them into generated .fs
files.
Addresses #222