-
Notifications
You must be signed in to change notification settings - Fork 94
Unable to generate obsolete methods from generative TP #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you check if the generative DLL is produced correctly by the type provider? Or find the exception stacktrace? The bug could be in codegen in this repo, or perhaps the F# compiler. May require a bit of type provider debugging work to grab the dll from temp storage. |
Exception occurs on this line https://github.com/fsprojects/FSharp.TypeProviders.StarterPack/blob/master/src/ProvidedTypes.fs#L1841 StackTrace:
Seems like we are trying to call wrong Sooo, probably here typeof<System.ObsoleteAttribute>.GetConstructors()
|> Array.find (fun x -> x.GetParameters().Length = 2) instead of typeof<System.ObsoleteAttribute>.GetConstructors()
|> Array.find (fun x -> x.GetParameters().Length = 1) because member __.ConstructorArguments =
upcast [|CustomAttributeTypedArgument(typeof<string>, message) ;
CustomAttributeTypedArgument(typeof<bool>, isError) |] |
Seems that generative TP cannot produce methods with
Obsolete
attributeHere is the simple generative type provider that provide single static method
If I execute simple usage script
I receive output as expected
But If I uncomment line
m.AddObsoleteAttribute("Deprecated", false)
and execute the same script I receive//cc @dsyme @dmitry-a-morozov @mavnn @ovatsus @pezipink
The text was updated successfully, but these errors were encountered: