-
Notifications
You must be signed in to change notification settings - Fork 94
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
Generate type provider fails to create custom operation for computation expression #386
Labels
Comments
This is not currently supported by the F# tooling. In particular From let TryBindMethInfoAttribute g (m: range) (AttribInfo(atref, _) as attribSpec) minfo f1 f2 f3 =
#if NO_TYPEPROVIDERS
// to prevent unused parameter warning
ignore f3
#endif
BindMethInfoAttributes m minfo
(fun ilAttribs -> TryDecodeILAttribute atref ilAttribs |> Option.bind f1)
(fun fsAttribs -> TryFindFSharpAttribute g attribSpec fsAttribs |> Option.bind f2)
#if !NO_TYPEPROVIDERS
(fun provAttribs ->
match provAttribs.PUntaint((fun a -> a.GetAttributeConstructorArgs(provAttribs.TypeProvider.PUntaintNoFailure(id), atref.FullName)), m) with
| Some args -> f3 args
| None -> None)
#else
(fun _provAttribs -> None) |
If you'd like to help address this problem, please submit a PR to dotnet/fsharp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Using a generative type provider fails to create a computation expression builder with a custom operation. The compiler fails to recognise the method as a custom operation.
Note that the IL appears to be practically equivalent for the generated type and the manually created builder (that does compile successfully).
Repro steps
See the repo ProvidedCustomOperation for a minimal reproduction. Key snippets below:
The generative type provider that creates a computation expression builder with a custom operation defined.
The equivalent builder:
Expected behavior
The computation expression compiles successfully:
Actual behavior
Compilation error:
Related information
The text was updated successfully, but these errors were encountered: