fsprojects / FSharp.TypeProviders.SDK

The SDK for creating F# type providers
https://fsprojects.github.io/FSharp.TypeProviders.SDK/
MIT License
298 stars 94 forks source link

Fix typeconversion #332

Closed thinkbeforecoding closed 4 years ago

thinkbeforecoding commented 4 years ago

This one is based on previous PR It is needed to make the WsdlProvider work.

There was a problem when generating the Async methods calls because the Task was generated in con convtype using typedef.MakeGenericType(args)... making it a TypeBuilderImplementation Instance that failed on IsAssignableFrom

It should actually be a TypeSymbol2 but the function is at the beginning of the Provided.fs file where this type is not defined yet.

So I introduced a ITypeBuilder interface that enables building GenericTypes, arrays etc that is implemented at the ProvidedTypeBuilder level and passed to previous functions to enable recursive generation

Once done, it works 👍