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

Add CustomAttributes on fields #335

Closed thinkbeforecoding closed 4 years ago

thinkbeforecoding commented 4 years ago

There was no way to add custom attributes on ProvidedFields yet. It was required to add XmlEnum attribute on generated Enum fields for the WsdlProvider.

The change is minor (adding the AddCustomAttribute method), and test have been added.

thinkbeforecoding commented 4 years ago

The build is failing during dotnet-setup... I don't know what has changed there... ... after a few tests, I used the @v1 tag, and it's working 👍

sergey-tihon commented 4 years ago

he build is failing during dotnet-setup... I don't know what has changed there...

looks like temporary issue, after re-run all builds passed

thinkbeforecoding commented 4 years ago

I actually had to change actions/set-dotnet to @v1 to make it run. Seems the specific commit that was used previously doesn't work anymore.

thinkbeforecoding commented 4 years ago

This is actually a very small PR since almost everything was already in place. @dsyme , is it possible to merge it soon, since it's needed for the WsdlProvider (it starts to work very well by the way 😄)

thinkbeforecoding commented 4 years ago

This PR also includes a fix for #333 The TypeBuilder used to build Generic/Array/Pointer types was generating SymbolTypes even when both the GenericDef and the type parameter were classic .net types. This caused a problem when checking Type equality. The change now use typedef.MakeGenericType(args) to generate a classic .net type.

thinkbeforecoding commented 4 years ago

@sergey-tihon , @dsyme is it possible to merge this PR ? Is there more work to do on this ?

sergey-tihon commented 4 years ago

@cartermp can we merge this?

deneuxj commented 4 years ago

This appears to break my project, which uses generative type providers.

The not so useful error: https://github.com/deneuxj/SturmovikMission/runs/647494055?check_suite_focus=true#step:5:70

Building with 41b91efaaaebe2782472b283c0c716cbcb0bbe75 instead works.