Skip to content

GetUnionCases fails on an option of provided type #336

Description

@kerams

Description

The following snippet causes an error message box to appear in the VS instance that consumes the type provider.

let typ = ProvidedTypeDefinition ("Blah", Some typeof<obj>)
let optionTyp = ProvidedTypeBuilder.MakeGenericType (typedefof<_ option>, [ typ ])
let cases = FSharp.Reflection.FSharpType.GetUnionCases optionTyp

Expected behavior

Expecting the function call so succeed and return 2 cases.

Actual behavior

A design time error message with The operation 'GetNestedType' on item 'FSharpOption``1' should not be called on provided type, member or parameter of type 'ProviderImplementation.ProvidedTypes.TypeSymbol' and a stack trace.

Is there any workaround for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions